Skip to content

Commit

Permalink
Use correct prefetch
Browse files Browse the repository at this point in the history
  • Loading branch information
jtquach1 committed Nov 21, 2023
1 parent 3b0faab commit ae878f6
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/Patient/PatientView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import axios from 'axios';
import * as env from 'env-var';
import PatientViewHook from '../../cds-hooks/resources/PatientView';
import { hydrate } from '../../cds-hooks/prefetch/PrefetchHydrator';
import example from '../../cds-hooks/prefetch/exampleHookService.json'; // TODO: Replace with request to CDS service

interface PatientViewProps {
client: Client;
Expand Down Expand Up @@ -95,7 +94,15 @@ function PatientView(props: PatientViewProps) {
const hook = new PatientViewHook(patient.id, user);
const tempHook = hook.generate();

hydrate(getFhirResource, example.prefetch, tempHook).then(() => {
hydrate(
getFhirResource,
{
patient: 'Patient/{{context.patientId}}',
practitioner: 'Practitioner/{{context.userId}}',
medicationRequests: 'MedicationRequest?subject={{context.patientId}}'
},
tempHook
).then(() => {
setCDSHook(tempHook);
});
}
Expand Down

0 comments on commit ae878f6

Please sign in to comment.