Skip to content

Commit

Permalink
Merge branch 'master' into 354-generic-resource-list
Browse files Browse the repository at this point in the history
  • Loading branch information
ir4y committed Dec 18, 2024
2 parents 2d33024 + f63914d commit 2499307
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {
} from 'fhir/r4b';
import _ from 'lodash';
import moment from 'moment';
import { extractExtension, fromFHIRReference } from 'sdc-qrf';
import { extractExtension } from 'sdc-qrf';

import { WithId, extractBundleResources, formatFHIRDate, parseFHIRDateTime } from '@beda.software/fhir-react';

Expand Down Expand Up @@ -281,12 +281,14 @@ export function prepareAppointmentDetails(appointment: Appointment) {
];

//TODO agree on terminology for Appointment.particioant.type and use it
const participants = appointment.participant.filter(p => p.type?.[0]?.coding?.[0]?.code !== 'patient').map(participant => ({
title: participant.type?.[0]?.text,
value: participant.actor?.display,
}))
const participants = appointment.participant
.filter((p) => p.type?.[0]?.coding?.[0]?.code !== 'patient')
.map((participant) => ({
title: participant.type?.[0]?.text,
value: participant.actor?.display,
}));

return [...appointmentDetails, ...participants]
return [...appointmentDetails, ...participants];
}

export function prepareServiceRequest(
Expand Down
4 changes: 2 additions & 2 deletions src/utils/fhirpath.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ type NonEmptyArray<T> = [T, ...T[]];
export function compileAsArray<SRC, DST = unknown, REQ = false>(expression: string) {
const path = fhirpath.compile(expression);

return (s: SRC) => path(s) as REQ extends true ? NonEmptyArray<DST> : Array<DST>;
return (s: SRC, context?: Context | undefined) => path(s, context) as REQ extends true ? NonEmptyArray<DST> : Array<DST>;
}

export function compileAsFirst<SRC, DST = unknown, REQ = false>(expression: string) {
const path = fhirpath.compile(expression);

return (s: SRC) => path(s)[0] as REQ extends true ? DST : DST | undefined;
return (s: SRC, context?: Context | undefined) => path(s, context)[0] as REQ extends true ? DST : DST | undefined;
}

0 comments on commit 2499307

Please sign in to comment.