Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EA-205: Support loading dispositionConfig.json from the file system b… #248

Merged
merged 5 commits into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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
mseaton marked this conversation as resolved.
Show resolved Hide resolved
dispositionDescriptor = ContextSensitiveMetadataTestUtils.setupDispositionDescriptor(conceptService, dispositionService);
ContextSensitiveMetadataTestUtils.setupAdmissionDecisionConcept(conceptService, emrApiProperties);
query = new AwaitingAdmissionVisitQuery();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
Loading