diff --git a/opensrp-path-zeir/build.gradle b/opensrp-path-zeir/build.gradle index 4edd09d7..50532a1f 100644 --- a/opensrp-path-zeir/build.gradle +++ b/opensrp-path-zeir/build.gradle @@ -71,13 +71,13 @@ android { applicationVariants.all { variant -> if (variant.name == "debug") { variant.outputs.each { output -> - output.versionCodeOverride = 9 - output.versionNameOverride = "0.0.9-debug" + output.versionCodeOverride = 10 + output.versionNameOverride = "0.0.10-debug" } } else if (variant.name == "preview") { variant.outputs.each { output -> - output.versionCodeOverride = 9 - output.versionNameOverride = "0.0.9-preview" + output.versionCodeOverride = 10 + output.versionNameOverride = "0.0.10-preview" } } else if (variant.name == "release") { variant.outputs.each { output -> @@ -252,7 +252,7 @@ dependencies { implementation "androidx.cardview:cardview:1.0.0" // implementation(project(':opensrp-child')) { - implementation('org.smartregister:opensrp-client-child:0.6.12-ZEIR-PREVIEW-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-child:0.7.0-ALPHA4-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'org.smartregister', module: 'opensrp-client-growth-monitoring' @@ -265,7 +265,7 @@ dependencies { exclude group: 'io.ona.rdt-capture', module: 'lib' } - implementation('org.smartregister:opensrp-client-immunization:3.0.9-ZEIR-PREVIEW-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-immunization:3.0.10-SNAPSHOT@aar') { transitive = true exclude group: 'org.smartregister', module: 'opensrp-client-core' exclude group: 'org.smartregister', module: 'opensrp-client-native-form' @@ -273,7 +273,7 @@ dependencies { exclude group: 'com.android.support', module: 'appcompat-v7' } - implementation('org.smartregister:opensrp-client-core:4.2.14-SNAPSHOT@aar') { + implementation('org.smartregister:opensrp-client-core:4.3.2-SNAPSHOT@aar') { transitive = true exclude group: 'id.zelory', module: 'compressor' exclude group: 'com.android.support', module: 'appcompat-v7' diff --git a/opensrp-path-zeir/src/main/assets/app.properties b/opensrp-path-zeir/src/main/assets/app.properties index 30c4debe..34a25be5 100644 --- a/opensrp-path-zeir/src/main/assets/app.properties +++ b/opensrp-path-zeir/src/main/assets/app.properties @@ -31,4 +31,5 @@ home.alert.style.legacy=true home.split.fully.immunized.status=true home.zeir.id.column.enabled=true show.booster.immunizations=true -notifications.weight.enabled=true \ No newline at end of file +notifications.weight.enabled=true +widget.datepicker.is.numeric=true \ No newline at end of file diff --git a/opensrp-path-zeir/src/main/java/org/smartregister/path/application/AppSyncConfiguration.java b/opensrp-path-zeir/src/main/java/org/smartregister/path/application/AppSyncConfiguration.java index 0ed7135b..e87fc651 100644 --- a/opensrp-path-zeir/src/main/java/org/smartregister/path/application/AppSyncConfiguration.java +++ b/opensrp-path-zeir/src/main/java/org/smartregister/path/application/AppSyncConfiguration.java @@ -81,5 +81,8 @@ public Class getAuthenticationActivity() { return LoginActivity.class; } + public boolean validateUserAssignments() { + return false; + } } diff --git a/opensrp-path-zeir/src/main/java/org/smartregister/path/helper/AppValidateAssignmentHelper.java b/opensrp-path-zeir/src/main/java/org/smartregister/path/helper/AppValidateAssignmentHelper.java deleted file mode 100644 index 6c4a3ee4..00000000 --- a/opensrp-path-zeir/src/main/java/org/smartregister/path/helper/AppValidateAssignmentHelper.java +++ /dev/null @@ -1,36 +0,0 @@ -package org.smartregister.path.helper; - -import org.smartregister.CoreLibrary; -import org.smartregister.domain.PhysicalLocation; -import org.smartregister.repository.LocationRepository; -import org.smartregister.sync.helper.ValidateAssignmentHelper; -import org.smartregister.util.SyncUtils; - -import java.util.Set; -import java.util.stream.Collectors; - -public class AppValidateAssignmentHelper extends ValidateAssignmentHelper { - - public AppValidateAssignmentHelper(SyncUtils syncUtils) { - super(syncUtils); - } - - /** - * Validate Health Facility Level only - * - * @return existing jurisdictions set - */ - @Override - protected Set getExistingJurisdictions() { - LocationRepository locationRepository = CoreLibrary.getInstance().context().getLocationRepository(); - return locationRepository.getAllLocations().stream() - .filter(location -> location.getProperties().getGeographicLevel() == 4) - .map(PhysicalLocation::getId).collect(Collectors.toSet()); - } - - - @Override - public void validateUserAssignment() { - // Do nothing - } -} \ No newline at end of file diff --git a/opensrp-path-zeir/src/main/java/org/smartregister/path/processor/AppClientProcessorForJava.java b/opensrp-path-zeir/src/main/java/org/smartregister/path/processor/AppClientProcessorForJava.java index f1aa0752..9838a802 100644 --- a/opensrp-path-zeir/src/main/java/org/smartregister/path/processor/AppClientProcessorForJava.java +++ b/opensrp-path-zeir/src/main/java/org/smartregister/path/processor/AppClientProcessorForJava.java @@ -167,6 +167,10 @@ public void processClient(List eventClients) { case Constants.EventType.BOOSTER_VACCINES: processEventClient(clientClassification, eventClient, event); break; + case Constants.EventType.UPDATE_DYNAMIC_VACCINES: + case Constants.EventType.DELETE_DYNAMIC_VACCINES: + processUpdateDynamicVaccineEvent(event); + break; case Constants.EventType.BITRH_REGISTRATION: case Constants.EventType.UPDATE_BITRH_REGISTRATION: case Constants.EventType.NEW_WOMAN_REGISTRATION: @@ -316,6 +320,22 @@ private void processCardStatusUpdateEvent(Event event) { } } + private void processUpdateDynamicVaccineEvent(Event event) { + CommonRepository commonrepository = getApplication().context().commonrepository(AppConstants.TableNameConstants.BOOSTER_VACCINES); + if (event != null && StringUtils.isNotBlank(event.getBaseEntityId())) { + Map details = event.getDetails(); + String vaccineDate = details.get(Constants.KEY.VACCINE_DATE); + if (StringUtils.isNotBlank(vaccineDate) && StringUtils.isNotBlank(vaccineDate) && + Constants.EventType.UPDATE_DYNAMIC_VACCINES.equalsIgnoreCase(event.getEventType())) { + ContentValues contentValues = new ContentValues(); + contentValues.put(Constants.KEY.VACCINE_DATE, vaccineDate); + commonrepository.updateColumn(AppConstants.TableNameConstants.BOOSTER_VACCINES, contentValues, event.getBaseEntityId()); + } else if (Constants.EventType.DELETE_DYNAMIC_VACCINES.equalsIgnoreCase(event.getEventType()) && details.get(Constants.KEY.BASE_ENTITY_ID) != null) { + commonrepository.deleteCase(details.get(Constants.KEY.BASE_ENTITY_ID), AppConstants.TableNameConstants.BOOSTER_VACCINES); + } + } + } + private void unSync(List events) { try { ClientField clientField = assetJsonToJava("ec_client_fields.json", ClientField.class); @@ -684,7 +704,7 @@ private Float parseFloat(String string) { @Override public void updateFTSsearch(String tableName, String entityId, ContentValues contentValues) { - Timber.i("Starting updateFTSsearch table: %s", tableName); + Timber.i("Starting updateFTSsearch table: %s Base Entity ID %s", tableName, entityId); AllCommonsRepository allCommonsRepository = getApplication().context(). allCommonsRepositoryobjects(tableName); @@ -700,7 +720,7 @@ public void updateFTSsearch(String tableName, String entityId, ContentValues con if (StringUtils.isNotBlank(dobString)) { DateTime birthDateTime = Utils.dobStringToDateTime(dobString); if (birthDateTime != null) { - VaccineSchedule.updateOfflineAlerts(entityId, birthDateTime, "child"); + VaccineSchedule.updateOfflineAlertsOnly(entityId, birthDateTime, "child"); ServiceSchedule.updateOfflineAlerts(entityId, birthDateTime); } } diff --git a/opensrp-path-zeir/src/main/java/org/smartregister/path/service/intent/AppSyncIntentService.java b/opensrp-path-zeir/src/main/java/org/smartregister/path/service/intent/AppSyncIntentService.java index b69ca654..d4cad54a 100644 --- a/opensrp-path-zeir/src/main/java/org/smartregister/path/service/intent/AppSyncIntentService.java +++ b/opensrp-path-zeir/src/main/java/org/smartregister/path/service/intent/AppSyncIntentService.java @@ -4,15 +4,12 @@ import androidx.annotation.NonNull; -import org.smartregister.path.helper.AppValidateAssignmentHelper; import org.smartregister.sync.intent.SyncIntentService; -import org.smartregister.util.SyncUtils; public class AppSyncIntentService extends SyncIntentService { @Override protected void init(@NonNull Context context) { super.init(context); - validateAssignmentHelper = new AppValidateAssignmentHelper(new SyncUtils(getBaseContext())); } } \ No newline at end of file diff --git a/opensrp-path-zeir/src/main/java/org/smartregister/path/util/AppConstants.java b/opensrp-path-zeir/src/main/java/org/smartregister/path/util/AppConstants.java index bebe2f2a..95225814 100644 --- a/opensrp-path-zeir/src/main/java/org/smartregister/path/util/AppConstants.java +++ b/opensrp-path-zeir/src/main/java/org/smartregister/path/util/AppConstants.java @@ -96,6 +96,7 @@ public static class TableNameConstants { public static final String CHILD_UPDATED_ALERTS = "child_updated_alerts"; public static final String MOTHER_DETAILS = "ec_mother_details"; public static final String CHILD_DETAILS = "ec_child_details"; + public static final String BOOSTER_VACCINES = "ec_booster_vaccines"; } public interface Columns { @@ -109,6 +110,7 @@ interface RegisterType { public static final class EntityTypeConstants { public static final String CHILD = "child"; + public static final String MOTHER = "mother"; } public interface IntentKeyUtil { diff --git a/opensrp-path-zeir/src/main/resources/child_enrollment.properties b/opensrp-path-zeir/src/main/resources/child_enrollment.properties index df308d34..dc8ae26f 100644 --- a/opensrp-path-zeir/src/main/resources/child_enrollment.properties +++ b/opensrp-path-zeir/src/main/resources/child_enrollment.properties @@ -35,7 +35,7 @@ child_enrollment.step1.last_name.v_required.err = Please enter the last name child_enrollment.step1.physical_landmark.hint = Landmark child_enrollment.step1.title = Birth Registration child_enrollment.step1.Sex.v_required.err = Please enter the sex -child_enrollment.step1.residential_address.hint = Home address +child_enrollment.step1.residential_address.hint = Child's home address child_enrollment.step1.zeir_id.hint = Child's ZEIR ID child_enrollment.step1.birth_facility_name.v_required.err = Please enter the birth facility name child_enrollment.step1.place_of_birth.hint = Place of birth