7
7
} from '@fhir/fhir-data/schema/documentReference'
8
8
import { sykInnApiService } from '@services/syk-inn-api/SykInnApiService'
9
9
import { serverFhirResources } from '@fhir/fhir-data/fhir-data-server'
10
- import { isE2E , isLocalOrDemo } from '@utils/env'
11
10
12
11
type DocRefResponseResult = FhirDocumentReferenceResponse | [ { errors : { message : string } } ]
13
12
@@ -22,12 +21,6 @@ export async function POST(request: Request): Promise<Response | DocRefResponseR
22
21
return new Response ( 'Missing sykmeldingId header' , { status : 400 } )
23
22
}
24
23
25
- if ( isLocalOrDemo || isE2E ) {
26
- logger . warn ( 'Is in demo, local or e2e, returning mocked sykmelding data' )
27
-
28
- return handleMockedRoute ( )
29
- }
30
-
31
24
const sykmeldingPdf = await sykInnApiService . getSykmeldingPdf ( sykmeldingId )
32
25
if ( 'errorType' in sykmeldingPdf ) {
33
26
return new Response ( 'Failed to retrieve sykmelding pdf' , { status : 500 } )
@@ -80,13 +73,13 @@ export async function POST(request: Request): Promise<Response | DocRefResponseR
80
73
return Response . json ( verifiedCreatedDocRef . data satisfies DocRefResponseResult )
81
74
}
82
75
83
- function handleMockedRoute ( ) : Response {
84
- return Response . json ( {
85
- resourceType : 'DocumentReference' ,
86
- id : 'aa66036d-b63c-4c5a-b3d5-b1d1f812da8d' ,
87
- meta : {
88
- versionId : '1' ,
89
- lastUpdated : '2025-03-04T03:21:36.880-05:00' ,
90
- } ,
91
- } )
92
- }
76
+ // function handleMockedRoute(): Response {
77
+ // return Response.json({
78
+ // resourceType: 'DocumentReference',
79
+ // id: 'aa66036d-b63c-4c5a-b3d5-b1d1f812da8d',
80
+ // meta: {
81
+ // versionId: '1',
82
+ // lastUpdated: '2025-03-04T03:21:36.880-05:00',
83
+ // },
84
+ // })
85
+ // }
0 commit comments