From 4419e682866f1020897bd1cfc3c5ab289da123cc Mon Sep 17 00:00:00 2001 From: Ariel Virgulto Date: Thu, 15 Feb 2024 20:04:58 -0500 Subject: [PATCH] Update to account for unknown status --- src/views/Patient/MedReqDropDown/MedReqDropDown.tsx | 11 ++++++++++- .../MedReqDropDown/pharmacyStatus/PharmacyStatus.tsx | 12 +++++++++++- .../components/RemsInterface/RemsInterface.tsx | 12 +++++++++++- 3 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx b/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx index 3e7ec3b..196bb32 100644 --- a/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx +++ b/src/views/Patient/MedReqDropDown/MedReqDropDown.tsx @@ -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 @@ -435,7 +444,7 @@ function MedReqDropDown({

Medication:

-

{pStatus === 'completed' ? 'Picked Up' : 'Unknown'}

+

{getMedicationStatus(pStatus)}

{renderTimestamp(checkedPharmacyTime)} diff --git a/src/views/Patient/MedReqDropDown/pharmacyStatus/PharmacyStatus.tsx b/src/views/Patient/MedReqDropDown/pharmacyStatus/PharmacyStatus.tsx index e1836d4..b79a8c4 100644 --- a/src/views/Patient/MedReqDropDown/pharmacyStatus/PharmacyStatus.tsx +++ b/src/views/Patient/MedReqDropDown/pharmacyStatus/PharmacyStatus.tsx @@ -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') { @@ -34,7 +44,7 @@ const PharmacyStatus = (props: PharmacyStatusProps) => {
ID: {props.testEhrResponse?.resource?.id || 'N/A'}
-
Status: {status === 'completed' ? 'Picked Up' : 'N/A'}
+
Status: {getMedicationStatus(status)}
diff --git a/src/views/Questionnaire/components/RemsInterface/RemsInterface.tsx b/src/views/Questionnaire/components/RemsInterface/RemsInterface.tsx index d0dfafe..0220032 100644 --- a/src/views/Questionnaire/components/RemsInterface/RemsInterface.tsx +++ b/src/views/Questionnaire/components/RemsInterface/RemsInterface.tsx @@ -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 (
@@ -254,7 +264,7 @@ export default function RemsInterface(props: RemsInterfaceProps) {
ID : {response?.resource?.id || 'N/A'}
- Status: {statusPis === 'completed' ? 'Picked Up' : 'N/A'} + Status: {getMedicationStatus(statusPis)}