From 542f41f5f00519a156c787d3be3213de8f75869d Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 11 Sep 2024 13:14:25 +0530 Subject: [PATCH 01/17] Improved Nursing Care UI; fixes #8521 --- .../LogUpdate/Sections/NursingCare.tsx | 106 +++++++++--------- src/Locale/en/Common.json | 4 +- src/Locale/en/LogUpdate.json | 3 +- 3 files changed, 55 insertions(+), 58 deletions(-) diff --git a/src/Components/LogUpdate/Sections/NursingCare.tsx b/src/Components/LogUpdate/Sections/NursingCare.tsx index ffb4a445125..eb610dcc2d7 100644 --- a/src/Components/LogUpdate/Sections/NursingCare.tsx +++ b/src/Components/LogUpdate/Sections/NursingCare.tsx @@ -1,9 +1,8 @@ import { useTranslation } from "react-i18next"; import { NURSING_CARE_PROCEDURES } from "../../../Common/constants"; -import { classNames } from "../../../Utils/utils"; -import CheckBoxFormField from "../../Form/FormFields/CheckBoxFormField"; import TextAreaFormField from "../../Form/FormFields/TextAreaFormField"; import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils"; +import { MultiSelectFormField } from "../../Form/FormFields/SelectFormField"; const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { const { t } = useTranslation(); @@ -11,59 +10,56 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { return (
- {NURSING_CARE_PROCEDURES.map((procedure, i) => { - const obj = nursing.find((n) => n.procedure === procedure); - - return ( -
-
- { - if (e.value) { - onChange({ - nursing: [...nursing, { procedure, description: "" }], - }); - } else { - onChange({ - nursing: nursing.filter((n) => n.procedure !== procedure), - }); - } - }} - errorClassName="hidden" - /> -
- {obj && ( -
- - onChange({ - nursing: nursing.map((n) => - n.procedure === procedure - ? { ...n, description: val.value } - : n, - ), - }) - } - placeholder="Description" - errorClassName="hidden" - /> -
- )} -
- ); - })} + p.procedure)} + onChange={({ value }) => { + onChange({ + nursing: value.map((procedure) => ({ + procedure, + description: + nursing.find((p) => p.procedure === procedure)?.description ?? + "", + })), + }); + }} + options={NURSING_CARE_PROCEDURES} + optionLabel={(procedure) => t(`NURSING_CARE_PROCEDURE__${procedure}`)} + optionValue={(o) => o} + errorClassName="hidden" + /> + {!!nursing.length && ( + + + {nursing.map((obj) => ( + + + + + ))} + +
+ {t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)} + + + onChange({ + nursing: nursing.map((n) => + n.procedure === obj.procedure + ? { ...n, description: val.value } + : n, + ), + }) + } + rows={2} + placeholder={t("add_remarks")} + errorClassName="hidden" + /> +
+ )}
); }; diff --git a/src/Locale/en/Common.json b/src/Locale/en/Common.json index 432d5979bed..2bb82c076de 100644 --- a/src/Locale/en/Common.json +++ b/src/Locale/en/Common.json @@ -203,6 +203,6 @@ "deleted_successfully": "{{name}} deleted successfully", "delete_item": "Delete {{name}}", "unsupported_browser": "Unsupported Browser", - "unsupported_browser_description": "Your browser ({{name}} version {{version}}) is not supported. Please update your browser to the latest version or switch to a supported browser for the best experience." - + "unsupported_browser_description": "Your browser ({{name}} version {{version}}) is not supported. Please update your browser to the latest version or switch to a supported browser for the best experience.", + "add_remarks": "Add remarks" } \ No newline at end of file diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index 080e2fc979a..fb7963cd932 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -69,5 +69,6 @@ "pulse": "Pulse", "bradycardia": "Bradycardia", "tachycardia": "Tachycardia", - "spo2": "SpO₂" + "spo2": "SpO₂", + "procedures_select_placeholder": "Select procedures to add details" } \ No newline at end of file From d395aa09aa44e55da0e1f8d0190434e1857bb68e Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 11 Sep 2024 13:16:42 +0530 Subject: [PATCH 02/17] make multi-select menu options type immutable --- src/Components/Form/FormFields/SelectFormField.tsx | 2 +- src/Components/Form/MultiSelectMenuV2.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Components/Form/FormFields/SelectFormField.tsx b/src/Components/Form/FormFields/SelectFormField.tsx index 75c9c5741f9..9607e26bbdf 100644 --- a/src/Components/Form/FormFields/SelectFormField.tsx +++ b/src/Components/Form/FormFields/SelectFormField.tsx @@ -46,7 +46,7 @@ export const SelectFormField = (props: SelectFormFieldProps) => { type MultiSelectFormFieldProps = FormFieldBaseProps & { placeholder?: React.ReactNode; - options: T[]; + options: readonly T[]; optionLabel: OptionCallback; optionSelectedLabel?: OptionCallback; optionDescription?: OptionCallback; diff --git a/src/Components/Form/MultiSelectMenuV2.tsx b/src/Components/Form/MultiSelectMenuV2.tsx index d3a46cdb1f9..2cf47584dda 100644 --- a/src/Components/Form/MultiSelectMenuV2.tsx +++ b/src/Components/Form/MultiSelectMenuV2.tsx @@ -14,7 +14,7 @@ type OptionCallback = (option: T) => R; type Props = { id?: string; - options: T[]; + options: readonly T[]; value: V[] | undefined; placeholder?: ReactNode; optionLabel: OptionCallback; From dcce340216fecf02370b607188892da1d18b16e9 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Thu, 12 Sep 2024 13:21:47 +0530 Subject: [PATCH 03/17] Adds support for community nurses log update --- src/Common/constants.tsx | 59 +++++ src/Components/LogUpdate/Sections/index.tsx | 1 + src/Components/Patient/DailyRounds.tsx | 262 ++++++++++++++++---- src/Components/Patient/models.tsx | 18 ++ src/Locale/en/Consultation.json | 2 +- src/Locale/en/LogUpdate.json | 55 +++- 6 files changed, 341 insertions(+), 56 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 681fe874475..ae8cd2278ba 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -795,6 +795,65 @@ export const RHYTHM_CHOICES = [ { id: 10, text: "IRREGULAR", desc: "Irregular" }, ] as const; +export const BOWEL_DIFFICULTY_CHOICES = [ + "NO_DIFFICULTY", + "CONSTIPATION", + "DIARRHOEA", +] as const; + +export const BLADDER_DRAINAGE_CHOICES = [ + "NORMAL", + "CONDOM_CATHETER", + "DIAPER", + "INTERMITTENT_CATHETER", + "CONTINUOUS_INDWELLING_CATHETER", + "CONTINUOUS_SUPRAPUBIC_CATHETER", + "UROSTOMY", +] as const; + +export const BLADDER_ISSUE_CHOICES = [ + "NO_ISSUES", + "INCONTINENCE", + "RETENTION", + "HESITANCY", +] as const; + +export const URINATION_FREQUENCY_CHOICES = [ + "NORMAL", + "DECREASED", + "INCREASED", +] as const; + +export const SLEEP_CHOICES = [ + "EXCESSIVE", + "SATISFACTORY", + "UNSATISFACTORY", + "NO_SLEEP", +] as const; + +export const NUTRITION_ROUTE_CHOICES = [ + "ORAL", + "RYLES_TUBE", + "GASTROSTOMY_OR_JEJUNOSTOMY", + "PEG", + "PARENTERAL_TUBING_FLUID", + "PARENTERAL_TUBING_TPN", +] as const; + +export const ORAL_ISSUE_CHOICES = [ + "NO_ISSUE", + "DYSPHAGIA", + "ODYNOPHAGIA", +] as const; + +export const APPETITE_CHOICES = [ + "INCREASED", + "SATISFACTORY", + "REDUCED", + "NO_TASTE_FOR_FOOD", + "CANNOT_BE_ASSESSED", +] as const; + export const LOCATION_BED_TYPES = [ { id: "ISOLATION", name: "Isolation" }, { id: "ICU", name: "ICU" }, diff --git a/src/Components/LogUpdate/Sections/index.tsx b/src/Components/LogUpdate/Sections/index.tsx index bccc0578095..97328f74c92 100644 --- a/src/Components/LogUpdate/Sections/index.tsx +++ b/src/Components/LogUpdate/Sections/index.tsx @@ -44,6 +44,7 @@ export const RoundTypeSections = { "NursingCare", ], DOCTORS_LOG: ["NeurologicalMonitoring", "RespiratorySupport"], + COMMUNITY_NURSES_LOG: [], } as const satisfies Record< (typeof DailyRoundTypes)[number], (keyof typeof LogUpdateSections)[] diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 0f0c7396f5e..c45de1c9016 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -3,11 +3,19 @@ import { navigate } from "raviger"; import dayjs from "dayjs"; import { lazy, useCallback, useEffect, useState } from "react"; import { + APPETITE_CHOICES, + BLADDER_DRAINAGE_CHOICES, + BLADDER_ISSUE_CHOICES, + BOWEL_DIFFICULTY_CHOICES, CONSCIOUSNESS_LEVEL, + NUTRITION_ROUTE_CHOICES, + ORAL_ISSUE_CHOICES, PATIENT_CATEGORIES, REVIEW_AT_CHOICES, RHYTHM_CHOICES, + SLEEP_CHOICES, TELEMEDICINE_ACTIONS, + URINATION_FREQUENCY_CHOICES, } from "../../Common/constants"; import useAppHistory from "../../Common/hooks/useAppHistory"; import { DraftSection, useAutoSaveReducer } from "../../Utils/AutoSave"; @@ -30,7 +38,7 @@ import request from "../../Utils/request/request"; import routes from "../../Redux/api"; import { Scribe } from "../Scribe/Scribe"; import { SCRIBE_FORMS } from "../Scribe/formDetails"; -import { DailyRoundsModel } from "./models"; +import { DailyRoundsModel, DailyRoundTypes } from "./models"; import InvestigationBuilder from "../Common/prescription-builder/InvestigationBuilder"; import { FieldErrorText } from "../Form/FormFields/FormField"; import { error } from "@pnotify/core"; @@ -48,6 +56,7 @@ import CheckBoxFormField from "../Form/FormFields/CheckBoxFormField"; import SymptomsApi from "../Symptoms/api"; import { scrollTo } from "../../Utils/utils"; import { ICD11DiagnosisModel } from "../Facility/models"; +import NursingCare from "../LogUpdate/Sections/NursingCare"; const Loading = lazy(() => import("../Common/Loading")); @@ -281,6 +290,16 @@ export const DailyRounds = (props: any) => { } return; } + + case "oral_issue": { + if (state.form.nutrition_route !== "ORAL" && state.form[field]) { + errors[field] = t("oral_issue_for_non_oral_nutrition_route_error"); + invalidForm = true; + break; + } + return; + } + default: return; } @@ -329,7 +348,7 @@ export const DailyRounds = (props: any) => { review_interval: Number(prevReviewInterval), }; - if (!["VENTILATOR"].includes(state.form.rounds_type)) { + if (state.form.rounds_type !== "VENTILATOR") { data = { ...data, bp: state.form.bp ?? {}, @@ -340,6 +359,15 @@ export const DailyRounds = (props: any) => { rhythm_detail: state.form.rhythm_detail, ventilator_spo2: state.form.ventilator_spo2 ?? null, consciousness_level: state.form.consciousness_level || undefined, + bowel_difficulty: state.form.bowel_difficulty ?? null, + bladder_drainage: state.form.bladder_drainage ?? null, + bladder_issue: state.form.bladder_issue ?? null, + is_experiencing_dysuria: state.form.is_experiencing_dysuria ?? null, + urination_frequency: state.form.urination_frequency ?? null, + sleep: state.form.sleep ?? null, + nutrition_route: state.form.nutrition_route ?? null, + oral_issue: state.form.oral_issue ?? null, + appetite: state.form.appetite ?? null, }; } @@ -408,6 +436,7 @@ export const DailyRounds = (props: any) => { const field = (name: string) => { return { id: name, + label: t(`LOG_UPDATE_FIELD_LABEL__${name}`), name, value: state.form[name], error: state.errors[name], @@ -415,6 +444,19 @@ export const DailyRounds = (props: any) => { }; }; + const selectField = ( + name: keyof DailyRoundsModel, + options: readonly T[], + ) => { + return { + ...field(name), + options, + optionLabel: (option: T) => t(`${name.toUpperCase()}__${option}`), + optionDisplay: (option: T) => t(`${name.toUpperCase()}__${option}`), // Duplicate as radio form field uses prop name `optionDisplay` instead. TODO: convert all `optionDisplay` to `optionLabel` of radio form field for consistency with other reusable components + optionValue: (option: T) => option, + }; + }; + const getExpectedReviewTime = () => { const nextReviewTime = Number( state.form.review_interval || prevReviewInterval, @@ -428,24 +470,20 @@ export const DailyRounds = (props: any) => { return ; } - const roundTypes: { id: string; text: string }[] = []; + const roundTypes: (typeof DailyRoundTypes)[number][] = []; if ( ["Doctor", "Staff", "DistrictAdmin", "StateAdmin"].includes( authUser.user_type, ) ) { - roundTypes.push({ id: "DOCTORS_LOG", text: t("DOCTORS_LOG") }); + roundTypes.push("DOCTORS_LOG"); } - - roundTypes.push( - { id: "NORMAL", text: t("NORMAL") }, - { id: "VENTILATOR", text: t("VENTILATOR") }, - ); - + roundTypes.push("NORMAL", "COMMUNITY_NURSES_LOG", "VENTILATOR"); if (consultationSuggestion === "DC") { - roundTypes.push({ id: "TELEMEDICINE", text: t("TELEMEDICINE") }); + roundTypes.push("TELEMEDICINE"); } + const submitButtonDisabled = (() => { if (buttonText !== "Save") { return false; @@ -539,7 +577,7 @@ export const DailyRounds = (props: any) => { "additional_symptoms", ].includes(f), ) && - roundTypes.some((t) => t.id === "DOCTORS_LOG") + roundTypes.some((t) => t === "DOCTORS_LOG") ) { rounds_type = "DOCTORS_LOG"; } @@ -577,13 +615,9 @@ export const DailyRounds = (props: any) => {
option.text} - optionValue={(option) => option.id} />
@@ -621,41 +655,60 @@ export const DailyRounds = (props: any) => { rows={5} /> - {state.form.rounds_type !== "DOCTORS_LOG" && ( + {state.form.rounds_type === "COMMUNITY_NURSES_LOG" && ( <> +
+

Routine

+ option.desc} - optionValue={(option) => option.text} - value={prevAction} - onChange={(event) => { - handleFormFieldChange(event); - setPreviousAction(event.value); - }} - /> - - option.text} - optionValue={(option) => option.id} - value={prevReviewInterval} - onChange={(event) => { - handleFormFieldChange(event); - setPreviousReviewInterval(Number(event.value)); - }} + {...selectField("bowel_difficulty", BOWEL_DIFFICULTY_CHOICES)} /> +
+
Bladder
+ + + (c ? "Yes" : "No")} + /> + +
+
+
Nutrition
+ + + +
)} - {["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes( - state.form.rounds_type, - ) && ( + {[ + "NORMAL", + "TELEMEDICINE", + "DOCTORS_LOG", + "COMMUNITY_NURSES_LOG", + ].includes(state.form.rounds_type) && ( <> +

Vitals

{ }, ]} /> + + )} + + {state.form.rounds_type === "COMMUNITY_NURSES_LOG" && ( + <> + + + )} + {["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes( + state.form.rounds_type, + ) && ( + <> { /> ({ - label: t(`CONSCIOUSNESS_LEVEL__${level.value}`), - value: level.value, - }))} - optionDisplay={(option) => option.label} - optionValue={(option) => option.value} + {...selectField( + "consciousness_level", + CONSCIOUSNESS_LEVEL.map((a) => a.value), + )} unselectLabel="Unknown" layout="vertical" /> )} + {state.form.rounds_type === "COMMUNITY_NURSES_LOG" && ( +
+
+
+

+ {t("prescription_medications")} +

+ + setShowDiscontinuedPrescriptions(value) + } + errorClassName="hidden" + /> +
+ +
+ )} + + {state.form.rounds_type === "COMMUNITY_NURSES_LOG" && ( +
+
+
+

Nursing Care

+
+ + handleFormFieldChange({ name: "nursing", value: log.nursing }) + } + /> +
+ )} + {state.form.rounds_type === "DOCTORS_LOG" && ( <>
@@ -860,6 +984,38 @@ export const DailyRounds = (props: any) => {
)} + + {state.form.rounds_type !== "DOCTORS_LOG" && ( + <> +
+ option.desc} + optionValue={(option) => option.text} + value={prevAction} + onChange={(event) => { + handleFormFieldChange(event); + setPreviousAction(event.value); + }} + /> + + option.text} + optionValue={(option) => option.id} + value={prevReviewInterval} + onChange={(event) => { + handleFormFieldChange(event); + setPreviousReviewInterval(Number(event.value)); + }} + /> + + )}
diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 7676d294b4c..f23b87d3543 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -1,18 +1,26 @@ import { ConsultationModel, PatientCategory } from "../Facility/models"; import { PerformedByModel } from "../HCX/misc"; import { + APPETITE_CHOICES, + BLADDER_DRAINAGE_CHOICES, + BLADDER_ISSUE_CHOICES, + BOWEL_DIFFICULTY_CHOICES, CONSCIOUSNESS_LEVEL, HEARTBEAT_RHYTHM_CHOICES, HumanBodyRegion, INSULIN_INTAKE_FREQUENCY_OPTIONS, LIMB_RESPONSE_OPTIONS, NURSING_CARE_PROCEDURES, + NUTRITION_ROUTE_CHOICES, OCCUPATION_TYPES, + ORAL_ISSUE_CHOICES, OXYGEN_MODALITY_OPTIONS, PressureSoreExudateAmountOptions, PressureSoreTissueTypeOptions, RATION_CARD_CATEGORY, RESPIRATORY_SUPPORT, + SLEEP_CHOICES, + URINATION_FREQUENCY_CHOICES, VENTILATOR_MODE_OPTIONS, } from "../../Common/constants"; @@ -280,6 +288,7 @@ export interface SampleListModel { export const DailyRoundTypes = [ "NORMAL", + "COMMUNITY_NURSES_LOG", "DOCTORS_LOG", "VENTILATOR", "AUTOMATED", @@ -393,6 +402,15 @@ export interface DailyRoundsModel { ventilator_tidal_volume?: number; pressure_sore?: IPressureSore[]; + bowel_difficulty?: (typeof BOWEL_DIFFICULTY_CHOICES)[number]; + bladder_drainage?: (typeof BLADDER_DRAINAGE_CHOICES)[number]; + bladder_issue?: (typeof BLADDER_ISSUE_CHOICES)[number]; + is_experiencing_dysuria?: boolean; + urination_frequency?: (typeof URINATION_FREQUENCY_CHOICES)[number]; + sleep?: (typeof SLEEP_CHOICES)[number]; + nutrition_route?: (typeof NUTRITION_ROUTE_CHOICES)[number]; + oral_issue?: (typeof ORAL_ISSUE_CHOICES)[number]; + appetite?: (typeof APPETITE_CHOICES)[number]; } export interface FacilityNameModel { diff --git a/src/Locale/en/Consultation.json b/src/Locale/en/Consultation.json index 65ea63e875c..b55dd6b180a 100644 --- a/src/Locale/en/Consultation.json +++ b/src/Locale/en/Consultation.json @@ -56,4 +56,4 @@ "encounter_duration_confirmation": "The duration of this encounter would be", "consultation_notes": "General Instructions (Advice)", "procedure_suggestions": "Procedure Suggestions" -} +} \ No newline at end of file diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index fb7963cd932..585a31f87e0 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -1,4 +1,19 @@ { + "LOG_UPDATE_FIELD_LABEL__rounds_type": "Rounds Type", + "LOG_UPDATE_FIELD_LABEL__consciousness_level": "Level Of Consciousness", + "LOG_UPDATE_FIELD_LABEL__sleep": "Sleep", + "LOG_UPDATE_FIELD_LABEL__bowel_difficulty": "Bowel", + "LOG_UPDATE_FIELD_LABEL__bladder_drainage": "Bladder Drainage", + "LOG_UPDATE_FIELD_LABEL__bladder_issue": "Bladder Issues", + "LOG_UPDATE_FIELD_LABEL__urination_frequency": "Frequency of Urination", + "LOG_UPDATE_FIELD_LABEL__nutrition_route": "Nutrition Route", + "LOG_UPDATE_FIELD_LABEL__oral_issue": "Oral issues", + "LOG_UPDATE_FIELD_LABEL__appetite": "Appetite", + "ROUNDS_TYPE__NORMAL": "Brief Update", + "ROUNDS_TYPE__COMMUNITY_NURSES_LOG": "Community Nurse's Log", + "ROUNDS_TYPE__VENTILATOR": "Detailed Update", + "ROUNDS_TYPE__DOCTORS_LOG": "Progress Note", + "ROUNDS_TYPE__AUTOMATED": "Automated", "RESPIRATORY_SUPPORT_SHORT__UNKNOWN": "None", "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O2 Support", "RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE": "NIV", @@ -20,11 +35,46 @@ "CONSCIOUSNESS_LEVEL__ALERT": "Alert", "CONSCIOUSNESS_LEVEL__AGITATED_OR_CONFUSED": "Agitated or Confused", "CONSCIOUSNESS_LEVEL__ONSET_OF_AGITATION_AND_CONFUSION": "Onset of Agitation and Confusion", + "BOWEL_DIFFICULTY__NO_DIFFICULTY": "No difficulty", + "BOWEL_DIFFICULTY__CONSTIPATION": "Constipation", + "BOWEL_DIFFICULTY__DIARRHOEA": "Diarrhoea", + "BLADDER_DRAINAGE__NORMAL": "Normal", + "BLADDER_DRAINAGE__CONDOM_CATHETER": "Condom Catheter", + "BLADDER_DRAINAGE__DIAPER": "Diaper", + "BLADDER_DRAINAGE__INTERMITTENT_CATHETER": "Intermittent Catheter", + "BLADDER_DRAINAGE__CONTINUOUS_INDWELLING_CATHETER": "Continuous Indwelling Catheter", + "BLADDER_DRAINAGE__CONTINUOUS_SUPRAPUBIC_CATHETER": "Continuous Suprapubic Catheter", + "BLADDER_DRAINAGE__UROSTOMY": "Urostomy", + "BLADDER_ISSUE__NO_ISSUES": "No issues", + "BLADDER_ISSUE__INCONTINENCE": "Incontinence", + "BLADDER_ISSUE__RETENTION": "Retention", + "BLADDER_ISSUE__HESITANCY": "Hesitancy", + "URINATION_FREQUENCY__NORMAL": "Normal", + "URINATION_FREQUENCY__DECREASED": "Decreased", + "URINATION_FREQUENCY__INCREASED": "Increased", + "SLEEP__EXCESSIVE": "Excessive", + "SLEEP__SATISFACTORY": "Satisfactory", + "SLEEP__UNSATISFACTORY": "Unsatisfactory", + "SLEEP__NO_SLEEP": "No sleep", + "NUTRITION_ROUTE__ORAL": "Oral", + "NUTRITION_ROUTE__RYLES_TUBE": "Ryle's Tube", + "NUTRITION_ROUTE__GASTROSTOMY_OR_JEJUNOSTOMY": "Gastrostomy/Jejunostomy", + "NUTRITION_ROUTE__PEG": "PEG", + "NUTRITION_ROUTE__PARENTERAL_TUBING_FLUID": "Parenteral Tubing (Fluid)", + "NUTRITION_ROUTE___TPN": "Parenteral Tubing (TPN)", + "ORAL_ISSUE__NO_ISSUE": "No issues", + "ORAL_ISSUE__DYSPHAGIA": "Dysphagia", + "ORAL_ISSUE__ODYNOPHAGIA": "Odynophagia", + "APPETITE__INCREASED": "Increased", + "APPETITE__SATISFACTORY": "Satisfactory", + "APPETITE__REDUCED": "Reduced", + "APPETITE__NO_TASTE_FOR_FOOD": "No taste for food", + "APPETITE__CANNOT_BE_ASSESSED": "Cannot be assessed", "PUPIL_REACTION__UNKNOWN": "Unknown", "PUPIL_REACTION__BRISK": "Brisk", "PUPIL_REACTION__SLUGGISH": "Sluggish", "PUPIL_REACTION__FIXED": "Fixed", - "PUPIL_REACTION__CANNOT_BE_ASSESSED": "Cannot Be Assessed", + "PUPIL_REACTION__CANNOT_BE_ASSESSED": "Cannot be assessed", "LIMB_RESPONSE__UNKNOWN": "Unknown", "LIMB_RESPONSE__STRONG": "Strong", "LIMB_RESPONSE__MODERATE": "Moderate", @@ -70,5 +120,6 @@ "bradycardia": "Bradycardia", "tachycardia": "Tachycardia", "spo2": "SpO₂", - "procedures_select_placeholder": "Select procedures to add details" + "procedures_select_placeholder": "Select procedures to add details", + "oral_issue_for_non_oral_nutrition_route_error": "Can be specified only if nutrition route is set to Oral" } \ No newline at end of file From ba1cc2397719883e4cb3281327e3a7f82c26b22d Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 13 Sep 2024 13:06:14 +0530 Subject: [PATCH 04/17] fix error: no key for repeating elements; fix i18n's; fix missing values in handleSubmit --- .../LogUpdate/Sections/NursingCare.tsx | 2 +- src/Components/Patient/DailyRounds.tsx | 40 ++++++++++++------- src/Locale/en/LogUpdate.json | 8 ++-- 3 files changed, 31 insertions(+), 19 deletions(-) diff --git a/src/Components/LogUpdate/Sections/NursingCare.tsx b/src/Components/LogUpdate/Sections/NursingCare.tsx index eb610dcc2d7..f4dd34d5e1b 100644 --- a/src/Components/LogUpdate/Sections/NursingCare.tsx +++ b/src/Components/LogUpdate/Sections/NursingCare.tsx @@ -33,7 +33,7 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { {nursing.map((obj) => ( - + diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index c45de1c9016..f9e78b136e8 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -359,15 +359,17 @@ export const DailyRounds = (props: any) => { rhythm_detail: state.form.rhythm_detail, ventilator_spo2: state.form.ventilator_spo2 ?? null, consciousness_level: state.form.consciousness_level || undefined, - bowel_difficulty: state.form.bowel_difficulty ?? null, - bladder_drainage: state.form.bladder_drainage ?? null, - bladder_issue: state.form.bladder_issue ?? null, - is_experiencing_dysuria: state.form.is_experiencing_dysuria ?? null, - urination_frequency: state.form.urination_frequency ?? null, - sleep: state.form.sleep ?? null, - nutrition_route: state.form.nutrition_route ?? null, - oral_issue: state.form.oral_issue ?? null, - appetite: state.form.appetite ?? null, + bowel_difficulty: state.form.bowel_difficulty, + bladder_drainage: state.form.bladder_drainage, + bladder_issue: state.form.bladder_issue, + is_experiencing_dysuria: state.form.is_experiencing_dysuria, + urination_frequency: state.form.urination_frequency, + sleep: state.form.sleep, + nutrition_route: state.form.nutrition_route, + oral_issue: state.form.oral_issue, + appetite: state.form.appetite, + blood_sugar_level: state.form.blood_sugar_level, + nursing: state.form.nursing, }; } @@ -403,10 +405,16 @@ export const DailyRounds = (props: any) => { if (obj) { dispatch({ type: "set_form", form: initForm }); Notification.Success({ - msg: `${t(state.form.rounds_type)} log created successfully`, + msg: t("LOG_UPDATE_CREATED_NOTIFICATION", { + roundType: t(`ROUNDS_TYPE__${state.form.rounds_type}`), + }), }); - if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) { + if ( + ["NORMAL", "TELEMEDICINE", "COMMUNITY_NURSES_LOG"].includes( + state.form.rounds_type, + ) + ) { navigate( `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`, ); @@ -489,7 +497,11 @@ export const DailyRounds = (props: any) => { return false; } - if (["VENTILATOR", "DOCTORS_LOG"].includes(state.form.rounds_type)) { + if ( + ["VENTILATOR", "DOCTORS_LOG", "COMMUNITY_NURSES_LOG"].includes( + state.form.rounds_type, + ) + ) { return false; } @@ -672,9 +684,7 @@ export const DailyRounds = (props: any) => { {...selectField("bladder_issue", BLADDER_ISSUE_CHOICES)} /> (c ? "Yes" : "No")} /> diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index 585a31f87e0..64c2107feb3 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -1,10 +1,12 @@ { + "LOG_UPDATE_CREATED_NOTIFICATION": "{{ roundType }} created successfully", "LOG_UPDATE_FIELD_LABEL__rounds_type": "Rounds Type", - "LOG_UPDATE_FIELD_LABEL__consciousness_level": "Level Of Consciousness", + "LOG_UPDATE_FIELD_LABEL__consciousness_level": "Level of Consciousness", "LOG_UPDATE_FIELD_LABEL__sleep": "Sleep", "LOG_UPDATE_FIELD_LABEL__bowel_difficulty": "Bowel", "LOG_UPDATE_FIELD_LABEL__bladder_drainage": "Bladder Drainage", "LOG_UPDATE_FIELD_LABEL__bladder_issue": "Bladder Issues", + "LOG_UPDATE_FIELD_LABEL__is_experiencing_dysuria": "Experiences Dysuria?", "LOG_UPDATE_FIELD_LABEL__urination_frequency": "Frequency of Urination", "LOG_UPDATE_FIELD_LABEL__nutrition_route": "Nutrition Route", "LOG_UPDATE_FIELD_LABEL__oral_issue": "Oral issues", @@ -13,7 +15,7 @@ "ROUNDS_TYPE__COMMUNITY_NURSES_LOG": "Community Nurse's Log", "ROUNDS_TYPE__VENTILATOR": "Detailed Update", "ROUNDS_TYPE__DOCTORS_LOG": "Progress Note", - "ROUNDS_TYPE__AUTOMATED": "Automated", + "ROUNDS_TYPE__AUTOMATED": "Virtual Nursing Assistant", "RESPIRATORY_SUPPORT_SHORT__UNKNOWN": "None", "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O2 Support", "RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE": "NIV", @@ -61,7 +63,7 @@ "NUTRITION_ROUTE__GASTROSTOMY_OR_JEJUNOSTOMY": "Gastrostomy/Jejunostomy", "NUTRITION_ROUTE__PEG": "PEG", "NUTRITION_ROUTE__PARENTERAL_TUBING_FLUID": "Parenteral Tubing (Fluid)", - "NUTRITION_ROUTE___TPN": "Parenteral Tubing (TPN)", + "NUTRITION_ROUTE__PARENTERAL_TUBING_TPN": "Parenteral Tubing (TPN)", "ORAL_ISSUE__NO_ISSUE": "No issues", "ORAL_ISSUE__DYSPHAGIA": "Dysphagia", "ORAL_ISSUE__ODYNOPHAGIA": "Odynophagia", From cb23669d3eefea400fd05034c21e06ba05fb4fa3 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 13 Sep 2024 14:12:12 +0530 Subject: [PATCH 05/17] Update view details page; fixes #8532 --- .../DailyRounds/DefaultLogUpdateCard.tsx | 2 +- .../LogUpdate/CriticalCarePreview.tsx | 121 ++++++++++++++++-- 2 files changed, 109 insertions(+), 14 deletions(-) diff --git a/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx b/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx index 9096e66b69b..e7759395615 100644 --- a/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx @@ -21,7 +21,7 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => { > -

Consultation Updates

+

+ Consultation Updates +
+ {t(`ROUNDS_TYPE__${data.rounds_type}`)} +
+

- {/* */}
+
+ + +
+ + + + +
+
+ + + +
+
+
{(["left", "right"] as const).map((dir) => ( -
+
{dir} Pupil
{ +type SectionContextType = { + hasValue: () => void; +}; + +const sectionContext = React.createContext(null); + +const Section = (props: { + title: string; + children: React.ReactNode; + subSection?: boolean; +}) => { + const parentContext = React.useContext(sectionContext); + const [hasValue, setHasValue] = React.useState(false); + + useEffect(() => { + if (parentContext && hasValue) { + parentContext.hasValue(); + } + }, [parentContext, hasValue]); + return ( -
setHasValue(true), + }} > -

{props.title}

- {props.children} -
+
+ {props.subSection ? ( +
{props.title}
+ ) : ( +

{props.title}

+ )} + {props.children} +
+ ); }; const Detail = (props: { label: React.ReactNode; - value?: string | number | boolean; + value?: string | number | boolean | null; suffix?: React.ReactNode; }) => { + const context = React.useContext(sectionContext); + + if (context === null) { + throw "This component must be used as a descendant of Section component only"; + } + let value = props.value; - value = value === "" ? undefined : value; + value = value === "" ? null : value; value = value === true ? "Yes" : value; value = value === false ? "No" : value; + React.useEffect(() => { + if (value != null) { + context.hasValue(); + } + }, [context, value]); + + if (value == null) { + // Skip showing detail if attribute not filled. + return null; + } + value = typeof value === "string" ? parseFloat(value) || value : value; value = typeof value === "number" ? properRoundOf(value) : value; @@ -516,6 +592,25 @@ const Detail = (props: { ); }; +const ChoiceDetail = (props: { + name: keyof DailyRoundsModel; + data: DailyRoundsModel; +}) => { + const { t } = useTranslation(); + const value = props.data[props.name]; + + if (value == null) { + return; + } + + return ( + + ); +}; + const RangeDetail = (props: { label: React.ReactNode; value?: number; From 20cb8ee2216487286b5f85ba81689434c5f5e2a0 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 13 Sep 2024 14:20:45 +0530 Subject: [PATCH 06/17] skip parent is section check; coz why not detail be present outside section too --- src/Components/LogUpdate/CriticalCarePreview.tsx | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Components/LogUpdate/CriticalCarePreview.tsx b/src/Components/LogUpdate/CriticalCarePreview.tsx index 0f33bdfe7af..23efc98028f 100644 --- a/src/Components/LogUpdate/CriticalCarePreview.tsx +++ b/src/Components/LogUpdate/CriticalCarePreview.tsx @@ -555,17 +555,13 @@ const Detail = (props: { }) => { const context = React.useContext(sectionContext); - if (context === null) { - throw "This component must be used as a descendant of Section component only"; - } - let value = props.value; value = value === "" ? null : value; value = value === true ? "Yes" : value; value = value === false ? "No" : value; React.useEffect(() => { - if (value != null) { + if (context && value != null) { context.hasValue(); } }, [context, value]); From beb083359ea3cd2314bab53f1ea5474ab26701bd Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 13 Sep 2024 15:16:38 +0530 Subject: [PATCH 07/17] fix pressure sore and I/O balance accidentally getting hidden --- .../LogUpdate/CriticalCarePreview.tsx | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/src/Components/LogUpdate/CriticalCarePreview.tsx b/src/Components/LogUpdate/CriticalCarePreview.tsx index 23efc98028f..83024681625 100644 --- a/src/Components/LogUpdate/CriticalCarePreview.tsx +++ b/src/Components/LogUpdate/CriticalCarePreview.tsx @@ -312,6 +312,12 @@ export default function CriticalCarePreview(props: Props) { s.fields.flatMap((f) => data[f.key] ?? []), ).length && (
+ + s.fields.map((f) => f.key), + )} + />
{IOBalanceSections.map(({ name, fields }) => (
@@ -387,6 +393,7 @@ export default function CriticalCarePreview(props: Props) { )}
+ { + const context = React.useContext(sectionContext); + + useEffect(() => { + if ( + context && + props.fields.some( + (field) => props.data[field] != null && props.data[field] !== "", + ) + ) { + context.hasValue(); + } + }, [props.data, context]); + + return null; +}; + const ChoiceDetail = (props: { name: keyof DailyRoundsModel; data: DailyRoundsModel; From 08cc4d9dd1bc61694d0b18bd3acbdee290635871 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Fri, 13 Sep 2024 21:30:10 +0530 Subject: [PATCH 08/17] FIxes issues reported in QA * Fixes form responsiveness in mobile displays * Fixes bugs in view details page * Fixes update log redirection * Fixes #8534 - Show patient category --- .../DailyRounds/DefaultLogUpdateCard.tsx | 29 +++- .../Consultations/DailyRoundsList.tsx | 13 -- .../LogUpdate/CriticalCarePreview.tsx | 130 +++++++++--------- .../LogUpdate/Sections/NursingCare.tsx | 2 +- src/Components/Patient/DailyRounds.tsx | 16 ++- src/Locale/en/Common.json | 1 + src/Locale/en/LogUpdate.json | 1 + 7 files changed, 102 insertions(+), 90 deletions(-) diff --git a/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx b/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx index e7759395615..fa589c89710 100644 --- a/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx +++ b/src/Components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx @@ -4,16 +4,22 @@ import ButtonV2 from "../../../Common/components/ButtonV2"; import { DailyRoundsModel } from "../../../Patient/models"; import LogUpdateCardAttribute from "./LogUpdateCardAttribute"; import { ConsultationModel } from "../../models"; +import { useSlugs } from "../../../../Common/hooks/useSlug"; interface Props { round: DailyRoundsModel; consultationData: ConsultationModel; - onViewDetails: () => void; - onUpdateLog?: () => void; } const DefaultLogUpdateCard = ({ round, ...props }: Props) => { + const [facilityId, patientId, consultationId] = useSlugs( + "facility", + "patient", + "consultation", + ); const { t } = useTranslation(); + const consultationUrl = `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`; + return (
{ ghost size="small" className="w-full" - onClick={props.onViewDetails} + href={ + ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes( + round.rounds_type!, + ) + ? `${consultationUrl}/daily-rounds/${round.id}` + : `${consultationUrl}/daily_rounds/${round.id}` + } > {t("view_details")} @@ -55,7 +67,16 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => { ghost size="small" className="w-full" - onClick={props.onUpdateLog} + href={ + [ + "NORMAL", + "TELEMEDICINE", + "DOCTORS_LOG", + "COMMUNITY_NURSES_LOG", + ].includes(round.rounds_type!) + ? `${consultationUrl}/daily-rounds/${round.id}/update` + : `${consultationUrl}/daily_rounds/${round.id}/update` + } > {t("update_log")} diff --git a/src/Components/Facility/Consultations/DailyRoundsList.tsx b/src/Components/Facility/Consultations/DailyRoundsList.tsx index ddf5b28fd8f..561a4f1a958 100644 --- a/src/Components/Facility/Consultations/DailyRoundsList.tsx +++ b/src/Components/Facility/Consultations/DailyRoundsList.tsx @@ -1,4 +1,3 @@ -import { navigate } from "raviger"; import { DailyRoundsModel } from "../../Patient/models"; import VirtualNursingAssistantLogUpdateCard from "./DailyRounds/VirtualNursingAssistantLogUpdateCard"; import DefaultLogUpdateCard from "./DailyRounds/DefaultLogUpdateCard"; @@ -24,8 +23,6 @@ export default function DailyRoundsList({ consultation }: Props) { const { t } = useTranslation(); const [query, setQuery] = useState(); - const consultationUrl = `/facility/${consultation.facility}/patient/${consultation.patient}/consultation/${consultation.id}`; - return ( navigate(itemUrl)} - onUpdateLog={() => navigate(`${itemUrl}/update`)} /> ); diff --git a/src/Components/LogUpdate/CriticalCarePreview.tsx b/src/Components/LogUpdate/CriticalCarePreview.tsx index 83024681625..7e18e12b107 100644 --- a/src/Components/LogUpdate/CriticalCarePreview.tsx +++ b/src/Components/LogUpdate/CriticalCarePreview.tsx @@ -58,12 +58,13 @@ export default function CriticalCarePreview(props: Props) {

Consultation Updates -
+
{t(`ROUNDS_TYPE__${data.rounds_type}`)}

+ -
- {(["left", "right"] as const).map((dir) => ( -
-
{dir} Pupil
- - {data[`${dir}_pupil_size`] === 0 && ( + {(data.left_pupil_light_reaction || + data.left_pupil_light_reaction_detail || + data.left_pupil_size || + data.left_pupil_size_detail || + data.right_pupil_light_reaction || + data.right_pupil_light_reaction_detail || + data.right_pupil_size || + data.right_pupil_size_detail) && ( +
+ {(["left", "right"] as const).map((dir) => ( +
+
{dir} Pupil
- )} - )} - /> - -
- ))} -
+ + +
+ ))} +
+ )}
-
+
{data.bp && (
Blood Pressure
@@ -304,20 +314,23 @@ export default function CriticalCarePreview(props: Props) { label={t("heartbeat_description")} value={data.rhythm_detail} /> -

Pain Scale

- + {!!data.pain_scale_enhanced?.length && ( + <> +

Pain Scale

+ + + )}
{!!IOBalanceSections.flatMap((s) => s.fields.flatMap((f) => data[f.key] ?? []), ).length && ( -
- - s.fields.map((f) => f.key), - )} - /> +
+ s.fields.map((f) => f.key), + ).some((field) => data[field]?.length)} + >
{IOBalanceSections.map(({ name, fields }) => (
@@ -384,7 +397,7 @@ export default function CriticalCarePreview(props: Props) {
  • ))} @@ -392,8 +405,10 @@ export default function CriticalCarePreview(props: Props) {
    )} -
    - +
    { const parentContext = React.useContext(sectionContext); - const [hasValue, setHasValue] = React.useState(false); + const [hasValue, setHasValue] = React.useState(props.show ?? false); useEffect(() => { if (parentContext && hasValue) { @@ -595,26 +611,6 @@ const Detail = (props: { ); }; -const ShowOnData = (props: { - data: DailyRoundsModel; - fields: (keyof DailyRoundsModel)[]; -}) => { - const context = React.useContext(sectionContext); - - useEffect(() => { - if ( - context && - props.fields.some( - (field) => props.data[field] != null && props.data[field] !== "", - ) - ) { - context.hasValue(); - } - }, [props.data, context]); - - return null; -}; - const ChoiceDetail = (props: { name: keyof DailyRoundsModel; data: DailyRoundsModel; diff --git a/src/Components/LogUpdate/Sections/NursingCare.tsx b/src/Components/LogUpdate/Sections/NursingCare.tsx index f4dd34d5e1b..e97bda64e99 100644 --- a/src/Components/LogUpdate/Sections/NursingCare.tsx +++ b/src/Components/LogUpdate/Sections/NursingCare.tsx @@ -34,7 +34,7 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => {
    {nursing.map((obj) => ( - {nursing.map((obj) => ( - -
    {t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)}
    + {t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)} diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index f9e78b136e8..d74cded6057 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -366,7 +366,7 @@ export const DailyRounds = (props: any) => { urination_frequency: state.form.urination_frequency, sleep: state.form.sleep, nutrition_route: state.form.nutrition_route, - oral_issue: state.form.oral_issue, + oral_issue: state.form.oral_issue ?? undefined, appetite: state.form.appetite, blood_sugar_level: state.form.blood_sugar_level, nursing: state.form.nursing, @@ -384,9 +384,15 @@ export const DailyRounds = (props: any) => { if (obj) { dispatch({ type: "set_form", form: initForm }); Notification.Success({ - msg: `${t(obj.rounds_type as string)} log updated successfully`, + msg: t("LOG_UPDATE_UPDATED_NOTIFICATION", { + roundType: t(`ROUNDS_TYPE__${state.form.rounds_type}`), + }), }); - if (["NORMAL", "TELEMEDICINE"].includes(state.form.rounds_type)) { + if ( + ["NORMAL", "TELEMEDICINE", "COMMUNITY_NURSES_LOG"].includes( + state.form.rounds_type, + ) + ) { navigate( `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}`, ); @@ -675,7 +681,7 @@ export const DailyRounds = (props: any) => { -
    +
    Bladder
    { )} />
    -
    +
    Nutrition
    Date: Tue, 17 Sep 2024 16:27:40 +0530 Subject: [PATCH 09/17] change title from Nursing analysis to Nursing information; i18n consultation tabs --- src/Common/constants.tsx | 16 ---------------- .../ConsultationNursingTab.tsx | 8 +++++++- .../Facility/ConsultationDetails/index.tsx | 19 +++++++++++-------- src/Locale/en/Consultation.json | 15 +++++++++++++++ 4 files changed, 33 insertions(+), 25 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index ae8cd2278ba..9ea454e9c2b 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -773,22 +773,6 @@ export const MOTOR_RESPONSE_SCALE = [ { value: 5, text: "Moves to localized pain" }, { value: 6, text: "Obeying commands/Normal acrivity" }, ]; -export const CONSULTATION_TABS = [ - { text: "UPDATES", desc: "Overview" }, - { text: "FEED", desc: "Feed" }, - { text: "SUMMARY", desc: "Vitals" }, - { text: "ABG", desc: "ABG" }, - { text: "MEDICINES", desc: "Medicines" }, - { text: "FILES", desc: "Files" }, - { text: "INVESTIGATIONS", desc: "Investigations" }, - { text: "NEUROLOGICAL_MONITORING", desc: "Neuro" }, - { text: "VENTILATOR", desc: "Ventilation" }, - { text: "NUTRITION", desc: "Nutrition" }, - { text: "PRESSURE_SORE", desc: "Pressure Sore" }, - { text: "NURSING", desc: "Nursing" }, - { text: "DIALYSIS", desc: "Dialysis" }, - { text: "ABDM", desc: "ABDM Records" }, -]; export const RHYTHM_CHOICES = [ { id: 5, text: "REGULAR", desc: "Regular" }, diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index f8d38b2adb3..a7c6aaf1ece 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -1,13 +1,19 @@ import { lazy } from "react"; import { ConsultationTabProps } from "./index"; import { NursingPlot } from "../Consultations/NursingPlot"; +import { useTranslation } from "react-i18next"; const PageTitle = lazy(() => import("../../Common/PageTitle")); export const ConsultationNursingTab = (props: ConsultationTabProps) => { + const { t } = useTranslation(); return (
    - + import("../../Common/Loading")); const PageTitle = lazy(() => import("../../Common/PageTitle")); @@ -75,6 +77,7 @@ const TABS = { export const ConsultationDetails = (props: any) => { const { facilityId, patientId, consultationId } = props; + const { t } = useTranslation(); let tab = undefined; if (Object.keys(TABS).includes(props.tab.toUpperCase())) { tab = props.tab.toUpperCase() as keyof typeof TABS; @@ -388,8 +391,8 @@ export const ConsultationDetails = (props: any) => { className="flex space-x-6 overflow-x-auto pb-2 pl-2" id="consultation_tab_nav" > - {CONSULTATION_TABS.map((p) => { - if (p.text === "FEED") { + {keysOf(TABS).map((p) => { + if (p === "FEED") { if ( isCameraAttached === false || // No camera attached consultationData?.discharge_date || // Discharged @@ -399,17 +402,17 @@ export const ConsultationDetails = (props: any) => { return null; // Hide feed tab } - if (p.text === "ABDM" && !abhaNumberData?.abha_number) { + if (p === "ABDM" && !abhaNumberData?.abha_number) { return null; } return ( - {p.desc} + {t(`CONSULTATION_TAB__${p}`)} ); })} diff --git a/src/Locale/en/Consultation.json b/src/Locale/en/Consultation.json index 8282656b560..753c6509e2b 100644 --- a/src/Locale/en/Consultation.json +++ b/src/Locale/en/Consultation.json @@ -1,4 +1,19 @@ { + "CONSULTATION_TAB__UPDATES": "Overview", + "CONSULTATION_TAB__FEED": "Feed", + "CONSULTATION_TAB__SUMMARY": "Vitals", + "CONSULTATION_TAB__ABG": "ABG", + "CONSULTATION_TAB__MEDICINES": "Medicines", + "CONSULTATION_TAB__FILES": "Files", + "CONSULTATION_TAB__INVESTIGATIONS": "Investigations", + "CONSULTATION_TAB__NEUROLOGICAL_MONITORING": "Neuro", + "CONSULTATION_TAB__VENTILATOR": "Ventilation", + "CONSULTATION_TAB__NUTRITION": "Nutrition", + "CONSULTATION_TAB__PRESSURE_SORE": "Pressure Sore", + "CONSULTATION_TAB__NURSING": "Nursing", + "CONSULTATION_TAB__DIALYSIS": "Dialysis", + "CONSULTATION_TAB__ABDM": "ABDM Records", + "CONSULTATION_TAB_TITLE__NURSING": "Nursing Information", "no_consultation_updates": "No consultation updates", "consultation_updates": "Consultation updates", "update_log": "Update Log", From 307f50ad395977a6817435b8140452516224256c Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 13:24:54 +0530 Subject: [PATCH 10/17] add routine view in nursing tab and improve i18n and other minor improvements --- src/Common/constants.tsx | 2 +- .../ConsultationNursingTab.tsx | 218 +++++++++++++++++- .../Facility/ConsultationDetails/index.tsx | 2 +- .../Facility/Consultations/ABGPlots.tsx | 16 +- .../Facility/Consultations/DialysisPlots.tsx | 6 +- .../Consultations/NeurologicalTables.tsx | 24 +- .../Facility/Consultations/NursingPlot.tsx | 8 +- .../Facility/Consultations/NutritionPlots.tsx | 13 +- .../Facility/Consultations/PainDiagrams.tsx | 5 +- .../Consultations/PressureSoreDiagrams.tsx | 7 +- .../Consultations/PrimaryParametersPlot.tsx | 15 +- .../Facility/Consultations/VentilatorPlot.tsx | 19 +- src/Components/Facility/models.tsx | 178 ++++++++------ .../LogUpdate/CriticalCarePreview.tsx | 6 +- .../LogUpdate/Sections/NursingCare.tsx | 12 +- src/Components/LogUpdate/Sections/Vitals.tsx | 14 +- src/Components/Patient/DailyRounds.tsx | 52 ++--- src/Components/Patient/models.tsx | 6 +- src/Locale/en/Common.json | 1 + src/Locale/en/Consultation.json | 2 +- src/Locale/en/LogUpdate.json | 38 +-- src/Locale/hi/LogUpdate.json | 8 +- src/Locale/kn/LogUpdate.json | 8 +- src/Locale/ml/LogUpdate.json | 8 +- src/Locale/ta/LogUpdate.json | 8 +- 25 files changed, 400 insertions(+), 276 deletions(-) diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx index 9ea454e9c2b..74150a53e4f 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -779,7 +779,7 @@ export const RHYTHM_CHOICES = [ { id: 10, text: "IRREGULAR", desc: "Irregular" }, ] as const; -export const BOWEL_DIFFICULTY_CHOICES = [ +export const BOWEL_ISSUE_CHOICES = [ "NO_DIFFICULTY", "CONSTIPATION", "DIARRHOEA", diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index a7c6aaf1ece..3820fad140a 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -1,24 +1,226 @@ -import { lazy } from "react"; +import { lazy, useEffect, useState } from "react"; import { ConsultationTabProps } from "./index"; import { NursingPlot } from "../Consultations/NursingPlot"; import { useTranslation } from "react-i18next"; +import request from "../../../Utils/request/request"; +import routes from "../../../Redux/api"; +import { RoutineAnalysisRes, RoutineFields } from "../models"; +import Loading from "../../Common/Loading"; +import { classNames, formatDate, formatTime } from "../../../Utils/utils"; +import Pagination from "../../Common/Pagination"; +import { PAGINATION_LIMIT } from "../../../Common/constants"; const PageTitle = lazy(() => import("../../Common/PageTitle")); -export const ConsultationNursingTab = (props: ConsultationTabProps) => { +export default function ConsultationNursingTab(props: ConsultationTabProps) { const { t } = useTranslation(); return (
    - +
    +

    {t("routine")}

    + +
    +
    +

    {t("nursing_care")}

    + +
    +
    + ); +} + +const REVERSE_CHOICES = { + appetite: { + 1: "INCREASED", + 2: "SATISFACTORY", + 3: "REDUCED", + 4: "NO_TASTE_FOR_FOOD", + 5: "CANNOT_BE_ASSESSED", + }, + bladder_drainage: { + 1: "NORMAL", + 2: "CONDOM_CATHETER", + 3: "DIAPER", + 4: "INTERMITTENT_CATHETER", + 5: "CONTINUOUS_INDWELLING_CATHETER", + 6: "CONTINUOUS_SUPRAPUBIC_CATHETER", + 7: "UROSTOMY", + }, + bladder_issue: { + 0: "NO_ISSUES", + 1: "INCONTINENCE", + 2: "RETENTION", + 3: "HESITANCY", + }, + bowel_issue: { + 0: "NO_DIFFICULTY", + 1: "CONSTIPATION", + 2: "DIARRHOEA", + }, + nutrition_route: { + 1: "ORAL", + 2: "RYLES_TUBE", + 3: "GASTROSTOMY_OR_JEJUNOSTOMY", + 4: "PEG", + 5: "PARENTERAL_TUBING_FLUID", + 6: "PARENTERAL_TUBING_TPN", + }, + oral_issue: { + 0: "NO_ISSUE", + 1: "DYSPHAGIA", + 2: "ODYNOPHAGIA", + }, + is_experiencing_dysuria: { + true: "yes", + false: "no", + }, + urination_frequency: { + 1: "NORMAL", + 2: "DECREASED", + 3: "INCREASED", + }, + sleep: { + 1: "EXCESSIVE", + 2: "SATISFACTORY", + 3: "UNSATISFACTORY", + 4: "NO_SLEEP", + }, +} as const; + +const RoutineSection = ({ consultationId }: ConsultationTabProps) => { + const { t } = useTranslation(); + const [page, setPage] = useState(1); + const [totalCount, setTotalCount] = useState(); + const [results, setResults] = useState>(); + + useEffect(() => { + const getData = async () => { + const { data } = await request(routes.dailyRoundsAnalyse, { + body: { fields: RoutineFields, page }, + pathParams: { consultationId }, + }); + if (!data) { + return; + } + setTotalCount(data.count); + setResults( + Object.fromEntries( + Object.entries(data.results).filter(([_, value]) => + Object.entries(value).some(([k, v]) => k !== "id" && v != null), + ), + ) as typeof results, + ); + }; + + getData(); + }, [page, consultationId]); + + if (results == null) { + return ; + } + + if (Object.keys(results).length === 0) { + return ( +
    +
    + {t("no_data_found")} +
    +
    + ); + } + + return ( +
    +
    + + + + + ))} + + + + {[ + { field: "sleep" } as const, + { field: "bowel_issue" } as const, + { title: "Bladder" } as const, + { subField: true, field: "bladder_drainage" } as const, + { subField: true, field: "bladder_issue" } as const, + { subField: true, field: "is_experiencing_dysuria" } as const, + { subField: true, field: "urination_frequency" } as const, + { title: "Nutrition" } as const, + { subField: true, field: "nutrition_route" } as const, + { subField: true, field: "oral_issue" } as const, + { subField: true, field: "appetite" } as const, + ].map((row) => ( + + + {row.field && + Object.values(results).map((obj, idx) => ( + + ))} + + ))} + +
    + {Object.keys(results).map((date) => ( + +

    {formatDate(date)}

    +

    {formatTime(date)}

    +
    + {row.title ?? t(`LOG_UPDATE_FIELD_LABEL__${row.field!}`)} + + {(() => { + const value = obj[row.field]; + if (value == null) { + return "-"; + } + if (typeof value === "boolean") { + return t(value ? "yes" : "no"); + } + const choices = REVERSE_CHOICES[row.field]; + const choice = `${row.field.toUpperCase()}__${choices[value as keyof typeof choices]}`; + return t(choice); + })()} +
    +
    + + {totalCount != null && totalCount > PAGINATION_LIMIT && ( +
    + +
    + )}
    ); }; diff --git a/src/Components/Facility/ConsultationDetails/index.tsx b/src/Components/Facility/ConsultationDetails/index.tsx index 3dc7bb1cd64..911e62d5627 100644 --- a/src/Components/Facility/ConsultationDetails/index.tsx +++ b/src/Components/Facility/ConsultationDetails/index.tsx @@ -23,7 +23,7 @@ import { triggerGoal } from "../../../Integrations/Plausible"; import useAuthUser from "../../../Common/hooks/useAuthUser"; import { ConsultationUpdatesTab } from "./ConsultationUpdatesTab"; import { ConsultationABGTab } from "./ConsultationABGTab"; -import { ConsultationNursingTab } from "./ConsultationNursingTab"; +import ConsultationNursingTab from "./ConsultationNursingTab"; import { ConsultationFeedTab } from "./ConsultationFeedTab"; import { ConsultationSummaryTab } from "./ConsultationSummaryTab"; import { ConsultationFilesTab } from "./ConsultationFilesTab"; diff --git a/src/Components/Facility/Consultations/ABGPlots.tsx b/src/Components/Facility/Consultations/ABGPlots.tsx index 7b1809730bf..10415920ceb 100644 --- a/src/Components/Facility/Consultations/ABGPlots.tsx +++ b/src/Components/Facility/Consultations/ABGPlots.tsx @@ -5,6 +5,7 @@ import { PAGINATION_LIMIT } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; import routes from "../../../Redux/api"; import request from "../../../Utils/request/request"; +import { ABGPlotsFields } from "../models"; export const ABGPlots = (props: any) => { const { consultationId } = props; @@ -15,20 +16,7 @@ export const ABGPlots = (props: any) => { useEffect(() => { const fetchDailyRounds = async (currentPage: number) => { const { res, data } = await request(routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: [ - "ph", - "pco2", - "po2", - "hco3", - "base_excess", - "lactate", - "sodium", - "potassium", - "ventilator_fio2", - ], - }, + body: { page: currentPage, fields: ABGPlotsFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/Consultations/DialysisPlots.tsx b/src/Components/Facility/Consultations/DialysisPlots.tsx index 50bbf911208..54c2dab60b9 100644 --- a/src/Components/Facility/Consultations/DialysisPlots.tsx +++ b/src/Components/Facility/Consultations/DialysisPlots.tsx @@ -5,6 +5,7 @@ import { LinePlot } from "./components/LinePlot"; import Pagination from "../../Common/Pagination"; import { PAGINATION_LIMIT } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; +import { DialysisPlotsFields } from "../models"; export const DialysisPlots = (props: any) => { const { consultationId } = props; @@ -15,10 +16,7 @@ export const DialysisPlots = (props: any) => { useEffect(() => { const fetchDailyRounds = async (currentPage: number) => { const { res, data } = await request(routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: ["dialysis_fluid_balance", "dialysis_net_balance"], - }, + body: { page: currentPage, fields: DialysisPlotsFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/Consultations/NeurologicalTables.tsx b/src/Components/Facility/Consultations/NeurologicalTables.tsx index 5a1abe3e189..6ee363e341f 100644 --- a/src/Components/Facility/Consultations/NeurologicalTables.tsx +++ b/src/Components/Facility/Consultations/NeurologicalTables.tsx @@ -15,6 +15,7 @@ import { } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; import { useTranslation } from "react-i18next"; +import { NeurologicalTablesFields } from "../models"; const DataTable = (props: any) => { const { title, data } = props; @@ -113,28 +114,7 @@ export const NeurologicalTable = (props: any) => { consultationId: string, ) => { const { res, data } = await request(routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: [ - "consciousness_level", - "left_pupil_size", - "left_pupil_size_detail", - "right_pupil_size", - "right_pupil_size_detail", - "left_pupil_light_reaction", - "left_pupil_light_reaction_detail", - "right_pupil_light_reaction", - "right_pupil_light_reaction_detail", - "limb_response_upper_extremity_right", - "limb_response_upper_extremity_left", - "limb_response_lower_extremity_left", - "limb_response_lower_extremity_right", - "glasgow_eye_open", - "glasgow_verbal_response", - "glasgow_motor_response", - "glasgow_total_calculated", - ], - }, + body: { page: currentPage, fields: NeurologicalTablesFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/Consultations/NursingPlot.tsx b/src/Components/Facility/Consultations/NursingPlot.tsx index fcae4bb43db..c747ec60d26 100644 --- a/src/Components/Facility/Consultations/NursingPlot.tsx +++ b/src/Components/Facility/Consultations/NursingPlot.tsx @@ -9,6 +9,7 @@ import { import Pagination from "../../Common/Pagination"; import { formatDateTime } from "../../../Utils/utils"; import { useTranslation } from "react-i18next"; +import { NursingPlotFields } from "../models"; export const NursingPlot = ({ consultationId }: any) => { const { t } = useTranslation(); @@ -22,10 +23,7 @@ export const NursingPlot = ({ consultationId }: any) => { consultationId: string, ) => { const { res, data } = await request(routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: ["nursing"], - }, + body: { page: currentPage, fields: NursingPlotFields }, pathParams: { consultationId, }, @@ -81,7 +79,7 @@ export const NursingPlot = ({ consultationId }: any) => { {areFieldsEmpty() && (
    - No data available + {t("no_data_found")}
    )} diff --git a/src/Components/Facility/Consultations/NutritionPlots.tsx b/src/Components/Facility/Consultations/NutritionPlots.tsx index 835a1c2a28e..b489b257184 100644 --- a/src/Components/Facility/Consultations/NutritionPlots.tsx +++ b/src/Components/Facility/Consultations/NutritionPlots.tsx @@ -8,6 +8,7 @@ import Pagination from "../../Common/Pagination"; import { PAGINATION_LIMIT } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; import CareIcon from "../../../CAREUI/icons/CareIcon"; +import { NutritionPlotsFields } from "../models"; export const NutritionPlots = (props: any) => { const { consultationId } = props; @@ -24,17 +25,7 @@ export const NutritionPlots = (props: any) => { consultationId: string, ) => { const { res, data } = await request(routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: [ - "infusions", - "iv_fluids", - "feeds", - "total_intake_calculated", - "total_output_calculated", - "output", - ], - }, + body: { page: currentPage, fields: NutritionPlotsFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/Consultations/PainDiagrams.tsx b/src/Components/Facility/Consultations/PainDiagrams.tsx index baf7308d03d..2b73fe978ad 100644 --- a/src/Components/Facility/Consultations/PainDiagrams.tsx +++ b/src/Components/Facility/Consultations/PainDiagrams.tsx @@ -3,6 +3,7 @@ import routes from "../../../Redux/api"; import request from "../../../Utils/request/request"; import { formatDateTime } from "../../../Utils/utils"; import PainChart from "../../LogUpdate/components/PainChart"; +import { PainDiagramsFields } from "../models"; export const PainDiagrams = (props: any) => { const { consultationId } = props; @@ -19,9 +20,7 @@ export const PainDiagrams = (props: any) => { const { res, data: dailyRound } = await request( routes.dailyRoundsAnalyse, { - body: { - fields: ["pain_scale_enhanced"], - }, + body: { fields: PainDiagramsFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/Consultations/PressureSoreDiagrams.tsx b/src/Components/Facility/Consultations/PressureSoreDiagrams.tsx index a0d559a0eca..8113a81e99b 100644 --- a/src/Components/Facility/Consultations/PressureSoreDiagrams.tsx +++ b/src/Components/Facility/Consultations/PressureSoreDiagrams.tsx @@ -5,7 +5,7 @@ import Pagination from "../../Common/Pagination"; import { PAGINATION_LIMIT } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; -import { PressureSoreDiagramsRes } from "../models"; +import { PressureSoreDiagramsFields, PressureSoreDiagramsRes } from "../models"; import PressureSore from "../../LogUpdate/Sections/PressureSore/PressureSore"; export const PressureSoreDiagrams = (props: any) => { @@ -28,10 +28,7 @@ export const PressureSoreDiagrams = (props: any) => { const { res, data: dailyRounds } = await request( routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: ["pressure_sore"], - }, + body: { page: currentPage, fields: PressureSoreDiagramsFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx b/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx index ca01ac1b113..0fb0844c576 100644 --- a/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx +++ b/src/Components/Facility/Consultations/PrimaryParametersPlot.tsx @@ -10,6 +10,7 @@ import CareIcon from "../../../CAREUI/icons/CareIcon"; import { PainDiagrams } from "./PainDiagrams"; import PageTitle from "../../Common/PageTitle"; import dayjs from "../../../Utils/dayjs"; +import { PrimaryParametersPlotFields } from "../models"; interface PrimaryParametersPlotProps { facilityId: string; @@ -43,19 +44,7 @@ export const PrimaryParametersPlot = ({ const { res, data } = await request(routes.dailyRoundsAnalyse, { body: { page: currentPage, - fields: [ - "bp", - "pulse", - "temperature", - "resp", - "blood_sugar_level", - "insulin_intake_frequency", - "insulin_intake_dose", - "ventilator_spo2", - "ventilator_fio2", - "rhythm", - "rhythm_detail", - ], + fields: PrimaryParametersPlotFields, }, pathParams: { consultationId, diff --git a/src/Components/Facility/Consultations/VentilatorPlot.tsx b/src/Components/Facility/Consultations/VentilatorPlot.tsx index aa07b639f88..778f274918c 100644 --- a/src/Components/Facility/Consultations/VentilatorPlot.tsx +++ b/src/Components/Facility/Consultations/VentilatorPlot.tsx @@ -6,6 +6,7 @@ import Pagination from "../../Common/Pagination"; import { PAGINATION_LIMIT } from "../../../Common/constants"; import { formatDateTime } from "../../../Utils/utils"; import BinaryChronologicalChart from "./components/BinaryChronologicalChart"; +import { VentilatorPlotFields } from "../models"; /* interface ModalityType { @@ -39,23 +40,7 @@ export const VentilatorPlot = (props: any) => { consultationId: string, ) => { const { res, data } = await request(routes.dailyRoundsAnalyse, { - body: { - page: currentPage, - fields: [ - "ventilator_pip", - "ventilator_mean_airway_pressure", - "ventilator_resp_rate", - "ventilator_pressure_support", - "ventilator_tidal_volume", - "ventilator_peep", - "ventilator_fio2", - "ventilator_spo2", - "etco2", - "bilateral_air_entry", - "ventilator_oxygen_modality_oxygen_rate", - "ventilator_oxygen_modality_flow_rate", - ], - }, + body: { page: currentPage, fields: VentilatorPlotFields }, pathParams: { consultationId, }, diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx index 3f060240ee7..92a55ae6ae7 100644 --- a/src/Components/Facility/models.tsx +++ b/src/Components/Facility/models.tsx @@ -282,16 +282,17 @@ export type ICD11DiagnosisModel = { label: string; }; -export type ABGPlotsFields = - | "ph" - | "pco2" - | "po2" - | "hco3" - | "base_excess" - | "lactate" - | "sodium" - | "potassium" - | "ventilator_fio2"; +export const ABGPlotsFields = [ + "ph", + "pco2", + "po2", + "hco3", + "base_excess", + "lactate", + "sodium", + "potassium", + "ventilator_fio2", +] as const satisfies (keyof DailyRoundsModel)[]; export type ABGPlotsRes = { ph: string; @@ -305,33 +306,35 @@ export type ABGPlotsRes = { ventilator_fio2: number; }; -export type DialysisPlotsFields = - | "dialysis_fluid_balance" - | "dialysis_net_balance"; +export const DialysisPlotsFields = [ + "dialysis_fluid_balance", + "dialysis_net_balance", +] as const satisfies (keyof DailyRoundsModel)[]; export type DialysisPlotsRes = { dialysis_fluid_balance: number; dialysis_net_balance: number; }; -export type NeurologicalTablesFields = - | "consciousness_level" - | "left_pupil_size" - | "left_pupil_size_detail" - | "right_pupil_size" - | "right_pupil_size_detail" - | "left_pupil_light_reaction" - | "left_pupil_light_reaction_detail" - | "right_pupil_light_reaction" - | "right_pupil_light_reaction_detail" - | "limb_response_upper_extremity_right" - | "limb_response_upper_extremity_left" - | "limb_response_lower_extremity_left" - | "limb_response_lower_extremity_right" - | "glasgow_eye_open" - | "glasgow_verbal_response" - | "glasgow_motor_response" - | "glasgow_total_calculated"; +export const NeurologicalTablesFields = [ + "consciousness_level", + "left_pupil_size", + "left_pupil_size_detail", + "right_pupil_size", + "right_pupil_size_detail", + "left_pupil_light_reaction", + "left_pupil_light_reaction_detail", + "right_pupil_light_reaction", + "right_pupil_light_reaction_detail", + "limb_response_upper_extremity_right", + "limb_response_upper_extremity_left", + "limb_response_lower_extremity_left", + "limb_response_lower_extremity_right", + "glasgow_eye_open", + "glasgow_verbal_response", + "glasgow_motor_response", + "glasgow_total_calculated", +] as const satisfies (keyof DailyRoundsModel)[]; export type NeurologicalTablesRes = { consciousness_level: number; @@ -353,19 +356,36 @@ export type NeurologicalTablesRes = { glasgow_total_calculated: number; }; -export type NursingPlotFields = "nursing"; +export const NursingPlotFields = [ + "nursing", +] as const satisfies (keyof DailyRoundsModel)[]; export type NursingPlotRes = { nursing: any[]; }; -export type NutritionPlotsFields = - | "infusions" - | "iv_fluids" - | "feeds" - | "total_intake_calculated" - | "total_output_calculated" - | "output"; +export const RoutineFields = [ + "sleep", + "bowel_issue", + "bladder_drainage", + "bladder_issue", + "is_experiencing_dysuria", + "urination_frequency", + "nutrition_route", + "oral_issue", + "appetite", +] as const satisfies (keyof DailyRoundsModel)[]; + +export type RoutineAnalysisRes = Record<(typeof RoutineFields)[number], any>; + +export const NutritionPlotsFields = [ + "infusions", + "iv_fluids", + "feeds", + "total_intake_calculated", + "total_output_calculated", + "output", +] as const satisfies (keyof DailyRoundsModel)[]; export type NutritionPlotsRes = { infusions: any[]; @@ -376,30 +396,35 @@ export type NutritionPlotsRes = { output: any[]; }; -export type PainDiagramsFields = "pain_scale_enhanced"; +export const PainDiagramsFields = [ + "pain_scale_enhanced", +] as const satisfies (keyof DailyRoundsModel)[]; export type PainDiagramsRes = { pain_scale_enhanced: any[]; }; -export type PressureSoreDiagramsFields = "pressure_sore"; +export const PressureSoreDiagramsFields = [ + "pressure_sore", +] as const satisfies (keyof DailyRoundsModel)[]; export type PressureSoreDiagramsRes = { pressure_sore: any[]; }; -export type PrimaryParametersPlotFields = - | "bp" - | "pulse" - | "temperature" - | "resp" - | "blood_sugar_level" - | "insulin_intake_frequency" - | "insulin_intake_dose" - | "ventilator_spo2" - | "ventilator_fio2" - | "rhythm" - | "rhythm_detail"; +export const PrimaryParametersPlotFields = [ + "bp", + "pulse", + "temperature", + "resp", + "blood_sugar_level", + "insulin_intake_frequency", + "insulin_intake_dose", + "ventilator_spo2", + "ventilator_fio2", + "rhythm", + "rhythm_detail", +] as const satisfies (keyof DailyRoundsModel)[]; export type PrimaryParametersPlotRes = { bp: { @@ -419,19 +444,20 @@ export type PrimaryParametersPlotRes = { rhythm_detail: string; }; -export type VentilatorPlotFields = - | "ventilator_pip" - | "ventilator_mean_airway_pressure" - | "ventilator_resp_rate" - | "ventilator_pressure_support" - | "ventilator_tidal_volume" - | "ventilator_peep" - | "ventilator_fio2" - | "ventilator_spo2" - | "etco2" - | "bilateral_air_entry" - | "ventilator_oxygen_modality_oxygen_rate" - | "ventilator_oxygen_modality_flow_rate"; +export const VentilatorPlotFields = [ + "ventilator_pip", + "ventilator_mean_airway_pressure", + "ventilator_resp_rate", + "ventilator_pressure_support", + "ventilator_tidal_volume", + "ventilator_peep", + "ventilator_fio2", + "ventilator_spo2", + "etco2", + "bilateral_air_entry", + "ventilator_oxygen_modality_oxygen_rate", + "ventilator_oxygen_modality_flow_rate", +] as const satisfies (keyof DailyRoundsModel)[]; export type VentilatorPlotRes = { ventilator_pip: number; @@ -451,15 +477,16 @@ export type VentilatorPlotRes = { export interface DailyRoundsBody { page?: number; fields: - | ABGPlotsFields[] - | DialysisPlotsFields[] - | NeurologicalTablesFields[] - | NursingPlotFields[] - | NutritionPlotsFields[] - | PainDiagramsFields[] - | PressureSoreDiagramsFields[] - | PrimaryParametersPlotFields[] - | VentilatorPlotFields[]; + | typeof ABGPlotsFields + | typeof DialysisPlotsFields + | typeof NeurologicalTablesFields + | typeof NursingPlotFields + | typeof RoutineFields + | typeof NutritionPlotsFields + | typeof PainDiagramsFields + | typeof PressureSoreDiagramsFields + | typeof PrimaryParametersPlotFields + | typeof VentilatorPlotFields; } export interface DailyRoundsRes { @@ -472,6 +499,7 @@ export interface DailyRoundsRes { | DialysisPlotsRes | NeurologicalTablesRes | NursingPlotRes + | RoutineAnalysisRes | NutritionPlotsRes | PainDiagramsRes | PrimaryParametersPlotRes diff --git a/src/Components/LogUpdate/CriticalCarePreview.tsx b/src/Components/LogUpdate/CriticalCarePreview.tsx index 7e18e12b107..838887decf9 100644 --- a/src/Components/LogUpdate/CriticalCarePreview.tsx +++ b/src/Components/LogUpdate/CriticalCarePreview.tsx @@ -74,7 +74,7 @@ export default function CriticalCarePreview(props: Props) {
    - +
    @@ -307,11 +307,11 @@ export default function CriticalCarePreview(props: Props) { ]} /> {!!data.pain_scale_enhanced?.length && ( diff --git a/src/Components/LogUpdate/Sections/NursingCare.tsx b/src/Components/LogUpdate/Sections/NursingCare.tsx index e97bda64e99..48037d6c842 100644 --- a/src/Components/LogUpdate/Sections/NursingCare.tsx +++ b/src/Components/LogUpdate/Sections/NursingCare.tsx @@ -1,8 +1,8 @@ import { useTranslation } from "react-i18next"; import { NURSING_CARE_PROCEDURES } from "../../../Common/constants"; -import TextAreaFormField from "../../Form/FormFields/TextAreaFormField"; import { LogUpdateSectionMeta, LogUpdateSectionProps } from "../utils"; import { MultiSelectFormField } from "../../Form/FormFields/SelectFormField"; +import AutoExpandingTextInputFormField from "../../Form/FormFields/AutoExpandingTextInputFormField"; const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { const { t } = useTranslation(); @@ -34,11 +34,12 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => {
    + {t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)} - + @@ -50,7 +51,8 @@ const NursingCare = ({ log, onChange }: LogUpdateSectionProps) => { ), }) } - rows={2} + rows={1} + maxHeight={160} placeholder={t("add_remarks")} errorClassName="hidden" /> diff --git a/src/Components/LogUpdate/Sections/Vitals.tsx b/src/Components/LogUpdate/Sections/Vitals.tsx index 1fa4b3f3aac..90e3a95e22d 100644 --- a/src/Components/LogUpdate/Sections/Vitals.tsx +++ b/src/Components/LogUpdate/Sections/Vitals.tsx @@ -59,8 +59,8 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { />
    onChange({ ventilator_spo2: c.value })} value={log.ventilator_spo2} min={0} @@ -70,7 +70,7 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { valueDescriptions={rangeValueDescription({ low: 89 })} /> onChange({ temperature: c.value })} value={log.temperature} @@ -88,7 +88,7 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { ]} /> onChange({ resp: c.value })} value={log.resp} @@ -111,7 +111,7 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { />
    onChange({ pulse: c.value })} value={log.pulse} @@ -137,7 +137,7 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { ]} /> t(`HEARTBEAT_RHYTHM__${c}`)} @@ -146,7 +146,7 @@ const Vitals = ({ log, onChange }: LogUpdateSectionProps) => { onChange={(c) => onChange({ rhythm: c.value ?? undefined })} /> onChange({ rhythm_detail: c.value })} diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index d74cded6057..ef04ad25abe 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -6,7 +6,7 @@ import { APPETITE_CHOICES, BLADDER_DRAINAGE_CHOICES, BLADDER_ISSUE_CHOICES, - BOWEL_DIFFICULTY_CHOICES, + BOWEL_ISSUE_CHOICES, CONSCIOUSNESS_LEVEL, NUTRITION_ROUTE_CHOICES, ORAL_ISSUE_CHOICES, @@ -359,7 +359,7 @@ export const DailyRounds = (props: any) => { rhythm_detail: state.form.rhythm_detail, ventilator_spo2: state.form.ventilator_spo2 ?? null, consciousness_level: state.form.consciousness_level || undefined, - bowel_difficulty: state.form.bowel_difficulty, + bowel_issue: state.form.bowel_issue, bladder_drainage: state.form.bladder_drainage, bladder_issue: state.form.bladder_issue, is_experiencing_dysuria: state.form.is_experiencing_dysuria, @@ -642,7 +642,6 @@ export const DailyRounds = (props: any) => { @@ -662,27 +661,19 @@ export const DailyRounds = (props: any) => { /> - - + + {state.form.rounds_type === "COMMUNITY_NURSES_LOG" && ( <>
    -

    Routine

    +

    {t("routine")}

    -
    Bladder
    +
    {t("bladder")}
    @@ -692,7 +683,7 @@ export const DailyRounds = (props: any) => { (c ? "Yes" : "No")} + optionLabel={(c) => t(c ? "yes" : "no")} /> { />
    -
    Nutrition
    +
    {t("nutrition")}
    @@ -725,17 +716,12 @@ export const DailyRounds = (props: any) => { ].includes(state.form.rounds_type) && ( <>
    -

    Vitals

    +

    {t("vitals")}

    - + { <> { state.form.rounds_type, ) && ( <> - + { { option.desc} optionValue={(option) => option.id} @@ -864,7 +843,6 @@ export const DailyRounds = (props: any) => { @@ -907,7 +885,7 @@ export const DailyRounds = (props: any) => {

    -

    Nursing Care

    +

    {t("nursing_care")}

    {
    option.desc} optionValue={(option) => option.text} @@ -1019,7 +996,6 @@ export const DailyRounds = (props: any) => { option.text} diff --git a/src/Components/Patient/models.tsx b/src/Components/Patient/models.tsx index 9bf57cb78b3..8002a86442f 100644 --- a/src/Components/Patient/models.tsx +++ b/src/Components/Patient/models.tsx @@ -4,7 +4,7 @@ import { APPETITE_CHOICES, BLADDER_DRAINAGE_CHOICES, BLADDER_ISSUE_CHOICES, - BOWEL_DIFFICULTY_CHOICES, + BOWEL_ISSUE_CHOICES, CONSCIOUSNESS_LEVEL, HEARTBEAT_RHYTHM_CHOICES, HumanBodyRegion, @@ -364,6 +364,8 @@ export interface DailyRoundsModel { infusions?: NameQuantity[]; iv_fluids?: NameQuantity[]; output?: NameQuantity[]; + total_intake_calculated?: number; + total_output_calculated?: number; ventilator_spo2?: number; ventilator_interface?: (typeof RESPIRATORY_SUPPORT)[number]["value"]; ventilator_oxygen_modality?: (typeof OXYGEN_MODALITY_OPTIONS)[number]["value"]; @@ -379,7 +381,7 @@ export interface DailyRoundsModel { ventilator_tidal_volume?: number; pressure_sore?: IPressureSore[]; - bowel_difficulty?: (typeof BOWEL_DIFFICULTY_CHOICES)[number]; + bowel_issue?: (typeof BOWEL_ISSUE_CHOICES)[number]; bladder_drainage?: (typeof BLADDER_DRAINAGE_CHOICES)[number]; bladder_issue?: (typeof BLADDER_ISSUE_CHOICES)[number]; is_experiencing_dysuria?: boolean; diff --git a/src/Locale/en/Common.json b/src/Locale/en/Common.json index 84555ff4596..b0316e4d98c 100644 --- a/src/Locale/en/Common.json +++ b/src/Locale/en/Common.json @@ -166,6 +166,7 @@ "not_specified": "Not Specified", "all_changes_have_been_saved": "All changes have been saved", "no_data_found": "No data found", + "other_details": "Other details", "no_remarks": "No remarks", "edit": "Edit", "clear_selection": "Clear selection", diff --git a/src/Locale/en/Consultation.json b/src/Locale/en/Consultation.json index 753c6509e2b..4758df4c4fd 100644 --- a/src/Locale/en/Consultation.json +++ b/src/Locale/en/Consultation.json @@ -13,7 +13,7 @@ "CONSULTATION_TAB__NURSING": "Nursing", "CONSULTATION_TAB__DIALYSIS": "Dialysis", "CONSULTATION_TAB__ABDM": "ABDM Records", - "CONSULTATION_TAB_TITLE__NURSING": "Nursing Information", + "nursing_information": "Nursing Information", "no_consultation_updates": "No consultation updates", "consultation_updates": "Consultation updates", "update_log": "Update Log", diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index 60a2ad743e0..c0b29d0e631 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -2,16 +2,29 @@ "LOG_UPDATE_CREATED_NOTIFICATION": "{{ roundType }} created successfully", "LOG_UPDATE_UPDATED_NOTIFICATION": "{{ roundType }} updated successfully", "LOG_UPDATE_FIELD_LABEL__rounds_type": "Rounds Type", + "LOG_UPDATE_FIELD_LABEL__patient_category": "Category", "LOG_UPDATE_FIELD_LABEL__consciousness_level": "Level of Consciousness", "LOG_UPDATE_FIELD_LABEL__sleep": "Sleep", - "LOG_UPDATE_FIELD_LABEL__bowel_difficulty": "Bowel", - "LOG_UPDATE_FIELD_LABEL__bladder_drainage": "Bladder Drainage", - "LOG_UPDATE_FIELD_LABEL__bladder_issue": "Bladder Issues", + "LOG_UPDATE_FIELD_LABEL__bowel_issue": "Bowel", + "LOG_UPDATE_FIELD_LABEL__bladder_drainage": "Drainage", + "LOG_UPDATE_FIELD_LABEL__bladder_issue": "Issues", "LOG_UPDATE_FIELD_LABEL__is_experiencing_dysuria": "Experiences Dysuria?", "LOG_UPDATE_FIELD_LABEL__urination_frequency": "Frequency of Urination", "LOG_UPDATE_FIELD_LABEL__nutrition_route": "Nutrition Route", "LOG_UPDATE_FIELD_LABEL__oral_issue": "Oral issues", "LOG_UPDATE_FIELD_LABEL__appetite": "Appetite", + "LOG_UPDATE_FIELD_LABEL__physical_examination_info": "Physical Examination Info", + "LOG_UPDATE_FIELD_LABEL__bp": "Blood Pressure", + "LOG_UPDATE_FIELD_LABEL__blood_sugar_level": "Blood Sugar Level", + "LOG_UPDATE_FIELD_LABEL__action": "Action", + "LOG_UPDATE_FIELD_LABEL__review_interval": "Review after", + "LOG_UPDATE_FIELD_LABEL__rhythm": "Heartbeat Rhythm", + "LOG_UPDATE_FIELD_LABEL__rhythm_detail": "Rhythm Description", + "LOG_UPDATE_FIELD_LABEL__ventilator_spo2": "SpO₂", + "LOG_UPDATE_FIELD_LABEL__resp": "Respiratory Rate", + "LOG_UPDATE_FIELD_LABEL__temperature": "Temperature", + "LOG_UPDATE_FIELD_LABEL__other_details": "Other details", + "LOG_UPDATE_FIELD_LABEL__pulse": "Pulse", "ROUNDS_TYPE__NORMAL": "Brief Update", "ROUNDS_TYPE__COMMUNITY_NURSES_LOG": "Community Nurse's Log", "ROUNDS_TYPE__VENTILATOR": "Detailed Update", @@ -38,9 +51,9 @@ "CONSCIOUSNESS_LEVEL__ALERT": "Alert", "CONSCIOUSNESS_LEVEL__AGITATED_OR_CONFUSED": "Agitated or Confused", "CONSCIOUSNESS_LEVEL__ONSET_OF_AGITATION_AND_CONFUSION": "Onset of Agitation and Confusion", - "BOWEL_DIFFICULTY__NO_DIFFICULTY": "No difficulty", - "BOWEL_DIFFICULTY__CONSTIPATION": "Constipation", - "BOWEL_DIFFICULTY__DIARRHOEA": "Diarrhoea", + "BOWEL_ISSUE__NO_DIFFICULTY": "No difficulty", + "BOWEL_ISSUE__CONSTIPATION": "Constipation", + "BOWEL_ISSUE__DIARRHOEA": "Diarrhoea", "BLADDER_DRAINAGE__NORMAL": "Normal", "BLADDER_DRAINAGE__CONDOM_CATHETER": "Condom Catheter", "BLADDER_DRAINAGE__DIAPER": "Diaper", @@ -109,20 +122,19 @@ "HEARTBEAT_RHYTHM__REGULAR": "Regular", "HEARTBEAT_RHYTHM__IRREGULAR": "Irregular", "HEARTBEAT_RHYTHM__UNKNOWN": "Unknown", - "heartbeat_rhythm": "Heartbeat Rhythm", - "heartbeat_description": "Heartbeat Description", "blood_pressure": "Blood Pressure", "map_acronym": "M.A.P.", "systolic": "Systolic", "diastolic": "Diastolic", - "temperature": "Temperature", - "resipiratory_rate": "Respiratory Rate", "pain": "Pain", "pain_chart_description": "Mark region and intensity of pain", - "pulse": "Pulse", "bradycardia": "Bradycardia", "tachycardia": "Tachycardia", - "spo2": "SpO₂", "procedures_select_placeholder": "Select procedures to add details", - "oral_issue_for_non_oral_nutrition_route_error": "Can be specified only if nutrition route is set to Oral" + "oral_issue_for_non_oral_nutrition_route_error": "Can be specified only if nutrition route is set to Oral", + "routine": "Routine", + "bladder": "Bladder", + "nutrition": "Nutrition", + "vitals": "Vitals", + "nursing_care": "Nursing Care" } \ No newline at end of file diff --git a/src/Locale/hi/LogUpdate.json b/src/Locale/hi/LogUpdate.json index 3026eccce57..176886c855b 100644 --- a/src/Locale/hi/LogUpdate.json +++ b/src/Locale/hi/LogUpdate.json @@ -56,18 +56,12 @@ "HEARTBEAT_RHYTHM__REGULAR": "नियमित", "HEARTBEAT_RHYTHM__IRREGULAR": "अनियमित", "HEARTBEAT_RHYTHM__UNKNOWN": "अज्ञात", - "heartbeat_rhythm": "दिल की धड़कन की लय", - "heartbeat_description": "दिल की धड़कन का विवरण", "blood_pressure": "रक्तचाप", "map_acronym": "मानचित्र", "systolic": "सिस्टोलिक", "diastolic": "डायस्टोलिक", - "temperature": "तापमान", - "resipiratory_rate": "श्वसन दर", "pain": "दर्द", "pain_chart_description": "दर्द का क्षेत्र और तीव्रता चिह्नित करें", - "pulse": "नाड़ी", "bradycardia": "मंदनाड़ी", - "tachycardia": "tachycardia", - "spo2": "SpO₂" + "tachycardia": "tachycardia" } \ No newline at end of file diff --git a/src/Locale/kn/LogUpdate.json b/src/Locale/kn/LogUpdate.json index e1d8104ad95..25e4ee4623e 100644 --- a/src/Locale/kn/LogUpdate.json +++ b/src/Locale/kn/LogUpdate.json @@ -56,18 +56,12 @@ "HEARTBEAT_RHYTHM__REGULAR": "ನಿಯಮಿತ", "HEARTBEAT_RHYTHM__IRREGULAR": "ಅನಿಯಮಿತ", "HEARTBEAT_RHYTHM__UNKNOWN": "ಅಜ್ಞಾತ", - "heartbeat_rhythm": "ಹೃದಯ ಬಡಿತದ ಲಯ", - "heartbeat_description": "ಹೃದಯ ಬಡಿತದ ವಿವರಣೆ", "blood_pressure": "ರಕ್ತದೊತ್ತಡ", "map_acronym": "ನಕ್ಷೆ", "systolic": "ಸಿಸ್ಟೊಲಿಕ್", "diastolic": "ಡಯಾಸ್ಟೊಲಿಕ್", - "temperature": "ತಾಪಮಾನ", - "resipiratory_rate": "ಉಸಿರಾಟದ ದರ", "pain": "ನೋವು", "pain_chart_description": "ನೋವಿನ ಪ್ರದೇಶ ಮತ್ತು ತೀವ್ರತೆಯನ್ನು ಗುರುತಿಸಿ", - "pulse": "ನಾಡಿ", "bradycardia": "ಬ್ರಾಡಿಕಾರ್ಡಿಯಾ", - "tachycardia": "ಟಾಕಿಕಾರ್ಡಿಯಾ", - "spo2": "SpO₂" + "tachycardia": "ಟಾಕಿಕಾರ್ಡಿಯಾ" } \ No newline at end of file diff --git a/src/Locale/ml/LogUpdate.json b/src/Locale/ml/LogUpdate.json index 1a3304b88ca..d2503cd8d34 100644 --- a/src/Locale/ml/LogUpdate.json +++ b/src/Locale/ml/LogUpdate.json @@ -56,18 +56,12 @@ "HEARTBEAT_RHYTHM__REGULAR": "പതിവ്", "HEARTBEAT_RHYTHM__IRREGULAR": "ക്രമരഹിതം", "HEARTBEAT_RHYTHM__UNKNOWN": "അജ്ഞാതം", - "heartbeat_rhythm": "ഹൃദയമിടിപ്പ് താളം", - "heartbeat_description": "ഹൃദയമിടിപ്പ് വിവരണം", "blood_pressure": "രക്തസമ്മർദ്ദം", "map_acronym": "മാപ്പ്", "systolic": "സിസ്റ്റോളിക്", "diastolic": "ഡയസ്റ്റോളിക്", - "temperature": "താപനില", - "resipiratory_rate": "ശ്വസന നിരക്ക്", "pain": "വേദന", "pain_chart_description": "വേദനയുടെ പ്രദേശവും തീവ്രതയും അടയാളപ്പെടുത്തുക", - "pulse": "പൾസ്", "bradycardia": "ബ്രാഡികാർഡിയ", - "tachycardia": "ടാക്കിക്കാർഡിയ", - "spo2": "SpO₂" + "tachycardia": "ടാക്കിക്കാർഡിയ" } \ No newline at end of file diff --git a/src/Locale/ta/LogUpdate.json b/src/Locale/ta/LogUpdate.json index fa5308cde39..61a52f69d48 100644 --- a/src/Locale/ta/LogUpdate.json +++ b/src/Locale/ta/LogUpdate.json @@ -56,18 +56,12 @@ "HEARTBEAT_RHYTHM__REGULAR": "வழக்கமான", "HEARTBEAT_RHYTHM__IRREGULAR": "ஒழுங்கற்ற", "HEARTBEAT_RHYTHM__UNKNOWN": "தெரியவில்லை", - "heartbeat_rhythm": "இதயத் துடிப்பு தாளம்", - "heartbeat_description": "இதய துடிப்பு விளக்கம்", "blood_pressure": "இரத்த அழுத்தம்", "map_acronym": "வரைபடம்", "systolic": "சிஸ்டாலிக்", "diastolic": "டயஸ்டாலிக்", - "temperature": "வெப்பநிலை", - "resipiratory_rate": "சுவாச விகிதம்", "pain": "வலி", "pain_chart_description": "வலியின் பகுதி மற்றும் தீவிரத்தை குறிக்கவும்", - "pulse": "துடிப்பு", "bradycardia": "பிராடி கார்டியா", - "tachycardia": "டாக்ரிக்கார்டியா", - "spo2": "SpO₂" + "tachycardia": "டாக்ரிக்கார்டியா" } \ No newline at end of file From f9ab0d29699d3b68fde74aacff4a250c8e3fac4e Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 14:57:12 +0530 Subject: [PATCH 11/17] make responsive in mobile screen --- .../Facility/ConsultationDetails/ConsultationNursingTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index 3820fad140a..662336f21b2 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -139,7 +139,7 @@ const RoutineSection = ({ consultationId }: ConsultationTabProps) => { return (
    -
    +
    From 809d835ad2222115a04c0c1fab4c9a6ee6c3b2de Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 14:58:54 +0530 Subject: [PATCH 12/17] fix responsiveness --- .../Facility/ConsultationDetails/ConsultationNursingTab.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index 662336f21b2..e02fe5fee59 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -139,7 +139,7 @@ const RoutineSection = ({ consultationId }: ConsultationTabProps) => { return (
    -
    +
    From ae43d7ad6e7180eaa9812f383943db331c23cd8b Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 15:00:31 +0530 Subject: [PATCH 13/17] add space to nutrition route --- src/Locale/en/LogUpdate.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index c0b29d0e631..aa57d0afcd5 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -74,7 +74,7 @@ "SLEEP__NO_SLEEP": "No sleep", "NUTRITION_ROUTE__ORAL": "Oral", "NUTRITION_ROUTE__RYLES_TUBE": "Ryle's Tube", - "NUTRITION_ROUTE__GASTROSTOMY_OR_JEJUNOSTOMY": "Gastrostomy/Jejunostomy", + "NUTRITION_ROUTE__GASTROSTOMY_OR_JEJUNOSTOMY": "Gastrostomy / Jejunostomy", "NUTRITION_ROUTE__PEG": "PEG", "NUTRITION_ROUTE__PARENTERAL_TUBING_FLUID": "Parenteral Tubing (Fluid)", "NUTRITION_ROUTE__PARENTERAL_TUBING_TPN": "Parenteral Tubing (TPN)", From 33748dd2a1efdbe4baa40320359f80ea9d55d42c Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 16:00:21 +0530 Subject: [PATCH 14/17] fix cypress and adds missing i18n --- cypress/e2e/patient_spec/PatientLogUpdate.cy.ts | 16 ++++++++-------- src/Locale/en/LogUpdate.json | 1 + 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index 773b0087d80..4b3749030d7 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -55,7 +55,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.selectPatientCategory(patientCategory); patientLogupdate.selectRoundType("Detailed Update"); cy.submitButton("Save and Continue"); - cy.verifyNotification("Detailed Update log created successfully"); + cy.verifyNotification("Detailed Update created successfully"); cy.closeNotification(); // Select two Section - First One is Respiratory Support patientLogupdate.selectCriticalCareSection("Respiratory Support"); @@ -162,7 +162,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.closeNotification(); // Submit the doctors log update cy.submitButton("Save and Continue"); - cy.verifyNotification("Progress Note log created successfully"); + cy.verifyNotification("Progress Note created successfully"); cy.closeNotification(); // modify the relevant critical care log update patientLogupdate.selectCriticalCareSection("Neurological Monitoring"); @@ -204,7 +204,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.closeNotification(); patientLogupdate.clickLogupdate(); patientLogupdate.typePhysicalExamination(physicalExamination); - patientLogupdate.selectRoundType("Telemedicine"); + patientLogupdate.selectRoundType("Tele-medicine Log"); patientLogupdate.typeOtherDetails(otherExamination); patientLogupdate.selectSymptomsDate("01012024"); patientLogupdate.typeAndMultiSelectSymptoms("fe", ["Fever"]); @@ -219,7 +219,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRhythm(patientRhythm); cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click(); cy.submitButton("Save"); - cy.verifyNotification("Telemedicine log created successfully"); + cy.verifyNotification("Tele-medicine Log created successfully"); }); it("Create a new Normal Log update for a domicilary care patient and edit it", () => { @@ -245,7 +245,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRhythm(patientRhythm); cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click(); cy.submitButton("Save"); - cy.verifyNotification("Brief Update log created successfully"); + cy.verifyNotification("Brief Update created successfully"); cy.closeNotification(); // edit the card and verify the data. cy.contains("button", "Daily Rounds").click(); @@ -307,7 +307,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click(); cy.submitButton("Save"); cy.wait(2000); - cy.verifyNotification("Brief Update log created successfully"); + cy.verifyNotification("Brief Update created successfully"); // Verify the card content cy.get("#basic-information").scrollIntoView(); cy.verifyContentPresence("#encounter-symptoms", [additionalSymptoms]); @@ -330,7 +330,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeRespiratory(patientRespiratory); cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click(); cy.submitButton("Save"); - cy.verifyNotification("Brief Update log created successfully"); + cy.verifyNotification("Brief Update created successfully"); cy.closeNotification(); cy.verifyContentPresence("#consultation-buttons", ["9"]); // Verify the Incomplete data will give blank info @@ -340,7 +340,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeDiastolic(patientDiastolic); patientLogupdate.typePulse(patientPulse); cy.submitButton("Save"); - cy.verifyNotification("Brief Update log created successfully"); + cy.verifyNotification("Brief Update created successfully"); cy.closeNotification(); cy.verifyContentPresence("#consultation-buttons", ["-"]); }); diff --git a/src/Locale/en/LogUpdate.json b/src/Locale/en/LogUpdate.json index aa57d0afcd5..f057c8c4235 100644 --- a/src/Locale/en/LogUpdate.json +++ b/src/Locale/en/LogUpdate.json @@ -30,6 +30,7 @@ "ROUNDS_TYPE__VENTILATOR": "Detailed Update", "ROUNDS_TYPE__DOCTORS_LOG": "Progress Note", "ROUNDS_TYPE__AUTOMATED": "Virtual Nursing Assistant", + "ROUNDS_TYPE__TELEMEDICINE": "Tele-medicine Log", "RESPIRATORY_SUPPORT_SHORT__UNKNOWN": "None", "RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT": "O2 Support", "RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE": "NIV", From 0b7529650a2e30e23f5e8e449d1d19cede1784e1 Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 16:20:05 +0530 Subject: [PATCH 15/17] fix update log failing due to null sent to backend --- src/Components/Patient/DailyRounds.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Components/Patient/DailyRounds.tsx b/src/Components/Patient/DailyRounds.tsx index 37582e88c2a..f949bd9e404 100644 --- a/src/Components/Patient/DailyRounds.tsx +++ b/src/Components/Patient/DailyRounds.tsx @@ -359,15 +359,15 @@ export const DailyRounds = (props: any) => { rhythm_detail: state.form.rhythm_detail, ventilator_spo2: state.form.ventilator_spo2 ?? null, consciousness_level: state.form.consciousness_level || undefined, - bowel_issue: state.form.bowel_issue, - bladder_drainage: state.form.bladder_drainage, - bladder_issue: state.form.bladder_issue, + bowel_issue: state.form.bowel_issue ?? undefined, + bladder_drainage: state.form.bladder_drainage ?? undefined, + bladder_issue: state.form.bladder_issue ?? undefined, is_experiencing_dysuria: state.form.is_experiencing_dysuria, - urination_frequency: state.form.urination_frequency, - sleep: state.form.sleep, - nutrition_route: state.form.nutrition_route, + urination_frequency: state.form.urination_frequency ?? undefined, + sleep: state.form.sleep ?? undefined, + nutrition_route: state.form.nutrition_route ?? undefined, oral_issue: state.form.oral_issue ?? undefined, - appetite: state.form.appetite, + appetite: state.form.appetite ?? undefined, blood_sugar_level: state.form.blood_sugar_level, nursing: state.form.nursing, }; From 54d8f486259962ce25d23e22f158f36495afc2ce Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 16:27:24 +0530 Subject: [PATCH 16/17] fix cypress --- cypress/e2e/patient_spec/PatientLogUpdate.cy.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index 4b3749030d7..923d9410657 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -192,7 +192,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeSystolic(patientModifiedSystolic); patientLogupdate.typeDiastolic(patientModifiedDiastolic); cy.submitButton("Continue"); - cy.verifyNotification("Progress Note log updated successfully"); + cy.verifyNotification("Progress Note updated successfully"); }); it("Create a new TeleIcu log update for a domicilary care patient", () => { @@ -271,7 +271,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.clickClearButtonInElement("#diastolic"); patientLogupdate.typeDiastolic(patientModifiedDiastolic); cy.submitButton("Continue"); - cy.verifyNotification("Brief Update log updated successfully"); + cy.verifyNotification("Brief Update updated successfully"); cy.contains("button", "Daily Rounds").click(); patientLogupdate.clickLogUpdateViewDetails( "#dailyround-entry", From 5603345e01d77830ab2eac737241260a61a4dfdc Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 17:19:55 +0530 Subject: [PATCH 17/17] make routine rows global const --- .../ConsultationNursingTab.tsx | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index e02fe5fee59..2f689c82d19 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -95,6 +95,20 @@ const REVERSE_CHOICES = { }, } as const; +const ROUTINE_ROWS = [ + { field: "sleep" } as const, + { field: "bowel_issue" } as const, + { title: "Bladder" } as const, + { subField: true, field: "bladder_drainage" } as const, + { subField: true, field: "bladder_issue" } as const, + { subField: true, field: "is_experiencing_dysuria" } as const, + { subField: true, field: "urination_frequency" } as const, + { title: "Nutrition" } as const, + { subField: true, field: "nutrition_route" } as const, + { subField: true, field: "oral_issue" } as const, + { subField: true, field: "appetite" } as const, +]; + const RoutineSection = ({ consultationId }: ConsultationTabProps) => { const { t } = useTranslation(); const [page, setPage] = useState(1); @@ -156,19 +170,7 @@ const RoutineSection = ({ consultationId }: ConsultationTabProps) => { - {[ - { field: "sleep" } as const, - { field: "bowel_issue" } as const, - { title: "Bladder" } as const, - { subField: true, field: "bladder_drainage" } as const, - { subField: true, field: "bladder_issue" } as const, - { subField: true, field: "is_experiencing_dysuria" } as const, - { subField: true, field: "urination_frequency" } as const, - { title: "Nutrition" } as const, - { subField: true, field: "nutrition_route" } as const, - { subField: true, field: "oral_issue" } as const, - { subField: true, field: "appetite" } as const, - ].map((row) => ( + {ROUTINE_ROWS.map((row) => (