Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/components/MedicationStatus/MedicationStatus.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@ export const getStatusColor = status => {
switch (status) {
case 'completed':
return 'green';
case 'on-hold':
return '#f0ad4e';
case 'preparation':
case 'in-progress':
case 'cancelled':
case 'on-hold':
case 'entered-in-error':
case 'stopped':
case 'declined':
Expand All @@ -62,10 +63,11 @@ export const getStatusText = status => {
return 'Picked Up';
case 'unknown':
return 'Not Started';
case 'on-hold':
return 'On Hold';
case 'preparation':
case 'in-progress':
case 'cancelled':
case 'on-hold':
case 'entered-in-error':
case 'stopped':
case 'declined':
Expand Down
2 changes: 2 additions & 0 deletions src/components/MedicationStatus/MedicationStatusModal.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const MedicationStatusModal = props => {
const [spin, setSpin] = useState(false);
const color = getStatusColor(medicationDispense?.status);
const status = getStatusText(medicationDispense?.status);
const note = medicationDispense?.note ? medicationDispense?.note[0]?.text : "";

useEffect(() => {
if (update) {
Expand All @@ -29,6 +30,7 @@ export const MedicationStatusModal = props => {
<Grid item xs={10}>
<div className="bundle-entry">ID: {getIdText(medicationDispense)}</div>
<div className="bundle-entry">Status: {status}</div>
<div className="bundle-entry">Note: {note}</div>
</Grid>
<Grid item xs={2}>
<div className="bundle-entry">
Expand Down
1 change: 1 addition & 0 deletions src/util/fhir.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ function createMedicationDispenseFromMedicationRequest(medicationRequest) {
medicationDispense.authorizingPrescription = [
{ reference: 'MedicationRequest/' + medicationRequest.id }
];
medicationDispense.note = [ { text: "Medication sent to pharmacy" } ];
return medicationDispense;
}

Expand Down