From d352d9fa280eb98c8e840a9c0bd9368d490dc1d9 Mon Sep 17 00:00:00 2001 From: chibongho Date: Tue, 12 Nov 2024 10:11:23 -0500 Subject: [PATCH] (fix) O3-4104 Ward App - prevent cancelling of pending ADT request when patient swaps bed (#1367) --- 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: [ {