Page History
...
Code Block |
---|
private appointmentEndPoint$ = this.configurationService.fetch( config => config.appointmentsEndpoint ); private serverUrl = this.configurationService.fetch(config => config.serverUrl); private createNapErrorMessage(error: GenericAppError): NAPMessage { return { date: new Date().toISOString(), id: UUID(), event: { type: NAPEventCatalogue.v1.SessionError, context: [ { resource: { resourceType: FHIRValueSetter.FHIRResourceType.Basic, code: { coding: [ { code: NAPEventCatalogue.v1.SessionError, system: FHIRValueSetter.FHIRSystem.NAP, }, ], }, identifier: [ { system: FHIRValueSetter.FHIRIdentifierSystem.NAPErrorMessage, value: error.innerError?.message ? error.innerError?.message : '', }, { system: FHIRValueSetter.FHIRIdentifierSystem.NAPErrorDescription, value: error.errorMessage, }, ], }, }, ], } } } public getAppointments(patientIdentifier: string | undefined): Observable<any[] | undefined> { return combineLatest( [ this.serverUrl, this.appointmentEndPoint$, this.serviceActivator ] ).pipe( switchMap(([serverUrl, endpointPath, _]) => this.http.get<any[]>(serverUrl + endpointPath + '/' + patientIdentifier)), catchError(error => { this.errorService.postError(error); this.napSDK.sendMessage(this.createNapErrorMessage(error)); // indicate to the host that something went wrong return of(undefined); }), ); } |
...
Snitfladebeskrivelse og brug
...