diff --git a/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/AwaitingAdmissionVisitQueryEvaluatorTest.java b/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/AwaitingAdmissionVisitQueryEvaluatorTest.java index 13611dbf..dcc8ddd7 100644 --- a/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/AwaitingAdmissionVisitQueryEvaluatorTest.java +++ b/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/AwaitingAdmissionVisitQueryEvaluatorTest.java @@ -67,6 +67,7 @@ public class AwaitingAdmissionVisitQueryEvaluatorTest extends BaseReportingTest @Before public void setup() throws Exception { executeDataSet("baseTestDataset.xml"); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources dispositionDescriptor = ContextSensitiveMetadataTestUtils.setupDispositionDescriptor(conceptService, dispositionService); ContextSensitiveMetadataTestUtils.setupAdmissionDecisionConcept(conceptService, emrApiProperties); query = new AwaitingAdmissionVisitQuery(); diff --git a/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/MostRecentAdmissionRequestVisitDataEvaluatorTest.java b/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/MostRecentAdmissionRequestVisitDataEvaluatorTest.java index 91f7c990..1cb1c5ce 100644 --- a/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/MostRecentAdmissionRequestVisitDataEvaluatorTest.java +++ b/api-reporting/src/test/java/org/openmrs/module/emrapi/adt/reporting/evaluator/MostRecentAdmissionRequestVisitDataEvaluatorTest.java @@ -67,6 +67,7 @@ public class MostRecentAdmissionRequestVisitDataEvaluatorTest extends BaseReport @Before public void setup() throws Exception { executeDataSet("baseTestDataset.xml"); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources def = new MostRecentAdmissionRequestVisitDataDefinition(); dispositionDescriptor = ContextSensitiveMetadataTestUtils.setupDispositionDescriptor(conceptService, dispositionService); diagnosisMetadata = ContextSensitiveMetadataTestUtils.setupDiagnosisMetadata(conceptService, emrApiProperties); diff --git a/api/src/main/java/org/openmrs/module/emrapi/disposition/DispositionServiceImpl.java b/api/src/main/java/org/openmrs/module/emrapi/disposition/DispositionServiceImpl.java index 324c22f3..ac4ebb30 100644 --- a/api/src/main/java/org/openmrs/module/emrapi/disposition/DispositionServiceImpl.java +++ b/api/src/main/java/org/openmrs/module/emrapi/disposition/DispositionServiceImpl.java @@ -30,7 +30,7 @@ public class DispositionServiceImpl extends BaseOpenmrsService implements Dispos private PathMatchingResourcePatternResolver resourceResolver = new PathMatchingResourcePatternResolver(); - // TODO inject this in some better way than using a setter to override? + // can be overridden by Initializer starting with Iniz version 2.8.0 private String dispositionConfig = "dispositionConfig.json"; public DispositionServiceImpl(ConceptService conceptService, EmrConceptService emrConceptService) { diff --git a/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceComponentTest.java b/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceComponentTest.java index af5dbc75..e2abd639 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceComponentTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceComponentTest.java @@ -118,6 +118,7 @@ public boolean evaluate(Object o) { public void setUp() throws Exception { executeDataSet("baseTestDataset.xml"); administrationService.setGlobalProperty(EmrApiConstants.GP_INPATIENT_VISIT_EXPIRE_HOURS, ""); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources } @Test diff --git a/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceImplTest.java b/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceImplTest.java index b0944a4e..f96f4449 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceImplTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/adt/AdtServiceImplTest.java @@ -72,6 +72,7 @@ public class AdtServiceImplTest extends EmrApiContextSensitiveTest { @Before public void setup() throws Exception { executeDataSet("baseTestDataset.xml"); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources dispositionDescriptor = ContextSensitiveMetadataTestUtils.setupDispositionDescriptor(conceptService, dispositionService); ContextSensitiveMetadataTestUtils.setupAdmissionDecisionConcept(conceptService, emrApiProperties); visitLocation = testDataManager.location().name("Hospital").tag("Visit Location").save(); diff --git a/api/src/test/java/org/openmrs/module/emrapi/disposition/DispositionServiceTest.java b/api/src/test/java/org/openmrs/module/emrapi/disposition/DispositionServiceTest.java index 4c7fa1b4..ccc103db 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/disposition/DispositionServiceTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/disposition/DispositionServiceTest.java @@ -56,6 +56,7 @@ public void setUp(){ dispositionService = new DispositionServiceImpl(concertService, emrConceptService); dispositionService.setDispositionDescriptor(dispositionDescriptor); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources } @Test diff --git a/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java b/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java index 81a6f5e3..01bcec40 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/maternal/MaternalServiceImplTest.java @@ -61,6 +61,7 @@ public class MaternalServiceImplTest extends EmrApiContextSensitiveTest { @Before public void setUp() { executeDataSet("baseTestDataset.xml"); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources ContextSensitiveMetadataTestUtils.setupDispositionDescriptor(conceptService, dispositionService); ContextSensitiveMetadataTestUtils.setupAdmissionDecisionConcept(conceptService, emrApiProperties); } diff --git a/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java b/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java index f11d3ace..c50e2367 100644 --- a/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java +++ b/api/src/test/java/org/openmrs/module/emrapi/visit/VisitDomainWrapperComponentTest.java @@ -71,6 +71,7 @@ public class VisitDomainWrapperComponentTest extends EmrApiContextSensitiveTest @Before public void setup() throws Exception { executeDataSet("baseTestDataset.xml"); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources dispositionDescriptor = ContextSensitiveMetadataTestUtils.setupDispositionDescriptor(conceptService, dispositionService); ContextSensitiveMetadataTestUtils.setupAdmissionDecisionConcept(conceptService, emrApiProperties); ContextSensitiveMetadataTestUtils.setupDiagnosisMetadata(conceptService, emrApiProperties); diff --git a/api/src/test/resources/dispositionConfig.json b/api/src/test/resources/testDispositionConfig.json similarity index 100% rename from api/src/test/resources/dispositionConfig.json rename to api/src/test/resources/testDispositionConfig.json 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 3c9e79b0..cc758a85 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 @@ -51,6 +51,7 @@ public class EmrApiConfigurationControllerTest extends BaseModuleWebContextSensi @Before public void setUp() { executeDataSet("baseTestDataset.xml"); + dispositionService.setDispositionConfig("testDispositionConfig.json"); // use demo disposition config from test resources request = new MockHttpServletRequest(); response = new MockHttpServletResponse(); }