From 6e37cae82b6f09f2cf7fd4991b25657f5f9b0885 Mon Sep 17 00:00:00 2001
From: Yaswanth Kumar Bethu <yash.topaz@gmail.com>
Date: Sun, 17 Nov 2024 20:03:24 +0530
Subject: [PATCH 01/24] 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 }) => (
       <DailyRounds
         facilityId={facilityId}
@@ -101,7 +101,7 @@ const consultationRoutes: AppRoutes = {
         id={id}
       />
     ),
-  "/facility/:facilityId/patient/:patientId/consultation/:consultationId/daily-rounds/:id":
+  "/facility/:facilityId/patient/:patientId/consultation/:consultationId/log_updates/:id":
     ({ facilityId, patientId, consultationId, id }) => (
       <DailyRoundListDetails
         facilityId={facilityId}
@@ -110,7 +110,7 @@ const consultationRoutes: AppRoutes = {
         id={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 }) => (
       <CriticalCarePreview
         facilityId={facilityId}
@@ -119,7 +119,7 @@ const consultationRoutes: AppRoutes = {
         id={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 }) => (
       <CriticalCareEditor
         facilityId={facilityId}
diff --git a/src/common/constants.tsx b/src/common/constants.tsx
index 857796d7c88..d46c42969ee 100644
--- a/src/common/constants.tsx
+++ b/src/common/constants.tsx
@@ -653,12 +653,12 @@ export const NOTIFICATION_EVENTS: NotificationEvent[] = [
   },
   {
     id: "PATIENT_CONSULTATION_UPDATE_CREATED",
-    text: "Patient Consultation Update Created",
+    text: "Patient Log Update Created",
     icon: "l-heart",
   },
   {
     id: "PATIENT_CONSULTATION_UPDATE_UPDATED",
-    text: "Patient Consultation Update Updated",
+    text: "Patient Log Update Updated",
     icon: "l-heart-medical",
   },
   {
diff --git a/src/components/Facility/ConsultationCard.tsx b/src/components/Facility/ConsultationCard.tsx
index 213f306d730..1a2ed02d6ad 100644
--- a/src/components/Facility/ConsultationCard.tsx
+++ b/src/components/Facility/ConsultationCard.tsx
@@ -1,4 +1,5 @@
 import careConfig from "@careConfig";
+import { t } from "i18next";
 import { navigate } from "raviger";
 import { useState } from "react";
 
@@ -169,7 +170,7 @@ export const ConsultationCard = (props: ConsultationProps) => {
         </div>
         <div className="mt-4 flex w-full flex-col justify-between gap-1 md:flex-row">
           <ButtonV2
-            id="view_consultation_updates"
+            id="view_consultation_and_log_updates"
             className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
             onClick={() =>
               navigate(
@@ -177,7 +178,7 @@ export const ConsultationCard = (props: ConsultationProps) => {
               )
             }
           >
-            View Consultation / Consultation Updates
+            {t("view_consultation_and_log_updates")}
           </ButtonV2>
           <ButtonV2
             className="h-auto whitespace-pre-wrap border border-secondary-500 bg-white text-black hover:bg-secondary-300"
@@ -200,14 +201,14 @@ export const ConsultationCard = (props: ConsultationProps) => {
                   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")}
             </ButtonV2>
           )}
         </div>
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 ? (
             <EventsList query={eventsQuery!} />
           ) : (
-            <DailyRoundsList
+            <LogUpdatesList
               consultation={props.consultationData}
               query={dailyRoundsQuery!}
             />
@@ -773,7 +773,7 @@ function DailyRoundsSortDropdown({
   setDailyRoundsQuery: (query: QueryParams) => void;
 }) {
   return (
-    <DailyRoundsFilter
+    <LogUpdatesFilter
       onApply={(query) => {
         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 (
     <div
       className="flex w-full flex-col gap-4 rounded-lg border border-secondary-400 p-4 @container"
-      id="dailyround-entry"
+      id="logupdate-entry"
     >
       <LogUpdateCardAttribute
         attributeKey={"rounds_type"}
@@ -59,8 +59,8 @@ const DefaultLogUpdateCard = ({ round, ...props }: Props) => {
             ["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`
           }
         >
           <CareIcon icon="l-eye" className="text-lg" />
@@ -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`
           }
         >
           <CareIcon icon="l-pen" className="text-lg" />
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<FilterState>({});
 
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) {
             <div className="flex flex-col gap-4 overflow-y-auto overflow-x-hidden px-3">
               <PaginatedList.WhenEmpty className="flex w-full justify-center border-b border-secondary-200 bg-white p-5 text-center text-2xl font-bold text-secondary-500">
                 <span className="flex justify-center rounded-lg bg-white p-3 text-secondary-700">
-                  {t("no_consultation_updates")}
+                  {t("no_log_updates")}
                 </span>
               </PaginatedList.WhenEmpty>
               <PaginatedList.WhenLoading>
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`}
               >
                 <CareIcon
                   icon="l-info-circle"
@@ -178,7 +178,7 @@ type SectionEditorProps = {
 };
 
 const SectionEditor = ({ log, onComplete, section }: SectionEditorProps) => {
-  const [consultationId, id] = useSlugs("consultation", "daily_rounds");
+  const [consultationId, id] = useSlugs("consultation", "log_updates");
   const [diff, setDiff] = useState<Partial<DailyRoundsModel>>({});
   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) {
 
       <Card className="md:rounded-xl lg:p-8">
         <h2 className="mb-3 flex flex-col gap-4 text-black md:flex-row md:items-center">
-          <span>Consultation Updates</span>
+          <span>{t("log_updates")}</span>
           <div className="max-w-min whitespace-nowrap rounded-full border border-primary-300 bg-primary-100 px-2.5 py-1.5 text-sm font-semibold text-primary-500">
             <span>{t(`ROUNDS_TYPE__${data.rounds_type}`)}</span>
           </div>
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 (
     <Page
-      title={`Consultation Update #${id}`}
-      backUrl={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds`}
+      title={t("log_update") + ` #${id}`}
+      backUrl={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates`}
     >
       <div
         className="mt-4 h-full rounded-lg border bg-white p-4 text-black shadow hover:border-primary-500"
@@ -51,7 +51,7 @@ export const DailyRoundListDetails = (props: any) => {
           <div>
             <div className="mt-2">
               <ButtonV2
-                href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/daily-rounds/${id}/update`}
+                href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/log_updates/${id}/update`}
               >
                 Update Details
               </ButtonV2>
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<ConsultationDiagnosis[]>();
   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 02/24] 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 (
     <Page
       title={t("patient_details")}
@@ -1061,49 +1053,6 @@ export const PatientHome = (props: any) => {
         <section className="mt-4 space-y-2 md:flex">
           <div className="hidden lg:block">
             <div className="mt-4 grid grid-cols-6 gap-5 xl:grid-cols-7">
-              <div
-                className={classNames(
-                  "w-full rounded-lg border",
-                  isPatientEligibleForNewConsultation(patientData)
-                    ? "cursor-pointer border-green-700 hover:bg-primary-400"
-                    : "border-secondary-700 text-secondary-700 hover:cursor-not-allowed",
-                )}
-                onClick={() =>
-                  isPatientEligibleForNewConsultation(patientData) &&
-                  navigate(
-                    `/facility/${patientData?.facility}/patient/${id}/consultation`,
-                  )
-                }
-              >
-                <div
-                  className={classNames(
-                    "h-full space-y-2 rounded-lg bg-white p-4 shadow",
-                    isPatientEligibleForNewConsultation(patientData) &&
-                      "hover:bg-secondary-200",
-                  )}
-                >
-                  <div
-                    className={classNames(
-                      "text-center",
-                      isPatientEligibleForNewConsultation(patientData) &&
-                        "text-green-700",
-                    )}
-                  >
-                    <span>
-                      <CareIcon
-                        icon="l-chat-bubble-user"
-                        className="text-5xl"
-                      />
-                    </span>
-                  </div>
-
-                  <div>
-                    <p className="text-center text-sm font-medium">
-                      Add Consultation
-                    </p>
-                  </div>
-                </div>
-              </div>
               <div
                 className="w-full"
                 onClick={() => navigate(`/patient/${id}/investigation_reports`)}
@@ -1290,28 +1239,6 @@ export const PatientHome = (props: any) => {
           <div className="mx-2 w-full lg:hidden">
             <div className="h-full space-y-2 rounded-lg bg-white p-4 shadow">
               <div className="space-y-2 border-b border-dashed text-left text-lg font-semibold text-secondary-900">
-                <div>
-                  <ButtonV2
-                    className="w-full"
-                    disabled={
-                      !(
-                        patientData.is_active &&
-                        (!patientData?.last_consultation ||
-                          patientData?.last_consultation?.discharge_date)
-                      )
-                    }
-                    onClick={() =>
-                      navigate(
-                        `/facility/${patientData?.facility}/patient/${id}/consultation`,
-                      )
-                    }
-                  >
-                    <span className="flex w-full items-center justify-start gap-2">
-                      <CareIcon icon="l-chat-bubble-user" className="text-xl" />
-                      Add Consultation
-                    </span>
-                  </ButtonV2>
-                </div>
                 <div>
                   <ButtonV2
                     className="w-full"

From 5469cc4927b724e7b10609da402b3ed64ff0f251 Mon Sep 17 00:00:00 2001
From: Khavin Shankar <khavinshankar@gmail.com>
Date: Mon, 18 Nov 2024 15:59:37 +0530
Subject: [PATCH 03/24] 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 04/24] 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 05/24] 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 (
     <div className="my-3 w-full overflow-x-scroll rounded-lg border bg-white px-4 pt-3 shadow">
@@ -122,7 +129,7 @@ export default function VentilatorTable(props: VentilatorTableProps) {
             </th>
           </tr>
         </thead>
-        <tbody>{VentilatorTableBody(sortedData)}</tbody>
+        <tbody>{tableBody}</tbody>
       </table>
     </div>
   );

From 294f6b03a1313bf31f840111a4b5c717626f2ed9 Mon Sep 17 00:00:00 2001
From: Nithish Kumar Siliveru <nithishsiliveru18@gmail.com>
Date: Mon, 18 Nov 2024 19:04:31 +0530
Subject: [PATCH 06/24] fixed doctor calling button size and added types
 (#9130)

---
 public/locale/en.json                     | 1 +
 src/components/Patient/ManagePatients.tsx | 7 ++++---
 2 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/public/locale/en.json b/public/locale/en.json
index 36c25a06682..21fa1bea6ba 100644
--- a/public/locale/en.json
+++ b/public/locale/en.json
@@ -905,6 +905,7 @@
   "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_found": "No Patients Found",
   "no_patients_to_show": "No patients to show.",
   "no_policy_added": "No Insurance Policy Added",
   "no_policy_found": "No Insurance Policy Found for this Patient",
diff --git a/src/components/Patient/ManagePatients.tsx b/src/components/Patient/ManagePatients.tsx
index d42f0072794..0664532b0a1 100644
--- a/src/components/Patient/ManagePatients.tsx
+++ b/src/components/Patient/ManagePatients.tsx
@@ -392,7 +392,7 @@ export const PatientManager = () => {
   );
 
   const LastAdmittedToTypeBadges = () => {
-    const badge = (key: string, value: any, id: string) => {
+    const badge = (key: string, value: string | undefined, id: string) => {
       return (
         value && (
           <FilterBadge
@@ -421,7 +421,7 @@ export const PatientManager = () => {
   };
 
   const HasConsentTypesBadges = () => {
-    const badge = (key: string, value: any, id: string) => {
+    const badge = (key: string, value: string | undefined, id: string) => {
       return (
         value && (
           <FilterBadge
@@ -773,7 +773,7 @@ export const PatientManager = () => {
     managePatients = (
       <div className="col-span-3 w-full rounded-lg bg-white p-2 py-8 pt-4 text-center">
         <p className="text-2xl font-bold text-secondary-600">
-          No Patients Found
+          {t("no_patients_found")}
         </p>
       </div>
     );
@@ -875,6 +875,7 @@ export const PatientManager = () => {
             />
             {!!params.facility && (
               <ButtonV2
+                className="w-full lg:w-fit"
                 id="doctor-connect-patient-button"
                 onClick={() => {
                   triggerGoal("Doctor Connect Clicked", {

From a8beedcf981089650a82bf120a287981d765ff7a Mon Sep 17 00:00:00 2001
From: Anvesh Nalimela <151531961+AnveshNalimela@users.noreply.github.com>
Date: Mon, 18 Nov 2024 19:06:06 +0530
Subject: [PATCH 07/24] Design of List View layout  in Resource Page (#9096)

---
 public/locale/en.json                    |   4 +
 src/components/Resource/ResourceList.tsx | 174 ++++++++++++++++++++---
 2 files changed, 160 insertions(+), 18 deletions(-)

diff --git a/public/locale/en.json b/public/locale/en.json
index 21fa1bea6ba..e281d8239bf 100644
--- a/public/locale/en.json
+++ b/public/locale/en.json
@@ -5,6 +5,7 @@
   "APPETITE__NO_TASTE_FOR_FOOD": "No taste for food",
   "APPETITE__REDUCED": "Reduced",
   "APPETITE__SATISFACTORY": "Satisfactory",
+  "APPROVED": "Approved",
   "AUTOMATED": "Automated",
   "BED_WITH_OXYGEN_SUPPORT": "Bed with Oxygen Support",
   "BLADDER_DRAINAGE__CONDOM_CATHETER": "Condom Catheter",
@@ -140,6 +141,7 @@
   "OXYGEN_MODALITY__NON_REBREATHING_MASK_short": "NRM",
   "OXYGEN_MODALITY__SIMPLE_FACE_MASK": "Simple Face Mask",
   "OXYGEN_MODALITY__SIMPLE_FACE_MASK_short": "SFM",
+  "PENDING": "Pending",
   "PRESCRIPTION_FREQUENCY_BD": "Twice daily",
   "PRESCRIPTION_FREQUENCY_HS": "Night only",
   "PRESCRIPTION_FREQUENCY_OD": "Once daily",
@@ -205,6 +207,7 @@
   "SORT_OPTIONS__taken_at": "Oldest taken date first",
   "Submit": "Submit",
   "TELEMEDICINE": "Telemedicine",
+  "TRANSPORTATION TO BE ARRANGED": "Transportation",
   "URINATION_FREQUENCY__DECREASED": "Decreased",
   "URINATION_FREQUENCY__INCREASED": "Increased",
   "URINATION_FREQUENCY__NORMAL": "Normal",
@@ -1103,6 +1106,7 @@
   "resource_approving_facility": "Resource approving facility",
   "resource_origin_facility": "Origin Facility",
   "resource_request": "Resource Request",
+  "resource_status": "Resource Status",
   "result": "Result",
   "result_date": "Result Date",
   "result_details": "Result details",
diff --git a/src/components/Resource/ResourceList.tsx b/src/components/Resource/ResourceList.tsx
index 8a12545d7d1..6eecf7fcef2 100644
--- a/src/components/Resource/ResourceList.tsx
+++ b/src/components/Resource/ResourceList.tsx
@@ -1,6 +1,7 @@
-import { navigate } from "raviger";
+import { Link, navigate } from "raviger";
 import { useTranslation } from "react-i18next";
 
+import Chip from "@/CAREUI/display/Chip";
 import CareIcon from "@/CAREUI/icons/CareIcon";
 import { AdvancedFilterButton } from "@/CAREUI/interactive/FiltersSlideover";
 
@@ -11,7 +12,6 @@ import Page from "@/components/Common/Page";
 import { ResourceModel } from "@/components/Facility/models";
 import SearchInput from "@/components/Form/SearchInput";
 import BadgesList from "@/components/Resource/ResourceBadges";
-import ResourceBlock from "@/components/Resource/ResourceBlock";
 import { formatFilter } from "@/components/Resource/ResourceCommons";
 import ListFilter from "@/components/Resource/ResourceFilter";
 
@@ -20,6 +20,7 @@ import useFilters from "@/hooks/useFilters";
 import routes from "@/Utils/request/api";
 import request from "@/Utils/request/request";
 import useQuery from "@/Utils/request/useQuery";
+import { formatDateTime } from "@/Utils/utils";
 
 export default function ListView() {
   const {
@@ -48,15 +49,140 @@ export default function ListView() {
   const showResourceCardList = (data: ResourceModel[]) => {
     if (data && !data.length) {
       return (
-        <div className="mt-64 flex flex-1 justify-center text-secondary-600">
+        <div className="w-full mt-64 flex flex-1 justify-center text-secondary-600">
           {t("no_results_found")}
         </div>
       );
     }
 
-    return data.map((resource, i) => (
-      <div key={i} className="rounded-lg border border-secondary-300 bg-white">
-        <ResourceBlock resource={resource} />
+    return data.map((resource: ResourceModel, i) => (
+      <div
+        key={i}
+        className="w-full border border-b-2 border-gray-200  col-span-6"
+      >
+        <div className=" flex grid w-full gap-1 overflow-hidden bg-white p-4    sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-5">
+          <div className="col-span-1 px-3 text-left">
+            <div className="text-sm font-bold capitalize">{resource.title}</div>
+          </div>
+
+          <div className="col-span-1 flex flex-col px-2 text-left">
+            <div className="category">
+              <dt
+                title={t("LOG_UPDATE_FIELD_LABEL__patient_category")}
+                className="flex items-center text-sm font-medium leading-5 text-secondary-500"
+              >
+                <CareIcon icon="l-box" className="text-lg mr-1" />
+                <dd className="text-sm font-bold leading-5 text-secondary-900">
+                  {resource.category || ""}
+                </dd>
+              </dt>
+            </div>
+            <div className="address mt-1">
+              <dd className="text-xs font-medium leading-5">
+                {resource.sub_category || "--"}
+              </dd>
+            </div>
+          </div>
+
+          <div className="col-span-1 flex flex-col px-3 text-left">
+            <div className="3xl:flex-row mb-2 flex gap-2 sm:flex-row md:flex-row lg:flex-col xl:flex-row 2xl:flex-row ">
+              {resource.status === "TRANSPORTATION TO BE ARRANGED" ? (
+                <dt
+                  title={t("resource_status")}
+                  className="w-3/4 mt-1 h-fit flex h-5 shrink-0 items-center  overflow-hidden whitespace-nowrap text-ellipsis truncate"
+                >
+                  <Chip
+                    size="small"
+                    variant="secondary"
+                    startIcon="l-truck"
+                    text={t(`${resource.status}`)}
+                    className="text-lg font-bold text-sky-600 truncate bg-gray-300 rounded-full uppercase text-center"
+                  />
+                </dt>
+              ) : (
+                <dt
+                  title={t("resource_status")}
+                  className="w-fit mt-1 h-fit flex h-5 shrink-0 items-center rounded-full  leading-4"
+                >
+                  <Chip
+                    size="small"
+                    variant={
+                      resource.status === "APPROVED" ? "primary" : "secondary"
+                    }
+                    startIcon="l-truck"
+                    text={t(`${resource.status}`)}
+                    className={`text-lg font-bold rounded-full uppercase ${
+                      resource.status === "APPROVED"
+                        ? "bg-sky-200"
+                        : "bg-yellow-200 "
+                    }`}
+                  />
+                </dt>
+              )}
+
+              <div>
+                {resource.emergency && (
+                  <span className="mt-1.5 inline-block shrink-0 rounded-full bg-red-100 px-2 py-1 text-xs font-medium leading-4 text-red-800">
+                    {t("emergency")}
+                  </span>
+                )}
+              </div>
+            </div>
+
+            <div className="text-center">
+              <dt
+                title={t("last_modified")}
+                className={"flex items-center text-sm font-medium leading-5"}
+              >
+                <CareIcon icon="l-stopwatch" className="mr-1" />
+                <dd className="text-xs font-medium leading-5">
+                  {formatDateTime(resource.modified_date) || "--"}
+                </dd>
+              </dt>
+            </div>
+          </div>
+
+          <div className="col-span-1 text-left">
+            <dt
+              title={t("origin_facility")}
+              className="flex items-center text-left text-sm font-medium leading-5 text-secondary-500"
+            >
+              <CareIcon icon="l-plane-departure" className="mr-2" />
+              <dd className="text-sm font-bold leading-5 text-secondary-900">
+                {resource.origin_facility_object?.name}
+              </dd>
+            </dt>
+
+            <dt
+              title={t("resource_approving_facility")}
+              className="flex items-center text-left text-sm font-medium leading-5 text-secondary-500"
+            >
+              <CareIcon icon="l-user-check" className="mr-2" />
+              <dd className="text-sm font-bold leading-5 text-secondary-900">
+                {resource.approving_facility_object?.name}
+              </dd>
+            </dt>
+
+            <dt
+              title={t("assigned_facility")}
+              className="flex items-center text-left text-sm font-medium leading-5 text-secondary-500"
+            >
+              <CareIcon icon="l-plane-arrival" className="mr-2" />
+              <dd className="text-sm font-bold leading-5 text-secondary-900">
+                {resource.assigned_facility_object?.name ||
+                  t("yet_to_be_decided")}
+              </dd>
+            </dt>
+          </div>
+          <div className="col-span-1 mt-2 flex flex-col text-left">
+            <Link
+              href={`/resource/${resource.id}`}
+              className="flex w-full items-center justify-center gap-2 rounded-lg border border-secondary-300 bg-secondary-200 p-2 text-sm font-semibold text-inherit transition-all hover:bg-secondary-300"
+            >
+              <CareIcon icon="l-eye" className="text-lg" /> {t("all_details")}
+            </Link>
+          </div>
+        </div>
       </div>
     ));
   };
@@ -79,7 +205,8 @@ export default function ListView() {
       breadcrumbs={false}
       options={
         <>
-          <div className="md:px-4">
+          <div className="md:px-4"></div>
+          <div className="mt-2 flex w-full flex-col items-center justify-between gap-2 pt-2 xl:flex-row">
             <SearchInput
               name="title"
               value={qParams.title}
@@ -87,18 +214,15 @@ export default function ListView() {
               placeholder={t("search_resource")}
             />
           </div>
-          <div className="w-32">
-            {/* dummy div to align space as per board view */}
-          </div>
-          <div className="flex w-full flex-col gap-2 lg:w-fit lg:flex-row lg:gap-4">
-            <ButtonV2 className="py-[11px]" onClick={onBoardViewBtnClick}>
-              <CareIcon icon="l-list-ul" className="rotate-90" />
-              {t("board_view")}
-            </ButtonV2>
 
+          <div className="mt-2 flex w-full flex-col gap-2 lg:w-fit lg:flex-row lg:gap-4">
             <AdvancedFilterButton
               onClick={() => advancedFilter.setShow(true)}
             />
+            <ButtonV2 className="py-[11px]" onClick={onBoardViewBtnClick}>
+              <CareIcon icon="l-list-ul" className="rotate-90" />
+              {t("board_view")}
+            </ButtonV2>
           </div>
         </>
       }
@@ -123,10 +247,24 @@ export default function ListView() {
                 {t("refresh_list")}
               </button>
             </div>
-
-            <div className="mb-5 grid grid-cols-1 gap-4 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4">
-              {data?.results && showResourceCardList(data?.results)}
+            <div className="mx-5 mt-5 grid w-full gap-2 border-b-2 border-gray-100 p-4 text-sm font-medium sm:grid-cols-1 md:grid-cols-1 lg:grid-cols-5">
+              <div className="col-span-1 uppercase sm:text-center md:text-center lg:block lg:text-left">
+                {t("resource")}
+              </div>
+              <div className="col-span-1 hidden text-left uppercase sm:hidden md:hidden lg:block">
+                {t("LOG_UPDATE_FIELD_LABEL__patient_category")}
+              </div>
+              <div className="col-span-1 hidden text-left uppercase sm:hidden md:hidden lg:block">
+                {t("consent__status")}
+              </div>
+              <div className="col-span-1 hidden text-left uppercase sm:hidden md:hidden lg:block">
+                {t("facilities")}
+              </div>
+              <div className="col-span-1 hidden text-left uppercase sm:hidden md:hidden lg:block">
+                {t("LOG_UPDATE_FIELD_LABEL__action")}
+              </div>
             </div>
+            <div>{showResourceCardList(data?.results || [])}</div>
             <div>
               <Pagination totalCount={data?.count || 0} />
             </div>

From e49c274892e6e7d5a1263c0a59507efbe7cacbea Mon Sep 17 00:00:00 2001
From: Srayash Singh <146334722+Srayash@users.noreply.github.com>
Date: Mon, 18 Nov 2024 19:06:36 +0530
Subject: [PATCH 08/24] disable "Save Button" if no file is selected (#9111)

---
 src/components/Common/AvatarEditModal.tsx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/components/Common/AvatarEditModal.tsx b/src/components/Common/AvatarEditModal.tsx
index 38b54b1f1d2..bcc61819fde 100644
--- a/src/components/Common/AvatarEditModal.tsx
+++ b/src/components/Common/AvatarEditModal.tsx
@@ -292,7 +292,7 @@ const AvatarEditModal = ({
                 <ButtonV2
                   id="save-cover-image"
                   onClick={uploadAvatar}
-                  disabled={isProcessing}
+                  disabled={isProcessing || !selectedFile}
                 >
                   {isProcessing ? (
                     <CareIcon

From 2dc5923b3ab2bb95820bfded4fc9222f11027fc4 Mon Sep 17 00:00:00 2001
From: eat_code_sleep <141677292+i0am0arunava@users.noreply.github.com>
Date: Mon, 18 Nov 2024 19:11:14 +0530
Subject: [PATCH 09/24] Fixed:Show more monitors in CNS on very large displays
 #6503 (#9013)

Co-authored-by: Rithvik Nishad <rithvikn2001@gmail.com>
Co-authored-by: rithviknishad <mail@rithviknishad.dev>
---
 .../Facility/CentralNursingStation.tsx        | 50 ++++++++++---------
 src/hooks/useBreakpoints.ts                   |  4 +-
 2 files changed, 30 insertions(+), 24 deletions(-)

diff --git a/src/components/Facility/CentralNursingStation.tsx b/src/components/Facility/CentralNursingStation.tsx
index 6c5d1381064..f5c17b52360 100644
--- a/src/components/Facility/CentralNursingStation.tsx
+++ b/src/components/Facility/CentralNursingStation.tsx
@@ -21,14 +21,13 @@ import HL7PatientVitalsMonitor from "@/components/VitalsMonitor/HL7PatientVitals
 import useVitalsAspectRatioConfig from "@/components/VitalsMonitor/useVitalsAspectRatioConfig";
 import { getVitalsMonitorSocketUrl } from "@/components/VitalsMonitor/utils";
 
+import useBreakpoints from "@/hooks/useBreakpoints";
 import useFilters from "@/hooks/useFilters";
 import useFullscreen from "@/hooks/useFullscreen";
 
 import routes from "@/Utils/request/api";
 import useQuery from "@/Utils/request/useQuery";
 
-const PER_PAGE_LIMIT = 6;
-
 const SORT_OPTIONS: SortOption[] = [
   { isAscending: true, value: "bed__name" },
   { isAscending: false, value: "-bed__name" },
@@ -41,31 +40,34 @@ interface Props {
 }
 
 export default function CentralNursingStation({ facilityId }: Props) {
+  const perPageLimit = useBreakpoints({
+    default: 6,
+    "4xl": 9,
+    "4k": 24,
+  });
   const { t } = useTranslation();
   const [isFullscreen, setFullscreen] = useFullscreen();
   const { qParams, updateQuery, removeFilter, updatePage } = useFilters({
-    limit: PER_PAGE_LIMIT,
+    limit: perPageLimit,
   });
   const query = useQuery(routes.listPatientAssetBeds, {
     pathParams: { facility_external_id: facilityId },
     query: {
       ...qParams,
       page: qParams.page || 1,
-      limit: PER_PAGE_LIMIT,
-      offset: (qParams.page ? qParams.page - 1 : 0) * PER_PAGE_LIMIT,
+      limit: perPageLimit,
+      offset: (qParams.page ? qParams.page - 1 : 0) * perPageLimit,
       asset_class: "HL7MONITOR",
       ordering: qParams.ordering || "bed__name",
       bed_is_occupied:
         qParams.monitors_without_patient === "true" ? undefined : "true",
     },
   });
-
   const totalCount = query.data?.count ?? 0;
   const data = query.data?.results.map((obj) => ({
     patientAssetBed: obj,
     socketUrl: getVitalsMonitorSocketUrl(obj.asset),
   }));
-
   const { config, hash } = useVitalsAspectRatioConfig({
     default: 6 / 11,
     sm: 17 / 11,
@@ -88,7 +90,7 @@ export default function CentralNursingStation({ facilityId }: Props) {
           <Pagination
             className=""
             cPage={qParams.page}
-            defaultPerPage={PER_PAGE_LIMIT}
+            defaultPerPage={perPageLimit}
             data={{ totalCount }}
             onChange={(page) => updatePage(page)}
           />
@@ -216,21 +218,23 @@ export default function CentralNursingStation({ facilityId }: Props) {
           {t("no_vitals_present")}
         </div>
       ) : (
-        <div className="3xl:grid-cols-3 mt-1 grid grid-cols-1 gap-1 lg:grid-cols-2">
-          {data.map((props, i) => (
-            <div className="overflow-hidden text-clip" key={i}>
-              <HL7PatientVitalsMonitor
-                patientCurrentBedAssignmentDate={
-                  props.patientAssetBed?.patient?.last_consultation?.current_bed
-                    ?.start_date
-                }
-                key={`${props.patientAssetBed?.bed.id}-${hash}`}
-                patientAssetBed={props.patientAssetBed}
-                socketUrl={props.socketUrl || ""}
-                config={config}
-              />
-            </div>
-          ))}
+        <div className="@container">
+          <div className="mt-1 grid grid-cols-1 gap-1 @5xl:grid-cols-2 @7xl:grid-cols-3 @[140rem]:grid-cols-4 @[180rem]:grid-cols-5 @[240rem]:grid-cols-6">
+            {data.map((props, i) => (
+              <div className="overflow-hidden text-clip" key={i}>
+                <HL7PatientVitalsMonitor
+                  patientCurrentBedAssignmentDate={
+                    props.patientAssetBed?.patient?.last_consultation
+                      ?.current_bed?.start_date
+                  }
+                  key={`${props.patientAssetBed?.bed.id}-${hash}`}
+                  patientAssetBed={props.patientAssetBed}
+                  socketUrl={props.socketUrl || ""}
+                  config={config}
+                />
+              </div>
+            ))}
+          </div>
         </div>
       )}
     </Page>
diff --git a/src/hooks/useBreakpoints.ts b/src/hooks/useBreakpoints.ts
index bba811ab88e..2b36e4664eb 100644
--- a/src/hooks/useBreakpoints.ts
+++ b/src/hooks/useBreakpoints.ts
@@ -1,6 +1,6 @@
 import useWindowDimensions from "@/hooks/useWindowDimensions";
 
-type Breakpoints = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl";
+type Breakpoints = "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "4k";
 
 // Ensure that the breakpoint widths are sorted in ascending order.
 const BREAKPOINT_WIDTH: Record<Breakpoints, number> = {
@@ -10,6 +10,8 @@ const BREAKPOINT_WIDTH: Record<Breakpoints, number> = {
   xl: 1280,
   "2xl": 1536,
   "3xl": 1920,
+  "4xl": 2560,
+  "4k": 3840,
 };
 
 /**

From b17eb221aac972911ef6c3ae15cdc84c837b469a Mon Sep 17 00:00:00 2001
From: JavidSumra <112365664+JavidSumra@users.noreply.github.com>
Date: Tue, 19 Nov 2024 06:26:17 +0530
Subject: [PATCH 10/24] Add Cypress Test Suite for Sample Test Request Workflow
 (#8977)

Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
---
 .../e2e/facility_spec/FacilityHomepage.cy.ts  |   4 +-
 .../e2e/facility_spec/FacilityLocation.cy.ts  |   4 +-
 cypress/e2e/hcx_spec/HcxClaims.cy.ts          |   4 +-
 .../PatientConsultationCreation.cy.ts         |  22 ++--
 .../PatientConsultationDischarge.cy.ts        |  18 +--
 .../patient_spec/PatientInvestigation.cy.ts   |   2 +-
 .../e2e/patient_spec/PatientLogUpdate.cy.ts   |  40 +++---
 .../patient_spec/PatientPrescription.cy.ts    |  26 ++--
 .../sample_test_spec/SampleTestRequest.cy.ts  |  88 ++++++++++++++
 cypress/e2e/users_spec/UsersManage.cy.ts      |   1 +
 .../pageobject/Facility/FacilityCreation.ts   |   2 +-
 cypress/pageobject/Login/LoginPage.ts         |   4 +-
 .../pageobject/Patient/PatientConsultation.ts |   8 ++
 cypress/pageobject/Patient/PatientCreation.ts |   4 +-
 .../pageobject/Patient/PatientFileupload.ts   |   4 +-
 cypress/pageobject/Sample/SampleTestCreate.ts | 114 ++++++++++++++++++
 cypress/support/commands.ts                   |   7 +-
 cypress/support/index.ts                      |   3 +-
 src/components/Patient/PatientHome.tsx        |   1 +
 src/components/Patient/SampleDetails.tsx      |  16 ++-
 src/components/Patient/SampleTest.tsx         |  33 ++++-
 src/components/Patient/SampleTestCard.tsx     |  21 +++-
 src/components/Patient/SampleViewAdmin.tsx    |   7 +-
 23 files changed, 350 insertions(+), 83 deletions(-)
 create mode 100644 cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
 create mode 100644 cypress/pageobject/Sample/SampleTestCreate.ts

diff --git a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
index 08ea39ee2c9..2c5699ec76c 100644
--- a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
+++ b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
@@ -152,7 +152,7 @@ describe("Facility Homepage Function", () => {
     facilityNotify.verifyFacilityName(facilityName);
     facilityNotify.fillNotifyText(notificationMessage);
     facilityNotify.interceptPostNotificationReq();
-    cy.submitButton("Notify");
+    cy.clickSubmitButton("Notify");
     facilityNotify.verifyPostNotificationReq();
     cy.verifyNotification("Facility Notified");
     cy.closeNotification();
@@ -160,7 +160,7 @@ describe("Facility Homepage Function", () => {
     // Verify the frontend error on empty message
     facilityHome.clickFacilityNotifyButton();
     facilityNotify.verifyFacilityName(facilityName);
-    cy.submitButton("Notify");
+    cy.clickSubmitButton("Notify");
     facilityNotify.verifyErrorMessage(notificationErrorMsg);
     // close pop-up and verify
     facilityHome.verifyAndCloseNotifyModal();
diff --git a/cypress/e2e/facility_spec/FacilityLocation.cy.ts b/cypress/e2e/facility_spec/FacilityLocation.cy.ts
index b700f5c75ae..7d0c626a93b 100644
--- a/cypress/e2e/facility_spec/FacilityLocation.cy.ts
+++ b/cypress/e2e/facility_spec/FacilityLocation.cy.ts
@@ -194,14 +194,14 @@ describe("Location Management Section", () => {
     facilityLocation.clickAddNewLocationButton();
     facilityLocation.enterLocationName("Test Location with Beds");
     facilityLocation.selectLocationType("OTHER");
-    cy.submitButton("Add Location");
+    cy.clickSubmitButton("Add Location");
     cy.verifyNotification("Location created successfully");
     cy.closeNotification();
     facilityLocation.clickManageBedButton();
     facilityLocation.clickAddBedButton();
     facilityLocation.enterBedName("Bed 1");
     facilityLocation.selectBedType("Regular");
-    cy.submitButton("Add Bed(s)");
+    cy.clickSubmitButton("Add Bed(s)");
     cy.verifyNotification("1 Bed created successfully");
     cy.closeNotification();
     facilityLocation.loadLocationManagementPage("Dummy Shifting Center");
diff --git a/cypress/e2e/hcx_spec/HcxClaims.cy.ts b/cypress/e2e/hcx_spec/HcxClaims.cy.ts
index 2c4a6b45df9..869afd6fcbb 100644
--- a/cypress/e2e/hcx_spec/HcxClaims.cy.ts
+++ b/cypress/e2e/hcx_spec/HcxClaims.cy.ts
@@ -48,7 +48,7 @@ describe("HCX Claims configuration and approval workflow", () => {
       firstInsuranceIdentifier,
       patientInsurerName,
     );
-    cy.submitButton("Save Details");
+    cy.clickSubmitButton("Save Details");
     cy.verifyNotification("Patient updated successfully");
     cy.closeNotification();
     // Navigate to Consultation View and capture dynamic consultation ID
@@ -80,6 +80,8 @@ describe("HCX Claims configuration and approval workflow", () => {
     // Raise a HCX Pre-auth
     patientConsultationPage.clickManagePatientButton();
     patientConsultationPage.clickClaimsButton();
+    cy.verifyAndClickElement("#edit-insurance-policy", "Edit Insurance Policy");
+    cy.clickCancelButton();
     hcxClaims.selectEligiblePolicy(patientInsurerName);
     hcxClaims.verifyPolicyEligibility();
     cy.verifyNotification("Checking Policy Eligibility");
diff --git a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
index 4c84f7fad8f..bd6e7c0d967 100644
--- a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
+++ b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
@@ -91,11 +91,11 @@ describe("Patient Consultation in multiple combination", () => {
     patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
     patientTreatmentPlan.typeSpecialInstruction(specialInstruction);
     patientTreatmentPlan.fillTreatingPhysican(doctorName);
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     // the above submit should fail as IP number is missing
     patientConsultationPage.typePatientNumber(patientIpNumber);
     patientConsultationPage.selectBed("Dummy Bed 6");
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     cy.verifyNotification("Consultation created successfully");
     // Below code for the prescription module only present while creating a new consultation
     patientPrescription.clickAddPrescription();
@@ -104,7 +104,7 @@ describe("Patient Consultation in multiple combination", () => {
     patientPrescription.selectMedicine(medicineOne);
     patientPrescription.enterDosage("3");
     patientPrescription.selectDosageFrequency("Twice daily");
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.wait(2000);
     cy.verifyNotification("Medicine prescribed");
     patientPrescription.clickReturnToDashboard();
@@ -189,7 +189,7 @@ describe("Patient Consultation in multiple combination", () => {
       "#encounter_date",
       "220220241230",
     );
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     cy.verifyNotification(
       "Create Diagnoses - Atleast one diagnosis is required",
     );
@@ -198,7 +198,7 @@ describe("Patient Consultation in multiple combination", () => {
       diagnosis4,
       "add-icd11-diagnosis-as-confirmed",
     );
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     cy.verifyNotification("Consultation created successfully");
     // verify the data and death report
     patientConsultationPage.verifyTextInConsultation(
@@ -215,7 +215,7 @@ describe("Patient Consultation in multiple combination", () => {
       "#cause_of_death",
       "Cause of Death",
     );
-    cy.submitButton("Preview");
+    cy.clickSubmitButton("Preview");
     cy.preventPrint();
     patientDeathReport.clickPrintDeathReport();
     cy.get("@verifyPrevent").should("be.called");
@@ -261,7 +261,7 @@ describe("Patient Consultation in multiple combination", () => {
     // add telemedicine
     patientTreatmentPlan.clickTelemedicineCheckbox();
     patientTreatmentPlan.assignTelemedicineDoctor(doctorName);
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     cy.verifyNotification("Consultation created successfully");
     // verify the data reflection -
     patientConsultationPage.verifyTextInConsultation(
@@ -312,7 +312,7 @@ describe("Patient Consultation in multiple combination", () => {
     patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
     // no review after and no action
     patientTreatmentPlan.fillTreatingPhysican(doctorName);
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     cy.verifyNotification("Patient discharged successfully");
     // verify the Discharge Reason, Diagnosis, treatment physican
     patientConsultationPage.verifyTextInConsultation(
@@ -364,13 +364,13 @@ describe("Patient Consultation in multiple combination", () => {
     patientTreatmentPlan.typePatientGeneralInstruction(generalInstruction);
     patientTreatmentPlan.fillTreatingPhysican(doctorName);
     // no review after and no action
-    cy.submitButton("Create Consultation");
+    cy.clickSubmitButton("Create Consultation");
     // Create a shifting request
     cy.closeNotification();
     shiftCreation.typeCurrentFacilityPerson("Current Facility Person");
     shiftCreation.typeCurrentFacilityPhone("9999999999");
     shiftCreation.typeShiftReason("reason for shift");
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Shift request created successfully");
   });
 
@@ -386,7 +386,7 @@ describe("Patient Consultation in multiple combination", () => {
       cy.get("#condition-verification-status-menu").click();
       cy.get("#add-icd11-diagnosis-as-entered-in-error").click();
     });
-    cy.submitButton("Update Consultation");
+    cy.clickSubmitButton("Update Consultation");
     cy.verifyNotification("Consultation updated successfully");
     cy.get("#diagnoses-view").should("not.contain.text", diagnosis5);
     patientConsultationPage.verifyTextInConsultation(
diff --git a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
index e2403fd56bd..6a3d2863818 100644
--- a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
+++ b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
@@ -34,8 +34,8 @@ describe("Patient Discharge based on multiple reason", () => {
     patientPage.visitPatient("Dummy Patient 12");
     patientDischarge.clickDischarge();
     patientDischarge.selectDischargeReason(patientDischargeReason4);
-    cy.submitButton("Confirm Discharge");
-    cy.submitButton("Acknowledge & Submit");
+    cy.clickSubmitButton("Confirm Discharge");
+    cy.clickSubmitButton("Acknowledge & Submit");
     cy.verifyNotification("Patient Discharged Successfully");
     cy.closeNotification();
     // Verify the consultation dashboard reflection
@@ -52,8 +52,8 @@ describe("Patient Discharge based on multiple reason", () => {
     patientDischarge.selectDischargeReason(patientDischargeReason3);
     patientDischarge.typeDischargeNote(patientDeathCause);
     patientDischarge.typeDoctorName(doctorName);
-    cy.submitButton("Confirm Discharge");
-    cy.submitButton("Acknowledge & Submit");
+    cy.clickSubmitButton("Confirm Discharge");
+    cy.clickSubmitButton("Acknowledge & Submit");
     cy.verifyNotification("Patient Discharged Successfully");
     cy.closeNotification();
     // Verify the consultation dashboard reflection
@@ -77,8 +77,8 @@ describe("Patient Discharge based on multiple reason", () => {
     // select a non-registered facility and perform the discharge
     patientDischarge.typeReferringFacility(referringFreetextFacility);
     cy.wait(2000);
-    cy.submitButton("Confirm Discharge");
-    cy.submitButton("Acknowledge & Submit");
+    cy.clickSubmitButton("Confirm Discharge");
+    cy.clickSubmitButton("Acknowledge & Submit");
     cy.wait(2000);
     cy.verifyNotification("Patient Discharged Successfully");
     cy.closeNotification();
@@ -104,13 +104,13 @@ describe("Patient Discharge based on multiple reason", () => {
     patientPrescription.selectMedicine(patientMedicine);
     patientPrescription.enterDosage("4");
     patientPrescription.selectDosageFrequency("Twice daily");
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.wait(2000);
     cy.closeNotification();
     // submit the discharge pop-up
-    cy.submitButton("Confirm Discharge");
-    cy.submitButton("Acknowledge & Submit");
+    cy.clickSubmitButton("Confirm Discharge");
+    cy.clickSubmitButton("Acknowledge & Submit");
     cy.wait(2000);
     cy.verifyNotification("Patient Discharged Successfully");
     cy.closeNotification();
diff --git a/cypress/e2e/patient_spec/PatientInvestigation.cy.ts b/cypress/e2e/patient_spec/PatientInvestigation.cy.ts
index 7426890d5a6..262759bd360 100644
--- a/cypress/e2e/patient_spec/PatientInvestigation.cy.ts
+++ b/cypress/e2e/patient_spec/PatientInvestigation.cy.ts
@@ -28,7 +28,7 @@ describe("Patient Investigation Creation from Patient consultation page", () =>
       "Haematology",
       "Urine Test",
     ]);
-    cy.submitButton("Save Investigation");
+    cy.clickSubmitButton("Save Investigation");
     cy.verifyNotification("Please Enter at least one value");
     cy.closeNotification();
     // Temporary workflow for investigation since we dont have dummy data and moving away from existing module
diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
index b6399ff02ce..05958bdf3f0 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", () => {
     patientPage.visitPatient(domicilaryPatient);
     patientConsultationPage.clickEditConsultationButton();
     patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
-    cy.submitButton("Update Consultation");
+    cy.clickSubmitButton("Update Consultation");
     cy.verifyNotification("Consultation updated successfully");
     cy.closeNotification();
     patientLogupdate.clickLogupdate();
@@ -74,7 +74,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.selectRhythm(patientRhythmType);
     patientLogupdate.typeRhythm(patientRhythm);
     cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
-    cy.submitButton("Save");
+    cy.clickSubmitButton("Save");
     cy.verifyNotification("Tele-medicine Log created successfully");
   });
 
@@ -108,11 +108,11 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientPrescription.selectMedicine("DOLO");
     patientPrescription.enterDosage("4");
     patientPrescription.selectDosageFrequency("Twice daily");
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.closeNotification();
     // Submit the doctors log update
-    cy.submitButton("Save and Continue");
+    cy.clickSubmitButton("Save and Continue");
     cy.wait(2000);
     cy.verifyNotification("Progress Note created successfully");
     cy.closeNotification();
@@ -120,13 +120,13 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.selectCriticalCareSection("Neurological Monitoring");
     cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
     cy.get("#left_pupil_light_reaction-option-FIXED").click();
-    cy.submitButton("Update Details");
+    cy.clickSubmitButton("Update Details");
     cy.verifyNotification(
       "Neurological Monitoring details succesfully updated.",
     );
     cy.closeNotification();
     // Final Submission of the form
-    cy.submitButton("Complete");
+    cy.clickSubmitButton("Complete");
     cy.verifyNotification("Progress Note Log Update filed successfully");
     cy.closeNotification();
     // Verify the data reflection
@@ -143,7 +143,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.clickUpdateDetail();
     patientLogupdate.typeSystolic(patientModifiedSystolic);
     patientLogupdate.typeDiastolic(patientModifiedDiastolic);
-    cy.submitButton("Continue");
+    cy.clickSubmitButton("Continue");
     cy.verifyNotification("Progress Note updated successfully");
   });
 
@@ -156,7 +156,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.clickLogupdate();
     patientLogupdate.selectRoundType("Detailed Update");
     patientLogupdate.selectPatientCategory(patientCategory);
-    cy.submitButton("Save and Continue");
+    cy.clickSubmitButton("Save and Continue");
     cy.verifyNotification("Detailed Update created successfully");
     cy.closeNotification();
     // Select two Section - First One is Respiratory Support
@@ -166,7 +166,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.selectOxygenSupport();
     patientLogupdate.typeOxygenFlowRate(patientOxygenFlowRate);
     patientLogupdate.typeVentilatorSpo2(patientSpo2);
-    cy.submitButton("Update Details");
+    cy.clickSubmitButton("Update Details");
     cy.verifyNotification("Respiratory Support details succesfully updated.");
     cy.closeNotification();
     // Second Section will be Blood Sugar
@@ -174,10 +174,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.typeBloodSugar(patientBloodSugar);
     patientLogupdate.typeInsulinDosage(patientInsulinDosage);
     cy.get("#insulin_intake_frequency-option-BD").click();
-    cy.submitButton("Update Details");
+    cy.clickSubmitButton("Update Details");
     cy.verifyNotification("Blood Sugar details succesfully updated.");
     // Submit the form and verify the details
-    cy.submitButton("Complete");
+    cy.clickSubmitButton("Complete");
     cy.verifyNotification("Detailed Log Update filed successfully");
     cy.closeNotification();
     cy.contains("button", "Log Updates").click();
@@ -203,10 +203,10 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.selectCriticalCareSection("Dialysis");
     patientLogupdate.typeFluidBalance(patientFluidBalance);
     patientLogupdate.typeNetBalance(patientNetBalance);
-    cy.submitButton("Update Details");
+    cy.clickSubmitButton("Update Details");
     cy.verifyNotification("Dialysis details succesfully updated.");
     cy.closeNotification();
-    cy.submitButton("Complete");
+    cy.clickSubmitButton("Complete");
     cy.verifyNotification("Detailed Log Update filed successfully");
     cy.closeNotification();
     //Reverify the editted and newly added data
@@ -251,7 +251,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.selectRhythm(patientRhythmType);
     patientLogupdate.typeRhythm(patientRhythm);
     cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
-    cy.submitButton("Save");
+    cy.clickSubmitButton("Save");
     cy.wait(2000);
     cy.verifyNotification("Brief Update created successfully");
     // Verify the card content
@@ -263,7 +263,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientPage.visitPatient(domicilaryPatient);
     patientConsultationPage.clickEditConsultationButton();
     patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
-    cy.submitButton("Update Consultation");
+    cy.clickSubmitButton("Update Consultation");
     cy.verifyNotification("Consultation updated successfully");
     cy.closeNotification();
     patientLogupdate.clickLogupdate();
@@ -281,7 +281,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.selectRhythm(patientRhythmType);
     patientLogupdate.typeRhythm(patientRhythm);
     cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
-    cy.submitButton("Save");
+    cy.clickSubmitButton("Save");
     cy.verifyNotification("Brief Update created successfully");
     cy.closeNotification();
     // edit the card and verify the data.
@@ -307,7 +307,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.typeSystolic(patientModifiedSystolic);
     patientLogupdate.clearIntoElementById("#diastolic");
     patientLogupdate.typeDiastolic(patientModifiedDiastolic);
-    cy.submitButton("Continue");
+    cy.clickSubmitButton("Continue");
     cy.verifyNotification("Brief Update updated successfully");
     cy.contains("button", "Log Updates").click();
     patientLogupdate.clickLogUpdateViewDetails(
@@ -324,7 +324,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientPage.visitPatient(domicilaryPatient);
     patientConsultationPage.clickEditConsultationButton();
     patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
-    cy.submitButton("Update Consultation");
+    cy.clickSubmitButton("Update Consultation");
     cy.verifyNotification("Consultation updated successfully");
     cy.closeNotification();
     patientLogupdate.clickLogupdate();
@@ -336,7 +336,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.typeTemperature(patientTemperature);
     patientLogupdate.typeRespiratory(patientRespiratory);
     cy.get("#consciousness_level-option-RESPONDS_TO_PAIN").click();
-    cy.submitButton("Save");
+    cy.clickSubmitButton("Save");
     cy.verifyNotification("Brief Update created successfully");
     cy.closeNotification();
     cy.verifyContentPresence("#consultation-buttons", ["9"]);
@@ -346,7 +346,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
     patientLogupdate.typeSystolic(patientSystolic);
     patientLogupdate.typeDiastolic(patientDiastolic);
     patientLogupdate.typePulse(patientPulse);
-    cy.submitButton("Save");
+    cy.clickSubmitButton("Save");
     cy.verifyNotification("Brief Update created successfully");
     cy.closeNotification();
     cy.verifyContentPresence("#consultation-buttons", ["-"]);
diff --git a/cypress/e2e/patient_spec/PatientPrescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts
index 53e67324199..1011c2f4f4d 100644
--- a/cypress/e2e/patient_spec/PatientPrescription.cy.ts
+++ b/cypress/e2e/patient_spec/PatientPrescription.cy.ts
@@ -36,7 +36,7 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.selectMedicine(medicineNameOne);
     patientPrescription.enterDosage(medicineBaseDosage);
     patientPrescription.selectDosageFrequency(medicineFrequency);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.closeNotification();
     // Edit the existing medicine & Verify they are properly moved to discontinue position
@@ -44,16 +44,16 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.visitMedicineTab();
     cy.verifyAndClickElement("#0", medicineNameOne);
     cy.verifyContentPresence("#submit", ["Discontinue"]); // To verify the pop-up is open
-    cy.submitButton("Edit");
+    cy.clickSubmitButton("Edit");
     patientPrescription.enterDosage(medicineTargetDosage);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Prescription edited successfully");
     cy.closeNotification();
     // Discontinue a medicine & Verify the notification
     cy.verifyAndClickElement("#0", medicineNameOne);
-    cy.submitButton("Discontinue");
+    cy.clickSubmitButton("Discontinue");
     patientPrescription.enterDiscontinueReason("Medicine is been discontinued");
-    cy.submitButton("Confirm Discontinue");
+    cy.clickSubmitButton("Confirm Discontinue");
     cy.verifyNotification("Prescription discontinued");
     cy.closeNotification();
     // verify the discontinue medicine view
@@ -73,7 +73,7 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.selectMedicine(medicineNameOne);
     patientPrescription.enterDosage(medicineBaseDosage);
     patientPrescription.enterIndicator(medicineIndicator);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.closeNotification();
     // Add Second Medicine
@@ -83,7 +83,7 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.selectMedicine(medicineNameTwo);
     patientPrescription.enterDosage(medicineBaseDosage);
     patientPrescription.enterIndicator(medicineIndicator);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.closeNotification();
     patientPrescription.clickReturnToDashboard();
@@ -108,7 +108,7 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.enterDosage(medicineBaseDosage);
     patientPrescription.enterTargetDosage(medicineTargetDosage);
     patientPrescription.selectDosageFrequency(medicineFrequency);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.closeNotification();
     // Administer the medicine in edit form
@@ -116,7 +116,7 @@ describe("Patient Medicine Administration", () => {
     cy.wait(2000);
     patientPrescription.enterAdministerDosage(medicineBaseDosage);
     patientPrescription.enterAdministerNotes(medicineAdministerNote);
-    cy.submitButton("Administer Medicine");
+    cy.clickSubmitButton("Administer Medicine");
     cy.verifyNotification("Medicine(s) administered");
     cy.closeNotification();
     // Verify the Reflection on the Medicine
@@ -129,9 +129,9 @@ describe("Patient Medicine Administration", () => {
     // Go to medicine tab and administer it again
     patientPrescription.visitMedicineTab();
     cy.verifyAndClickElement("#0", medicineNameOne);
-    cy.submitButton("Administer");
+    cy.clickSubmitButton("Administer");
     patientPrescription.enterAdministerDosage(medicineBaseDosage);
-    cy.submitButton("Administer Medicine");
+    cy.clickSubmitButton("Administer Medicine");
     cy.verifyNotification("Medicine(s) administered");
   });
 
@@ -145,7 +145,7 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.selectMedicine(medicineNameOne);
     patientPrescription.enterDosage(medicineBaseDosage);
     patientPrescription.selectDosageFrequency(medicineFrequency);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification("Medicine prescribed");
     cy.closeNotification();
     // verify the duplicate medicine error message
@@ -155,7 +155,7 @@ describe("Patient Medicine Administration", () => {
     patientPrescription.selectMedicine(medicineNameOne);
     patientPrescription.enterDosage(medicineBaseDosage);
     patientPrescription.selectDosageFrequency(medicineFrequency);
-    cy.submitButton("Submit");
+    cy.clickSubmitButton("Submit");
     cy.verifyNotification(
       "Medicine - This medicine is already prescribed to this patient. Please discontinue the existing prescription to prescribe again.",
     );
diff --git a/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts b/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
new file mode 100644
index 00000000000..a0f30ebd6db
--- /dev/null
+++ b/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
@@ -0,0 +1,88 @@
+import LoginPage from "pageobject/Login/LoginPage";
+import { PatientConsultationPage } from "pageobject/Patient/PatientConsultation";
+import { PatientPage } from "pageobject/Patient/PatientCreation";
+import { SampleTestPage } from "pageobject/Sample/SampleTestCreate";
+
+describe("Sample Test", () => {
+  const sampleTestPage = new SampleTestPage();
+  const patientPage = new PatientPage();
+  const loginPage = new LoginPage();
+  const patientConsultationPage = new PatientConsultationPage();
+  const patientName = "Dummy Patient 11";
+  const sampleTestType = "BA/ETA";
+  const icmrCategory = "Cat 0";
+  const icmrLabel = "Test Icmr Label";
+  const doctorName = "Dr John Doe";
+  const atypicalDetails = "Patient showing unusual symptoms";
+  const diagnosis = "Suspected respiratory infection";
+  const etiologyIdentified = "Bacterial infection suspected";
+  const differentialDiagnosis = "Possibly a viral infection";
+  const fastTrackReason =
+    "The patient has a high risk of complications and requires immediate testing.";
+  const sampleTestStatus = "Request Submitted";
+  const expectedSampleTestType = "ba/eta";
+  const sampleTestResult = "Awaiting";
+
+  before(() => {
+    loginPage.loginAsDistrictAdmin();
+    cy.saveLocalStorage();
+  });
+
+  beforeEach(() => {
+    cy.restoreLocalStorage();
+    cy.clearLocalStorage(/filters--.+/);
+  });
+
+  it("should request a new sample test", () => {
+    // Ensure patient list API is loaded before proceeding
+    cy.awaitUrl("/patients");
+    patientPage.visitPatient(patientName);
+    patientConsultationPage.interceptPatientDetailsAPI();
+    patientConsultationPage.clickPatientDetails();
+    patientConsultationPage.verifyPatientDetailsResponse();
+    // Visit SampleRequest Page
+    sampleTestPage.visitSampleRequestPage();
+    // Fill Sample Test Request Form
+    sampleTestPage.selectSampleType(sampleTestType);
+    sampleTestPage.selectIcmrCategory(icmrCategory);
+    sampleTestPage.fillIcmrLabel(icmrLabel);
+    sampleTestPage.fillFastTrackReason(fastTrackReason);
+    sampleTestPage.fillDoctorName(doctorName);
+    sampleTestPage.fillAtypicalPresentation(atypicalDetails);
+    sampleTestPage.fillDiagnosis(diagnosis);
+    sampleTestPage.fillEtiology(etiologyIdentified);
+    sampleTestPage.fillDiffDiagnosis(differentialDiagnosis);
+    sampleTestPage.checkHasSari();
+    sampleTestPage.checkHasAri();
+    sampleTestPage.checkIsUnusualCourse();
+    sampleTestPage.interceptSampleTestReq();
+    // Submit the form and verify notification
+    cy.clickSubmitButton("Confirm your request to send sample for testing");
+    sampleTestPage.verifySampleTestReq();
+    cy.verifyNotification("Sample test created successfully");
+    // Check the updated request history
+    sampleTestPage.checkRequestHistory(
+      sampleTestStatus,
+      expectedSampleTestType,
+      fastTrackReason,
+      sampleTestResult,
+    );
+    // Checking Reflection on Sample Page
+    cy.awaitUrl("/sample");
+    sampleTestPage.interceptGetSampleTestReq();
+    sampleTestPage.searchPatientSample(patientName);
+    sampleTestPage.verifyGetSampleTestReq();
+    sampleTestPage.verifyPatientName(patientName);
+    sampleTestPage.interceptGetSampleTestReq();
+    sampleTestPage.clickOnSampleDetailsBtn();
+    sampleTestPage.verifyGetSampleTestReq();
+    sampleTestPage.verifyPatientTestDetails(
+      patientName,
+      fastTrackReason,
+      doctorName,
+      diagnosis,
+      differentialDiagnosis,
+      etiologyIdentified,
+    );
+  });
+});
diff --git a/cypress/e2e/users_spec/UsersManage.cy.ts b/cypress/e2e/users_spec/UsersManage.cy.ts
index 22da938542d..40d436be0a6 100644
--- a/cypress/e2e/users_spec/UsersManage.cy.ts
+++ b/cypress/e2e/users_spec/UsersManage.cy.ts
@@ -60,6 +60,7 @@ describe("Manage User", () => {
     advanceFilters.clickAdvancedFiltersButton();
     userPage.typeInFirstName(firstNameUserSkill);
     userPage.typeInLastName(lastNameUserSkill);
+    userPage.selectHomeFacility(facilitytolinkskill);
     advanceFilters.applySelectedFilter();
     userPage.checkUsernameText(usernameToLinkSkill);
     manageUserPage.clicklinkedskillbutton();
diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts
index 6ce0cc6270e..908431e3a65 100644
--- a/cypress/pageobject/Facility/FacilityCreation.ts
+++ b/cypress/pageobject/Facility/FacilityCreation.ts
@@ -276,7 +276,7 @@ class FacilityPage {
   }
 
   confirmDeleteFacility() {
-    cy.submitButton("Delete");
+    cy.clickSubmitButton("Delete");
   }
 
   selectLocation(location: string) {
diff --git a/cypress/pageobject/Login/LoginPage.ts b/cypress/pageobject/Login/LoginPage.ts
index 07eb4486d17..714004023f7 100644
--- a/cypress/pageobject/Login/LoginPage.ts
+++ b/cypress/pageobject/Login/LoginPage.ts
@@ -20,13 +20,13 @@ class LoginPage {
     } else {
       cy.get("input[id='password']").type("Corona");
     }
-    cy.submitButton("Login");
+    cy.clickSubmitButton("Login");
   }
 
   loginManuallyAsNurse(): void {
     cy.get("input[id='username']").click().type("dummynurse1");
     cy.get("input[id='password']").click().type("Coronasafe@123");
-    cy.submitButton("Login");
+    cy.clickSubmitButton("Login");
   }
 
   login(username: string, password: string): void {
diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts
index 642eaf9e4d6..c8046a39a9e 100644
--- a/cypress/pageobject/Patient/PatientConsultation.ts
+++ b/cypress/pageobject/Patient/PatientConsultation.ts
@@ -113,6 +113,14 @@ export class PatientConsultationPage {
     cy.wait(3000);
   }
 
+  interceptPatientDetailsAPI(): void {
+    cy.intercept("GET", "**/api/v1/patient/**").as("patientDetails");
+  }
+
+  verifyPatientDetailsResponse(): void {
+    cy.wait("@patientDetails").its("response.statusCode").should("eq", 200);
+  }
+
   clickViewConsultationButton() {
     cy.verifyAndClickElement(
       "#view_consultation_and_log_updates",
diff --git a/cypress/pageobject/Patient/PatientCreation.ts b/cypress/pageobject/Patient/PatientCreation.ts
index 8f46dec5560..a38b8ab6a5c 100644
--- a/cypress/pageobject/Patient/PatientCreation.ts
+++ b/cypress/pageobject/Patient/PatientCreation.ts
@@ -23,7 +23,7 @@ export class PatientPage {
 
   selectFacility(facilityName: string) {
     cy.typeAndSelectOption("input[name='facilities']", facilityName);
-    cy.submitButton("Select");
+    cy.clickSubmitButton("Select");
   }
 
   interceptCreatePatientAPI() {
@@ -57,7 +57,7 @@ export class PatientPage {
 
   typePatientAge(age: string) {
     cy.clickAndSelectOption("#patientAge", "Age");
-    cy.submitButton("Confirm");
+    cy.clickSubmitButton("Confirm");
     cy.get("#age").clear().type(age);
   }
 
diff --git a/cypress/pageobject/Patient/PatientFileupload.ts b/cypress/pageobject/Patient/PatientFileupload.ts
index 0616a19729c..6cde7d78568 100644
--- a/cypress/pageobject/Patient/PatientFileupload.ts
+++ b/cypress/pageobject/Patient/PatientFileupload.ts
@@ -58,7 +58,7 @@ export class PatientFileUpload {
 
   clickSaveArchiveFile() {
     cy.intercept("PATCH", "**/api/v1/files/**").as("saveArchiveFile");
-    cy.submitButton("Proceed");
+    cy.clickSubmitButton("Proceed");
     cy.wait("@saveArchiveFile").its("response.statusCode").should("eq", 200);
   }
 
@@ -89,7 +89,7 @@ export class PatientFileUpload {
 
   clickSaveFileName() {
     cy.intercept("PATCH", "**/api/v1/files/**").as("saveFileName");
-    cy.submitButton("Proceed");
+    cy.clickSubmitButton("Proceed");
     cy.wait("@saveFileName").its("response.statusCode").should("eq", 200);
   }
 }
diff --git a/cypress/pageobject/Sample/SampleTestCreate.ts b/cypress/pageobject/Sample/SampleTestCreate.ts
new file mode 100644
index 00000000000..cd2e93e5072
--- /dev/null
+++ b/cypress/pageobject/Sample/SampleTestCreate.ts
@@ -0,0 +1,114 @@
+export class SampleTestPage {
+  visitSampleRequestPage(): void {
+    cy.verifyAndClickElement("#sample-request-btn", "Request Sample Test");
+    cy.url().should("include", "/sample-test");
+  }
+
+  selectSampleType(option: string): void {
+    cy.clickAndSelectOption("#sample-type", option);
+  }
+
+  selectIcmrCategory(option: string): void {
+    cy.clickAndSelectOption("#icmr-category", option);
+  }
+
+  fillIcmrLabel(label: string): void {
+    cy.get("#icmr-label").should("be.visible").type(label);
+  }
+
+  fillFastTrackReason(value: string): void {
+    cy.get("#is_fast_track").should("be.visible").check();
+    cy.get("#fast_track").should("be.visible").type(value);
+  }
+
+  fillDoctorName(value: string): void {
+    cy.get("#doctor_name").should("be.visible").type(value);
+  }
+
+  fillAtypicalPresentation(value: string): void {
+    cy.get("#is_atypical_presentation").should("be.visible").check();
+    cy.get("#atypical_presentation").should("be.visible").type(value);
+  }
+
+  fillDiagnosis(value: string): void {
+    cy.get("#diagnosis").should("be.visible").type(value);
+  }
+
+  fillEtiology(value: string): void {
+    cy.get("#etiology_identified").should("be.visible").type(value);
+  }
+
+  fillDiffDiagnosis(value: string): void {
+    cy.get("#diff_diagnosis").should("be.visible").type(value);
+  }
+
+  checkHasSari(): void {
+    cy.get("#has_sari").should("be.visible").check();
+  }
+
+  checkHasAri(): void {
+    cy.get("#has_ari").should("be.visible").check();
+  }
+
+  checkIsUnusualCourse(): void {
+    cy.get("#is_unusual_course").should("be.visible").check();
+  }
+
+  checkRequestHistory(
+    sampleTestStatus: string,
+    sampleTestType: string,
+    fastTrack: string,
+    sampleTestResult: string,
+  ): void {
+    cy.verifyContentPresence("#sample-test-status", [sampleTestStatus]);
+    cy.verifyContentPresence("#sample-test-type", [sampleTestType]);
+    cy.verifyContentPresence("#sample-test-fast-track", [fastTrack]);
+    cy.verifyContentPresence("#sample-test-result", [sampleTestResult]);
+  }
+
+  searchPatientSample(patientName: string): void {
+    cy.get("#search_patient_name").should("be.visible").type(patientName);
+  }
+
+  verifyPatientName(patientName: string): void {
+    cy.verifyContentPresence("#sample-test-patient-name", [patientName]);
+  }
+
+  clickOnSampleDetailsBtn(): void {
+    cy.get("#sample-details-btn").should("be.visible").first().click();
+  }
+
+  verifyPatientTestDetails(
+    patientName: string,
+    fastTrackReason: string,
+    doctorName: string,
+    diagnosis: string,
+    differentialDiagnosis: string,
+    etiologyIdentified: string,
+  ): void {
+    cy.verifyContentPresence("#patient_name", [patientName]);
+    cy.verifyContentPresence("#fast_track_reason", [fastTrackReason]);
+    cy.verifyContentPresence("#doctor_name", [doctorName]);
+    cy.verifyContentPresence("#diagnosis", [diagnosis]);
+    cy.verifyContentPresence("#diff_diagnosis", [differentialDiagnosis]);
+    cy.verifyContentPresence("#etiology_identified", [etiologyIdentified]);
+  }
+
+  interceptSampleTestReq(): void {
+    cy.intercept("POST", "**/api/v1/patient/*/test_sample/").as(
+      "sampleDetails",
+    );
+  }
+
+  verifySampleTestReq(): void {
+    cy.wait("@sampleDetails").its("response.statusCode").should("eq", 201);
+  }
+
+  interceptGetSampleTestReq(): void {
+    cy.intercept("GET", "**/api/v1/test_sample/**").as("getSampleTestReq");
+  }
+
+  verifyGetSampleTestReq(): void {
+    cy.wait("@getSampleTestReq").its("response.statusCode").should("eq", 200);
+  }
+}
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts
index 9af5f97e5d4..d97bb52732f 100644
--- a/cypress/support/commands.ts
+++ b/cypress/support/commands.ts
@@ -121,11 +121,16 @@ Cypress.Commands.add("clearAllFilters", () => {
   return cy.get("#clear-all-filters").click();
 });
 
-Cypress.Commands.add("submitButton", (buttonText = "Submit") => {
+Cypress.Commands.add("clickSubmitButton", (buttonText = "Submit") => {
   cy.get("button[type='submit']").contains(buttonText).scrollIntoView();
   cy.get("button[type='submit']").contains(buttonText).click();
 });
 
+Cypress.Commands.add("clickCancelButton", (buttonText = "Cancel") => {
+  cy.get("#cancel").contains(buttonText).scrollIntoView();
+  cy.get("#cancel").contains(buttonText).click();
+});
+
 Cypress.Commands.add(
   "typeAndSelectOption",
   (element: string, referance: string) => {
diff --git a/cypress/support/index.ts b/cypress/support/index.ts
index b2895871872..6429ef5710f 100644
--- a/cypress/support/index.ts
+++ b/cypress/support/index.ts
@@ -14,7 +14,8 @@ declare global {
       ): Chainable<Subject>;
       getAttached(selector: string): Chainable<Subject>;
       clearAllFilters(): Chainable<Subject>;
-      submitButton(buttonText?: string): Chainable<Element>;
+      clickSubmitButton(buttonText?: string): Chainable<Element>;
+      clickCancelButton(buttonText?: string): Chainable<Element>;
       typeAndSelectOption(
         element: string,
         referance: string,
diff --git a/src/components/Patient/PatientHome.tsx b/src/components/Patient/PatientHome.tsx
index 9d3ab238e5b..a7b08bdea58 100644
--- a/src/components/Patient/PatientHome.tsx
+++ b/src/components/Patient/PatientHome.tsx
@@ -1295,6 +1295,7 @@ export const PatientHome = (props: any) => {
                       )
                     }
                     authorizeFor={NonReadOnlyUsers}
+                    id="sample-request-btn"
                   >
                     <span className="flex w-full items-center justify-start gap-2">
                       <CareIcon icon="l-medkit" className="text-xl" />
diff --git a/src/components/Patient/SampleDetails.tsx b/src/components/Patient/SampleDetails.tsx
index c16ef1c0e86..c5282a65c1f 100644
--- a/src/components/Patient/SampleDetails.tsx
+++ b/src/components/Patient/SampleDetails.tsx
@@ -331,7 +331,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
             <span className="font-semibold leading-relaxed">
               {t("patient")}:{" "}
             </span>
-            {sampleDetails?.patient_name}
+            <span id="patient_name">{sampleDetails?.patient_name}</span>
           </div>
           {sampleDetails?.facility_object && (
             <div>
@@ -362,7 +362,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
               <span className="font-semibold leading-relaxed">
                 {t("fast_track_testing_reason")}:{" "}
               </span>
-              {sampleDetails.fast_track}
+              <span id="fast_track_reason">{sampleDetails.fast_track}</span>
             </div>
           )}
           {sampleDetails?.doctor_name && (
@@ -370,7 +370,9 @@ export const SampleDetails = ({ id }: DetailRoute) => {
               <span className="font-semibold leading-relaxed">
                 {t("doctors_name")}:{" "}
               </span>
-              {startCase(camelCase(sampleDetails.doctor_name))}
+              <span id="doctor_name">
+                {startCase(camelCase(sampleDetails.doctor_name))}
+              </span>
             </div>
           )}
           {sampleDetails?.diagnosis && (
@@ -378,7 +380,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
               <span className="font-semibold leading-relaxed">
                 {t("diagnosis")}:{" "}
               </span>
-              {sampleDetails.diagnosis}
+              <span id="diagnosis">{sampleDetails.diagnosis}</span>
             </div>
           )}
           {sampleDetails?.diff_diagnosis && (
@@ -386,7 +388,7 @@ export const SampleDetails = ({ id }: DetailRoute) => {
               <span className="font-semibold leading-relaxed">
                 {t("differential_diagnosis")}:{" "}
               </span>
-              {sampleDetails?.diff_diagnosis}
+              <span id="diff_diagnosis">{sampleDetails?.diff_diagnosis}</span>
             </div>
           )}
           {sampleDetails?.etiology_identified && (
@@ -394,7 +396,9 @@ export const SampleDetails = ({ id }: DetailRoute) => {
               <span className="font-semibold leading-relaxed">
                 {t("etiology_identified")}:{" "}
               </span>
-              {sampleDetails.etiology_identified}
+              <span id="etiology_identified">
+                {sampleDetails.etiology_identified}
+              </span>
             </div>
           )}
           <div>
diff --git a/src/components/Patient/SampleTest.tsx b/src/components/Patient/SampleTest.tsx
index 0714de28492..0933d03761e 100644
--- a/src/components/Patient/SampleTest.tsx
+++ b/src/components/Patient/SampleTest.tsx
@@ -216,6 +216,7 @@ export const SampleTest = ({ facilityId, patientId }: any) => {
           options={SAMPLE_TYPE_CHOICES}
           optionLabel={(option) => option.text}
           optionValue={(option) => option.id}
+          id="sample-type"
         />
 
         {state.form.sample_type === "9" && (
@@ -230,6 +231,7 @@ export const SampleTest = ({ facilityId, patientId }: any) => {
           options={ICMR_CATEGORY}
           optionLabel={(option) => option}
           optionValue={(option) => option}
+          id="icmr-category"
         />
         <div className="mb-6 flex flex-col gap-1">
           <p className="font-medium">
@@ -255,7 +257,11 @@ export const SampleTest = ({ facilityId, patientId }: any) => {
           </span>
         </div>
 
-        <TextFormField {...field("icmr_label", "ICMR Label")} required />
+        <TextFormField
+          {...field("icmr_label", "ICMR Label")}
+          required
+          id="icmr-label"
+        />
         <div className="mb-6 w-full flex-none">
           <FieldLabel>Testing Facility</FieldLabel>
           <FacilitySelect
@@ -274,22 +280,29 @@ export const SampleTest = ({ facilityId, patientId }: any) => {
           />
         </div>
         <CheckBoxFormField
+          id="is_fast_track"
           {...field("isFastTrack", "Is fast-track testing required?")}
         />
         {state.form.isFastTrack && (
           <TextAreaFormField
+            id="fast_track"
             {...field("fast_track", "Reasons for fast-track testing")}
             required
           />
         )}
 
-        <TextFormField {...field("doctor_name", "Doctor's Name")} />
+        <TextFormField
+          id="doctor_name"
+          {...field("doctor_name", "Doctor's Name")}
+        />
         <CheckBoxFormField
+          id="is_atypical_presentation"
           {...field("is_atypical_presentation", "Is atypical presentation?")}
         />
         {state.form.is_atypical_presentation && (
           <div>
             <TextAreaFormField
+              id="atypical_presentation"
               {...field(
                 "atypical_presentation",
                 "Atypical presentation details",
@@ -298,26 +311,38 @@ export const SampleTest = ({ facilityId, patientId }: any) => {
             />
           </div>
         )}
-        <TextAreaFormField {...field("diagnosis", "Diagnosis")} />
         <TextAreaFormField
+          id="diagnosis"
+          {...field("diagnosis", "Diagnosis")}
+        />
+        <TextAreaFormField
+          id="etiology_identified"
           {...field("etiology_identified", "Etiology identified")}
         />
         <TextAreaFormField
+          id="diff_diagnosis"
           {...field("diff_diagnosis", "Differential diagnosis")}
         />
 
         <CheckBoxFormField
+          id="has_sari"
           {...field("has_sari", "Has SARI (Severe Acute Respiratory illness)?")}
         />
         <CheckBoxFormField
+          id="has_ari"
           {...field("has_ari", "Has ARI (Acute Respiratory illness)?")}
         />
         <CheckBoxFormField
+          id="is_unusual_course"
           {...field("is_unusual_course", "Is unusual course?")}
         />
         <div className="mt-4 flex flex-col justify-end gap-2 lg:flex-row">
           <Cancel onClick={() => goBack()} />
-          <Submit onClick={handleSubmit} label={buttonText} />
+          <Submit
+            onClick={handleSubmit}
+            label={buttonText}
+            id="sample-test-submit-btn"
+          />
         </div>
       </form>
     </Page>
diff --git a/src/components/Patient/SampleTestCard.tsx b/src/components/Patient/SampleTestCard.tsx
index fef2c9e4d08..a0303705eb7 100644
--- a/src/components/Patient/SampleTestCard.tsx
+++ b/src/components/Patient/SampleTestCard.tsx
@@ -79,6 +79,7 @@ export const SampleTestCard = (props: SampleDetailsProps) => {
 
   return (
     <div
+      id="sample-test-history"
       className={`${
         itemData.result === "POSITIVE"
           ? "border-red-500 bg-red-100 hover:border-red-700"
@@ -100,7 +101,10 @@ export const SampleTestCard = (props: SampleDetailsProps) => {
             <div className="text-sm font-semibold leading-5 text-zinc-400">
               Status{" "}
             </div>
-            <div className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium leading-5">
+            <div
+              id="sample-test-status"
+              className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium leading-5"
+            >
               {startCase(camelCase(itemData.status))}
             </div>
           </div>
@@ -110,7 +114,10 @@ export const SampleTestCard = (props: SampleDetailsProps) => {
             <div className="text-sm font-semibold leading-5 text-zinc-400">
               Sample Type{" "}
             </div>
-            <div className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium capitalize leading-5">
+            <div
+              id="sample-test-type"
+              className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium capitalize leading-5"
+            >
               {itemData.sample_type?.toLowerCase()}
             </div>
           </div>
@@ -121,7 +128,10 @@ export const SampleTestCard = (props: SampleDetailsProps) => {
               <div className="text-sm font-semibold leading-5 text-zinc-400">
                 Fast-Track{" "}
               </div>
-              <div className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium leading-5">
+              <div
+                id="sample-test-fast-track"
+                className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium leading-5"
+              >
                 {itemData.fast_track}
               </div>
             </div>
@@ -132,7 +142,10 @@ export const SampleTestCard = (props: SampleDetailsProps) => {
             <div className="text-sm font-semibold leading-5 text-zinc-400">
               Result{" "}
             </div>
-            <div className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium leading-5">
+            <div
+              id="sample-test-result"
+              className="mt-1 overflow-x-scroll whitespace-normal break-words text-sm font-medium leading-5"
+            >
               {startCase(camelCase(itemData.result))}
             </div>
           </div>
diff --git a/src/components/Patient/SampleViewAdmin.tsx b/src/components/Patient/SampleViewAdmin.tsx
index 43d03ad1d12..37d66bfb815 100644
--- a/src/components/Patient/SampleViewAdmin.tsx
+++ b/src/components/Patient/SampleViewAdmin.tsx
@@ -155,7 +155,10 @@ export default function SampleViewAdmin() {
             <div className="flex h-full flex-col justify-between px-6 py-4">
               <div>
                 <div className="flex flex-col md:flex-row md:justify-between">
-                  <div className="mb-2 text-xl font-bold capitalize">
+                  <div
+                    id="sample-test-patient-name"
+                    className="mb-2 text-xl font-bold capitalize"
+                  >
                     {item.patient_name}
                   </div>
                   <div>
@@ -274,6 +277,7 @@ export default function SampleViewAdmin() {
                 )}
 
                 <button
+                  id="sample-details-btn"
                   onClick={() => navigate(`/sample/${item.id}`)}
                   className="mt-2 w-full rounded border border-secondary-400 bg-white px-4 py-2 text-center text-sm font-semibold text-secondary-800 shadow hover:bg-secondary-400"
                 >
@@ -350,6 +354,7 @@ export default function SampleViewAdmin() {
           <div className="flex w-full flex-col gap-3">
             <SearchInput
               name="patient_name"
+              id="search_patient_name"
               value={qParams.patient_name}
               onChange={(e) => updateQuery({ [e.name]: e.value })}
               placeholder="Search patient"

From 5eb31eb5e28d286751f5ec2e8bd71342388480ee Mon Sep 17 00:00:00 2001
From: Alok <ihalok24@gmail.com>
Date: Tue, 19 Nov 2024 12:26:24 +0530
Subject: [PATCH 11/24] Tests to verify error handling and access restrictions
 during Facility Creation (#9119)

---
 .../e2e/facility_spec/FacilityCreation.cy.ts  | 33 +++++++++++++++++++
 .../pageobject/Facility/FacilityCreation.ts   |  4 +++
 2 files changed, 37 insertions(+)

diff --git a/cypress/e2e/facility_spec/FacilityCreation.cy.ts b/cypress/e2e/facility_spec/FacilityCreation.cy.ts
index 5e644238999..5fd988480fc 100644
--- a/cypress/e2e/facility_spec/FacilityCreation.cy.ts
+++ b/cypress/e2e/facility_spec/FacilityCreation.cy.ts
@@ -317,6 +317,39 @@ describe("Facility Creation", () => {
     );
   });
 
+  it("Should display error when district admin tries to create facility in a different district", () => {
+    facilityPage.visitCreateFacilityPage();
+    facilityPage.fillFacilityName(facilityName);
+    facilityPage.selectFacilityType(facilityType);
+    facilityPage.fillPincode("682001");
+    facilityPage.selectStateOnPincode("Kerala");
+    facilityPage.selectDistrictOnPincode("Kottayam");
+    facilityPage.selectLocalBody("Arpookara");
+    facilityPage.selectWard("5");
+    facilityPage.fillAddress(facilityAddress);
+    facilityPage.fillPhoneNumber(facilityNumber);
+    facilityPage.submitForm();
+    facilityPage.verifyErrorNotification(
+      "You do not have permission to perform this action.",
+    );
+  });
+
+  it("Access Restriction for Non-Admin Users to facility creation page", () => {
+    const nonAdminLoginMethods = [
+      loginPage.loginAsDevDoctor.bind(loginPage),
+      loginPage.loginAsStaff.bind(loginPage),
+    ];
+
+    nonAdminLoginMethods.forEach((loginMethod) => {
+      loginMethod();
+      cy.visit("/facility/create");
+      facilityPage.verifyErrorNotification(
+        "You don't have permission to perform this action. Contact the admin",
+      );
+      cy.clearCookies();
+    });
+  });
+
   afterEach(() => {
     cy.saveLocalStorage();
   });
diff --git a/cypress/pageobject/Facility/FacilityCreation.ts b/cypress/pageobject/Facility/FacilityCreation.ts
index 908431e3a65..0fddc3f9799 100644
--- a/cypress/pageobject/Facility/FacilityCreation.ts
+++ b/cypress/pageobject/Facility/FacilityCreation.ts
@@ -302,6 +302,10 @@ class FacilityPage {
     cy.verifyNotification(message);
   }
 
+  verifyErrorNotification(message: string) {
+    cy.verifyNotification(message);
+  }
+
   visitAlreadyCreatedFacility() {
     cy.intercept("GET", "**/api/v1/facility/**").as("getFacilities");
     cy.get("[id='facility-details']").first().click();

From e0264d06edf473638b60f6f102a21896ec0bad4b Mon Sep 17 00:00:00 2001
From: Kamishetty Rishith <119791436+Rishith25@users.noreply.github.com>
Date: Tue, 19 Nov 2024 12:26:52 +0530
Subject: [PATCH 12/24] Login page input fields UI update (#9125)

---
 src/CAREUI/interactive/LegendInput.tsx | 2 +-
 src/components/Auth/Login.tsx          | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/CAREUI/interactive/LegendInput.tsx b/src/CAREUI/interactive/LegendInput.tsx
index cb415d76ab1..064eb2ceb0f 100644
--- a/src/CAREUI/interactive/LegendInput.tsx
+++ b/src/CAREUI/interactive/LegendInput.tsx
@@ -130,7 +130,7 @@ export default function LegendInput(props: InputProps) {
           required={props.required}
           autoComplete={props.autoComplete}
           className={classNames(
-            "cui-input w-full rounded-md border-secondary-300 bg-secondary-50 shadow-sm focus:border-2 focus:border-primary-500 focus:bg-secondary-100 focus:outline-none focus:ring-0",
+            "cui-input w-full rounded-md border-2 border-secondary-300 border-transparent bg-secondary-50 shadow-sm focus:border-2 focus:border-primary-500 focus:bg-secondary-100 focus:outline-none focus:ring-0",
             props.size === "small" && "px-3 py-2 text-xs",
             (!props.size || !["small", "large"].includes(props.size)) &&
               "px-4 py-3",
diff --git a/src/components/Auth/Login.tsx b/src/components/Auth/Login.tsx
index aab5f8df179..4255161194a 100644
--- a/src/components/Auth/Login.tsx
+++ b/src/components/Auth/Login.tsx
@@ -350,7 +350,7 @@ const Login = (props: { forgot?: boolean }) => {
                         <button
                           id="login-button"
                           type="submit"
-                          className="inline-flex w-full cursor-pointer items-center justify-center rounded bg-primary-500 px-4 py-2 text-sm font-semibold text-white"
+                          className="inline-flex w-full cursor-pointer items-center justify-center rounded bg-primary-500 px-4 py-2 text-sm font-semibold text-white hover:bg-primary-600"
                         >
                           {t("login")}
                         </button>

From 570ed1ea258c8f121e7b30b88109aa6a246a0067 Mon Sep 17 00:00:00 2001
From: Aditya Jindal <adityajindal2305@gmail.com>
Date: Tue, 19 Nov 2024 12:27:18 +0530
Subject: [PATCH 13/24] Fix: Bed capacity pop up errors (#9123)

---
 src/components/Facility/BedCapacity.tsx | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/components/Facility/BedCapacity.tsx b/src/components/Facility/BedCapacity.tsx
index 0bb405670fd..156dc6adce6 100644
--- a/src/components/Facility/BedCapacity.tsx
+++ b/src/components/Facility/BedCapacity.tsx
@@ -77,6 +77,8 @@ export const BedCapacity = (props: BedCapacityProps) => {
         const existingData = capacityQuery.data?.results;
         // if all options are diabled
         if (existingData.length === BED_TYPES.length) {
+          setBedTypes([]);
+          setIsLoading(false);
           return;
         }
         // disable existing bed types
@@ -277,18 +279,20 @@ export const BedCapacity = (props: BedCapacityProps) => {
 
           <div className="cui-form-button-group mt-4">
             <Cancel onClick={handleClose} />
-            {!isLastOptionType && headerText === "Add Bed Capacity" && (
+            {headerText === "Add Bed Capacity" && (
               <Submit
                 id="bed-capacity-save-and-exit"
                 onClick={(e) => handleSubmit(e, "Save and Exit")}
                 label="Save Bed Capacity"
               />
             )}
-            <Submit
-              id="bed-capacity-save"
-              onClick={(e) => handleSubmit(e)}
-              label={buttonText}
-            />
+            {!isLastOptionType && (
+              <Submit
+                id="bed-capacity-save"
+                onClick={(e) => handleSubmit(e)}
+                label={buttonText}
+              />
+            )}
           </div>
         </div>
       )}

From 46105634b64da62c8247a5c455fafb2761f3ee2f Mon Sep 17 00:00:00 2001
From: Alok <ihalok24@gmail.com>
Date: Tue, 19 Nov 2024 15:55:28 +0530
Subject: [PATCH 14/24] Enhanced care config to validate env during build
 process (#9032)

---
 package-lock.json              | 447 ++++++++++++++++++++++++++++++++-
 package.json                   |   4 +-
 src/Integrations/Plausible.tsx |  10 +
 src/Integrations/Sentry.tsx    |   5 +-
 vite.config.mts                |  33 ++-
 5 files changed, 490 insertions(+), 9 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index f5edb998e4e..5c703af8fe1 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -60,6 +60,7 @@
         "xlsx": "^0.18.5"
       },
       "devDependencies": {
+        "@julr/vite-plugin-validate-env": "^1.1.1",
         "@tailwindcss/container-queries": "^0.1.1",
         "@tailwindcss/forms": "^0.5.9",
         "@tailwindcss/typography": "^0.5.15",
@@ -106,7 +107,8 @@
         "vite": "^5.4.10",
         "vite-plugin-checker": "^0.8.0",
         "vite-plugin-pwa": "^0.20.5",
-        "vite-plugin-static-copy": "^2.0.0"
+        "vite-plugin-static-copy": "^2.0.0",
+        "zod": "^3.23.8"
       },
       "engines": {
         "node": ">=22.11.0"
@@ -196,6 +198,16 @@
         "node": ">=6.0.0"
       }
     },
+    "node_modules/@antfu/utils": {
+      "version": "0.7.10",
+      "resolved": "https://registry.npmjs.org/@antfu/utils/-/utils-0.7.10.tgz",
+      "integrity": "sha512-+562v9k4aI80m1+VuMHehNJWLOFjBnXn3tdOitzD0il5b7smkSBal4+a3oKiQTbrwMmN/TBUMDvbdoWDehgOww==",
+      "dev": true,
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      }
+    },
     "node_modules/@babel/code-frame": {
       "version": "7.25.7",
       "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.25.7.tgz",
@@ -2836,6 +2848,33 @@
         "@jridgewell/sourcemap-codec": "^1.4.14"
       }
     },
+    "node_modules/@julr/vite-plugin-validate-env": {
+      "version": "1.1.1",
+      "resolved": "https://registry.npmjs.org/@julr/vite-plugin-validate-env/-/vite-plugin-validate-env-1.1.1.tgz",
+      "integrity": "sha512-MiAvuLrolS6xkzG/B4ofOCFUzmOEnC32pvD5fn9g6b3SK4nVruGZp5PU/WG+F+hw9fhsw0ES13L7GVzAeDJaYA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@poppinss/cliui": "^6.3.0",
+        "@poppinss/validator-lite": "^1.0.3",
+        "unconfig": "^0.3.11"
+      },
+      "engines": {
+        "node": ">=16"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/Julien-R44"
+      },
+      "peerDependencies": {
+        "vite": "^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0",
+        "zod": "^3.0.0"
+      },
+      "peerDependenciesMeta": {
+        "zod": {
+          "optional": true
+        }
+      }
+    },
     "node_modules/@mapbox/node-pre-gyp": {
       "version": "1.0.11",
       "resolved": "https://registry.npmjs.org/@mapbox/node-pre-gyp/-/node-pre-gyp-1.0.11.tgz",
@@ -3266,6 +3305,327 @@
         "@pnotify/core": "^5.2.0"
       }
     },
+    "node_modules/@poppinss/cliui": {
+      "version": "6.4.1",
+      "resolved": "https://registry.npmjs.org/@poppinss/cliui/-/cliui-6.4.1.tgz",
+      "integrity": "sha512-tdV3QpAfrPFRLPOh98F8QxWBvwYF3ziWGGtpVqfZtFNTFkC7nQnVQlUW55UtQ7rkeMmFohxfDI+2JNWScGJ1jQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@poppinss/colors": "^4.1.3",
+        "cli-boxes": "^3.0.0",
+        "cli-table3": "^0.6.4",
+        "cli-truncate": "^4.0.0",
+        "log-update": "^6.0.0",
+        "pretty-hrtime": "^1.0.3",
+        "string-width": "^7.1.0",
+        "supports-color": "^9.4.0",
+        "terminal-size": "^4.0.0",
+        "wordwrap": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=18.16.0"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/ansi-escapes": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-7.0.0.tgz",
+      "integrity": "sha512-GdYO7a61mR0fOlAsvC9/rIHf7L96sBc6dEWzeOu+KAea5bZyQRPIpojrVoI4AXGJS/ycu/fBTdLrUkA4ODrvjw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "environment": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/ansi-regex": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz",
+      "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/ansi-regex?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/ansi-styles": {
+      "version": "6.2.1",
+      "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz",
+      "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/ansi-styles?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/cli-cursor": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-5.0.0.tgz",
+      "integrity": "sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "restore-cursor": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/cli-truncate": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz",
+      "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "slice-ansi": "^5.0.0",
+        "string-width": "^7.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/emoji-regex": {
+      "version": "10.4.0",
+      "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz",
+      "integrity": "sha512-EC+0oUMY1Rqm4O6LLrgjtYDvcVYTy7chDnM4Q7030tP4Kwj3u/pR6gP9ygnp2CJMK5Gq+9Q2oqmrFJAz01DXjw==",
+      "dev": true,
+      "license": "MIT"
+    },
+    "node_modules/@poppinss/cliui/node_modules/is-fullwidth-code-point": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz",
+      "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/log-update": {
+      "version": "6.1.0",
+      "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz",
+      "integrity": "sha512-9ie8ItPR6tjY5uYJh8K/Zrv/RMZ5VOlOWvtZdEHYSTFKZfIBPQa9tOAEeAWhd+AnIneLJ22w5fjOYtoutpWq5w==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-escapes": "^7.0.0",
+        "cli-cursor": "^5.0.0",
+        "slice-ansi": "^7.1.0",
+        "strip-ansi": "^7.1.0",
+        "wrap-ansi": "^9.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/log-update/node_modules/is-fullwidth-code-point": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz",
+      "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "get-east-asian-width": "^1.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/log-update/node_modules/slice-ansi": {
+      "version": "7.1.0",
+      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz",
+      "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^6.2.1",
+        "is-fullwidth-code-point": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/slice-ansi?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/onetime": {
+      "version": "7.0.0",
+      "resolved": "https://registry.npmjs.org/onetime/-/onetime-7.0.0.tgz",
+      "integrity": "sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "mimic-function": "^5.0.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/restore-cursor": {
+      "version": "5.1.0",
+      "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-5.1.0.tgz",
+      "integrity": "sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "onetime": "^7.0.0",
+        "signal-exit": "^4.1.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/signal-exit": {
+      "version": "4.1.0",
+      "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz",
+      "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==",
+      "dev": true,
+      "license": "ISC",
+      "engines": {
+        "node": ">=14"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/isaacs"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/slice-ansi": {
+      "version": "5.0.0",
+      "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz",
+      "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^6.0.0",
+        "is-fullwidth-code-point": "^4.0.0"
+      },
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/slice-ansi?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/string-width": {
+      "version": "7.2.0",
+      "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.2.0.tgz",
+      "integrity": "sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "emoji-regex": "^10.3.0",
+        "get-east-asian-width": "^1.0.0",
+        "strip-ansi": "^7.1.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/strip-ansi": {
+      "version": "7.1.0",
+      "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz",
+      "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-regex": "^6.0.1"
+      },
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/strip-ansi?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/supports-color": {
+      "version": "9.4.0",
+      "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.4.0.tgz",
+      "integrity": "sha512-VL+lNrEoIXww1coLPOmiEmK/0sGigko5COxI09KzHc2VJXJsQ37UaQ+8quuxjDeA7+KnLGTWRyOXSLLR2Wb4jw==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=12"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/supports-color?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/cliui/node_modules/wrap-ansi": {
+      "version": "9.0.0",
+      "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz",
+      "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "ansi-styles": "^6.2.1",
+        "string-width": "^7.0.0",
+        "strip-ansi": "^7.1.0"
+      },
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/chalk/wrap-ansi?sponsor=1"
+      }
+    },
+    "node_modules/@poppinss/colors": {
+      "version": "4.1.3",
+      "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.3.tgz",
+      "integrity": "sha512-A0FjJ6x14donWDN3bHAFFjJaPWTwM2PgWT834+bPKVK6Xukf25CscoRqCPYI939a8yuJFX9PYWWnVbUVI0E2Cg==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "kleur": "^4.1.5"
+      },
+      "engines": {
+        "node": ">=18.16.0"
+      }
+    },
+    "node_modules/@poppinss/validator-lite": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/@poppinss/validator-lite/-/validator-lite-1.0.3.tgz",
+      "integrity": "sha512-u4dmT7PDHwNtxY3q1jHVp/u+hMEEcBlkzd37QwwM4tVt/0mLlEDttSfPQ+TT7sqPG4VEtWKwVSlMInwPUYyJpA==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "validator": "^13.9.0"
+      }
+    },
     "node_modules/@radix-ui/primitive": {
       "version": "1.1.0",
       "resolved": "https://registry.npmjs.org/@radix-ui/primitive/-/primitive-1.1.0.tgz",
@@ -6957,6 +7317,19 @@
         "node": ">=6"
       }
     },
+    "node_modules/cli-boxes": {
+      "version": "3.0.0",
+      "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-3.0.0.tgz",
+      "integrity": "sha512-/lzGpEWL/8PfI0BmBOPRwp0c/wFNX1RdUML3jK/RcSBA9T8mZDdQpqYBKtCFTOfQbwPqWEOpjqW+Fnayc0969g==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=10"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/cli-cursor": {
       "version": "3.1.0",
       "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
@@ -7686,6 +8059,13 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/defu": {
+      "version": "6.1.4",
+      "resolved": "https://registry.npmjs.org/defu/-/defu-6.1.4.tgz",
+      "integrity": "sha512-mEQCMmwJu317oSz8CwdIOdwf3xMif1ttiM8LTufzc3g6kR+9Pe236twL8j3IYT1F7GfRgGcW6MWxzZjLIkuHIg==",
+      "dev": true,
+      "license": "MIT"
+    },
     "node_modules/delayed-stream": {
       "version": "1.0.0",
       "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
@@ -15041,6 +15421,16 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/pretty-hrtime": {
+      "version": "1.0.3",
+      "resolved": "https://registry.npmjs.org/pretty-hrtime/-/pretty-hrtime-1.0.3.tgz",
+      "integrity": "sha512-66hKPCr+72mlfiSjlEB1+45IjXSqvVAIy6mocupoww4tBFE9R9IhwwUGoI4G++Tc9Aq+2rxOt0RFU6gPcrte0A==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.8"
+      }
+    },
     "node_modules/proc-log": {
       "version": "4.2.0",
       "resolved": "https://registry.npmjs.org/proc-log/-/proc-log-4.2.0.tgz",
@@ -17411,6 +17801,19 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/terminal-size": {
+      "version": "4.0.0",
+      "resolved": "https://registry.npmjs.org/terminal-size/-/terminal-size-4.0.0.tgz",
+      "integrity": "sha512-rcdty1xZ2/BkWa4ANjWRp4JGpda2quksXIHgn5TMjNBPZfwzJIgR68DKfSYiTL+CZWowDX/sbOo5ME/FRURvYQ==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">=18"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/sindresorhus"
+      }
+    },
     "node_modules/terser": {
       "version": "5.36.0",
       "resolved": "https://registry.npmjs.org/terser/-/terser-5.36.0.tgz",
@@ -17907,6 +18310,21 @@
         "url": "https://github.com/sponsors/ljharb"
       }
     },
+    "node_modules/unconfig": {
+      "version": "0.3.13",
+      "resolved": "https://registry.npmjs.org/unconfig/-/unconfig-0.3.13.tgz",
+      "integrity": "sha512-N9Ph5NC4+sqtcOjPfHrRcHekBCadCXWTBzp2VYYbySOHW0PfD9XLCeXshTXjkPYwLrBr9AtSeU0CZmkYECJhng==",
+      "dev": true,
+      "license": "MIT",
+      "dependencies": {
+        "@antfu/utils": "^0.7.7",
+        "defu": "^6.1.4",
+        "jiti": "^1.21.0"
+      },
+      "funding": {
+        "url": "https://github.com/sponsors/antfu"
+      }
+    },
     "node_modules/undici": {
       "version": "5.28.4",
       "resolved": "https://registry.npmjs.org/undici/-/undici-5.28.4.tgz",
@@ -18462,6 +18880,16 @@
         "node": "^14.17.0 || ^16.13.0 || >=18.0.0"
       }
     },
+    "node_modules/validator": {
+      "version": "13.12.0",
+      "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz",
+      "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==",
+      "dev": true,
+      "license": "MIT",
+      "engines": {
+        "node": ">= 0.10"
+      }
+    },
     "node_modules/verror": {
       "version": "1.10.0",
       "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz",
@@ -19742,6 +20170,13 @@
         "node": ">=0.10.0"
       }
     },
+    "node_modules/wordwrap": {
+      "version": "1.0.0",
+      "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+      "integrity": "sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==",
+      "dev": true,
+      "license": "MIT"
+    },
     "node_modules/workbox-background-sync": {
       "version": "7.1.0",
       "resolved": "https://registry.npmjs.org/workbox-background-sync/-/workbox-background-sync-7.1.0.tgz",
@@ -20381,6 +20816,16 @@
         "url": "https://github.com/sponsors/sindresorhus"
       }
     },
+    "node_modules/zod": {
+      "version": "3.23.8",
+      "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz",
+      "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==",
+      "dev": true,
+      "license": "MIT",
+      "funding": {
+        "url": "https://github.com/sponsors/colinhacks"
+      }
+    },
     "node_modules/zrender": {
       "version": "5.6.0",
       "resolved": "https://registry.npmjs.org/zrender/-/zrender-5.6.0.tgz",
diff --git a/package.json b/package.json
index 60250c2209e..020d73f5e65 100644
--- a/package.json
+++ b/package.json
@@ -99,6 +99,7 @@
     "xlsx": "^0.18.5"
   },
   "devDependencies": {
+    "@julr/vite-plugin-validate-env": "^1.1.1",
     "@tailwindcss/container-queries": "^0.1.1",
     "@tailwindcss/forms": "^0.5.9",
     "@tailwindcss/typography": "^0.5.15",
@@ -145,7 +146,8 @@
     "vite": "^5.4.10",
     "vite-plugin-checker": "^0.8.0",
     "vite-plugin-pwa": "^0.20.5",
-    "vite-plugin-static-copy": "^2.0.0"
+    "vite-plugin-static-copy": "^2.0.0",
+    "zod": "^3.23.8"
   },
   "browserslist": {
     "production": [
diff --git a/src/Integrations/Plausible.tsx b/src/Integrations/Plausible.tsx
index dfbb2942e5d..89d0572e9e4 100644
--- a/src/Integrations/Plausible.tsx
+++ b/src/Integrations/Plausible.tsx
@@ -10,6 +10,16 @@ export default function Plausible() {
   });
 
   useEffect(() => {
+    const missingConfig = [];
+    if (!careConfig.plausible.domain) missingConfig.push("domain");
+    if (!careConfig.plausible.server) missingConfig.push("server");
+    if (missingConfig.length > 0) {
+      console.error(
+        `Plausible analytics disabled. Missing configuration: ${missingConfig.join(", ")}`,
+      );
+      return;
+    }
+
     plausible("pageview");
   }, []);
 
diff --git a/src/Integrations/Sentry.tsx b/src/Integrations/Sentry.tsx
index 90a8e78f3a9..1fa3d7e6da1 100644
--- a/src/Integrations/Sentry.tsx
+++ b/src/Integrations/Sentry.tsx
@@ -7,7 +7,10 @@ interface Props {
 
 export default function Sentry({ disabled }: Props) {
   useEffect(() => {
-    if (disabled || !careConfig.sentry.dsn) {
+    if (disabled || !careConfig.sentry.dsn || !careConfig.sentry.environment) {
+      console.error(
+        "Sentry is not configured correctly. Please check your environment variables.",
+      );
       return;
     }
 
diff --git a/vite.config.mts b/vite.config.mts
index 3f6df95c290..ca92aa50954 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -1,14 +1,17 @@
+import { ValidateEnv } from "@julr/vite-plugin-validate-env";
+import react from "@vitejs/plugin-react-swc";
+import DOMPurify from "dompurify";
 import fs from "fs";
+import { JSDOM } from "jsdom";
+import { marked } from "marked";
+import { createRequire } from "node:module";
 import path from "path";
 import { defineConfig, loadEnv } from "vite";
-import { createRequire } from "node:module";
-import { VitePWA } from "vite-plugin-pwa";
-import react from "@vitejs/plugin-react-swc";
 import checker from "vite-plugin-checker";
+import { VitePWA } from "vite-plugin-pwa";
 import { viteStaticCopy } from "vite-plugin-static-copy";
-import DOMPurify from "dompurify";
-import { JSDOM } from "jsdom";
-import { marked } from "marked";
+import { z } from "zod";
+
 import { treeShakeCareIcons } from "./plugins/treeShakeCareIcons";
 
 const pdfWorkerPath = path.join(
@@ -100,6 +103,24 @@ export default defineConfig(({ mode }) => {
       ),
     },
     plugins: [
+      ValidateEnv({
+        validator: "zod",
+        schema: {
+          REACT_CARE_API_URL: z.string().url(),
+
+          REACT_SENTRY_DSN: z.string().url().optional(),
+          REACT_SENTRY_ENVIRONMENT: z.string().optional(),
+
+          REACT_PLAUSIBLE_SITE_DOMAIN: z.string().url().optional(),
+          REACT_PLAUSIBLE_SERVER_URL: z.string().url().optional(),
+          REACT_CDN_URLS: z
+            .string()
+            .optional()
+            .transform((val) => val?.split(" "))
+            .pipe(z.array(z.string().url()).optional())
+            .describe("Optional: Space-separated list of CDN URLs"),
+        },
+      }),
       viteStaticCopy({
         targets: [
           {

From b0305a496721fe7a48da9386b068af7dcacb9b14 Mon Sep 17 00:00:00 2001
From: Noufal Rahim <120470585+noufalrahim@users.noreply.github.com>
Date: Tue, 19 Nov 2024 15:56:56 +0530
Subject: [PATCH 15/24] Added SpO2 field in community log update for nurses
 (#8907)

---
 public/locale/en.json                  |  2 ++
 src/components/Patient/DailyRounds.tsx | 27 +++++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletion(-)

diff --git a/public/locale/en.json b/public/locale/en.json
index e281d8239bf..ad656dc6631 100644
--- a/public/locale/en.json
+++ b/public/locale/en.json
@@ -746,6 +746,7 @@
   "hi__record_not_fetched_title": "This record hasn't been fetched yet",
   "hi__waiting_for_record": "Waiting for the Host HIP to send the record.",
   "hide": "Hide",
+  "high": "High",
   "home_facility": "Home Facility",
   "hubs": "Hub Facilities",
   "i_declare": "I hereby declare that:",
@@ -835,6 +836,7 @@
   "log_updates": "Log Updates",
   "login": "Login",
   "longitude_invalid": "Longitude must be between -180 and 180",
+  "low": "Low",
   "lsg": "Lsg",
   "make_multiple_beds_label": "Do you want to make multiple beds?",
   "manage_bed_presets": "Manage Presets of Bed",
diff --git a/src/components/Patient/DailyRounds.tsx b/src/components/Patient/DailyRounds.tsx
index d9bcb1366d5..2afd2b0a95d 100644
--- a/src/components/Patient/DailyRounds.tsx
+++ b/src/components/Patient/DailyRounds.tsx
@@ -59,6 +59,7 @@ import request from "@/Utils/request/request";
 import { formatDateTime } from "@/Utils/utils";
 import { scrollTo } from "@/Utils/utils";
 
+import RangeAutocompleteFormField from "../Form/FormFields/RangeAutocompleteFormField";
 import TextFormField from "../Form/FormFields/TextFormField";
 
 export const DailyRounds = (props: any) => {
@@ -702,6 +703,31 @@ export const DailyRounds = (props: any) => {
                   },
                 ]}
               />
+
+              <RangeAutocompleteFormField
+                {...field("ventilator_spo2")}
+                unit="%"
+                start={0}
+                end={100}
+                step={1}
+                thresholds={[
+                  {
+                    value: 0,
+                    className: "text-danger-500",
+                    label: "Low",
+                  },
+                  {
+                    value: 90,
+                    className: "text-primary-500",
+                    label: "Normal",
+                  },
+                  {
+                    value: 100,
+                    className: "text-danger-500",
+                    label: "High",
+                  },
+                ]}
+              />
             </>
           )}
 
@@ -819,7 +845,6 @@ export const DailyRounds = (props: any) => {
               />
             </>
           )}
-
           {state.form.rounds_type === "COMMUNITY_NURSES_LOG" && (
             <div className="md:col-span-2" data-scribe-ignore>
               <hr className="my-4 md:col-span-2" />

From ea713dfee1dcfd80d594080e7b194e8b348f9574 Mon Sep 17 00:00:00 2001
From: Khavin Shankar <khavinshankar@gmail.com>
Date: Tue, 19 Nov 2024 15:58:40 +0530
Subject: [PATCH 16/24] added a missing translation (#9131)

---
 public/locale/en.json | 1 +
 1 file changed, 1 insertion(+)

diff --git a/public/locale/en.json b/public/locale/en.json
index ad656dc6631..2eb4822c27e 100644
--- a/public/locale/en.json
+++ b/public/locale/en.json
@@ -259,6 +259,7 @@
   "abha_link_options__link_with_demographics__title": "Link with Demographics",
   "abha_link_options__link_with_otp__description": "Link Existing ABHA Number Using Mobile or Aadhaar OTP",
   "abha_link_options__link_with_otp__title": "Link with OTP",
+  "abha_link_options__link_with_qr__description": "Link Existing ABHA Number by Scanning the ABHA QR",
   "abha_link_options__link_with_qr__title": "Link with ABHA QR",
   "abha_number": "ABHA Number",
   "abha_number_exists": "ABHA Number already exists",

From ff63195d38f5bdfb684c2f6c429cffde217063ec Mon Sep 17 00:00:00 2001
From: Tanuj Nainwal <125687187+Tanuj1718@users.noreply.github.com>
Date: Wed, 20 Nov 2024 07:44:38 +0530
Subject: [PATCH 17/24] fix: Resolve creation of patient name despite having
 numeric values (#9152)

---
 src/components/Patient/PatientRegister.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/components/Patient/PatientRegister.tsx b/src/components/Patient/PatientRegister.tsx
index 5cc958d44de..a7a7743aee4 100644
--- a/src/components/Patient/PatientRegister.tsx
+++ b/src/components/Patient/PatientRegister.tsx
@@ -67,7 +67,7 @@ import {
 } from "@/common/constants";
 import countryList from "@/common/static/countries.json";
 import { statusType, useAbortableEffect } from "@/common/utils";
-import { validatePincode } from "@/common/validation";
+import { validateName, validatePincode } from "@/common/validation";
 
 import { PLUGIN_Component } from "@/PluginEngine";
 import { RestoreDraftButton } from "@/Utils/AutoSave";
@@ -421,6 +421,10 @@ export const PatientRegister = (props: PatientRegisterProps) => {
       switch (field) {
         case "address":
         case "name":
+          if (!validateName(form[field])) {
+            errors[field] = "Please enter valid name";
+          }
+          return;
         case "gender":
           errors[field] = RequiredFieldValidator()(form[field]);
           return;

From 41ed5be0b175f501f54bcc57060af4cb6aaa37c7 Mon Sep 17 00:00:00 2001
From: Aditya Jindal <adityajindal2305@gmail.com>
Date: Wed, 20 Nov 2024 07:45:48 +0530
Subject: [PATCH 18/24] Adjusted SpO2 thresholds and labels in DailyRounds
 component to match medical standards (#9118)

---
 public/locale/en.json                  |  4 ++++
 src/components/Patient/DailyRounds.tsx | 19 ++++++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/public/locale/en.json b/public/locale/en.json
index 2eb4822c27e..5faa645b133 100644
--- a/public/locale/en.json
+++ b/public/locale/en.json
@@ -205,6 +205,10 @@
   "SORT_OPTIONS__name": "Patient name A-Z",
   "SORT_OPTIONS__review_time": "Oldest review date first",
   "SORT_OPTIONS__taken_at": "Oldest taken date first",
+  "SPO2_LEVEL_MILD_HYPOXEMIA": "Mild Hypoxemia",
+  "SPO2_LEVEL_MODERATE_HYPOXEMIA": "Moderate Hypoxemia",
+  "SPO2_LEVEL_NORMAL": "Normal",
+  "SPO2_LEVEL_SEVERE_HYPOXEMIA": "Severe Hypoxemia",
   "Submit": "Submit",
   "TELEMEDICINE": "Telemedicine",
   "TRANSPORTATION TO BE ARRANGED": "Transportation",
diff --git a/src/components/Patient/DailyRounds.tsx b/src/components/Patient/DailyRounds.tsx
index 2afd2b0a95d..4e8573d6273 100644
--- a/src/components/Patient/DailyRounds.tsx
+++ b/src/components/Patient/DailyRounds.tsx
@@ -800,17 +800,22 @@ export const DailyRounds = (props: any) => {
                   {
                     value: 0,
                     className: "text-danger-500",
-                    label: "Low",
+                    label: t("SPO2_LEVEL_SEVERE_HYPOXEMIA"),
                   },
                   {
-                    value: 90,
-                    className: "text-primary-500",
-                    label: "Normal",
+                    value: 86,
+                    className: "text-danger-500",
+                    label: t("SPO2_LEVEL_MODERATE_HYPOXEMIA"),
                   },
                   {
-                    value: 100,
-                    className: "text-danger-500",
-                    label: "High",
+                    value: 91,
+                    className: "text-warning-400",
+                    label: t("SPO2_LEVEL_MILD_HYPOXEMIA"),
+                  },
+                  {
+                    value: 95,
+                    className: "text-primary-500",
+                    label: t("SPO2_LEVEL_NORMAL"),
                   },
                 ]}
               />

From b076d4f7a3179eb7ef783cb48b7d6cecf349cf6c Mon Sep 17 00:00:00 2001
From: Aditya Jindal <adityajindal2305@gmail.com>
Date: Wed, 20 Nov 2024 07:46:07 +0530
Subject: [PATCH 19/24] Fix: Year Of Birth Field Validation Condition in
 Patient transfer form (#9133)

---
 .../Facility/TransferPatientDialog.tsx        | 48 +++++++++++++------
 1 file changed, 34 insertions(+), 14 deletions(-)

diff --git a/src/components/Facility/TransferPatientDialog.tsx b/src/components/Facility/TransferPatientDialog.tsx
index 530bc513f0d..153ea17fa92 100644
--- a/src/components/Facility/TransferPatientDialog.tsx
+++ b/src/components/Facility/TransferPatientDialog.tsx
@@ -75,22 +75,38 @@ const TransferPatientDialog = (props: Props) => {
   const maxYear = new Date().getFullYear();
 
   const handleChange = (e: FieldChangeEvent<unknown>) => {
-    if (
-      e.name === "year_of_birth" &&
-      parseInt((e.value as string) || "0") > maxYear
-    ) {
+    const value = String(e.value);
+
+    if (e.name === "year_of_birth") {
+      if (value.length <= 4) {
+        dispatch({
+          type: "set_form",
+          form: { ...state.form, [e.name]: e.value },
+        });
+      }
+    } else {
       dispatch({
-        type: "set_error",
-        errors: {
-          ...state.errors,
-          [e.name]: `Cannot be greater than ${maxYear}`,
-        },
+        type: "set_form",
+        form: { ...state.form, [e.name]: e.value },
       });
-      return;
+    }
+  };
+
+  const handleOnBlur = (e: React.FocusEvent<HTMLInputElement>) => {
+    const yearValue = Number(state.form.year_of_birth);
+    if (!state.form.year_of_birth) return;
+    let errorMessage = "";
+    if (yearValue > maxYear) {
+      errorMessage = `Cannot be greater than ${maxYear}`;
+    } else if (yearValue < 1900) {
+      errorMessage = `Cannot be smaller than 1900`;
     }
     dispatch({
-      type: "set_form",
-      form: { ...state.form, [e.name]: e.value },
+      type: "set_error",
+      errors: {
+        ...state.errors,
+        [e.target.name]: errorMessage,
+      },
     });
   };
 
@@ -115,6 +131,11 @@ const TransferPatientDialog = (props: Props) => {
             errors[field] = `Cannot be greater than ${maxYear}`;
             invalidForm = true;
           }
+
+          if (parseInt(state.form[field] || "0") < 1900) {
+            errors[field] = `Cannot be smaller than 1900`;
+            invalidForm = true;
+          }
           return;
         default:
           return;
@@ -193,9 +214,8 @@ const TransferPatientDialog = (props: Props) => {
               label="Year of birth"
               labelClassName="text-sm"
               value={state.form.year_of_birth}
-              min="1900"
-              max={maxYear}
               onChange={handleChange}
+              onBlur={handleOnBlur}
               placeholder="Enter year of birth"
               error={state.errors.year_of_birth}
             />

From 64ed2a32feba89beeab031377afc9cb27373f518 Mon Sep 17 00:00:00 2001
From: Aditya Jindal <adityajindal2305@gmail.com>
Date: Wed, 20 Nov 2024 07:47:48 +0530
Subject: [PATCH 20/24] Fix: TypeError in notification list (#8935)

---
 .../Notifications/NotificationsList.tsx       | 85 ++++++++++---------
 1 file changed, 43 insertions(+), 42 deletions(-)

diff --git a/src/components/Notifications/NotificationsList.tsx b/src/components/Notifications/NotificationsList.tsx
index 17033d67623..f9b65b35201 100644
--- a/src/components/Notifications/NotificationsList.tsx
+++ b/src/components/Notifications/NotificationsList.tsx
@@ -244,7 +244,10 @@ export default function NotificationsList({
 
   const handleSubscribeClick = () => {
     const status = isSubscribed;
-    if (status === "NotSubscribed" || status === "SubscribedOnAnotherDevice") {
+    if (!navigator.serviceWorker) {
+      return;
+    }
+    if (["NotSubscribed", "SubscribedOnAnotherDevice"].includes(status)) {
       if (Notification.permission === "denied") {
         Warn({
           msg: t("notification_permission_denied"),
@@ -286,49 +289,47 @@ export default function NotificationsList({
 
   let manageResults: any = null;
 
-  const unsubscribe = () => {
-    navigator.serviceWorker.ready
-      .then(function (reg) {
-        setIsSubscribing(true);
-        reg.pushManager
-          .getSubscription()
-          .then(function (subscription) {
-            subscription
-              ?.unsubscribe()
-              .then(async function (_successful) {
-                const data = {
-                  pf_endpoint: "",
-                  pf_p256dh: "",
-                  pf_auth: "",
-                };
-
-                await request(routes.updateUserPnconfig, {
-                  pathParams: { username: username },
-                  body: data,
-                });
-
-                Warn({
-                  msg: t("unsubscribed_successfully"),
-                });
-
-                setIsSubscribed("NotSubscribed");
-                setIsSubscribing(false);
-              })
-              .catch(function (_e) {
-                Error({
-                  msg: t("unsubscribe_failed"),
-                });
-              });
-          })
-          .catch(function (_e) {
-            Error({ msg: t("subscription_error") });
+  const unsubscribe = async () => {
+    try {
+      const reg = await navigator.serviceWorker.ready;
+
+      if (!reg.pushManager) {
+        Error({ msg: t("unsubscribe_failed") });
+        return;
+      }
+
+      setIsSubscribing(true);
+
+      const subscription = await reg.pushManager.getSubscription();
+
+      if (subscription) {
+        try {
+          await subscription.unsubscribe();
+
+          await request(routes.updateUserPnconfig, {
+            pathParams: { username },
+            body: {
+              pf_endpoint: "",
+              pf_p256dh: "",
+              pf_auth: "",
+            },
           });
-      })
-      .catch(function (_e) {
-        Sentry.captureException(_e);
-      });
-  };
 
+          setIsSubscribed("NotSubscribed");
+          Warn({
+            msg: t("unsubscribed_successfully"),
+          });
+        } catch (e) {
+          Error({ msg: t("unsubscribe_failed") });
+        }
+      }
+    } catch (e) {
+      Sentry.captureException(e);
+      Error({ msg: t("subscription_error") });
+    } finally {
+      setIsSubscribing(false);
+    }
+  };
   async function subscribe() {
     setIsSubscribing(true);
     try {

From f79a2a4be651ffa3b7f9f107f8f08b480b467c0b Mon Sep 17 00:00:00 2001
From: Aakash Singh <mail@singhaakash.dev>
Date: Wed, 20 Nov 2024 07:49:15 +0530
Subject: [PATCH 21/24] Enhancements to the nursing care procedures and
 routines tables (#9079)

---
 .../ConsultationNursingTab.tsx                | 203 ++++++++++--------
 .../Consultations/LogUpdateAnalyseTable.tsx   |  93 ++++++++
 .../Facility/Consultations/NursingPlot.tsx    | 132 ------------
 src/components/Facility/models.tsx            |   5 +-
 4 files changed, 213 insertions(+), 220 deletions(-)
 create mode 100644 src/components/Facility/Consultations/LogUpdateAnalyseTable.tsx
 delete mode 100644 src/components/Facility/Consultations/NursingPlot.tsx

diff --git a/src/components/Facility/ConsultationDetails/ConsultationNursingTab.tsx b/src/components/Facility/ConsultationDetails/ConsultationNursingTab.tsx
index 81078197a45..6a7e33c6c95 100644
--- a/src/components/Facility/ConsultationDetails/ConsultationNursingTab.tsx
+++ b/src/components/Facility/ConsultationDetails/ConsultationNursingTab.tsx
@@ -5,42 +5,18 @@ import Loading from "@/components/Common/Loading";
 import PageTitle from "@/components/Common/PageTitle";
 import Pagination from "@/components/Common/Pagination";
 import { ConsultationTabProps } from "@/components/Facility/ConsultationDetails/index";
-import { NursingPlot } from "@/components/Facility/Consultations/NursingPlot";
+import LogUpdateAnalyseTable from "@/components/Facility/Consultations/LogUpdateAnalyseTable";
 import {
+  NursingPlotFields,
+  NursingPlotRes,
   RoutineAnalysisRes,
   RoutineFields,
 } from "@/components/Facility/models";
 
-import { PAGINATION_LIMIT } from "@/common/constants";
+import { NURSING_CARE_PROCEDURES, PAGINATION_LIMIT } from "@/common/constants";
 
 import routes from "@/Utils/request/api";
 import request from "@/Utils/request/request";
-import { classNames, formatDate, formatTime } from "@/Utils/utils";
-
-export default function ConsultationNursingTab(props: ConsultationTabProps) {
-  const { t } = useTranslation();
-  return (
-    <div>
-      <PageTitle
-        title={t("nursing_information")}
-        hideBack
-        breadcrumbs={false}
-      />
-      <div>
-        <h4>{t("routine")}</h4>
-        <RoutineSection {...props} />
-      </div>
-      <div>
-        <h4>{t("nursing_care")}</h4>
-        <NursingPlot
-          facilityId={props.facilityId}
-          patientId={props.patientId}
-          consultationId={props.consultationId}
-        />
-      </div>
-    </div>
-  );
-}
 
 const REVERSE_CHOICES = {
   appetite: {
@@ -114,6 +90,92 @@ const ROUTINE_ROWS = [
   { subField: true, field: "appetite" } as const,
 ];
 
+const NursingPlot = ({ consultationId }: ConsultationTabProps) => {
+  const { t } = useTranslation();
+  const [results, setResults] = useState<{ [date: string]: NursingPlotRes }>(
+    {},
+  );
+  const [currentPage, setCurrentPage] = useState(1);
+  const [totalCount, setTotalCount] = useState(0);
+
+  useEffect(() => {
+    const fetchDailyRounds = async (
+      currentPage: number,
+      consultationId: string,
+    ) => {
+      const { res, data } = await request(routes.dailyRoundsAnalyse, {
+        body: { page: currentPage, fields: NursingPlotFields },
+        pathParams: { consultationId },
+      });
+      if (res?.ok && data) {
+        setResults(data.results as { [date: string]: NursingPlotRes });
+        setTotalCount(data.count);
+      }
+    };
+
+    fetchDailyRounds(currentPage, consultationId);
+  }, [consultationId, currentPage]);
+
+  const handlePagination = (page: number) => setCurrentPage(page);
+
+  let fieldsToDisplay = new Set<string>();
+
+  /**
+   * Transforms nursing procedure results into a structured format where dates are mapped to procedures and their descriptions.
+   * Groups nursing data by date, collecting unique procedures and their corresponding descriptions.
+   */
+  const tableData = Object.entries(results).reduce(
+    (acc: Record<string, Record<string, string>>, [date, result]) => {
+      if ("nursing" in result) {
+        result.nursing.forEach((field) => {
+          if (field.procedure && !acc[date]) acc[date] = {};
+          acc[date][field.procedure] = field.description;
+          // Add procedure to the set of procedures to display
+          fieldsToDisplay.add(field.procedure);
+        });
+      }
+      return acc;
+    },
+    {},
+  );
+
+  fieldsToDisplay = fieldsToDisplay.intersection(
+    new Set(NURSING_CARE_PROCEDURES),
+  );
+
+  const rows = Array.from(fieldsToDisplay).map((procedure) => ({
+    field: procedure,
+    title: t(`NURSING_CARE_PROCEDURE__${procedure}`),
+  }));
+
+  return (
+    <div>
+      <div>
+        {fieldsToDisplay.size == 0 ? (
+          <div className="mt-1 w-full rounded-lg border bg-white p-4 shadow">
+            <div className="flex items-center justify-center text-2xl font-bold text-secondary-500">
+              {t("no_data_found")}
+            </div>
+          </div>
+        ) : (
+          <LogUpdateAnalyseTable data={tableData} rows={rows} />
+        )}
+      </div>
+
+      {totalCount > PAGINATION_LIMIT && fieldsToDisplay.size > 0 && (
+        <div className="mt-4 flex w-full justify-center">
+          <Pagination
+            cPage={currentPage}
+            defaultPerPage={PAGINATION_LIMIT}
+            data={{ totalCount }}
+            onChange={handlePagination}
+          />
+        </div>
+      )}
+    </div>
+  );
+};
+
 const RoutineSection = ({ consultationId }: ConsultationTabProps) => {
   const { t } = useTranslation();
   const [page, setPage] = useState(1);
@@ -158,65 +220,11 @@ const RoutineSection = ({ consultationId }: ConsultationTabProps) => {
 
   return (
     <div className="pb-8 pt-4">
-      <div className="m-2 w-full overflow-hidden overflow-x-auto rounded-lg border border-black shadow md:w-fit">
-        <table className="border-collapse overflow-hidden rounded-lg border bg-secondary-100">
-          <thead className="bg-white shadow">
-            <tr>
-              <th className="w-48 border-b-2 border-r-2 border-black" />
-              {Object.keys(results).map((date) => (
-                <th
-                  key={date}
-                  className="border border-b-2 border-secondary-500 border-b-black p-1 text-sm font-semibold"
-                >
-                  <p>{formatDate(date)}</p>
-                  <p>{formatTime(date)}</p>
-                </th>
-              ))}
-            </tr>
-          </thead>
-          <tbody className="bg-secondary-200">
-            {ROUTINE_ROWS.map((row) => (
-              <tr
-                key={row.field ?? row.title}
-                className={classNames(
-                  row.title && "border-t-2 border-t-secondary-600",
-                )}
-              >
-                <td
-                  className={classNames(
-                    "border border-r-2 border-secondary-500 border-r-black bg-white p-2",
-                    row.subField ? "pl-4 font-medium" : "font-bold",
-                  )}
-                >
-                  {row.title ?? t(`LOG_UPDATE_FIELD_LABEL__${row.field!}`)}
-                </td>
-                {row.field &&
-                  Object.values(results).map((obj, idx) => (
-                    <td
-                      key={`${row.field}-${idx}`}
-                      className={classNames(
-                        "border border-secondary-500 bg-secondary-100 p-2 text-center font-medium",
-                      )}
-                    >
-                      {(() => {
-                        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);
-                      })()}
-                    </td>
-                  ))}
-              </tr>
-            ))}
-          </tbody>
-        </table>
-      </div>
+      <LogUpdateAnalyseTable
+        data={results}
+        rows={ROUTINE_ROWS}
+        choices={REVERSE_CHOICES}
+      />
 
       {totalCount != null && totalCount > PAGINATION_LIMIT && (
         <div className="mt-4 flex w-full justify-center">
@@ -231,3 +239,24 @@ const RoutineSection = ({ consultationId }: ConsultationTabProps) => {
     </div>
   );
 };
+
+export default function ConsultationNursingTab(props: ConsultationTabProps) {
+  const { t } = useTranslation();
+  return (
+    <div>
+      <PageTitle
+        title={t("nursing_information")}
+        hideBack
+        breadcrumbs={false}
+      />
+      <div>
+        <h4 aria-label={t("routine")}>{t("routine")}</h4>
+        <RoutineSection {...props} />
+      </div>
+      <div>
+        <h4 aria-label={t("nursing_care")}>{t("nursing_care")}</h4>
+        <NursingPlot {...props} />
+      </div>
+    </div>
+  );
+}
diff --git a/src/components/Facility/Consultations/LogUpdateAnalyseTable.tsx b/src/components/Facility/Consultations/LogUpdateAnalyseTable.tsx
new file mode 100644
index 00000000000..43e59bebe7d
--- /dev/null
+++ b/src/components/Facility/Consultations/LogUpdateAnalyseTable.tsx
@@ -0,0 +1,93 @@
+import React from "react";
+import { useTranslation } from "react-i18next";
+
+import { classNames, formatDate, formatTime } from "@/Utils/utils";
+
+interface SharedSectionTableProps {
+  data: Record<string, Record<string, string | boolean | null>>;
+  rows: Array<{ title?: string; field?: string; subField?: boolean }>;
+  choices?: Record<string, Record<string | number, string>>;
+}
+
+const LogUpdateAnalyseTable: React.FC<SharedSectionTableProps> = ({
+  data,
+  rows,
+  choices = {},
+}) => {
+  const { t } = useTranslation();
+
+  const dataValues = React.useMemo(() => Object.values(data), [data]);
+
+  const getDisplayValue = (
+    value: string | boolean | null | undefined,
+    field?: string,
+  ): string => {
+    if (typeof value === "boolean") {
+      return t(value ? "yes" : "no");
+    }
+
+    if (field && choices[field]) {
+      const choiceMap = choices[field];
+      const choice =
+        typeof value === "string" || typeof value === "number"
+          ? choiceMap[value]
+          : undefined;
+      return choice ? t(`${field.toUpperCase()}__${choice}`) : "-";
+    }
+
+    return typeof value === "string" ? value : "-";
+  };
+
+  return (
+    <div className="m-2 w-full overflow-hidden overflow-x-auto rounded-lg border border-black shadow md:w-fit">
+      <table className="border-collapse rounded-lg border bg-secondary-100">
+        <thead className="sticky top-0 bg-white shadow">
+          <tr>
+            <th className="sticky left-0 border-b-2 border-r-2 border-black bg-white"></th>
+            {Object.keys(data).map((date) => (
+              <th
+                key={date}
+                className="w-40 border border-b-2 border-secondary-500 border-b-black p-1 text-sm font-semibold"
+              >
+                <p>{formatDate(date)}</p>
+                <p>{formatTime(date)}</p>
+              </th>
+            ))}
+          </tr>
+        </thead>
+        <tbody className="bg-secondary-200">
+          {rows.map((row) => (
+            <tr
+              key={row.field ?? row.title}
+              className={classNames(
+                row.title && "border-t-2 border-t-secondary-600",
+              )}
+            >
+              <th
+                className={classNames(
+                  "sticky left-0 border border-r-2 border-secondary-500 border-r-black bg-white p-2",
+                  row.subField ? "pl-4 font-medium" : "font-bold",
+                )}
+              >
+                {row.title ?? t(`LOG_UPDATE_FIELD_LABEL__${row.field!}`)}
+              </th>
+              {dataValues.map((obj, idx) => {
+                const value = row.field ? obj[row.field] : undefined;
+                return (
+                  <td
+                    key={`${row.field}-${idx}`}
+                    className="w-80 border border-l-2 border-secondary-500 bg-secondary-100 p-2 text-center font-medium"
+                  >
+                    {row.field ? getDisplayValue(value, row.field) : "-"}
+                  </td>
+                );
+              })}
+            </tr>
+          ))}
+        </tbody>
+      </table>
+    </div>
+  );
+};
+
+export default LogUpdateAnalyseTable;
diff --git a/src/components/Facility/Consultations/NursingPlot.tsx b/src/components/Facility/Consultations/NursingPlot.tsx
deleted file mode 100644
index 13f5bb64201..00000000000
--- a/src/components/Facility/Consultations/NursingPlot.tsx
+++ /dev/null
@@ -1,132 +0,0 @@
-import { useEffect, useState } from "react";
-import { useTranslation } from "react-i18next";
-
-import Pagination from "@/components/Common/Pagination";
-import { NursingPlotFields } from "@/components/Facility/models";
-
-import { NURSING_CARE_PROCEDURES, PAGINATION_LIMIT } from "@/common/constants";
-
-import routes from "@/Utils/request/api";
-import request from "@/Utils/request/request";
-import { formatDateTime } from "@/Utils/utils";
-
-export const NursingPlot = ({ consultationId }: any) => {
-  const { t } = useTranslation();
-  const [results, setResults] = useState<any>({});
-  const [currentPage, setCurrentPage] = useState(1);
-  const [totalCount, setTotalCount] = useState(0);
-
-  useEffect(() => {
-    const fetchDailyRounds = async (
-      currentPage: number,
-      consultationId: string,
-    ) => {
-      const { res, data } = await request(routes.dailyRoundsAnalyse, {
-        body: { page: currentPage, fields: NursingPlotFields },
-        pathParams: {
-          consultationId,
-        },
-      });
-      if (res && res.ok && data) {
-        setResults(data.results);
-        setTotalCount(data.count);
-      }
-    };
-
-    fetchDailyRounds(currentPage, consultationId);
-  }, [consultationId, currentPage]);
-
-  const handlePagination = (page: number) => {
-    setCurrentPage(page);
-  };
-
-  const data = Object.entries(results).map((key: any) => {
-    return {
-      date: formatDateTime(key[0]),
-      nursing: key[1]["nursing"],
-    };
-  });
-
-  const dataToDisplay = data
-    .map((x) =>
-      x.nursing.map((f: any) => {
-        f["date"] = x.date;
-        return f;
-      }),
-    )
-    .reduce((accumulator, value) => accumulator.concat(value), []);
-
-  const filterEmpty = (field: (typeof NURSING_CARE_PROCEDURES)[number]) => {
-    const filtered = dataToDisplay.filter((i: any) => i.procedure === field);
-    return filtered.length > 0;
-  };
-
-  const areFieldsEmpty = () => {
-    let emptyFieldCount = 0;
-    for (const field of NURSING_CARE_PROCEDURES) {
-      if (!filterEmpty(field)) emptyFieldCount++;
-    }
-    if (emptyFieldCount === NURSING_CARE_PROCEDURES.length) return true;
-    else return false;
-  };
-
-  return (
-    <div>
-      <div className="">
-        <div>
-          <div className="flex flex-row overflow-x-scroll">
-            {areFieldsEmpty() && (
-              <div className="mt-1 w-full rounded-lg border bg-white p-4 shadow">
-                <div className="flex items-center justify-center text-2xl font-bold text-secondary-500">
-                  {t("no_data_found")}
-                </div>
-              </div>
-            )}
-            {NURSING_CARE_PROCEDURES.map(
-              (f) =>
-                filterEmpty(f) && (
-                  <div key={f} className="m-2 w-3/4">
-                    <div className="sticky top-0 z-10 rounded pt-2">
-                      <div className="mx-2 flex items-center justify-between rounded border bg-secondary-200 p-4">
-                        <h3 className="flex h-8 items-center text-sm">
-                          {t(`NURSING_CARE_PROCEDURE__${f}`)}
-                        </h3>
-                      </div>
-                    </div>
-                    <div className="m-2">
-                      {dataToDisplay
-                        .filter((i: any) => i.procedure === f)
-                        .map((care: any, index: number) => (
-                          <div
-                            key={index}
-                            className="my-2 w-full divide-y rounded-lg border bg-white p-4 shadow"
-                          >
-                            <div className="text-xs font-semibold">
-                              {care.date}
-                            </div>
-                            <div className="py-2 text-sm">
-                              {care.description}
-                            </div>
-                          </div>
-                        ))}
-                    </div>
-                  </div>
-                ),
-            )}
-          </div>
-        </div>
-      </div>
-
-      {!areFieldsEmpty() && totalCount > PAGINATION_LIMIT && (
-        <div className="mt-4 flex w-full justify-center">
-          <Pagination
-            cPage={currentPage}
-            defaultPerPage={PAGINATION_LIMIT}
-            data={{ totalCount }}
-            onChange={handlePagination}
-          />
-        </div>
-      )}
-    </div>
-  );
-};
diff --git a/src/components/Facility/models.tsx b/src/components/Facility/models.tsx
index 79272ac3de7..a984efe6283 100644
--- a/src/components/Facility/models.tsx
+++ b/src/components/Facility/models.tsx
@@ -391,7 +391,10 @@ export const NursingPlotFields = [
 ] as const satisfies (keyof DailyRoundsModel)[];
 
 export type NursingPlotRes = {
-  nursing: any[];
+  nursing: Array<{
+    procedure: string;
+    description: string;
+  }>;
 };
 
 export const RoutineFields = [

From 85a445c4dfe0720c26523b35831d55c5ce16604c Mon Sep 17 00:00:00 2001
From: JavidSumra <112365664+JavidSumra@users.noreply.github.com>
Date: Wed, 20 Nov 2024 15:34:55 +0530
Subject: [PATCH 22/24] Add function to authorize user to register patient
 (#9000)

---
 src/components/Facility/FacilityHome.tsx   | 26 +++++----
 src/components/Patient/PatientRegister.tsx | 61 +++++++++++++---------
 2 files changed, 51 insertions(+), 36 deletions(-)

diff --git a/src/components/Facility/FacilityHome.tsx b/src/components/Facility/FacilityHome.tsx
index 02c3f5386cb..e38c187590e 100644
--- a/src/components/Facility/FacilityHome.tsx
+++ b/src/components/Facility/FacilityHome.tsx
@@ -48,6 +48,8 @@ import uploadFile from "@/Utils/request/uploadFile";
 import useQuery from "@/Utils/request/useQuery";
 import { sleep } from "@/Utils/utils";
 
+import { patientRegisterAuth } from "../Patient/PatientRegister";
+
 type Props = {
   facilityId: string;
 };
@@ -458,17 +460,19 @@ export const FacilityHome = ({ facilityId }: Props) => {
               {CameraFeedPermittedUserTypes.includes(authUser.user_type) && (
                 <LiveMonitoringButton />
               )}
-              <ButtonV2
-                variant="primary"
-                ghost
-                border
-                className="mt-2 flex w-full flex-row justify-center md:w-auto"
-                onClick={() => navigate(`/facility/${facilityId}/patient`)}
-                authorizeFor={NonReadOnlyUsers}
-              >
-                <CareIcon icon="l-plus" className="text-lg" />
-                <span className="text-sm">{t("add_details_of_patient")}</span>
-              </ButtonV2>
+              {patientRegisterAuth(authUser, facilityData, facilityId) && (
+                <ButtonV2
+                  variant="primary"
+                  ghost
+                  border
+                  className="mt-2 flex w-full flex-row justify-center md:w-auto"
+                  onClick={() => navigate(`/facility/${facilityId}/patient`)}
+                  authorizeFor={NonReadOnlyUsers}
+                >
+                  <CareIcon icon="l-plus" className="text-lg" />
+                  <span className="text-sm">{t("add_details_of_patient")}</span>
+                </ButtonV2>
+              )}
               <ButtonV2
                 id="view-patient-facility-list"
                 variant="primary"
diff --git a/src/components/Patient/PatientRegister.tsx b/src/components/Patient/PatientRegister.tsx
index a7a7743aee4..2a15416e337 100644
--- a/src/components/Patient/PatientRegister.tsx
+++ b/src/components/Patient/PatientRegister.tsx
@@ -22,6 +22,7 @@ import TransferPatientDialog from "@/components/Facility/TransferPatientDialog";
 import {
   DistrictModel,
   DupPatientModel,
+  FacilityModel,
   WardModel,
 } from "@/components/Facility/models";
 import {
@@ -51,6 +52,7 @@ import {
   PatientMeta,
   PatientModel,
 } from "@/components/Patient/models";
+import { UserModel } from "@/components/Users/models";
 
 import useAppHistory from "@/hooks/useAppHistory";
 import useAuthUser from "@/hooks/useAuthUser";
@@ -818,31 +820,12 @@ export const PatientRegister = (props: PatientRegisterProps) => {
     return <Loading />;
   }
 
-  const PatientRegisterAuth = () => {
-    const showAllFacilityUsers = ["DistrictAdmin", "StateAdmin"];
-    if (
-      !showAllFacilityUsers.includes(authUser.user_type) &&
-      authUser.home_facility_object?.id === facilityId
-    ) {
-      return true;
-    }
-    if (
-      authUser.user_type === "DistrictAdmin" &&
-      authUser.district === facilityObject?.district
-    ) {
-      return true;
-    }
-    if (
-      authUser.user_type === "StateAdmin" &&
-      authUser.state === facilityObject?.state
-    ) {
-      return true;
-    }
-
-    return false;
-  };
-
-  if (!isLoading && facilityId && facilityObject && !PatientRegisterAuth()) {
+  if (
+    !isLoading &&
+    facilityId &&
+    facilityObject &&
+    !patientRegisterAuth(authUser, facilityObject, facilityId)
+  ) {
     return <Error404 />;
   }
 
@@ -1717,3 +1700,31 @@ export const PatientRegister = (props: PatientRegisterProps) => {
     </Form>
   );
 };
+
+export function patientRegisterAuth(
+  authUser: UserModel,
+  facilityObject: FacilityModel | undefined,
+  facilityId: string,
+) {
+  const showAllFacilityUsers = ["DistrictAdmin", "StateAdmin"];
+  if (
+    !showAllFacilityUsers.includes(authUser.user_type) &&
+    authUser.home_facility_object?.id === facilityId
+  ) {
+    return true;
+  }
+  if (
+    authUser.user_type === "DistrictAdmin" &&
+    authUser.district === facilityObject?.district
+  ) {
+    return true;
+  }
+  if (
+    authUser.user_type === "StateAdmin" &&
+    authUser.state === facilityObject?.state
+  ) {
+    return true;
+  }
+
+  return false;
+}

From 2d08896504f0b4a9abaf1621cfe0a0f7edb143bb Mon Sep 17 00:00:00 2001
From: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
Date: Wed, 20 Nov 2024 18:47:24 +0530
Subject: [PATCH 23/24] Refactored the pagination component in cypress (#9163)

---
 cypress/e2e/assets_spec/AssetHomepage.cy.ts   | 11 +++++------
 .../e2e/facility_spec/FacilityHomepage.cy.ts  | 12 ++++++------
 .../e2e/facility_spec/FacilityLocation.cy.ts  |  7 +++----
 cypress/e2e/hcx_spec/HcxClaims.cy.ts          |  2 +-
 .../patient_spec/PatientBedManagement.cy.ts   |  4 ++--
 .../PatientConsultationCreation.cy.ts         |  2 +-
 .../PatientConsultationDischarge.cy.ts        |  8 ++++----
 .../patient_spec/PatientDoctorConnect.cy.ts   |  4 ++--
 .../e2e/patient_spec/PatientDoctorNotes.cy.ts |  2 +-
 cypress/e2e/patient_spec/PatientFileUpload.ts |  6 +++---
 .../e2e/patient_spec/PatientHomepage.cy.ts    |  7 ++++---
 .../patient_spec/PatientInvestigation.cy.ts   |  2 +-
 .../e2e/patient_spec/PatientLogUpdate.cy.ts   |  8 ++++----
 .../patient_spec/PatientPrescription.cy.ts    |  8 ++++----
 .../patient_spec/PatientRegistration.cy.ts    |  4 ++--
 .../sample_test_spec/SampleTestRequest.cy.ts  |  2 +-
 cypress/e2e/users_spec/UsersHomepage.cy.ts    | 11 ++++++-----
 cypress/pageobject/Asset/AssetPagination.ts   | 19 -------------------
 cypress/pageobject/Patient/PatientHome.ts     | 12 ------------
 cypress/pageobject/Users/UserSearch.ts        | 12 ------------
 cypress/pageobject/utils/paginationHelpers.ts | 13 +++++++++++++
 21 files changed, 63 insertions(+), 93 deletions(-)
 create mode 100644 cypress/pageobject/utils/paginationHelpers.ts

diff --git a/cypress/e2e/assets_spec/AssetHomepage.cy.ts b/cypress/e2e/assets_spec/AssetHomepage.cy.ts
index 67ad50e832f..dfb3249c243 100644
--- a/cypress/e2e/assets_spec/AssetHomepage.cy.ts
+++ b/cypress/e2e/assets_spec/AssetHomepage.cy.ts
@@ -1,9 +1,9 @@
 import { advanceFilters } from "pageobject/utils/advanceFilterHelpers";
+import { pageNavigation } from "pageobject/utils/paginationHelpers";
 import { v4 as uuidv4 } from "uuid";
 
 import { AssetPage } from "../../pageobject/Asset/AssetCreation";
 import { AssetFilters } from "../../pageobject/Asset/AssetFilters";
-import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
 import { AssetQRScanPage } from "../../pageobject/Asset/AssetQRScan";
 import { AssetSearchPage } from "../../pageobject/Asset/AssetSearch";
 import LoginPage from "../../pageobject/Login/LoginPage";
@@ -11,7 +11,6 @@ import LoginPage from "../../pageobject/Login/LoginPage";
 describe("Asset Tab", () => {
   const assetSearchPage = new AssetSearchPage();
   const assetQRScanPage = new AssetQRScanPage();
-  const assetPagination = new AssetPagination();
   const assetFilters = new AssetFilters();
   const assetPage = new AssetPage();
   const loginPage = new LoginPage();
@@ -79,10 +78,10 @@ describe("Asset Tab", () => {
   // Verify the pagination in the page
 
   it("Next/Previous Page", () => {
-    assetPagination.navigateToNextPage();
-    assetPagination.verifyNextUrl();
-    assetPagination.navigateToPreviousPage();
-    assetPagination.verifyPreviousUrl();
+    pageNavigation.navigateToNextPage();
+    pageNavigation.verifyCurrentPageNumber(2);
+    pageNavigation.navigateToPreviousPage();
+    pageNavigation.verifyCurrentPageNumber(1);
   });
 
   it("Import new asset", () => {
diff --git a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
index 2c5699ec76c..f4c7aaa90a0 100644
--- a/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
+++ b/cypress/e2e/facility_spec/FacilityHomepage.cy.ts
@@ -1,5 +1,6 @@
 // FacilityCreation
-import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
+import { pageNavigation } from "pageobject/utils/paginationHelpers";
+
 import FacilityPage from "../../pageobject/Facility/FacilityCreation";
 import FacilityHome from "../../pageobject/Facility/FacilityHome";
 import FacilityNotify from "../../pageobject/Facility/FacilityNotify";
@@ -15,7 +16,6 @@ describe("Facility Homepage Function", () => {
   const facilityPage = new FacilityPage();
   const manageUserPage = new ManageUserPage();
   const userPage = new UserPage();
-  const assetPagination = new AssetPagination();
   const facilitiesAlias = "downloadFacilitiesCSV";
   const doctorsAlias = "downloadDoctorsCSV";
   const triagesAlias = "downloadTriagesCSV";
@@ -83,10 +83,10 @@ describe("Facility Homepage Function", () => {
 
   it("Search a facility in homepage and pagination", () => {
     // pagination of the facility page
-    assetPagination.navigateToNextPage();
-    assetPagination.verifyNextUrl();
-    assetPagination.navigateToPreviousPage();
-    assetPagination.verifyPreviousUrl();
+    pageNavigation.navigateToNextPage();
+    pageNavigation.verifyCurrentPageNumber(2);
+    pageNavigation.navigateToPreviousPage();
+    pageNavigation.verifyCurrentPageNumber(1);
     // search for a facility
     manageUserPage.typeFacilitySearch(facilityName);
     facilityPage.verifyFacilityBadgeContent(facilityName);
diff --git a/cypress/e2e/facility_spec/FacilityLocation.cy.ts b/cypress/e2e/facility_spec/FacilityLocation.cy.ts
index 7d0c626a93b..9ac85e9ba4c 100644
--- a/cypress/e2e/facility_spec/FacilityLocation.cy.ts
+++ b/cypress/e2e/facility_spec/FacilityLocation.cy.ts
@@ -1,7 +1,7 @@
+import { pageNavigation } from "pageobject/utils/paginationHelpers";
 import { v4 as uuidv4 } from "uuid";
 
 import { AssetPage } from "../../pageobject/Asset/AssetCreation";
-import { AssetPagination } from "../../pageobject/Asset/AssetPagination";
 import FacilityPage from "../../pageobject/Facility/FacilityCreation";
 import FacilityHome from "../../pageobject/Facility/FacilityHome";
 import FacilityLocation from "../../pageobject/Facility/FacilityLocation";
@@ -12,7 +12,6 @@ describe("Location Management Section", () => {
   const userCreationPage = new UserCreationPage();
   const facilityPage = new FacilityPage();
   const facilityLocation = new FacilityLocation();
-  const assetPagination = new AssetPagination();
   const facilityHome = new FacilityHome();
 
   const EXPECTED_LOCATION_ERROR_MESSAGES = [
@@ -172,8 +171,8 @@ describe("Location Management Section", () => {
     facilityLocation.setMultipleBeds(numberOfModifiedBeds);
     assetPage.clickassetupdatebutton();
     // pagination
-    assetPagination.navigateToNextPage();
-    assetPagination.navigateToPreviousPage();
+    pageNavigation.navigateToNextPage();
+    pageNavigation.navigateToPreviousPage();
     facilityLocation.closeNotification();
   });
 
diff --git a/cypress/e2e/hcx_spec/HcxClaims.cy.ts b/cypress/e2e/hcx_spec/HcxClaims.cy.ts
index 869afd6fcbb..b698bb7ffd8 100644
--- a/cypress/e2e/hcx_spec/HcxClaims.cy.ts
+++ b/cypress/e2e/hcx_spec/HcxClaims.cy.ts
@@ -11,7 +11,7 @@ describe("HCX Claims configuration and approval workflow", () => {
   const patientConsultationPage = new PatientConsultationPage();
   const patientInsurance = new PatientInsurance();
   const hcxClaims = new HcxClaims();
-  const hcxPatientName = "Dummy Patient 14";
+  const hcxPatientName = "Dummy Patient Thirteen";
   const firstInsuranceIdentifier = "insurance-details-0";
   const patientMemberId = "001";
   const patientPolicyId = "100";
diff --git a/cypress/e2e/patient_spec/PatientBedManagement.cy.ts b/cypress/e2e/patient_spec/PatientBedManagement.cy.ts
index 65adf131c87..94f0869db9b 100644
--- a/cypress/e2e/patient_spec/PatientBedManagement.cy.ts
+++ b/cypress/e2e/patient_spec/PatientBedManagement.cy.ts
@@ -11,8 +11,8 @@ describe("Patient swtich bed functionality", () => {
   const switchBedOne = "Dummy Bed 4";
   const switchBedTwo = "Dummy Bed 1";
   const switchBedThree = "Dummy Bed 7";
-  const switchPatientOne = "Dummy Patient 6";
-  const switchPatientTwo = "Dummy Patient 7";
+  const switchPatientOne = "Dummy Patient Six";
+  const switchPatientTwo = "Dummy Patient Seven";
 
   before(() => {
     loginPage.loginAsDistrictAdmin();
diff --git a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
index bd6e7c0d967..3eacd9b718f 100644
--- a/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
+++ b/cypress/e2e/patient_spec/PatientConsultationCreation.cy.ts
@@ -375,7 +375,7 @@ describe("Patient Consultation in multiple combination", () => {
   });
 
   it("Edit created consultation to existing patient", () => {
-    patientPage.visitPatient("Dummy Patient 13");
+    patientPage.visitPatient("Dummy Patient Thirteen");
     patientConsultationPage.clickEditConsultationButton();
     patientConsultationPage.typePatientIllnessHistory("editted");
     patientConsultationPage.selectPatientDiagnosis(
diff --git a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
index 6a3d2863818..9e234c860da 100644
--- a/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
+++ b/cypress/e2e/patient_spec/PatientConsultationDischarge.cy.ts
@@ -31,7 +31,7 @@ describe("Patient Discharge based on multiple reason", () => {
   });
 
   it("Discharge a LAMA patient in the consultation", () => {
-    patientPage.visitPatient("Dummy Patient 12");
+    patientPage.visitPatient("Discharge Patient One");
     patientDischarge.clickDischarge();
     patientDischarge.selectDischargeReason(patientDischargeReason4);
     cy.clickSubmitButton("Confirm Discharge");
@@ -47,7 +47,7 @@ describe("Patient Discharge based on multiple reason", () => {
   });
 
   it("Discharge a expired patient in the consultation", () => {
-    patientPage.visitPatient("Dummy Patient 13");
+    patientPage.visitPatient("Discharge Patient Two");
     patientDischarge.clickDischarge();
     patientDischarge.selectDischargeReason(patientDischargeReason3);
     patientDischarge.typeDischargeNote(patientDeathCause);
@@ -67,7 +67,7 @@ describe("Patient Discharge based on multiple reason", () => {
   });
 
   it("Discharge patient with referred reason to a facility", () => {
-    patientPage.visitPatient("Dummy Patient 16");
+    patientPage.visitPatient("Discharge Patient Three");
     patientDischarge.clickDischarge();
     patientDischarge.selectDischargeReason(patientDischargeReason2);
     patientDischarge.typeDischargeNote(patientDischargeAdvice);
@@ -93,7 +93,7 @@ describe("Patient Discharge based on multiple reason", () => {
   });
 
   it("Discharge a recovered patient with all relevant fields", () => {
-    patientPage.visitPatient("Dummy Patient 15");
+    patientPage.visitPatient("Discharge Patient Four");
     patientDischarge.clickDischarge();
     patientDischarge.selectDischargeReason(patientDischargeReason1);
     patientDischarge.typeDischargeNote(patientDischargeAdvice);
diff --git a/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts b/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts
index dd626f619ce..474af286b21 100644
--- a/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts
+++ b/cypress/e2e/patient_spec/PatientDoctorConnect.cy.ts
@@ -7,10 +7,10 @@ describe("Patient Doctor Connect in consultation page", () => {
   const loginPage = new LoginPage();
   const patientPage = new PatientPage();
   const doctorconnect = new DoctorConnect();
-  const patientName = "Dummy Patient 11";
+  const patientName = "Dummy Patient Eleven";
   const doctorUser = "Dev Doctor";
   const nurseUser = "Dev Staff";
-  const teleIcuUser = "Dev Doctor Two";
+  const teleIcuUser = "Tester Doctor";
 
   before(() => {
     loginPage.loginAsDistrictAdmin();
diff --git a/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts b/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
index e35d3eb8961..d227d68ddcb 100644
--- a/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
+++ b/cypress/e2e/patient_spec/PatientDoctorNotes.cy.ts
@@ -6,7 +6,7 @@ describe("Patient Discussion notes in the consultation page", () => {
   const loginPage = new LoginPage();
   const patientPage = new PatientPage();
   const patientDoctorNotes = new PatientDoctorNotes();
-  const patientName = "Dummy Patient 4";
+  const patientName = "Dummy Patient Four";
   const patientNurseNote = "Test nurse Notes";
   const patientNurseReplyNote = "Test nurse reply Notes";
   const discussionNotesSubscribeWarning =
diff --git a/cypress/e2e/patient_spec/PatientFileUpload.ts b/cypress/e2e/patient_spec/PatientFileUpload.ts
index 110631551a1..dd3098163ec 100644
--- a/cypress/e2e/patient_spec/PatientFileUpload.ts
+++ b/cypress/e2e/patient_spec/PatientFileUpload.ts
@@ -14,9 +14,9 @@ function runTests(
     const cypressAudioName = "cypress audio";
     const cypressFileName = "cypress name";
     const newFileName = "cypress modified name";
-    const patientNameOne = "Dummy Patient 3";
-    const patientNameTwo = "Dummy Patient 4";
-    const patientNameThree = "Dummy Patient 5";
+    const patientNameOne = "Dummy Patient Three";
+    const patientNameTwo = "Dummy Patient Four";
+    const patientNameThree = "Dummy Patient Five";
     before(() => {
       loginPage.loginAsDistrictAdmin();
       cy.saveLocalStorage();
diff --git a/cypress/e2e/patient_spec/PatientHomepage.cy.ts b/cypress/e2e/patient_spec/PatientHomepage.cy.ts
index e4e0f927952..e2c32098f1c 100644
--- a/cypress/e2e/patient_spec/PatientHomepage.cy.ts
+++ b/cypress/e2e/patient_spec/PatientHomepage.cy.ts
@@ -1,4 +1,5 @@
 import { advanceFilters } from "pageobject/utils/advanceFilterHelpers";
+import { pageNavigation } from "pageobject/utils/paginationHelpers";
 
 import LoginPage from "../../pageobject/Login/LoginPage";
 import PatientHome from "../../pageobject/Patient/PatientHome";
@@ -163,15 +164,15 @@ describe("Patient Homepage present functionalities", () => {
       .invoke("text")
       .then((patientOne: string) => {
         firstPatientPageOne = patientOne.trim();
-        patientHome.clickNextPage();
-        patientHome.verifySecondPageUrl();
+        pageNavigation.navigateToNextPage();
+        pageNavigation.verifyCurrentPageNumber(2);
         cy.get('[data-cy="patient"]')
           .first()
           .invoke("text")
           .then((patientTwo: string) => {
             const firstPatientPageTwo = patientTwo.trim();
             expect(firstPatientPageOne).not.to.eq(firstPatientPageTwo);
-            patientHome.clickPreviousPage();
+            pageNavigation.navigateToPreviousPage();
           });
       });
   });
diff --git a/cypress/e2e/patient_spec/PatientInvestigation.cy.ts b/cypress/e2e/patient_spec/PatientInvestigation.cy.ts
index 262759bd360..350614d0c9a 100644
--- a/cypress/e2e/patient_spec/PatientInvestigation.cy.ts
+++ b/cypress/e2e/patient_spec/PatientInvestigation.cy.ts
@@ -7,7 +7,7 @@ describe("Patient Investigation Creation from Patient consultation page", () =>
   const loginPage = new LoginPage();
   const patientPage = new PatientPage();
   const patientInvestigation = new PatientInvestigation();
-  const patientName = "Dummy Patient 14";
+  const patientName = "Dummy Patient Thirteen";
 
   before(() => {
     loginPage.loginAsDistrictAdmin();
diff --git a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
index 05958bdf3f0..cfb739c8343 100644
--- a/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
+++ b/cypress/e2e/patient_spec/PatientLogUpdate.cy.ts
@@ -32,13 +32,13 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
   const patientInsulinDosage = "56";
   const patientFluidBalance = "500";
   const patientNetBalance = "1000";
-  const patientOne = "Dummy Patient 9";
+  const patientOne = "Dummy Patient Nine";
   const bedOne = "Dummy Bed 5";
-  const patientTwo = "Dummy Patient 10";
+  const patientTwo = "Dummy Patient Ten";
   const bedTwo = "Dummy Bed 2";
-  const patientThree = "Dummy Patient 8";
+  const patientThree = "Dummy Patient Eight";
   const bedThree = "Dummy Bed 3";
-  const domicilaryPatient = "Dummy Patient 11";
+  const domicilaryPatient = "Dummy Patient Eleven";
 
   before(() => {
     loginPage.loginAsDistrictAdmin();
diff --git a/cypress/e2e/patient_spec/PatientPrescription.cy.ts b/cypress/e2e/patient_spec/PatientPrescription.cy.ts
index 1011c2f4f4d..96e6e23b1aa 100644
--- a/cypress/e2e/patient_spec/PatientPrescription.cy.ts
+++ b/cypress/e2e/patient_spec/PatientPrescription.cy.ts
@@ -26,7 +26,7 @@ describe("Patient Medicine Administration", () => {
   });
 
   it("Add a new medicine | Verify the Edit and Discontinue Medicine workflow |", () => {
-    patientPage.visitPatient("Dummy Patient 9");
+    patientPage.visitPatient("Dummy Patient Nine");
     patientPrescription.visitMedicineTab();
     patientPrescription.visitEditPrescription();
     // Add a normal Medicine to the patient
@@ -63,7 +63,7 @@ describe("Patient Medicine Administration", () => {
   });
 
   it("Add a PRN Prescription medicine | Group Administrate it |", () => {
-    patientPage.visitPatient("Dummy Patient 6");
+    patientPage.visitPatient("Dummy Patient Six");
     patientPrescription.visitMedicineTab();
     patientPrescription.visitEditPrescription();
     // Add First Medicine
@@ -97,7 +97,7 @@ describe("Patient Medicine Administration", () => {
   });
 
   it("Add a new titrated medicine for a patient | Individual Administeration |", () => {
-    patientPage.visitPatient("Dummy Patient 5");
+    patientPage.visitPatient("Dummy Patient Five");
     patientPrescription.visitMedicineTab();
     patientPrescription.visitEditPrescription();
     patientPrescription.clickAddPrescription();
@@ -136,7 +136,7 @@ describe("Patient Medicine Administration", () => {
   });
 
   it("Add a new medicine for a patient and verify the duplicate medicine validation", () => {
-    patientPage.visitPatient("Dummy Patient 4");
+    patientPage.visitPatient("Dummy Patient Four");
     patientPrescription.visitMedicineTab();
     patientPrescription.visitEditPrescription();
     patientPrescription.clickAddPrescription();
diff --git a/cypress/e2e/patient_spec/PatientRegistration.cy.ts b/cypress/e2e/patient_spec/PatientRegistration.cy.ts
index 91810ffd273..c3647ceac3a 100644
--- a/cypress/e2e/patient_spec/PatientRegistration.cy.ts
+++ b/cypress/e2e/patient_spec/PatientRegistration.cy.ts
@@ -64,7 +64,7 @@ describe("Patient Creation with consultation", () => {
   const patientOneSecondInsurerName = "Care Payor";
   const patientTransferPhoneNumber = "9849511866";
   const patientTransferFacility = "Dummy Shifting Center";
-  const patientTransferName = "Dummy Patient 10";
+  const patientTransferName = "Dummy Patient Twelve";
   const patientOccupation = "Student";
 
   before(() => {
@@ -243,7 +243,7 @@ describe("Patient Creation with consultation", () => {
     patientTransfer.clickTransferPatientYOB(yearOfBirth);
     patientTransfer.clickTransferSubmitButton();
     cy.verifyNotification(
-      "Patient Dummy Patient 10 (Male) transferred successfully",
+      `Patient ${patientTransferName} (Male) transferred successfully`,
     );
     patientTransfer.clickConsultationCancelButton();
     // allow the transfer button of a patient
diff --git a/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts b/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
index a0f30ebd6db..da4d8aabd20 100644
--- a/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
+++ b/cypress/e2e/sample_test_spec/SampleTestRequest.cy.ts
@@ -8,7 +8,7 @@ describe("Sample Test", () => {
   const patientPage = new PatientPage();
   const loginPage = new LoginPage();
   const patientConsultationPage = new PatientConsultationPage();
-  const patientName = "Dummy Patient 11";
+  const patientName = "Dummy Patient Eleven";
   const sampleTestType = "BA/ETA";
   const icmrCategory = "Cat 0";
   const icmrLabel = "Test Icmr Label";
diff --git a/cypress/e2e/users_spec/UsersHomepage.cy.ts b/cypress/e2e/users_spec/UsersHomepage.cy.ts
index d5825f58f20..b32bb859e4e 100644
--- a/cypress/e2e/users_spec/UsersHomepage.cy.ts
+++ b/cypress/e2e/users_spec/UsersHomepage.cy.ts
@@ -1,4 +1,5 @@
 import { advanceFilters } from "pageobject/utils/advanceFilterHelpers";
+import { pageNavigation } from "pageobject/utils/paginationHelpers";
 
 import LoginPage from "../../pageobject/Login/LoginPage";
 import { UserPage } from "../../pageobject/Users/UserSearch";
@@ -16,7 +17,7 @@ describe("User Homepage", () => {
   const altPhoneNumber = "8878825662";
   const homeFacility = "Dummy Facility 40";
   const nurseUserName = "dummynurse1";
-  const doctorUserName = "devdoctor1";
+  const doctorUserName = "dev-doctor2";
 
   before(() => {
     loginPage.loginAsDistrictAdmin();
@@ -84,10 +85,10 @@ describe("User Homepage", () => {
   });
 
   it("Next/Previous Page Navigation", () => {
-    userPage.navigateToNextPage();
-    userPage.verifyCurrentPageNumber(2);
-    userPage.navigateToPreviousPage();
-    userPage.verifyCurrentPageNumber(1);
+    pageNavigation.navigateToNextPage();
+    pageNavigation.verifyCurrentPageNumber(2);
+    pageNavigation.navigateToPreviousPage();
+    pageNavigation.verifyCurrentPageNumber(1);
   });
 
   afterEach(() => {
diff --git a/cypress/pageobject/Asset/AssetPagination.ts b/cypress/pageobject/Asset/AssetPagination.ts
index f2a4103b065..e69de29bb2d 100644
--- a/cypress/pageobject/Asset/AssetPagination.ts
+++ b/cypress/pageobject/Asset/AssetPagination.ts
@@ -1,19 +0,0 @@
-export class AssetPagination {
-  navigateToNextPage() {
-    // only works for desktop mode
-    cy.get("button#next-pages").click();
-  }
-
-  verifyNextUrl() {
-    cy.url().should("include", "page=2");
-  }
-
-  navigateToPreviousPage() {
-    // only works for desktop mode
-    cy.get("button#prev-pages").click();
-  }
-
-  verifyPreviousUrl() {
-    cy.url().should("include", "page=1");
-  }
-}
diff --git a/cypress/pageobject/Patient/PatientHome.ts b/cypress/pageobject/Patient/PatientHome.ts
index bc27977d561..36cad15f0e5 100644
--- a/cypress/pageobject/Patient/PatientHome.ts
+++ b/cypress/pageobject/Patient/PatientHome.ts
@@ -1,16 +1,4 @@
 class PatientHome {
-  clickNextPage() {
-    cy.get("#next-pages").click();
-  }
-
-  verifySecondPageUrl() {
-    cy.url().should("include", "/patients?page=2");
-  }
-
-  clickPreviousPage() {
-    cy.get("#prev-pages").click();
-  }
-
   clickPatientExport() {
     cy.get("#patient-export").click();
   }
diff --git a/cypress/pageobject/Users/UserSearch.ts b/cypress/pageobject/Users/UserSearch.ts
index 85575398d0d..6b727aa2040 100644
--- a/cypress/pageobject/Users/UserSearch.ts
+++ b/cypress/pageobject/Users/UserSearch.ts
@@ -76,18 +76,6 @@ export class UserPage {
     cy.get(`[data-testid="${testId}"]`).should("not.be.visible");
   }
 
-  navigateToNextPage() {
-    cy.get("button#next-pages").click();
-  }
-
-  navigateToPreviousPage() {
-    cy.get("button#prev-pages").click();
-  }
-
-  verifyCurrentPageNumber(pageNumber: number) {
-    cy.url().should("include", `page=${pageNumber}`);
-  }
-
   verifyMultipleBadgesWithSameId(alreadylinkedusersviews: string[]) {
     cy.get("#user-view-name").then(($elements) => {
       const userViews = $elements
diff --git a/cypress/pageobject/utils/paginationHelpers.ts b/cypress/pageobject/utils/paginationHelpers.ts
new file mode 100644
index 00000000000..edbabec5523
--- /dev/null
+++ b/cypress/pageobject/utils/paginationHelpers.ts
@@ -0,0 +1,13 @@
+export const pageNavigation = {
+  navigateToNextPage() {
+    cy.get("button#next-pages").click();
+  },
+
+  verifyCurrentPageNumber(pageNumber: number) {
+    cy.url().should("include", `page=${pageNumber}`);
+  },
+
+  navigateToPreviousPage() {
+    cy.get("button#prev-pages").click();
+  },
+};

From 10369c59abf6e75c8de71a7a133b5ca43c0e54ab Mon Sep 17 00:00:00 2001
From: Rithvik Nishad <mail@rithviknishad.dev>
Date: Wed, 20 Nov 2024 19:16:47 +0530
Subject: [PATCH 24/24] fix plausible site domain env validation (#9168)

---
 vite.config.mts | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/vite.config.mts b/vite.config.mts
index ca92aa50954..3fc64d66829 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -111,7 +111,12 @@ export default defineConfig(({ mode }) => {
           REACT_SENTRY_DSN: z.string().url().optional(),
           REACT_SENTRY_ENVIRONMENT: z.string().optional(),
 
-          REACT_PLAUSIBLE_SITE_DOMAIN: z.string().url().optional(),
+          REACT_PLAUSIBLE_SITE_DOMAIN: z
+            .string()
+            .regex(/^[a-zA-Z0-9][a-zA-Z0-9-_.]*\.[a-zA-Z]{2,}$/)
+            .optional()
+            .describe("Domain name without protocol (e.g., sub.domain.com)"),
+
           REACT_PLAUSIBLE_SERVER_URL: z.string().url().optional(),
           REACT_CDN_URLS: z
             .string()