diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 5c09b0fd20..a60606be1a 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -392,12 +392,33 @@ export type PatientCategoryID = "Comfort" | "Stable" | "Moderate" | "Critical"; export const PATIENT_CATEGORIES: { id: PatientCategoryID; text: PatientCategory; + description: string; twClass: string; }[] = [ - { id: "Comfort", text: "Comfort Care", twClass: "patient-comfort" }, - { id: "Stable", text: "Mild", twClass: "patient-stable" }, - { id: "Moderate", text: "Moderate", twClass: "patient-abnormal" }, - { id: "Critical", text: "Critical", twClass: "patient-critical" }, + { + id: "Comfort", + text: "Comfort Care", + twClass: "patient-comfort", + description: "End of life care", + }, + { + id: "Stable", + text: "Mild", + twClass: "patient-stable", + description: "Urgent: not life-threatening", + }, + { + id: "Moderate", + text: "Moderate", + twClass: "patient-abnormal", + description: "Emergency: could be life-threatening", + }, + { + id: "Critical", + text: "Critical", + twClass: "patient-critical", + description: "Immediate: life-threatening", + }, ]; export const PATIENT_FILTER_CATEGORIES = PATIENT_CATEGORIES; diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx index a728ffc805..c30c8ecc4a 100644 --- a/src/Components/Facility/ConsultationForm.tsx +++ b/src/Components/Facility/ConsultationForm.tsx @@ -1122,22 +1122,6 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => { /> - -
- - A daily round already exists. -

- ) - } - required - label="Category" - {...field("category")} - /> -
-
{
)} -
+
{ required={state.form.suggestion === "A"} />
+
+ + A daily round already exists. +

+ ) + } + hideDescription={ + (Array.isArray(bed) + ? bed[0].bed_type + : bed?.bed_type) !== "ICU" + } + required + label="Category" + {...field("category")} + /> +
diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index dd68e1f7dd..15b0cfc6f2 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -121,6 +121,7 @@ export const DailyRounds = (props: any) => { const [isLoading, setIsLoading] = useState(false); const [facilityName, setFacilityName] = useState(""); const [patientName, setPatientName] = useState(""); + const [bedType, setBedType] = useState(""); const [consultationSuggestion, setConsultationSuggestion] = useState(""); const [prevReviewInterval, setPreviousReviewInterval] = useState(-1); const [prevAction, setPreviousAction] = useState("NO_ACTION"); @@ -180,6 +181,9 @@ export const DailyRounds = (props: any) => { if (data) { setPatientName(data.name!); setFacilityName(data.facility_object!.name); + setBedType( + data.last_consultation?.current_bed?.bed_object?.bed_type || "", + ); setConsultationSuggestion(data.last_consultation?.suggestion); setDiagnoses( data.last_consultation?.diagnoses?.sort( @@ -206,6 +210,7 @@ export const DailyRounds = (props: any) => { }; } } else { + setBedType(""); setPatientName(""); setFacilityName(""); } @@ -517,6 +522,7 @@ export const DailyRounds = (props: any) => {
diff --git a/src/Components/Patient/PatientCategorySelect.tsx b/src/Components/Patient/PatientCategorySelect.tsx index 4d159529f4..85a479e071 100644 --- a/src/Components/Patient/PatientCategorySelect.tsx +++ b/src/Components/Patient/PatientCategorySelect.tsx @@ -8,7 +8,7 @@ import { FormFieldBaseProps } from "../Form/FormFields/Utils"; * field. */ export default function PatientCategorySelect( - props: FormFieldBaseProps, + props: FormFieldBaseProps & { hideDescription?: boolean }, ) { return ( option.id} optionLabel={(option) => option.text} + optionDescription={ + props.hideDescription ? undefined : (option) => option.description + } optionSelectedLabel={(option) => (
{ const { facilityId, patientId } = props; const [isLoading, setIsLoading] = useState(false); const [patientCategory, setPatientCategory] = useState(); + const [bedType, setBedType] = useState(""); const { t } = useTranslation(); const { wartime_shifting } = useConfig(); @@ -120,6 +121,9 @@ export const ShiftCreate = (props: patientShiftProps) => { setPatientCategory( PATIENT_CATEGORIES.find((c) => c.text === patient_category)?.id, ); + setBedType( + data.last_consultation?.current_bed?.bed_object.bed_type || "", + ); } }, }); @@ -331,6 +335,7 @@ export const ShiftCreate = (props: patientShiftProps) => { setPatientCategory(e.value)} label="Patient Category" diff --git a/src/Components/Shifting/ShiftDetailsUpdate.tsx b/src/Components/Shifting/ShiftDetailsUpdate.tsx index d327e40288..b27a4f6d8f 100644 --- a/src/Components/Shifting/ShiftDetailsUpdate.tsx +++ b/src/Components/Shifting/ShiftDetailsUpdate.tsx @@ -399,6 +399,9 @@ export const ShiftDetailsUpdate = (props: patientShiftProps) => { required={true} name="patient_category" value={state.form.patient_category} + hideDescription={ + consultationData.current_bed?.bed_object.bed_type !== "ICU" + } onChange={handleFormFieldChange} label="Patient Category" className="md:col-span-2"