Skip to content

Commit

Permalink
Update to account for unknown status
Browse files Browse the repository at this point in the history
  • Loading branch information
Ariel Virgulto committed Feb 16, 2024
1 parent 23566df commit 4419e68
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3 deletions.
11 changes: 10 additions & 1 deletion src/views/Patient/MedReqDropDown/MedReqDropDown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,15 @@ function MedReqDropDown({
}

const pStatus = testEhrResponse?.resource?.status;
const getMedicationStatus = (status: string | undefined) => {
if (status === 'completed') {
return 'Picked Up';
} else if (status === 'unknown') {
return 'Not Started';
} else {
return 'N/A';
}
};
let pColor = '#0c0c0c'; // black
if (pStatus === 'completed') {
pColor = '#5cb85c'; // green
Expand Down Expand Up @@ -435,7 +444,7 @@ function MedReqDropDown({
<div>
<LocalPharmacyIcon fontSize="large" />
<p className="etasuButtonText">Medication: </p>
<p>{pStatus === 'completed' ? 'Picked Up' : 'Unknown'}</p>
<p>{getMedicationStatus(pStatus)}</p>
</div>
</Button>
{renderTimestamp(checkedPharmacyTime)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,16 @@ const PharmacyStatus = (props: PharmacyStatusProps) => {
}
}, [props.update]);

const getMedicationStatus = (status: string | undefined) => {
if (status === 'completed') {
return 'Picked Up';
} else if (status === 'unknown') {
return 'Not Started';
} else {
return 'N/A';
}
};

const status = props.testEhrResponse?.resource?.status;
let color = '#0c0c0c'; // black
if (status === 'completed') {
Expand All @@ -34,7 +44,7 @@ const PharmacyStatus = (props: PharmacyStatusProps) => {
<Grid container columns={12}>
<Grid item xs={10}>
<div className="bundle-entry">ID: {props.testEhrResponse?.resource?.id || 'N/A'}</div>
<div className="bundle-entry">Status: {status === 'completed' ? 'Picked Up' : 'N/A'}</div>
<div className="bundle-entry">Status: {getMedicationStatus(status)}</div>
</Grid>
<Grid item xs={2}>
<div className="bundle-entry">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,16 @@ export default function RemsInterface(props: RemsInterfaceProps) {
// Checking if REMS Request (pt enrollment) || Met Requirments (prescriber Form)
const hasRemsCase = remsAdminResponse?.data?.case_number ? true : false;

const getMedicationStatus = (status: string | undefined) => {
if (status === 'completed') {
return 'Picked Up';
} else if (status === 'unknown') {
return 'Not Started';
} else {
return 'N/A';
}
};

return (
<div>
<div>
Expand Down Expand Up @@ -254,7 +264,7 @@ export default function RemsInterface(props: RemsInterfaceProps) {
<div className="status-icon" style={{ backgroundColor: colorPis }}></div>
<div className="bundle-entry">ID : {response?.resource?.id || 'N/A'}</div>
<div className="bundle-entry">
Status: {statusPis === 'completed' ? 'Picked Up' : 'N/A'}
Status: {getMedicationStatus(statusPis)}
</div>
<div className="bundle-entry">
<AutorenewIcon
Expand Down

0 comments on commit 4419e68

Please sign in to comment.