From 8c6b842f30720343f741d4685a4cdac193e8b492 Mon Sep 17 00:00:00 2001 From: Elly Kitoto Date: Fri, 27 Aug 2021 16:40:48 +0300 Subject: [PATCH] Populate SMS reminder questions on mother lookup (#197) --- .../path/activity/ChildFormActivity.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/opensrp-path-zeir/src/main/java/org/smartregister/path/activity/ChildFormActivity.java b/opensrp-path-zeir/src/main/java/org/smartregister/path/activity/ChildFormActivity.java index 23d54270..af88d07f 100644 --- a/opensrp-path-zeir/src/main/java/org/smartregister/path/activity/ChildFormActivity.java +++ b/opensrp-path-zeir/src/main/java/org/smartregister/path/activity/ChildFormActivity.java @@ -5,6 +5,8 @@ import static org.smartregister.path.util.AppConstants.KeyConstants.LAST_NAME; import static org.smartregister.path.util.AppConstants.KeyConstants.MOTHER_GUARDIAN_NRC; import static org.smartregister.path.util.AppConstants.KeyConstants.MOTHER_GUARDIAN_NUMBER; +import static org.smartregister.path.util.AppConstants.KeyConstants.SMS_REMINDER; +import static org.smartregister.path.util.AppConstants.KeyConstants.SMS_REMINDER_PHONE; import static org.smartregister.path.util.TableUtil.getMotherDetailsColumn; import com.vijay.jsonwizard.constants.JsonFormConstants; @@ -82,12 +84,17 @@ protected static String getMainConditionString(Map entityMap) { public String lookUpQuery(Map entityMap, String tableName) { RegisterQueryProvider queryProvider = Utils.metadata().getRegisterQueryProvider(); - String[] lookupColumns = new String[]{queryProvider.getDemographicTable() + "." + MotherLookUpUtils.RELATIONALID, queryProvider.getDemographicTable() + "." + MotherLookUpUtils.DETAILS, Constants.KEY.ZEIR_ID, FIRST_NAME, LAST_NAME, + String[] lookupColumns = new String[]{queryProvider.getDemographicTable() + "." + + MotherLookUpUtils.RELATIONALID, queryProvider.getDemographicTable() + "." + + MotherLookUpUtils.DETAILS, Constants.KEY.ZEIR_ID, FIRST_NAME, LAST_NAME, queryProvider.getDemographicTable() + "." + AllConstants.ChildRegistrationFields.GENDER, queryProvider.getDemographicTable() + "." + Constants.KEY.DOB, queryProvider.getDemographicTable() + "." + Constants.KEY.BASE_ENTITY_ID, + getMotherDetailsColumn(SMS_REMINDER), + getMotherDetailsColumn(SMS_REMINDER_PHONE), getMotherDetailsColumn(MOTHER_GUARDIAN_NUMBER), - getMotherDetailsColumn(MOTHER_GUARDIAN_NRC)}; + getMotherDetailsColumn(MOTHER_GUARDIAN_NRC) + }; SmartRegisterQueryBuilder queryBuilder = new SmartRegisterQueryBuilder(); queryBuilder.selectInitiateMainTable(tableName, lookupColumns);