diff --git a/cypress/pageobject/Patient/PatientConsultation.ts b/cypress/pageobject/Patient/PatientConsultation.ts index 6937559d548..2eb6550cb8b 100644 --- a/cypress/pageobject/Patient/PatientConsultation.ts +++ b/cypress/pageobject/Patient/PatientConsultation.ts @@ -49,7 +49,7 @@ export class PatientConsultationPage { .click() .type("1A"); cy.get("#icd11_diagnoses_object [role='option']") - .contains("1A03 Intestinal infections due to Escherichia coli") + .contains("1A00 Cholera") .scrollIntoView() .click(); cy.get("label[for='icd11_diagnoses_object']").click(); @@ -57,7 +57,7 @@ export class PatientConsultationPage { cy.get("#icd11_principal_diagnosis [role='combobox']").click().type("1A"); cy.get("#icd11_principal_diagnosis [role='option']") - .contains("1A03 Intestinal infections due to Escherichia coli") + .contains("1A00 Cholera") .click(); cy.get("#consultation_notes").click().type(consulationNotes); diff --git a/src/Components/Auth/Login.tsx b/src/Components/Auth/Login.tsx index dd6a42d3983..140a0013fd9 100644 --- a/src/Components/Auth/Login.tsx +++ b/src/Components/Auth/Login.tsx @@ -151,7 +151,7 @@ export const Login = (props: { forgot?: boolean }) => { body: { ...valid }, }); setLoading(false); - if (res && res.statusText === "OK") { + if (res?.ok) { Notification.Success({ msg: t("password_sent"), }); diff --git a/src/Components/Auth/ResetPassword.tsx b/src/Components/Auth/ResetPassword.tsx index 2f02737f6de..47d120e1a97 100644 --- a/src/Components/Auth/ResetPassword.tsx +++ b/src/Components/Auth/ResetPassword.tsx @@ -72,7 +72,7 @@ export const ResetPassword = (props: any) => { const { res, error } = await request(routes.resetPassword, { body: { ...valid }, }); - if (res && res.statusText === "OK") { + if (res?.ok) { localStorage.removeItem(LocalStorageKeys.accessToken); Notification.Success({ msg: t("password_reset_success"), @@ -89,7 +89,7 @@ export const ResetPassword = (props: any) => { const { res } = await request(routes.checkResetToken, { body: { token: props.token }, }); - if (!res || res.statusText !== "OK") { + if (!res || !res.ok) { navigate("/invalid-reset"); } }; diff --git a/src/Components/Common/DateInputV2.tsx b/src/Components/Common/DateInputV2.tsx index 7036d5c8bfb..12009cb495f 100644 --- a/src/Components/Common/DateInputV2.tsx +++ b/src/Components/Common/DateInputV2.tsx @@ -113,6 +113,7 @@ const DateInputV2: React.FC = ({ ) ); close(); + setIsOpen?.(false); }; const getDayCount = (date: Date) => { @@ -212,13 +213,7 @@ const DateInputV2: React.FC = ({ {({ open, close }) => (
- { - setIsOpen?.(!isOpen); - }} - > + = ({ {(open || isOpen) && ( { - setIsOpen?.(false); - }} static className={classNames( "cui-dropdown-base absolute mt-0.5 w-72 divide-y-0 p-4", diff --git a/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx b/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx index 1b45fd80ddc..44cadd8263c 100644 --- a/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx +++ b/src/Components/VitalsMonitor/HL7PatientVitalsMonitor.tsx @@ -8,6 +8,15 @@ import { classNames } from "../../Utils/utils"; import { IVitalsComponentProps, VitalsValueBase } from "./types"; import { triggerGoal } from "../../Integrations/Plausible"; import useAuthUser from "../../Common/hooks/useAuthUser"; +import dayjs from "dayjs"; + +const minutesAgo = (timestamp: string) => { + return `${dayjs().diff(dayjs(timestamp), "minute")}m ago`; +}; + +const isWithinMinutes = (timestamp: string, minutes: number) => { + return dayjs().diff(dayjs(timestamp), "minute") < minutes; +}; export default function HL7PatientVitalsMonitor(props: IVitalsComponentProps) { const { connect, waveformCanvas, data, isOnline } = useHL7VitalsMonitor( @@ -30,6 +39,10 @@ export default function HL7PatientVitalsMonitor(props: IVitalsComponentProps) { connect(props.socketUrl); }, [props.socketUrl]); + const bpWithinMaxPersistence = !!( + (data.bp?.["date-time"] && isWithinMinutes(data.bp?.["date-time"], 30)) // Max blood pressure persistence is 30 minutes + ); + return (
{props.patientAssetBed && ( @@ -97,24 +110,37 @@ export default function HL7PatientVitalsMonitor(props: IVitalsComponentProps) { {/* Blood Pressure */}
-
+
NIBP - {data.bp?.systolic.unit ?? "--"} + + {bpWithinMaxPersistence ? data.bp?.systolic.unit ?? "--" : "--"} + + + {data.bp?.["date-time"] && minutesAgo(data.bp?.["date-time"])} +
Sys / Dia
- {data.bp?.systolic.value ?? "--"} + + {bpWithinMaxPersistence + ? data.bp?.systolic.value ?? "--" + : "--"} + / - {data.bp?.diastolic.value ?? "--"} + + {bpWithinMaxPersistence + ? data.bp?.diastolic.value ?? "--" + : "--"} +
Mean - {data.bp?.map.value ?? "--"} + {bpWithinMaxPersistence ? data.bp?.map.value ?? "--" : "--"}
diff --git a/src/Components/VitalsMonitor/types.ts b/src/Components/VitalsMonitor/types.ts index 066b7a7cc78..60979a6f9b0 100644 --- a/src/Components/VitalsMonitor/types.ts +++ b/src/Components/VitalsMonitor/types.ts @@ -8,7 +8,7 @@ export interface VitalsDataBase { "patient-name": string; } -export interface VitalsValueBase { +export interface VitalsValueBase extends VitalsDataBase { value: number; unit: string; interpretation: string; diff --git a/src/Components/VitalsMonitor/useHL7VitalsMonitor.ts b/src/Components/VitalsMonitor/useHL7VitalsMonitor.ts index 8b74a2d05d2..ed16cc2edfd 100644 --- a/src/Components/VitalsMonitor/useHL7VitalsMonitor.ts +++ b/src/Components/VitalsMonitor/useHL7VitalsMonitor.ts @@ -8,11 +8,12 @@ import useCanvas from "../../Common/hooks/useCanvas"; import { ChannelOptions, IVitalsComponentProps, + VitalsDataBase, VitalsValueBase as VitalsValue, } from "./types"; import { getChannel, getVitalsCanvasSizeAndDuration } from "./utils"; -interface VitalsBPValue { +interface VitalsBPValue extends VitalsDataBase { systolic: VitalsValue; diastolic: VitalsValue; map: VitalsValue; diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 9cf9a0b6643..8a4ca5cf1df 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -55,6 +55,7 @@ const routes = { checkResetToken: { path: "/api/v1/password_reset/check/", method: "POST", + noAuth: true, TRes: Type>(), TBody: Type<{ token: string }>(), }, @@ -62,6 +63,7 @@ const routes = { resetPassword: { path: "/api/v1/password_reset/confirm/", method: "POST", + noAuth: true, TRes: Type>(), TBody: Type<{ password: string; confirm: string }>(), }, @@ -69,6 +71,7 @@ const routes = { forgotPassword: { path: "/api/v1/password_reset/", method: "POST", + noAuth: true, TRes: Type>(), TBody: Type<{ username: string }>(), },