From 26511bea353b4da4f0563848d852bca47276d799 Mon Sep 17 00:00:00 2001 From: Ashesh3 <3626859+Ashesh3@users.noreply.github.com> Date: Thu, 28 Dec 2023 16:48:53 +0530 Subject: [PATCH] Add consciousness level options for normal daily round type --- src/Common/constants.tsx | 13 ++++++++++++ .../Form/FormFields/RadioFormField.tsx | 3 ++- .../Patient/DailyRoundListDetails.tsx | 16 +++++++++++++- src/Components/Patient/DailyRounds.tsx | 21 +++++++++++++++++-- 4 files changed, 49 insertions(+), 4 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 23c02e389f3..f472e8b193c 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -300,6 +300,19 @@ export const DISCHARGE_REASONS = [ { id: "LAMA", text: "LAMA" }, ]; +export const CONSCIOUSNESS_LEVEL = [ + { id: "UNRESPONSIVE", text: "Unresponsive" }, + { id: "RESPONDS_TO_PAIN", text: "Responds to Pain" }, + { id: "RESPONDS_TO_VOICE", text: "Responds to Voice" }, + { id: "ALERT", text: "Alert" }, + { id: "AGITATED_OR_CONFUSED", text: "Agitated or Confused" }, + { + id: "Onset of Agitation and Confusion", + text: "Onset of Agitation and Confusion", + }, + { id: "UNKNOWN", text: "Unknown" }, +]; + export const LINES_CATHETER_CHOICES: Array = [ { id: 1, text: "CVP catheter " }, { id: 2, text: "Arterial Line" }, diff --git a/src/Components/Form/FormFields/RadioFormField.tsx b/src/Components/Form/FormFields/RadioFormField.tsx index 3d1a9b7d8ac..905986d62af 100644 --- a/src/Components/Form/FormFields/RadioFormField.tsx +++ b/src/Components/Form/FormFields/RadioFormField.tsx @@ -5,13 +5,14 @@ type Props = FormFieldBaseProps & { options: T[]; optionDisplay: (option: T) => React.ReactNode; optionValue: (option: T) => string; + containerClassName?: string; }; const RadioFormField = (props: Props) => { const field = useFormFieldPropsResolver(props); return ( -
+
{props.options.map((option, idx) => { const value = props.optionValue(option); const optionId = `${props.name}-${idx}`; diff --git a/src/Components/Patient/DailyRoundListDetails.tsx b/src/Components/Patient/DailyRoundListDetails.tsx index 9ac68a20ca7..8f313c0a51d 100644 --- a/src/Components/Patient/DailyRoundListDetails.tsx +++ b/src/Components/Patient/DailyRoundListDetails.tsx @@ -1,6 +1,10 @@ import { lazy, useCallback, useState } from "react"; import { useDispatch } from "react-redux"; -import { CURRENT_HEALTH_CHANGE, SYMPTOM_CHOICES } from "../../Common/constants"; +import { + CONSCIOUSNESS_LEVEL, + CURRENT_HEALTH_CHANGE, + SYMPTOM_CHOICES, +} from "../../Common/constants"; import { statusType, useAbortableEffect } from "../../Common/utils"; import { getConsultationDailyRoundsDetails } from "../../Redux/actions"; import { DailyRoundsModel } from "./models"; @@ -183,6 +187,16 @@ export const DailyRoundListDetails = (props: any) => { {dailyRoundListDetailsData.rhythm_detail ?? "-"}
+
+ + Level Of Consciousness:{" "} + + {dailyRoundListDetailsData.consciousness_level + ? CONSCIOUSNESS_LEVEL.find( + (i) => i.id === dailyRoundListDetailsData.consciousness_level + )?.text + : "-"} +
Recommend Discharge:{" "} diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index a9a31f2aa14..2b8bec1a75f 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -4,6 +4,7 @@ import dayjs from "dayjs"; import { lazy, useCallback, useEffect, useState } from "react"; import { useDispatch } from "react-redux"; import { + CONSCIOUSNESS_LEVEL, PATIENT_CATEGORIES, REVIEW_AT_CHOICES, RHYTHM_CHOICES, @@ -35,6 +36,7 @@ import TextAreaFormField from "../Form/FormFields/TextAreaFormField"; import TextFormField from "../Form/FormFields/TextFormField"; import { FieldChangeEvent } from "../Form/FormFields/Utils"; import PatientCategorySelect from "./PatientCategorySelect"; +import RadioFormField from "../Form/FormFields/RadioFormField"; const Loading = lazy(() => import("../Common/Loading")); const initForm: any = { @@ -59,6 +61,7 @@ const initForm: any = { rhythm: "0", rhythm_detail: "", ventilator_spo2: null, + consciousness_level: "Unknown", // bed: null, }; @@ -129,6 +132,7 @@ export const DailyRounds = (props: any) => { "ventilator_spo2", "rhythm", "rhythm_detail", + "consciousness_level", ]; useEffect(() => { @@ -312,6 +316,7 @@ export const DailyRounds = (props: any) => { rhythm: Number(state.form.rhythm) || 0, rhythm_detail: state.form.rhythm_detail, ventilator_spo2: state.form.ventilator_spo2, + consciousness_level: state.form.consciousness_level, }; } } else { @@ -637,9 +642,21 @@ export const DailyRounds = (props: any) => { + + ({ + label: level.text, + value: level.id, + }))} + optionDisplay={(option) => option.label} + optionValue={(option) => option.value} + containerClassName="grid gap-1 grid-cols-1" /> )}