diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index 773b0087d80..923d9410657 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"); @@ -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", () => { @@ -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(); @@ -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", @@ -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/Common/constants.tsx b/src/Common/constants.tsx index 681fe874475..74150a53e4f 100644 --- a/src/Common/constants.tsx +++ b/src/Common/constants.tsx @@ -773,28 +773,71 @@ 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" }, { id: 10, text: "IRREGULAR", desc: "Irregular" }, ] as const; +export const BOWEL_ISSUE_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/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx index f8d38b2adb3..2f689c82d19 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationNursingTab.tsx @@ -1,18 +1,228 @@ -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 (
+ {Object.keys(results).map((date) => ( + |
+ {formatDate(date)} +{formatTime(date)} + |
+ ))}
+
---|---|
+ {row.title ?? t(`LOG_UPDATE_FIELD_LABEL__${row.field!}`)} + | + {row.field && + Object.values(results).map((obj, idx) => ( ++ {(() => { + 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); + })()} + | + ))} +
+ {t(`NURSING_CARE_PROCEDURE__${obj.procedure}`)} + | +
+ |
+