From ae878f6b9be386def09eabe7c8a810c7492dbbb5 Mon Sep 17 00:00:00 2001 From: Joyce Quach Date: Tue, 21 Nov 2023 15:08:21 -0500 Subject: [PATCH] Use correct prefetch --- src/views/Patient/PatientView.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/views/Patient/PatientView.tsx b/src/views/Patient/PatientView.tsx index 762eda3..1cf4246 100644 --- a/src/views/Patient/PatientView.tsx +++ b/src/views/Patient/PatientView.tsx @@ -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; @@ -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); }); }