From 4a2aa4ac98416814fec47cf36bdb3c7c5c715e4f Mon Sep 17 00:00:00 2001 From: Chi Bong Ho Date: Thu, 7 Nov 2024 14:15:00 -0500 Subject: [PATCH] (fix) O3-4104 Ward App - prevent cancelling of pending ADT request when patient swaps bed --- packages/esm-ward-app/src/hooks/useEmrConfiguration.ts | 4 ++++ .../patient-bed-swap-form.component.tsx | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/esm-ward-app/src/hooks/useEmrConfiguration.ts b/packages/esm-ward-app/src/hooks/useEmrConfiguration.ts index 2e2ba95ba..8f1b795f5 100644 --- a/packages/esm-ward-app/src/hooks/useEmrConfiguration.ts +++ b/packages/esm-ward-app/src/hooks/useEmrConfiguration.ts @@ -39,6 +39,8 @@ interface EmrApiConfigurationResponse { excludedEncounterTypes: Array; uuid: string; }>; + bedAssignmentEncounterType: OpenmrsResource; + cancelADTRequestEncounterType: OpenmrsResource; // There are many more keys to this object, but we only need these for now // Add more keys as needed } @@ -94,6 +96,8 @@ const customRepProps = [ ['unknownPatientPersonAttributeType', 'ref'], ['supportsVisitsLocationTag', '(uuid,display,name,links)'], ['transferForm', 'ref'], + ['bedAssignmentEncounterType', 'ref'], + ['cancelADTRequestEncounterType', 'ref'], ]; const customRep = `custom:${customRepProps.map((prop) => prop.join(':')).join(',')}`; diff --git a/packages/esm-ward-app/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx b/packages/esm-ward-app/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx index 1d4ac42ad..0d0955cea 100644 --- a/packages/esm-ward-app/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx +++ b/packages/esm-ward-app/src/ward-workspace/patient-transfer-bed-swap/patient-bed-swap-form.component.tsx @@ -69,7 +69,7 @@ export default function PatientBedSwapForm({ setShowErrorNotifications(false); createEncounter({ patient: patient.uuid, - encounterType: emrConfiguration.transferWithinHospitalEncounterType.uuid, + encounterType: emrConfiguration.bedAssignmentEncounterType.uuid, location: location?.uuid, encounterProviders: [ {