From be895ff0634b66caa91995e425dbea0ad1635d2a Mon Sep 17 00:00:00 2001 From: Chi Bong Ho Date: Thu, 7 Nov 2024 14:11:21 -0500 Subject: [PATCH] EA-210 Add encounter types for cancelling ADT request and for bed assignment --- .../java/org/openmrs/module/emrapi/EmrApiConstants.java | 4 ++++ .../java/org/openmrs/module/emrapi/EmrApiProperties.java | 8 ++++++++ .../web/controller/EmrApiConfigurationControllerTest.java | 2 +- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/org/openmrs/module/emrapi/EmrApiConstants.java b/api/src/main/java/org/openmrs/module/emrapi/EmrApiConstants.java index 2d410db0..f8856c10 100644 --- a/api/src/main/java/org/openmrs/module/emrapi/EmrApiConstants.java +++ b/api/src/main/java/org/openmrs/module/emrapi/EmrApiConstants.java @@ -48,6 +48,10 @@ public class EmrApiConstants { public static final String GP_TRANSFER_REQUEST_ENCOUNTER_TYPE = "emr.transferRequestEncounterType"; + public static final String GP_BED_ASSIGNMENT_ENCOUNTER_TYPE = "emr.bedAssignmentEncounterType"; + + public static final String GP_CANCEL_ADT_REQUEST_ENCOUNTER_TYPE = "emr.cancelADTRequestEncounterType"; + public static final String GP_CHECK_IN_CLERK_ENCOUNTER_ROLE = "emr.checkInClerkEncounterRole"; public static final String GP_CLINICIAN_ENCOUNTER_ROLE = "emr.clinicianEncounterRole"; diff --git a/api/src/main/java/org/openmrs/module/emrapi/EmrApiProperties.java b/api/src/main/java/org/openmrs/module/emrapi/EmrApiProperties.java index 7d7c1e5f..5f50d0f7 100644 --- a/api/src/main/java/org/openmrs/module/emrapi/EmrApiProperties.java +++ b/api/src/main/java/org/openmrs/module/emrapi/EmrApiProperties.java @@ -129,6 +129,14 @@ public EncounterType getTransferRequestEncounterType() { return getEmrApiMetadataByCode(EncounterType.class, EmrApiConstants.GP_TRANSFER_REQUEST_ENCOUNTER_TYPE, false); } + public EncounterType getBedAssignmentEncounterType() { + return getEmrApiMetadataByCode(EncounterType.class, EmrApiConstants.GP_BED_ASSIGNMENT_ENCOUNTER_TYPE, false); + } + + public EncounterType getCancelADTRequestEncounterType() { + return getEmrApiMetadataByCode(EncounterType.class, EmrApiConstants.GP_CANCEL_ADT_REQUEST_ENCOUNTER_TYPE, false); + } + public Form getAdmissionForm() { return getEmrApiMetadataByCode(Form.class, EmrApiConstants.GP_ADMISSION_FORM, false); } diff --git a/omod/src/test/java/org/openmrs/module/emrapi/web/controller/EmrApiConfigurationControllerTest.java b/omod/src/test/java/org/openmrs/module/emrapi/web/controller/EmrApiConfigurationControllerTest.java index cc758a85..b0f5226f 100644 --- a/omod/src/test/java/org/openmrs/module/emrapi/web/controller/EmrApiConfigurationControllerTest.java +++ b/omod/src/test/java/org/openmrs/module/emrapi/web/controller/EmrApiConfigurationControllerTest.java @@ -67,7 +67,7 @@ public void shouldGetAsJson() throws Exception { @Test public void shouldGetDefaultRepresentation() { SimpleObject config = emrApiConfigurationController.getEmrApiConfiguration(request, response); - assertEquals(51, config.keySet().size()); + assertEquals(53, config.keySet().size()); assertEquals("org.openmrs.module.emrapi", config.get("metadataSourceName")); assertEquals("50", config.get("lastViewedPatientSizeLimit").toString()); Map unknownLocation = mapNode(config, "unknownLocation");