From cce3b3b8fda4d6b089ca100e05ffc79b3d9b8069 Mon Sep 17 00:00:00 2001 From: victor Date: Tue, 16 Mar 2021 13:11:10 +0100 Subject: [PATCH 1/6] [ANDROSDK-1338] Set ACCESSIBLE ouMode if TEI download by uid and orgunit is empty --- .../TrackedEntityInstanceQueryBuilderFactory.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java index dd1fa2520b..d6249c022e 100644 --- a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java +++ b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java @@ -140,13 +140,18 @@ private List queryPerProgram(ProgramDataDownloadParams params, ouMode = OrganisationUnitMode.SELECTED; orgUnits = getLinkedCaptureOrgUnitUids(programUid); } else { - ouMode = OrganisationUnitMode.DESCENDANTS; - orgUnits = getRootCaptureOrgUnitUids(); + if (params.uids().isEmpty()) { + ouMode = OrganisationUnitMode.DESCENDANTS; + orgUnits = getRootCaptureOrgUnitUids(); + } else { + ouMode = OrganisationUnitMode.ACCESSIBLE; + orgUnits = Collections.emptyList(); + } } List builders = new ArrayList<>(); - if (hasLimitByOrgUnit) { + if (hasLimitByOrgUnit && !orgUnits.isEmpty()) { for (String orgUnitUid : orgUnits) { builders.add(getBuilderFor(lastUpdated, Collections.singletonList(orgUnitUid), ouMode, params, limit) .program(programUid).programStatus(programStatus).programStartDate(programStartDate)); From 45fac93891172b0f1f11b54dd2e89e663ed447f4 Mon Sep 17 00:00:00 2001 From: victor Date: Tue, 16 Mar 2021 13:16:20 +0100 Subject: [PATCH 2/6] [ANDROSDK-1338] Relax condition to set ACCESSIBLE ouMode --- .../TrackedEntityInstanceQueryBuilderFactory.java | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java index d6249c022e..e383903ded 100644 --- a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java +++ b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java @@ -136,17 +136,15 @@ private List queryPerProgram(ProgramDataDownloadParams params, if (params.orgUnits().size() > 0) { ouMode = OrganisationUnitMode.SELECTED; orgUnits = params.orgUnits(); + } else if (params.uids().size() > 0) { + ouMode = OrganisationUnitMode.ACCESSIBLE; + orgUnits = Collections.emptyList(); } else if (hasLimitByOrgUnit) { ouMode = OrganisationUnitMode.SELECTED; orgUnits = getLinkedCaptureOrgUnitUids(programUid); } else { - if (params.uids().isEmpty()) { - ouMode = OrganisationUnitMode.DESCENDANTS; - orgUnits = getRootCaptureOrgUnitUids(); - } else { - ouMode = OrganisationUnitMode.ACCESSIBLE; - orgUnits = Collections.emptyList(); - } + ouMode = OrganisationUnitMode.DESCENDANTS; + orgUnits = getRootCaptureOrgUnitUids(); } List builders = new ArrayList<>(); From 8e804e5a9af513a7c00ac85c564c0b7d2c2db362 Mon Sep 17 00:00:00 2001 From: victor Date: Tue, 16 Mar 2021 13:40:06 +0100 Subject: [PATCH 3/6] [ANDROSDK-1338] Apply logic in global download --- .../internal/TrackedEntityInstanceQueryBuilderFactory.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java index e383903ded..d024b561a4 100644 --- a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java +++ b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/internal/TrackedEntityInstanceQueryBuilderFactory.java @@ -180,6 +180,9 @@ private List queryGlobal(ProgramDataDownloadParams params, if (params.orgUnits().size() > 0) { ouMode = OrganisationUnitMode.SELECTED; orgUnits = params.orgUnits(); + } else if (params.uids().size() > 0) { + ouMode = OrganisationUnitMode.ACCESSIBLE; + orgUnits = Collections.emptyList(); } else if (hasLimitByOrgUnit) { ouMode = OrganisationUnitMode.SELECTED; orgUnits = getCaptureOrgUnitUids(); @@ -190,7 +193,7 @@ private List queryGlobal(ProgramDataDownloadParams params, List builders = new ArrayList<>(); - if (hasLimitByOrgUnit) { + if (hasLimitByOrgUnit && !orgUnits.isEmpty()) { for (String orgUnitUid : orgUnits) { builders.add(getBuilderFor(lastUpdated, Collections.singletonList(orgUnitUid), ouMode, params, limit)); } From 6b7ca8043a9b5f8890cc62ef636a108dd31d1581 Mon Sep 17 00:00:00 2001 From: victor Date: Wed, 17 Mar 2021 16:08:30 +0100 Subject: [PATCH 4/6] [ANDROSDK-1339] TEI query: do not append empty string if orgunit list is empty --- .../search/TrackedEntityInstanceQueryCallFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/search/TrackedEntityInstanceQueryCallFactory.java b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/search/TrackedEntityInstanceQueryCallFactory.java index b27750cfc7..d8fc0bce87 100644 --- a/core/src/main/java/org/hisp/dhis/android/core/trackedentity/search/TrackedEntityInstanceQueryCallFactory.java +++ b/core/src/main/java/org/hisp/dhis/android/core/trackedentity/search/TrackedEntityInstanceQueryCallFactory.java @@ -79,8 +79,9 @@ private List queryTrackedEntityInstances(TrackedEntityIns String assignedUserModeStr = query.assignedUserMode() == null ? null : query.assignedUserMode().toString(); String enrollmentStatus = query.enrollmentStatus() == null ? null : query.enrollmentStatus().toString(); String eventStatus = query.eventStatus() == null ? null : query.eventStatus().toString(); + String orgUnits = query.orgUnits().isEmpty() ? null : + CollectionsHelper.joinCollectionWithSeparator(query.orgUnits(), ";"); - String orgUnits = CollectionsHelper.joinCollectionWithSeparator(query.orgUnits(), ";"); Call searchGridCall = service.query(orgUnits, orgUnitModeStr, query.program(), query.formattedProgramStartDate(), query.formattedProgramEndDate(), enrollmentStatus, query.formattedEventStartDate(), query.formattedEventEndDate(), eventStatus, From f0893e875bda11c385aa3b274a1438a36f5b0680 Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 22 Mar 2021 09:21:34 +0100 Subject: [PATCH 5/6] [MASTER-DEV] Version 1.3.2 --- core/build.gradle | 4 ++-- core/gradle.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/build.gradle b/core/build.gradle index b449a21ba8..430a009761 100644 --- a/core/build.gradle +++ b/core/build.gradle @@ -41,8 +41,8 @@ ext { buildToolsVersion: "29.0.3", minSdkVersion : 19, targetSdkVersion : 29, - versionCode : 231, - versionName : "1.3.1" + versionCode : 232, + versionName : "1.3.2" ] libraries = [ diff --git a/core/gradle.properties b/core/gradle.properties index 826bfa5c70..86c2250fed 100644 --- a/core/gradle.properties +++ b/core/gradle.properties @@ -29,8 +29,8 @@ # Properties which are consumed by plugins/gradle-mvn-push.gradle plugin. # They are used for publishing artifact to snapshot repository. -VERSION_NAME=1.3.1 -VERSION_CODE=231 +VERSION_NAME=1.3.2 +VERSION_CODE=232 GROUP=org.hisp.dhis From 5e44e6508dd9748b25f16b466669c288b909f50e Mon Sep 17 00:00:00 2001 From: victor Date: Mon, 22 Mar 2021 09:21:57 +0100 Subject: [PATCH 6/6] [MASTER-DEV] Update doc version 1.3.2 --- docs/content/developer/compatibility.md | 1 + docs/content/developer/getting-started.md | 2 +- docs/content/developer/known-issues.md | 6 +++++- docs/dhis2_android_sdk_developer_guide_INDEX.md | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/docs/content/developer/compatibility.md b/docs/content/developer/compatibility.md index 8ae421a6a0..c6f161a635 100644 --- a/docs/content/developer/compatibility.md +++ b/docs/content/developer/compatibility.md @@ -17,3 +17,4 @@ Compatibility table between DHIS2 Android SDK library, DHIS2 core and Android SD | 1.2.1 | 2.29 -> 2.34 | 19 - 28 | | 1.3.0 | 2.29 -> 2.35 | 19 - 29 | | 1.3.1 | 2.29 -> 2.35 | 19 - 29 | +| 1.3.2 | 2.29 -> 2.35 | 19 - 29 | diff --git a/docs/content/developer/getting-started.md b/docs/content/developer/getting-started.md index 6907c33bd4..18fe855e37 100644 --- a/docs/content/developer/getting-started.md +++ b/docs/content/developer/getting-started.md @@ -10,7 +10,7 @@ Include dependency in build.gradle. ```gradle dependencies { - implementation "org.hisp.dhis:android-core:1.3.1" + implementation "org.hisp.dhis:android-core:1.3.2" ... } ``` diff --git a/docs/content/developer/known-issues.md b/docs/content/developer/known-issues.md index c2e90de57a..a4b105e765 100644 --- a/docs/content/developer/known-issues.md +++ b/docs/content/developer/known-issues.md @@ -4,4 +4,8 @@ ## Data set completion -- In DHIS2 version 2.33.0 and 2.33.1, if a dataset is mark as uncompleted in the server, this value is not updated in the SDK. In those versions the API did not expose enough information to know if the status was complete or uncomplete. \ No newline at end of file +- In DHIS2 version 2.33.0 and 2.33.1, if a dataset is mark as uncompleted in the server, this value is not updated in the SDK. In those versions the API did not expose enough information to know if the status was complete or uncomplete. + +## Tracker relationships + +- In DHIS2 version 2.35.1, TEI relationships might fail to be downloaded at data sync. \ No newline at end of file diff --git a/docs/dhis2_android_sdk_developer_guide_INDEX.md b/docs/dhis2_android_sdk_developer_guide_INDEX.md index 92fc8e31a0..fe7b154caa 100644 --- a/docs/dhis2_android_sdk_developer_guide_INDEX.md +++ b/docs/dhis2_android_sdk_developer_guide_INDEX.md @@ -3,11 +3,11 @@ title: 'DHIS 2 Android SDK Developer Guide' author: 'DHIS 2' date: year: 2021 -month: January +month: March keywords: [DHIS2, Android] commit: version: master -applicable_txt: 'Applicable to version 1.3.1' +applicable_txt: 'Applicable to version 1.3.2' ---