diff --git a/src/Components/Facility/CentralNursingStation.tsx b/src/Components/Facility/CentralNursingStation.tsx index 0d510d8459e..26bed83635b 100644 --- a/src/Components/Facility/CentralNursingStation.tsx +++ b/src/Components/Facility/CentralNursingStation.tsx @@ -273,6 +273,10 @@ export default function CentralNursingStation({ facilityId }: Props) { {data.map((props) => (
{
{
{ 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( props.config @@ -39,8 +35,8 @@ 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 + const bpWithinMaxPersistence = dayjs(data.bp?.["date-time"]).isAfter( + props.patientCurrentBedAssignmentDate ); return ( diff --git a/src/Components/VitalsMonitor/types.ts b/src/Components/VitalsMonitor/types.ts index 60979a6f9b0..c73d7399b59 100644 --- a/src/Components/VitalsMonitor/types.ts +++ b/src/Components/VitalsMonitor/types.ts @@ -46,6 +46,7 @@ export interface ChannelOptions { } export interface IVitalsComponentProps { + patientCurrentBedAssignmentDate?: string; patientAssetBed?: PatientAssetBed; socketUrl: string; config?: ReturnType; diff --git a/src/Redux/api.tsx b/src/Redux/api.tsx index 7194aba5278..0e3fabf0bff 100644 --- a/src/Redux/api.tsx +++ b/src/Redux/api.tsx @@ -1,4 +1,5 @@ import { IConfig } from "../Common/hooks/useConfig"; + import { IAadhaarOtp, IAadhaarOtpTBody, @@ -29,6 +30,7 @@ import { } from "../Components/Assets/AssetTypes"; import { ConsultationModel, + CurrentBed, FacilityModel, LocationModel, WardModel, @@ -355,6 +357,7 @@ const routes = { listConsultationBeds: { path: "/api/v1/consultationbed/", method: "GET", + TRes: Type>(), }, createConsultationBed: { path: "/api/v1/consultationbed/",