From b49247cfc154db3f3d1adc6e5a8c18c3ecc4d65c Mon Sep 17 00:00:00 2001 From: Ashesh <3626859+Ashesh3@users.noreply.github.com> Date: Fri, 1 Dec 2023 23:07:04 +0530 Subject: [PATCH] Add middleware address to AssetLocationObject and (#6778) update HL7 and ventilator middleware --- src/Components/Assets/AssetTypes.tsx | 1 + .../ConsultationDetails/ConsultationUpdatesTab.tsx | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Components/Assets/AssetTypes.tsx b/src/Components/Assets/AssetTypes.tsx index 8b96b6beeb7..a4005404da1 100644 --- a/src/Components/Assets/AssetTypes.tsx +++ b/src/Components/Assets/AssetTypes.tsx @@ -8,6 +8,7 @@ export interface AssetLocationObject { description: string; created_date?: string; modified_date?: string; + middleware_address?: string; facility: { id: string; name: string; diff --git a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx index 736a7c81575..bb584ae93e6 100644 --- a/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx +++ b/src/Components/Facility/ConsultationDetails/ConsultationUpdatesTab.tsx @@ -60,7 +60,10 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => { setMonitorBedData(monitorBedData); const assetDataForMonitor = monitorBedData?.asset_object; const hl7Meta = assetDataForMonitor?.meta; - const hl7Middleware = hl7Meta?.middleware_hostname || middleware_address; + const hl7Middleware = + hl7Meta?.middleware_hostname || + assetDataForMonitor?.location_object?.middleware_address || + middleware_address; if (hl7Middleware && hl7Meta?.local_ip_address) { setHL7SocketUrl( `wss://${hl7Middleware}/observations/${hl7Meta.local_ip_address}` @@ -85,7 +88,9 @@ export const ConsultationUpdatesTab = (props: ConsultationTabProps) => { setVentilatorBedData(ventilatorBedData); const ventilatorMeta = ventilatorBedData?.asset_object?.meta; const ventilatorMiddleware = - ventilatorMeta?.middleware_hostname || middleware_address; + ventilatorMeta?.middleware_hostname || + consultationBedVentilator?.location_object.middleware_address || + middleware_address; if (ventilatorMiddleware && ventilatorMeta?.local_ip_address) { setVentilatorSocketUrl( `wss://${ventilatorMiddleware}/observations/${ventilatorMeta?.local_ip_address}`