Skip to content

Commit b360c9f

Browse files
committed
Revert "REPORT-913: Migrate to OpenMRS Platform 2.4.0 (#262)"
This reverts commit e4022f6.
1 parent e4022f6 commit b360c9f

File tree

47 files changed

+2916
-731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+2916
-731
lines changed

.github/workflows/maven.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ jobs:
1414
matrix:
1515
platform: [ ubuntu-latest ]
1616
java-version: [ 8 ]
17+
profile: [ 1.10, 1.11, 1.12, 2.0, 2.1, 2.2, 2.3, 2.4 ]
1718

1819
runs-on: ${{ matrix.platform }}
1920
env:
@@ -35,5 +36,5 @@ jobs:
3536
restore-keys: |
3637
${{ runner.os }}-maven-
3738
- name: Build with Maven
38-
run: mvn clean install --batch-mode --show-version --file pom.xml
39+
run: mvn clean install -P ${{ matrix.profile }} --batch-mode --show-version --file pom.xml
3940

api-1.10/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/.settings
2+
/.classpath
3+
/.project
4+
/target

api-1.10/pom.xml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
2+
<modelVersion>4.0.0</modelVersion>
3+
4+
<parent>
5+
<groupId>org.openmrs.module</groupId>
6+
<artifactId>reporting</artifactId>
7+
<version>1.28.0-SNAPSHOT</version>
8+
</parent>
9+
10+
<artifactId>reporting-api-1.10</artifactId>
11+
<packaging>jar</packaging>
12+
<name>reporting Module api 1.10</name>
13+
<description>1.10 api project for reporting</description>
14+
15+
<properties>
16+
<openMRSVersion>1.10.6</openMRSVersion>
17+
</properties>
18+
19+
<dependencies>
20+
<dependency>
21+
<groupId>${project.parent.groupId}</groupId>
22+
<artifactId>${project.parent.artifactId}-api</artifactId>
23+
<version>${project.parent.version}</version>
24+
<scope>provided</scope>
25+
</dependency>
26+
27+
<dependency>
28+
<groupId>${project.parent.groupId}</groupId>
29+
<artifactId>${project.parent.artifactId}-api-tests</artifactId>
30+
<version>${project.parent.version}</version>
31+
<type>test-jar</type>
32+
<scope>test</scope>
33+
</dependency>
34+
35+
<dependency>
36+
<groupId>org.openmrs.api</groupId>
37+
<artifactId>openmrs-api</artifactId>
38+
<version>${openMRSVersion}</version>
39+
<scope>provided</scope>
40+
</dependency>
41+
42+
<dependency>
43+
<groupId>org.openmrs.api</groupId>
44+
<artifactId>openmrs-api</artifactId>
45+
<type>test-jar</type>
46+
<version>${openMRSVersion}</version>
47+
<scope>test</scope>
48+
</dependency>
49+
50+
<dependency>
51+
<groupId>org.openmrs.test</groupId>
52+
<artifactId>openmrs-test</artifactId>
53+
<version>${openMRSVersion}</version>
54+
<type>pom</type>
55+
<scope>test</scope>
56+
</dependency>
57+
58+
</dependencies>
59+
60+
<build>
61+
<resources>
62+
<resource>
63+
<directory>src/main/resources</directory>
64+
<filtering>true</filtering>
65+
</resource>
66+
</resources>
67+
68+
<testResources>
69+
<testResource>
70+
<directory>src/test/resources</directory>
71+
<includes>
72+
<include>**/*.properties</include>
73+
<include>**/*.xml</include>
74+
</includes>
75+
<filtering>true</filtering>
76+
</testResource>
77+
<testResource>
78+
<directory>src/test/resources</directory>
79+
<excludes>
80+
<exclude>**/*.properties</exclude>
81+
<exclude>**/*.xml</exclude>
82+
</excludes>
83+
<filtering>false</filtering>
84+
</testResource>
85+
</testResources>
86+
</build>
87+
88+
</project>
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@
1010

1111
package org.openmrs.module.reporting.cohort.definition;
1212

13-
import org.openmrs.CareSetting;
1413
import org.openmrs.Concept;
14+
import org.openmrs.CareSetting;
1515
import org.openmrs.Drug;
16-
import org.openmrs.module.reporting.common.Localized;
16+
1717
import org.openmrs.module.reporting.common.Match;
18+
import org.openmrs.module.reporting.common.Localized;
1819
import org.openmrs.module.reporting.definition.configuration.ConfigurationProperty;
1920
import org.openmrs.module.reporting.definition.configuration.ConfigurationPropertyCachingStrategy;
2021
import org.openmrs.module.reporting.evaluation.caching.Caching;
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,20 +10,22 @@
1010

1111
package org.openmrs.module.reporting.cohort.definition.evaluator;
1212

13+
import org.apache.commons.lang3.time.DateUtils;
1314
import org.openmrs.Cohort;
1415
import org.openmrs.DrugOrder;
15-
import org.openmrs.annotation.Handler;
16-
import org.openmrs.module.reporting.cohort.EvaluatedCohort;
1716
import org.openmrs.module.reporting.cohort.definition.CohortDefinition;
18-
import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition;
19-
import org.openmrs.module.reporting.common.Match;
20-
import org.openmrs.module.reporting.common.ObjectUtil;
2117
import org.openmrs.module.reporting.evaluation.EvaluationContext;
2218
import org.openmrs.module.reporting.evaluation.querybuilder.HqlQueryBuilder;
2319
import org.openmrs.module.reporting.evaluation.service.EvaluationService;
24-
import org.springframework.beans.factory.annotation.Autowired;
20+
import org.openmrs.module.reporting.cohort.EvaluatedCohort;
21+
import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition;
22+
import org.openmrs.module.reporting.common.ObjectUtil;
23+
import org.openmrs.module.reporting.common.Match;
24+
import org.openmrs.annotation.Handler;
2525

26+
import org.springframework.beans.factory.annotation.Autowired;
2627
import java.util.List;
28+
import java.util.Date;
2729

2830
@Handler(supports = { DrugOrderCohortDefinition.class })
2931
public class DrugOrderCohortDefinitionEvaluator implements CohortDefinitionEvaluator {
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
/**
2+
* This Source Code Form is subject to the terms of the Mozilla Public License,
3+
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
4+
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5+
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6+
*
7+
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8+
* graphic logo is a trademark of OpenMRS Inc.
9+
*/
10+
package org.openmrs.module.reporting.cohort.definition.library;
11+
12+
import org.openmrs.Concept;
13+
import org.openmrs.CareSetting;
14+
import org.openmrs.Drug;
15+
import org.openmrs.module.reporting.common.Match;
16+
import org.openmrs.module.reporting.cohort.definition.CohortDefinition;
17+
import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition;
18+
import org.openmrs.module.reporting.cohort.definition.library.BuiltInCohortDefinitionLibrary;
19+
import org.openmrs.module.reporting.definition.library.DocumentedDefinition;
20+
import org.openmrs.module.reporting.evaluation.parameter.Parameter;
21+
import org.springframework.stereotype.Component;
22+
23+
import java.util.Date;
24+
import java.util.List;
25+
26+
/**
27+
* Basic set of cohort definitions
28+
*/
29+
@Component
30+
public class BuiltInCohortDefinitionLibrary1_10 extends BuiltInCohortDefinitionLibrary {
31+
32+
33+
34+
@DocumentedDefinition("drugOrderSearch")
35+
public CohortDefinition getDrugOrderSearch() {
36+
CohortDefinition drugOrderCohortDefinition = new DrugOrderCohortDefinition();
37+
drugOrderCohortDefinition.addParameter(new Parameter("which", "reporting.parameter.which", Match.class));
38+
drugOrderCohortDefinition.addParameter(new Parameter("drugConcepts", "reporting.parameter.drugConcepts", Concept.class, List.class, null));
39+
drugOrderCohortDefinition.addParameter(new Parameter("drugSets", "reporting.parameter.drugSets", Concept.class, List.class, null));
40+
drugOrderCohortDefinition.addParameter(new Parameter("activatedOnOrBefore", "reporting.parameter.activatedOnOrBefore", Date.class));
41+
drugOrderCohortDefinition.addParameter(new Parameter("activatedOnOrAfter", "reporting.parameter.activatedOnOrAfter", Date.class));
42+
drugOrderCohortDefinition.addParameter(new Parameter("activeOnOrBefore", "reporting.parameter.activeOnOrBefore", Date.class));
43+
drugOrderCohortDefinition.addParameter(new Parameter("activeOnOrAfter", "reporting.parameter.activeOnOrAfter", Date.class));
44+
drugOrderCohortDefinition.addParameter(new Parameter("activeOnDate", "reporting.parameter.activeOnDate", Date.class));
45+
drugOrderCohortDefinition.addParameter(new Parameter("careSetting", "reporting.parameter.careSetting", CareSetting.class));
46+
drugOrderCohortDefinition.addParameter(new Parameter("drugs", "reporting.parameter.drugs", Drug.class, List.class, null));
47+
return drugOrderCohortDefinition;
48+
}
49+
}
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@
1010

1111
package org.openmrs.module.reporting.cohort.definition.evaluator;
1212

13-
import org.apache.commons.lang3.time.DateUtils;
13+
import java.util.ArrayList;
14+
import java.util.List;
15+
import java.util.Date;
1416
import org.junit.After;
17+
1518
import org.junit.Assert;
1619
import org.junit.Before;
1720
import org.junit.Test;
18-
import org.openmrs.CareSetting;
1921
import org.openmrs.Cohort;
2022
import org.openmrs.Concept;
23+
import org.openmrs.CareSetting;
2124
import org.openmrs.Drug;
2225
import org.openmrs.api.OrderService;
2326
import org.openmrs.api.context.Context;
27+
import org.openmrs.module.reporting.common.Match;
2428
import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition;
2529
import org.openmrs.module.reporting.cohort.definition.service.CohortDefinitionService;
2630
import org.openmrs.module.reporting.common.DateUtil;
27-
import org.openmrs.module.reporting.common.Match;
2831
import org.openmrs.test.BaseModuleContextSensitiveTest;
29-
30-
import java.util.ArrayList;
31-
import java.util.Date;
32-
import java.util.List;
32+
import org.apache.commons.lang3.time.DateUtils;
3333

3434

3535
public class DrugOrderCohortDefinitionEvaluatorTest extends BaseModuleContextSensitiveTest {
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/**
2+
* This Source Code Form is subject to the terms of the Mozilla Public License,
3+
* v. 2.0. If a copy of the MPL was not distributed with this file, You can
4+
* obtain one at http://mozilla.org/MPL/2.0/. OpenMRS is also distributed under
5+
* the terms of the Healthcare Disclaimer located at http://openmrs.org/license.
6+
*
7+
* Copyright (C) OpenMRS Inc. OpenMRS is a registered trademark and the OpenMRS
8+
* graphic logo is a trademark of OpenMRS Inc.
9+
*/
10+
package org.openmrs.module.reporting.cohort.definition.library;
11+
12+
import org.junit.Before;
13+
import org.junit.Test;
14+
import org.openmrs.CareSetting;
15+
import org.openmrs.Concept;
16+
import org.openmrs.Drug;
17+
import org.openmrs.module.reporting.common.Match;
18+
import org.openmrs.module.reporting.cohort.definition.CohortDefinition;
19+
import org.openmrs.module.reporting.cohort.definition.DrugOrderCohortDefinition;
20+
21+
import java.util.Date;
22+
import java.util.List;
23+
24+
import static org.hamcrest.Matchers.is;
25+
import static org.junit.Assert.assertThat;
26+
import static org.junit.Assert.assertTrue;
27+
import static org.openmrs.module.reporting.common.ReportingMatchers.hasParameter;
28+
29+
/**
30+
*
31+
*/
32+
public class BuiltInCohortDefinitionLibrary1_10Test {
33+
34+
private BuiltInCohortDefinitionLibrary1_10 library;
35+
36+
@Before
37+
public void setUp() throws Exception {
38+
library = new BuiltInCohortDefinitionLibrary1_10();
39+
}
40+
41+
@Test
42+
public void testgetDrugOrderSearch() throws Exception {
43+
CohortDefinition drugOrderCohortDefinition = library.getDrugOrderSearch();
44+
assertTrue(DrugOrderCohortDefinition.class.isAssignableFrom(drugOrderCohortDefinition.getClass()));
45+
assertThat(drugOrderCohortDefinition, hasParameter("which", Match.class));
46+
assertThat(drugOrderCohortDefinition, hasParameter("drugConcepts", Concept.class, List.class));
47+
assertThat(drugOrderCohortDefinition, hasParameter("drugSets", Concept.class, List.class));
48+
assertThat(drugOrderCohortDefinition, hasParameter("activatedOnOrBefore", Date.class));
49+
assertThat(drugOrderCohortDefinition, hasParameter("activatedOnOrAfter", Date.class));
50+
assertThat(drugOrderCohortDefinition, hasParameter("activeOnOrBefore", Date.class));
51+
assertThat(drugOrderCohortDefinition, hasParameter("activeOnOrAfter", Date.class));
52+
assertThat(drugOrderCohortDefinition, hasParameter("activeOnDate", Date.class));
53+
assertThat(drugOrderCohortDefinition, hasParameter("careSetting", CareSetting.class));
54+
assertThat(drugOrderCohortDefinition, hasParameter("drugs", Drug.class, List.class));
55+
}
56+
57+
}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,10 @@
7474
<patient patient_id="24" creator="1" date_created="2009-01-18 00:00:00.0" voided="false" void_reason=""/>
7575
<patient patient_id="999" creator="1" date_created="2006-01-18 00:00:00.0" changed_by="1" date_changed="2008-08-18 12:24:34.0" voided="true" void_reason="For test purposes"/>
7676

77-
<patient_identifier_type patient_identifier_type_id="1" name="OpenMRS Identification Number" description="Unique number used in OpenMRS" format="" creator="1" date_created="2005-09-22 00:00:00.0" required="false" validator="org.openmrs.patient.impl.LuhnIdentifierValidator" retired="false" uuid="1a339fe9-38bc-4ab3-b180-320988c0b968"/>
77+
<patient_identifier_type patient_identifier_type_id="1" name="OpenMRS Identification Number" description="Unique number used in OpenMRS" format="" check_digit="true" creator="1" date_created="2005-09-22 00:00:00.0" required="false" validator="org.openmrs.patient.impl.LuhnIdentifierValidator" retired="false" uuid="1a339fe9-38bc-4ab3-b180-320988c0b968"/>
7878
<patient_identifier patient_identifier_id="4" patient_id="7" identifier="6TS-4" identifier_type="1" preferred="0" location_id="1" creator="1" date_created="2006-01-18 00:00:00.0" voided="false" void_reason="" uuid="489edb7f-0786-4726-88a3-f0fcd2505d1a"/>
79-
<patient_identifier_type patient_identifier_type_id="2" name="Old Identification Number" description="Number given out prior to the OpenMRS system (No check digit)" format="" creator="1" date_created="2005-09-22 00:00:00.0" required="false" retired="false" uuid="2f470aa8-1d73-43b7-81b5-01f0c0dfa53c"/>
80-
<patient_identifier_type patient_identifier_type_id="4" name="Social Security Number" description="Soc security ID" format="" creator="1" date_created="2008-08-15 15:59:20.0" required="false" format_description="" validator="" retired="true" retired_by="1" date_retired="2008-08-15 00:00:00.0" retire_reason="test" uuid="158d6b17-a8ab-435b-8fe3-952a04bda757"/>
79+
<patient_identifier_type patient_identifier_type_id="2" name="Old Identification Number" description="Number given out prior to the OpenMRS system (No check digit)" format="" check_digit="false" creator="1" date_created="2005-09-22 00:00:00.0" required="false" retired="false" uuid="2f470aa8-1d73-43b7-81b5-01f0c0dfa53c"/>
80+
<patient_identifier_type patient_identifier_type_id="4" name="Social Security Number" description="Soc security ID" format="" check_digit="false" creator="1" date_created="2008-08-15 15:59:20.0" required="false" format_description="" validator="" retired="true" retired_by="1" date_retired="2008-08-15 00:00:00.0" retire_reason="test" uuid="158d6b17-a8ab-435b-8fe3-952a04bda757"/>
8181

8282
<patient_identifier patient_identifier_id="1" patient_id="2" identifier="101" identifier_type="2" preferred="0" location_id="1" creator="1" date_created="2005-09-22 00:00:00.0" voided="false" void_reason="" uuid="ff41928c-3bca-48d9-a4dc-9198f6b2873b"/>
8383
<patient_identifier patient_identifier_id="2" patient_id="2" identifier="101-6" identifier_type="1" preferred="1" location_id="1" creator="1" date_created="2005-09-22 00:00:00.0" voided="false" void_reason="" uuid="8a9aac6e-3f9f-4ed2-8fb5-25215f8bb614"/>

api-1.9/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/target/

0 commit comments

Comments
 (0)