From c593982b57b2fd00f89d95d3721533f8a4ae13f7 Mon Sep 17 00:00:00 2001 From: Dylan Hall Date: Tue, 19 Mar 2024 13:27:00 -0400 Subject: [PATCH] hack to support MedicationRequest.medicationReference --- src/ui/components/PatientViewer/PatientViewer.jsx | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/ui/components/PatientViewer/PatientViewer.jsx b/src/ui/components/PatientViewer/PatientViewer.jsx index 1f21cf3..2d8180c 100644 --- a/src/ui/components/PatientViewer/PatientViewer.jsx +++ b/src/ui/components/PatientViewer/PatientViewer.jsx @@ -228,6 +228,16 @@ const EntireRecord = props => { const getByType = type => allResources.filter(r => r.resourceType === type); const conditions = getByType('Condition'); const medications = getByType('MedicationRequest'); + const meds = getByType('Medication'); + medications.forEach(m => { + if (m.medicationReference) { + const referencedMed = meds.find(med => isMatchingReference(med, m.medicationReference.reference, 'Medication')); + if (referencedMed) { + m.medicationCodeableConcept = referencedMed.code; + } + } + }); + let observations = getByType('Observation'); const reports = getByType('DiagnosticReport');