Skip to content

Commit

Permalink
Merge pull request #15 from synthetichealth/med_refs
Browse files Browse the repository at this point in the history
Support MedicationRequest.medicationReference
  • Loading branch information
dehall authored Mar 19, 2024
2 parents bf9f36c + c593982 commit 413f8b8
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 413f8b8

Please sign in to comment.