From a7dc1d03de69f167a51b93dcdf7fc062312a2876 Mon Sep 17 00:00:00 2001 From: Maikel Arabori <51713408+maikelarabori@users.noreply.github.com> Date: Mon, 23 Dec 2024 15:14:46 +0100 Subject: [PATCH] test: New ev/en analytics query tests [DHIS2-18695] (#19560) --- .../query/EnrollmentsQuery5AutoTest.java | 155 +++++++++++++ .../event/query/EventsQuery4AutoTest.java | 204 ++++++++++++++++++ .../generator/scenarios/enroll-query.json | 18 +- .../generator/scenarios/event-query.json | 23 +- 4 files changed, 397 insertions(+), 3 deletions(-) diff --git a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/enrollment/query/EnrollmentsQuery5AutoTest.java b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/enrollment/query/EnrollmentsQuery5AutoTest.java index 38109115c723..d48118d3f4ed 100644 --- a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/enrollment/query/EnrollmentsQuery5AutoTest.java +++ b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/enrollment/query/EnrollmentsQuery5AutoTest.java @@ -30,8 +30,10 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hisp.dhis.analytics.ValidationHelper.validateHeader; +import static org.hisp.dhis.analytics.ValidationHelper.validateRow; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import java.util.List; import java.util.Map; import org.hisp.dhis.AnalyticsApiTest; import org.hisp.dhis.test.e2e.actions.analytics.AnalyticsEnrollmentsActions; @@ -104,4 +106,157 @@ public void financialYear2022Sep() throws JSONException { // Assert rows. } + + @Test + public void programIndicatorWeightGainBetweenBirthAndLastPostnatal() throws JSONException { + // Given + QueryParamsBuilder params = + new QueryParamsBuilder() + .add("includeMetadataDetails=true") + .add("headers=ouname,lastupdated,qhTkqwAJLMv") + .add("lastUpdated=LAST_6_MONTHS") + .add("displayProperty=NAME") + .add("totalPages=false") + .add("rowContext=true") + .add("pageSize=10") + .add("outputType=ENROLLMENT") + .add("page=1") + .add("dimension=ou:USER_ORGUNIT,qhTkqwAJLMv:EQ:NV") + .add("desc=lastupdated") + .add("relativePeriodDate=2019-02-01"); + + // When + ApiResponse response = actions.query().get("IpHINAT79UW", JSON, JSON, params); + + // Then + response + .validate() + .statusCode(200) + .body("headers", hasSize(equalTo(3))) + .body("rows", hasSize(equalTo(10))) + .body("height", equalTo(10)) + .body("width", equalTo(3)) + .body("headerWidth", equalTo(3)); + + // Assert metaData. + String expectedMetaData = + "{\"pager\":{\"page\":1,\"pageSize\":10,\"isLastPage\":false},\"items\":{\"ImspTQPwCqd\":{\"uid\":\"ImspTQPwCqd\",\"code\":\"OU_525\",\"name\":\"Sierra Leone\",\"dimensionItemType\":\"ORGANISATION_UNIT\",\"valueType\":\"TEXT\",\"totalAggregationType\":\"SUM\"},\"LAST_6_MONTHS\":{\"name\":\"Last 6 months\"},\"IpHINAT79UW\":{\"uid\":\"IpHINAT79UW\",\"name\":\"Child Programme\"},\"ZzYYXq4fJie\":{\"uid\":\"ZzYYXq4fJie\",\"name\":\"Baby Postnatal\",\"description\":\"Baby Postnatal\"},\"USER_ORGUNIT\":{\"organisationUnits\":[\"ImspTQPwCqd\"]},\"ou\":{\"uid\":\"ou\",\"name\":\"Organisation unit\",\"dimensionType\":\"ORGANISATION_UNIT\"},\"A03MvHHogjR\":{\"uid\":\"A03MvHHogjR\",\"name\":\"Birth\",\"description\":\"Birth of the baby\"},\"qhTkqwAJLMv\":{\"uid\":\"qhTkqwAJLMv\",\"name\":\"Weight gain(in g) between birth and last postnatal\",\"description\":\"The average number of grams the baby has gained through the postnatal period. Only counted among the babies that has completed the postnatal period.\",\"dimensionItemType\":\"PROGRAM_INDICATOR\",\"valueType\":\"NUMBER\",\"aggregationType\":\"AVERAGE\",\"totalAggregationType\":\"SUM\"}},\"dimensions\":{\"pe\":[],\"ou\":[\"ImspTQPwCqd\"],\"qhTkqwAJLMv\":[]}}"; + String actualMetaData = new JSONObject((Map) response.extract("metaData")).toString(); + assertEquals(expectedMetaData, actualMetaData, false); + + // Assert headers. + validateHeader( + response, 0, "ouname", "Organisation unit name", "TEXT", "java.lang.String", false, true); + validateHeader( + response, + 1, + "lastupdated", + "Last updated on", + "DATETIME", + "java.time.LocalDateTime", + false, + true); + validateHeader( + response, + 2, + "qhTkqwAJLMv", + "Weight gain(in g) between birth and last postnatal", + "NUMBER", + "java.lang.Double", + false, + true); + + // Assert rows. + validateRow(response, 0, List.of("Elshadai Clinic", "2018-10-11 17:04:24.953", "")); + validateRow(response, 1, List.of("Tonko Maternity Clinic", "2018-08-07 15:47:29.301", "")); + validateRow(response, 2, List.of("Banka Makuloh MCHP", "2018-08-07 15:47:29.3", "")); + validateRow(response, 3, List.of("Yonibana MCHP", "2018-08-07 15:47:29.299", "")); + validateRow(response, 4, List.of("Kindoyal Hospital", "2018-08-07 15:47:29.298", "")); + validateRow(response, 5, List.of("Baoma-Peje CHP", "2018-08-07 15:47:29.297", "")); + validateRow(response, 6, List.of("Bontiwo MCHP", "2018-08-07 15:47:29.296", "")); + validateRow(response, 7, List.of("Konia MCHP", "2018-08-07 15:47:29.295", "")); + validateRow(response, 8, List.of("Kania MCHP", "2018-08-07 15:47:29.294", "")); + validateRow(response, 9, List.of("Taninahun (Malen) CHP", "2018-08-07 15:47:29.293", "")); + } + + @Test + public void programIndicatorWomenWithLowHbVisitWithinOneYear() throws JSONException { + // Given + QueryParamsBuilder params = + new QueryParamsBuilder() + .add("includeMetadataDetails=true") + .add("headers=ouname,lastupdated,EDp0b79Rbx9,programstatus,enrollmentdate") + .add("lastUpdated=LAST_12_MONTHS") + .add("displayProperty=NAME") + .add("totalPages=false") + .add("rowContext=true") + .add("pageSize=100") + .add("outputType=ENROLLMENT") + .add("page=1") + .add("dimension=EDp0b79Rbx9,ou:USER_ORGUNIT") + .add("relativePeriodDate=2019-02-01") + .add("desc=lastupdated"); + + // When + ApiResponse response = actions.query().get("WSGAb5XwJ3Y", JSON, JSON, params); + + // Then + response + .validate() + .statusCode(200) + .body("headers", hasSize(equalTo(5))) + .body("rows", hasSize(equalTo(2))) + .body("height", equalTo(2)) + .body("width", equalTo(5)) + .body("headerWidth", equalTo(5)); + + // Assert metaData. + String expectedMetaData = + "{\"pager\":{\"page\":1,\"pageSize\":100,\"isLastPage\":true},\"items\":{\"EDp0b79Rbx9\":{\"uid\":\"EDp0b79Rbx9\",\"name\":\"Number of women with at least one low hemoglobin visit within one year of the reporting period end\",\"description\":\"Counts the number of women enrolled in the reporting period, that has had at least one low-hemoglobin visit within the end of the reporting period.\",\"dimensionItemType\":\"PROGRAM_INDICATOR\",\"valueType\":\"NUMBER\",\"aggregationType\":\"COUNT\",\"totalAggregationType\":\"SUM\"},\"ImspTQPwCqd\":{\"uid\":\"ImspTQPwCqd\",\"code\":\"OU_525\",\"name\":\"Sierra Leone\",\"dimensionItemType\":\"ORGANISATION_UNIT\",\"valueType\":\"TEXT\",\"totalAggregationType\":\"SUM\"},\"PFDfvmGpsR3\":{\"uid\":\"PFDfvmGpsR3\",\"name\":\"Care at birth\",\"description\":\"Intrapartum care / Childbirth / Labour and delivery\"},\"bbKtnxRZKEP\":{\"uid\":\"bbKtnxRZKEP\",\"name\":\"Postpartum care visit\",\"description\":\"Provision of care for the mother for some weeks after delivery\"},\"USER_ORGUNIT\":{\"organisationUnits\":[\"ImspTQPwCqd\"]},\"ou\":{\"uid\":\"ou\",\"name\":\"Organisation unit\",\"dimensionType\":\"ORGANISATION_UNIT\"},\"PUZaKR0Jh2k\":{\"uid\":\"PUZaKR0Jh2k\",\"name\":\"Previous deliveries\",\"description\":\"Table for recording earlier deliveries\"},\"edqlbukwRfQ\":{\"uid\":\"edqlbukwRfQ\",\"name\":\"Second antenatal care visit\",\"description\":\"Antenatal care visit\"},\"WZbXY0S00lP\":{\"uid\":\"WZbXY0S00lP\",\"name\":\"First antenatal care visit\",\"description\":\"First antenatal care visit\"},\"WSGAb5XwJ3Y\":{\"uid\":\"WSGAb5XwJ3Y\",\"name\":\"WHO RMNCH Tracker\"},\"LAST_12_MONTHS\":{\"name\":\"Last 12 months\"}},\"dimensions\":{\"EDp0b79Rbx9\":[],\"pe\":[],\"ou\":[\"ImspTQPwCqd\"]}}"; + String actualMetaData = new JSONObject((Map) response.extract("metaData")).toString(); + assertEquals(expectedMetaData, actualMetaData, false); + + // Assert headers. + validateHeader( + response, 0, "ouname", "Organisation unit name", "TEXT", "java.lang.String", false, true); + validateHeader( + response, + 1, + "lastupdated", + "Last updated on", + "DATETIME", + "java.time.LocalDateTime", + false, + true); + validateHeader( + response, + 2, + "EDp0b79Rbx9", + "Number of women with at least one low hemoglobin visit within one year of the reporting period end", + "NUMBER", + "java.lang.Double", + false, + true); + validateHeader( + response, 3, "programstatus", "Program status", "TEXT", "java.lang.String", false, true); + validateHeader( + response, + 4, + "enrollmentdate", + "Date of first visit", + "DATETIME", + "java.time.LocalDateTime", + false, + true); + + // Assert rows. + validateRow( + response, + 0, + List.of("Ngelehun CHC", "2018-05-22 22:34:09.668", "0", "ACTIVE", "2023-10-14 02:00:00.0")); + validateRow( + response, + 1, + List.of("Ngelehun CHC", "2018-02-20 18:47:35.335", "0", "ACTIVE", "2023-10-15 02:00:00.0")); + } } diff --git a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/event/query/EventsQuery4AutoTest.java b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/event/query/EventsQuery4AutoTest.java index a0fb87dd9645..ffe664c11699 100644 --- a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/event/query/EventsQuery4AutoTest.java +++ b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/event/query/EventsQuery4AutoTest.java @@ -30,8 +30,10 @@ import static org.hamcrest.Matchers.equalTo; import static org.hamcrest.Matchers.hasSize; import static org.hisp.dhis.analytics.ValidationHelper.validateHeader; +import static org.hisp.dhis.analytics.ValidationHelper.validateRow; import static org.skyscreamer.jsonassert.JSONAssert.assertEquals; +import java.util.List; import java.util.Map; import org.hisp.dhis.AnalyticsApiTest; import org.hisp.dhis.test.e2e.actions.analytics.AnalyticsEventActions; @@ -104,4 +106,206 @@ public void financialYear2023Sep() throws JSONException { // Assert rows. } + + @Test + public void programIndicatorMalariaCaseMicroscopyPv514YearsFemale() throws JSONException { + // Given + QueryParamsBuilder params = + new QueryParamsBuilder() + .add("includeMetadataDetails=true") + .add("headers=ouname,TEmaOXaSPe7") + .add("stage=hYyB7FUS5eR") + .add("displayProperty=NAME") + .add("totalPages=false") + .add("enrollmentDate=MONTHS_THIS_YEAR") + .add("pageSize=10") + .add("outputType=EVENT") + .add("page=1") + .add("dimension=TEmaOXaSPe7,ou:USER_ORGUNIT") + .add("relativePeriodDate=2022-07-01") + .add("desc=lastupdated"); + + // When + ApiResponse response = actions.query().get("qDkgAbB5Jlk", JSON, JSON, params); + + // Then + response + .validate() + .statusCode(200) + .body("headers", hasSize(equalTo(2))) + .body("rows", hasSize(equalTo(10))) + .body("height", equalTo(10)) + .body("width", equalTo(2)) + .body("headerWidth", equalTo(2)); + + // Assert metaData. + String expectedMetaData = + "{\"pager\":{\"page\":1,\"pageSize\":10,\"isLastPage\":false},\"items\":{\"ImspTQPwCqd\":{\"uid\":\"ImspTQPwCqd\",\"code\":\"OU_525\",\"name\":\"Sierra Leone\",\"dimensionItemType\":\"ORGANISATION_UNIT\",\"valueType\":\"TEXT\",\"totalAggregationType\":\"SUM\"},\"TEmaOXaSPe7\":{\"uid\":\"TEmaOXaSPe7\",\"name\":\"Malaria case - microscopy Pv. 5-14 years female\",\"dimensionItemType\":\"PROGRAM_INDICATOR\",\"valueType\":\"NUMBER\",\"aggregationType\":\"COUNT\",\"totalAggregationType\":\"SUM\"},\"qDkgAbB5Jlk\":{\"uid\":\"qDkgAbB5Jlk\",\"name\":\"Malaria case diagnosis, treatment and investigation\",\"description\":\"All cases in an elimination setting should be registered in this program. Includes relevant case identifiers/details including the ID, Name, Index, Age, Gender, Location,etc..\"},\"USER_ORGUNIT\":{\"organisationUnits\":[\"ImspTQPwCqd\"]},\"ou\":{\"uid\":\"ou\",\"name\":\"Organisation unit\",\"dimensionType\":\"ORGANISATION_UNIT\"},\"MONTHS_THIS_YEAR\":{\"name\":\"Months this year\"},\"hYyB7FUS5eR\":{\"uid\":\"hYyB7FUS5eR\",\"name\":\"Diagnosis & treatment\",\"description\":\"This stage is used to identify initial diagnosis and treatment. This includes the method of case detection, information about the case include travel history, method of diagnosis, malaria species type and treatment details. \"}},\"dimensions\":{\"TEmaOXaSPe7\":[],\"pe\":[],\"ou\":[\"ImspTQPwCqd\"]}}"; + String actualMetaData = new JSONObject((Map) response.extract("metaData")).toString(); + assertEquals(expectedMetaData, actualMetaData, false); + + // Assert headers. + validateHeader( + response, 0, "ouname", "Organisation unit name", "TEXT", "java.lang.String", false, true); + validateHeader( + response, + 1, + "TEmaOXaSPe7", + "Malaria case - microscopy Pv. 5-14 years female", + "NUMBER", + "java.lang.Double", + false, + true); + + // Assert rows. + validateRow(response, 0, List.of("Ngelehun CHC", "1")); + validateRow(response, 1, List.of("Ngelehun CHC", "0")); + validateRow(response, 2, List.of("Ngelehun CHC", "0")); + validateRow(response, 3, List.of("Ngelehun CHC", "1")); + validateRow(response, 4, List.of("Ngelehun CHC", "0")); + validateRow(response, 5, List.of("Ngelehun CHC", "0")); + validateRow(response, 6, List.of("Ngelehun CHC", "0")); + validateRow(response, 7, List.of("Ngelehun CHC", "0")); + validateRow(response, 8, List.of("Ngelehun CHC", "0")); + validateRow(response, 9, List.of("Ngelehun CHC", "0")); + } + + @Test + public void programIndicatorNumberOfOrgUnitsWithOngoingArv() throws JSONException { + // Given + QueryParamsBuilder params = + new QueryParamsBuilder() + .add("includeMetadataDetails=true") + .add("headers=ouname,rxNjqzJ7dkK,lastupdated") + .add("lastUpdated=LAST_YEAR") + .add("stage=PUZaKR0Jh2k") + .add("displayProperty=NAME") + .add("totalPages=false") + .add("outputType=EVENT") + .add("pageSize=10") + .add("page=1") + .add("dimension=ou:USER_ORGUNIT,rxNjqzJ7dkK:GE:0") + .add("relativePeriodDate=2019-07-01") + .add("desc=lastupdated"); + + // When + ApiResponse response = actions.query().get("WSGAb5XwJ3Y", JSON, JSON, params); + + // Then + response + .validate() + .statusCode(200) + .body("headers", hasSize(equalTo(3))) + .body("rows", hasSize(equalTo(10))) + .body("height", equalTo(10)) + .body("width", equalTo(3)) + .body("headerWidth", equalTo(3)); + + // Assert metaData. + String expectedMetaData = + "{\"pager\":{\"page\":1,\"pageSize\":10,\"isLastPage\":false},\"items\":{\"ImspTQPwCqd\":{\"uid\":\"ImspTQPwCqd\",\"code\":\"OU_525\",\"name\":\"Sierra Leone\",\"dimensionItemType\":\"ORGANISATION_UNIT\",\"valueType\":\"TEXT\",\"totalAggregationType\":\"SUM\"},\"USER_ORGUNIT\":{\"organisationUnits\":[\"ImspTQPwCqd\"]},\"ou\":{\"uid\":\"ou\",\"name\":\"Organisation unit\",\"dimensionType\":\"ORGANISATION_UNIT\"},\"PUZaKR0Jh2k\":{\"uid\":\"PUZaKR0Jh2k\",\"name\":\"Previous deliveries\",\"description\":\"Table for recording earlier deliveries\"},\"WSGAb5XwJ3Y\":{\"uid\":\"WSGAb5XwJ3Y\",\"name\":\"WHO RMNCH Tracker\"},\"rxNjqzJ7dkK\":{\"uid\":\"rxNjqzJ7dkK\",\"name\":\"Number of organisation units with ongoing arv treatment\",\"dimensionItemType\":\"PROGRAM_INDICATOR\",\"valueType\":\"NUMBER\",\"aggregationType\":\"COUNT\",\"totalAggregationType\":\"SUM\"},\"LAST_YEAR\":{\"name\":\"Last year\"}},\"dimensions\":{\"pe\":[],\"ou\":[\"ImspTQPwCqd\"],\"rxNjqzJ7dkK\":[]}}"; + String actualMetaData = new JSONObject((Map) response.extract("metaData")).toString(); + assertEquals(expectedMetaData, actualMetaData, false); + + // Assert headers. + validateHeader( + response, 0, "ouname", "Organisation unit name", "TEXT", "java.lang.String", false, true); + validateHeader( + response, + 1, + "rxNjqzJ7dkK", + "Number of organisation units with ongoing arv treatment", + "NUMBER", + "java.lang.Double", + false, + true); + validateHeader( + response, + 2, + "lastupdated", + "Last updated on", + "DATETIME", + "java.time.LocalDateTime", + false, + true); + + // Assert rows. + validateRow(response, 0, List.of("Ngelehun CHC", "0", "2018-10-14 14:14:36.922")); + validateRow(response, 1, List.of("Kondewakoro CHP", "0", "2018-01-26 13:48:13.368")); + validateRow(response, 2, List.of("Mathen MCHP", "0", "2018-01-26 13:48:13.366")); + validateRow(response, 3, List.of("Mbokie CHP", "0", "2018-01-26 13:48:13.363")); + validateRow(response, 4, List.of("Grey Bush CHC", "0", "2018-01-26 13:48:13.359")); + validateRow(response, 5, List.of("Bangoma MCHP", "0", "2018-01-26 13:48:13.353")); + validateRow(response, 6, List.of("Blessed Mokaka East Clinic", "0", "2018-01-26 13:48:13.351")); + validateRow(response, 7, List.of("MCH Static/U5", "0", "2018-01-26 13:48:13.349")); + validateRow(response, 8, List.of("Konjo MCHP", "0", "2018-01-26 13:48:13.345")); + validateRow(response, 9, List.of("Lakka/Ogoo Farm CHC", "0", "2018-01-26 13:48:13.341")); + } + + @Test + public void programIndicatorBMIFemaleUnder5y() throws JSONException { + // Given + QueryParamsBuilder params = + new QueryParamsBuilder() + .add("includeMetadataDetails=true") + .add("headers=ouname,lastupdated,hlPt8H4bUOQ") + .add("lastUpdated=LAST_12_MONTHS") + .add("stage=Zj7UnCAulEk") + .add("displayProperty=NAME") + .add("totalPages=false") + .add("pageSize=5") + .add("outputType=EVENT") + .add("page=1") + .add("dimension=hlPt8H4bUOQ,ou:USER_ORGUNIT") + .add("relativePeriodDate=2019-02-01") + .add("desc=lastupdated"); + + // When + ApiResponse response = actions.query().get("eBAyeGv0exc", JSON, JSON, params); + + // Then + response + .validate() + .statusCode(200) + .body("headers", hasSize(equalTo(3))) + .body("rows", hasSize(equalTo(5))) + .body("height", equalTo(5)) + .body("width", equalTo(3)) + .body("headerWidth", equalTo(3)); + + // Assert metaData. + String expectedMetaData = + "{\"pager\":{\"page\":1,\"pageSize\":5,\"isLastPage\":false},\"items\":{\"ImspTQPwCqd\":{\"uid\":\"ImspTQPwCqd\",\"code\":\"OU_525\",\"name\":\"Sierra Leone\",\"dimensionItemType\":\"ORGANISATION_UNIT\",\"valueType\":\"TEXT\",\"totalAggregationType\":\"SUM\"},\"hlPt8H4bUOQ\":{\"uid\":\"hlPt8H4bUOQ\",\"name\":\"BMI female under 5 y\",\"dimensionItemType\":\"PROGRAM_INDICATOR\",\"valueType\":\"NUMBER\",\"aggregationType\":\"AVERAGE\",\"totalAggregationType\":\"SUM\"},\"eBAyeGv0exc\":{\"uid\":\"eBAyeGv0exc\",\"name\":\"Inpatient morbidity and mortality\"},\"USER_ORGUNIT\":{\"organisationUnits\":[\"ImspTQPwCqd\"]},\"ou\":{\"uid\":\"ou\",\"name\":\"Organisation unit\",\"dimensionType\":\"ORGANISATION_UNIT\"},\"Zj7UnCAulEk\":{\"uid\":\"Zj7UnCAulEk\",\"name\":\"Inpatient morbidity and mortality\",\"description\":\"Anonymous and ICD-10 coded inpatient data\"},\"LAST_12_MONTHS\":{\"name\":\"Last 12 months\"}},\"dimensions\":{\"hlPt8H4bUOQ\":[],\"pe\":[],\"ou\":[\"ImspTQPwCqd\"]}}"; + String actualMetaData = new JSONObject((Map) response.extract("metaData")).toString(); + assertEquals(expectedMetaData, actualMetaData, false); + + // Assert headers. + validateHeader( + response, 0, "ouname", "Organisation unit name", "TEXT", "java.lang.String", false, true); + validateHeader( + response, + 1, + "lastupdated", + "Last updated on", + "DATETIME", + "java.time.LocalDateTime", + false, + true); + validateHeader( + response, + 2, + "hlPt8H4bUOQ", + "BMI female under 5 y", + "NUMBER", + "java.lang.Double", + false, + true); + + // Assert rows. + validateRow(response, 0, List.of("Ngelehun CHC", "2018-08-04 15:19:36.473", "")); + validateRow(response, 1, List.of("Ngelehun CHC", "2018-08-04 15:18:06.085", "")); + validateRow(response, 2, List.of("Ngelehun CHC", "2018-08-04 15:17:39.87", "")); + validateRow(response, 3, List.of("Ngelehun CHC", "2018-08-04 15:17:10.722", "")); + validateRow(response, 4, List.of("Ngelehun CHC", "2018-08-04 15:15:50.672", "")); + } } diff --git a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/enroll-query.json b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/enroll-query.json index 0523d2077d1f..9f6af3e8d67e 100644 --- a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/enroll-query.json +++ b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/enroll-query.json @@ -2,17 +2,31 @@ "scenarios": [ { "name": "someDimensionsWithFilter", - "query": "/api/analytics/enrollments/query/ur1Edk5Oe2n?dimension=ou:O6uvpzGd5pu,J5jldMd8OHv,w75KJ2mc4zz,cejWyOfXge6:IN:Female,GUOBQt5K2WI:LIKE:Cape,ZkbAXlQUYJG.U5ubm6PPYrM,lZGmxYbs97q,OvY4VVhSDeJ:LE:45:NE:NV:!EQ:44&headers=ouname,J5jldMd8OHv,w75KJ2mc4zz,cejWyOfXge6,GUOBQt5K2WI,ZkbAXlQUYJG.U5ubm6PPYrM,lZGmxYbs97q,OvY4VVhSDeJ,lastupdated,createdbydisplayname,lastupdatedbydisplayname,enrollmentdate,programstatus&totalPages=false&rowContext=true&lastUpdated=LAST_10_YEARS&programStatus=ACTIVE&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=ENROLLMENT&asc=OvY4VVhSDeJ&relativePeriodDate=2022-07-01", + "query": "/api/analytics/enrollments/query/ur1Edk5Oe2n.json?dimension=ou:O6uvpzGd5pu,J5jldMd8OHv,w75KJ2mc4zz,cejWyOfXge6:IN:Female,GUOBQt5K2WI:LIKE:Cape,ZkbAXlQUYJG.U5ubm6PPYrM,lZGmxYbs97q,OvY4VVhSDeJ:LE:45:NE:NV:!EQ:44&headers=ouname,J5jldMd8OHv,w75KJ2mc4zz,cejWyOfXge6,GUOBQt5K2WI,ZkbAXlQUYJG.U5ubm6PPYrM,lZGmxYbs97q,OvY4VVhSDeJ,lastupdated,createdbydisplayname,lastupdatedbydisplayname,enrollmentdate,programstatus&totalPages=false&rowContext=true&lastUpdated=LAST_10_YEARS&programStatus=ACTIVE&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=ENROLLMENT&asc=OvY4VVhSDeJ&relativePeriodDate=2022-07-01", "version": { "min": 39 } }, { "name": "financialYear2022Sep", - "query": "/api/42/analytics/enrollments/query/IpHINAT79UW?dimension=ou:USER_ORGUNIT,GxdhnY5wmHq&headers=ouname,GxdhnY5wmHq,lastupdated&totalPages=false&rowContext=true&lastUpdated=2022Sep&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=ENROLLMENT", + "query": "/api/42/analytics/enrollments/query/IpHINAT79UW.json?dimension=ou:USER_ORGUNIT,GxdhnY5wmHq&headers=ouname,GxdhnY5wmHq,lastupdated&totalPages=false&rowContext=true&lastUpdated=2022Sep&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=ENROLLMENT", "version": { "min": 42 } + }, + { + "name": "programIndicatorWeightGainBetweenBirthAndLastPostnatal", + "query": "/api/42/analytics/enrollments/query/IpHINAT79UW.json?dimension=ou:USER_ORGUNIT,qhTkqwAJLMv:EQ:NV&headers=ouname,lastupdated,qhTkqwAJLMv&totalPages=false&rowContext=true&lastUpdated=LAST_6_MONTHS&displayProperty=NAME&pageSize=10&page=1&includeMetadataDetails=true&outputType=ENROLLMENT&desc=lastupdated&relativePeriodDate=2019-02-01", + "version": { + "min": 41 + } + }, + { + "name": "programIndicatorWomenWithLowHbVisitWithinOneYear", + "query": "/api/42/analytics/enrollments/query/WSGAb5XwJ3Y.json?dimension=EDp0b79Rbx9,ou:USER_ORGUNIT&headers=ouname,lastupdated,EDp0b79Rbx9,programstatus,enrollmentdate&totalPages=false&rowContext=true&lastUpdated=LAST_12_MONTHS&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=ENROLLMENT&relativePeriodDate=2019-02-01&desc=lastupdated", + "version": { + "min": 41 + } } ] } diff --git a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/event-query.json b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/event-query.json index 337fedb6e0b0..1f203fe9dfd2 100644 --- a/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/event-query.json +++ b/dhis-2/dhis-test-e2e/src/test/java/org/hisp/dhis/analytics/generator/scenarios/event-query.json @@ -16,10 +16,31 @@ }, { "name": "financialYear2023Sep", - "query": "/api/42/analytics/events/query/IpHINAT79UW?dimension=ou:USER_ORGUNIT,GxdhnY5wmHq&headers=ouname,GxdhnY5wmHq,lastupdated&totalPages=false&lastUpdated=2023Sep&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=EVENT&stage=A03MvHHogjR", + "query": "/api/analytics/events/query/IpHINAT79UW.json?dimension=ou:USER_ORGUNIT,GxdhnY5wmHq&headers=ouname,GxdhnY5wmHq,lastupdated&totalPages=false&lastUpdated=2023Sep&displayProperty=NAME&pageSize=100&page=1&includeMetadataDetails=true&outputType=EVENT&stage=A03MvHHogjR", "version": { "min": 42 } + }, + { + "name": "programIndicatorMalariaCaseMicroscopyPv5_14YearsFemale", + "query": "/api/analytics/events/query/qDkgAbB5Jlk.json?dimension=TEmaOXaSPe7,ou:USER_ORGUNIT&headers=ouname,TEmaOXaSPe7&totalPages=false&displayProperty=NAME&pageSize=10&page=1&includeMetadataDetails=true&outputType=EVENT&stage=hYyB7FUS5eR&enrollmentDate=MONTHS_THIS_YEAR&relativePeriodDate=2022-07-01&desc=lastupdated", + "version": { + "min": 41 + } + }, + { + "name": "programIndicatorNumberOfOrgUnitsWithOngoingArv", + "query": "/api/analytics/events/query/WSGAb5XwJ3Y.json?dimension=ou:USER_ORGUNIT,rxNjqzJ7dkK:GE:0&headers=ouname,rxNjqzJ7dkK,lastupdated&totalPages=false&displayProperty=NAME&includeMetadataDetails=true&outputType=EVENT&stage=PUZaKR0Jh2k&lastUpdated=LAST_YEAR&pageSize=10&page=1&relativePeriodDate=2019-07-01&desc=lastupdated", + "version": { + "min": 41 + } + }, + { + "name": "programIndicatorBMIFemaleUnder5y", + "query": "/api/analytics/events/query/eBAyeGv0exc.json?dimension=hlPt8H4bUOQ,ou:USER_ORGUNIT&headers=ouname,lastupdated,hlPt8H4bUOQ&totalPages=false&lastUpdated=LAST_12_MONTHS&displayProperty=NAME&pageSize=5&page=1&includeMetadataDetails=true&outputType=EVENT&stage=Zj7UnCAulEk&relativePeriodDate=2019-02-01&desc=lastupdated", + "version": { + "min": 41 + } } ] }