Page History
...
Patient-Open og Patient-close
Patient-open sender den brugervalgte patient journal og patient-close lukker den bruger valgte patient (set fra det indlejrede systems perspektiv). Et eksempel på dette kan ses i appointment.component
Code Block |
---|
constructor(
private napSDK: NapAngularService,
private appointmentService: AppointmentService,
private authService: AuthService
) {
const napMsg: NAPMessage = {
date: new Date().toISOString(),
id: UUID(),
event: {
type: NAPEventCatalogue.v1.PatientOpen,
},
};
this.napSDK.sendMessage(napMsg);
}
public currentPatient$: Observable<NAPPatientInfo | undefined> = this.napSDK.incomming$.pipe(
filterEvent(NAPEventCatalogue.v1.PatientOpen),
map(message => FHIRValueGetter.getPatientInfo(message))
); |
Session-Error
Session-error sendes hvis der sker en uventet fejl i gæstesystemet skal dette sendes til værtssystemet og vice versa. Et eksempel på dette findes i appointment-service:
Code Block |
---|
private appointmentEndPoint$ = this.configurationService.fetch(
config => config.appointmentsEndpoint
);
private serverUrl = this.configurationService.fetch(config => config.serverUrl);
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);
}),
);
} |