-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IS-2114: Send arbeidsuforhet forhandsvarsel to docdist
- Loading branch information
1 parent
57f66d9
commit 74123ee
Showing
9 changed files
with
101 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/main/kotlin/no/nav/syfo/service/ArbeidsuforhetForhandsvarselService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package no.nav.syfo.service | ||
|
||
import no.nav.syfo.consumer.distribuerjournalpost.DistibusjonsType | ||
import no.nav.syfo.kafka.consumers.varselbus.domain.ArbeidstakerHendelse | ||
import no.nav.syfo.utils.dataToVarselData | ||
import org.slf4j.LoggerFactory | ||
|
||
class ArbeidsuforhetForhandsvarselService( | ||
private val senderFacade: SenderFacade, | ||
private val isSendingEnabled: Boolean, | ||
) { | ||
suspend fun sendVarselTilArbeidstaker(varselHendelse: ArbeidstakerHendelse) { | ||
if (isSendingEnabled) { | ||
log.info("[ARBEIDSUFORHET_FORHAANDSVARSEL] sending enabled") | ||
val data = dataToVarselData(varselHendelse.data) | ||
requireNotNull(data.journalpost) | ||
requireNotNull(data.journalpost.id) | ||
|
||
log.info("Sending [ARBEIDSUFORHET_FORHAANDSVARSEL] to print") | ||
senderFacade.sendBrevTilFysiskPrint( | ||
data.journalpost.uuid, | ||
varselHendelse, | ||
data.journalpost.id, | ||
DistibusjonsType.VIKTIG, | ||
) | ||
} | ||
} | ||
|
||
companion object { | ||
private val log = LoggerFactory.getLogger(ArbeidsuforhetForhandsvarselService::class.qualifiedName) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters