diff --git a/src/components/medication-event.component.tsx b/src/components/medication-event.component.tsx index 81c2ba3..8ca5eef 100644 --- a/src/components/medication-event.component.tsx +++ b/src/components/medication-event.component.tsx @@ -66,6 +66,9 @@ const MedicationEvent: React.FC<{
)} {dosageInstruction?.text &&{dosageInstruction.text}
} + {dosageInstruction?.additionalInstruction?.length > 0 && ( +{dosageInstruction?.additionalInstruction[0].text}
+ )} ); }; diff --git a/src/medication-dispense/medication-dispense.resource.tsx b/src/medication-dispense/medication-dispense.resource.tsx index 47f8528..c703cb7 100644 --- a/src/medication-dispense/medication-dispense.resource.tsx +++ b/src/medication-dispense/medication-dispense.resource.tsx @@ -135,7 +135,15 @@ export function initiateMedicationDispenseBody( whenHandedOver: null, dosageInstruction: [ { - text: medicationRequest.dosageInstruction[0].text, + // see https://openmrs.atlassian.net/browse/O3-3791 for an explanation for the reason for the below + text: [ + medicationRequest.dosageInstruction[0].text, + medicationRequest.dosageInstruction[0].additionalInstruction?.length > 0 + ? medicationRequest.dosageInstruction[0].additionalInstruction[0].text + : null, + ] + .filter((str) => str != null) + .join(' '), timing: medicationRequest.dosageInstruction[0].timing, asNeededBoolean: false, route: medicationRequest.dosageInstruction[0].route, diff --git a/src/types.ts b/src/types.ts index b73ef30..a89079b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -97,7 +97,7 @@ export interface Attribute { } export interface CodeableConcept { - coding: Coding[]; + coding?: Coding[]; text?: string; } @@ -131,6 +131,7 @@ export interface DosageInstruction { doseAndRate: Array<{ doseQuantity: Quantity; }>; + additionalInstruction?: Array