Skip to content

Commit

Permalink
Add middleware address to AssetLocationObject and (ohcnetwork#6778)
Browse files Browse the repository at this point in the history
update HL7 and ventilator middleware
  • Loading branch information
Ashesh3 authored Dec 1, 2023
1 parent 4ed48a9 commit b49247c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/Components/Assets/AssetTypes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface AssetLocationObject {
description: string;
created_date?: string;
modified_date?: string;
middleware_address?: string;
facility: {
id: string;
name: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}`
Expand All @@ -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}`
Expand Down

0 comments on commit b49247c

Please sign in to comment.