Skip to content

Commit

Permalink
Populate SMS reminder questions on mother lookup (#197)
Browse files Browse the repository at this point in the history
  • Loading branch information
ellykits authored Aug 27, 2021
1 parent ff21e67 commit 8c6b842
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -82,12 +84,17 @@ protected static String getMainConditionString(Map<String, String> entityMap) {
public String lookUpQuery(Map<String, String> 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);
Expand Down

0 comments on commit 8c6b842

Please sign in to comment.