Skip to content

Commit

Permalink
O3-3791: Dispensing: display instructions from DrugOrder.instructions… (
Browse files Browse the repository at this point in the history
  • Loading branch information
mogoodrich authored Aug 15, 2024
1 parent a90ff57 commit 47cf3c0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions src/components/medication-event.component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ const MedicationEvent: React.FC<{
</p>
)}
{dosageInstruction?.text && <p className={styles.bodyLong01}>{dosageInstruction.text}</p>}
{dosageInstruction?.additionalInstruction?.length > 0 && (
<p className={styles.bodyLong01}>{dosageInstruction?.additionalInstruction[0].text}</p>
)}
</div>
);
};
Expand Down
10 changes: 9 additions & 1 deletion src/medication-dispense/medication-dispense.resource.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
3 changes: 2 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ export interface Attribute {
}

export interface CodeableConcept {
coding: Coding[];
coding?: Coding[];
text?: string;
}

Expand Down Expand Up @@ -131,6 +131,7 @@ export interface DosageInstruction {
doseAndRate: Array<{
doseQuantity: Quantity;
}>;
additionalInstruction?: Array<CodeableConcept>;
}

export interface Drug {
Expand Down

0 comments on commit 47cf3c0

Please sign in to comment.