Skip to content

Commit

Permalink
IS-2864: Inkludere hprId i behandler-api
Browse files Browse the repository at this point in the history
  • Loading branch information
geir-waagboe committed Dec 3, 2024
1 parent a912feb commit 56a7f35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/main/kotlin/no/nav/syfo/behandler/api/BehandlerDTO.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ package no.nav.syfo.behandler.api
data class BehandlerDTO(
val type: String?,
val behandlerRef: String,
val kategori: String,
val fnr: String?,
val hprId: Int?,
val fornavn: String,
val mellomnavn: String?,
val etternavn: String,
Expand Down
3 changes: 2 additions & 1 deletion src/main/kotlin/no/nav/syfo/behandler/domain/Behandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,14 @@ data class Behandler(
val suspendert: Boolean,
)

// TODO: Få med behandlerkategori
fun Behandler.toBehandlerDTO(
behandlerType: BehandlerArbeidstakerRelasjonstype?,
) = BehandlerDTO(
type = behandlerType?.name,
behandlerRef = this.behandlerRef.toString(),
fnr = this.personident?.value,
hprId = this.hprId,
kategori = this.kategori.name,
fornavn = this.fornavn,
mellomnavn = this.mellomnavn,
etternavn = this.etternavn,
Expand Down
3 changes: 3 additions & 0 deletions src/test/kotlin/no/nav/syfo/behandler/api/BehandlerApiSpek.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.ktor.http.*
import io.ktor.server.testing.*
import no.nav.syfo.behandler.database.*
import no.nav.syfo.behandler.domain.BehandlerArbeidstakerRelasjonstype
import no.nav.syfo.behandler.domain.BehandlerKategori
import no.nav.syfo.testhelper.*
import no.nav.syfo.testhelper.UserConstants.ARBEIDSTAKER_FNR
import no.nav.syfo.testhelper.UserConstants.ARBEIDSTAKER_MED_FASTLEGE_MED_FLERE_PARTNERINFO
Expand Down Expand Up @@ -77,6 +78,8 @@ class BehandlerApiSpek : Spek({
behandlerDTO.type shouldBeEqualTo BehandlerArbeidstakerRelasjonstype.FASTLEGE.name
behandlerDTO.behandlerRef shouldBeEqualTo behandlerForPersonList.first().behandlerRef.toString()
behandlerDTO.fnr shouldBeEqualTo fastlegeResponse.fnr
behandlerDTO.kategori shouldBeEqualTo BehandlerKategori.LEGE.name
behandlerDTO.hprId shouldBeEqualTo fastlegeResponse.helsepersonellregisterId
}
}
it("should return list of Behandler and store behandler connected to kontor with latest dialogmeldingEnabled") {
Expand Down

0 comments on commit 56a7f35

Please sign in to comment.