Skip to content

Commit

Permalink
fix: Arbeidsgiver HarArbeidsgiver V må være satt
Browse files Browse the repository at this point in the history
  • Loading branch information
helehar committed Apr 17, 2024
1 parent 1a33712 commit 155fc4f
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
38 changes: 38 additions & 0 deletions src/main/kotlin/no/nav/syfo/handlestatus/HandleStatusInvalid.kt
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,44 @@ fun handleBehandletDatoMangler(
)
}

fun handleArbeidsgiverUgyldigVerdi(
loggingMeta: LoggingMeta,
fellesformat: XMLEIFellesformat,
ediLoggId: String,
msgId: String,
msgHead: XMLMsgHead,
env: EnvironmentVariables,
kafkaproducerApprec: KafkaProducer<String, Apprec>,
duplicationService: DuplicationService,
duplicateCheck: DuplicateCheck,
) {
logger.warn(
"Sykmeldingen er avvist fordi arbeidsgiver verdi mangler {} {}",
fields(loggingMeta),
keyValue("avvistAv", env.applicationName),
)

val apprec =
fellesformatToAppprec(
fellesformat,
"Sykmeldingen kan ikke rettes, det må skrives en ny." +
"Pasienten har ikke fått beskjed, men venter på ny sykmelding fra deg. Grunnet følgende:" +
"Arbeidsgiver HarArbeidsgiver V mangler i sykmeldingen. Kontakt din EPJ-leverandør",
ediLoggId,
msgId,
msgHead,
)

sendApprec(
apprec,
env,
kafkaproducerApprec,
loggingMeta,
duplicationService,
duplicateCheck,
)
}

fun handleVedleggOver300MB(
loggingMeta: LoggingMeta,
fellesformat: XMLEIFellesformat,
Expand Down
15 changes: 15 additions & 0 deletions src/main/kotlin/no/nav/syfo/util/CheckSM2013Content.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import no.nav.syfo.apprec.Apprec
import no.nav.syfo.duplicationcheck.model.DuplicateCheck
import no.nav.syfo.handlestatus.handleAktivitetOrPeriodeIsMissing
import no.nav.syfo.handlestatus.handleAnnenFraversArsakkodeVIsmissing
import no.nav.syfo.handlestatus.handleArbeidsgiverUgyldigVerdi
import no.nav.syfo.handlestatus.handleArbeidsplassenArsakskodeHarUgyldigVerdi
import no.nav.syfo.handlestatus.handleArbeidsplassenArsakskodeIsmissing
import no.nav.syfo.handlestatus.handleBehandletDatoMangler
Expand Down Expand Up @@ -318,6 +319,20 @@ fun checkSM2013Content(
)
return true
}
if (arbeidsgiverUgydlgiVerdi(healthInformation)) {
handleArbeidsgiverUgyldigVerdi(
loggingMeta,
fellesformat,
ediLoggId,
msgId,
msgHead,
env,
kafkaproducerApprec,
duplicationService,
duplicateCheck,
)
return true
}

return false
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,3 +119,7 @@ fun periodetypeIkkeAngitt(aktivitet: HelseOpplysningerArbeidsuforhet.Aktivitet):
fun behandletDatoMangler(healthInformation: HelseOpplysningerArbeidsuforhet): Boolean {
return healthInformation.kontaktMedPasient.behandletDato == null
}

fun arbeidsgiverUgydlgiVerdi(healthInformation: HelseOpplysningerArbeidsuforhet): Boolean {
return healthInformation.arbeidsgiver.harArbeidsgiver.v.isNullOrEmpty()
}

0 comments on commit 155fc4f

Please sign in to comment.