Skip to content

Commit 6e7fccb

Browse files
IS-1477: Add behandlingsnummer header to pdl requests (#494)
1 parent 6da6f92 commit 6e7fccb

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

src/main/kotlin/no/nav/syfo/client/pdl/PdlClient.kt

+11-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ import no.nav.syfo.client.httpClientDefault
1111
import no.nav.syfo.domain.PersonIdent
1212
import no.nav.syfo.metric.COUNT_CALL_PDL_FAIL
1313
import no.nav.syfo.metric.COUNT_CALL_PDL_SUCCESS
14-
import no.nav.syfo.util.*
14+
import no.nav.syfo.util.NAV_CALL_ID_HEADER
15+
import no.nav.syfo.util.bearerHeader
1516
import org.slf4j.LoggerFactory
1617

1718
class PdlClient(
@@ -79,7 +80,7 @@ class PdlClient(
7980
setBody(request)
8081
header(HttpHeaders.ContentType, "application/json")
8182
header(HttpHeaders.Authorization, bearerHeader(systemToken.accessToken))
82-
header(TEMA_HEADER, ALLE_TEMA_HEADERVERDI)
83+
header(BEHANDLINGSNUMMER_HEADER_KEY, BEHANDLINGSNUMMER_HEADER_VALUE)
8384
header(NAV_CALL_ID_HEADER, callId)
8485
}
8586

@@ -101,6 +102,7 @@ class PdlClient(
101102
pdlIdenterReponse.data?.hentIdenter
102103
}
103104
}
105+
104106
else -> {
105107
COUNT_CALL_PDL_FAIL.increment()
106108
val message = "Request with url: $pdlUrl failed with reponse code ${response.status.value}"
@@ -123,7 +125,7 @@ class PdlClient(
123125
setBody(request)
124126
header(HttpHeaders.ContentType, "application/json")
125127
header(HttpHeaders.Authorization, bearerHeader(token.accessToken))
126-
header(TEMA_HEADER, ALLE_TEMA_HEADERVERDI)
128+
header(BEHANDLINGSNUMMER_HEADER_KEY, BEHANDLINGSNUMMER_HEADER_VALUE)
127129
header(NAV_CALL_ID_HEADER, callId)
128130
}
129131

@@ -141,6 +143,7 @@ class PdlClient(
141143
pdlPersonReponse.data
142144
}
143145
}
146+
144147
else -> {
145148
COUNT_CALL_PDL_FAIL.increment()
146149
logger.error("Request with url: $pdlUrl failed with reponse code ${response.status.value}")
@@ -160,5 +163,10 @@ class PdlClient(
160163
private val FOLKEREG_IDENTER_CACHE_KEY_PREFIX = "pdl-folkereg-identer"
161164
private val CACHE_EXPIRE_SECONDS = 24L * 3600
162165
private val logger = LoggerFactory.getLogger(PdlClient::class.java)
166+
167+
// Se behandlingskatalog https://behandlingskatalog.intern.nav.no/
168+
// Behandling: Vurdere behov for, innkalle og gjennomføre dialogmøter, samt vurdere behov for arbeidsrettede tiltak, jf. § 8-7 a.
169+
private const val BEHANDLINGSNUMMER_HEADER_KEY = "behandlingsnummer"
170+
private const val BEHANDLINGSNUMMER_HEADER_VALUE = "B380"
163171
}
164172
}

src/main/kotlin/no/nav/syfo/util/RequestUtil.kt

-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@ import io.ktor.util.pipeline.*
66
import net.logstash.logback.argument.StructuredArguments
77

88
const val NAV_PERSONIDENT_HEADER = "nav-personident"
9-
const val TEMA_HEADER = "Tema"
10-
const val ALLE_TEMA_HEADERVERDI = "GEN"
119
const val NAV_VIRKSOMHETSNUMMER = "nav-virksomhetsnummer"
1210
const val NAV_CALL_ID_HEADER = "Nav-Call-Id"
1311
fun PipelineContext<out Unit, ApplicationCall>.getCallId(): String {

0 commit comments

Comments
 (0)