Skip to content

Commit

Permalink
hack to support MedicationRequest.medicationReference
Browse files Browse the repository at this point in the history
  • Loading branch information
dehall committed Mar 19, 2024
1 parent bf9f36c commit c593982
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/ui/components/PatientViewer/PatientViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down

0 comments on commit c593982

Please sign in to comment.