Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore/send #357

Merged
merged 107 commits into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
f9de307
Added client for helsenett
heinharaldsen Oct 31, 2024
328606c
Removed Bearer string
heinharaldsen Nov 1, 2024
eab276d
Added config for helsenettClient
heinharaldsen Nov 1, 2024
41d44f0
chore: add sykmelder/hprNummer functionality
helehar Nov 7, 2024
47d63e8
fix: make helsenetttoken m2m
helehar Nov 8, 2024
6f1a542
fix: back to obo token
helehar Nov 8, 2024
9d369be
wip
helehar Nov 7, 2024
3c77296
wip
helehar Nov 11, 2024
f7b2913
fix: regelclient wip
helehar Nov 13, 2024
dc447dc
more wip in handlepapirsykmelding
helehar Nov 18, 2024
f0769c5
wipwipwip
helehar Nov 18, 2024
2baf750
wiiip
helehar Nov 19, 2024
f248861
chore: fixed class naming
jaflaten Nov 20, 2024
2eb19d8
chore: fixing some wip
jaflaten Nov 20, 2024
76f2e0e
wip
helehar Nov 20, 2024
65093e3
chore: begin storing in db and sending to kafka
helehar Nov 20, 2024
3f12243
chore: removing duplicate code and refactoring
jaflaten Nov 21, 2024
056b54c
chore: update oppgave
jaflaten Nov 21, 2024
6ee09ec
chore: fix tests and try to fix build
helehar Nov 21, 2024
1db55c6
chore: fixed test failure
jaflaten Nov 21, 2024
916b897
chore: updated helsenett config
jaflaten Nov 21, 2024
3bf1905
chore: removed helsenettRT bean
jaflaten Nov 21, 2024
2503f58
fix: access to nasjonal oppgave
helehar Nov 21, 2024
29eb816
fix: smtss m2m token
helehar Nov 21, 2024
dc3c0a0
fix: smtss.url
helehar Nov 21, 2024
2c77403
fix: build
helehar Nov 21, 2024
66ed15a
fix: rege.url
helehar Nov 21, 2024
7cf5caa
fix: regel
helehar Nov 21, 2024
8a03293
fix: fix
helehar Nov 21, 2024
d03583b
chore: log recievedsykmelding
helehar Nov 21, 2024
4b6e782
chore: logging dao
helehar Nov 22, 2024
a87e64f
chore: log
helehar Nov 22, 2024
4cf9d28
chore: objectmapper
helehar Nov 22, 2024
ef8346c
chore: map to sykmelding
helehar Nov 22, 2024
0157750
chore: write date das timestamps
helehar Nov 22, 2024
fa94eba
adding JdbcTypeCode annotation for sykmelding object serialization
jaflaten Nov 22, 2024
21e655a
chore: debug logging for sql query generation
jaflaten Nov 23, 2024
7bc7233
chore: added failing save nasjonalSykmeldingTest
jaflaten Nov 23, 2024
42417c2
chore: added custom converter for sykmelding and OffsetDateTime to fi…
jaflaten Nov 23, 2024
90c1bfa
feat: added avvisning functionality
jaflaten Nov 25, 2024
d283117
chore: removed param for nav epost in controller
jaflaten Nov 25, 2024
f24585b
chore: fixed cyclic depedency after refactor
jaflaten Nov 25, 2024
ee5de0d
chore: refactoring and ferdistilling avvist in dokarkiv
jaflaten Nov 26, 2024
32895b4
Update src/main/kotlin/no/nav/sykdig/digitalisering/dokarkiv/Dokarkiv…
jaflaten Nov 27, 2024
6d26f2c
chore: trying to fix test
jaflaten Nov 28, 2024
4372b96
chore: added navIdent to claim in test
jaflaten Nov 28, 2024
a4e455d
chore: added mock for OppgaveSecService
jaflaten Nov 28, 2024
3dffc96
chore: changing port for mock server
jaflaten Nov 28, 2024
2571d69
chore: adding logging
jaflaten Nov 28, 2024
87b41b0
chore: using getNavEmail instead of getNavIdent
jaflaten Nov 29, 2024
f2ef2d6
Added different titles to opprettOgLagreOppgave
heinharaldsen Nov 29, 2024
d005b2a
Fixed title function
heinharaldsen Nov 29, 2024
07051da
chore: created async version of getnavEmail and used it
jaflaten Nov 29, 2024
414b4c1
Moved the private method to bottom
heinharaldsen Nov 29, 2024
546b4cc
Some refactoring of opprettOgLagreOppgave
heinharaldsen Nov 29, 2024
b4ce4ed
chore: wrapping findby methods in withContext to use a single thread
jaflaten Nov 29, 2024
51e154e
chore: refactoring to not use optional and wrapping withContext
jaflaten Nov 29, 2024
e26c3c4
chore: fixed tests
jaflaten Nov 29, 2024
fe30817
chore: adding access check on getOppgave
jaflaten Dec 2, 2024
105dbe6
chore: logging token to verify
jaflaten Dec 2, 2024
beddf27
chore: reverting auth check on getOppgave
jaflaten Dec 2, 2024
f1f0126
chore: updating sec context token handling
jaflaten Dec 2, 2024
9da4231
chore: logging name of running thread
jaflaten Dec 2, 2024
c2aa1af
chore: reverting to blocking instead of non-blocking
jaflaten Dec 2, 2024
1d99455
chore: fixing excess param
jaflaten Dec 2, 2024
c3ae8f6
chore: getPapirSykmelding using postAuthorize
jaflaten Dec 2, 2024
fb06af1
chore: adding check in local DB before fetching oppgave frå smregistr…
jaflaten Dec 2, 2024
d071442
chore: adding list of documents in mapped papirManuellOppgave
jaflaten Dec 3, 2024
cfa8615
chore: removed double update of oppdater
jaflaten Dec 3, 2024
1373a51
chore: changing return type of avvis to papirManuellOppgave
jaflaten Dec 3, 2024
82a0eb6
chore: changing http status return type of avvist
jaflaten Dec 3, 2024
c788ac1
chore: adding check for oppgave in local db on get
jaflaten Dec 3, 2024
c05892f
chore: enable authorization on get endpoint
jaflaten Dec 3, 2024
1819dbf
chore: updating document title and ferdigstilling oppgave in oppgaveC…
jaflaten Dec 3, 2024
0b4d932
chore: remove unused auth and email
nuranes Dec 3, 2024
902f255
chore: return not found if oppgave is null
nuranes Dec 4, 2024
51475a9
chore: checking locally when fetching ferdigstilt SM
jaflaten Dec 4, 2024
33d00f7
chore: adding more logging
jaflaten Dec 4, 2024
2a58f5a
Removed magic number
heinharaldsen Dec 4, 2024
bcbec63
Replaced buidAndExpand with pathSegment
heinharaldsen Dec 4, 2024
2a5da9b
chore: ensuring that korrigerSykmelding is persisted in syk-dig DB wh…
jaflaten Dec 5, 2024
feb93a0
chore: verifying oppgaveId input to prevent server side request forgery
jaflaten Dec 5, 2024
79e8ff6
chore: removing transaction and updating avvisOppgave return type
jaflaten Dec 5, 2024
0949f7f
chore: checking for invalid oppgaveId in getOppgaveRequest
jaflaten Dec 5, 2024
59dec5a
chore: add more logging
jaflaten Dec 5, 2024
410ef1a
chore: removed debug logging
jaflaten Dec 5, 2024
824dc51
chore: updating document in dokarkiv
jaflaten Dec 5, 2024
a83ba5a
chore: using veilederIdent instead of email
jaflaten Dec 5, 2024
655232a
chore: getting ferdigstilt sykmelding locally before going to smregis…
jaflaten Dec 5, 2024
18979bc
chore: added more logging
jaflaten Dec 5, 2024
3f250c5
chore: updating db values based on user input
jaflaten Dec 5, 2024
27d413a
chore: updating db when korrigering oppgave
jaflaten Dec 5, 2024
d6196d2
chore: updating return type for korriger sykmelding
jaflaten Dec 5, 2024
9d06d15
chore: returning string in korriger sm
jaflaten Dec 5, 2024
be7d858
chore: adding new whitelisted rules and checking for ferdigstilte opp…
jaflaten Dec 6, 2024
c60902c
chore: refactored getOppgave to ensure that ferdigstilt oppgave cant …
jaflaten Dec 6, 2024
711f832
chore: fixed test
jaflaten Dec 6, 2024
d0d8452
chore: fixed tests
jaflaten Dec 6, 2024
97aec96
chore: checking if oppgave is ferdigstilt on get
jaflaten Dec 6, 2024
ec192b1
chore: returning GONE as statuscode with a message if a oppgave is fe…
jaflaten Dec 6, 2024
89959e2
chore: changed to 404
jaflaten Dec 6, 2024
32a9bf3
chore: ensuring that getFerdigstiltSykmelding is saved as ferdigstilt…
jaflaten Dec 6, 2024
54b0135
chore: added auth on korriger and get ferdigstiltSm endpoints
jaflaten Dec 6, 2024
5ec946a
chore: added method for getFerdigstiltSm and a hasAccess method
jaflaten Dec 6, 2024
b305409
chore: using the correct hasAccessTo method
jaflaten Dec 9, 2024
10a64a0
chore: adding withspan on endpoints for open telemetry
jaflaten Dec 9, 2024
1c0af2a
Merge branch 'main' into chore/send
jaflaten Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -48,16 +48,18 @@ val prometheusVersion = "0.16.0"
val mockkVersion = "1.13.10"
val kluentVersion = "1.73"
val coroutinesVersion = "1.8.1"
val coroutineReactorVersion = "1.9.0"
val hibernateVersion = "6.2.6.Final"
val jacksonDatatypeJsr310Version = "2.18.0"

val mockitoKotlinVersion = "5.4.0"
dependencies {
implementation(platform("com.netflix.graphql.dgs:graphql-dgs-platform-dependencies:$graphqlDgsPlatformDependenciesVersion"))
implementation("com.netflix.graphql.dgs:graphql-dgs-spring-boot-starter")
implementation("com.netflix.graphql.dgs:graphql-dgs-extended-scalars")
implementation("com.graphql-java:graphql-java:$graphqlVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-slf4j:$coroutinesVersion")
implementation("org.springframework.boot:spring-boot-starter-web")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor:$coroutineReactorVersion")
// implementation("org.springframework.boot:spring-boot-starter-web")
implementation("com.fasterxml.jackson.module:jackson-module-kotlin")
implementation("com.fasterxml.jackson.module:jackson-module-jaxb-annotations")
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:$jacksonDatatypeJsr310Version")
Expand Down Expand Up @@ -109,11 +111,13 @@ dependencies {
testImplementation("org.testcontainers:kafka:$testContainersVersion")
testImplementation("io.mockk:mockk:$mockkVersion")
testImplementation("org.amshove.kluent:kluent:$kluentVersion")
testImplementation("org.mockito.kotlin:mockito-kotlin:$mockitoKotlinVersion")
constraints {
testImplementation("org.apache.commons:commons-compress:$commonsCompressVersion") {
because("overstyrer sårbar dependency fra com.opentable.components:otj-pg-embedded")
}
}
testImplementation(kotlin("test"))
}

tasks {
Expand Down
14 changes: 14 additions & 0 deletions naiserator-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ spec:
- application: syfohelsenettproxy
namespace: teamsykmelding
cluster: dev-gcp
- application: smtss
namespace: teamsykmelding
cluster: dev-gcp
- application: syfosmpapirregler
namespace: teamsykmelding
cluster: dev-gcp
external:
- host: kodeverk-api.nav.no
- host: oppgave-q1.dev-fss-pub.nais.io
Expand Down Expand Up @@ -127,3 +133,11 @@ spec:
value: http://syfohelsenettproxy
- name: HELSENETT_CLIENT_ID
value: dev-gcp.teamsykmelding.syfohelsenettproxy
- name: SMTSS_URL
value: http://smtss
- name: SMTSS_CLIENT_ID
value: dev-gcp.teamsykmelding.smtss
- name: SYFOSMPAPIRREGLER_URL
value: http://syfosmpapirregler
- name: SYFOSMPAPIRREGLER_CLIENT_ID
value: dev-gcp.teamsykmelding.syfosmpapirregler
14 changes: 14 additions & 0 deletions naiserator-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ spec:
- application: syfohelsenettproxy
namespace: teamsykmelding
cluster: prod-gcp
- application: smtss
namespace: teamsykmelding
cluster: prod-gcp
- application: syfosmpapirregler
namespace: teamsykmelding
cluster: prod-gcp
external:
- host: saf.prod-fss-pub.nais.io
- host: pdl-api.prod-fss-pub.nais.io
Expand Down Expand Up @@ -124,3 +130,11 @@ spec:
value: http://syfohelsenettproxy
- name: HELSENETT_CLIENT_ID
value: prod-gcp.teamsykmelding.syfohelsenettproxy
- name: SMTSS_URL
value: http://smtss
- name: SMTSS_CLIENT_ID
value: prod-gcp.teamsykmelding.smtss
- name: SYFOSMPAPIRREGLER_URL
value: http://syfosmpapirregler
- name: SYFOSMPAPIRREGLER_CLIENT_ID
value: prod-gcp.teamsykmelding.syfosmpapirregler
8 changes: 8 additions & 0 deletions src/main/kotlin/no/nav/sykdig/Log.kt
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,11 @@ inline fun <reified T> T.securelog(): Logger {
inline fun <reified T> T.auditlog(): Logger {
return LoggerFactory.getLogger("auditLogger")
}

data class LoggingMeta(
val mottakId: String,
val journalpostId: String?,
val dokumentInfoId: String?,
val msgId: String,
val sykmeldingId: String,
)
14 changes: 14 additions & 0 deletions src/main/kotlin/no/nav/sykdig/config/M2MRestTemplate.kt
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,20 @@ class M2MRestTemplate(
.build()
}

@Bean
fun smtssM2mRestTemplate(): RestTemplate {
return restTemplateBuilder
.additionalInterceptors(bearerTokenInterceptor("smtss-m2m"))
.build()
}

@Bean
fun regeltM2mRestTemplate(): RestTemplate {
return restTemplateBuilder
.additionalInterceptors(bearerTokenInterceptor("regel-m2m"))
.build()
}

private fun bearerTokenInterceptor(type: String): ClientHttpRequestInterceptor {
return ClientHttpRequestInterceptor { request: HttpRequest, body: ByteArray, execution: ClientHttpRequestExecution ->
val token = m2mTokenService.getM2MToken(type)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import org.springframework.context.annotation.Configuration
import org.springframework.http.HttpMethod
import org.springframework.security.config.annotation.method.configuration.EnableMethodSecurity
import org.springframework.security.config.annotation.web.builders.HttpSecurity
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity
import org.springframework.security.web.SecurityFilterChain

@Configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,4 @@ class AivenKafkaConfig(
}

const val SYK_DIG_OPPGAVE_TOPIC = "teamsykmelding.syk-dig-oppgave"
const val OK_SYKMLEDING_TOPIC = "teamsykmelding.ok-sykmelding"
const val OK_SYKMELDING_TOPIC = "teamsykmelding.ok-sykmelding"
10 changes: 5 additions & 5 deletions src/main/kotlin/no/nav/sykdig/db/OppgaveRepository.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ package no.nav.sykdig.db
import com.fasterxml.jackson.module.kotlin.readValue
import no.nav.sykdig.applog
import no.nav.sykdig.digitalisering.model.RegisterOppgaveValues
import no.nav.sykdig.digitalisering.sykmelding.AktivitetIkkeMulig
import no.nav.sykdig.digitalisering.sykmelding.Diagnose
import no.nav.sykdig.digitalisering.sykmelding.Gradert
import no.nav.sykdig.digitalisering.sykmelding.MedisinskVurdering
import no.nav.sykdig.digitalisering.sykmelding.Periode
import no.nav.sykdig.digitalisering.felles.AktivitetIkkeMulig
import no.nav.sykdig.digitalisering.felles.Diagnose
import no.nav.sykdig.digitalisering.felles.Gradert
import no.nav.sykdig.digitalisering.felles.MedisinskVurdering
import no.nav.sykdig.digitalisering.felles.Periode
import no.nav.sykdig.digitalisering.sykmelding.UtenlandskSykmelding
import no.nav.sykdig.generated.types.Avvisingsgrunn
import no.nav.sykdig.generated.types.PeriodeInput
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package no.nav.sykdig.digitalisering

import no.nav.sykdig.digitalisering.pdl.toFormattedNameString
import no.nav.sykdig.digitalisering.sykmelding.Periode
import no.nav.sykdig.generated.DgsConstants.QUERY.DigitalisertSykmelding
import no.nav.sykdig.digitalisering.felles.Periode
import no.nav.sykdig.generated.types.Bostedsadresse
import no.nav.sykdig.generated.types.DiagnoseValue
import no.nav.sykdig.generated.types.Digitaliseringsoppgave
Expand Down
112 changes: 65 additions & 47 deletions src/main/kotlin/no/nav/sykdig/digitalisering/SykDigOppgaveService.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ import no.nav.sykdig.digitalisering.ferdigstilling.oppgave.OppgaveClient
import no.nav.sykdig.digitalisering.model.FerdistilltRegisterOppgaveValues
import no.nav.sykdig.digitalisering.model.RegisterOppgaveValues
import no.nav.sykdig.digitalisering.pdl.Person
import no.nav.sykdig.digitalisering.saf.graphql.DokumentInfo
import no.nav.sykdig.digitalisering.saf.graphql.SafJournalpost
import no.nav.sykdig.digitalisering.tilgangskontroll.OppgaveSecurityService
import no.nav.sykdig.digitalisering.tilgangskontroll.getNavEmail
import no.nav.sykdig.generated.types.Avvisingsgrunn
import no.nav.sykdig.model.DokumentDbModel
import no.nav.sykdig.model.OppgaveDbModel
Expand All @@ -35,59 +34,28 @@ class SykDigOppgaveService(
private val log = applog()
private val securelog = securelog()

private fun createOppgave(oppgaveId: String, fnr: String, journalpostId: String, journalpost: SafJournalpost, dokumentInfoId: String, source: String = "syk-dig"): OppgaveDbModel {
val dokumenter = journalpost.dokumenter.map {
val oppdatertTittel = if (it.tittel == "Utenlandsk sykmelding") {
"Digitalisert utenlandsk sykmelding"
} else {
it.tittel ?: "Mangler Tittel"
}
DokumentDbModel(it.dokumentInfoId, oppdatertTittel)
}

return OppgaveDbModel(
oppgaveId = oppgaveId,
fnr = fnr,
journalpostId = journalpostId,
dokumentInfoId = dokumentInfoId,
dokumenter = dokumenter,
opprettet = OffsetDateTime.now(ZoneOffset.UTC),
ferdigstilt = null,
tilbakeTilGosys = false,
avvisingsgrunn = null,
sykmeldingId = UUID.randomUUID(),
type = UTLAND,
sykmelding = null,
endretAv = getNavEmail(),
timestamp = OffsetDateTime.now(ZoneOffset.UTC),
source = source,
)
}

fun opprettOgLagreOppgave(
journalpost: SafJournalpost,
journalpostId: String,
fnr: String,
aktoerId: String,
navEpost: String,
): String {
val response =
oppgaveClient.opprettOppgave(
journalpostId = journalpostId,
aktoerId = aktoerId,
)
val opprettetOppgave = oppgaveClient.opprettOppgave(
journalpostId = journalpostId,
aktoerId = aktoerId,
)
val oppgaveId = opprettetOppgave.id.toString()

val oppgaveId = response.id.toString()
val dokumentInfoId = journalpost.dokumenter.first().dokumentInfoId
val tittel = journalpost.tittel.lowercase().contains("egenerklæring")
securelog.info("is egenarklaring: $tittel journalpostId: $journalpostId")
val oppgave = createOppgave(
val oppgave = buildOppgaveModel(
oppgaveId = oppgaveId,
fnr = fnr,
journalpostId = journalpostId,
journalpost = journalpost,
dokumentInfoId = dokumentInfoId,
source = if (journalpost.kanal == "NAV_NO" || tittel) "navno" else if (journalpost.kanal == "RINA") "rina" else "syk-dig"
journalpostId = journalpostId,
fnr = fnr,
navEpost = navEpost,
)

oppgaveRepository.lagreOppgave(oppgave)
log.info("Oppgave med id $oppgaveId lagret")
return oppgaveId
Expand Down Expand Up @@ -211,7 +179,7 @@ class SykDigOppgaveService(
) {
val sykmelding = oppgaveRepository.getLastSykmelding(oppgave.oppgaveId)
oppgaveRepository.ferdigstillAvvistOppgave(oppgave, navEpost, sykmelding, avvisningsgrunn)
ferdigstillingService.ferdigstillAvvistJournalpost(
ferdigstillingService.ferdigstillUtenlandskAvvistJournalpost(
enhet = enhetId,
oppgave = oppgave,
sykmeldt = sykmeldt,
Expand All @@ -220,7 +188,7 @@ class SykDigOppgaveService(
}

@Transactional
fun ferdigstillOppgave(
fun ferdigstillUtenlandskAvvistOppgave(
oppgave: OppgaveDbModel,
navEpost: String,
values: FerdistilltRegisterOppgaveValues,
Expand All @@ -230,7 +198,7 @@ class SykDigOppgaveService(
val sykmelding = toSykmelding(oppgave, values)

oppgaveRepository.updateOppgave(oppgave, sykmelding, navEpost, true)
ferdigstillingService.ferdigstill(
ferdigstillingService.ferdigstillUtenlandskOppgave(
enhet = enhetId,
oppgave = oppgave,
sykmeldt = sykmeldt,
Expand All @@ -247,6 +215,56 @@ class SykDigOppgaveService(
ferdigstillingService.sendUpdatedSykmelding(oppgave, sykmeldt, navEmail, values)
}

private fun buildOppgaveModel(
oppgaveId: String,
journalpost: SafJournalpost,
journalpostId: String,
fnr: String,
navEpost: String,
): OppgaveDbModel {
val dokumentInfoId = journalpost.dokumenter.first().dokumentInfoId
val dokumenter = buildDokumenter(journalpost.dokumenter)
val source = determineSource(journalpost)

return OppgaveDbModel(
oppgaveId = oppgaveId,
fnr = fnr,
journalpostId = journalpostId,
dokumentInfoId = dokumentInfoId,
dokumenter = dokumenter,
opprettet = OffsetDateTime.now(ZoneOffset.UTC),
ferdigstilt = null,
tilbakeTilGosys = false,
avvisingsgrunn = null,
sykmeldingId = UUID.randomUUID(),
type = UTLAND,
sykmelding = null,
endretAv = navEpost,
timestamp = OffsetDateTime.now(ZoneOffset.UTC),
source = source,
)
}

private fun buildDokumenter(dokumenter: List<DokumentInfo>): List<DokumentDbModel> {
return dokumenter.map {
val oppdatertTittel = if (it.tittel == "Utenlandsk sykmelding") {
"Digitalisert utenlandsk sykmelding"
} else {
it.tittel ?: "Mangler Tittel"
}
DokumentDbModel(it.dokumentInfoId, oppdatertTittel)
}
}

private fun determineSource(journalpost: SafJournalpost): String {
val isEgenerklaering = journalpost.tittel.lowercase().contains("egenerklæring")
return when {
journalpost.kanal == "NAV_NO" || isEgenerklaering -> "navno"
journalpost.kanal == "RINA" -> "rina"
else -> "syk-dig"
}
}

companion object {
private const val UTLAND = "UTLAND"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,9 @@ import no.nav.sykdig.digitalisering.model.FerdistilltRegisterOppgaveValues
import no.nav.sykdig.digitalisering.model.RegisterOppgaveValues
import no.nav.sykdig.digitalisering.pdl.PersonService
import no.nav.sykdig.digitalisering.regelvalidering.RegelvalideringService
import no.nav.sykdig.digitalisering.sykmelding.Sykmelding
import no.nav.sykdig.generated.types.Avvisingsgrunn
import no.nav.sykdig.generated.types.DigitaliseringsoppgaveStatus
import no.nav.sykdig.generated.types.DigitaliseringsoppgaveStatusEnum
import no.nav.sykdig.generated.types.OppdatertSykmeldingStatus
import no.nav.sykdig.generated.types.OppdatertSykmeldingStatusEnum
import no.nav.sykdig.generated.types.SykmeldingUnderArbeidValues
import no.nav.sykdig.metrics.MetricRegister
import no.nav.sykdig.model.OppgaveDbModel
import org.springframework.stereotype.Service
Expand Down Expand Up @@ -83,7 +79,7 @@ class UtenlandskOppgaveService(
throw ClientException(valideringsresultat.joinToString())
}

sykDigOppgaveService.ferdigstillOppgave(oppgave, navEpost, values, enhetId, sykmeldt)
sykDigOppgaveService.ferdigstillUtenlandskAvvistOppgave(oppgave, navEpost, values, enhetId, sykmeldt)
metricRegister.ferdigstiltOppgave.increment()
}

Expand Down
Loading
Loading