File tree 5 files changed +6
-57
lines changed
app/(fhir)/fhir/resources/sykmelding
5 files changed +6
-57
lines changed Original file line number Diff line number Diff line change @@ -52,6 +52,5 @@ function handleMockedRoute(): Response {
52
52
code : 'L73' ,
53
53
text : 'Brudd legg/ankel' ,
54
54
} ,
55
- pdf : 'asdasdda' ,
56
55
} satisfies ExistingSykmelding )
57
56
}
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import { logger } from '@navikt/next-logger'
2
2
3
3
import { isE2E , isLocalOrDemo } from '@utils/env'
4
4
import { sykInnApiService } from '@services/syk-inn-api/SykInnApiService'
5
- import { ExistingSykmeldinger } from '@services/syk-inn-api/SykInnApiSchema'
5
+ import { ExistingSykmelding } from '@services/syk-inn-api/SykInnApiSchema'
6
6
import { ensureValidFhirAuth } from '@fhir/auth/verify'
7
7
8
8
export async function GET ( request : Request ) : Promise < Response > {
@@ -29,7 +29,7 @@ export async function GET(request: Request): Promise<Response> {
29
29
return new Response ( 'Failed to retrieve sykmeldinger' , { status : 500 } )
30
30
}
31
31
32
- return Response . json ( sykmeldinger satisfies ExistingSykmeldinger [ ] , { status : 200 } )
32
+ return Response . json ( sykmeldinger satisfies ExistingSykmelding [ ] , { status : 200 } )
33
33
}
34
34
35
35
function handleMockedRoute ( ) : Response {
@@ -83,5 +83,5 @@ function handleMockedRoute(): Response {
83
83
text : 'Brudd legg/ankel' ,
84
84
} ,
85
85
} ,
86
- ] satisfies ExistingSykmeldinger [ ] )
86
+ ] satisfies ExistingSykmelding [ ] )
87
87
}
Original file line number Diff line number Diff line change 1
- import { ExistingSykmeldinger } from '@services/syk-inn-api/SykInnApiSchema'
2
-
3
1
export type NotAvailable = typeof NotAvailable
4
2
export const NotAvailable = {
5
3
type : 'resource-not-available' ,
@@ -25,7 +23,7 @@ export type DataService = {
25
23
pasient : ( ( ) => Promise < PasientInfo > ) | NotAvailable
26
24
arbeidsgivere : ( ( ) => Promise < ArbeidsgiverInfo [ ] > ) | NotAvailable
27
25
konsultasjon : ( ( ) => Promise < KonsultasjonInfo > ) | NotAvailable
28
- tidligereSykmeldinger : ( ( ) => Promise < ExistingSykmeldinger [ ] > ) | NotAvailable
26
+ tidligereSykmeldinger : ( ( ) => Promise < ExistingSykmelding [ ] > ) | NotAvailable
29
27
}
30
28
/**
31
29
* Query data can be anything that requires an argument to fetch, such as a specific patient.
@@ -123,7 +121,6 @@ export type ExistingSykmelding = {
123
121
code : string
124
122
text : string
125
123
}
126
- pdf : string
127
124
}
128
125
129
126
/**
Original file line number Diff line number Diff line change @@ -29,51 +29,6 @@ export const ExistingSykmeldingSchema = z.object({
29
29
code : z . string ( ) ,
30
30
text : z . string ( ) ,
31
31
} ) ,
32
- pdf : z . string ( ) ,
33
- } )
34
-
35
- export type ExistingSykmeldinger = z . infer < typeof ExistingSykmeldingerSchema >
36
- export const ExistingSykmeldingerSchema = z . object ( {
37
- sykmeldingId : z . string ( ) ,
38
- pasient : z . object ( {
39
- fnr : z . string ( ) ,
40
- } ) ,
41
- aktivitet : z . discriminatedUnion ( 'type' , [
42
- z . object ( {
43
- type : z . literal ( 'AKTIVITET_IKKE_MULIG' ) ,
44
- fom : DateOnly ,
45
- tom : DateOnly ,
46
- } ) ,
47
- z . object ( {
48
- type : z . literal ( 'GRADERT' ) ,
49
- fom : DateOnly ,
50
- tom : DateOnly ,
51
- grad : z
52
- . string ( )
53
- . transform ( ( it ) => + it )
54
- . pipe ( z . number ( ) . min ( 1 ) . max ( 99 ) ) ,
55
- } ) ,
56
- z . object ( {
57
- type : z . literal ( 'AVVENTENDE' ) ,
58
- fom : DateOnly ,
59
- tom : DateOnly ,
60
- } ) ,
61
- z . object ( {
62
- type : z . literal ( 'BEHANDLINGSDAGER' ) ,
63
- fom : DateOnly ,
64
- tom : DateOnly ,
65
- } ) ,
66
- z . object ( {
67
- type : z . literal ( 'REISETILSKUDD' ) ,
68
- fom : DateOnly ,
69
- tom : DateOnly ,
70
- } ) ,
71
- ] ) ,
72
- hovedDiagnose : z . object ( {
73
- system : z . string ( ) ,
74
- code : z . string ( ) ,
75
- text : z . string ( ) ,
76
- } ) ,
77
32
} )
78
33
79
34
export type NySykmelding = z . infer < typeof NySykmeldingSchema >
Original file line number Diff line number Diff line change 1
1
import {
2
2
ExistingSykmelding ,
3
- ExistingSykmeldinger ,
4
- ExistingSykmeldingerSchema ,
5
3
ExistingSykmeldingSchema ,
6
4
NySykmelding ,
7
5
NySykmeldingSchema ,
@@ -54,7 +52,7 @@ export const sykInnApiService = {
54
52
} ,
55
53
responseSchema : ExistingSykmeldingSchema ,
56
54
} ) ,
57
- getTidligereSykmeldinger : async ( ident : string ) : Promise < ExistingSykmeldinger [ ] | ApiFetchErrors > =>
55
+ getTidligereSykmeldinger : async ( ident : string ) : Promise < ExistingSykmelding [ ] | ApiFetchErrors > =>
58
56
fetchInternalAPI ( {
59
57
api : 'syk-inn-api' ,
60
58
path : `/api/v1/sykmelding` ,
@@ -63,6 +61,6 @@ export const sykInnApiService = {
63
61
'Content-Type' : 'application/json' ,
64
62
Ident : ident ,
65
63
} ,
66
- responseSchema : ExistingSykmeldingerSchema . array ( ) ,
64
+ responseSchema : ExistingSykmeldingSchema . array ( ) ,
67
65
} ) ,
68
66
}
You can’t perform that action at this time.
0 commit comments