From e1fb26062ed1a0a7e39bdcbda8081c5257bc3f78 Mon Sep 17 00:00:00 2001
From: Rithvik Nishad
Date: Fri, 22 Mar 2024 20:52:25 +0530
Subject: [PATCH 01/13] Removes support for exporting All Patients (#7457)
---
src/Components/Common/Export.tsx | 19 +++++++++++++++++++
src/Components/Patient/ManagePatients.tsx | 10 +---------
2 files changed, 20 insertions(+), 9 deletions(-)
diff --git a/src/Components/Common/Export.tsx b/src/Components/Common/Export.tsx
index 7ddaca115bd..6714d8bdb08 100644
--- a/src/Components/Common/Export.tsx
+++ b/src/Components/Common/Export.tsx
@@ -39,6 +39,25 @@ export const ExportMenu = ({
}: ExportMenuProps) => {
const { isExporting, exportFile } = useExport();
+ if (exportItems.length === 1) {
+ const item = exportItems[0];
+
+ return (
+
+ exportFile(item.action, item.filePrefix, item.type, item.parse)
+ }
+ border
+ ghost
+ className="py-2.5"
+ >
+
+ {isExporting ? "Exporting..." : label}
+
+ );
+ }
+
return (
diff --git a/src/Components/Common/Export.tsx b/src/Components/Common/Export.tsx
index 6714d8bdb08..e94a2826398 100644
--- a/src/Components/Common/Export.tsx
+++ b/src/Components/Common/Export.tsx
@@ -63,7 +63,7 @@ export const ExportMenu = ({
}
+ icon={}
className="tooltip border-primary-500 bg-white text-primary-500 hover:bg-primary-100 enabled:border"
>
{exportItems.map((item) => (
@@ -103,9 +103,9 @@ export const ExportButton = ({
circle
>
{isExporting ? (
-
+
) : (
-
+
)}
{props.tooltip || "Export"}
diff --git a/src/Components/Common/GLocationPicker.tsx b/src/Components/Common/GLocationPicker.tsx
index fc121b8519f..6fc1a4c2b6c 100644
--- a/src/Components/Common/GLocationPicker.tsx
+++ b/src/Components/Common/GLocationPicker.tsx
@@ -220,7 +220,10 @@ const Map: React.FC = ({
ref={mapCloseRef}
onClick={handleOnClose}
>
-
+
)}
@@ -235,7 +238,10 @@ const Map: React.FC = ({
)
}
>
-
+
)}
>
diff --git a/src/Components/Common/LanguageSelector.tsx b/src/Components/Common/LanguageSelector.tsx
index 4a4f67b993e..8ae1b187c89 100644
--- a/src/Components/Common/LanguageSelector.tsx
+++ b/src/Components/Common/LanguageSelector.tsx
@@ -38,7 +38,10 @@ export const LanguageSelector = (props: any) => {
))}
-
+
);
diff --git a/src/Components/Common/Pagination.tsx b/src/Components/Common/Pagination.tsx
index e86c9b7a491..0f988874257 100644
--- a/src/Components/Common/Pagination.tsx
+++ b/src/Components/Common/Pagination.tsx
@@ -94,12 +94,12 @@ const Pagination = ({
tooltip="Previous"
onClick={() => goToPage(currentPage - 1)}
disabled={currentPage - 1 <= 0}
- children={}
+ children={}
/>
}
+ children={}
onClick={() => goToPage(currentPage + 1)}
disabled={currentPage + 1 > totalPage}
/>
@@ -110,7 +110,7 @@ const Pagination = ({
}
+ children={}
onClick={() => goToPage(1)}
disabled={currentPage === 1}
/>
@@ -119,7 +119,7 @@ const Pagination = ({
tooltip="Previous"
onClick={() => goToPage(currentPage - 1)}
disabled={currentPage - 1 <= 0}
- children={}
+ children={}
/>
{pageNumbers.map((page) => (
@@ -137,14 +137,16 @@ const Pagination = ({
}
+ children={}
onClick={() => goToPage(currentPage + 1)}
disabled={currentPage + 1 > totalPage}
/>
}
+ children={
+
+ }
onClick={() => goToPage(totalPage)}
disabled={totalPage === 0 || currentPage === totalPage}
/>
diff --git a/src/Components/Common/QRScanner.tsx b/src/Components/Common/QRScanner.tsx
index b4d618ec7dc..4b744ba2eeb 100644
--- a/src/Components/Common/QRScanner.tsx
+++ b/src/Components/Common/QRScanner.tsx
@@ -73,8 +73,9 @@ const QRScanner = ({
setShowScanner(true)}
- className="care-l-focus z-50 cursor-pointer text-black"
+ className="z-50 cursor-pointer text-black"
/>
}
error={error}
diff --git a/src/Components/Common/RelativeDateUserMention.tsx b/src/Components/Common/RelativeDateUserMention.tsx
index 2af92268987..70eadc5b7ed 100644
--- a/src/Components/Common/RelativeDateUserMention.tsx
+++ b/src/Components/Common/RelativeDateUserMention.tsx
@@ -33,7 +33,10 @@ function RelativeDateUserMention(props: {
{props.user.user_type}
-
+
)}
diff --git a/src/Components/Common/Sidebar/Sidebar.tsx b/src/Components/Common/Sidebar/Sidebar.tsx
index 747fa3949da..c611b26f2e5 100644
--- a/src/Components/Common/Sidebar/Sidebar.tsx
+++ b/src/Components/Common/Sidebar/Sidebar.tsx
@@ -3,7 +3,7 @@ import { SidebarItem, ShrinkedSidebarItem } from "./SidebarItem";
import SidebarUserCard from "./SidebarUserCard";
import NotificationItem from "../../Notifications/NotificationsList";
import useActiveLink from "../../../Common/hooks/useActiveLink";
-import CareIcon from "../../../CAREUI/icons/CareIcon";
+import CareIcon, { IconName } from "../../../CAREUI/icons/CareIcon";
import useConfig from "../../../Common/hooks/useConfig";
import SlideOver from "../../../CAREUI/interactive/SlideOver";
import { classNames } from "../../../Utils/utils";
@@ -36,26 +36,30 @@ const StatelessSidebar = ({
}: StatelessSidebarProps) => {
const authUser = useAuthUser();
- const NavItems = [
- { text: "Facilities", to: "/facility", icon: "care-l-hospital" },
- { text: "Patients", to: "/patients", icon: "care-l-user-injured" },
- { text: "Assets", to: "/assets", icon: "care-l-shopping-cart-alt" },
- { text: "Sample Test", to: "/sample", icon: "care-l-medkit" },
- { text: "Shifting", to: "/shifting", icon: "care-l-ambulance" },
- { text: "Resource", to: "/resource", icon: "care-l-heart-medical" },
+ const NavItems: {
+ text: string;
+ to: string;
+ icon: IconName;
+ }[] = [
+ { text: "Facilities", to: "/facility", icon: "l-hospital" },
+ { text: "Patients", to: "/patients", icon: "l-user-injured" },
+ { text: "Assets", to: "/assets", icon: "l-shopping-cart-alt" },
+ { text: "Sample Test", to: "/sample", icon: "l-medkit" },
+ { text: "Shifting", to: "/shifting", icon: "l-ambulance" },
+ { text: "Resource", to: "/resource", icon: "l-heart-medical" },
...(!["Nurse", "NurseReadOnly", "Staff", "StaffReadOnly"].includes(
authUser.user_type
)
- ? [
+ ? ([
{
text: "External Results",
to: "/external_results",
- icon: "care-l-clipboard-notes",
+ icon: "l-clipboard-notes",
},
- ]
+ ] as const)
: []),
- { text: "Users", to: "/users", icon: "care-l-users-alt" },
- { text: "Notice Board", to: "/notice_board", icon: "care-l-meeting-board" },
+ { text: "Users", to: "/users", icon: "l-users-alt" },
+ { text: "Notice Board", to: "/notice_board", icon: "l-meeting-board" },
];
const { main_logo } = useConfig();
@@ -134,7 +138,7 @@ const StatelessSidebar = ({
ref={i.to === activeLink ? activeLinkRef : undefined}
key={i.text}
{...i}
- icon={}
+ icon={}
selected={i.to === activeLink}
do={() => onItemClick && onItemClick(false)}
handleOverflow={handleOverflow}
@@ -151,7 +155,7 @@ const StatelessSidebar = ({
}
+ icon={}
external
handleOverflow={handleOverflow}
/>
diff --git a/src/Components/Common/Sidebar/SidebarItem.tsx b/src/Components/Common/Sidebar/SidebarItem.tsx
index 20ffec4217e..90698aa3bbc 100644
--- a/src/Components/Common/Sidebar/SidebarItem.tsx
+++ b/src/Components/Common/Sidebar/SidebarItem.tsx
@@ -66,7 +66,7 @@ const SidebarItemBase = forwardRef(
{t(props.text)}
{external && !shrinked && (
-
+
)}
diff --git a/src/Components/Common/Sidebar/SidebarUserCard.tsx b/src/Components/Common/Sidebar/SidebarUserCard.tsx
index 75cf2d9ce43..d083867738c 100644
--- a/src/Components/Common/Sidebar/SidebarUserCard.tsx
+++ b/src/Components/Common/Sidebar/SidebarUserCard.tsx
@@ -16,11 +16,12 @@ const SidebarUserCard = ({ shrinked }: { shrinked: boolean }) => {
} transition-all duration-200 ease-in-out`}
>
-
+
@@ -44,9 +45,8 @@ const SidebarUserCard = ({ shrinked }: { shrinked: boolean }) => {
onClick={signOut}
>
{t("sign_out")}
diff --git a/src/Components/Common/SortDropdown.tsx b/src/Components/Common/SortDropdown.tsx
index e979d89375e..b29662de0a7 100644
--- a/src/Components/Common/SortDropdown.tsx
+++ b/src/Components/Common/SortDropdown.tsx
@@ -24,7 +24,7 @@ export default function SortDropdownMenu(props: Props) {
title={props.label ?? t("sort_by")}
variant="secondary"
className="border border-primary-500 bg-white"
- icon={}
+ icon={}
>
{props.options.map(({ isAscending, value }) => (
props.onSelect({ ordering: value })}
icon={
}
>
diff --git a/src/Components/Common/Steps.tsx b/src/Components/Common/Steps.tsx
index 497682c3bf8..e0b1e03af3f 100644
--- a/src/Components/Common/Steps.tsx
+++ b/src/Components/Common/Steps.tsx
@@ -29,7 +29,8 @@ export default function Steps(props: { steps: Step[] }) {
diff --git a/src/Components/Common/SymptomsSelect.tsx b/src/Components/Common/SymptomsSelect.tsx
index e96c8070e3a..f16744b7343 100644
--- a/src/Components/Common/SymptomsSelect.tsx
+++ b/src/Components/Common/SymptomsSelect.tsx
@@ -51,7 +51,7 @@ export const SymptomsSelect = (props: FormFieldBaseProps) => {
if (value.includes(ASYMPTOMATIC_ID) && id !== ASYMPTOMATIC_ID)
return (
-
+
also unselects Asymptomatic
@@ -61,7 +61,7 @@ export const SymptomsSelect = (props: FormFieldBaseProps
) => {
if (!value.includes(ASYMPTOMATIC_ID) && id === ASYMPTOMATIC_ID)
return (
-
+
{`also unselects the other ${value.length} option(s)`}
);
diff --git a/src/Components/Common/TemperatureFormField.tsx b/src/Components/Common/TemperatureFormField.tsx
index 4a40781a141..2d81ab3d8df 100644
--- a/src/Components/Common/TemperatureFormField.tsx
+++ b/src/Components/Common/TemperatureFormField.tsx
@@ -3,7 +3,6 @@ import { FormFieldBaseProps } from "../Form/FormFields/Utils";
import RangeAutocompleteFormField from "../Form/FormFields/RangeAutocompleteFormField";
import CareIcon from "../../CAREUI/icons/CareIcon";
import ButtonV2 from "./components/ButtonV2";
-import { classNames } from "../../Utils/utils";
type TemperatureUnit = "celsius" | "fahrenheit";
@@ -24,31 +23,31 @@ export default function TemperatureFormField(props: Props) {
{
value: 95,
label: "Low",
- icon: ,
+ icon: ,
className: "text-danger-500",
},
{
value: 96.6,
label: "Low",
- icon: ,
+ icon: ,
className: "text-warning-500",
},
{
value: 97.6,
label: "Normal",
- icon: ,
+ icon: ,
className: "text-primary-500",
},
{
value: 99.6,
label: "High",
- icon: ,
+ icon: ,
className: "text-warning-500",
},
{
value: 101.6,
label: "High",
- icon: ,
+ icon: ,
className: "text-danger-500",
},
]}
@@ -66,7 +65,10 @@ export default function TemperatureFormField(props: Props) {
border
onClick={() => setUnit(unit === "celsius" ? "fahrenheit" : "celsius")}
>
-
+
}
/>
diff --git a/src/Components/Common/UpdatableApp.tsx b/src/Components/Common/UpdatableApp.tsx
index 8b200d5da0e..1fd44da1672 100644
--- a/src/Components/Common/UpdatableApp.tsx
+++ b/src/Components/Common/UpdatableApp.tsx
@@ -121,6 +121,7 @@ const UpdateAppPopup = ({ onUpdate }: UpdateAppPopupProps) => {
{
-
+
Updated successfully
diff --git a/src/Components/Common/components/ButtonV2.tsx b/src/Components/Common/components/ButtonV2.tsx
index 2f3d3002451..4dc6c71ac82 100644
--- a/src/Components/Common/components/ButtonV2.tsx
+++ b/src/Components/Common/components/ButtonV2.tsx
@@ -171,7 +171,7 @@ export const Submit = ({ label = "Submit", ...props }: CommonButtonProps) => {
type="submit"
children={
<>
-
+
{t(label)}
>
}
@@ -191,7 +191,7 @@ export const Cancel = ({ label = "Cancel", ...props }: CommonButtonProps) => {
border
children={
<>
-
+
{t(label)}
>
}
diff --git a/src/Components/Common/components/ContactLink.tsx b/src/Components/Common/components/ContactLink.tsx
index f78b32863c4..762558f5bb2 100644
--- a/src/Components/Common/components/ContactLink.tsx
+++ b/src/Components/Common/components/ContactLink.tsx
@@ -12,9 +12,8 @@ export default function ContactLink(props: ContactLinkProps) {
className=" flex items-center gap-2 border-b border-blue-500 text-base font-medium tracking-wider text-blue-500"
>
{props.tel ? props.tel : props.mailto}
diff --git a/src/Components/Common/prescription-builder/InvestigationBuilder.tsx b/src/Components/Common/prescription-builder/InvestigationBuilder.tsx
index 7cf7e3024ad..6ccef78e6ec 100644
--- a/src/Components/Common/prescription-builder/InvestigationBuilder.tsx
+++ b/src/Components/Common/prescription-builder/InvestigationBuilder.tsx
@@ -142,7 +142,7 @@ export default function InvestigationBuilder(
}
>
Delete Investigation
-
+
diff --git a/src/Components/Common/prescription-builder/ProcedureBuilder.tsx b/src/Components/Common/prescription-builder/ProcedureBuilder.tsx
index a42f2bab19d..1c773482464 100644
--- a/src/Components/Common/prescription-builder/ProcedureBuilder.tsx
+++ b/src/Components/Common/prescription-builder/ProcedureBuilder.tsx
@@ -60,7 +60,7 @@ export default function ProcedureBuilder(props: Props
) {
}
>
Delete Procedure
-
+
diff --git a/src/Components/ExternalResult/ResultList.tsx b/src/Components/ExternalResult/ResultList.tsx
index 88a385394aa..3cedd0fc109 100644
--- a/src/Components/ExternalResult/ResultList.tsx
+++ b/src/Components/ExternalResult/ResultList.tsx
@@ -245,7 +245,7 @@ export default function ResultList() {
label: "Import Results",
action: () => navigate("/external_results/upload"),
options: {
- icon:
,
+ icon:
,
},
},
]
@@ -259,7 +259,7 @@ export default function ResultList() {
),
filePrefix: "external_results",
options: {
- icon:
,
+ icon:
,
},
},
]}
diff --git a/src/Components/Facility/AssetCreate.tsx b/src/Components/Facility/AssetCreate.tsx
index eba5d89a0b3..a0fa23e74c4 100644
--- a/src/Components/Facility/AssetCreate.tsx
+++ b/src/Components/Facility/AssetCreate.tsx
@@ -390,7 +390,7 @@ const AssetCreate = (props: AssetProps) => {
-
+
@@ -673,7 +673,10 @@ const AssetCreate = (props: AssetProps) => {
className="ml-1 mt-1 flex h-10 cursor-pointer items-center justify-self-end rounded border border-gray-400 px-4 hover:bg-gray-200"
onClick={() => setIsScannerActive(true)}
>
-
+
diff --git a/src/Components/Facility/BedManagement.tsx b/src/Components/Facility/BedManagement.tsx
index d8799f1fbc5..e0d7c99b3b6 100644
--- a/src/Components/Facility/BedManagement.tsx
+++ b/src/Components/Facility/BedManagement.tsx
@@ -120,7 +120,7 @@ const BedRow = (props: BedRowProps) => {
border
ghost
>
-
+
Edit
{
tooltip={isOccupied ? "Bed is occupied" : undefined}
tooltipClassName="w-full lg:w-auto"
>
-
+
Delete
@@ -222,7 +222,7 @@ export const BedManagement = (props: BedManagementProps) => {
href={`/facility/${facilityId}/location/${locationId}/beds/add`}
authorizeFor={NonReadOnlyUsers}
>
-
+
Add New Bed(s)
diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx
index e063292cf2f..2b938d2af07 100644
--- a/src/Components/Facility/CentralNursingStation.tsx
+++ b/src/Components/Facility/CentralNursingStation.tsx
@@ -6,7 +6,6 @@ import Loading from "../Common/Loading";
import Page from "../Common/components/Page";
import ButtonV2 from "../Common/components/ButtonV2";
import CareIcon from "../../CAREUI/icons/CareIcon";
-import { classNames } from "../../Utils/utils";
import { LocationSelect } from "../Common/LocationSelect";
import Pagination from "../Common/Pagination";
import { Popover, Transition } from "@headlessui/react";
@@ -82,7 +81,7 @@ export default function CentralNursingStation({ facilityId }: Props) {
-
+
Settings and Filters
@@ -138,10 +137,10 @@ export default function CentralNursingStation({ facilityId }: Props) {
optionLabel={({ value }) => t("SortOptions." + value)}
optionIcon={({ isAscending }) => (
)}
@@ -166,12 +165,12 @@ export default function CentralNursingStation({ facilityId }: Props) {
className="tooltip !h-11"
>
{isFullscreen ? "Exit Fullscreen" : "Fullscreen"}
diff --git a/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx
index 69b11a30ed5..470658f4e52 100644
--- a/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx
+++ b/src/Components/Facility/ConsultationDetails/ConsultationInvestigationsTab.tsx
@@ -23,7 +23,7 @@ export const ConsultationInvestigationsTab = (props: ConsultationTabProps) => {
)
}
>
-
+
{t("log_lab_results")}
diff --git a/src/Components/Facility/ConsultationDetails/index.tsx b/src/Components/Facility/ConsultationDetails/index.tsx
index b422fc8867d..6ce75c6ed70 100644
--- a/src/Components/Facility/ConsultationDetails/index.tsx
+++ b/src/Components/Facility/ConsultationDetails/index.tsx
@@ -228,7 +228,7 @@ export const ConsultationDetails = (props: any) => {
// {diagnosis.label}
//
//
- //
+ //
//
//
//
diff --git a/src/Components/Facility/ConsultationDoctorNotes/index.tsx b/src/Components/Facility/ConsultationDoctorNotes/index.tsx
index cf0f78a39bb..9d2af1461c1 100644
--- a/src/Components/Facility/ConsultationDoctorNotes/index.tsx
+++ b/src/Components/Facility/ConsultationDoctorNotes/index.tsx
@@ -143,7 +143,7 @@ const ConsultationDoctorNotes = (props: ConsultationDoctorNotesProps) => {
disabled={!patientActive}
authorizeFor={NonReadOnlyUsers}
>
-
+
diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx
index 70e78ccb3c8..ea49f24871b 100644
--- a/src/Components/Facility/ConsultationForm.tsx
+++ b/src/Components/Facility/ConsultationForm.tsx
@@ -267,26 +267,26 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
const sections = {
"Consultation Details": {
- iconClass: "care-l-medkit",
+ iconClass: "l-medkit",
visible: consultationDetailsVisible,
ref: consultationDetailsRef,
},
Diagnosis: {
- iconClass: "care-l-stethoscope",
+ iconClass: "l-stethoscope",
visible: diagnosisVisible,
ref: diagnosisRef,
},
"Treatment Plan": {
- iconClass: "care-l-clipboard-alt",
+ iconClass: "l-clipboard-alt",
visible: treatmentPlanVisible,
ref: treatmentPlanRef,
},
"Bed Status": {
- iconClass: "care-l-bed",
+ iconClass: "l-bed",
visible: bedStatusVisible,
ref: bedStatusRef,
},
- };
+ } as const;
useEffect(() => {
setCurrentSection((prev) => {
@@ -838,7 +838,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
className="col-span-6 -ml-2 mb-6 flex flex-row items-center"
ref={section.ref as LegacyRef}
>
-
+
-
+
@@ -278,7 +278,7 @@ function UserListItem(props: { user: UserAssignedModel }) {
Copy Phone number
-
+
{user.alt_phone_number}
diff --git a/src/Components/Facility/FacilityCard.tsx b/src/Components/Facility/FacilityCard.tsx
index 6305fec69cf..31627259fbb 100644
--- a/src/Components/Facility/FacilityCard.tsx
+++ b/src/Components/Facility/FacilityCard.tsx
@@ -110,7 +110,10 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
border
ghost
>
-
+
View CNS
@@ -180,8 +183,9 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
Live Patients / Total beds
{" "}
0.85
? "text-white"
: "text-primary-600"
@@ -241,7 +245,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
className="h-[38px]"
onClick={(_) => setNotifyModalFor(facility.id)}
>
-
+
Notify
)}
@@ -252,7 +256,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
ghost
className="h-[38px]"
>
-
+
{t("view_faciliy")}
@@ -263,7 +267,7 @@ export const FacilityCard = (props: { facility: any; userType: any }) => {
border
ghost
>
-
+
{t("view_patients")}
{/* */}
diff --git a/src/Components/Facility/FacilityCreate.tsx b/src/Components/Facility/FacilityCreate.tsx
index f52df5e95ee..ab711058204 100644
--- a/src/Components/Facility/FacilityCreate.tsx
+++ b/src/Components/Facility/FacilityCreate.tsx
@@ -752,7 +752,7 @@ export const FacilityCreate = (props: FacilityProps) => {
/>
{showAutoFilledPincode && (
-
+
State and district auto-filled from pincode
@@ -930,7 +930,7 @@ export const FacilityCreate = (props: FacilityProps) => {
id="facility-location-button"
className="tooltip p-2"
>
-
+
Select location from map
diff --git a/src/Components/Facility/FacilityHome.tsx b/src/Components/Facility/FacilityHome.tsx
index 1c6feee2383..0f068e72aed 100644
--- a/src/Components/Facility/FacilityHome.tsx
+++ b/src/Components/Facility/FacilityHome.tsx
@@ -38,7 +38,7 @@ export const getFacilityFeatureIcon = (featureId: number) => {
const feature = FACILITY_FEATURE_TYPES.find((f) => f.id === featureId);
if (!feature?.icon) return null;
return typeof feature.icon === "string" ? (
-
+
) : (
feature.icon
);
@@ -315,13 +315,13 @@ export const FacilityHome = (props: any) => {
}
+ icon={}
>
navigate(`/facility/${facilityId}/update`)}
authorizeFor={NonReadOnlyUsers}
- icon={}
+ icon={}
>
Update Facility
@@ -329,14 +329,14 @@ export const FacilityHome = (props: any) => {
id="configure-facility"
onClick={() => navigate(`/facility/${facilityId}/configure`)}
authorizeFor={NonReadOnlyUsers}
- icon={}
+ icon={}
>
Configure Facility
navigate(`/facility/${facilityId}/inventory`)}
- icon={}
+ icon={}
>
Inventory Management
@@ -344,7 +344,9 @@ export const FacilityHome = (props: any) => {
id="location-management"
onClick={() => navigate(`/facility/${facilityId}/location`)}
authorizeFor={NonReadOnlyUsers}
- icon={}
+ icon={
+
+ }
>
Location Management
@@ -354,7 +356,7 @@ export const FacilityHome = (props: any) => {
navigate(`/facility/${facilityId}/resource/new`)
}
authorizeFor={NonReadOnlyUsers}
- icon={}
+ icon={}
>
Resource Request
@@ -362,21 +364,21 @@ export const FacilityHome = (props: any) => {
id="create-assets"
onClick={() => navigate(`/facility/${facilityId}/assets/new`)}
authorizeFor={NonReadOnlyUsers}
- icon={}
+ icon={}
>
Create Asset
navigate(`/assets?facility=${facilityId}`)}
- icon={}
+ icon={}
>
View Assets
navigate(`/facility/${facilityId}/users`)}
- icon={}
+ icon={}
>
View Users
@@ -386,7 +388,7 @@ export const FacilityHome = (props: any) => {
variant="danger"
onClick={() => setOpenDeleteDialog(true)}
className="flex items-center gap-3"
- icon={}
+ icon={}
>
Delete Facility
@@ -402,7 +404,7 @@ export const FacilityHome = (props: any) => {
className="mt-2 flex w-full flex-row justify-center md:w-auto"
onClick={() => navigate(`/facility/${facilityId}/cns`)}
>
-
+
Central Nursing Station
@@ -414,7 +416,7 @@ export const FacilityHome = (props: any) => {
onClick={() => navigate(`/facility/${facilityId}/patient`)}
authorizeFor={NonReadOnlyUsers}
>
-
+
Add Details of a Patient
{
className="mt-2 flex w-full flex-row justify-center md:w-auto"
onClick={() => navigate(`/patients?facility=${facilityId}`)}
>
-
+
View Patients
{
navigate(`/facility/${facilityId}/discharged-patients`)
}
>
-
+
View Discharged Patients
diff --git a/src/Components/Facility/FacilityUsers.tsx b/src/Components/Facility/FacilityUsers.tsx
index 2985649a543..781dbad9e40 100644
--- a/src/Components/Facility/FacilityUsers.tsx
+++ b/src/Components/Facility/FacilityUsers.tsx
@@ -221,7 +221,7 @@ export default function FacilityUsers(props: any) {
})
}
>
-
+
diff --git a/src/Components/Facility/InventoryLog.tsx b/src/Components/Facility/InventoryLog.tsx
index 96dd564d53c..0d8673e6d01 100644
--- a/src/Components/Facility/InventoryLog.tsx
+++ b/src/Components/Facility/InventoryLog.tsx
@@ -139,7 +139,10 @@ export default function InventoryLog(props: any) {
variant="primary"
>
-
+
UnMark
@@ -150,7 +153,10 @@ export default function InventoryLog(props: any) {
variant="danger"
>
-
+
Mark as Accident
@@ -244,7 +250,10 @@ export default function InventoryLog(props: any) {
disabled={saving}
>
-
+
Delete Last Entry
diff --git a/src/Components/Facility/Investigations/InvestigationSuggestions.tsx b/src/Components/Facility/Investigations/InvestigationSuggestions.tsx
index 5e43d13e07e..8bd884831b7 100644
--- a/src/Components/Facility/Investigations/InvestigationSuggestions.tsx
+++ b/src/Components/Facility/Investigations/InvestigationSuggestions.tsx
@@ -182,7 +182,7 @@ export default function ViewInvestigationSuggestions(props: {
investigation.type?.join("_-_")
}
>
-
+
Log Report
@@ -305,7 +305,7 @@ export default function ViewInvestigationSuggestions(props: {
investigation.type?.join("_-_")
}
>
-
+
Log Report
)}
diff --git a/src/Components/Facility/Investigations/InvestigationTable.tsx b/src/Components/Facility/Investigations/InvestigationTable.tsx
index d322698779d..7f56bff21ef 100644
--- a/src/Components/Facility/Investigations/InvestigationTable.tsx
+++ b/src/Components/Facility/Investigations/InvestigationTable.tsx
@@ -101,7 +101,7 @@ export const InvestigationTable = ({
setShowForm((prev) => !prev);
}}
>
- {!showForm && }
+ {!showForm && }
{showForm ? "Cancel" : "Update Details"}
{showForm && (
diff --git a/src/Components/Facility/LocationManagement.tsx b/src/Components/Facility/LocationManagement.tsx
index c6578958ac5..06e0de28d62 100644
--- a/src/Components/Facility/LocationManagement.tsx
+++ b/src/Components/Facility/LocationManagement.tsx
@@ -267,7 +267,7 @@ const Location = ({
className="mt-3 w-full"
href={`location/${id}/beds`}
>
-
+
Manage Beds
@@ -280,7 +280,7 @@ const Location = ({
href={`location/${id}/update`}
authorizeFor={NonReadOnlyUsers}
>
-
+
Edit
@@ -295,7 +295,7 @@ const Location = ({
}
authorizeFor={NonReadOnlyUsers}
>
-
+
Delete
diff --git a/src/Components/Facility/PatientNotesSlideover.tsx b/src/Components/Facility/PatientNotesSlideover.tsx
index 2e04312d277..b3fe50f7c4c 100644
--- a/src/Components/Facility/PatientNotesSlideover.tsx
+++ b/src/Components/Facility/PatientNotesSlideover.tsx
@@ -140,7 +140,10 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
className="flex h-8 w-8 cursor-pointer items-center justify-center rounded bg-primary-800 text-gray-100 text-opacity-70 hover:bg-primary-700 hover:text-opacity-100"
href={`/facility/${facilityId}/patient/${patientId}/consultation/${consultationId}/notes`}
>
-
+
)}
setShow(!show)}
>
-
+
setShowPatientNotesPopup(false)}
>
-
+
);
@@ -223,7 +232,7 @@ export default function PatientNotesSlideover(props: PatientNotesProps) {
disabled={!patientActive}
authorizeFor={NonReadOnlyUsers}
>
-
+
diff --git a/src/Components/Facility/TriageForm.tsx b/src/Components/Facility/TriageForm.tsx
index 32971f1d302..b4d50a73cec 100644
--- a/src/Components/Facility/TriageForm.tsx
+++ b/src/Components/Facility/TriageForm.tsx
@@ -203,7 +203,10 @@ export const TriageForm = ({ facilityId, id }: Props) => {
-
+
A Triage already exist on this date
}
diff --git a/src/Components/Form/AutoCompleteAsync.tsx b/src/Components/Form/AutoCompleteAsync.tsx
index 4ad68e96d73..762c9f2d136 100644
--- a/src/Components/Form/AutoCompleteAsync.tsx
+++ b/src/Components/Form/AutoCompleteAsync.tsx
@@ -109,7 +109,8 @@ const AutoCompleteAsync = (props: Props) => {
{hasSelection && !loading && !required && (
{
e.preventDefault();
onChange(null);
@@ -121,9 +122,12 @@ const AutoCompleteAsync = (props: Props) => {
)}
{loading ? (
-
+
) : (
-
+
)}
@@ -155,7 +159,7 @@ const AutoCompleteAsync = (props: Props) => {
)}
{selected && (
-
+
)}
)}
diff --git a/src/Components/Form/FormFields/Autocomplete.tsx b/src/Components/Form/FormFields/Autocomplete.tsx
index bf3840b2c44..ec5c73024c3 100644
--- a/src/Components/Form/FormFields/Autocomplete.tsx
+++ b/src/Components/Form/FormFields/Autocomplete.tsx
@@ -121,7 +121,7 @@ export const Autocomplete = (props: AutocompleteProps) => {
label: query,
description: undefined,
search: query.toLowerCase(),
- icon: ,
+ icon: ,
value: query,
},
...mappedOptions,
@@ -168,7 +168,8 @@ export const Autocomplete = (props: AutocompleteProps) => {
{value && !props.isLoading && !props.required && (
{
e.preventDefault();
props.onChange(undefined);
@@ -181,9 +182,9 @@ export const Autocomplete = (props: AutocompleteProps) => {
)}
{props.isLoading ? (
-
+
) : (
-
+
)}
diff --git a/src/Components/Form/FormFields/AutocompleteMultiselect.tsx b/src/Components/Form/FormFields/AutocompleteMultiselect.tsx
index 9004dea939d..3dde6941795 100644
--- a/src/Components/Form/FormFields/AutocompleteMultiselect.tsx
+++ b/src/Components/Form/FormFields/AutocompleteMultiselect.tsx
@@ -123,9 +123,9 @@ export const AutocompleteMutliSelect = (
{props.isLoading ? (
-
+
) : (
-
+
)}
@@ -162,7 +162,7 @@ export const AutocompleteMutliSelect = (
Select All
{value.length === filteredOptions.length && (
-
+
)}
@@ -178,7 +178,7 @@ export const AutocompleteMutliSelect = (
{option.label}
{selected && (
-
+
)}
)}
@@ -187,7 +187,7 @@ export const AutocompleteMutliSelect = (
>
) : (
- {!query && }
+ {!query && }
{query ? "No results" : "Type to search"}
)}
@@ -202,7 +202,7 @@ export const AutocompleteMutliSelect = (
const Searching = () => {
return (
-
+
Searching...
);
diff --git a/src/Components/Form/FormFields/PhoneNumberFormField.tsx b/src/Components/Form/FormFields/PhoneNumberFormField.tsx
index 93ff4cf21eb..e86076d62af 100644
--- a/src/Components/Form/FormFields/PhoneNumberFormField.tsx
+++ b/src/Components/Form/FormFields/PhoneNumberFormField.tsx
@@ -14,7 +14,7 @@ import {
PhoneNumberValidator,
PhoneNumberType,
} from "../FieldValidators";
-import CareIcon from "../../../CAREUI/icons/CareIcon";
+import CareIcon, { IconName } from "../../../CAREUI/icons/CareIcon";
const phoneCodes: Record = phoneCodesJson;
@@ -115,9 +115,15 @@ export default function PhoneNumberFormField(props: Props) {
{country?.flag ?? "🇮🇳"}
{isOpen ? (
-
+
) : (
-
+
)}
@@ -146,12 +152,12 @@ export default function PhoneNumberFormField(props: Props) {
);
}
-const phoneNumberTypeIcons: Record = {
- international_mobile: "globe",
- indian_mobile: "mobile-android",
- mobile: "mobile-android",
- landline: "phone",
- support: "headset",
+const phoneNumberTypeIcons: Record = {
+ international_mobile: "l-globe",
+ indian_mobile: "l-mobile-android",
+ mobile: "l-mobile-android",
+ landline: "l-phone",
+ support: "l-headset",
};
const PhoneNumberTypesHelp = ({ types }: { types: PhoneNumberType[] }) => (
@@ -159,10 +165,8 @@ const PhoneNumberTypesHelp = ({ types }: { types: PhoneNumberType[] }) => (
{types.map((type) => (
{type.replace("_", " ")}
diff --git a/src/Components/Form/FormFields/TextFormField.tsx b/src/Components/Form/FormFields/TextFormField.tsx
index 773dddc034b..3f814f27fc1 100644
--- a/src/Components/Form/FormFields/TextFormField.tsx
+++ b/src/Components/Form/FormFields/TextFormField.tsx
@@ -76,7 +76,7 @@ const TextFormField = forwardRef((props: TextFormFieldProps, ref) => {
className="z-5 absolute right-0 top-0 flex h-full items-center px-3 text-xl"
onClick={() => setShowPassword(!showPassword)}
>
-
+
);
diff --git a/src/Components/Form/MultiSelectMenuV2.tsx b/src/Components/Form/MultiSelectMenuV2.tsx
index 7a976b86bb7..96d7f65f8d0 100644
--- a/src/Components/Form/MultiSelectMenuV2.tsx
+++ b/src/Components/Form/MultiSelectMenuV2.tsx
@@ -122,7 +122,10 @@ const MultiSelectMenuV2 = (props: Props) => {
)}
-
+
@@ -142,7 +145,7 @@ const MultiSelectMenuV2 = (props: Props) => {
{option.label}
{(option.icon || option.isSelected) &&
(option.isSelected ? (
-
+
) : (
option.icon
))}
@@ -186,7 +189,7 @@ export const MultiSelectOptionChip = (props: MultiSelectOptionChipProps) => {
className="cursor-pointer rounded-full hover:bg-white"
onClick={props.onRemove}
>
-
+
)}
diff --git a/src/Components/Form/SearchInput.tsx b/src/Components/Form/SearchInput.tsx
index 40855b8b9a6..146cd0d9b4b 100644
--- a/src/Components/Form/SearchInput.tsx
+++ b/src/Components/Form/SearchInput.tsx
@@ -73,7 +73,7 @@ const SearchInput = ({
className={className}
leading={
props.leading || (
-
+
)
}
trailing={
diff --git a/src/Components/Form/SelectMenuV2.tsx b/src/Components/Form/SelectMenuV2.tsx
index 2e277b40b4f..640f3163b9d 100644
--- a/src/Components/Form/SelectMenuV2.tsx
+++ b/src/Components/Form/SelectMenuV2.tsx
@@ -106,7 +106,10 @@ const SelectMenuV2 = (props: SelectMenuProps) => {
{showChevronIcon && (
-
+
)}
@@ -132,7 +135,10 @@ const SelectMenuV2 = (props: SelectMenuProps) => {
{props.optionIcon
? option.icon
: selected && (
-
+
)}
{option.description && (
diff --git a/src/Components/HCX/ClaimCreatedModal.tsx b/src/Components/HCX/ClaimCreatedModal.tsx
index 0b2e4703177..5148792e09e 100644
--- a/src/Components/HCX/ClaimCreatedModal.tsx
+++ b/src/Components/HCX/ClaimCreatedModal.tsx
@@ -41,7 +41,7 @@ export default function ClaimCreatedModal({ claim, ...props }: Props) {
titleAction={
{isMakingClaim && (
-
+
)}
{isMakingClaim
? `Requesting ${use === "Claim" ? "Claim" : "Pre-Authorization"}...`
diff --git a/src/Components/HCX/ClaimsItemsBuilder.tsx b/src/Components/HCX/ClaimsItemsBuilder.tsx
index 867f302a89e..42f1bc08cc8 100644
--- a/src/Components/HCX/ClaimsItemsBuilder.tsx
+++ b/src/Components/HCX/ClaimsItemsBuilder.tsx
@@ -70,7 +70,7 @@ export default function ClaimsItemsBuilder(props: Props) {
disabled={props.disabled}
>
Delete
-
+
)}
diff --git a/src/Components/HCX/CreateClaimCard.tsx b/src/Components/HCX/CreateClaimCard.tsx
index 755c2865747..1d3b3dc4933 100644
--- a/src/Components/HCX/CreateClaimCard.tsx
+++ b/src/Components/HCX/CreateClaimCard.tsx
@@ -153,7 +153,7 @@ export default function CreateClaimCard({
Check Insurance Policy Eligibility
setShowAddPolicy(true)} ghost border>
-
+
Edit Patient Insurance Details
@@ -177,7 +177,7 @@ export default function CreateClaimCard({
setItems([...(items ?? []), { name: "", id: "", price: 0 }])
}
>
-
+
Add Item
@@ -229,7 +229,7 @@ export default function CreateClaimCard({
onClick={handleSubmit}
className="min-w-[200px]"
>
- {isCreating && }
+ {isCreating && }
{isCreating
? `Creating ${use === "claim" ? "Claim" : "Pre-Authorization"}...`
: "Proceed"}
diff --git a/src/Components/HCX/InsuranceDetailsBuilder.tsx b/src/Components/HCX/InsuranceDetailsBuilder.tsx
index 36713e317a2..c507566a259 100644
--- a/src/Components/HCX/InsuranceDetailsBuilder.tsx
+++ b/src/Components/HCX/InsuranceDetailsBuilder.tsx
@@ -105,7 +105,7 @@ const InsuranceDetailEditCard = ({
Policy
Delete
-
+
diff --git a/src/Components/HCX/PatientInsuranceDetailsEditor.tsx b/src/Components/HCX/PatientInsuranceDetailsEditor.tsx
index c11d2266aba..952ee29e6e7 100644
--- a/src/Components/HCX/PatientInsuranceDetailsEditor.tsx
+++ b/src/Components/HCX/PatientInsuranceDetailsEditor.tsx
@@ -111,7 +111,7 @@ export default function PatientInsuranceDetailsEditor({
])
}
>
-
+
Add Insurance Details
@@ -119,7 +119,7 @@ export default function PatientInsuranceDetailsEditor({
{isUpdating ? (
<>
-
+
Updating...
>
) : (
diff --git a/src/Components/HCX/PolicyEligibilityCheck.tsx b/src/Components/HCX/PolicyEligibilityCheck.tsx
index 42aa3caa87d..a21b3ce611a 100644
--- a/src/Components/HCX/PolicyEligibilityCheck.tsx
+++ b/src/Components/HCX/PolicyEligibilityCheck.tsx
@@ -160,7 +160,7 @@ export default function HCXPolicyEligibilityCheck({
>
{isChecking ? (
<>
-
+
Checking ...
>
) : (
@@ -179,9 +179,7 @@ const EligibilityChip = ({ eligible }: { eligible: boolean }) => {
eligible ? "bg-primary-100 text-primary-500" : "bg-red-500 text-white"
}`}
>
-
+
{eligible ? "Eligible" : "Not Eligible"}
diff --git a/src/Components/Medicine/AdministerMedicine.tsx b/src/Components/Medicine/AdministerMedicine.tsx
index 12b7be3e0da..f7353051ea7 100644
--- a/src/Components/Medicine/AdministerMedicine.tsx
+++ b/src/Components/Medicine/AdministerMedicine.tsx
@@ -37,16 +37,16 @@ export default function AdministerMedicine({ prescription, ...props }: Props) {
-
+
{t("administer_medicine")}
>
}
title={t("administer_medicine")}
description={
- Last administered
+ Last administered
- {" "}
+ {" "}
{prescription.last_administration?.administered_date
? formatDateTime(
prescription.last_administration.administered_date
@@ -55,12 +55,12 @@ export default function AdministerMedicine({ prescription, ...props }: Props) {
{prescription.dosage_type === "TITRATED" && (
- {t("dosage")}
+ {t("dosage")}
{":"} {prescription.last_administration?.dosage ?? "NA"}
)}
- Administered by:{" "}
+ Administered by:{" "}
{prescription.last_administration?.administered_by?.username ??
"NA"}
diff --git a/src/Components/Medicine/ManagePrescriptions.tsx b/src/Components/Medicine/ManagePrescriptions.tsx
index 16e8ffedcb2..12ed0712533 100644
--- a/src/Components/Medicine/ManagePrescriptions.tsx
+++ b/src/Components/Medicine/ManagePrescriptions.tsx
@@ -33,11 +33,11 @@ export default function ManagePrescriptions() {
onClick={() => goBack()}
data-testid="return-to-patient-dashboard"
>
-
+
{t("return_to_patient_dashboard")}
-
+
{t("all_changes_have_been_saved")}
diff --git a/src/Components/Medicine/MedicineAdministration.tsx b/src/Components/Medicine/MedicineAdministration.tsx
index 23aef4b4dd1..44bbe436618 100644
--- a/src/Components/Medicine/MedicineAdministration.tsx
+++ b/src/Components/Medicine/MedicineAdministration.tsx
@@ -126,7 +126,7 @@ export default function MedicineAdministration(props: Props) {
errorClassName="hidden"
/>
-
{" "}
+
{" "}
{t("last_administered")}
{obj.last_administration?.administered_date
@@ -135,7 +135,7 @@ export default function MedicineAdministration(props: Props) {
{obj.dosage_type === "TITRATED" && (
- {t("dosage")}
+ {t("dosage")}
{":"} {obj.last_administration?.dosage ?? "NA"}
)}
@@ -224,7 +224,7 @@ export default function MedicineAdministration(props: Props) {
))}
-
+
{t("administer_selected_medicines")}{" "}
{selectedCount > 0 && `(${selectedCount})`}
diff --git a/src/Components/Medicine/MedicineAdministrationSheet/AdministrationTableRow.tsx b/src/Components/Medicine/MedicineAdministrationSheet/AdministrationTableRow.tsx
index 7a1542b43ae..98bffe81804 100644
--- a/src/Components/Medicine/MedicineAdministrationSheet/AdministrationTableRow.tsx
+++ b/src/Components/Medicine/MedicineAdministrationSheet/AdministrationTableRow.tsx
@@ -129,7 +129,7 @@ export default function MedicineAdministrationTableRow({
}
onClick={() => setShowAdminister(true)}
>
-
+
{t("administer")}
diff --git a/src/Components/Medicine/PrescriptionBuilder.tsx b/src/Components/Medicine/PrescriptionBuilder.tsx
index 998b96f3315..4dcc2603122 100644
--- a/src/Components/Medicine/PrescriptionBuilder.tsx
+++ b/src/Components/Medicine/PrescriptionBuilder.tsx
@@ -83,7 +83,7 @@ export default function PrescriptionBuilder({
disabled={disabled}
>
-
+
{t(is_prn ? "add_prn_prescription" : "add_prescription_medication")}
@@ -98,7 +98,7 @@ export default function PrescriptionBuilder({
)}
description={
-
+
{t("modification_caution_note")}
}
diff --git a/src/Components/Medicine/PrescriptionDetailCard.tsx b/src/Components/Medicine/PrescriptionDetailCard.tsx
index 7112f75d598..773c5df6d33 100644
--- a/src/Components/Medicine/PrescriptionDetailCard.tsx
+++ b/src/Components/Medicine/PrescriptionDetailCard.tsx
@@ -66,7 +66,7 @@ export default function PrescriptionDetailCard({
ghost
border
>
-
+
{t("administer")}
-
+
{t("discontinue")}
diff --git a/src/Components/Medicine/PrescriptionsTable.tsx b/src/Components/Medicine/PrescriptionsTable.tsx
index 6cedc4ec29c..79ddac3e5cb 100644
--- a/src/Components/Medicine/PrescriptionsTable.tsx
+++ b/src/Components/Medicine/PrescriptionsTable.tsx
@@ -119,7 +119,7 @@ export default function PrescriptionsTable({
variant="danger"
onClick={() => setShowDiscontinueFor(detailedViewFor)}
>
-
+
{t("discontinue")}
setShowAdministerFor(detailedViewFor)}
>
-
+
{t("administer")}
@@ -142,7 +142,7 @@ export default function PrescriptionsTable({
{is_prn ? "PRN Prescriptions" : "Prescriptions"}
-
+
{lastModified && formatDateTime(lastModified)}
@@ -157,7 +157,7 @@ export default function PrescriptionsTable({
href="prescriptions"
className="w-full lg:w-auto"
>
-
+
{t("edit_prescriptions")}
{t("edit")}
@@ -168,7 +168,7 @@ export default function PrescriptionsTable({
onClick={() => setShowBulkAdminister(true)}
className="w-full lg:w-auto"
>
-
+
{t("administer_medicines")}
@@ -225,7 +225,7 @@ export default function PrescriptionsTable({
if (med.discontinued) {
return (
-
+
{t("discontinued")}
);
@@ -244,7 +244,7 @@ export default function PrescriptionsTable({
setShowAdministerFor(med);
}}
>
-
+
{t("administer")}
-
+
{t("discontinue")}
diff --git a/src/Components/Notifications/NoticeBoard.tsx b/src/Components/Notifications/NoticeBoard.tsx
index 8ad3afba0f8..7835f8576b7 100644
--- a/src/Components/Notifications/NoticeBoard.tsx
+++ b/src/Components/Notifications/NoticeBoard.tsx
@@ -42,7 +42,7 @@ export const NoticeBoard = () => {
notices = (
-
+
No Notice Available
diff --git a/src/Components/Notifications/NotificationsList.tsx b/src/Components/Notifications/NotificationsList.tsx
index 1ce23dafdbc..95093743080 100644
--- a/src/Components/Notifications/NotificationsList.tsx
+++ b/src/Components/Notifications/NotificationsList.tsx
@@ -121,11 +121,8 @@ const NotificationTile = ({
}}
>
{t("mark_as_read")}
@@ -134,7 +131,7 @@ const NotificationTile = ({
ghost
className="shrink-0 bg-white px-2 py-1 font-semibold hover:bg-secondary-300"
>
-
+
{t("open")}
@@ -212,21 +209,21 @@ export default function NotificationsList({
if (status === "NotSubscribed") {
return (
<>
-
+
{t("subscribe")}
>
);
} else if (status === "SubscribedOnAnotherDevice") {
return (
<>
-
+
{t("subscribe_on_this_device")}
>
);
} else {
return (
<>
-
+
{t("unsubscribe")}
>
);
@@ -414,7 +411,7 @@ export default function NotificationsList({
- setOpen(!open)}
- icon={}
+ icon={}
badgeCount={unreadCount}
handleOverflow={handleOverflow}
/>
@@ -438,7 +435,7 @@ export default function NotificationsList({
setOffset(0);
}}
>
-
+
{t("reload")}
{t("mark_all_as_read")}
@@ -470,9 +464,7 @@ export default function NotificationsList({
variant="secondary"
onClick={() => setShowUnread(!showUnread)}
>
-
+
{showUnread
diff --git a/src/Components/Patient/FileUpload.tsx b/src/Components/Patient/FileUpload.tsx
index 804dedcde10..6e6d289d187 100644
--- a/src/Components/Patient/FileUpload.tsx
+++ b/src/Components/Patient/FileUpload.tsx
@@ -629,7 +629,10 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="m-1 w-full sm:w-auto"
>
- {" "}
+ {" "}
DOWNLOAD
{item?.uploaded_by?.username === authUser.username ||
@@ -647,7 +650,7 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="m-1 w-full sm:w-auto"
>
-
+
RENAME
>
@@ -669,7 +672,7 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="m-1 w-full sm:w-auto"
>
-
+
ARCHIVE
>
@@ -762,7 +765,7 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="m-1 w-full sm:w-auto"
>
-
+
RENAME
>
@@ -782,7 +785,7 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="m-1 w-full sm:w-auto"
>
-
+
ARCHIVE
>
@@ -872,7 +875,8 @@ export const FileUpload = (props: FileUploadProps) => {
{" "}
- FILE ARCHIVED
+ FILE
+ ARCHIVED
{
@@ -886,7 +890,7 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="m-1 w-full sm:w-auto"
>
-
+
MORE DETAILS
@@ -1144,7 +1148,10 @@ export const FileUpload = (props: FileUploadProps) => {
title={
-
+
Camera
@@ -1239,7 +1246,7 @@ export const FileUpload = (props: FileUploadProps) => {
-
+
{`${t("switch")} ${t("camera")}`}
@@ -1254,7 +1261,7 @@ export const FileUpload = (props: FileUploadProps) => {
captureImage();
}}
>
-
+
{t("capture")}
@@ -1299,7 +1306,10 @@ export const FileUpload = (props: FileUploadProps) => {
title={
-
+
Rename File
@@ -1343,7 +1353,10 @@ export const FileUpload = (props: FileUploadProps) => {
title={
-
+
Archive File
@@ -1390,7 +1403,10 @@ export const FileUpload = (props: FileUploadProps) => {
title={
-
+
File Details
@@ -1464,7 +1480,7 @@ export const FileUpload = (props: FileUploadProps) => {
deleteAudioBlob();
}}
>
- Delete
+ Delete
)}
@@ -1477,7 +1493,10 @@ export const FileUpload = (props: FileUploadProps) => {
/>
{!audioBlobExists && (
-
+
Please allow browser permission before you start
speaking
@@ -1491,7 +1510,7 @@ export const FileUpload = (props: FileUploadProps) => {
}}
className="w-full"
>
-
+
Save
@@ -1526,7 +1545,10 @@ export const FileUpload = (props: FileUploadProps) => {
{({ isAuthorized }) =>
isAuthorized ? (
diff --git a/src/Components/Patient/ManagePatients.tsx b/src/Components/Patient/ManagePatients.tsx
index d08b1ea94b8..ff3dede4072 100644
--- a/src/Components/Patient/ManagePatients.tsx
+++ b/src/Components/Patient/ManagePatients.tsx
@@ -505,7 +505,10 @@ export const PatientManager = () => {
) : patient.last_consultation?.suggestion === "DC" ? (
-
+
Domiciliary Care
@@ -747,7 +750,7 @@ export const PatientManager = () => {
}}
className="w-full lg:w-fit"
>
-
+
Add Patient Details
@@ -793,7 +796,7 @@ export const PatientManager = () => {
setShowDoctors(true);
}}
>
-
+
Doctor Connect
)}
@@ -823,7 +826,7 @@ export const PatientManager = () => {
}}
className="mr-5 w-full lg:w-fit"
>
-
+
Export
) : (
diff --git a/src/Components/Patient/PatientFilter.tsx b/src/Components/Patient/PatientFilter.tsx
index 6392c5c4d45..0275710444a 100644
--- a/src/Components/Patient/PatientFilter.tsx
+++ b/src/Components/Patient/PatientFilter.tsx
@@ -599,7 +599,7 @@ export default function PatientFilter(props: any) {
setFilterState({ ...filterState, facility_type: v })
}
optionIcon={() => (
-
+
)}
/>
@@ -675,7 +675,7 @@ export default function PatientFilter(props: any) {
optionValue={({ id }) => id}
optionIcon={({ id }) => (
<>
-
+
{id}
>
)}
diff --git a/src/Components/Patient/PatientHome.tsx b/src/Components/Patient/PatientHome.tsx
index 59ec27b3c36..5c151553379 100644
--- a/src/Components/Patient/PatientHome.tsx
+++ b/src/Components/Patient/PatientHome.tsx
@@ -649,7 +649,7 @@ export const PatientHome = (props: any) => {
)
}
>
-
+
Update Details
@@ -666,7 +666,7 @@ export const PatientHome = (props: any) => {
}
authorizeFor={NonReadOnlyUsers}
>
-
+
{patientData.allow_transfer
? "Disable Transfer"
: "Allow Transfer"}
@@ -686,9 +686,9 @@ export const PatientHome = (props: any) => {
>
Shifting
{showShifts ? (
-
+
) : (
-
+
)}
{
title="Shifting status"
className="flex items-center text-sm font-semibold leading-5 text-zinc-400"
>
-
+
{shift.status}
@@ -739,7 +742,10 @@ export const PatientHome = (props: any) => {
title=" Origin facility"
className="flex items-center text-sm font-semibold leading-5 text-zinc-400"
>
-
+
{(shift.origin_facility_object || {})?.name}
@@ -750,7 +756,10 @@ export const PatientHome = (props: any) => {
title="Shifting approving facility"
className="flex items-center text-sm font-semibold leading-5 text-zinc-400"
>
-
+
{
(
@@ -766,7 +775,10 @@ export const PatientHome = (props: any) => {
title=" Assigned facility"
className="flex items-center text-sm font-semibold leading-5 text-zinc-400"
>
-
+
{(shift.assigned_facility_object || {})?.name ||
"Yet to be decided"}
@@ -786,7 +798,10 @@ export const PatientHome = (props: any) => {
: "rounded p-1 font-normal text-red-600")
}
>
-
+
{formatDateTime(shift.modified_date) || "--"}
@@ -802,7 +817,7 @@ export const PatientHome = (props: any) => {
navigate(`/shifting/${shift.external_id}`)
}
>
-
+
All Details
@@ -1030,7 +1045,10 @@ export const PatientHome = (props: any) => {
)}
>
-
+
@@ -1048,7 +1066,7 @@ export const PatientHome = (props: any) => {
-
+
@@ -1069,7 +1087,7 @@ export const PatientHome = (props: any) => {
-
+
@@ -1102,7 +1120,7 @@ export const PatientHome = (props: any) => {
} text-center `}
>
-
+
@@ -1144,7 +1162,7 @@ export const PatientHome = (props: any) => {
} text-center `}
>
-
+
@@ -1170,7 +1188,7 @@ export const PatientHome = (props: any) => {
-
+
@@ -1205,7 +1223,7 @@ export const PatientHome = (props: any) => {
)}
>
-
+
@@ -1244,7 +1262,7 @@ export const PatientHome = (props: any) => {
}
>
-
+
Add Consultation
@@ -1257,7 +1275,7 @@ export const PatientHome = (props: any) => {
}
>
-
+
Investigations Summary
@@ -1272,7 +1290,7 @@ export const PatientHome = (props: any) => {
}
>
-
+
View/Upload Patient Files
@@ -1289,7 +1307,7 @@ export const PatientHome = (props: any) => {
authorizeFor={NonReadOnlyUsers}
>
-
+
Shift Patient
@@ -1306,7 +1324,7 @@ export const PatientHome = (props: any) => {
authorizeFor={NonReadOnlyUsers}
>
-
+
Request Sample Test
@@ -1321,7 +1339,7 @@ export const PatientHome = (props: any) => {
}
>
-
+
View Patient Notes
@@ -1334,7 +1352,7 @@ export const PatientHome = (props: any) => {
authorizeFor={NonReadOnlyUsers}
>
-
+
Assign to a volunteer
diff --git a/src/Components/Patient/PatientInfoCard.tsx b/src/Components/Patient/PatientInfoCard.tsx
index e91ce645626..eab3cd5f28f 100644
--- a/src/Components/Patient/PatientInfoCard.tsx
+++ b/src/Components/Patient/PatientInfoCard.tsx
@@ -324,7 +324,10 @@ export default function PatientInfoCard(props: {
@@ -525,7 +528,7 @@ export default function PatientInfoCard(props: {
className="w-full"
>
-
+
Log Update
@@ -537,8 +540,8 @@ export default function PatientInfoCard(props: {
<>
- {" "}
- No update filed in the last 24 hours
+ No update
+ filed in the last 24 hours
>
@@ -558,7 +561,7 @@ export default function PatientInfoCard(props: {
[
`/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/update`,
"Edit Consultation Details",
- "pen",
+ "l-pen",
patient.is_active &&
consultation?.id &&
!consultation?.discharge_date,
@@ -566,13 +569,13 @@ export default function PatientInfoCard(props: {
[
`/patient/${patient.id}/investigation_reports`,
"Investigation Summary",
- "align-alt",
+ "l-align-alt",
true,
],
[
`/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/treatment-summary`,
"Treatment Summary",
- "file-medical",
+ "l-file-medical",
consultation?.id,
],
]
@@ -582,7 +585,7 @@ export default function PatientInfoCard(props: {
[
`/facility/${patient.facility}/patient/${patient.id}/consultation/${consultation?.id}/claims`,
"Claims",
- "copy-landscape",
+ "l-copy-landscape",
consultation?.id,
],
]
@@ -623,7 +626,8 @@ export default function PatientInfoCard(props: {
}}
>
{action[1]}
@@ -658,7 +662,10 @@ export default function PatientInfoCard(props: {
});
}}
>
-
+
Show ABHA Profile
-
+
Link Care Context
>
@@ -691,7 +701,10 @@ export default function PatientInfoCard(props: {
}}
>
-
+
Link ABHA Number
@@ -719,7 +732,10 @@ export default function PatientInfoCard(props: {
}}
>
-
+
Track Shifting
@@ -734,7 +750,10 @@ export default function PatientInfoCard(props: {
}}
>
-
+
Shift Patient
@@ -753,7 +772,10 @@ export default function PatientInfoCard(props: {
}}
>
-
+
{t("discharge_summary")}
@@ -775,7 +797,8 @@ export default function PatientInfoCard(props: {
>
{
disabled={!patientActive}
authorizeFor={NonReadOnlyUsers}
>
-
+
diff --git a/src/Components/Patient/PatientRegister.tsx b/src/Components/Patient/PatientRegister.tsx
index eb6c7104c04..85a5002f8da 100644
--- a/src/Components/Patient/PatientRegister.tsx
+++ b/src/Components/Patient/PatientRegister.tsx
@@ -1074,7 +1074,10 @@ export const PatientRegister = (props: PatientRegisterProps) => {
- {" "}
+ {" "}
Please enter the correct date of birth for the patient
@@ -1176,7 +1179,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
setQuery({ extId: "" }, { replace: true });
}}
>
-
+
Import From External Results
@@ -1560,7 +1563,10 @@ export const PatientRegister = (props: PatientRegisterProps) => {
+
}
title={
@@ -1894,7 +1900,7 @@ export const PatientRegister = (props: PatientRegisterProps) => {
}
data-testid="add-insurance-button"
>
-
+
Add Insurance Details
diff --git a/src/Components/Patient/SampleViewAdmin.tsx b/src/Components/Patient/SampleViewAdmin.tsx
index 122f82aa7e2..431fc09a317 100644
--- a/src/Components/Patient/SampleViewAdmin.tsx
+++ b/src/Components/Patient/SampleViewAdmin.tsx
@@ -199,7 +199,10 @@ export default function SampleViewAdmin() {
Contact:{" "}
Confirmed carrier
-
+
)}
{item.patient_has_suspected_contact &&
@@ -209,7 +212,10 @@ export default function SampleViewAdmin() {
Contact:{" "}
Suspected carrier
-
+
)}
{item.has_sari && (
@@ -218,14 +224,20 @@ export default function SampleViewAdmin() {
SARI:{" "}
Severe Acute Respiratory illness
-
+
)}
{item.has_ari && !item.has_sari && (
ARI:
Acute Respiratory illness
-
+
)}
diff --git a/src/Components/Patient/UpdateStatusDialog.tsx b/src/Components/Patient/UpdateStatusDialog.tsx
index 064e19ff2ee..c547a1b85ff 100644
--- a/src/Components/Patient/UpdateStatusDialog.tsx
+++ b/src/Components/Patient/UpdateStatusDialog.tsx
@@ -215,7 +215,7 @@ const UpdateStatusDialog = (props: Props) => {
) : (
diff --git a/src/Components/Resource/ListView.tsx b/src/Components/Resource/ListView.tsx
index 2cf8b9eb26d..680015b16f2 100644
--- a/src/Components/Resource/ListView.tsx
+++ b/src/Components/Resource/ListView.tsx
@@ -181,7 +181,7 @@ export default function ListView() {
-
+
{t("board_view")}
diff --git a/src/Components/Resource/ResourceBoardView.tsx b/src/Components/Resource/ResourceBoardView.tsx
index 558cd77c1f0..6c02d932f77 100644
--- a/src/Components/Resource/ResourceBoardView.tsx
+++ b/src/Components/Resource/ResourceBoardView.tsx
@@ -76,7 +76,7 @@ export default function BoardView() {
/>
-
+
{t("list_view")}
navigate("/shifting/list", { query: qParams })}
>
-
+
{t("list_view")}
navigate("/shifting/board", { query: qParams })}
>
-
+
{t("board_view")}
diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx
index dbfca3a815a..ef3d4f00a3f 100644
--- a/src/Components/Users/ManageUsers.tsx
+++ b/src/Components/Users/ManageUsers.tsx
@@ -392,7 +392,7 @@ export default function ManageUsers() {
setSelectedUser(user);
}}
>
-
+
Linked Facilities
-
+
Linked Skills
@@ -420,7 +420,7 @@ export default function ManageUsers() {
setWeeklyHours(user.weekly_working_hours);
}}
>
-
+
Set Average weekly working hours
@@ -736,7 +736,7 @@ function UserFacilities(props: { user: any }) {
})
}
>
-
+
{t("clear_home_facility")}
@@ -791,7 +791,7 @@ function UserFacilities(props: { user: any }) {
}
}}
>
-
+
Set as home facility
@@ -808,7 +808,7 @@ function UserFacilities(props: { user: any }) {
})
}
>
-
+
Unlink Facility
diff --git a/src/Components/Users/SkillsSlideOverComponents.tsx b/src/Components/Users/SkillsSlideOverComponents.tsx
index d03de928c74..428c5cac5aa 100644
--- a/src/Components/Users/SkillsSlideOverComponents.tsx
+++ b/src/Components/Users/SkillsSlideOverComponents.tsx
@@ -52,7 +52,7 @@ export const SkillsArray = ({
disabled={isLoading || !authorizeForAddSkill}
onClick={() => setDeleteSkill(skill)}
>
-
+
diff --git a/src/Components/Users/UserProfile.tsx b/src/Components/Users/UserProfile.tsx
index d1c23a9db64..da5b7b9639b 100644
--- a/src/Components/Users/UserProfile.tsx
+++ b/src/Components/Users/UserProfile.tsx
@@ -443,7 +443,7 @@ export default function UserProfile() {
{showEdit ? "Cancel" : "Edit User Profile"}
-
+
Sign out
@@ -834,7 +834,7 @@ export default function UserProfile() {
-
+
Update available
@@ -849,8 +849,9 @@ export default function UserProfile() {
{" "}
diff --git a/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx b/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx
index 268e6c91ffa..9bd01fea4e6 100644
--- a/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx
+++ b/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx
@@ -149,7 +149,10 @@ export default function HL7PatientVitalsMonitor(props: IVitalsComponentProps) {
)}
style={waveformCanvas.size}
>
-
+
No incoming data from HL7 Monitor
-
+
No incoming data from Ventilator
-
+
@@ -64,7 +68,7 @@ const VitalsMonitorAssetPopover = ({
id="configure-asset"
data-testid="asset-configure-button"
>
-
+
{t("configure")}
diff --git a/src/Components/VitalsMonitor/VitalsMonitorHeader.tsx b/src/Components/VitalsMonitor/VitalsMonitorHeader.tsx
index 2f9df8607b0..8fa272d4058 100644
--- a/src/Components/VitalsMonitor/VitalsMonitorHeader.tsx
+++ b/src/Components/VitalsMonitor/VitalsMonitorHeader.tsx
@@ -21,7 +21,7 @@ const VitalsMonitorHeader = ({ patientAssetBed }: VitalsMonitorHeaderProps) => {
) : (
-
+
No Patient
)}
@@ -39,11 +39,14 @@ const VitalsMonitorHeader = ({ patientAssetBed }: VitalsMonitorHeaderProps) => {
href={`/facility/${patient?.facility_object?.id}/location/${bed?.location_object?.id}/beds`}
>
-
+
{bed.name}
-
+
{bed.location_object?.name}
diff --git a/src/Utils/VoiceRecorder.tsx b/src/Utils/VoiceRecorder.tsx
index f816a700154..ab14738df89 100644
--- a/src/Utils/VoiceRecorder.tsx
+++ b/src/Utils/VoiceRecorder.tsx
@@ -42,7 +42,10 @@ export const VoiceRecorder = (props: any) => {
<>
-
+
{t("recording") + "..."}
{
confirmAudioBlobExists();
}}
>
-
+
{t("stop")}
@@ -68,7 +71,7 @@ export const VoiceRecorder = (props: any) => {
authorizeFor={NonReadOnlyUsers}
className="w-full md:w-fit"
>
-
+
{t("record")}
)}
diff --git a/vite.config.mts b/vite.config.mts
index c8eb11c53cf..9285f495850 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -1,6 +1,7 @@
import { VitePWA } from "vite-plugin-pwa";
import { defineConfig } from "vite";
import react from "@vitejs/plugin-react-swc";
+import { treeShakeCareIcons } from "./plugins/treeShakeCareIcons.mts";
const cdnUrls =
process.env.CARE_CDN_URL ??
@@ -14,6 +15,9 @@ export default defineConfig({
envPrefix: "REACT_",
plugins: [
react(),
+ treeShakeCareIcons({
+ iconWhitelist: ["default"],
+ }),
VitePWA({
strategies: "injectManifest",
srcDir: "src",
From a27fe83f4f54fb9a162deac46022b0002133db1b Mon Sep 17 00:00:00 2001
From: Rithvik Nishad
Date: Tue, 26 Mar 2024 19:34:41 +0530
Subject: [PATCH 03/13] Fixes high cpu usage in medicines tab, pagination not
working, incorrect last modified date and type errors (#7477)
* Fixes component re-rendering issue due to change in reference
fixes #7465;
* fixes dependency on field `last_administered_on` that no longer exists
fixes #7466
---
src/Common/hooks/useRangePagination.ts | 2 +-
.../Medicine/MedicineAdministrationSheet/index.tsx | 2 +-
.../Medicine/MedicineAdministrationSheet/utils.ts | 9 +++++----
3 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/src/Common/hooks/useRangePagination.ts b/src/Common/hooks/useRangePagination.ts
index 7652ae546c1..b7c8b8510a5 100644
--- a/src/Common/hooks/useRangePagination.ts
+++ b/src/Common/hooks/useRangePagination.ts
@@ -19,7 +19,7 @@ const useRangePagination = ({ bounds, perPage, ...props }: Props) => {
useEffect(() => {
setCurrentRange(getInitialBounds(bounds, perPage, props.defaultEnd));
- }, [bounds, perPage, props.defaultEnd]);
+ }, [JSON.stringify(bounds), perPage, props.defaultEnd]);
const next = () => {
const { end } = currentRange;
diff --git a/src/Components/Medicine/MedicineAdministrationSheet/index.tsx b/src/Components/Medicine/MedicineAdministrationSheet/index.tsx
index 48c7e2aaff8..fd3d50272a3 100644
--- a/src/Components/Medicine/MedicineAdministrationSheet/index.tsx
+++ b/src/Components/Medicine/MedicineAdministrationSheet/index.tsx
@@ -83,7 +83,7 @@ const MedicineAdministrationSheet = ({ readonly, is_prn }: Props) => {
prescription.last_administered_on)
+ .filter((prescription) => prescription.last_administration?.created_date)
.reduce(
(latest, curr) =>
- curr.last_administered_on && curr.last_administered_on > latest
- ? curr.last_administered_on
+ curr.last_administration?.created_date &&
+ curr.last_administration?.created_date > latest
+ ? curr.last_administration?.created_date
: latest,
prescriptions[0]?.created_date ?? new Date()
)
From 5a8b9e89d84e6023971f02d34436c5c8bac04257 Mon Sep 17 00:00:00 2001
From: Rashmik <146672184+rash-27@users.noreply.github.com>
Date: Tue, 26 Mar 2024 23:56:22 +0530
Subject: [PATCH 04/13] Replace age field with DOB while Updating User (#7322)
* Replace age field with DOB while Updating User
* change cypress tests
* minor ux enhancements
* fix cypress fail
* fix cypress fails
* fix cypress fail in user profile
---------
Co-authored-by: khavinshankar
---
cypress/e2e/users_spec/user_creation.cy.ts | 16 +++---
cypress/e2e/users_spec/user_profile.cy.ts | 8 +--
cypress/pageobject/Users/UserCreation.ts | 5 +-
cypress/pageobject/Users/UserProfilePage.ts | 15 ++++--
src/Components/Users/UserAdd.tsx | 10 ++--
src/Components/Users/UserProfile.tsx | 57 +++++++++++++--------
src/Components/Users/models.tsx | 4 +-
7 files changed, 72 insertions(+), 43 deletions(-)
diff --git a/cypress/e2e/users_spec/user_creation.cy.ts b/cypress/e2e/users_spec/user_creation.cy.ts
index d9b3e52ddaf..33fd7cb958d 100644
--- a/cypress/e2e/users_spec/user_creation.cy.ts
+++ b/cypress/e2e/users_spec/user_creation.cy.ts
@@ -37,7 +37,7 @@ describe("User Creation", () => {
"Please select the User Type",
"Please enter valid phone number",
"Please enter the username",
- "Please enter date in YYYY/MM/DD format",
+ "Please enter date in DD/MM/YYYY format",
"Please enter the password",
"Confirm password is required",
"First Name is required",
@@ -52,10 +52,7 @@ describe("User Creation", () => {
const EXPECTED_PROFILE_ERROR_MESSAGES = [
"Field is required",
"Field is required",
- "This field is required",
"Please enter valid phone number",
- "This field is required",
- "This field is required",
];
before(() => {
@@ -81,7 +78,6 @@ describe("User Creation", () => {
"District Editted"
);
userCreationPage.typeIntoElementByIdPostClear("lastName", "Cypress");
- userCreationPage.typeIntoElementByIdPostClear("age", "22");
userCreationPage.selectDropdownOption("gender", "Male");
userCreationPage.typeIntoElementByIdPostClear(
"phoneNumber",
@@ -93,6 +89,10 @@ describe("User Creation", () => {
);
userCreationPage.typeIntoElementByIdPostClear("email", "test@test.com");
userCreationPage.typeIntoElementByIdPostClear("weekly_working_hours", "14");
+ userCreationPage.typeIntoElementByIdPostClearDob(
+ "date_of_birth",
+ "01011998"
+ );
userCreationPage.clickElementById("submit");
userCreationPage.verifyElementContainsText(
"contactno-profile-details",
@@ -110,7 +110,10 @@ describe("User Creation", () => {
"lastname-profile-details",
"Cypress"
);
- userCreationPage.verifyElementContainsText("age-profile-details", "22");
+ userCreationPage.verifyElementContainsText(
+ "date_of_birth-profile-details",
+ "01/01/1998"
+ );
userCreationPage.verifyElementContainsText(
"emailid-profile-details",
"test@test.com"
@@ -130,7 +133,6 @@ describe("User Creation", () => {
userCreationPage.clickElementById("edit-cancel-profile-button");
userCreationPage.clearIntoElementById("firstName");
userCreationPage.clearIntoElementById("lastName");
- userCreationPage.clearIntoElementById("age");
userCreationPage.clearIntoElementById("phoneNumber");
userCreationPage.clearIntoElementById("altPhoneNumber");
userCreationPage.clearIntoElementById("weekly_working_hours");
diff --git a/cypress/e2e/users_spec/user_profile.cy.ts b/cypress/e2e/users_spec/user_profile.cy.ts
index 3f3202eb423..3cbc2e91404 100644
--- a/cypress/e2e/users_spec/user_profile.cy.ts
+++ b/cypress/e2e/users_spec/user_profile.cy.ts
@@ -8,7 +8,7 @@ describe("Manage User Profile", () => {
const userProfilePage = new UserProfilePage();
const manageUserPage = new ManageUserPage();
- const age = "30";
+ const date_of_birth = "01011999";
const gender = "Male";
const email = "test@example.com";
const phone = "+918899887788";
@@ -32,10 +32,10 @@ describe("Manage User Profile", () => {
cy.awaitUrl("/user/profile");
});
- it("Set Age, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => {
+ it("Set Dob, Gender, Email, Phone and Working Hours for a user and verify its reflection in user profile", () => {
userProfilePage.clickEditProfileButton();
- userProfilePage.typeAge(age);
+ userProfilePage.typedate_of_birth(date_of_birth);
userProfilePage.selectGender(gender);
userProfilePage.typeEmail(email);
userProfilePage.typePhone(phone);
@@ -49,7 +49,7 @@ describe("Manage User Profile", () => {
cy.verifyNotification("Details updated successfully");
- userProfilePage.assertAge(age);
+ userProfilePage.assertdate_of_birth("01/01/1999");
userProfilePage.assertGender(gender);
userProfilePage.assertEmail(email);
userProfilePage.assertPhone(phone);
diff --git a/cypress/pageobject/Users/UserCreation.ts b/cypress/pageobject/Users/UserCreation.ts
index 32127ffcb90..c10d853f706 100644
--- a/cypress/pageobject/Users/UserCreation.ts
+++ b/cypress/pageobject/Users/UserCreation.ts
@@ -17,7 +17,10 @@ export class UserCreationPage {
.click()
.type(value);
}
-
+ typeIntoElementByIdPostClearDob(elementId: string, value: string) {
+ cy.get("#" + elementId).click();
+ cy.get("#date-input").clear().type(value);
+ }
clearIntoElementById(elementId: string) {
cy.get("#" + elementId)
.click()
diff --git a/cypress/pageobject/Users/UserProfilePage.ts b/cypress/pageobject/Users/UserProfilePage.ts
index 3f71a29181b..cb5f6d11f1c 100644
--- a/cypress/pageobject/Users/UserProfilePage.ts
+++ b/cypress/pageobject/Users/UserProfilePage.ts
@@ -1,3 +1,5 @@
+import { cy } from "local-cypress";
+
export default class UserProfilePage {
assertVideoConnectLink(link: string) {
cy.get("#videoconnectlink-profile-details").should("contain.text", link);
@@ -15,8 +17,10 @@ export default class UserProfilePage {
cy.get("#submit").click();
}
- typeAge(age: string) {
- cy.get("#age").click().clear().type(age);
+ typedate_of_birth(date_of_birth: string) {
+ //check
+ cy.get("#date_of_birth").click();
+ cy.get("#date-input").clear().type(date_of_birth);
}
selectGender(gender: string) {
@@ -55,8 +59,11 @@ export default class UserProfilePage {
.type(medicalCouncilRegistration);
};
- assertAge(age: string) {
- cy.get("#age-profile-details").should("contain.text", age);
+ assertdate_of_birth(date_of_birth: string) {
+ cy.get("#date_of_birth-profile-details").should(
+ "contain.text",
+ date_of_birth
+ );
}
assertGender(gender: string) {
diff --git a/src/Components/Users/UserAdd.tsx b/src/Components/Users/UserAdd.tsx
index b4d9e9fbca6..c6de6c18fa4 100644
--- a/src/Components/Users/UserAdd.tsx
+++ b/src/Components/Users/UserAdd.tsx
@@ -67,7 +67,6 @@ type UserForm = {
phone_number: string;
alt_phone_number: string;
phone_number_is_whatsapp: boolean;
- age: number;
date_of_birth: Date | null;
state: number;
district: number;
@@ -91,7 +90,6 @@ const initForm: UserForm = {
phone_number: "+91",
alt_phone_number: "+91",
phone_number_is_whatsapp: true,
- age: 0,
date_of_birth: null,
state: 0,
district: 0,
@@ -471,7 +469,12 @@ export const UserAdd = (props: UserProps) => {
return;
case "date_of_birth":
if (!state.form[field]) {
- errors[field] = "Please enter date in YYYY/MM/DD format";
+ errors[field] = "Please enter date in DD/MM/YYYY format";
+ invalidForm = true;
+ } else if (
+ dayjs(state.form[field]).isAfter(dayjs().subtract(1, "year"))
+ ) {
+ errors[field] = "Enter a valid date of birth";
invalidForm = true;
}
return;
@@ -543,7 +546,6 @@ export const UserAdd = (props: UserProps) => {
: state.form.alt_phone_number
) ?? "",
date_of_birth: dateQueryString(state.form.date_of_birth),
- age: Number(dayjs().diff(state.form.date_of_birth, "years", false)),
doctor_qualification:
state.form.user_type === "Doctor"
? state.form.doctor_qualification
diff --git a/src/Components/Users/UserProfile.tsx b/src/Components/Users/UserProfile.tsx
index da5b7b9639b..43949165a55 100644
--- a/src/Components/Users/UserProfile.tsx
+++ b/src/Components/Users/UserProfile.tsx
@@ -5,7 +5,13 @@ import * as Notification from "../../Utils/Notifications.js";
import LanguageSelector from "../../Components/Common/LanguageSelector";
import TextFormField from "../Form/FormFields/TextFormField";
import ButtonV2, { Submit } from "../Common/components/ButtonV2";
-import { classNames, isValidUrl, parsePhoneNumber } from "../../Utils/utils";
+import {
+ classNames,
+ dateQueryString,
+ formatDate,
+ isValidUrl,
+ parsePhoneNumber,
+} from "../../Utils/utils";
import CareIcon from "../../CAREUI/icons/CareIcon";
import PhoneNumberFormField from "../Form/FormFields/PhoneNumberFormField";
import { FieldChangeEvent } from "../Form/FormFields/Utils";
@@ -18,13 +24,13 @@ import { PhoneNumberValidator } from "../Form/FieldValidators";
import useQuery from "../../Utils/request/useQuery";
import routes from "../../Redux/api";
import request from "../../Utils/request/request";
-
+import DateFormField from "../Form/FormFields/DateFormField";
const Loading = lazy(() => import("../Common/Loading"));
type EditForm = {
firstName: string;
lastName: string;
- age: string;
+ date_of_birth: Date | null | string;
gender: GenderType;
email: string;
video_connect_link: string | undefined;
@@ -34,12 +40,12 @@ type EditForm = {
doctor_qualification: string | undefined;
doctor_experience_commenced_on: number | string | undefined;
doctor_medical_council_registration: string | undefined;
- weekly_working_hours: string | null;
+ weekly_working_hours: string | null | undefined;
};
type ErrorForm = {
firstName: string;
lastName: string;
- age: string;
+ date_of_birth: string | null;
gender: string;
email: string;
video_connect_link: string | undefined;
@@ -62,7 +68,7 @@ type Action =
const initForm: EditForm = {
firstName: "",
lastName: "",
- age: "",
+ date_of_birth: null,
gender: "Male",
video_connect_link: "",
email: "",
@@ -145,7 +151,7 @@ export default function UserProfile() {
const formData: EditForm = {
firstName: result.data.first_name,
lastName: result.data.last_name,
- age: result.data.age?.toString() || "",
+ date_of_birth: result.data.date_of_birth || null,
gender: result.data.gender || "Male",
email: result.data.email,
video_connect_link: result.data.video_connect_link,
@@ -188,15 +194,15 @@ export default function UserProfile() {
invalidForm = true;
}
return;
- case "age":
+ case "date_of_birth":
if (!states.form[field]) {
- errors[field] = "This field is required";
+ errors[field] = "Enter a valid date of birth";
invalidForm = true;
} else if (
- Number(states.form[field]) <= 0 ||
- !/^\d+$/.test(states.form[field])
+ !dayjs(states.form[field]).isValid() ||
+ dayjs(states.form[field]).isAfter(dayjs().subtract(17, "year"))
) {
- errors[field] = "Age must be a number greater than 0";
+ errors[field] = "Enter a valid date of birth";
invalidForm = true;
}
return;
@@ -298,6 +304,9 @@ export default function UserProfile() {
});
};
+ const getDate = (value: any) =>
+ value && dayjs(value).isValid() && dayjs(value).toDate();
+
const fieldProps = (name: string) => {
return {
name,
@@ -321,7 +330,7 @@ export default function UserProfile() {
phone_number: parsePhoneNumber(states.form.phoneNumber) ?? "",
alt_phone_number: parsePhoneNumber(states.form.altPhoneNumber) ?? "",
gender: states.form.gender,
- age: +states.form.age,
+ date_of_birth: dateQueryString(states.form.date_of_birth),
doctor_qualification:
states.form.user_type === "Doctor"
? states.form.doctor_qualification
@@ -520,12 +529,17 @@ export default function UserProfile() {
{userData?.last_name || "-"}
-
+
- Age
+ Date of Birth
- {userData?.age || "-"}
+ {userData?.date_of_birth
+ ? formatDate(userData?.date_of_birth)
+ : "-"}
@@ -649,13 +663,14 @@ export default function UserProfile() {
label="Last name"
className="col-span-6 sm:col-span-3"
/>
-
Date: Wed, 27 Mar 2024 21:05:16 +0530
Subject: [PATCH 05/13] Improving Doctor Connect UI (#7198)
* changed base structure
* Removed redundant filter logic and structure changes
* added sorting based on user_type
* added filter Switch
* added spacing between items
* fixed unnecessary api calls on filter switching
* replaced useDispatch with useQuery and code refactor
* code refactor
* fixed deepScan issues
* reverted back certain changes
* redundant null check fix
* suggestion commit
* fix lint
* fix linting
* reverted back to old layout
* post merge fixes
* tooltip direction fixed
* minor bug fix
---------
Co-authored-by: Rithvik Nishad
Co-authored-by: rithviknishad
---
.../Facility/DoctorVideoSlideover.tsx | 351 ++++++++++--------
src/Redux/api.tsx | 3 +-
2 files changed, 190 insertions(+), 164 deletions(-)
diff --git a/src/Components/Facility/DoctorVideoSlideover.tsx b/src/Components/Facility/DoctorVideoSlideover.tsx
index 998528217f2..a8732f959eb 100644
--- a/src/Components/Facility/DoctorVideoSlideover.tsx
+++ b/src/Components/Facility/DoctorVideoSlideover.tsx
@@ -1,7 +1,5 @@
import React, { useEffect, useState } from "react";
-import { useDispatch } from "react-redux";
import SlideOver from "../../CAREUI/interactive/SlideOver";
-import { getFacilityUsers } from "../../Redux/actions";
import { UserAssignedModel } from "../Users/models";
import { SkillObjectModel } from "../Users/models";
import CareIcon, { IconName } from "../../CAREUI/icons/CareIcon";
@@ -9,6 +7,19 @@ import { relativeTime } from "../../Utils/utils";
import useAuthUser from "../../Common/hooks/useAuthUser";
import { triggerGoal } from "../../Integrations/Plausible";
import { Warn } from "../../Utils/Notifications";
+import Switch from "../../CAREUI/interactive/Switch";
+import useQuery from "../../Utils/request/useQuery";
+import routes from "../../Redux/api";
+
+enum FilterTypes {
+ ALL = "All",
+ DOCTOR = "Doctor",
+ NURSE = "Nurse",
+ TELEICU = "TeleICU Hub",
+}
+
+const isHomeUser = (user: UserAssignedModel, facilityId: string) =>
+ user.home_facility_object?.id === facilityId;
export default function DoctorVideoSlideover(props: {
show: boolean;
@@ -16,90 +27,84 @@ export default function DoctorVideoSlideover(props: {
setShow: (show: boolean) => void;
}) {
const { show, facilityId, setShow } = props;
- const [doctors, setDoctors] = useState([]);
+ const [filteredDoctors, setFilteredDoctors] = useState(
+ []
+ );
+ const [filter, setFilter] = useState(FilterTypes.ALL);
+
+ const { data: users, loading } = useQuery(routes.getFacilityUsers, {
+ prefetch: show,
+ pathParams: { facility_id: facilityId },
+ query: { limit: 50 },
+ });
- const dispatchAction: any = useDispatch();
useEffect(() => {
- const fetchUsers = async () => {
- if (facilityId) {
- const res = await dispatchAction(
- getFacilityUsers(facilityId, { limit: 50 })
- );
- if (res?.data) {
- setDoctors(
- res.data.results
- .filter(
- (user: any) => user.alt_phone_number || user.video_connect_link
- )
- .sort((a: any, b: any) => {
- return Number(a.last_login) - Number(b.last_login);
- })
- );
- }
- } else {
- setDoctors([]);
- }
+ const filterDoctors = (users: UserAssignedModel[]) => {
+ return users.filter(
+ (user: UserAssignedModel) =>
+ (user.alt_phone_number || user.video_connect_link) &&
+ (user.user_type === "Doctor" || user.user_type === "Nurse") &&
+ (filter === FilterTypes.ALL ||
+ (filter === FilterTypes.DOCTOR &&
+ isHomeUser(user, facilityId) &&
+ user.user_type === "Doctor") ||
+ (filter === FilterTypes.NURSE &&
+ isHomeUser(user, facilityId) &&
+ user.user_type === "Nurse") ||
+ (filter === FilterTypes.TELEICU && !isHomeUser(user, facilityId)))
+ );
};
- if (show) {
- fetchUsers();
+ if (users?.results && !loading) {
+ setFilteredDoctors(
+ filterDoctors(users.results).sort(
+ (a: UserAssignedModel, b: UserAssignedModel) => {
+ const aIsHomeUser = isHomeUser(a, facilityId);
+ const bIsHomeUser = isHomeUser(b, facilityId);
+ return aIsHomeUser === bIsHomeUser ? 0 : aIsHomeUser ? -1 : 1;
+ }
+ )
+ );
}
- }, [show, facilityId]);
+ }, [facilityId, filter, loading, users?.results]);
return (
{/* Title and close button */}
Select a doctor to connect via video
- {[
- {
- title: "Doctors",
- user_type: "Doctor",
- home: true,
- },
- {
- title: "Nurse",
- user_type: "Nurse",
- home: true,
- },
- {
- title: "TeleICU Hub",
- user_type: "Doctor",
- home: false,
- },
- ].map((type, i) => (
+
+ ({ ...acc, [type]: type }),
+ {}
+ ) as Record
+ }
+ selected={filter}
+ onChange={(tab) => setFilter(tab)}
+ size="md"
+ />
+
+ {filteredDoctors.map((doctor, i) => (
-
- {type.title}
-
-
-
- {doctors
- .filter((doc) => {
- const isHomeUser =
- (doc.home_facility_object?.id || "") === facilityId;
- return (
- doc.user_type === type.user_type && isHomeUser === type.home
- );
- })
- .map((doctor) => {
- return ;
- })}
+
))}
@@ -107,11 +112,11 @@ export default function DoctorVideoSlideover(props: {
);
}
-function UserListItem(props: { user: UserAssignedModel }) {
+function UserListItem(props: { user: UserAssignedModel; facilityId: string }) {
const user = props.user;
+ const facilityId = props.facilityId;
const icon: IconName =
user.user_type === "Doctor" ? "l-user-md" : "l-user-nurse";
- const authUser = useAuthUser();
function connectOnWhatsApp(e: React.MouseEvent) {
e.stopPropagation();
@@ -172,99 +177,63 @@ function UserListItem(props: { user: UserAssignedModel }) {
}
return (
-
-
-
-
- {
- // Show online icon based on last_login
- user.last_login &&
- Number(new Date()) - Number(new Date(user.last_login)) < 60000 ? (
-
- ) : (
-
- )
- }
-
-
From 83333fc03374af42773c4964f269919e53112250 Mon Sep 17 00:00:00 2001
From: Soumya Maheshwari <104725768+soumya-maheshwari@users.noreply.github.com>
Date: Wed, 27 Mar 2024 21:06:44 +0530
Subject: [PATCH 07/13] added toast messages on facility and skills dialog
(#7448)
* added toast messages on facility and skills dialog
* Requested changes done
---
src/Components/Users/ManageUsers.tsx | 41 +++++++++++++++++++++---
src/Components/Users/SkillsSlideOver.tsx | 5 +++
2 files changed, 42 insertions(+), 4 deletions(-)
diff --git a/src/Components/Users/ManageUsers.tsx b/src/Components/Users/ManageUsers.tsx
index ef3d4f00a3f..d25d6ec1d6c 100644
--- a/src/Components/Users/ManageUsers.tsx
+++ b/src/Components/Users/ManageUsers.tsx
@@ -638,7 +638,16 @@ function UserFacilities(props: { user: any }) {
pathParams: { username },
body: { home_facility: facility.id.toString() },
});
- if (res && res.status === 200) user.home_facility_object = facility;
+ if (!res?.ok) {
+ Notification.Error({
+ msg: "Error while updating Home facility",
+ });
+ } else {
+ user.home_facility_object = facility;
+ Notification.Success({
+ msg: "Home Facility updated successfully",
+ });
+ }
await refetchUserFacilities();
setIsLoading(false);
};
@@ -649,12 +658,31 @@ function UserFacilities(props: { user: any }) {
const { res } = await request(routes.clearHomeFacility, {
pathParams: { username },
});
- if (res && res.status === 204) user.home_facility_object = null;
+
+ if (!res?.ok) {
+ Notification.Error({
+ msg: "Error while clearing home facility",
+ });
+ } else {
+ user.home_facility_object = null;
+ Notification.Success({
+ msg: "Home Facility cleared successfully",
+ });
+ }
} else {
- await request(routes.deleteUserFacility, {
+ const { res } = await request(routes.deleteUserFacility, {
pathParams: { username },
body: { facility: unlinkFacilityData?.facility?.id?.toString() },
});
+ if (!res?.ok) {
+ Notification.Error({
+ msg: "Error while unlinking home facility",
+ });
+ } else {
+ Notification.Success({
+ msg: "Facility unlinked successfully",
+ });
+ }
}
await refetchUserFacilities();
hideUnlinkFacilityModal();
@@ -667,10 +695,15 @@ function UserFacilities(props: { user: any }) {
pathParams: { username },
body: { facility: facility.id.toString() },
});
- if (res?.status !== 201) {
+
+ if (!res?.ok) {
Notification.Error({
msg: "Error while linking facility",
});
+ } else {
+ Notification.Success({
+ msg: "Facility linked successfully",
+ });
}
await refetchUserFacilities();
setIsLoading(false);
diff --git a/src/Components/Users/SkillsSlideOver.tsx b/src/Components/Users/SkillsSlideOver.tsx
index 616dbb6404d..e7af920a533 100644
--- a/src/Components/Users/SkillsSlideOver.tsx
+++ b/src/Components/Users/SkillsSlideOver.tsx
@@ -45,6 +45,7 @@ export default ({ show, setShow, username }: IProps) => {
pathParams: { username },
body: { skill: skill.id },
});
+
if (!res?.ok) {
Notification.Error({
msg: "Error while adding skill",
@@ -70,6 +71,10 @@ export default ({ show, setShow, username }: IProps) => {
Notification.Error({
msg: "Error while unlinking skill",
});
+ } else {
+ Notification.Success({
+ msg: "Skill unlinked successfully",
+ });
}
setDeleteSkill(null);
await refetchUserSkills();
From a4e46c23d86f220393da8f5dac010bf2283196a4 Mon Sep 17 00:00:00 2001
From: Soumya Maheshwari <104725768+soumya-maheshwari@users.noreply.github.com>
Date: Wed, 27 Mar 2024 21:07:09 +0530
Subject: [PATCH 08/13] edit padding in shifting board and resource board pages
in mobile screen (#7449)
---
src/Components/Resource/ResourceBoardView.tsx | 4 ++--
src/Components/Shifting/BoardView.tsx | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/Components/Resource/ResourceBoardView.tsx b/src/Components/Resource/ResourceBoardView.tsx
index 6c02d932f77..421fab4ab06 100644
--- a/src/Components/Resource/ResourceBoardView.tsx
+++ b/src/Components/Resource/ResourceBoardView.tsx
@@ -87,8 +87,8 @@ export default function BoardView() {
-
-
+
+
{isLoading ? (
) : (
diff --git a/src/Components/Shifting/BoardView.tsx b/src/Components/Shifting/BoardView.tsx
index 5cf34e67e18..c08a7ffdfdd 100644
--- a/src/Components/Shifting/BoardView.tsx
+++ b/src/Components/Shifting/BoardView.tsx
@@ -113,7 +113,7 @@ export default function BoardView() {
isIconEnable && (
{renderArrowIcons("left")}
{boardFilter.map((board) => (
From 0402261c1fd95d021ab3177a83d92299a00996e6 Mon Sep 17 00:00:00 2001
From: hrit2773 <128292557+hrit2773@users.noreply.github.com>
Date: Wed, 27 Mar 2024 21:07:42 +0530
Subject: [PATCH 09/13] E-chart vitals precision problem fixed (#7450)
* added span tags for cypress tests
* added span sr-only tags for all the data values
* added id to access for cypress
* Update src/Components/Facility/Consultations/components/LinePlot.tsx
Co-authored-by: Rithvik Nishad
---------
Co-authored-by: Rithvik Nishad
---
.../Consultations/components/LinePlot.tsx | 24 +++++++++++++------
src/Utils/utils.ts | 7 ++++++
2 files changed, 24 insertions(+), 7 deletions(-)
diff --git a/src/Components/Facility/Consultations/components/LinePlot.tsx b/src/Components/Facility/Consultations/components/LinePlot.tsx
index 92e3afcec61..667240428e5 100644
--- a/src/Components/Facility/Consultations/components/LinePlot.tsx
+++ b/src/Components/Facility/Consultations/components/LinePlot.tsx
@@ -13,6 +13,7 @@ import {
import * as echarts from "echarts/core";
import { CanvasRenderer } from "echarts/renderers";
+import { properRoundOf } from "../../../../Utils/utils";
echarts.use([
BarChart,
LineChart,
@@ -46,7 +47,9 @@ export const LinePlot = (props: any) => {
containLabel: true,
},
title: {
- text: `${title} [ {0|${yData[yData.length - 1]?.toFixed(2) || "NA"}} ]`,
+ text: `${title} [ {0|${
+ yData[yData.length - 1] ? properRoundOf(yData[yData.length - 1]) : "NA"
+ }} ]`,
textStyle: {
fontSize: 14,
rich: {
@@ -225,11 +228,18 @@ export const LinePlot = (props: any) => {
}
return (
-
+ <>
+ {yData.map((value: any, idx: any) => (
+
+ {value ? properRoundOf(value) : "NA"}
+
+ ))}
+
+ >
);
};
diff --git a/src/Utils/utils.ts b/src/Utils/utils.ts
index 4e1d1626a59..4bbc6317d2d 100644
--- a/src/Utils/utils.ts
+++ b/src/Utils/utils.ts
@@ -479,3 +479,10 @@ export const mergeQueryOptions = (
),
];
};
+
+export const properRoundOf = (value: number) => {
+ if (value % 1 === 0) {
+ return value.toFixed();
+ }
+ return value.toFixed(2);
+};
From ee803ceb2a46dfc32ff73f7809bcbe7027705664 Mon Sep 17 00:00:00 2001
From: Pranshu Aggarwal <70687348+Pranshu1902@users.noreply.github.com>
Date: Wed, 27 Mar 2024 21:08:44 +0530
Subject: [PATCH 10/13] Don't allow negative values for quantity in Manage
Inventory and Minimum Quantity Required page (#7455)
* add negative value check
* add validation for minimum quantity required page
---
src/Components/Facility/AddInventoryForm.tsx | 3 ++
src/Components/Facility/SetInventoryForm.tsx | 30 ++++++++++++++++++++
2 files changed, 33 insertions(+)
diff --git a/src/Components/Facility/AddInventoryForm.tsx b/src/Components/Facility/AddInventoryForm.tsx
index 5188f50d088..b9f6c4c7bae 100644
--- a/src/Components/Facility/AddInventoryForm.tsx
+++ b/src/Components/Facility/AddInventoryForm.tsx
@@ -160,6 +160,9 @@ export const AddInventoryForm = (props: any) => {
if (!state.form[field]?.length) {
errors[field] = "Please select a quantity";
invalidForm = true;
+ } else if (state.form[field] <= 0) {
+ errors[field] = "Quantity must be more than 0";
+ invalidForm = true;
}
return;
case "unit":
diff --git a/src/Components/Facility/SetInventoryForm.tsx b/src/Components/Facility/SetInventoryForm.tsx
index c963aa05f5f..e580b297a0f 100644
--- a/src/Components/Facility/SetInventoryForm.tsx
+++ b/src/Components/Facility/SetInventoryForm.tsx
@@ -16,8 +16,13 @@ const initForm = {
id: "",
quantity: "",
};
+const initError = Object.assign(
+ {},
+ ...Object.keys(initForm).map((k) => ({ [k]: "" }))
+);
const initialState = {
form: { ...initForm },
+ errors: { ...initError },
};
const inventoryFormReducer = (state = initialState, action: any) => {
@@ -99,8 +104,32 @@ export const SetInventoryForm = (props: any) => {
}
}, [state.form.id]);
+ const validateForm = () => {
+ const errors = { ...initError };
+ let invalidForm = false;
+
+ Object.keys(state.form).forEach((field) => {
+ switch (field) {
+ case "quantity":
+ if (!state.form[field]?.length) {
+ errors[field] = "Please select a quantity";
+ invalidForm = true;
+ } else if (state.form[field] < 0) {
+ errors[field] = "Quantity can't be negative";
+ invalidForm = true;
+ }
+ return;
+ }
+ });
+
+ dispatch({ type: "set_error", errors });
+ return !invalidForm;
+ };
+
const handleSubmit = async (e: any) => {
e.preventDefault();
+ const validated = validateForm();
+ if (!validated) return;
await request(routes.setMinQuantity, {
pathParams: { facilityId },
body: {
@@ -159,6 +188,7 @@ export const SetInventoryForm = (props: any) => {
type="number"
value={state.form.quantity}
onChange={handleChange}
+ error={state.errors.quantity}
/>
Date: Wed, 27 Mar 2024 21:13:14 +0530
Subject: [PATCH 11/13] Extend Update Log to bottom of the screen (#7136)
* removed fixed height
* moved Paginator container one level up and minor CSS fix
* removed filter overlapping with card
* Update src/Components/Facility/Consultations/DailyRoundsList.tsx
Co-authored-by: Ashesh <3626859+Ashesh3@users.noreply.github.com>
---------
Co-authored-by: Khavin Shankar
Co-authored-by: Ashesh <3626859+Ashesh3@users.noreply.github.com>
---
.../Facility/Consultations/DailyRoundsList.tsx | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/Components/Facility/Consultations/DailyRoundsList.tsx b/src/Components/Facility/Consultations/DailyRoundsList.tsx
index 76d48ec86ba..edcf00f3016 100644
--- a/src/Components/Facility/Consultations/DailyRoundsList.tsx
+++ b/src/Components/Facility/Consultations/DailyRoundsList.tsx
@@ -41,8 +41,8 @@ export default function DailyRoundsList({ consultation }: Props) {
/>
-
-
+
+
{t("no_consultation_updates")}
@@ -116,9 +116,9 @@ export default function DailyRoundsList({ consultation }: Props) {
}}
-
+
+
>
From 36ec6a25e775db398f5adc9863ab1a8709fe1a18 Mon Sep 17 00:00:00 2001
From: Shivank Kacker
Date: Thu, 28 Mar 2024 22:15:19 +0530
Subject: [PATCH 12/13] Added consent form to patient consultation (#7461)
* Added consent form to patient consultation
* reverted vite config
* added keys
* removed undefined titles
* disable on create
* fix vite
* updated as decided on call
* fixed dropdown
* fix
* fix page title
* reverted vite config change
* fix linting issue in constants file
* fix linting errors
---------
Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
Co-authored-by: khavinshankar
---
src/Common/constants.tsx | 15 +
src/Components/Common/PageTitle.tsx | 4 +-
src/Components/Common/components/Page.tsx | 2 +
.../AddICD11Diagnosis.tsx | 2 +-
.../ConsultationUpdatesTab.tsx | 48 ++-
src/Components/Facility/ConsultationForm.tsx | 200 ++++++++++-
src/Components/Facility/models.tsx | 2 +
src/Components/Patient/FileUpload.tsx | 338 ++++++++++--------
src/Redux/actions.tsx | 3 +
9 files changed, 451 insertions(+), 163 deletions(-)
diff --git a/src/Common/constants.tsx b/src/Common/constants.tsx
index 8ad2e72032c..f1aed577cea 100644
--- a/src/Common/constants.tsx
+++ b/src/Common/constants.tsx
@@ -1172,6 +1172,21 @@ export const IN_LANDLINE_AREA_CODES = [
"891",
"4822",
];
+
+export const CONSENT_TYPE_CHOICES = [
+ { id: 1, text: "Consent for admission" },
+ { id: 2, text: "Patient Code Status" },
+ { id: 3, text: "Consent for procedure" },
+ { id: 4, text: "High risk consent" },
+ { id: 5, text: "Others" },
+];
+
+export const CONSENT_PATIENT_CODE_STATUS_CHOICES = [
+ { id: 1, text: "Do Not Hospitalise (DNH)" },
+ { id: 2, text: "Do Not Resuscitate (DNR)" },
+ { id: 3, text: "Comfort Care Only" },
+ { id: 4, text: "Active treatment (Default)" },
+];
export const OCCUPATION_TYPES = [
{ id: 1, text: "Student", value: "STUDENT" },
{
diff --git a/src/Components/Common/PageTitle.tsx b/src/Components/Common/PageTitle.tsx
index 4f29ca892e3..6fb38a36f08 100644
--- a/src/Components/Common/PageTitle.tsx
+++ b/src/Components/Common/PageTitle.tsx
@@ -26,6 +26,7 @@ export interface PageTitleProps {
};
focusOnLoad?: boolean;
isInsidePage?: boolean;
+ changePageMetadata?: boolean;
}
export default function PageTitle({
@@ -40,6 +41,7 @@ export default function PageTitle({
justifyContents = "justify-start",
focusOnLoad = false,
isInsidePage = false,
+ changePageMetadata = true,
}: PageTitleProps) {
const divRef = useRef();
@@ -56,7 +58,7 @@ export default function PageTitle({
ref={divRef}
className={isInsidePage ? "" : `mb-2 pt-4 md:mb-4 ${className}`}
>
-
+ {changePageMetadata && }
{!hideBack && (
diff --git a/src/Components/Common/components/Page.tsx b/src/Components/Common/components/Page.tsx
index ce5e84deefe..437a4ef21f7 100644
--- a/src/Components/Common/components/Page.tsx
+++ b/src/Components/Common/components/Page.tsx
@@ -6,6 +6,7 @@ import { SidebarShrinkContext } from "../Sidebar/Sidebar";
interface PageProps extends PageTitleProps {
children: React.ReactNode | React.ReactNode[];
options?: React.ReactNode | React.ReactNode[];
+ changePageMetadata?: boolean;
className?: string;
noImplicitPadding?: boolean;
ref?: RefObject
;
@@ -39,6 +40,7 @@ export default function Page(props: PageProps) {
();
const [adding, setAdding] = useState(false);
- const hasError = !!props.disallowed.find((d) => d.id === selected?.id);
+ const hasError = !!props.disallowed.find((d) => d?.id === selected?.id);
const { fetchOptions, isLoading, options } =
useAsyncOptions("id");
diff --git a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
index e8a64b5310d..b3aca51c615 100644
--- a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
+++ b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
@@ -7,7 +7,12 @@ import { BedModel } from "../models";
import HL7PatientVitalsMonitor from "../../VitalsMonitor/HL7PatientVitalsMonitor";
import VentilatorPatientVitalsMonitor from "../../VitalsMonitor/VentilatorPatientVitalsMonitor";
import useVitalsAspectRatioConfig from "../../VitalsMonitor/useVitalsAspectRatioConfig";
-import { DISCHARGE_REASONS, SYMPTOM_CHOICES } from "../../../Common/constants";
+import {
+ CONSENT_PATIENT_CODE_STATUS_CHOICES,
+ CONSENT_TYPE_CHOICES,
+ DISCHARGE_REASONS,
+ SYMPTOM_CHOICES,
+} from "../../../Common/constants";
import PrescriptionsTable from "../../Medicine/PrescriptionsTable";
import Chip from "../../../CAREUI/display/Chip";
import { formatAge, formatDate, formatDateTime } from "../../../Utils/utils";
@@ -16,6 +21,7 @@ import DailyRoundsList from "../Consultations/DailyRoundsList";
import EventsList from "./Events/EventsList";
import SwitchTabs from "../../Common/components/SwitchTabs";
import { getVitalsMonitorSocketUrl } from "../../VitalsMonitor/utils";
+import { FileUpload } from "../../Patient/FileUpload";
const PageTitle = lazy(() => import("../../Common/PageTitle"));
@@ -669,6 +675,46 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
+ {(
+ props.consultationData.consent_records?.filter(
+ (record) => record.deleted !== true
+ ) || []
+ ).length > 0 && (
+ <>
+
+
+ Consent Records
+
+ {props.consultationData.consent_records
+ ?.filter((record) => record.deleted !== true)
+ ?.map((record, i) => (
+
+
+ {
+ CONSENT_TYPE_CHOICES.find(
+ (c) => c.id === record.type
+ )?.text
+ }{" "}
+ {record.patient_code_status &&
+ `( ${
+ CONSENT_PATIENT_CODE_STATUS_CHOICES.find(
+ (c) => c.id === record.patient_code_status
+ )?.text
+ } )`}
+
+
+
+ ))}
+
+ >
+ )}
diff --git a/src/Components/Facility/ConsultationForm.tsx b/src/Components/Facility/ConsultationForm.tsx
index ea49f24871b..4d2d58457e5 100644
--- a/src/Components/Facility/ConsultationForm.tsx
+++ b/src/Components/Facility/ConsultationForm.tsx
@@ -8,6 +8,8 @@ import {
PATIENT_CATEGORIES,
REVIEW_AT_CHOICES,
TELEMEDICINE_ACTIONS,
+ CONSENT_TYPE_CHOICES,
+ CONSENT_PATIENT_CODE_STATUS_CHOICES,
} from "../../Common/constants";
import { Cancel, Submit } from "../Common/components/ButtonV2";
import { DraftSection, useAutoSaveReducer } from "../../Utils/AutoSave";
@@ -30,6 +32,7 @@ import {
createConsultation,
getConsultation,
getPatient,
+ partialUpdateConsultation,
updateConsultation,
} from "../../Redux/actions";
import { statusType, useAbortableEffect } from "../../Common/utils";
@@ -74,12 +77,21 @@ import {
CreateDiagnosesBuilder,
EditDiagnosesBuilder,
} from "../Diagnosis/ConsultationDiagnosisBuilder/ConsultationDiagnosisBuilder.js";
+import { FileUpload } from "../Patient/FileUpload.js";
+import ConfirmDialog from "../Common/ConfirmDialog.js";
const Loading = lazy(() => import("../Common/Loading"));
const PageTitle = lazy(() => import("../Common/PageTitle"));
type BooleanStrings = "true" | "false";
+export type ConsentRecord = {
+ id: string;
+ type: (typeof CONSENT_TYPE_CHOICES)[number]["id"];
+ patient_code_status?: (typeof CONSENT_PATIENT_CODE_STATUS_CHOICES)[number]["id"];
+ deleted?: boolean;
+};
+
type FormDetails = {
symptoms: number[];
other_symptoms: string;
@@ -128,6 +140,7 @@ type FormDetails = {
death_confirmed_doctor: string;
InvestigationAdvice: InvestigationType[];
procedures: ProcedureType[];
+ consent_records: ConsentRecord[];
};
const initForm: FormDetails = {
@@ -178,6 +191,7 @@ const initForm: FormDetails = {
death_confirmed_doctor: "",
InvestigationAdvice: [],
procedures: [],
+ consent_records: [],
};
const initError = Object.assign(
@@ -228,6 +242,7 @@ type ConsultationFormSection =
| "Consultation Details"
| "Diagnosis"
| "Treatment Plan"
+ | "Consent Records"
| "Bed Status";
type Props = {
@@ -261,7 +276,14 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
const [diagnosisVisible, diagnosisRef] = useVisibility(-300);
const [treatmentPlanVisible, treatmentPlanRef] = useVisibility(-300);
const [bedStatusVisible, bedStatusRef] = useVisibility(-300);
+ const [consentRecordsVisible, consentRecordsRef] = useVisibility(-300);
const [disabledFields, setDisabledFields] = useState
([]);
+ const [collapsedConsentRecords, setCollapsedConsentRecords] = useState<
+ number[]
+ >([]);
+ const [showDeleteConsent, setShowDeleteConsent] = useState(
+ null
+ );
const { min_encounter_date } = useConfig();
@@ -281,6 +303,11 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
visible: treatmentPlanVisible,
ref: treatmentPlanRef,
},
+ "Consent Records": {
+ iconClass: "care-l-file-alt",
+ visible: consentRecordsVisible,
+ ref: consentRecordsRef,
+ },
"Bed Status": {
iconClass: "l-bed",
visible: bedStatusVisible,
@@ -293,6 +320,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
if (consultationDetailsVisible) return "Consultation Details";
if (diagnosisVisible) return "Diagnosis";
if (treatmentPlanVisible) return "Treatment Plan";
+ if (consentRecordsVisible) return "Consent Records";
if (bedStatusVisible) return "Bed Status";
return prev;
});
@@ -300,6 +328,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
consultationDetailsVisible,
diagnosisVisible,
treatmentPlanVisible,
+ consentRecordsVisible,
bedStatusVisible,
]);
@@ -762,6 +791,7 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
height: Number(state.form.height),
bed: bed && bed instanceof Array ? bed[0]?.id : bed?.id,
patient_no: state.form.patient_no || null,
+ consent_records: state.form.consent_records || [],
};
const res = await dispatchAction(
@@ -904,6 +934,62 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
};
};
+ const handleConsentTypeChange: FieldChangeEventHandler = async (
+ event
+ ) => {
+ if (!id) return;
+ const consentRecords = [...state.form.consent_records];
+ if (
+ consentRecords
+ .filter((cr) => cr.deleted !== true)
+ .map((cr) => cr.type)
+ .includes(event.value)
+ ) {
+ return;
+ } else {
+ const randomId = "consent-" + new Date().getTime().toString();
+ const newRecords = [
+ ...consentRecords,
+ { id: randomId, type: event.value },
+ ];
+ await dispatchAction(
+ partialUpdateConsultation(id, { consent_records: newRecords })
+ );
+ dispatch({
+ type: "set_form",
+ form: { ...state.form, consent_records: newRecords },
+ });
+ }
+ };
+
+ const handleConsentPCSChange: FieldChangeEventHandler = (event) => {
+ dispatch({
+ type: "set_form",
+ form: {
+ ...state.form,
+ consent_records: state.form.consent_records.map((cr) =>
+ cr.type === 2 ? { ...cr, patient_code_status: event.value } : cr
+ ),
+ },
+ });
+ };
+
+ const handleDeleteConsent = async () => {
+ const consent_id = showDeleteConsent;
+ if (!consent_id || !id) return;
+ const newRecords = state.form.consent_records.map((cr) =>
+ cr.id === consent_id ? { ...cr, deleted: true } : cr
+ );
+ await dispatchAction(
+ partialUpdateConsultation(id, { consent_records: newRecords })
+ );
+ dispatch({
+ type: "set_form",
+ form: { ...state.form, consent_records: newRecords },
+ });
+ setShowDeleteConsent(null);
+ };
+
return (
{
{Object.keys(sections).map((sectionTitle) => {
- if (!isUpdate && sectionTitle === "Bed Status") {
+ if (
+ !isUpdate &&
+ ["Bed Status", "Consent Records"].includes(sectionTitle)
+ ) {
return null;
}
const isCurrent = currentSection === sectionTitle;
@@ -1477,7 +1566,114 @@ export const ConsultationForm = ({ facilityId, patientId, id }: Props) => {
>
)}
-
+ {id && (
+ <>
+
+ {sectionTitle("Consent Records", true)}
+
+
setShowDeleteConsent(null)}
+ onConfirm={handleDeleteConsent}
+ action="Delete"
+ variant="danger"
+ description={
+ "Are you sure you want to delete this consent record?"
+ }
+ title="Delete Consent"
+ className="w-auto"
+ />
+
+ !state.form.consent_records
+ .filter((r) => r.deleted !== true)
+ .map((record) => record.type)
+ .includes(c.id)
+ )}
+ />
+
+ {state.form.consent_records
+ .filter((record) => record.deleted !== true)
+ .map((record, index) => (
+
+
+
+
+
+
+
+ {record.type === 2 && (
+
+ )}
+
+
+
+
+ ))}
+
+ >
+ )}
diff --git a/src/Components/Facility/models.tsx b/src/Components/Facility/models.tsx
index 58386bef3a4..1e590797f83 100644
--- a/src/Components/Facility/models.tsx
+++ b/src/Components/Facility/models.tsx
@@ -7,6 +7,7 @@ import { ConsultationDiagnosis, CreateDiagnosis } from "../Diagnosis/types";
import { NormalPrescription, PRNPrescription } from "../Medicine/models";
import { AssignedToObjectModel, DailyRoundsModel } from "../Patient/models";
import { UserBareMinimum } from "../Users/models";
+import { ConsentRecord } from "./ConsultationForm";
export interface LocalBodyModel {
id: number;
@@ -164,6 +165,7 @@ export interface ConsultationModel {
is_readmission?: boolean;
medico_legal_case?: boolean;
investigation?: InvestigationType[];
+ consent_records?: ConsentRecord[];
}
export interface PatientStatsModel {
diff --git a/src/Components/Patient/FileUpload.tsx b/src/Components/Patient/FileUpload.tsx
index 6e6d289d187..0c8cad60005 100644
--- a/src/Components/Patient/FileUpload.tsx
+++ b/src/Components/Patient/FileUpload.tsx
@@ -104,11 +104,15 @@ interface FileUploadProps {
patientId?: any;
facilityId?: any;
consultationId?: any;
+ consentId?: string;
hideBack: boolean;
audio?: boolean;
unspecified: boolean;
sampleId?: string;
claimId?: string;
+ className?: string;
+ hideUpload?: boolean;
+ changePageMetadata?: boolean;
}
interface URLS {
@@ -144,12 +148,14 @@ export const FileUpload = (props: FileUploadProps) => {
facilityId,
consultationId,
patientId,
+ consentId,
type,
hideBack,
audio,
unspecified,
sampleId,
claimId,
+ changePageMetadata,
} = props;
const id = patientId;
const [isLoading, setIsLoading] = useState(false);
@@ -302,6 +308,8 @@ export const FileUpload = (props: FileUploadProps) => {
switch (type) {
case "PATIENT":
return patientId;
+ case "CONSENT_RECORD":
+ return consentId;
case "CONSULTATION":
return consultationId;
case "SAMPLE_MANAGEMENT":
@@ -559,7 +567,10 @@ export const FileUpload = (props: FileUploadProps) => {
const renderFileUpload = (item: FileUploadModel) => {
const isPreviewSupported = previewExtensions.includes(item.extension ?? "");
return (
-
+
{!item.is_archived ? (
<>
{item.file_category === "AUDIO" ? (
@@ -1132,7 +1143,7 @@ export const FileUpload = (props: FileUploadProps) => {
};
return (
-
-
-
- {audio ? (
-
-
Record and Upload Audio File
-
{
- setAudioName(e.value);
- }}
- error={audioFileError}
- />
- {audiouploadStarted ? (
-
- ) : (
-
- {audioBlobExists && (
-
+ {!props.hideUpload && (
+
+
+ {audio ? (
+
+
Record and Upload Audio File
+
{
+ setAudioName(e.value);
+ }}
+ error={audioFileError}
+ />
+ {audiouploadStarted ? (
+
+ ) : (
+
+ {audioBlobExists && (
+
+ {
+ deleteAudioBlob();
+ }}
+ >
+ Delete
+
+
+ )}
+
+
+ {!audioBlobExists && (
+
+
+ Please allow browser permission before you start
+ speaking
+
+ )}
+
+ {audioBlobExists && (
+
+ {
+ handleAudioUpload();
+ }}
+ className="w-full"
+ >
+
+ Save
+
+
+ )}
+
+ )}
+
+ ) : null}
+ {unspecified ? (
+
+
+
Upload New File
+
+
{
+ setUploadFileName(e.value);
+ }}
+ error={uploadFileError}
+ />
+
+ {uploadStarted ? (
+
+ ) : (
+
)}
-
-
- {!audioBlobExists && (
-
-
- Please allow browser permission before you start
- speaking
-
- )}
-
- {audioBlobExists && (
-
-
+ {file?.name}
+
+
+
)}
- )}
-
- ) : null}
- {unspecified ? (
-
-
-
Upload New File
-
-
{
- setUploadFileName(e.value);
- }}
- error={uploadFileError}
- />
-
- {uploadStarted ? (
-
- ) : (
-
-
- {({ isAuthorized }) =>
- isAuthorized ? (
-
- ) : (
- <>>
- )
- }
-
-
setModalOpenForCamera(true)}
- className="w-full"
- >
-
- Open Camera
-
-
-
- {t("upload")}
-
-
- )}
- {file && (
-
- {file?.name}
-
-
- )}
-
- ) : null}
-
-
-
-
+ ) : null}
+
+
+ )}
+
{
export const updateConsultation = (id: string, params: object) => {
return fireRequest("updateConsultation", [], params, { id: id });
};
+export const partialUpdateConsultation = (id: string, params: object) => {
+ return fireRequest("partialUpdateConsultation", [], params, { id: id });
+};
export const generateDischargeSummary = (pathParams: object) => {
return fireRequest("dischargeSummaryGenerate", [], {}, pathParams);
From f96d5cac0ac21f55067f089937b94296bc5fd09a Mon Sep 17 00:00:00 2001
From: Ashesh <3626859+Ashesh3@users.noreply.github.com>
Date: Mon, 1 Apr 2024 17:06:32 +0530
Subject: [PATCH 13/13] Fix invalid page title while rendering consent form
(#7515)
* Fix invalid page title while rendering consent form
* Refactor verifyNotification command in commands.ts
* fix the flaky test
* fix the flaky test
---------
Co-authored-by: Mohammed Nihal <57055998+nihal467@users.noreply.github.com>
---
cypress/e2e/patient_spec/patient_consultation.cy.ts | 1 +
cypress/e2e/patient_spec/patient_logupdate.cy.ts | 3 +++
cypress/support/commands.ts | 3 +--
.../Facility/ConsultationDetails/ConsultationUpdatesTab.tsx | 1 +
4 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/cypress/e2e/patient_spec/patient_consultation.cy.ts b/cypress/e2e/patient_spec/patient_consultation.cy.ts
index 36c3ebdcb40..d851e08ed14 100644
--- a/cypress/e2e/patient_spec/patient_consultation.cy.ts
+++ b/cypress/e2e/patient_spec/patient_consultation.cy.ts
@@ -193,6 +193,7 @@ describe("Patient Consultation in multiple combination", () => {
cy.verifyNotification(
"Create Diagnoses - Atleast one diagnosis is required"
);
+ cy.closeNotification();
patientConsultationPage.selectPatientDiagnosis(
diagnosis4,
"add-icd11-diagnosis-as-confirmed"
diff --git a/cypress/e2e/patient_spec/patient_logupdate.cy.ts b/cypress/e2e/patient_spec/patient_logupdate.cy.ts
index 57f31980679..143be363efc 100644
--- a/cypress/e2e/patient_spec/patient_logupdate.cy.ts
+++ b/cypress/e2e/patient_spec/patient_logupdate.cy.ts
@@ -42,6 +42,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
+ cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
@@ -79,6 +80,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
patientConsultationPage.selectPatientSuggestion("Domiciliary Care");
cy.submitButton("Update Consultation");
cy.verifyNotification("Consultation updated successfully");
+ cy.closeNotification();
patientLogupdate.clickLogupdate();
patientLogupdate.typePhysicalExamination(physicalExamination);
patientLogupdate.typeOtherDetails(otherExamination);
@@ -95,6 +97,7 @@ describe("Patient Log Update in Normal, Critical and TeleIcu", () => {
cy.get("#consciousness_level-2").click();
cy.submitButton("Save");
cy.verifyNotification("Consultation Updates details created successfully");
+ cy.closeNotification();
// edit the card and verify the data.
patientLogupdate.clickLogupdateCard("#dailyround-entry", patientCategory);
cy.verifyContentPresence("#consultation-preview", [
diff --git a/cypress/support/commands.ts b/cypress/support/commands.ts
index f4b7becdcae..94af548f6cd 100644
--- a/cypress/support/commands.ts
+++ b/cypress/support/commands.ts
@@ -78,8 +78,7 @@ Cypress.Commands.add(
);
Cypress.Commands.add("verifyNotification", (text) => {
- cy.get(".pnotify-container").should("exist").contains(text);
- return cy.get(".pnotify-container").contains(text).click({ force: true });
+ return cy.get(".pnotify-container").should("exist").contains(text);
});
Cypress.on("uncaught:exception", () => {
diff --git a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
index b3aca51c615..6b9848ad898 100644
--- a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
+++ b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx
@@ -703,6 +703,7 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => {
} )`}