From 307f50ad395977a6817435b8140452516224256c Mon Sep 17 00:00:00 2001 From: rithviknishad Date: Wed, 18 Sep 2024 13:24:54 +0530 Subject: [PATCH] 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) => { {nursing.map((obj) => ( - + {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