From 6e37cae82b6f09f2cf7fd4991b25657f5f9b0885 Mon Sep 17 00:00:00 2001 From: Yaswanth Kumar Bethu Date: Sun, 17 Nov 2024 20:03:24 +0530 Subject: [PATCH 1/5] Use Log Update instead of daily rounds (#9089) --- .../e2e/patient_spec/PatientLogUpdate.cy.ts | 24 +++++++++---------- .../pageobject/Patient/PatientConsultation.ts | 4 ++-- public/locale/en.json | 4 ++++ src/Routers/routes/ConsultationRoutes.tsx | 10 ++++---- src/common/constants.tsx | 4 ++-- src/components/Facility/ConsultationCard.tsx | 9 +++---- .../ConsultationUpdatesTab.tsx | 10 ++++---- .../ConsultationDetails/Events/EventsList.tsx | 2 +- .../DefaultLogUpdateCard.tsx | 12 +++++----- .../LoadingCard.tsx | 0 .../LogUpdateCardAttribute.tsx | 0 .../VirtualNursingAssistantLogUpdateCard.tsx | 2 +- ...yRoundsFilter.tsx => LogUpdatesFilter.tsx} | 2 +- ...DailyRoundsList.tsx => LogUpdatesList.tsx} | 10 ++++---- .../LogUpdate/CriticalCareEditor.tsx | 4 ++-- .../LogUpdate/CriticalCarePreview.tsx | 2 +- .../Notifications/NotificationsList.tsx | 4 ++-- .../Notifications/ShowPushNotification.tsx | 4 ++-- .../Patient/DailyRoundListDetails.tsx | 6 ++--- src/components/Patient/DailyRounds.tsx | 8 +++---- src/components/Patient/PatientInfoCard.tsx | 2 +- tailwind.config.js | 6 ++++- 22 files changed, 69 insertions(+), 60 deletions(-) rename src/components/Facility/Consultations/{DailyRounds => LogUpdates}/DefaultLogUpdateCard.tsx (88%) rename src/components/Facility/Consultations/{DailyRounds => LogUpdates}/LoadingCard.tsx (100%) rename src/components/Facility/Consultations/{DailyRounds => LogUpdates}/LogUpdateCardAttribute.tsx (100%) rename src/components/Facility/Consultations/{DailyRounds => LogUpdates}/VirtualNursingAssistantLogUpdateCard.tsx (97%) rename src/components/Facility/Consultations/{DailyRoundsFilter.tsx => LogUpdatesFilter.tsx} (98%) rename src/components/Facility/Consultations/{DailyRoundsList.tsx => LogUpdatesList.tsx} (93%) diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts index b6d7ecbc173..b6399ff02ce 100644 --- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts +++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts @@ -130,9 +130,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.verifyNotification("Progress Note Log Update filed successfully"); cy.closeNotification(); // Verify the data reflection - cy.contains("button", "Daily Rounds").click(); + cy.contains("button", "Log Updates").click(); patientLogupdate.clickLogUpdateViewDetails( - "#dailyround-entry", + "#logupdate-entry", patientCategory, ); cy.verifyContentPresence("#consultation-preview", [ @@ -180,9 +180,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.submitButton("Complete"); cy.verifyNotification("Detailed Log Update filed successfully"); cy.closeNotification(); - cy.contains("button", "Daily Rounds").click(); + cy.contains("button", "Log Updates").click(); patientLogupdate.clickLogUpdateViewDetails( - "#dailyround-entry", + "#logupdate-entry", patientCategory, ); cy.verifyContentPresence("#respiratory-support", [ @@ -195,9 +195,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { ]); // Go back and edit the data on a third section patientLogupdate.clickGoBackConsultation(); - cy.contains("button", "Daily Rounds").click(); + cy.contains("button", "Log Updates").click(); patientLogupdate.clickLogUpdateUpdateLog( - "#dailyround-entry", + "#logupdate-entry", patientCategory, ); patientLogupdate.selectCriticalCareSection("Dialysis"); @@ -210,9 +210,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.verifyNotification("Detailed Log Update filed successfully"); cy.closeNotification(); //Reverify the editted and newly added data - cy.contains("button", "Daily Rounds").click(); + cy.contains("button", "Log Updates").click(); patientLogupdate.clickLogUpdateViewDetails( - "#dailyround-entry", + "#logupdate-entry", patientCategory, ); cy.verifyContentPresence("#respiratory-support", [ @@ -285,9 +285,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { cy.verifyNotification("Brief Update created successfully"); cy.closeNotification(); // edit the card and verify the data. - cy.contains("button", "Daily Rounds").click(); + cy.contains("button", "Log Updates").click(); patientLogupdate.clickLogUpdateViewDetails( - "#dailyround-entry", + "#logupdate-entry", patientCategory, ); cy.verifyContentPresence("#consultation-preview", [ @@ -309,9 +309,9 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => { patientLogupdate.typeDiastolic(patientModifiedDiastolic); cy.submitButton("Continue"); cy.verifyNotification("Brief Update updated successfully"); - cy.contains("button", "Daily Rounds").click(); + cy.contains("button", "Log Updates").click(); patientLogupdate.clickLogUpdateViewDetails( - "#dailyround-entry", + "#logupdate-entry", patientCategory, ); cy.verifyContentPresence("#consultation-preview", [ diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index 6f4f994b395..642eaf9e4d6 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -115,8 +115,8 @@ export class PatientConsultationPage { clickViewConsultationButton() { cy.verifyAndClickElement( - "#view_consultation_updates", - "View Consultation / Consultation Updates", + "#view_consultation_and_log_updates", + "View Consultation / Log Updates", ); } diff --git a/public/locale/en.json b/public/locale/en.json index 2e8469a3667..36c25a06682 100644 --- a/public/locale/en.json +++ b/public/locale/en.json @@ -828,6 +828,8 @@ "location_management": "Location Management", "log_lab_results": "Log Lab Results", "log_report": "Log Report", + "log_update": "Log Update", + "log_updates": "Log Updates", "login": "Login", "longitude_invalid": "Longitude must be between -180 and 180", "lsg": "Lsg", @@ -901,6 +903,7 @@ "no_investigation_suggestions": "No Investigation Suggestions", "no_linked_facilities": "No Linked Facilities", "no_log_update_delta": "No changes since previous log update", + "no_log_updates": "No log updates found", "no_notices_for_you": "No notices for you.", "no_patients_to_show": "No patients to show.", "no_policy_added": "No Insurance Policy Added", @@ -1309,6 +1312,7 @@ "view_abdm_records": "View ABDM Records", "view_asset": "View Assets", "view_cns": "View CNS", + "view_consultation_and_log_updates": "View Consultation / Log Updates", "view_details": "View Details", "view_faciliy": "View Facility", "view_patients": "View Patients", diff --git a/src/Routers/routes/ConsultationRoutes.tsx b/src/Routers/routes/ConsultationRoutes.tsx index 2d283df27d7..da3c30b5093 100644 --- a/src/Routers/routes/ConsultationRoutes.tsx +++ b/src/Routers/routes/ConsultationRoutes.tsx @@ -81,7 +81,7 @@ const consultationRoutes: AppRoutes = { sessionId={sessionId} /> ), - "/facility/:facilityId/patient/:patientId/consultation/:id/daily-rounds": ({ + "/facility/:facilityId/patient/:patientId/consultation/:id/log_updates": ({ facilityId, patientId, id, @@ -92,7 +92,7 @@ const consultationRoutes: AppRoutes = { consultationId={id} /> ), - "/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id/update": + "/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/update": ({ facilityId, patientId, consultationId, id }) => ( ), - "/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id": + "/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id": ({ facilityId, patientId, consultationId, id }) => ( ), - "/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id": + "/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care": ({ facilityId, patientId, consultationId, id }) => ( ), - "/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily_rounds/:id/update": + "/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id/critical_care/update": ({ facilityId, patientId, consultationId, id }) => ( {
navigate( @@ -177,7 +178,7 @@ export const ConsultationCard = (props: ConsultationProps) => { ) } > - View Consultation / Consultation Updates + {t("view_consultation_and_log_updates")} { setOpen(true); } else { navigate( - `/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/daily-rounds`, + `/facility/${itemData.facility}/patient/${itemData.patient}/consultation/${itemData.id}/log_updates/`, ); } }} disabled={!!itemData.discharge_date} authorizeFor={NonReadOnlyUsers} > - Add Consultation Updates + {t("add") + " " + t("log_update")} )}
diff --git a/src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx b/src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx index e70b142d663..ea7448d37b2 100644 --- a/src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx +++ b/src/components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx @@ -21,8 +21,8 @@ import ReadMore from "@/components/Common/Readmore"; import Tabs from "@/components/Common/Tabs"; import EventsList from "@/components/Facility/ConsultationDetails/Events/EventsList"; import { ConsultationTabProps } from "@/components/Facility/ConsultationDetails/index"; -import DailyRoundsFilter from "@/components/Facility/Consultations/DailyRoundsFilter"; -import DailyRoundsList from "@/components/Facility/Consultations/DailyRoundsList"; +import LogUpdatesFilter from "@/components/Facility/Consultations/LogUpdatesFilter"; +import LogUpdatesList from "@/components/Facility/Consultations/LogUpdatesList"; import { BedModel } from "@/components/Facility/models"; import PrescriptionsTable from "@/components/Medicine/PrescriptionsTable"; import EncounterSymptomsCard from "@/components/Symptoms/SymptomsCard"; @@ -688,7 +688,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => { ), value: 1, }, - { text: t("daily_rounds"), value: 0 }, + { text: t("log_updates"), value: 0 }, ]} onTabChange={(v) => setShowEvents(!!v)} currentTab={showEvents ? 1 : 0} @@ -756,7 +756,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => { {showEvents ? ( ) : ( - @@ -773,7 +773,7 @@ function DailyRoundsSortDropdown({ setDailyRoundsQuery: (query: QueryParams) => void; }) { return ( - { setDailyRoundsQuery(query); }} diff --git a/src/components/Facility/ConsultationDetails/Events/EventsList.tsx b/src/components/Facility/ConsultationDetails/Events/EventsList.tsx index 47c68636a1a..e89f8dd8b2f 100644 --- a/src/components/Facility/ConsultationDetails/Events/EventsList.tsx +++ b/src/components/Facility/ConsultationDetails/Events/EventsList.tsx @@ -6,7 +6,7 @@ import PaginatedList from "@/CAREUI/misc/PaginatedList"; import GenericEvent from "@/components/Facility/ConsultationDetails/Events/GenericEvent"; import { getEventIcon } from "@/components/Facility/ConsultationDetails/Events/iconMap"; import { EventGeneric } from "@/components/Facility/ConsultationDetails/Events/types"; -import LoadingLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/LoadingCard"; +import LoadingLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/LoadingCard"; import { useSlugs } from "@/hooks/useSlug"; diff --git a/src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx b/src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx similarity index 88% rename from src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx rename to src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx index 8a436c07393..31a685cdb59 100644 --- a/src/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard.tsx +++ b/src/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "react-i18next"; import CareIcon from "@/CAREUI/icons/CareIcon"; import ButtonV2 from "@/components/Common/ButtonV2"; -import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute"; +import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute"; import { ConsultationModel } from "@/components/Facility/models"; import { DailyRoundsModel } from "@/components/Patient/models"; @@ -26,7 +26,7 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => { return (
{ ["NORMAL", "TELEMEDICINE", "DOCTORS_LOG"].includes( round.rounds_type!, ) - ? `${consultationUrl}/daily-rounds/${round.id}` - : `${consultationUrl}/daily_rounds/${round.id}` + ? `${consultationUrl}/log_updates/${round.id}` + : `${consultationUrl}/log_updates/${round.id}/critical_care` } > @@ -81,8 +81,8 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => { "DOCTORS_LOG", "COMMUNITY_NURSES_LOG", ].includes(round.rounds_type!) - ? `${consultationUrl}/daily-rounds/${round.id}/update` - : `${consultationUrl}/daily_rounds/${round.id}/update` + ? `${consultationUrl}/log_updates/${round.id}/update` + : `${consultationUrl}/log_updates/${round.id}/critical_care/update` } > diff --git a/src/components/Facility/Consultations/DailyRounds/LoadingCard.tsx b/src/components/Facility/Consultations/LogUpdates/LoadingCard.tsx similarity index 100% rename from src/components/Facility/Consultations/DailyRounds/LoadingCard.tsx rename to src/components/Facility/Consultations/LogUpdates/LoadingCard.tsx diff --git a/src/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx b/src/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute.tsx similarity index 100% rename from src/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute.tsx rename to src/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute.tsx diff --git a/src/components/Facility/Consultations/DailyRounds/VirtualNursingAssistantLogUpdateCard.tsx b/src/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard.tsx similarity index 97% rename from src/components/Facility/Consultations/DailyRounds/VirtualNursingAssistantLogUpdateCard.tsx rename to src/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard.tsx index b8a8e9fd814..e7229634266 100644 --- a/src/components/Facility/Consultations/DailyRounds/VirtualNursingAssistantLogUpdateCard.tsx +++ b/src/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard.tsx @@ -1,6 +1,6 @@ import { useTranslation } from "react-i18next"; -import LogUpdateCardAttribute from "@/components/Facility/Consultations/DailyRounds/LogUpdateCardAttribute"; +import LogUpdateCardAttribute from "@/components/Facility/Consultations/LogUpdates/LogUpdateCardAttribute"; import { DailyRoundsModel } from "@/components/Patient/models"; // TODO: remove this method once events module is ready diff --git a/src/components/Facility/Consultations/DailyRoundsFilter.tsx b/src/components/Facility/Consultations/LogUpdatesFilter.tsx similarity index 98% rename from src/components/Facility/Consultations/DailyRoundsFilter.tsx rename to src/components/Facility/Consultations/LogUpdatesFilter.tsx index 90e7908ac16..22cb357936c 100644 --- a/src/components/Facility/Consultations/DailyRoundsFilter.tsx +++ b/src/components/Facility/Consultations/LogUpdatesFilter.tsx @@ -26,7 +26,7 @@ interface Props { onApply: (filter: FilterState) => void; } -export default function DailyRoundsFilter(props: Props) { +export default function LogUpdatesFilter(props: Props) { const { t } = useTranslation(); const [filter, setFilter] = useState({}); diff --git a/src/components/Facility/Consultations/DailyRoundsList.tsx b/src/components/Facility/Consultations/LogUpdatesList.tsx similarity index 93% rename from src/components/Facility/Consultations/DailyRoundsList.tsx rename to src/components/Facility/Consultations/LogUpdatesList.tsx index 037556e6dda..911d32dca25 100644 --- a/src/components/Facility/Consultations/DailyRoundsList.tsx +++ b/src/components/Facility/Consultations/LogUpdatesList.tsx @@ -3,9 +3,9 @@ import { useTranslation } from "react-i18next"; import Timeline, { TimelineNode } from "@/CAREUI/display/Timeline"; import PaginatedList from "@/CAREUI/misc/PaginatedList"; -import DefaultLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/DefaultLogUpdateCard"; -import LoadingLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/LoadingCard"; -import VirtualNursingAssistantLogUpdateCard from "@/components/Facility/Consultations/DailyRounds/VirtualNursingAssistantLogUpdateCard"; +import DefaultLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/DefaultLogUpdateCard"; +import LoadingLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/LoadingCard"; +import VirtualNursingAssistantLogUpdateCard from "@/components/Facility/Consultations/LogUpdates/VirtualNursingAssistantLogUpdateCard"; import { ConsultationModel } from "@/components/Facility/models"; import { DailyRoundsModel } from "@/components/Patient/models"; @@ -21,7 +21,7 @@ interface Props { query: QueryParams; } -export default function DailyRoundsList({ consultation, query }: Props) { +export default function LogUpdatesList({ consultation, query }: Props) { const [consultationId] = useSlugs("consultation"); const { t } = useTranslation(); @@ -37,7 +37,7 @@ export default function DailyRoundsList({ consultation, query }: Props) {
- {t("no_consultation_updates")} + {t("no_log_updates")} diff --git a/src/components/LogUpdate/CriticalCareEditor.tsx b/src/components/LogUpdate/CriticalCareEditor.tsx index 42de82b51b8..c6b48f24909 100644 --- a/src/components/LogUpdate/CriticalCareEditor.tsx +++ b/src/components/LogUpdate/CriticalCareEditor.tsx @@ -95,7 +95,7 @@ export default function CriticalCareEditor(props: Props) { ghost className="w-full bg-primary-100/50 py-3" border - href={`${consultationDashboardUrl}/daily-rounds/${props.id}/update`} + href={`${consultationDashboardUrl}/log_updates/${props.id}/update`} > { - const [consultationId, id] = useSlugs("consultation", "daily_rounds"); + const [consultationId, id] = useSlugs("consultation", "log_updates"); const [diff, setDiff] = useState>({}); const [isProcessing, setIsProcessing] = useState(false); diff --git a/src/components/LogUpdate/CriticalCarePreview.tsx b/src/components/LogUpdate/CriticalCarePreview.tsx index 1c95f051526..e131e43f405 100644 --- a/src/components/LogUpdate/CriticalCarePreview.tsx +++ b/src/components/LogUpdate/CriticalCarePreview.tsx @@ -61,7 +61,7 @@ export default function CriticalCarePreview(props: Props) {

- Consultation Updates + {t("log_updates")}
{t(`ROUNDS_TYPE__${data.rounds_type}`)}
diff --git a/src/components/Notifications/NotificationsList.tsx b/src/components/Notifications/NotificationsList.tsx index 0153017c5ed..17033d67623 100644 --- a/src/components/Notifications/NotificationsList.tsx +++ b/src/components/Notifications/NotificationsList.tsx @@ -72,9 +72,9 @@ const NotificationTile = ({ case "PATIENT_CONSULTATION_UPDATED": return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}`; case "PATIENT_CONSULTATION_UPDATE_CREATED": - return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/daily-rounds/${data.daily_round}`; + return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/log_updates/${data.daily_round}`; case "PATIENT_CONSULTATION_UPDATE_UPDATED": - return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/daily-rounds/${data.daily_round}`; + return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/log_updates/${data.daily_round}`; case "INVESTIGATION_SESSION_CREATED": return `/facility/${data.facility}/patient/${data.patient}/consultation/${data.consultation}/investigation/${data.session}`; case "PATIENT_NOTE_ADDED": diff --git a/src/components/Notifications/ShowPushNotification.tsx b/src/components/Notifications/ShowPushNotification.tsx index 490c44ea649..b1bc7c34397 100644 --- a/src/components/Notifications/ShowPushNotification.tsx +++ b/src/components/Notifications/ShowPushNotification.tsx @@ -24,9 +24,9 @@ export default function ShowPushNotification({ id }: { id: string }) { case "PATIENT_CONSULTATION_UPDATED": return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}`; case "PATIENT_CONSULTATION_UPDATE_CREATED": - return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/daily-rounds/${caused_objects?.daily_round}`; + return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.daily_round}`; case "PATIENT_CONSULTATION_UPDATE_UPDATED": - return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/daily-rounds/${caused_objects?.daily_round}`; + return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/log_updates/${caused_objects?.daily_round}`; case "INVESTIGATION_SESSION_CREATED": return `/facility/${caused_objects?.facility}/patient/${caused_objects?.patient}/consultation/${caused_objects?.consultation}/investigation/${caused_objects?.session}`; case "PATIENT_NOTE_ADDED": diff --git a/src/components/Patient/DailyRoundListDetails.tsx b/src/components/Patient/DailyRoundListDetails.tsx index b7bc8964f65..ec568ba56d2 100644 --- a/src/components/Patient/DailyRoundListDetails.tsx +++ b/src/components/Patient/DailyRoundListDetails.tsx @@ -31,8 +31,8 @@ export const DailyRoundListDetails = (props: any) => { return (
{
Update Details diff --git a/src/components/Patient/DailyRounds.tsx b/src/components/Patient/DailyRounds.tsx index c12621e410f..d9bcb1366d5 100644 --- a/src/components/Patient/DailyRounds.tsx +++ b/src/components/Patient/DailyRounds.tsx @@ -144,7 +144,7 @@ export const DailyRounds = (props: any) => { const [diagnoses, setDiagnoses] = useState(); const [showDiscontinuedPrescriptions, setShowDiscontinuedPrescriptions] = useState(false); - const headerText = !id ? "Add Consultation Update" : "Info"; + const headerText = !id ? t("add") + " " + t("log_update") : "Info"; const buttonText = !id ? !["VENTILATOR", "DOCTORS_LOG"].includes(state.form.rounds_type) ? t("save") @@ -411,7 +411,7 @@ export const DailyRounds = (props: any) => { ); } else { navigate( - `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily_rounds/${obj.id}/update`, + `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates/${obj.id}/update`, ); } } @@ -439,7 +439,7 @@ export const DailyRounds = (props: any) => { ); } else { navigate( - `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily_rounds/${obj.id}/update`, + `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates/${obj.id}/critical_care/update`, ); } } @@ -553,7 +553,7 @@ export const DailyRounds = (props: any) => { }} backUrl={ id - ? `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds` + ? `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates` : `/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}` } className="mx-auto max-w-4xl" diff --git a/src/components/Patient/PatientInfoCard.tsx b/src/components/Patient/PatientInfoCard.tsx index 544c9585e09..e415d928a0d 100644 --- a/src/components/Patient/PatientInfoCard.tsx +++ b/src/components/Patient/PatientInfoCard.tsx @@ -582,7 +582,7 @@ export default function PatientInfoCard(props: PatientInfoCardProps) { href={ consultation?.admitted && !consultation?.current_bed ? undefined - : `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/daily-rounds` + : `/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/log_updates` } onClick={() => { if ( diff --git a/tailwind.config.js b/tailwind.config.js index 520c1c4b5da..6594264d903 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -83,7 +83,11 @@ module.exports = { }, }, }, - content: ["./src/**/*.{html,md,js,jsx,ts,tsx}", "./apps/**/*.{html,md,js,jsx,ts,tsx}", "./index.html"], + content: [ + "./src/**/*.{html,md,js,jsx,ts,tsx}", + "./apps/**/*.{html,md,js,jsx,ts,tsx}", + "./index.html", + ], plugins: [ require("@tailwindcss/forms"), require("@tailwindcss/typography"), From 2eaf15ef9688463752d63560e922ef7a8e12c3c2 Mon Sep 17 00:00:00 2001 From: Srayash Singh <146334722+Srayash@users.noreply.github.com> Date: Sun, 17 Nov 2024 20:05:33 +0530 Subject: [PATCH 2/5] Remove redundant "Add Consultation" button (#9095) --- src/components/Patient/PatientHome.tsx | 73 -------------------------- 1 file changed, 73 deletions(-) diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx index 3b5924009bb..9d3ab238e5b 100644 --- a/src/components/Patient/PatientHome.tsx +++ b/src/components/Patient/PatientHome.tsx @@ -242,14 +242,6 @@ export const PatientHome = (props: any) => { ); }; - const isPatientEligibleForNewConsultation = (patientData: PatientModel) => { - return patientData.is_active && - (!patientData?.last_consultation || - patientData?.last_consultation?.discharge_date) - ? true - : false; - }; - return ( {
-
- isPatientEligibleForNewConsultation(patientData) && - navigate( - `/facility/${patientData?.facility}/patient/${id}/consultation`, - ) - } - > -
-
- - - -
- -
-

- Add Consultation -

-
-
-
navigate(`/patient/${id}/investigation_reports`)} @@ -1290,28 +1239,6 @@ export const PatientHome = (props: any) => {
-
- - navigate( - `/facility/${patientData?.facility}/patient/${id}/consultation`, - ) - } - > - - - Add Consultation - - -
Date: Mon, 18 Nov 2024 15:59:37 +0530 Subject: [PATCH 3/5] fixed the condition in cypress video artefact upload (#9149) --- .github/workflows/cypress.yaml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/cypress.yaml b/.github/workflows/cypress.yaml index ecd06f922c0..506c2e56f66 100644 --- a/.github/workflows/cypress.yaml +++ b/.github/workflows/cypress.yaml @@ -116,7 +116,6 @@ jobs: group: "UI-Chrome" env: CYPRESS_SPLIT_TESTS: "true" - CYPRESS_RECORD_KEY: ${{ secrets.CYPRESS_RECORD_KEY }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} NODE_OPTIONS: --max_old_space_size=4096 COMMIT_INFO_MESSAGE: ${{github.event.pull_request.title}} @@ -133,7 +132,7 @@ jobs: - name: Upload cypress videos 📹 uses: actions/upload-artifact@v3 - if: steps.pr_origin.outputs.is_forked == 'true' + if: ${{ failure() && steps.pr_origin.outputs.is_forked == 'true' }} with: name: cypress-videos path: cypress/videos \ No newline at end of file From 5a85fb3afe4a14c3e94c8b9ab64f02098c6356ff Mon Sep 17 00:00:00 2001 From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:24:19 +0530 Subject: [PATCH 4/5] Fixed the flaky test in user skill management cypress test (#9148) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- cypress/e2e/users_spec/UsersManage.cy.ts | 9 ++------- cypress/pageobject/Hcx/HcxClaims.ts | 3 +++ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts index f3a04ca4410..22da938542d 100644 --- a/cypress/e2e/users_spec/UsersManage.cy.ts +++ b/cypress/e2e/users_spec/UsersManage.cy.ts @@ -65,14 +65,9 @@ describe("Manage User", () => { manageUserPage.clicklinkedskillbutton(); manageUserPage.selectSkillFromDropdown(linkedskill); manageUserPage.clickAddSkillButton(); - manageUserPage.clickCloseSlideOver(); - cy.wait(5000); // temporary hack to fix the failure - manageUserPage.clicklinkedskillbutton(); + cy.verifyNotification("Skill added successfully"); + cy.closeNotification(); manageUserPage.assertSkillInAddedUserSkills(linkedskill); - manageUserPage.clickUnlinkSkill(); - manageUserPage.clickSubmit(); - manageUserPage.selectSkillFromDropdown(linkedskill); - manageUserPage.clickAddSkillButton(); manageUserPage.clickCloseSlideOver(); // verifying the doctor connect manageUserPage.navigateToFacility(); diff --git a/cypress/pageobject/Hcx/HcxClaims.ts b/cypress/pageobject/Hcx/HcxClaims.ts index 9a915a05196..b93862e6d13 100644 --- a/cypress/pageobject/Hcx/HcxClaims.ts +++ b/cypress/pageobject/Hcx/HcxClaims.ts @@ -1,5 +1,8 @@ export class HcxClaims { selectEligiblePolicy(policy: string) { + cy.get("#select-insurance-policy", { timeout: 10000 }) + .should("be.visible") + .and("not.be.disabled"); cy.clickAndSelectOption("#select-insurance-policy", policy); } From c4f54a84bbbe885da149fcf1799e0c5a98f8218d Mon Sep 17 00:00:00 2001 From: Jacob John Jeevan <40040905+Jacobjeevan@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:36:08 +0530 Subject: [PATCH 5/5] Respiratory support table/graph: render no data points with no mode/modality (#9139) --- .../Facility/Consultations/VentilatorPlot.tsx | 60 +++++++------------ .../Consultations/VentilatorTable.tsx | 21 ++++--- 2 files changed, 36 insertions(+), 45 deletions(-) diff --git a/src/components/Facility/Consultations/VentilatorPlot.tsx b/src/components/Facility/Consultations/VentilatorPlot.tsx index 38948f165ea..2de4afe36a4 100644 --- a/src/components/Facility/Consultations/VentilatorPlot.tsx +++ b/src/components/Facility/Consultations/VentilatorPlot.tsx @@ -110,63 +110,47 @@ export const VentilatorPlot = ({ case "ventilator_tidal_volume": case "ventilator_peep": condition = - (currentRound.ventilator_interface === "INVASIVE" || - currentRound.ventilator_interface === "NON_INVASIVE") && - !!currentRound.ventilator_mode; + currentRound.ventilator_interface === "INVASIVE" || + currentRound.ventilator_interface === "NON_INVASIVE"; break; case "ventilator_fio2": condition = - currentRound.ventilator_interface === "OXYGEN_SUPPORT" && - currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA"; - break; - case "ventilator_spo2": - condition = - currentRound.ventilator_interface === "OXYGEN_SUPPORT" && - (currentRound.ventilator_oxygen_modality === "NASAL_PRONGS" || - currentRound.ventilator_oxygen_modality === "SIMPLE_FACE_MASK" || - currentRound.ventilator_oxygen_modality === - "NON_REBREATHING_MASK" || + currentRound.ventilator_interface === "INVASIVE" || + currentRound.ventilator_interface === "NON_INVASIVE" || + (currentRound.ventilator_interface === "OXYGEN_SUPPORT" && currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA"); break; + case "ventilator_spo2": + condition = currentRound.ventilator_interface !== "UNKNOWN"; + break; case "etco2": case "ventilator_oxygen_modality_flow_rate": condition = - !!currentRound.ventilator_mode || - !!currentRound.ventilator_oxygen_modality || - false; + currentRound.ventilator_interface === "OXYGEN_SUPPORT" && + currentRound.ventilator_oxygen_modality === "HIGH_FLOW_NASAL_CANNULA"; break; case "ventilator_oxygen_modality_oxygen_rate": condition = currentRound.ventilator_interface === "OXYGEN_SUPPORT" && - (currentRound.ventilator_oxygen_modality === "NASAL_PRONGS" || - currentRound.ventilator_oxygen_modality === "SIMPLE_FACE_MASK" || - currentRound.ventilator_oxygen_modality === "NON_REBREATHING_MASK"); + currentRound.ventilator_oxygen_modality !== "HIGH_FLOW_NASAL_CANNULA"; break; } switch (currentRound.ventilator_interface) { case "OXYGEN_SUPPORT": - legend = - t( - `OXYGEN_MODALITY__${currentRound.ventilator_oxygen_modality}_short`, - ) + - " (" + - t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT") + - ")"; + legend = currentRound.ventilator_oxygen_modality + ? `${t(`OXYGEN_MODALITY__${currentRound.ventilator_oxygen_modality}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT")})` + : t("RESPIRATORY_SUPPORT_SHORT__OXYGEN_SUPPORT"); break; case "INVASIVE": - legend = - t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`) + - " (" + - t("RESPIRATORY_SUPPORT_SHORT__INVASIVE") + - ")"; + legend = currentRound.ventilator_mode + ? `${t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__INVASIVE")})` + : t("RESPIRATORY_SUPPORT_SHORT__INVASIVE"); break; case "NON_INVASIVE": - legend = - t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`) + - " (" + - t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE") + - ")"; + legend = currentRound.ventilator_mode + ? `${t(`VENTILATOR_MODE__${currentRound.ventilator_mode}_short`)} (${t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE")})` + : t("RESPIRATORY_SUPPORT_SHORT__NON_INVASIVE"); break; } return { condition, legend }; @@ -178,9 +162,9 @@ export const VentilatorPlot = ({ switch (ventilatorInterface) { case "INVASIVE": case "NON_INVASIVE": - return round.ventilator_mode; + return round.ventilator_mode ?? "None"; case "OXYGEN_SUPPORT": - return round.ventilator_oxygen_modality; + return round.ventilator_oxygen_modality ?? "None"; default: return null; } diff --git a/src/components/Facility/Consultations/VentilatorTable.tsx b/src/components/Facility/Consultations/VentilatorTable.tsx index 2059f14bac0..9e4084cbaea 100644 --- a/src/components/Facility/Consultations/VentilatorTable.tsx +++ b/src/components/Facility/Consultations/VentilatorTable.tsx @@ -30,9 +30,13 @@ export default function VentilatorTable(props: VentilatorTableProps) { switch (ventilator_interface) { case "INVASIVE": case "NON_INVASIVE": - return t(`VENTILATOR_MODE__${ventilator_mode}`); + return ventilator_mode + ? t(`VENTILATOR_MODE__${ventilator_mode}`) + : "None"; case "OXYGEN_SUPPORT": - return t(`OXYGEN_MODALITY__${ventilator_oxygen_modality}`); + return ventilator_oxygen_modality + ? t(`OXYGEN_MODALITY__${ventilator_oxygen_modality}`) + : "None"; default: return null; } @@ -55,9 +59,9 @@ export default function VentilatorTable(props: VentilatorTableProps) { switch (ventilatorInterface) { case "INVASIVE": case "NON_INVASIVE": - return round.ventilator_mode; + return round.ventilator_mode ?? "None"; case "OXYGEN_SUPPORT": - return round.ventilator_oxygen_modality; + return round.ventilator_oxygen_modality ?? "None"; default: return null; } @@ -74,8 +78,9 @@ export default function VentilatorTable(props: VentilatorTableProps) { const nextInterfaceOrModality = getModeOrModality(nextRound); if ( nextInterfaceOrModality && - currentRound.ventilator_interface == nextRound.ventilator_interface && - currentInterfaceOrModality == nextInterfaceOrModality + currentRound.ventilator_interface === + nextRound.ventilator_interface && + currentInterfaceOrModality === nextInterfaceOrModality ) { index += 1; } else { @@ -105,6 +110,8 @@ export default function VentilatorTable(props: VentilatorTableProps) { const sortedData: DailyRoundsModel[] = dailyRoundsList.sort( compareByDateString("taken_at"), ); + const tableBody = VentilatorTableBody(sortedData); + if (!tableBody.length) return null; return (
@@ -122,7 +129,7 @@ export default function VentilatorTable(props: VentilatorTableProps) { - {VentilatorTableBody(sortedData)} + {tableBody}
);