From 6d556963e457a9290ed7921ee8e20b50d4f70d25 Mon Sep 17 00:00:00 2001 From: shakjaf110 Date: Mon, 3 Oct 2016 11:26:01 +0500 Subject: [PATCH 1/2] #145: Person Relationships support in OpenSRP --- assets/config/opensrp.properties | 6 +- .../src/test/java/META-INF/MANIFEST.MF | 3 + opensrp-common/.gitignore | 1 + .../opensrp/common/FormEntityConstants.java | 11 + .../src/test/java/META-INF/MANIFEST.MF | 3 + opensrp-connector/.gitignore | 1 + .../openmrs/service/HouseholdService.java | 9 +- .../openmrs/service/PatientService.java | 25 +- .../src/test/java/META-INF/MANIFEST.MF | 3 + .../openmrs/service/EncounterTest.java | 155 +- .../form/family_registration/form.json | 1 + .../form/family_registration/form.xml | 690 +++++++ .../family_registration/form_definition.json | 170 ++ .../form/family_registration/model.xml | 786 ++++++++ .../form/new_household_registration/form.json | 40 +- .../form_definition.json | 12 + .../form_submission1.json | 25 +- .../form/new_household_registration/model.xml | 3 + .../form/new_member_registration/form.json | 1 + .../form/new_member_registration/form.xml | 219 +++ .../form_definition.json | 137 ++ .../form_submission.json | 281 +++ .../form/new_member_registration/model.xml | 72 + .../test_new_household_registration/form.json | 134 ++ .../form_definition.json | 74 + .../form_submission.json | 96 + .../Maven_Ant_Builder.launch | 25 + opensrp-core/.gitignore | 1 + opensrp-core/maven-eclipse.xml | 14 + .../java/org/opensrp/domain/BaseEntity.java | 1 + .../main/java/org/opensrp/domain/Client.java | 74 +- .../src/main/java/org/opensrp/domain/Obs.java | 7 +- .../java/org/opensrp/domain/RelationShip.java | 104 + .../service/XlsFormDownloaderService.java | 22 +- .../formSubmission/FormEntityConverter.java | 82 +- .../src/test/java/META-INF/MANIFEST.MF | 3 + .../opensrp/FormSubmissionProcessorTest.java | 2 + .../it/AllClientsIntegrationTest.java | 2 +- .../resources/form/woman_enrollment/form.json | 2 +- .../resources/form/woman_enrollment/form.xml | 1701 ++--------------- .../woman_enrollment/form_definition.json | 274 +-- .../resources/form/woman_enrollment/model.xml | 1695 +--------------- opensrp-form/bin/pom.xml | 110 ++ .../org/opensrp/form/domain/FormData.class | Bin 0 -> 7578 bytes .../org/opensrp/form/domain/FormField.class | Bin 0 -> 3238 bytes .../opensrp/form/domain/FormInstance.class | Bin 0 -> 4669 bytes .../opensrp/form/domain/FormSubmission.class | Bin 0 -> 10041 bytes .../org/opensrp/form/domain/SubFormData.class | Bin 0 -> 5242 bytes .../form/repository/AllFormSubmissions.class | Bin 0 -> 8398 bytes .../form/service/FormAttributeParser.class | Bin 0 -> 12688 bytes .../opensrp/form/service/FormFieldMap.class | Bin 0 -> 8407 bytes .../service/FormSubmissionConverter.class | Bin 0 -> 3224 bytes .../form/service/FormSubmissionMap.class | Bin 0 -> 5599 bytes .../form/service/FormSubmissionService.class | Bin 0 -> 8281 bytes .../org/opensrp/form/service/SubformMap.class | Bin 0 -> 4959 bytes .../applicationContext-opensrp-form.xml | 23 + .../it/AllSubmissionsIntegrationTest.class | Bin 0 -> 6929 bytes .../service/FormAttributeParserTest.class | Bin 0 -> 15943 bytes .../service/FormSubmissionServiceTest.class | Bin 0 -> 10252 bytes .../form/service/TestResourceLoader.class | Bin 0 -> 3358 bytes .../test/resources/form/basic_reg/form.json | 653 +++++++ .../test/resources/form/basic_reg/form.xml | 287 +++ .../form/basic_reg/form_definition.json | 245 +++ .../form/basic_reg/form_submission.json | 254 +++ .../test/resources/form/basic_reg/model.xml | 79 + .../form/new_household_registration/form.json | 655 +++++++ .../form/new_household_registration/form.xml | 26 + .../form_definition.json | 166 ++ .../form_submission1.json | 228 +++ .../form_submission2.json | 207 ++ .../form_submission3.json | 208 ++ .../form_submission4.json | 208 ++ .../form_submission5.json | 209 ++ .../form_submission6.json | 216 +++ .../form_submission7.json | 216 +++ .../form_submission8.json | 211 ++ .../form/new_household_registration/model.xml | 49 + .../form.json | 1100 +++++++++++ .../form.xml | 31 + .../form_definition.json | 290 +++ .../form_submission1.json | 363 ++++ .../model.xml | 83 + .../form/pnc_1st_registration/form.json | 373 ++++ .../form/pnc_1st_registration/form.xml | 29 + .../pnc_1st_registration/form_definition.json | 89 + .../pnc_1st_registration/form_submission.json | 135 ++ .../form/pnc_1st_registration/model.xml | 31 + .../test/resources/form/repeatform/form.json | 1381 +++++++++++++ .../form/repeatform/form_definition.json | 315 +++ .../form/repeatform/form_submission.json | 452 +++++ .../test/resources/form/repeatform/model.xml | 91 + .../form/service/FormAttributeParser.java | 1 + .../form/service/FormSubmissionMap.java | 1 + .../org/opensrp/form/service/SubformMap.java | 1 + .../src/test/java/META-INF/MANIFEST.MF | 3 + opensrp-interface/bin/pom.xml | 52 + .../main/java/org/opensrp/dto/ANMDTO.class | Bin 0 -> 3011 bytes .../main/java/org/opensrp/dto/Action.class | Bin 0 -> 6348 bytes .../java/org/opensrp/dto/ActionData.class | Bin 0 -> 6705 bytes .../java/org/opensrp/dto/AlertStatus.class | Bin 0 -> 1955 bytes .../org/opensrp/dto/BeneficiaryType.class | Bin 0 -> 1911 bytes .../java/org/opensrp/dto/LocationDTO.class | Bin 0 -> 2919 bytes .../org/opensrp/dto/MonthSummaryDatum.class | Bin 0 -> 4231 bytes .../java/org/opensrp/dto/VillagesDTO.class | Bin 0 -> 4226 bytes .../AggregatorResponseDTO.class | Bin 0 -> 2999 bytes .../opensrp/dto/form/FormSubmissionDTO.class | Bin 0 -> 4994 bytes .../org/opensrp/dto/form/MultimediaDTO.class | Bin 0 -> 3940 bytes .../opensrp/dto/register/ANCRegisterDTO.class | Bin 0 -> 2366 bytes .../dto/register/ANCRegisterEntryDTO.class | Bin 0 -> 9395 bytes .../opensrp/dto/register/ANMDetailDTO.class | Bin 0 -> 3017 bytes .../opensrp/dto/register/ANMDetailsDTO.class | Bin 0 -> 2341 bytes .../dto/register/ChildRegisterDTO.class | Bin 0 -> 2378 bytes .../dto/register/ChildRegisterEntryDTO.class | Bin 0 -> 5519 bytes .../dto/register/CondomFPDetailsDTO.class | Bin 0 -> 2922 bytes .../dto/register/CondomRegisterEntryDTO.class | Bin 0 -> 7705 bytes .../opensrp/dto/register/ECRegisterDTO.class | Bin 0 -> 2360 bytes .../dto/register/ECRegisterEntryDTO.class | Bin 0 -> 8729 bytes .../dto/register/EntityDetailDTO.class | Bin 0 -> 4274 bytes .../opensrp/dto/register/FPRegisterDTO.class | Bin 0 -> 4068 bytes .../FemaleSterilizationFPDetailsDTO.class | Bin 0 -> 2927 bytes .../FemaleSterilizationRegisterEntryDTO.class | Bin 0 -> 8219 bytes .../dto/register/IUDFPDetailsDTO.class | Bin 0 -> 2780 bytes .../dto/register/IUDRegisterEntryDTO.class | Bin 0 -> 8384 bytes .../MaleSterilizationFPDetailsDTO.class | Bin 0 -> 2921 bytes .../MaleSterilizationRegisterEntryDTO.class | Bin 0 -> 8203 bytes .../dto/register/OCPFPDetailsDTO.class | Bin 0 -> 3355 bytes .../dto/register/OCPRegisterEntryDTO.class | Bin 0 -> 8493 bytes .../opensrp/dto/register/PNCRegisterDTO.class | Bin 0 -> 2366 bytes .../dto/register/PNCRegisterEntryDTO.class | Bin 0 -> 7575 bytes .../opensrp/dto/register/PNCVisitDTO.class | Bin 0 -> 5545 bytes .../dto/report/AggregatedReportsDTO.class | Bin 0 -> 2818 bytes .../dto/report/ServiceProvidedReportDTO.class | Bin 0 -> 4678 bytes .../Maven_Ant_Builder.launch | 25 + opensrp-register/bin/pom.xml | 99 + .../thrivepk/FormSubmissionView.class | Bin 0 -> 3296 bytes .../thrivepk/RegisterConstants$Form.class | Bin 0 -> 1688 bytes .../register/thrivepk/RegisterConstants.class | Bin 0 -> 1631 bytes .../opensrp/register/thrivepk/Schedule.class | Bin 0 -> 4723 bytes .../applicationContext-opensrp-register.xml | 42 + ...ggregate_child_enrollment_by_center_csv.js | 64 + ...ggregate_woman_enrollment_by_center_csv.js | 64 + .../bin/src/main/resources/lists/dump_csv.js | 83 + .../register/it/CreateFormSubmissions.class | Bin 0 -> 7634 bytes .../org/opensrp/register/util/Event.class | Bin 0 -> 812 bytes .../opensrp/register/util/EventBuilder.class | Bin 0 -> 5344 bytes .../register/util/FormSubmissionBuilder.class | Bin 0 -> 6075 bytes .../org/opensrp/register/util/Matcher.class | Bin 0 -> 2131 bytes .../resources/form/child_enrollment/form.json | 1 + .../resources/form/child_enrollment/form.xml | 1699 ++++++++++++++++ .../child_enrollment/form_definition.json | 343 ++++ .../resources/form/child_enrollment/model.xml | 1690 ++++++++++++++++ .../resources/form/child_followup/form.json | 1 + .../resources/form/child_followup/form.xml | 1689 ++++++++++++++++ .../form/child_followup/form_definition.json | 459 +++++ .../resources/form/child_followup/model.xml | 1697 ++++++++++++++++ .../form/offsite_child_followup/form.json | 1 + .../form/offsite_child_followup/form.xml | 1694 ++++++++++++++++ .../form_definition.json | 459 +++++ .../form/offsite_child_followup/model.xml | 1697 ++++++++++++++++ .../form/offsite_woman_followup/form.json | 1 + .../form/offsite_woman_followup/form.xml | 1500 +++++++++++++++ .../form_definition.json | 377 ++++ .../form/offsite_woman_followup/model.xml | 1645 ++++++++++++++++ .../form/vaccine_stock_position/form.json | 1 + .../form/vaccine_stock_position/form.xml | 385 ++++ .../form_definition.json | 189 ++ .../form/vaccine_stock_position/model.xml | 68 + .../resources/form/woman_enrollment/form.json | 1 + .../resources/form/woman_enrollment/form.xml | 1559 +++++++++++++++ .../woman_enrollment/form_definition.json | 308 +++ .../resources/form/woman_enrollment/model.xml | 1658 ++++++++++++++++ .../resources/form/woman_followup/form.json | 1 + .../resources/form/woman_followup/form.xml | 1495 +++++++++++++++ .../form/woman_followup/form_definition.json | 377 ++++ .../resources/form/woman_followup/model.xml | 1645 ++++++++++++++++ .../test/resources/schedules/child-bcg.json | 35 + .../test/resources/schedules/child-ipv.json | 41 + .../resources/schedules/child-measles1.json | 41 + .../resources/schedules/child-measles2.json | 41 + .../test/resources/schedules/child-opv0.json | 35 + .../test/resources/schedules/child-opv1.json | 41 + .../test/resources/schedules/child-opv2.json | 41 + .../test/resources/schedules/child-opv3.json | 41 + .../test/resources/schedules/child-pcv1.json | 41 + .../test/resources/schedules/child-pcv2.json | 41 + .../test/resources/schedules/child-pcv3.json | 41 + .../schedules/child-pentavalent1.json | 41 + .../schedules/child-pentavalent2.json | 41 + .../schedules/child-pentavalent3.json | 41 + .../resources/schedules/schedule-config.xls | Bin 0 -> 24064 bytes .../test/resources/schedules/woman-tt2.json | 35 + .../test/resources/schedules/woman-tt3.json | 35 + .../test/resources/schedules/woman-tt4.json | 36 + .../test/resources/schedules/woman-tt5.json | 36 + ...st-applicationContext-opensrp-register.xml | 38 + opensrp-register/maven-eclipse.xml | 11 + .../src/test/java/META-INF/MANIFEST.MF | 3 + .../Maven_Ant_Builder.launch | 25 + opensrp-web/.gitignore | 1 + opensrp-web/maven-eclipse.xml | 11 + opensrp-web/pom.xml | 5 + .../src/main/resources/quartz.properties | 2 +- 202 files changed, 36327 insertions(+), 3528 deletions(-) create mode 100644 opensrp-api/src/test/java/META-INF/MANIFEST.MF create mode 100644 opensrp-common/.gitignore create mode 100644 opensrp-common/src/test/java/META-INF/MANIFEST.MF create mode 100644 opensrp-connector/src/test/java/META-INF/MANIFEST.MF create mode 100644 opensrp-connector/src/test/resources/form/family_registration/form.json create mode 100644 opensrp-connector/src/test/resources/form/family_registration/form.xml create mode 100644 opensrp-connector/src/test/resources/form/family_registration/form_definition.json create mode 100644 opensrp-connector/src/test/resources/form/family_registration/model.xml create mode 100644 opensrp-connector/src/test/resources/form/new_member_registration/form.json create mode 100644 opensrp-connector/src/test/resources/form/new_member_registration/form.xml create mode 100644 opensrp-connector/src/test/resources/form/new_member_registration/form_definition.json create mode 100644 opensrp-connector/src/test/resources/form/new_member_registration/form_submission.json create mode 100644 opensrp-connector/src/test/resources/form/new_member_registration/model.xml create mode 100644 opensrp-connector/src/test/resources/form/test_new_household_registration/form.json create mode 100644 opensrp-connector/src/test/resources/form/test_new_household_registration/form_definition.json create mode 100644 opensrp-connector/src/test/resources/form/test_new_household_registration/form_submission.json create mode 100644 opensrp-core/.externalToolBuilders/Maven_Ant_Builder.launch create mode 100644 opensrp-core/.gitignore create mode 100644 opensrp-core/maven-eclipse.xml create mode 100644 opensrp-core/src/main/java/org/opensrp/domain/RelationShip.java create mode 100644 opensrp-core/src/test/java/META-INF/MANIFEST.MF create mode 100644 opensrp-form/bin/pom.xml create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/domain/FormData.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/domain/FormField.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/domain/FormInstance.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/domain/FormSubmission.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/domain/SubFormData.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/repository/AllFormSubmissions.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/service/FormAttributeParser.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/service/FormFieldMap.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/service/FormSubmissionConverter.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/service/FormSubmissionMap.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/service/FormSubmissionService.class create mode 100644 opensrp-form/bin/src/main/java/org/opensrp/form/service/SubformMap.class create mode 100644 opensrp-form/bin/src/main/resources/applicationContext-opensrp-form.xml create mode 100644 opensrp-form/bin/src/test/java/org/opensrp/form/repository/it/AllSubmissionsIntegrationTest.class create mode 100644 opensrp-form/bin/src/test/java/org/opensrp/form/service/FormAttributeParserTest.class create mode 100644 opensrp-form/bin/src/test/java/org/opensrp/form/service/FormSubmissionServiceTest.class create mode 100644 opensrp-form/bin/src/test/java/org/opensrp/form/service/TestResourceLoader.class create mode 100644 opensrp-form/bin/src/test/resources/form/basic_reg/form.json create mode 100644 opensrp-form/bin/src/test/resources/form/basic_reg/form.xml create mode 100644 opensrp-form/bin/src/test/resources/form/basic_reg/form_definition.json create mode 100644 opensrp-form/bin/src/test/resources/form/basic_reg/form_submission.json create mode 100644 opensrp-form/bin/src/test/resources/form/basic_reg/model.xml create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form.xml create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_definition.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission1.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission2.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission3.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission4.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission5.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission6.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission7.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/form_submission8.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration/model.xml create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration_with_grouped_subform_data/form.xml create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration_with_grouped_subform_data/form_definition.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration_with_grouped_subform_data/form_submission1.json create mode 100644 opensrp-form/bin/src/test/resources/form/new_household_registration_with_grouped_subform_data/model.xml create mode 100644 opensrp-form/bin/src/test/resources/form/pnc_1st_registration/form.json create mode 100644 opensrp-form/bin/src/test/resources/form/pnc_1st_registration/form.xml create mode 100644 opensrp-form/bin/src/test/resources/form/pnc_1st_registration/form_definition.json create mode 100644 opensrp-form/bin/src/test/resources/form/pnc_1st_registration/form_submission.json create mode 100644 opensrp-form/bin/src/test/resources/form/pnc_1st_registration/model.xml create mode 100644 opensrp-form/bin/src/test/resources/form/repeatform/form.json create mode 100644 opensrp-form/bin/src/test/resources/form/repeatform/form_definition.json create mode 100644 opensrp-form/bin/src/test/resources/form/repeatform/form_submission.json create mode 100644 opensrp-form/bin/src/test/resources/form/repeatform/model.xml create mode 100644 opensrp-form/src/test/java/META-INF/MANIFEST.MF create mode 100644 opensrp-interface/bin/pom.xml create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/ANMDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/Action.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/ActionData.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/AlertStatus.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/BeneficiaryType.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/LocationDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/MonthSummaryDatum.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/VillagesDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/aggregatorResponse/AggregatorResponseDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/form/FormSubmissionDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/form/MultimediaDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ANCRegisterDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ANCRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ANMDetailDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ANMDetailsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ChildRegisterDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ChildRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/CondomFPDetailsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/CondomRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ECRegisterDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/ECRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/EntityDetailDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/FPRegisterDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/FemaleSterilizationFPDetailsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/FemaleSterilizationRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/IUDFPDetailsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/IUDRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/MaleSterilizationFPDetailsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/MaleSterilizationRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/OCPFPDetailsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/OCPRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/PNCRegisterDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/PNCRegisterEntryDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/register/PNCVisitDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/report/AggregatedReportsDTO.class create mode 100644 opensrp-interface/bin/src/main/java/org/opensrp/dto/report/ServiceProvidedReportDTO.class create mode 100644 opensrp-register/.externalToolBuilders/Maven_Ant_Builder.launch create mode 100644 opensrp-register/bin/pom.xml create mode 100644 opensrp-register/bin/src/main/java/org/opensrp/register/thrivepk/FormSubmissionView.class create mode 100644 opensrp-register/bin/src/main/java/org/opensrp/register/thrivepk/RegisterConstants$Form.class create mode 100644 opensrp-register/bin/src/main/java/org/opensrp/register/thrivepk/RegisterConstants.class create mode 100644 opensrp-register/bin/src/main/java/org/opensrp/register/thrivepk/Schedule.class create mode 100644 opensrp-register/bin/src/main/resources/applicationContext-opensrp-register.xml create mode 100644 opensrp-register/bin/src/main/resources/lists/aggregate_child_enrollment_by_center_csv.js create mode 100644 opensrp-register/bin/src/main/resources/lists/aggregate_woman_enrollment_by_center_csv.js create mode 100644 opensrp-register/bin/src/main/resources/lists/dump_csv.js create mode 100644 opensrp-register/bin/src/test/java/org/opensrp/register/it/CreateFormSubmissions.class create mode 100644 opensrp-register/bin/src/test/java/org/opensrp/register/util/Event.class create mode 100644 opensrp-register/bin/src/test/java/org/opensrp/register/util/EventBuilder.class create mode 100644 opensrp-register/bin/src/test/java/org/opensrp/register/util/FormSubmissionBuilder.class create mode 100644 opensrp-register/bin/src/test/java/org/opensrp/register/util/Matcher.class create mode 100644 opensrp-register/bin/src/test/resources/form/child_enrollment/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/child_enrollment/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/child_enrollment/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/child_enrollment/model.xml create mode 100644 opensrp-register/bin/src/test/resources/form/child_followup/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/child_followup/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/child_followup/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/child_followup/model.xml create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_child_followup/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_child_followup/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_child_followup/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_child_followup/model.xml create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_woman_followup/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_woman_followup/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_woman_followup/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/offsite_woman_followup/model.xml create mode 100644 opensrp-register/bin/src/test/resources/form/vaccine_stock_position/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/vaccine_stock_position/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/vaccine_stock_position/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/vaccine_stock_position/model.xml create mode 100644 opensrp-register/bin/src/test/resources/form/woman_enrollment/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/woman_enrollment/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/woman_enrollment/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/woman_enrollment/model.xml create mode 100644 opensrp-register/bin/src/test/resources/form/woman_followup/form.json create mode 100644 opensrp-register/bin/src/test/resources/form/woman_followup/form.xml create mode 100644 opensrp-register/bin/src/test/resources/form/woman_followup/form_definition.json create mode 100644 opensrp-register/bin/src/test/resources/form/woman_followup/model.xml create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-bcg.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-ipv.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-measles1.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-measles2.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-opv0.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-opv1.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-opv2.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-opv3.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-pcv1.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-pcv2.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-pcv3.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-pentavalent1.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-pentavalent2.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/child-pentavalent3.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/schedule-config.xls create mode 100644 opensrp-register/bin/src/test/resources/schedules/woman-tt2.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/woman-tt3.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/woman-tt4.json create mode 100644 opensrp-register/bin/src/test/resources/schedules/woman-tt5.json create mode 100644 opensrp-register/bin/src/test/resources/test-applicationContext-opensrp-register.xml create mode 100644 opensrp-register/maven-eclipse.xml create mode 100644 opensrp-register/src/test/java/META-INF/MANIFEST.MF create mode 100644 opensrp-web/.externalToolBuilders/Maven_Ant_Builder.launch create mode 100644 opensrp-web/.gitignore create mode 100644 opensrp-web/maven-eclipse.xml diff --git a/assets/config/opensrp.properties b/assets/config/opensrp.properties index 5b962c4078..74560c1aa3 100644 --- a/assets/config/opensrp.properties +++ b/assets/config/opensrp.properties @@ -16,12 +16,12 @@ mcts-report-delay-in-days=10 mcts.poll.time.interval.in.minutes=10 # OpenMRS configuration -openmrs.url=http://localhost:8181/openmrs/ +openmrs.url=http://localhost:8081/openmrs-standalone/ openmrs.username=admin openmrs.password=Admin123 # make REST calls and push data while testing on the server specified above -openmrs.test.make-rest-call=false +openmrs.test.make-rest-call=true openmrs.scheduletracker.syncer.interval-min=2 @@ -37,7 +37,7 @@ couchdb.atomfeed-db.revision-limit=2 jdbc.backend=mysql jdbc.driverClassName=com.mysql.jdbc.Driver jdbc.username=root -jdbc.password=VA1913wm +jdbc.password=star #jdbc url with server and port but without database jdbc.url-wo-db=jdbc:mysql://localhost:3306 diff --git a/opensrp-api/src/test/java/META-INF/MANIFEST.MF b/opensrp-api/src/test/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..254272e1c0 --- /dev/null +++ b/opensrp-api/src/test/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/opensrp-common/.gitignore b/opensrp-common/.gitignore new file mode 100644 index 0000000000..ae3c172604 --- /dev/null +++ b/opensrp-common/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/opensrp-common/src/main/java/org/opensrp/common/FormEntityConstants.java b/opensrp-common/src/main/java/org/opensrp/common/FormEntityConstants.java index dba9904989..e2cb195142 100644 --- a/opensrp-common/src/main/java/org/opensrp/common/FormEntityConstants.java +++ b/opensrp-common/src/main/java/org/opensrp/common/FormEntityConstants.java @@ -58,4 +58,15 @@ public enum Encounter implements FormEntity{ public String entity(){return "encounter";} public String entityId(){return this.name();} } + + public enum Member implements FormEntity{ + relationship_type, + person_B, + start_date, + end_date; + + + public String entity(){return "Relationship";} + public String entityId(){return this.name();} + } } \ No newline at end of file diff --git a/opensrp-common/src/test/java/META-INF/MANIFEST.MF b/opensrp-common/src/test/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..254272e1c0 --- /dev/null +++ b/opensrp-common/src/test/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/opensrp-connector/.gitignore b/opensrp-connector/.gitignore index b83d22266a..0f630157f4 100644 --- a/opensrp-connector/.gitignore +++ b/opensrp-connector/.gitignore @@ -1 +1,2 @@ /target/ +/bin/ diff --git a/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/HouseholdService.java b/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/HouseholdService.java index 5fcb3baec0..1f1e2457b5 100644 --- a/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/HouseholdService.java +++ b/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/HouseholdService.java @@ -43,6 +43,14 @@ public JSONObject createRelationshipType(String AIsToB, String BIsToA, String de return new JSONObject(HttpUtil.post(getURL()+"/"+RELATIONSHIP_TYPE_URL, "", o.toString(), OPENMRS_USER, OPENMRS_PWD).body()); } + public JSONObject getRelationship(String clientUuid, String relationshipInWord, String relativeUuid) throws JSONException + { + JSONArray r = new JSONObject(HttpUtil.get(getURL() + +"/"+RELATIONSHIP_URL, "v=full&relation="+relationshipInWord+""+"&personA="+clientUuid+"&personB="+relativeUuid, OPENMRS_USER, OPENMRS_PWD).body()) + .getJSONArray("results"); + return r.length()>0?r.getJSONObject(0):null; + } + public JSONObject createRelationship(String clientUuid, String isARelationship, String relativeUuid) throws JSONException{ JSONObject o = convertRelationshipToOpenmrsJson(clientUuid, isARelationship, relativeUuid); return new JSONObject(HttpUtil.post(getURL()+"/"+RELATIONSHIP_URL, "", o.toString(), OPENMRS_USER, OPENMRS_PWD).body()); @@ -90,7 +98,6 @@ public void saveHH(OpenmrsHouseHold household, boolean ignoreExisting) throws JS JSONObject mp = ignoreExisting&&hhMemEx!=null?hhMemEx:patientService.createPatient(m.getClient()); JSONObject me = encounterService.createEncounter(m.getEvent().get(0)); - createRelationship(hhp.getString("uuid"), hhrel, mp.getString("uuid")); } } diff --git a/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/PatientService.java b/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/PatientService.java index 0b6b65b779..82277b6bd3 100644 --- a/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/PatientService.java +++ b/opensrp-connector/src/main/java/org/opensrp/connector/openmrs/service/PatientService.java @@ -27,6 +27,7 @@ public class PatientService extends OpenmrsService{ //person methods should be separate private static final String PERSON_URL = "ws/rest/v1/person"; private static final String PATIENT_URL = "ws/rest/v1/patient"; + private static final String RELATION_URL = "ws/rest/v1/relationship"; private static final String PATIENT_IDENTIFIER_URL = "identifier"; private static final String PERSON_ATTRIBUTE_URL = "attribute"; private static final String PERSON_ATTRIBUTE_TYPE_URL = "ws/rest/v1/personattributetype"; @@ -44,13 +45,29 @@ public PatientService(String openmrsUrl, String user, String password) { } public JSONObject getPatientByIdentifier(String identifier) throws JSONException + { + System.out.println(HttpUtil.get(getURL()+"/"+PATIENT_URL, "v=full&identifier="+identifier, OPENMRS_USER, OPENMRS_PWD).body()); + String JSON=getURL()+"/"+PATIENT_URL; + JSONArray p = new JSONObject(HttpUtil.get(JSON, "v=full&identifier="+identifier, OPENMRS_USER, OPENMRS_PWD).body()) + .getJSONArray("results"); + System.out.println(String.valueOf(p)); + return p.length()>0?p.getJSONObject(0):null; + } + + public JSONObject getPatientByIdentifier(int num) throws JSONException { JSONArray p = new JSONObject(HttpUtil.get(getURL() - +"/"+PATIENT_URL, "v=full&identifier="+identifier, OPENMRS_USER, OPENMRS_PWD).body()) + +"/"+RELATION_URL, "v=full&identifier="+num, OPENMRS_USER, OPENMRS_PWD).body()) .getJSONArray("results"); return p.length()>0?p.getJSONObject(0):null; } + public JSONObject getRelativeByUuid(String uuid, boolean noRepresentationTag) throws JSONException + { + return new JSONObject(HttpUtil.get(getURL() + +"/"+RELATION_URL+"/"+uuid, noRepresentationTag?"":"v=full", OPENMRS_USER, OPENMRS_PWD).body()); + } + public JSONObject getPatientByUuid(String uuid, boolean noRepresentationTag) throws JSONException { return new JSONObject(HttpUtil.get(getURL() @@ -76,12 +93,18 @@ public JSONObject createIdentifierType(String name, String description) throws J return new JSONObject(HttpUtil.post(getURL()+"/"+PATIENT_IDENTIFIER_TYPE_URL, "", o.toString(), OPENMRS_USER, OPENMRS_PWD).body()); } + public JSONObject convertIdentifierToOpenmrsJson(String name, String description) throws JSONException { JSONObject a = new JSONObject(); a.put("name", name); a.put("description", description); return a; } + public JSONObject convertRelationShipToOpenmrsJson(int num) throws JSONException { + JSONObject a = new JSONObject(); + a.put("relationship", num); + return a; + } public JSONObject getPersonAttributeType(String attributeName) throws JSONException { diff --git a/opensrp-connector/src/test/java/META-INF/MANIFEST.MF b/opensrp-connector/src/test/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..254272e1c0 --- /dev/null +++ b/opensrp-connector/src/test/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/opensrp-connector/src/test/java/org/opensrp/connector/openmrs/service/EncounterTest.java b/opensrp-connector/src/test/java/org/opensrp/connector/openmrs/service/EncounterTest.java index 0f34e66a7c..161eb7c8f1 100644 --- a/opensrp-connector/src/test/java/org/opensrp/connector/openmrs/service/EncounterTest.java +++ b/opensrp-connector/src/test/java/org/opensrp/connector/openmrs/service/EncounterTest.java @@ -7,7 +7,9 @@ import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Map; +import java.util.logging.Logger; +import org.opensrp.domain.RelationShip; import org.hamcrest.Matchers; import org.joda.time.DateTime; import org.json.JSONException; @@ -22,15 +24,17 @@ import org.opensrp.form.domain.FormSubmission; import org.opensrp.form.service.FormAttributeParser; import org.opensrp.service.formSubmission.FormEntityConverter; +import org.springframework.web.filter.Log4jNestedDiagnosticContextFilter; import com.google.gson.JsonIOException; +import com.mysql.jdbc.log.Log; public class EncounterTest extends TestResourceLoader{ public EncounterTest() throws IOException { super(); } - + private final Logger log = Logger.getLogger(getClass().getSimpleName()); EncounterService s; FormEntityConverter oc; PatientService ps; @@ -49,15 +53,15 @@ public void setup() throws IOException{ hhs = new HouseholdService(openmrsOpenmrsUrl, openmrsUsername, openmrsPassword); hhs.setPatientService(ps); hhs.setEncounterService(s); - FormAttributeParser fam = new FormAttributeParser(formDirPath); + final FormAttributeParser fam = new FormAttributeParser(formDirPath); oc = new FormEntityConverter(fam); } @Test public void testEncounter() throws JSONException, ParseException, IOException { - FormSubmission fs = getFormSubmissionFor("basic_reg"); + final FormSubmission fs = getFormSubmissionFor("basic_reg"); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBaseEntityId(), "b716d938-1aea-40ae-a081-9ddddddcccc9"); assertEquals(c.getFirstName(), "test woman_name"); assertEquals(c.getGender(), "FEMALE"); @@ -67,28 +71,57 @@ public void testEncounter() throws JSONException, ParseException, IOException { assertEquals(c.getAddresses().get(3).getAddressType(), "deathplace"); assertTrue(c.getAttributes().isEmpty()); - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); assertEquals(e.getEventType(), "patient_register"); assertEquals(e.getEventDate(), new DateTime(new DateTime("2015-02-01"))); assertEquals(e.getLocationId(), "unknown location"); if(pushToOpenmrsForTest){ + + System.out.println(ps.getPatientByIdentifier(c.getBaseEntityId())); JSONObject p = ps.getPatientByIdentifier(c.getBaseEntityId()); if(p == null){ p = ps.createPatient(c); } - JSONObject en = s.createEncounter(e); + final JSONObject en = s.createEncounter(e); System.out.println(en); } } + @Test + public void relationshipTest() throws JSONException, ParseException, IOException { + final FormSubmission fs = getFormSubmissionFor("new_member_registration"); + final Client c = oc.getClientFromFormSubmission(fs); + System.out.print(c); + if(pushToOpenmrsForTest){ + System.out.println(ps.getPatientByIdentifier(c.getBaseEntityId())); + JSONObject p = ps.getPatientByIdentifier(c.getBaseEntityId()); + if(p == null){ + p = ps.createPatient(c); + } + final JSONObject relationShipJSON=hhs.getRelationshipType(c.getRelationships().get(0).getRelationship()); + final String relationShipUUID=relationShipJSON.getString("uuid"); + JSONObject o=hhs.getRelationship(p.getString("uuid"),c.getRelationships().get(0).getRelationship(),c.getRelationships().get(0).getPerson_b()); + System.out.println("Before If: "+ o); + if(o==null) + { + o= hhs.createRelationship(p.getString("uuid"), relationShipUUID,c.getRelationships().get(0).getPerson_b()); + System.out.println("JsonObject: "+ o); + return; + } + System.out.println("RelationShip UUID: "+ o.getString("uuid")); + + } + } + + @Test public void testGroupedEncounter() throws JSONException, ParseException, IOException { - FormSubmission fs = getFormSubmissionFor("repeatform"); + final FormSubmission fs = getFormSubmissionFor("repeatform"); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); //TODO - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); //TODO /*if(true){ JSONObject p = ps.getPatientByIdentifier(c.getBaseEntityId()); @@ -102,9 +135,9 @@ public void testGroupedEncounter() throws JSONException, ParseException, IOExcep @Test public void shouldHandleSubform() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("new_household_registration", 1); + final FormSubmission fs = getFormSubmissionFor("new_household_registration", 1); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBaseEntityId(), "a3f2abf4-2699-4761-819a-cea739224164"); assertEquals(c.getFirstName(), "test"); assertEquals(c.getGender(), "male"); @@ -114,7 +147,7 @@ public void shouldHandleSubform() throws IOException, ParseException, JSONExcept assertEquals(c.getIdentifiers().get("GOB HHID"), "1234"); assertEquals(c.getIdentifiers().get("JiVitA HHID"), "1234"); - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); assertEquals(e.getBaseEntityId(), "a3f2abf4-2699-4761-819a-cea739224164"); assertEquals(e.getEventDate(), new DateTime(new DateTime("2015-05-07"))); assertEquals(e.getLocationId(), "KUPTALA"); @@ -127,11 +160,12 @@ public void shouldHandleSubform() throws IOException, ParseException, JSONExcept assertEquals(e.getObs().get(1).getFieldCode(), "5611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"); assertEquals(e.getObs().get(1).getFormSubmissionField(), "FWNHHMBRNUM"); assertEquals(e.getObs().get(1).getValue(), "2"); - - Map> dc = oc.getDependentClientsFromFormSubmission(fs); - for (String id : dc.keySet()) { - Client cl = (Client) dc.get(id).get("client"); - Event ev = (Event) dc.get(id).get("event"); + + final Map> dc = oc.getDependentClientsFromFormSubmission(fs); + final int i=0; + for (final String id : dc.keySet()) { + final Client cl = (Client) dc.get(id).get("client"); + final Event ev = (Event) dc.get(id).get("event"); assertEquals(cl.getBaseEntityId(), id); assertEquals(ev.getBaseEntityId(), id); } @@ -139,9 +173,9 @@ public void shouldHandleSubform() throws IOException, ParseException, JSONExcept @Test public void shouldHandleEmptyRepeatGroup() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("new_household_registration", 5); + final FormSubmission fs = getFormSubmissionFor("new_household_registration", 5); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBaseEntityId(), "a3f2abf4-2699-4761-819a-cea739224164"); assertEquals(c.getFirstName(), "test"); assertEquals(c.getGender(), "male"); @@ -151,7 +185,7 @@ public void shouldHandleEmptyRepeatGroup() throws IOException, ParseException, J assertEquals(c.getIdentifiers().get("GOB HHID"), "1234"); assertEquals(c.getIdentifiers().get("JiVitA HHID"), "1234"); - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); assertEquals(e.getBaseEntityId(), "a3f2abf4-2699-4761-819a-cea739224164"); assertEquals(e.getEventDate(), new DateTime(new DateTime("2015-05-07"))); assertEquals(e.getLocationId(), "KUPTALA"); @@ -165,21 +199,21 @@ public void shouldHandleEmptyRepeatGroup() throws IOException, ParseException, J assertEquals(e.getObs().get(1).getFormSubmissionField(), "FWNHHMBRNUM"); assertEquals(e.getObs().get(1).getValue(), "2"); - Map> dc = oc.getDependentClientsFromFormSubmission(fs); + final Map> dc = oc.getDependentClientsFromFormSubmission(fs); assertTrue(dc.isEmpty()); } @Test public void shouldGetBirthdateNotEstimatedForMainAndApproxForRepeatGroup() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("new_household_registration", 7); + final FormSubmission fs = getFormSubmissionFor("new_household_registration", 7); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBirthdate(), new DateTime("1900-01-01")); assertTrue(c.getBirthdateApprox()); - Map> dc = oc.getDependentClientsFromFormSubmission(fs); - for (String id : dc.keySet()) { - Client cl = (Client) dc.get(id).get("client"); + final Map> dc = oc.getDependentClientsFromFormSubmission(fs); + for (final String id : dc.keySet()) { + final Client cl = (Client) dc.get(id).get("client"); assertEquals(cl.getBirthdate(), new DateTime("2000-05-07")); assertFalse(cl.getBirthdateApprox()); } @@ -187,32 +221,33 @@ public void shouldGetBirthdateNotEstimatedForMainAndApproxForRepeatGroup() throw @Test public void shouldGetBirthdateNotEstimatedForMainAndRepeatGroupIfNotSpecified() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("new_household_registration", 8); + final FormSubmission fs = getFormSubmissionFor("new_household_registration", 8); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBirthdate(), new DateTime("1900-01-01")); assertFalse(c.getBirthdateApprox()); - Map> dc = oc.getDependentClientsFromFormSubmission(fs); - for (String id : dc.keySet()) { - Client cl = (Client) dc.get(id).get("client"); + final Map> dc = oc.getDependentClientsFromFormSubmission(fs); + for (final String id : dc.keySet()) { + final Client cl = (Client) dc.get(id).get("client"); assertEquals(cl.getBirthdate(), new DateTime("2000-05-07")); assertFalse(cl.getBirthdateApprox()); } } + @SuppressWarnings("unchecked") @Test public void shouldGetDataSpecifiedInGroupInsideSubform() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("new_household_registration_with_grouped_subform_data", 1); + final FormSubmission fs = getFormSubmissionFor("new_household_registration_with_grouped_subform_data", 1); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBirthdate(), new DateTime("1900-01-01")); assertFalse(c.getBirthdateApprox()); assertThat(c.getAttributes(), Matchers.hasEntry(equalTo("GoB_HHID"), equalTo((Object)"2322"))); assertThat(c.getAttributes(), Matchers.hasEntry(equalTo("JiVitA_HHID"), equalTo((Object)"9889"))); - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); assertEquals(e.getBaseEntityId(), c.getBaseEntityId()); assertEquals(e.getEventType(), "New Household Registration"); assertEquals(e.getEventDate(), new DateTime(new SimpleDateFormat("yyyy-M-dd").parse("2015-10-11"))); @@ -224,9 +259,9 @@ public void shouldGetDataSpecifiedInGroupInsideSubform() throws IOException, Par Matchers.hasProperty("formSubmissionField",equalTo("FWNHHMBRNUM")) ))); - Map> dc = oc.getDependentClientsFromFormSubmission(fs); - for (String id : dc.keySet()) { - Client cl = (Client) dc.get(id).get("client"); + final Map> dc = oc.getDependentClientsFromFormSubmission(fs); + for (final String id : dc.keySet()) { + final Client cl = (Client) dc.get(id).get("client"); assertEquals(cl.getBirthdate(), new DateTime("1988-10-08")); assertFalse(cl.getBirthdateApprox()); assertEquals(cl.getFirstName(), "jackfruit"); @@ -238,7 +273,7 @@ public void shouldGetDataSpecifiedInGroupInsideSubform() throws IOException, Par assertThat(cl.getAttributes(), Matchers.hasEntry(equalTo("GoB_HHID"), equalTo((Object)"2322"))); assertThat(cl.getAttributes(), Matchers.hasEntry(equalTo("JiVitA_HHID"), equalTo((Object)"9889"))); - Event ev = (Event) dc.get(id).get("event"); + final Event ev = (Event) dc.get(id).get("event"); assertEquals(ev.getBaseEntityId(), cl.getBaseEntityId()); assertEquals(ev.getEventType(), "New Woman Registration"); assertEquals(ev.getEventDate(), new DateTime(new SimpleDateFormat("yyyy-M-dd").parse("2015-10-11"))); @@ -257,8 +292,8 @@ public void shouldGetDataSpecifiedInGroupInsideSubform() throws IOException, Par } if(pushToOpenmrsForTest){ - OpenmrsHouseHold hh = new OpenmrsHouseHold(c, e); - for (Map cm : dc.values()) { + final OpenmrsHouseHold hh = new OpenmrsHouseHold(c, e); + for (final Map cm : dc.values()) { hh.addHHMember((Client)cm.get("client"), (Event)cm.get("event")); } @@ -266,18 +301,19 @@ public void shouldGetDataSpecifiedInGroupInsideSubform() throws IOException, Par } } + @SuppressWarnings("unchecked") @Test public void shouldGetDataSpecifiedInMultiselect() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("new_household_registration_with_grouped_subform_data", 1); + final FormSubmission fs = getFormSubmissionFor("new_household_registration_with_grouped_subform_data", 1); - Client c = oc.getClientFromFormSubmission(fs); - Event e = oc.getEventFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); - Map> dc = oc.getDependentClientsFromFormSubmission(fs); - for (String id : dc.keySet()) { - Client cl = (Client) dc.get(id).get("client"); - Event ev = (Event) dc.get(id).get("event"); + final Map> dc = oc.getDependentClientsFromFormSubmission(fs); + for (final String id : dc.keySet()) { + final Client cl = (Client) dc.get(id).get("client"); + final Event ev = (Event) dc.get(id).get("event"); assertThat(ev.getObs(), Matchers.hasItem(Matchers.allOf( Matchers.hasProperty("fieldCode",equalTo("163087AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA")), @@ -289,8 +325,8 @@ public void shouldGetDataSpecifiedInMultiselect() throws IOException, ParseExcep } if(pushToOpenmrsForTest){ - OpenmrsHouseHold hh = new OpenmrsHouseHold(c, e); - for (Map cm : dc.values()) { + final OpenmrsHouseHold hh = new OpenmrsHouseHold(c, e); + for (final Map cm : dc.values()) { hh.addHHMember((Client)cm.get("client"), (Event)cm.get("event")); } @@ -298,12 +334,13 @@ public void shouldGetDataSpecifiedInMultiselect() throws IOException, ParseExcep } } + @Test public void parentChildObsTest() throws JsonIOException, IOException, JSONException { - FormSubmission fs = getFormSubmissionFor("psrf_form"); + final FormSubmission fs = getFormSubmissionFor("psrf_form"); - Client c = oc.getClientFromFormSubmission(fs); - Event e = (Event) oc.getEventFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); + final Event e = (Event) oc.getEventFromFormSubmission(fs); if(pushToOpenmrsForTest){ @@ -316,12 +353,13 @@ public void parentChildObsTest() throws JsonIOException, IOException, JSONExcept } + @SuppressWarnings("unchecked") @Test public void shouldHandleTTEnrollmentform() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("woman_enrollment"); + final FormSubmission fs = getFormSubmissionFor("woman_enrollment"); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBaseEntityId(), "69995674-bb29-4985-967a-fec8d372a475"); assertEquals(c.getFirstName(), "barsaat"); assertEquals(c.getGender(), "female"); @@ -335,7 +373,7 @@ public void shouldHandleTTEnrollmentform() throws IOException, ParseException, J assertEquals(c.getIdentifiers().get("Program Client ID"), "14608844"); assertEquals(c.getAttributes().get("EPI Card Number"), "20160003"); - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); assertEquals(e.getBaseEntityId(), "69995674-bb29-4985-967a-fec8d372a475"); assertEquals(e.getEventDate(), new DateTime(new DateTime("2016-04-05"))); assertEquals(e.getLocationId(), "Homeopathic Center"); @@ -382,12 +420,13 @@ public void shouldHandleTTEnrollmentform() throws IOException, ParseException, J } + @SuppressWarnings("unchecked") @Test public void shouldHandleChildVaccinationEnrollmentform() throws IOException, ParseException, JSONException{ - FormSubmission fs = getFormSubmissionFor("child_enrollment"); + final FormSubmission fs = getFormSubmissionFor("child_enrollment"); - Client c = oc.getClientFromFormSubmission(fs); + final Client c = oc.getClientFromFormSubmission(fs); assertEquals(c.getBaseEntityId(), "ad653225-6bed-48d3-8e5d-741d3d50d61a"); assertEquals(c.getFirstName(), "aase"); assertEquals(c.getLastName(), "zeest"); @@ -402,7 +441,7 @@ public void shouldHandleChildVaccinationEnrollmentform() throws IOException, Par assertEquals(c.getIdentifiers().get("Program Client ID"), "98120722"); assertEquals(c.getAttributes().get("EPI Card Number"), "20160009"); - Event e = oc.getEventFromFormSubmission(fs); + final Event e = oc.getEventFromFormSubmission(fs); assertEquals(e.getBaseEntityId(), "ad653225-6bed-48d3-8e5d-741d3d50d61a"); assertEquals(e.getEventDate(), new DateTime(new DateTime("2016-03-05"))); assertEquals(e.getLocationId(), "Homeopathic Center"); diff --git a/opensrp-connector/src/test/resources/form/family_registration/form.json b/opensrp-connector/src/test/resources/form/family_registration/form.json new file mode 100644 index 0000000000..731d4de542 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/family_registration/form.json @@ -0,0 +1 @@ +{"name":"family_registration_form","title":"خاندان رجسٹریشن فارم - Family Registration Form","sms_keyword":"family_registration_form","default_language":"English","choices":{"provinces":[{"name":"sindh","label":{"Roman Urdu":"Sindh","English":"Sindh"}},{"name":"punjab","label":{"Roman Urdu":"Punjab","English":"Punjab"}},{"name":"balochistan","label":{"Roman Urdu":"Balochistan","English":"Balochistan"}},{"name":"kpk","label":{"Roman Urdu":"Khyber Pakhtunkhwa","English":"Khyber Pakhtunkhwah"}},{"name":"gilgit_baltistan","label":{"Roman Urdu":"Gilgit Baltistan","English":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Roman Urdu":"Kashmir","English":"Kashmir"}},{"name":"fata","label":{"Roman Urdu":"FATA","English":"FATA"}},{"name":"out_of_country","label":{"Roman Urdu":"Mulk se baahir","English":"Out of Country"}}],"water_source":[{"instance":{"openmrs_code":"1510AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bore_hole","label":{"Roman Urdu":"Boring ka paani","English":"Bore Hole/Tube Well"}},{"instance":{"openmrs_code":"1508AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"roof_catchment","label":{"Roman Urdu":"Baarish ka jamah kardah paani","English":"Roof Catchment"}},{"instance":{"openmrs_code":"1507AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"spring","label":{"Roman Urdu":"Chasmay ka paani","English":"Spring"}},{"instance":{"openmrs_code":"1509AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"well","label":{"Roman Urdu":"Koonway ka paani","English":"Well"}},{"instance":{"openmrs_code":"1506AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"river","label":{"Roman Urdu":"Darya/Nadi/Neher ka paani","English":"River/Stream/Canal"}},{"instance":{"openmrs_code":"160314AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"water_faucet","label":{"Roman Urdu":"Zaathi nal ka paani","English":"Water Faucet in Home"}},{"instance":{"openmrs_code":"160315AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"public_water_faucet","label":{"Roman Urdu":"Awaami nal ka paani","English":"Public Water Faucet"}},{"instance":{"openmrs_code":"159609AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lake","label":{"Roman Urdu":"Jheel/Taalaab ka paani","English":"Lake/Pond"}},{"instance":{"openmrs_code":"159608AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"dam","label":{"Roman Urdu":"Bund ka paani","English":"Dam"}},{"instance":{"openmrs_code":"159678AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bottled_water","label":{"Roman Urdu":"Bottle ka paani","English":"Bottled Water"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}],"ucs":[{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"madeji","label":{"English":"Madeji","Roman Urdu":"Madeji"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"mirzapur","label":{"English":"Mirzapur","Roman Urdu":"Mirzapur"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"bambihar","label":{"English":"Bambihar","Roman Urdu":"Bambihar"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"gaheja","label":{"English":"Gaheja","Roman Urdu":"Gaheja"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"panah_udho","label":{"English":"Panah Udho","Roman Urdu":"Panah Udho"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"nausharo_abro","label":{"English":"Nausharo Abro","Roman Urdu":"Nausharo Abro"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"garhi_yasin_uc","label":{"English":"Garhi Yasin UC","Roman Urdu":"Garhi Yasin UC"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"chato_mangi","label":{"English":"Chato Mangi","Roman Urdu":"Chato Mangi"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"amrot","label":{"English":"Amrot","Roman Urdu":"Amrot"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"jindo_dero","label":{"English":"Jindo Dero","Roman Urdu":"Jindo Dero"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"waryaso","label":{"English":"Waryaso","Roman Urdu":"Waryaso"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"dakhan","label":{"English":"Dakhan","Roman Urdu":"Dakhan"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"nim_horo","label":{"English":"Nim Horo","Roman Urdu":"Nim Horo"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"other_garhi_yasin","label":{"English":"Other","Roman Urdu":"Deegar"}},{"province":"sindh","city":"shikarpur","town":"garhi_yasin","name":"na_garhi_yasin","label":{"English":"Not Applicable","Roman Urdu":"Qaabil-e-atlaaq nahi"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"thairo","label":{"English":"Thairo","Roman Urdu":"Thairo"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"pir_bux_hujra","label":{"English":"Pir Bux Hujra","Roman Urdu":"Pir Bux Hujra"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"gari_daakho","label":{"English":"Gari Daakho","Roman Urdu":"Gari Daakho"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"muhammad_bagh","label":{"English":"Muhammad Bagh","Roman Urdu":"Muhammad Bagh"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"raheemabad","label":{"English":"Raheemabad","Roman Urdu":"Raheemabad"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"mian_sahib","label":{"English":"Mian Sahib","Roman Urdu":"Mian Sahib"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"khanpur_uc","label":{"English":"Khanpur UC","Roman Urdu":"Khanpur UC"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"gari_telgo","label":{"English":"Gari Telgo","Roman Urdu":"Gari Teigo"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"zarkhai","label":{"English":"Zarkhai","Roman Urdu":"Zarkhai"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"shabbirabad","label":{"English":"Shabbirabad","Roman Urdu":"Shabbirabad"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"other_khanpur","label":{"English":"Other","Roman Urdu":"Deegar"}},{"province":"sindh","city":"shikarpur","town":"khanpur","name":"na_khanpur","label":{"English":"Not Applicable","Roman Urdu":"Qaabil-e-atlaaq nahi"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"chak","label":{"English":"Chak","Roman Urdu":"Chak"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"mungrani","label":{"English":"Mungrani","Roman Urdu":"Mungrani"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"rustam","label":{"English":"Rustam","Roman Urdu":"Rustam"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"ruk","label":{"English":"Ruk","Roman Urdu":"Ruk"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"sher_kot","label":{"English":"Sher Kot","Roman Urdu":"Sher Kot"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"wazirabad","label":{"English":"Wazirabad","Roman Urdu":"Wazirabad"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"lakhi_uc","label":{"English":"Lakhi UC","Roman Urdu":"Lakhi UC"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"sehwani","label":{"English":"Sehwani","Roman Urdu":"Sehwani"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"bhirkan","label":{"English":"Bhirkan","Roman Urdu":"Bhirkan"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"taib","label":{"English":"Taib","Roman Urdu":"Taib"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"abdu","label":{"English":"Abdu","Roman Urdu":"Abdu"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"other_binqasim","label":{"English":"Other","Roman Urdu":"Deegar"}},{"province":"sindh","city":"shikarpur","town":"lakhi","name":"na_binqasim","label":{"English":"Not Applicable","Roman Urdu":"Qaabil-e-atlaaq nahi"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_1","label":{"English":"UC 1","Roman Urdu":"UC 1"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_2","label":{"English":"UC 2","Roman Urdu":"UC 2"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_3","label":{"English":"UC 3","Roman Urdu":"UC 3"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_4","label":{"English":"UC 4","Roman Urdu":"UC 4"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_5","label":{"English":"UC 5","Roman Urdu":"UC 5"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_6","label":{"English":"UC 6","Roman Urdu":"UC 6"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_7","label":{"English":"UC 7","Roman Urdu":"UC 7"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"uc_8","label":{"English":"UC 8","Roman Urdu":"UC 8"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"jagan","label":{"English":"Jagan","Roman Urdu":"Jagan"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"lodra","label":{"English":"Lodra","Roman Urdu":"Lodra"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"sultan_kot","label":{"English":"Sultan Kot","Roman Urdu":"Sultan Kot"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"karan","label":{"English":"Karan","Roman Urdu":"Karan"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"jahanwah","label":{"English":"Jahanwah","Roman Urdu":"Jahanwah"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"jano","label":{"English":"Jano","Roman Urdu":"Jano"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"humayun","label":{"English":"Humayun","Roman Urdu":"Humayun"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"other_gadap","label":{"English":"Other","Roman Urdu":"Deegar"}},{"province":"sindh","city":"shikarpur","town":"shikarpur_taluka","name":"na_gadap","label":{"English":"Not Applicable","Roman Urdu":"Qaabil-e-atlaaq nahi"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Haan","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"Nahi","English":"No"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Roman Urdu":"Khwaja sira","English":"Transgender"}}],"latrine_system":[{"instance":{"openmrs_code":"159577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"flush_toilet","label":{"Roman Urdu":"Commode","English":"Flush Toilet"}},{"instance":{"openmrs_code":"163079AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pour_flush_toilet","label":{"Roman Urdu":"WC","English":"Pour Flush Toilet"}},{"instance":{"openmrs_code":"159580AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pit","label":{"Roman Urdu":"Garha","English":"Pit Latrine"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}],"towns":[{"province":"sindh","city":"shikarpur","name":"garhi_yasin","label":{"English":"Garhi Yasin","Roman Urdu":"Garhi Yasin"}},{"province":"sindh","city":"shikarpur","name":"khanpur","label":{"English":"Khanpur","Roman Urdu":"Khanpur"}},{"province":"sindh","city":"shikarpur","name":"lakhi","label":{"English":"Lakhi","Roman Urdu":"Lakhi"}},{"province":"sindh","city":"shikarpur","name":"shikarpur_taluka","label":{"English":"Shikarpur Taluka","Roman Urdu":"Shikarpur Taluka"}},{"province":"sindh","city":"shikarpur","name":"other","label":{"English":"Other","Roman Urdu":"Deegar"}},{"province":"sindh","city":"shikarpur","name":"not_applicable","label":{"English":"Not Applicable","Roman Urdu":"Qaabil-e-atlaaq nahi"}}],"cities":[{"province":"sindh","name":"shikarpur","label":{"Roman Urdu":"Shikarpur","English":"Shikarpur"}},{"province":"na","name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Roman Urdu":"Not Applicable","English":"Not Applicable"}}],"ethnicity":[{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}],"rel_hhh":[{"instance":{"openmrs_code":"970AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"mother","label":{"Roman Urdu":"Waalda","English":"Mother"}},{"instance":{"openmrs_code":"971AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"father","label":{"Roman Urdu":"Waalid","English":"Father"}},{"instance":{"openmrs_code":"5617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"spouse","label":{"Roman Urdu":"Shareek-e-hayaat","English":"Spouse"}},{"instance":{"openmrs_code":"160729AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"brother","label":{"Roman Urdu":"Bhai","English":"Brother"}},{"instance":{"openmrs_code":"160730AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sister","label":{"Roman Urdu":"Behen","English":"Sister"}},{"instance":{"openmrs_code":"160727AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"son","label":{"Roman Urdu":"Beta","English":"Son"}},{"instance":{"openmrs_code":"160728AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"daughter","label":{"Roman Urdu":"Beti","English":"Daughter"}},{"instance":{"openmrs_code":"1529AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"grandson","label":{"Roman Urdu":"Nawasa/Pota/Nawasi/Poti","English":"Grandchild"}},{"instance":{"openmrs_code":"974AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"uncle","label":{"Roman Urdu":"Maamoon/Khaaloo/Phuppa/Chacha/Thaya","English":"Uncle"}},{"instance":{"openmrs_code":"975AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"aunt","label":{"Roman Urdu":"Maami/Khala/Phuppo/Chachi/Thai","English":"Aunt"}},{"name":"cousin","label":{"Roman Urdu":"Cousin","English":"Cousin"}},{"instance":{"openmrs_code":"1580AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"nephew_niece","label":{"Roman Urdu":"Bhateeja/Bhaanja/Bhateeji/Bhaanji","English":"Nephew/Niece"}},{"name":"brother_in_law","label":{"Roman Urdu":"Saala/Bhenoi","English":"Brother-in-law"}},{"name":"sister_in_law","label":{"Roman Urdu":"Saali/Bhaabi","English":"Sister-in-law"}},{"instance":{"openmrs_code":"159684AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"mother_in_law","label":{"Roman Urdu":"Saas","English":"Mother-in-law"}},{"instance":{"openmrs_code":"159720AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"father_in_law","label":{"Roman Urdu":"Susar","English":"Father-in-law"}},{"instance":{"openmrs_code":"1581AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"son_daughter_in_law","label":{"Roman Urdu":"Daamaad/Bahoo","English":"Son-in-law/Daughter-in-law"}},{"instance":{"openmrs_code":"160723AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"maternal_grandmother","label":{"Roman Urdu":"Naani","English":"Maternal grandmother"}},{"instance":{"openmrs_code":"160726AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"paternal_grandmother","label":{"Roman Urdu":"Daadi","English":"Paternal grandmother"}},{"instance":{"openmrs_code":"160724AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"maternal_grandfather","label":{"Roman Urdu":"Daada","English":"Maternal grandfather"}},{"instance":{"openmrs_code":"160725AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"paternal_grandfather","label":{"Roman Urdu":"Naana","English":"Paternal grandfather"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}]},"instance":{"encounter_type":"Family Registration Form"},"version":"201609051713","id_string":"family_registration_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"bind":{"calculate":"${today}"},"type":"calculate","instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"name":"client_reg_date","label":{"Roman Urdu":"Indraj ki Tareekh","English":"Data Entry Date"}},{"instance":{"openmrs_entity_id":"Household ID","openmrs_entity":"person_identifier"},"type":"hidden","name":"household_id","label":{"Roman Urdu":"Gharaane ki ID","English":"Household ID"}},{"bind":{"required":"yes"},"type":"note","name":"household_id_note","label":{"Roman Urdu":"Gharaane ki ID: ${household_id}","English":"Household ID : ${household_id}"}},{"label":{"Roman Urdu":"Gharaane k sarbarah ki tafseelat","English":"Household Head Details"},"type":"group","children":[{"bind":{"required":"yes"},"label":{"Roman Urdu":"Gharane kay sarabarah ka pehlay kisi Thrive kay Progam may indraj hay","English":"Household head already enrolled in any other Thrive program"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Haan","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"Nahi","English":"No"}}],"name":"already_enrolled_in_other_program"},{"bind":{"constraint":"regex(., '[0-9]{0,20}$')","jr:constraintMsg":{"English":"Maximum 20 digits and cannot contain anything other than number"},"relevant":"selected(${already_enrolled_in_other_program}, 'yes')","required":"yes"},"type":"text","instance":{"openmrs_entity_id":"Program Client ID","openmrs_entity":"person_identifier"},"name":"program_client_id","label":{"Roman Urdu":"Program Client ID","English":"Program Client ID"}},{"bind":{"constraint":". = ${program_client_id}","jr:constraintMsg":{"Roman Urdu":"Mandarja ID darj bala ID say mukhtalif nahi hosakti","English":"Does not match with value entered above"},"relevant":"selected(${already_enrolled_in_other_program}, 'yes')","required":"yes"},"type":"text","name":"program_client_id_confirm","label":{"English":"Re-enter Program Client ID","Roman Urdu":"Program Client ID dobara darj karen"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Naam 3-30 huroof par mushtamil hona chahyay kisi makhsoo harf ki bagahir. Iskay ilawa sirf [. - space] hosaktay hen","English":"Name should contain only 3-30 alphabets and no special characters. Only allowed [. - space]"},"required":"yes","constraint":"regex(., '^[\\s\\.\\-a-zA-Z]{3,30}$')"},"type":"text","instance":{"openmrs_entity_id":"first_name","openmrs_entity":"person"},"name":"first_name","label":{"Roman Urdu":"Naam","English":"Name"}},{"name":"gender","bind":{"required":"yes"},"label":{"Roman Urdu":"Jins","English":"Gender"},"instance":{"openmrs_entity_id":"gender","openmrs_entity":"person"},"type":"select one","children":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Roman Urdu":"Khwaja sira","English":"Transgender"}}]},{"name":"birth_date_known","default":"yes","bind":{"required":"yes"},"label":{"English":"Is birthdate known?","Roman Urdu":"Kya tareekh-e-pedaaish maloom hai?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Haan","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"Nahi","English":"No"}}]},{"bind":{"constraint":".<=${today} and (int((${today} - .) div 365) < 160) and (int((${today} - .) div 365) > 10)","jr:constraintMsg":{"Roman Urdu":"Umr 10-160 saal kay darmiyan honi chahyay","English":"Age must be between 10-160"},"relevant":"selected(${birth_date_known}, 'yes')","required":"yes"},"type":"date","name":"birth_date","label":{"English":"Birth date","Roman Urdu":"Tareekh-e-pedaaish"}},{"bind":{"constraint":".<=160","jr:constraintMsg":{"Roman Urdu":"Umr 10-160 saal kay darmiyan honi chahyay","English":"Age must be between 10-160"},"relevant":"selected(${birth_date_known}, 'no')","required":"yes"},"type":"integer","name":"age","label":{"English":"Age (years)","Roman Urdu":"Umr (saal)"}},{"bind":{"calculate":"if(selected(${birth_date_known}, 'yes'), int((${today} - ${birth_date}) div 365), ${age})"},"type":"calculate","name":"calc_age","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"format-date (date(${today} - int(${age} * 365)), '%Y-%m-%d')"},"type":"calculate","name":"calc_dob"},{"bind":{"calculate":"if(${birth_date_known}='yes', ${birth_date}, ${calc_dob})"},"type":"calculate","name":"dob","instance":{"openmrs_entity_id":"birthdate","openmrs_entity":"person"}},{"bind":{"calculate":"if(${birth_date_known} = 'yes', '0', '1')"},"type":"calculate","name":"dob_estimated","instance":{"openmrs_entity_id":"birthdate_estimated","openmrs_entity":"person"}},{"type":"note","name":"birth_date_note","label":{"Roman Urdu":"Tareekh-e-pedaaish: ${dob} (${calc_age} saal)","English":"Date of Birth: ${dob} (${calc_age} years)"}},{"bind":{"calculate":"concat(${household_id},'01')"},"type":"calculate","name":"household_member_id","instance":{"openmrs_entity_id":"Household Member ID","openmrs_entity":"person_identifier"}},{"type":"note","name":"household_member_id_note","label":{"Roman Urdu":"Household Memebr ID : ${household_member_id}","English":"Household Memebr ID : ${household_member_id}"}},{"control":{"appearance":"minimal"},"name":"ethnicity","bind":{"required":"yes"},"label":{"Roman Urdu":"Qomiat","English":"Ethnicity"},"instance":{"openmrs_entity_id":"163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${ethnicity}, 'other')","required":"yes"},"type":"text","instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ethnicity_other","label":{"English":"Please specify:","Roman Urdu":"Wazaahat karain"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********","English":"Phone number should be 11 digits in the following format: 03*********"},"constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Roman Urdu":"Mobile phone number:","English":"Mobile phone number:"}}],"name":"household_head"},{"label":{"Roman Urdu":"Gharaane ki tafseelaat","English":"Household Details"},"type":"group","children":[{"bind":{"jr:constraintMsg":{"Roman Urdu":"0-50 kay darmiyan hona chahyay","English":"Should be from 0-50"},"required":"yes","constraint":".>=1 and .<=50"},"type":"integer","instance":{"openmrs_entity_id":"5611AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"num_household_members","label":{"Roman Urdu":"Gharaane kay afraad ki taadaad (bashamool sarbarah)","English":"Number of members in household (including head)"}},{"control":{"appearance":"minimal"},"name":"province","default":"sindh","bind":{"required":"yes"},"label":{"English":"Province","Roman Urdu":"Suba"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"sindh","label":{"Roman Urdu":"Sindh","English":"Sindh"}},{"name":"punjab","label":{"Roman Urdu":"Punjab","English":"Punjab"}},{"name":"balochistan","label":{"Roman Urdu":"Balochistan","English":"Balochistan"}},{"name":"kpk","label":{"Roman Urdu":"Khyber Pakhtunkhwa","English":"Khyber Pakhtunkhwah"}},{"name":"gilgit_baltistan","label":{"Roman Urdu":"Gilgit Baltistan","English":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Roman Urdu":"Kashmir","English":"Kashmir"}},{"name":"fata","label":{"Roman Urdu":"FATA","English":"FATA"}},{"name":"out_of_country","label":{"Roman Urdu":"Mulk se baahir","English":"Out of Country"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"shikarpur","bind":{"required":"yes"},"label":{"English":"City","Roman Urdu":"Shehr"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"required":"yes"},"label":{"English":"Town","Roman Urdu":"Town / Qasbah / Basti"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"required":"yes"},"label":{"English":"Union Council","Roman Urdu":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"address1","openmrs_entity_parent":"usual_residence"},"name":"address1","label":{"English":"Home Address","Roman Urdu":"Ghar ka pata"}},{"bind":{"calculate":"jr:choice-name(${province}, '${province}')"},"type":"calculate","name":"provincename"},{"bind":{"calculate":"jr:choice-name(${city_village}, '${city_village}')"},"type":"calculate","name":"city_villagename"},{"bind":{"calculate":"jr:choice-name(${town}, '${town}')"},"type":"calculate","name":"townname"},{"bind":{"calculate":"jr:choice-name(${union_council}, '${union_council}')"},"type":"calculate","name":"union_councilname"},{"type":"note","name":"address","label":{"Roman Urdu":"Pata: ${address1}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","English":"Address: ${address1}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"gps_location","label":{"Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain","English":"Collect GPS coordinates of data entry location"}},{"control":{"appearance":"minimal"},"name":"water_source","bind":{"required":"yes"},"label":{"Roman Urdu":"Peenay ke paani ka zariya","English":"Source of drinking water"},"instance":{"openmrs_entity_id":"1511AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1510AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bore_hole","label":{"Roman Urdu":"Boring ka paani","English":"Bore Hole/Tube Well"}},{"instance":{"openmrs_code":"1508AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"roof_catchment","label":{"Roman Urdu":"Baarish ka jamah kardah paani","English":"Roof Catchment"}},{"instance":{"openmrs_code":"1507AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"spring","label":{"Roman Urdu":"Chasmay ka paani","English":"Spring"}},{"instance":{"openmrs_code":"1509AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"well","label":{"Roman Urdu":"Koonway ka paani","English":"Well"}},{"instance":{"openmrs_code":"1506AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"river","label":{"Roman Urdu":"Darya/Nadi/Neher ka paani","English":"River/Stream/Canal"}},{"instance":{"openmrs_code":"160314AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"water_faucet","label":{"Roman Urdu":"Zaathi nal ka paani","English":"Water Faucet in Home"}},{"instance":{"openmrs_code":"160315AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"public_water_faucet","label":{"Roman Urdu":"Awaami nal ka paani","English":"Public Water Faucet"}},{"instance":{"openmrs_code":"159609AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lake","label":{"Roman Urdu":"Jheel/Taalaab ka paani","English":"Lake/Pond"}},{"instance":{"openmrs_code":"159608AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"dam","label":{"Roman Urdu":"Bund ka paani","English":"Dam"}},{"instance":{"openmrs_code":"159678AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"bottled_water","label":{"Roman Urdu":"Bottle ka paani","English":"Bottled Water"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${water_source}, 'other')","required":"yes"},"type":"text","instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1511AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"water_source_other","label":{"English":"Please specify:","Roman Urdu":"Wazaahat karain"}},{"control":{"appearance":"minimal"},"name":"latrine_system","bind":{"required":"yes"},"label":{"Roman Urdu":"Latrine system","English":"Latrine system"},"instance":{"openmrs_entity_id":"159741AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"159577AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"flush_toilet","label":{"Roman Urdu":"Commode","English":"Flush Toilet"}},{"instance":{"openmrs_code":"163079AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pour_flush_toilet","label":{"Roman Urdu":"WC","English":"Pour Flush Toilet"}},{"instance":{"openmrs_code":"159580AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pit","label":{"Roman Urdu":"Garha","English":"Pit Latrine"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${latrine_system}, 'other')","required":"yes"},"type":"text","instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"159741AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"latrine_system_other","label":{"English":"Please specify:","Roman Urdu":"Wazaahat karain"}}],"name":"household"},{"control":{"appearance":"multiline"},"instance":{"openmrs_entity_id":"161011AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"text","name":"comments","label":{"Roman Urdu":"Tabsarah","English":"Comments"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/family_registration/form.xml b/opensrp-connector/src/test/resources/form/family_registration/form.xml new file mode 100644 index 0000000000..b8aa14a8a9 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/family_registration/form.xml @@ -0,0 +1,690 @@ +
+ + +

خاندان رجسٹریشن فارم - Family Registration Form

+
+

+ Gharaane k sarbarah ki tafseelat + + Household Head Details +

+
+
+ + Gharane kay sarabarah ka pehlay kisi Thrive kay Progam may indraj hay + + Household head already enrolled in any other Thrive program + * +
+ + +
+
+
+ + + +
+
+ + Jins + + Gender + * +
+ + + +
+
+
+
+
+ + Kya tareekh-e-pedaaish maloom hai? + + Is birthdate known? + * +
+ + +
+
+
+ + + + + + +
+
+

+ Gharaane ki tafseelaat + + Household Details +

+ + + + + + + + + + + +
+ + +
diff --git a/opensrp-connector/src/test/resources/form/family_registration/form_definition.json b/opensrp-connector/src/test/resources/form/family_registration/form_definition.json new file mode 100644 index 0000000000..4452f20ebd --- /dev/null +++ b/opensrp-connector/src/test/resources/form/family_registration/form_definition.json @@ -0,0 +1,170 @@ +{ + "form_data_definition_version" : "2", + "form" : { + "bind_type" : "pkhousehold", + "default_bind_path" : "/model/instance/family_registration_form/", + "fields" : [ { + "name" : "id", + "shouldLoadValue" : true + }, { + "name" : "provider_uc", + "bind" : "/model/instance/family_registration_form/provider_uc" + }, { + "name" : "provider_town", + "bind" : "/model/instance/family_registration_form/provider_town" + }, { + "name" : "provider_city", + "bind" : "/model/instance/family_registration_form/provider_city" + }, { + "name" : "provider_province", + "bind" : "/model/instance/family_registration_form/provider_province" + }, { + "name" : "provider_location_id", + "bind" : "/model/instance/family_registration_form/provider_location_id" + }, { + "name" : "provider_location_name", + "bind" : "/model/instance/family_registration_form/provider_location_name" + }, { + "name" : "provider_location_note", + "bind" : "/model/instance/family_registration_form/provider_location_note" + }, { + "name" : "start", + "bind" : "/model/instance/family_registration_form/start" + }, { + "name" : "end", + "bind" : "/model/instance/family_registration_form/end" + }, { + "name" : "today", + "bind" : "/model/instance/family_registration_form/today" + }, { + "name" : "deviceid", + "bind" : "/model/instance/family_registration_form/deviceid" + }, { + "name" : "subscriberid", + "bind" : "/model/instance/family_registration_form/subscriberid" + }, { + "name" : "simserial", + "bind" : "/model/instance/family_registration_form/simserial" + }, { + "name" : "phonenumber", + "bind" : "/model/instance/family_registration_form/phonenumber" + }, { + "name" : "client_reg_date", + "bind" : "/model/instance/family_registration_form/client_reg_date" + }, { + "name" : "household_id", + "bind" : "/model/instance/family_registration_form/household_id" + }, { + "name" : "household_id_note", + "bind" : "/model/instance/family_registration_form/household_id_note" + }, { + "name" : "already_enrolled_in_other_program", + "bind" : "/model/instance/family_registration_form/household_head/already_enrolled_in_other_program" + }, { + "name" : "program_client_id", + "bind" : "/model/instance/family_registration_form/household_head/program_client_id" + }, { + "name" : "program_client_id_confirm", + "bind" : "/model/instance/family_registration_form/household_head/program_client_id_confirm" + }, { + "name" : "first_name", + "bind" : "/model/instance/family_registration_form/household_head/first_name" + }, { + "name" : "gender", + "bind" : "/model/instance/family_registration_form/household_head/gender" + }, { + "name" : "birth_date_known", + "bind" : "/model/instance/family_registration_form/household_head/birth_date_known" + }, { + "name" : "birth_date", + "bind" : "/model/instance/family_registration_form/household_head/birth_date" + }, { + "name" : "age", + "bind" : "/model/instance/family_registration_form/household_head/age" + }, { + "name" : "calc_age", + "bind" : "/model/instance/family_registration_form/household_head/calc_age" + }, { + "name" : "calc_dob", + "bind" : "/model/instance/family_registration_form/household_head/calc_dob" + }, { + "name" : "dob", + "bind" : "/model/instance/family_registration_form/household_head/dob" + }, { + "name" : "dob_estimated", + "bind" : "/model/instance/family_registration_form/household_head/dob_estimated" + }, { + "name" : "birth_date_note", + "bind" : "/model/instance/family_registration_form/household_head/birth_date_note" + }, { + "name" : "household_member_id", + "bind" : "/model/instance/family_registration_form/household_head/household_member_id" + }, { + "name" : "household_member_id_note", + "bind" : "/model/instance/family_registration_form/household_head/household_member_id_note" + }, { + "name" : "ethnicity", + "bind" : "/model/instance/family_registration_form/household_head/ethnicity" + }, { + "name" : "ethnicity_other", + "bind" : "/model/instance/family_registration_form/household_head/ethnicity_other" + }, { + "name" : "contact_phone_number", + "bind" : "/model/instance/family_registration_form/household_head/contact_phone_number" + }, { + "name" : "num_household_members", + "bind" : "/model/instance/family_registration_form/household/num_household_members" + }, { + "name" : "province", + "bind" : "/model/instance/family_registration_form/household/province" + }, { + "name" : "city_village", + "bind" : "/model/instance/family_registration_form/household/city_village" + }, { + "name" : "town", + "bind" : "/model/instance/family_registration_form/household/town" + }, { + "name" : "union_council", + "bind" : "/model/instance/family_registration_form/household/union_council" + }, { + "name" : "address1", + "bind" : "/model/instance/family_registration_form/household/address1" + }, { + "name" : "provincename", + "bind" : "/model/instance/family_registration_form/household/provincename" + }, { + "name" : "city_villagename", + "bind" : "/model/instance/family_registration_form/household/city_villagename" + }, { + "name" : "townname", + "bind" : "/model/instance/family_registration_form/household/townname" + }, { + "name" : "union_councilname", + "bind" : "/model/instance/family_registration_form/household/union_councilname" + }, { + "name" : "address", + "bind" : "/model/instance/family_registration_form/household/address" + }, { + "name" : "gps_location", + "bind" : "/model/instance/family_registration_form/household/gps_location" + }, { + "name" : "water_source", + "bind" : "/model/instance/family_registration_form/household/water_source" + }, { + "name" : "water_source_other", + "bind" : "/model/instance/family_registration_form/household/water_source_other" + }, { + "name" : "latrine_system", + "bind" : "/model/instance/family_registration_form/household/latrine_system" + }, { + "name" : "latrine_system_other", + "bind" : "/model/instance/family_registration_form/household/latrine_system_other" + }, { + "name" : "comments", + "bind" : "/model/instance/family_registration_form/comments" + }, { + "name" : "instanceID", + "bind" : "/model/instance/family_registration_form/meta/instanceID" + } ] + } +} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/family_registration/model.xml b/opensrp-connector/src/test/resources/form/family_registration/model.xml new file mode 100644 index 0000000000..0d698454fa --- /dev/null +++ b/opensrp-connector/src/test/resources/form/family_registration/model.xml @@ -0,0 +1,786 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + yes + + + + + + + + + + + + + + + + sindh + shikarpur + + + + + + + +
+ + + + + + + + + + + + + + + + static_instance-provinces-0 + sindh + + + static_instance-provinces-1 + punjab + + + static_instance-provinces-2 + balochistan + + + static_instance-provinces-3 + kpk + + + static_instance-provinces-4 + gilgit_baltistan + + + static_instance-provinces-5 + kashmir + + + static_instance-provinces-6 + fata + + + static_instance-provinces-7 + out_of_country + + + + + + + static_instance-cities-0 + sindh + shikarpur + + + static_instance-cities-1 + na + other + + + static_instance-cities-2 + na + not_applicable + + + + + + + static_instance-ucs-0 + sindh + shikarpur + garhi_yasin + madeji + + + static_instance-ucs-1 + sindh + shikarpur + garhi_yasin + mirzapur + + + static_instance-ucs-2 + sindh + shikarpur + garhi_yasin + bambihar + + + static_instance-ucs-3 + sindh + shikarpur + garhi_yasin + gaheja + + + static_instance-ucs-4 + sindh + shikarpur + garhi_yasin + panah_udho + + + static_instance-ucs-5 + sindh + shikarpur + garhi_yasin + nausharo_abro + + + static_instance-ucs-6 + sindh + shikarpur + garhi_yasin + garhi_yasin_uc + + + static_instance-ucs-7 + sindh + shikarpur + garhi_yasin + chato_mangi + + + static_instance-ucs-8 + sindh + shikarpur + garhi_yasin + amrot + + + static_instance-ucs-9 + sindh + shikarpur + garhi_yasin + jindo_dero + + + static_instance-ucs-10 + sindh + shikarpur + garhi_yasin + waryaso + + + static_instance-ucs-11 + sindh + shikarpur + garhi_yasin + dakhan + + + static_instance-ucs-12 + sindh + shikarpur + garhi_yasin + nim_horo + + + static_instance-ucs-13 + sindh + shikarpur + garhi_yasin + other_garhi_yasin + + + static_instance-ucs-14 + sindh + shikarpur + garhi_yasin + na_garhi_yasin + + + static_instance-ucs-15 + sindh + shikarpur + khanpur + thairo + + + static_instance-ucs-16 + sindh + shikarpur + khanpur + pir_bux_hujra + + + static_instance-ucs-17 + sindh + shikarpur + khanpur + gari_daakho + + + static_instance-ucs-18 + sindh + shikarpur + khanpur + muhammad_bagh + + + static_instance-ucs-19 + sindh + shikarpur + khanpur + raheemabad + + + static_instance-ucs-20 + sindh + shikarpur + khanpur + mian_sahib + + + static_instance-ucs-21 + sindh + shikarpur + khanpur + khanpur_uc + + + static_instance-ucs-22 + sindh + shikarpur + khanpur + gari_telgo + + + static_instance-ucs-23 + sindh + shikarpur + khanpur + zarkhai + + + static_instance-ucs-24 + sindh + shikarpur + khanpur + shabbirabad + + + static_instance-ucs-25 + sindh + shikarpur + khanpur + other_khanpur + + + static_instance-ucs-26 + sindh + shikarpur + khanpur + na_khanpur + + + static_instance-ucs-27 + sindh + shikarpur + lakhi + chak + + + static_instance-ucs-28 + sindh + shikarpur + lakhi + mungrani + + + static_instance-ucs-29 + sindh + shikarpur + lakhi + rustam + + + static_instance-ucs-30 + sindh + shikarpur + lakhi + ruk + + + static_instance-ucs-31 + sindh + shikarpur + lakhi + sher_kot + + + static_instance-ucs-32 + sindh + shikarpur + lakhi + wazirabad + + + static_instance-ucs-33 + sindh + shikarpur + lakhi + lakhi_uc + + + static_instance-ucs-34 + sindh + shikarpur + lakhi + sehwani + + + static_instance-ucs-35 + sindh + shikarpur + lakhi + bhirkan + + + static_instance-ucs-36 + sindh + shikarpur + lakhi + taib + + + static_instance-ucs-37 + sindh + shikarpur + lakhi + abdu + + + static_instance-ucs-38 + sindh + shikarpur + lakhi + other_binqasim + + + static_instance-ucs-39 + sindh + shikarpur + lakhi + na_binqasim + + + static_instance-ucs-40 + sindh + shikarpur + shikarpur_taluka + uc_1 + + + static_instance-ucs-41 + sindh + shikarpur + shikarpur_taluka + uc_2 + + + static_instance-ucs-42 + sindh + shikarpur + shikarpur_taluka + uc_3 + + + static_instance-ucs-43 + sindh + shikarpur + shikarpur_taluka + uc_4 + + + static_instance-ucs-44 + sindh + shikarpur + shikarpur_taluka + uc_5 + + + static_instance-ucs-45 + sindh + shikarpur + shikarpur_taluka + uc_6 + + + static_instance-ucs-46 + sindh + shikarpur + shikarpur_taluka + uc_7 + + + static_instance-ucs-47 + sindh + shikarpur + shikarpur_taluka + uc_8 + + + static_instance-ucs-48 + sindh + shikarpur + shikarpur_taluka + jagan + + + static_instance-ucs-49 + sindh + shikarpur + shikarpur_taluka + lodra + + + static_instance-ucs-50 + sindh + shikarpur + shikarpur_taluka + sultan_kot + + + static_instance-ucs-51 + sindh + shikarpur + shikarpur_taluka + karan + + + static_instance-ucs-52 + sindh + shikarpur + shikarpur_taluka + jahanwah + + + static_instance-ucs-53 + sindh + shikarpur + shikarpur_taluka + jano + + + static_instance-ucs-54 + sindh + shikarpur + shikarpur_taluka + humayun + + + static_instance-ucs-55 + sindh + shikarpur + shikarpur_taluka + other_gadap + + + static_instance-ucs-56 + sindh + shikarpur + shikarpur_taluka + na_gadap + + + + + + + static_instance-gender-0 + male + + + static_instance-gender-1 + female + + + static_instance-gender-2 + transgender + + + + + + + static_instance-latrine_system-0 + flush_toilet + + + static_instance-latrine_system-1 + pour_flush_toilet + + + static_instance-latrine_system-2 + pit + + + static_instance-latrine_system-3 + other + + + + + + + static_instance-towns-0 + sindh + shikarpur + garhi_yasin + + + static_instance-towns-1 + sindh + shikarpur + khanpur + + + static_instance-towns-2 + sindh + shikarpur + lakhi + + + static_instance-towns-3 + sindh + shikarpur + shikarpur_taluka + + + static_instance-towns-4 + sindh + shikarpur + other + + + static_instance-towns-5 + sindh + shikarpur + not_applicable + + + + + + + static_instance-water_source-0 + bore_hole + + + static_instance-water_source-1 + roof_catchment + + + static_instance-water_source-2 + spring + + + static_instance-water_source-3 + well + + + static_instance-water_source-4 + river + + + static_instance-water_source-5 + water_faucet + + + static_instance-water_source-6 + public_water_faucet + + + static_instance-water_source-7 + lake + + + static_instance-water_source-8 + dam + + + static_instance-water_source-9 + bottled_water + + + static_instance-water_source-10 + other + + + + + + + static_instance-rel_hhh-0 + mother + + + static_instance-rel_hhh-1 + father + + + static_instance-rel_hhh-2 + spouse + + + static_instance-rel_hhh-3 + brother + + + static_instance-rel_hhh-4 + sister + + + static_instance-rel_hhh-5 + son + + + static_instance-rel_hhh-6 + daughter + + + static_instance-rel_hhh-7 + grandson + + + static_instance-rel_hhh-8 + uncle + + + static_instance-rel_hhh-9 + aunt + + + static_instance-rel_hhh-10 + cousin + + + static_instance-rel_hhh-11 + nephew_niece + + + static_instance-rel_hhh-12 + brother_in_law + + + static_instance-rel_hhh-13 + sister_in_law + + + static_instance-rel_hhh-14 + mother_in_law + + + static_instance-rel_hhh-15 + father_in_law + + + static_instance-rel_hhh-16 + son_daughter_in_law + + + static_instance-rel_hhh-17 + maternal_grandmother + + + static_instance-rel_hhh-18 + paternal_grandmother + + + static_instance-rel_hhh-19 + maternal_grandfather + + + static_instance-rel_hhh-20 + paternal_grandfather + + + static_instance-rel_hhh-21 + other + + + + + + + static_instance-ethnicity-0 + sindhi + + + static_instance-ethnicity-1 + muhajir + + + static_instance-ethnicity-2 + punjabi + + + static_instance-ethnicity-3 + pushtuns + + + static_instance-ethnicity-4 + saraiki + + + static_instance-ethnicity-5 + balochi + + + static_instance-ethnicity-6 + other + + + + + + + static_instance-yes_no-0 + yes + + + static_instance-yes_no-1 + no + + + + \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/new_household_registration/form.json b/opensrp-connector/src/test/resources/form/new_household_registration/form.json index 0288ac30df..3e5c2de2ab 100644 --- a/opensrp-connector/src/test/resources/form/new_household_registration/form.json +++ b/opensrp-connector/src/test/resources/form/new_household_registration/form.json @@ -89,29 +89,53 @@ "control": { "appearance": "numbers" }, - "name": "FWJIVHHID", + "name": "FWGOBHHID", "hint": { - "Bengali": "অনুগ্রহ করে খানার দরজাতে লেখা লাল রঙের JiVitA/Study household ID (HHID) টি টাইপ করুন", - "English": "Please input the RED – painted JiVitA / Study household ID (HHID) as displayed on the door/wall of the HH." + "Bengali": "অনুগ্রহ করে খানার দরজাতে লেখা কালো রঙের JiVitA/Study household ID (HHID) টি টাইপ করুন", + "English": "Please input the Black – painted Government household ID (HHID) as displayed on the door/wall of the HH." }, "bind": { "jr:constraintMsg": { - "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের JiVitA HHID টাইপ করুন", - "English": "Please enter 4 digits of JiVitA HHID from 0001 to 9999" + "Bengali": "অনুগ্রহ করে ০০০১ থেকে ৯৯৯৯ এর মধ্যে ৪ ডিজিটের GoB HHID টাইপ করুন", + "English": "Please enter 4 digits of GoB HHID from 0001 to 9999" }, "required": "yes", "constraint": "regex(., '^(?!0{4})[0-9]{4}$')" }, "label": { - "Bengali": "JiVitA HHID", - "English": "JiVitA HHID" + "Bengali": "GoB HHID", + "English": "GoB HHID" }, "instance": { - "openmrs_entity_id": "JiVitA HHID", + "openmrs_entity_id": "GOB HHID", "openmrs_entity": "person_identifier" }, "type": "text" }, + { + "name": "FWRELATIONSHIP", + "instance": { + "openmrs_entity_id": "FWRELATIONSHIP", + "openmrs_entity": "relationship" + }, + "type": "text" + }, + { + "name": "FWSTART", + "instance": { + "openmrs_entity_id": "FWSTART", + "openmrs_entity": "relationship" + }, + "type": "text" + }, + { + "name": "FWEND", + "instance": { + "openmrs_entity_id": "FWEND", + "openmrs_entity": "relationship" + }, + "type": "text" + }, { "name": "FWNHNEARTO", "label": { diff --git a/opensrp-connector/src/test/resources/form/new_household_registration/form_definition.json b/opensrp-connector/src/test/resources/form/new_household_registration/form_definition.json index f1dea2a941..1eb88b6b55 100644 --- a/opensrp-connector/src/test/resources/form/new_household_registration/form_definition.json +++ b/opensrp-connector/src/test/resources/form/new_household_registration/form_definition.json @@ -158,6 +158,18 @@ { "name": "FWELIGIBLE", "bind": "/model/instance/FWNewHH/woman/FWELIGIBLE" + }, + { + "name": "FWRELATIONSHIP", + "bind": "/model/instance/FWNewHH/woman/FWRELATIONSHIP" + }, + { + "name": "FWSTART", + "bind": "/model/instance/FWNewHH/woman/FWSTART" + }, + { + "name": "FWEND", + "bind": "/model/instance/FWNewHH/woman/FWEND" } ] } diff --git a/opensrp-connector/src/test/resources/form/new_household_registration/form_submission1.json b/opensrp-connector/src/test/resources/form/new_household_registration/form_submission1.json index a6a2f189a5..977f21d858 100644 --- a/opensrp-connector/src/test/resources/form/new_household_registration/form_submission1.json +++ b/opensrp-connector/src/test/resources/form/new_household_registration/form_submission1.json @@ -178,7 +178,19 @@ { "name": "FWELIGIBLE", "source": "elco.FWELIGIBLE" - } + }, + { + "name": "FWRELATIONSHIP", + "source": "elco.FWRELATIONSHIP" + }, + { + "name": "FWSTART", + "source": "elco.FWSTART" + }, + { + "name": "FWEND", + "source": "elco.FWEND" + } ], "instances": [ { @@ -198,7 +210,11 @@ "FWNHWOMHUSLIV": "", "FWNHWOMHUSSTR": "", "FWELIGIBLE": "0", - "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f" + "id": "babcd9d2-b3e9-4f6d-8a06-2df8f5fbf01f", + "FWRELATIONSHIP": "8d919b58-c2cc-11de-8d13-0010c6dffd0f", + "FWSTART": "12-12-2012", + "FWEND": "12-12-2014" + }, { "GOBHHID": "1234121", @@ -217,7 +233,10 @@ "FWNHWOMHUSLIV": "1", "FWNHWOMHUSSTR": "1", "FWELIGIBLE": "0", - "id": "74eebb60-a1b9-4691-81a4-5c04ecce7ae9" + "id": "74eebb60-a1b9-4691-81a4-5c04ecce7ae9", + "FWRELATIONSHIP": "8d919b58-c2cc-11de-8d13-0010c6dffd0f2", + "FWSTART": "12-12-2012", + "FWEND": "12-12-2014" } ] } diff --git a/opensrp-connector/src/test/resources/form/new_household_registration/model.xml b/opensrp-connector/src/test/resources/form/new_household_registration/model.xml index a0cabcad26..63ad7001cd 100644 --- a/opensrp-connector/src/test/resources/form/new_household_registration/model.xml +++ b/opensrp-connector/src/test/resources/form/new_household_registration/model.xml @@ -32,6 +32,9 @@ + + + diff --git a/opensrp-connector/src/test/resources/form/new_member_registration/form.json b/opensrp-connector/src/test/resources/form/new_member_registration/form.json new file mode 100644 index 0000000000..a84ef848d5 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/new_member_registration/form.json @@ -0,0 +1 @@ +{"name":"woman_tt_enrollement_test_form","title":"خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form","sms_keyword":"woman_tt_enrollement_test_form","default_language":"English","instance":{"encounter_type":"Woman TT enrollment"},"version":"201609281042","id_string":"woman_tt_enrollement_test_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"Program Client ID","openmrs_entity":"person_identifier"},"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"type":"phonenumber","name":"phonenumber"},{"bind":{"required":"yes"},"type":"note","name":"program_client_id","label":{"Roman Urdu":"Program ID: ${existing_program_client_id}","English":"Program ID: ${existing_program_client_id}"}},{"bind":{"calculate":"${today}"},"type":"calculate","instance":{"openmrs_entity_id":"EPI Card Number","openmrs_entity":"person_attribute"},"name":"client_reg_date","label":{"English":"client_reg_date"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Number 8 hindason par mushtamil hona chahiye","English":"Number should be 8 digits"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","instance":{"openmrs_entity_id":"first_name","openmrs_entity":"person"},"name":"epi_card_number","label":{"Roman Urdu":"EPI Card Number","English":"EPI Card Number:"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Darj karda maaloomaat durust nahi","English":"Invalid data entered"},"required":"yes","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","name":"first_name","label":{"English":"Name","Roman Urdu":"Naam"}},{"name":"birth_date_known","default":"yes","bind":{"required":"yes"},"label":{"English":"Is birthdate known?","Roman Urdu":"Kya tareekh-e-pedaaish maloom hai?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"No","English":"No"}}]},{"bind":{"required":"yes","jr:constraintMsg":{"Roman Urdu":"Khatoon ki umar 15 saal ya zyada honi chahiyay","English":"Woman must be 15 years or above"},"relevant":"selected(${birth_date_known}, 'yes')","constraint":".<=(${today} - (15*365))"},"type":"date","name":"birth_date","label":{"English":"Birth date","Roman Urdu":"Tareekh-e-pedaaish"}},{"bind":{"required":"yes","jr:constraintMsg":{"Roman Urdu":"Khatoon ki umar 15 saal ya zyada honi chahiyay","English":"Woman must be 15 years or above"},"relevant":"selected(${birth_date_known}, 'no')","constraint":". >= 15"},"type":"integer","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"age","label":{"Roman Urdu":"Umar (saal)","English":"Age (years)"}},{"bind":{"calculate":"if(selected(${birth_date_known}, 'yes'), int((${today} - ${birth_date}) div 365), ${age})"},"type":"calculate","name":"calc_age"},{"bind":{"calculate":"format-date (date(${today} - int(${age} * 365.25)), '%Y-%m-%d')"},"type":"calculate","name":"calc_dob","instance":{"openmrs_entity_id":"birthdate","openmrs_entity":"person"}},{"bind":{"calculate":"if(${birth_date_known}='yes', ${birth_date}, ${calc_dob})"},"type":"calculate","name":"dob","instance":{"openmrs_entity_id":"birthdate_estimated","openmrs_entity":"person"}},{"bind":{"calculate":"if(${birth_date_known} = 'yes', '0', '1')"},"type":"calculate","name":"dob_estimated"},{"instance":{"openmrs_entity_id":"gender","openmrs_entity":"person"},"type":"note","name":"birth_date_note","label":{"Roman Urdu":"Tareekh-e-pedaaish: ${dob} (${calc_age} saal)","English":"Date of Birth: ${dob} (${calc_age} years)"}},{"name":"gender","default":"female","bind":{"required":"yes","calculate":"female"},"label":{"Roman Urdu":"Jins","English":"Gender"},"instance":{"openmrs_entity_id":"1594AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"calculate"},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Darj karda maaloomaat durust nahi","English":"Invalid data entered"},"constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","name":"father_name","label":{"English":"Father's Name","Roman Urdu":"Waalid ka naam"}},{"name":"marriage","bind":{"required":"yes"},"label":{"Roman Urdu":"Kya aap shaadi shuda hain?","English":"Are you married?"},"instance":{"openmrs_entity_id":"161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Darj karda maaloomaat durust nahi","English":"Invalid data entered"},"relevant":"selected(${marriage}, 'yes')","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"last_name","openmrs_entity":"person"},"name":"husband_name","label":{"Roman Urdu":"Shohar ka naam","English":"Husband's Name"}},{"bind":{"calculate":"if(${marriage} = 'no', ${father_name}, ${husband_name})"},"type":"calculate","name":"last_name","instance":{"openmrs_entity_id":"163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"control":{"appearance":"minimal"},"name":"ethnicity","bind":{"required":"yes"},"label":{"English":"Ethnicity","Roman Urdu":"Qomiat"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select one","children":[{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${ethnicity}, 'other')"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"name":"ethnicity_other","label":{"English":"Please specify:","Roman Urdu":"Wazaahat karain"}},{"name":"reminders_approval","bind":{"required":"yes"},"label":{"English":"Are you willing to receive SMS reminders for your next visit?","Roman Urdu":"Kya aap apnay aglay doray ki yaad-dihani ke liye SMS mausool karna chahti hain?"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"No","English":"No"}}]},{"bind":{"required":"yes","jr:constraintMsg":{"Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********","English":"Phone number should be 11 digits in the following format: 03*********"},"relevant":"${reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","name":"contact_phone_number","label":{"English":"Mobile Number:","Roman Urdu":"Mobile number:"}},{"instance":{"openmrs_entity":"person_relationship","openmrs_entity_id":"person_b","openmrs_entity_parent":"child"},"type":"text","name":"child_id","label":{"English":"child id to relate","Roman Urdu":"child id"}},{"instance":{"openmrs_entity":"person_relationship","openmrs_entity_id":"person_b","openmrs_entity_parent":"husband"},"type":"text","name":"husband_id","label":{"English":"husband id to relate","Roman Urdu":"husband id"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/new_member_registration/form.xml b/opensrp-connector/src/test/resources/form/new_member_registration/form.xml new file mode 100644 index 0000000000..d426861eb1 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/new_member_registration/form.xml @@ -0,0 +1,219 @@ +
+ + +

خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form

+
+
+ + Kya tareekh-e-pedaaish maloom hai? + Is birthdate known? + * +
+ + +
+
+
+
+ + Kya aap shaadi shuda hain? + Are you married? + * +
+ + +
+
+
+
+ + Kya aap apnay aglay doray ki yaad-dihani ke liye SMS mausool karna chahti hain? + Are you willing to receive SMS reminders for your next visit? + * +
+ + +
+
+
+ +
diff --git a/opensrp-connector/src/test/resources/form/new_member_registration/form_definition.json b/opensrp-connector/src/test/resources/form/new_member_registration/form_definition.json new file mode 100644 index 0000000000..c9ff8eeb5d --- /dev/null +++ b/opensrp-connector/src/test/resources/form/new_member_registration/form_definition.json @@ -0,0 +1,137 @@ +{ + "form" : { + "bind_type" : "pkwoman", +"default_bind_path" : "/model/instance/woman_tt_enrollement_test_form/", + "fields" : [ { + "name" : "id", + "shouldLoadValue" : true + }, { + "name" : "provider_uc", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_uc" + }, { + "name" : "provider_town", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_town" + }, { + "name" : "provider_city", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_city" + }, { + "name" : "provider_province", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_province" + }, { + "name" : "provider_id", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_id" + }, { + "name" : "provider_location_id", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_location_id" + }, { + "name" : "existing_program_client_id", + "bind" : "/model/instance/woman_tt_enrollement_test_form/existing_program_client_id" + }, { + "name" : "provider_location_name", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_location_name" + }, { + "name" : "provider_location_note", + "bind" : "/model/instance/woman_tt_enrollement_test_form/provider_location_note" + }, { + "name" : "start", + "bind" : "/model/instance/woman_tt_enrollement_test_form/start" + }, { + "name" : "end", + "bind" : "/model/instance/woman_tt_enrollement_test_form/end" + }, { + "name" : "today", + "bind" : "/model/instance/woman_tt_enrollement_test_form/today" + }, { + "name" : "deviceid", + "bind" : "/model/instance/woman_tt_enrollement_test_form/deviceid" + }, { + "name" : "subscriberid", + "bind" : "/model/instance/woman_tt_enrollement_test_form/subscriberid" + }, { + "name" : "simserial", + "bind" : "/model/instance/woman_tt_enrollement_test_form/simserial" + }, { + "name" : "phonenumber", + "bind" : "/model/instance/woman_tt_enrollement_test_form/phonenumber" + }, { + "name" : "program_client_id", + "bind" : "/model/instance/woman_tt_enrollement_test_form/program_client_id" + }, { + "name" : "client_reg_date", + "bind" : "/model/instance/woman_tt_enrollement_test_form/client_reg_date" + }, { + "name" : "epi_card_number", + "bind" : "/model/instance/woman_tt_enrollement_test_form/epi_card_number" + }, { + "name" : "first_name", + "bind" : "/model/instance/woman_tt_enrollement_test_form/first_name" + }, { + "name" : "birth_date_known", + "bind" : "/model/instance/woman_tt_enrollement_test_form/birth_date_known" + }, { + "name" : "birth_date", + "bind" : "/model/instance/woman_tt_enrollement_test_form/birth_date" + }, { + "name" : "age", + "bind" : "/model/instance/woman_tt_enrollement_test_form/age" + }, { + "name" : "calc_age", + "bind" : "/model/instance/woman_tt_enrollement_test_form/calc_age" + }, { + "name" : "calc_dob", + "bind" : "/model/instance/woman_tt_enrollement_test_form/calc_dob" + }, { + "name" : "dob", + "bind" : "/model/instance/woman_tt_enrollement_test_form/dob" + }, { + "name" : "dob_estimated", + "bind" : "/model/instance/woman_tt_enrollement_test_form/dob_estimated" + }, { + "name" : "birth_date_note", + "bind" : "/model/instance/woman_tt_enrollement_test_form/birth_date_note" + }, { + "name" : "gender", + "bind" : "/model/instance/woman_tt_enrollement_test_form/gender" + }, { + "name" : "father_name", + "bind" : "/model/instance/woman_tt_enrollement_test_form/father_name" + }, { + "name" : "marriage", + "bind" : "/model/instance/woman_tt_enrollement_test_form/marriage" + }, { + "name" : "husband_name", + "bind" : "/model/instance/woman_tt_enrollement_test_form/husband_name" + }, { + "name" : "last_name", + "bind" : "/model/instance/woman_tt_enrollement_test_form/last_name" + }, { + "name" : "ethnicity", + "bind" : "/model/instance/woman_tt_enrollement_test_form/ethnicity" + }, { + "name" : "ethnicity_other", + "bind" : "/model/instance/woman_tt_enrollement_test_form/ethnicity_other" + }, { + "name" : "reminders_approval", + "bind" : "/model/instance/woman_tt_enrollement_test_form/reminders_approval" + }, { + "name" : "contact_phone_number", + "bind" : "/model/instance/woman_tt_enrollement_test_form/contact_phone_number" + }, { + "name" : "child_id", + "bind" : "/model/instance/woman_tt_enrollement_test_form/child_id" + }, { + "name" : "Relationship_type1", + "bind" : "/model/instance/woman_tt_enrollement_test_form/Relationship_type1" + }, { + "name" : "husband_id", + "bind" : "/model/instance/woman_tt_enrollement_test_form/husband_id" + }, { + "name" : "Relationship_type2", + "bind" : "/model/instance/woman_tt_enrollement_test_form/Relationship_type2" + }, { + "name" : "instanceID", + "bind" : "/model/instance/woman_tt_enrollement_test_form/meta/instanceID" + } ], + "sub_forms" : [ ] + } +} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/new_member_registration/form_submission.json b/opensrp-connector/src/test/resources/form/new_member_registration/form_submission.json new file mode 100644 index 0000000000..a7a2f5c6a7 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/new_member_registration/form_submission.json @@ -0,0 +1,281 @@ +{ + "_id": "58e123cec0dc6b83cf04666bf6de20c5", + "_rev": "1-a68fc348e1a7ab4cfd6d8772484fd19c", + "type": "FormSubmission", + "anmId": "ahmed", + "instanceId": "e4a6d64f-c288-4423-89ca-d309aa2b2349", + "formName": "new_member_registration", + "entityId": "e8bb4a1b-1f3a-4f19-8f7f-8be826b1855d", + "clientVersion": 1475055151630, + "formDataDefinitionVersion": "3", + "formInstance": { + "form_data_definition_version": "3", + "form": { + "bind_type": "pkwoman", + "default_bind_path": "/model/instance/woman_tt_enrollement_test_form/", + "fields": [ + { + "name": "id", + "value": "e8bb4a1b-1f3a-4f19-8f7f-8be826b1855d", + "source": "pkwoman.id" + }, + { + "name": "provider_uc", + "value": "Zaman Town", + "source": "pkwoman.provider_uc" + }, + { + "name": "provider_town", + "value": "Korangi", + "source": "pkwoman.provider_town" + }, + { + "name": "provider_city", + "value": "Karachi", + "source": "pkwoman.provider_city" + }, + { + "name": "provider_province", + "value": "Sindh", + "source": "pkwoman.provider_province" + }, + { + "name": "provider_id", + "value": "ahmed", + "source": "pkwoman.provider_id" + }, + { + "name": "provider_location_id", + "value": "Homeopathic Center", + "source": "pkwoman.provider_location_id" + }, + { + "name": "existing_program_client_id", + "value": "218159972", + "source": "pkwoman.existing_program_client_id" + }, + { + "name": "provider_location_name", + "value": "Homeopathic Center", + "source": "pkwoman.provider_location_name" + }, + { + "name": "provider_location_note", + "value": "", + "source": "pkwoman.provider_location_note" + }, + { + "name": "start", + "value": "2016-09-28 14:32:00", + "source": "pkwoman.start" + }, + { + "name": "end", + "value": "2016-09-28 14:32:31", + "source": "pkwoman.end" + }, + { + "name": "today", + "value": "2016-09-28", + "source": "pkwoman.today" + }, + { + "name": "deviceid", + "value": "Error: could not determine deviceID", + "source": "pkwoman.deviceid" + }, + { + "name": "subscriberid", + "value": "no subscriberid property in enketo", + "source": "pkwoman.subscriberid" + }, + { + "name": "simserial", + "value": "no simserial property in enketo", + "source": "pkwoman.simserial" + }, + { + "name": "phonenumber", + "value": "no phonenumber property in enketo", + "source": "pkwoman.phonenumber" + }, + { + "name": "program_client_id", + "value": "218159972", + "source": "pkwoman.program_client_id" + }, + { + "name": "client_reg_date", + "value": "2016-09-28", + "source": "pkwoman.client_reg_date" + }, + { + "name": "epi_card_number", + "value": "20152580", + "source": "pkwoman.epi_card_number" + }, + { + "name": "first_name", + "value": "test lastDay", + "source": "pkwoman.first_name" + }, + { + "name": "birth_date_known", + "value": "no", + "source": "pkwoman.birth_date_known" + }, + { + "name": "birth_date", + "value": "", + "source": "pkwoman.birth_date" + }, + { + "name": "age", + "value": "25", + "source": "pkwoman.age" + }, + { + "name": "calc_age", + "value": "25", + "source": "pkwoman.calc_age" + }, + { + "name": "calc_dob", + "value": "1991-09-29", + "source": "pkwoman.calc_dob" + }, + { + "name": "dob", + "value": "1991-09-29", + "source": "pkwoman.dob" + }, + { + "name": "dob_estimated", + "value": "1", + "source": "pkwoman.dob_estimated" + }, + { + "name": "birth_date_note", + "value": "", + "source": "pkwoman.birth_date_note" + }, + { + "name": "gender", + "value": "male", + "source": "pkwoman.gender" + }, + { + "name": "father_name", + "value": "Fgy", + "source": "pkwoman.father_name" + }, + { + "name": "marriage", + "value": "no", + "source": "pkwoman.marriage" + }, + { + "name": "husband_name", + "value": "", + "source": "pkwoman.husband_name" + }, + { + "name": "last_name", + "value": "Fgy", + "source": "pkwoman.last_name" + }, + { + "name": "ethnicity", + "value": "punjabi", + "source": "pkwoman.ethnicity" + }, + { + "name": "ethnicity_other", + "value": "", + "source": "pkwoman.ethnicity_other" + }, + { + "name": "reminders_approval", + "value": "no", + "source": "pkwoman.reminders_approval" + }, + { + "name": "contact_phone_number", + "value": "", + "source": "pkwoman.contact_phone_number" + }, + { + "name": "husband_id", + "value": "007037a0-0500-11e3-8ffd-0800200c9a66", + "source": "pkwoman.husband_id" + }, + { + "name": "child_id", + "value": "007037a0-0500-11e3-8ffd-0800200c9a66", + "source": "pkwoman.child_id" + }, + { + "name": "Relation_type1", + "value": "father", + "source": "pkwoman.child.Relation_type" + }, + { + "name": "Relation_type2", + "value": "wife", + "source": "pkwoman.husband.Relation_type" + }, + { + "name": "instanceID", + "value": "uuid:267c7f9a-ad5e-4c69-9406-cca21af8ffe0", + "source": "pkwoman.instanceID" + } + ], + "fieldsAsMap": { + "contact_phone_number": "", + "program_client_id": "218158872", + "provider_id": "ahmed", + "instanceID": "uuid:267c7f9a-ad5e-4c69-9406-cca21af8ffe0", + "today": "2016-09-28", + "birth_date_note": "", + "father_name": "Fgy", + "deviceid": "Error: could not determine deviceID", + "id": "e8bb4a1b-1f3a-4f19-8f7f-8be826b1855d", + "client_reg_date": "2016-09-28", + "ethnicity_other": "", + "first_name": "Dghfd", + "husband_name": "", + "age": "25", + "gender": "", + "dob_estimated": "1", + "birth_date_known": "no", + "provider_location_id": "Homeopathic Center", + "provider_province": "Sindh", + "simserial": "no simserial property in enketo", + "end": "2016-09-28 14:32:31", + "phonenumber": "no phonenumber property in enketo", + "provider_location_name": "Homeopathic Center", + "birth_date": "", + "provider_uc": "Zaman Town", + "calc_dob": "1991-09-29", + "marriage": "no", + "existing_program_client_id": "218158872", + "calc_age": "25", + "provider_location_note": "", + "provider_city": "Karachi", + "subscriberid": "no subscriberid property in enketo", + "start": "2016-09-28 14:32:00", + "dob": "1991-09-29", + "last_name": "Fgy", + "provider_town": "Korangi", + "epi_card_number": "20152580", + "ethnicity": "punjabi", + "husband_id": "123456789", + "Relation_type1": "father", + "Relation_type2": "wife", + "child_id": "987654321", + "reminders_approval": "no" + } + } + }, + "serverVersion": 1475055131481 +} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/new_member_registration/model.xml b/opensrp-connector/src/test/resources/form/new_member_registration/model.xml new file mode 100644 index 0000000000..5090135b13 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/new_member_registration/model.xml @@ -0,0 +1,72 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + yes + + + + + + + + female + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/test_new_household_registration/form.json b/opensrp-connector/src/test/resources/form/test_new_household_registration/form.json new file mode 100644 index 0000000000..8faa9d9a46 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/test_new_household_registration/form.json @@ -0,0 +1,134 @@ +{ + "default_language": "Bengali", + "id_string": "FWNewHH_2", + "children": [ + { + "name": "relationship_id", + "instance": { + "openmrs_entity_id": "relationship_id", + "openmrs_entity": "encounter" + }, + "type": "hidden" + }, + { + "name": "person_a", + "instance": { + "openmrs_entity_id": "person_a", + "openmrs_entity": "encounter" + }, + "type": "today" + }, + { + "name": "_relationship", + "instance": { + "openmrs_entity_id": "_relationship", + "openmrs_entity": "encounter" + }, + "type": "integer" + }, + { + "name": "person_b", + "instance": { + "openmrs_entity_id": "person_b", + "openmrs_entity": "encounter" + }, + "type": "integer" + }, + { + "name": "start", + "instance": { + "openmrs_entity_id": "encounter_start", + "openmrs_entity": "encounter" + }, + "type": "start" + }, + { + "name": "end", + "instance": { + "openmrs_entity_id": "encounter_end", + "openmrs_entity": "encounter" + }, + "type": "end" + }, + { + "name": "creator", + "instance": { + "openmrs_entity_id": "creator", + "openmrs_entity": "person" + }, + "type": "text" + }, + { + "name": "date_created", + "instance": { + "openmrs_entity_id": "date_created", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "name": "date_changed", + "instance": { + "openmrs_entity_id": "date_changed", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "name": "changed_by", + "instance": { + "openmrs_entity_id": "changed_by", + "openmrs_entity": "encounter" + }, + "type" :"text" + }, + { + "name": "voided", + "instance": { + "openmrs_entity_id": "voided", + "openmrs_entity": "encounter" + }, + "type": "text" + }, + { + "name": "voided_by", + "instance": { + "openmrs_entity_id": "voided_by", + "openmrs_entity": "person" + }, + "type": "text" + }, + { + "name": "date_voided", + "instance": { + "openmrs_entity_id": "voided", + "openmrs_entity": "encounter" + }, + "type": "date" + }, + { + "name": "voided_reason", + "instance": { + "openmrs_entity_id": "voided_reason", + "openmrs_entity": "encounter" + }, + "type": "text" + }, + { + "name": "uuid", + "instance": { + "openmrs_entity_id": "uuid", + "openmrs_entity": "concept" + }, + "type": "text" + } + ], + "instance": { + "encounter_type": "test New Household Registration" + }, + "version": "201505070930", + "type": "survey", + "name": "Relationship", + "sms_keyword": "Relationship", + "title": "FW new Relationship Reg" +} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/test_new_household_registration/form_definition.json b/opensrp-connector/src/test/resources/form/test_new_household_registration/form_definition.json new file mode 100644 index 0000000000..e60e8495f7 --- /dev/null +++ b/opensrp-connector/src/test/resources/form/test_new_household_registration/form_definition.json @@ -0,0 +1,74 @@ +{ + "form_data_definition_version": "1", + "form": { + "default_bind_path": "/model/instance/test_new_member", + "bind_type": "household", + "fields": [ + { + "name": "relationship_id", + "bind": "/model/instance/test_new_member/relationship_id" + }, + { + "name": "person_a", + "bind": "/model/instance/test_new_member/person_a" + }, + { + "name": "relationship", + "bind": "/model/instance/test_new_member/relationship" + }, + { + "name": "person_b", + "bind": "/model/instance/test_new_member/person_b" + }, + { + "name": "start", + "bind": "/model/instance/test_new_member/start" + }, + { + "name": "end", + "bind": "/model/instance/test_new_member/end" + }, + { + "name": "creator", + "bind": "/model/instance/test_new_member/creator" + }, + { + "name": "date_created", + "bind": "/model/instance/test_new_member/date_created" + }, + { + "name": "date_changed", + "bind": "/model/instance/test_new_member/date_changed" + }, + { + "name": "changed_by", + "bind": "/model/instance/test_new_member/changed_by" + }, + { + "name": "voided", + "bind": "/model/instance/test_new_member/voided" + }, + { + "name": "voided_by", + "bind": "/model/instance/test_new_member/voided_by" + }, + { + "name": "date_voided", + "bind": "/model/instance/test_new_member/date_voided" + }, + { + "name": "void_reason", + "bind": "/model/instance/test_new_member/void_reason" + }, + { + "name": "uuid", + "bind": "/model/instance/test_new_member/uuid" + }, + { + "name": "FWHOHGENDER", + "bind": "/model/instance/test_new_member/FWHOHGENDER" + } + ] + + } +} \ No newline at end of file diff --git a/opensrp-connector/src/test/resources/form/test_new_household_registration/form_submission.json b/opensrp-connector/src/test/resources/form/test_new_household_registration/form_submission.json new file mode 100644 index 0000000000..b302cacfae --- /dev/null +++ b/opensrp-connector/src/test/resources/form/test_new_household_registration/form_submission.json @@ -0,0 +1,96 @@ +{ + "_id": "251ca0ef09df9af88f0e9d5f180115a3", + "_rev": "1-e73e1d93acdcdaeb1d41a738da5d9284", + "type": "FormSubmission", + "anmId": "demotest1", + "instanceId": "88c0e824-10b4-44c2-9429-754b8d823776", + "formName": "test_new_household_registration", + "entityId": "a3f2abf4-2699-4761-819a-cea739224164", + "clientVersion": 1430997074596, + "formDataDefinitionVersion": "1", + "formInstance": { + "form_data_definition_version": "1", + "form": { + "bind_type": "relationship", + "default_bind_path": "/model/instance/FWNewHH", + "fields": [ + { + "name": "relationship_id", + "value": "1111111111", + "source": "relationship.id" + }, + { + "name": "person_a", + "value": "2", + "source": "relationship.person_a" + }, + { + "name": "_relationship", + "value": "4", + "source": "relationship._relationship" + }, + { + "name": "person_b", + "value": "66", + "source": "relationship.person_b" + }, + { + "name": "start", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "relationship.start" + }, + { + "name": "end", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "relationship.end" + }, + { + "name": "creator", + "value": "2015-05-07", + "source": "relationship.creator" + }, + { + "name": "date_created", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "relationship.date_created" + }, + { + "name": "date_changed", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "relationship.changed" + }, + { + "name": "changed_by", + "value": "1234", + "source": "relationship.changed_by" + }, + { + "name": "voided", + "value": "1234", + "source": "relationship.voided" + }, + { + "name": "voided_by", + "value": "nothing", + "source": "relationship.voided_by" + }, + { + "name": "void_reason", + "value": "34 34 0 0", + "source": "relationship.void_reason" + }, + { + "name": "date_voided", + "value": "2015-05-07T17:07:21.000+06:00", + "source": "relationship.date_voided" + }, + { + "name": "uuid", + "value": "test", + "source": "relationship.uuid" + } + ] + } + }, + "serverVersion": 1430998001293 +} \ No newline at end of file diff --git a/opensrp-core/.externalToolBuilders/Maven_Ant_Builder.launch b/opensrp-core/.externalToolBuilders/Maven_Ant_Builder.launch new file mode 100644 index 0000000000..c03f395da6 --- /dev/null +++ b/opensrp-core/.externalToolBuilders/Maven_Ant_Builder.launch @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-core/.gitignore b/opensrp-core/.gitignore new file mode 100644 index 0000000000..ae3c172604 --- /dev/null +++ b/opensrp-core/.gitignore @@ -0,0 +1 @@ +/bin/ diff --git a/opensrp-core/maven-eclipse.xml b/opensrp-core/maven-eclipse.xml new file mode 100644 index 0000000000..06177786f3 --- /dev/null +++ b/opensrp-core/maven-eclipse.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/opensrp-core/src/main/java/org/opensrp/domain/BaseEntity.java b/opensrp-core/src/main/java/org/opensrp/domain/BaseEntity.java index 4f1ef28751..0083467a4a 100644 --- a/opensrp-core/src/main/java/org/opensrp/domain/BaseEntity.java +++ b/opensrp-core/src/main/java/org/opensrp/domain/BaseEntity.java @@ -185,6 +185,7 @@ public String getIdentifierMatchingRegex(String regex) { public void setIdentifiers(Map identifiers) { this.identifiers = identifiers; + System.out.print(this.identifiers); } public void addIdentifier(String identifierType, String identifier) { diff --git a/opensrp-core/src/main/java/org/opensrp/domain/Client.java b/opensrp-core/src/main/java/org/opensrp/domain/Client.java index cab34e91ea..f5bc00e95b 100644 --- a/opensrp-core/src/main/java/org/opensrp/domain/Client.java +++ b/opensrp-core/src/main/java/org/opensrp/domain/Client.java @@ -6,6 +6,7 @@ import java.util.Map; import java.util.Map.Entry; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.builder.EqualsBuilder; import org.apache.commons.lang3.builder.HashCodeBuilder; import org.apache.commons.lang3.builder.ToStringBuilder; @@ -33,7 +34,7 @@ public class Client extends BaseEntity { @JsonProperty private String gender; @JsonProperty - private Map> relationships; + private List relationships; protected Client() { @@ -152,14 +153,21 @@ public void setGender(String gender) { this.gender = gender; } - public Map> getRelationships() { + public List getRelationships() { return relationships; } - public void setRelationships(Map> relationships) { - this.relationships = relationships; + public void setRelationShip(List relationship) { + this.relationships = relationship; } - + + public void addRelationship(RelationShip Relationship) { + if (relationships == null) { + relationships = new ArrayList<>(); + } + relationships.add(Relationship); + } + public Client withFirstName(String firstName) { this.firstName = firstName; return this; @@ -204,46 +212,52 @@ public Client withGender(Gender gender) { this.gender = gender.name(); return this; } - /** * Overrides the existing data */ - public Client withRelationships(Map> relationships) { - this.relationships = relationships; + public Client withRelation(List relationShips) { + this.relationships = relationShips; return this; } - - public List findRelatives(String relationshipType) { + public Client withRelation(RelationShip relationship) { if(relationships == null){ - relationships = new HashMap<>(); + relationships = new ArrayList<>(); } - - return relationships.get(relationshipType); + relationships.add(relationship); + return this; } - public void addRelationship(String relationType, String relativeEntityId) { + + public RelationShip getObs(String parent, String concept) { if(relationships == null){ - relationships = new HashMap<>(); - } - - List relatives = findRelatives(relationType); - if(relatives == null){ - relatives = new ArrayList<>(); + relationships = new ArrayList<>(); } - relatives.add(relativeEntityId); - relationships.put(relationType, relatives); + for (RelationShip o : relationships) { + // parent is blank OR matches with obs parent + if((StringUtils.isBlank(parent) + || (StringUtils.isNotBlank(o.getRelationship()) && parent.equalsIgnoreCase(o.getRelationship()))) + && o.getRelationship().equalsIgnoreCase("relationship")){ + return o; //TODO handle duplicates + } + } + return null; } + + /** + * WARNING: Overrides all existing obs + * @param obs + * @return + */ - public List getRelationships(String relativeEntityId) { - List relations = new ArrayList(); - for (Entry> rl : relationships.entrySet()) { - if(rl.getValue().toString().equalsIgnoreCase(relativeEntityId)){ - relations.add(rl.getKey()); - } + + public void addObs(RelationShip relationship) { + if(relationships == null){ + relationships = new ArrayList<>(); } - return relations; + + relationships.add(relationship); } - + @Override public boolean equals(Object o) { return EqualsBuilder.reflectionEquals(this, o, "id", "revision"); diff --git a/opensrp-core/src/main/java/org/opensrp/domain/Obs.java b/opensrp-core/src/main/java/org/opensrp/domain/Obs.java index 5f653f6525..7ef053ebcb 100644 --- a/opensrp-core/src/main/java/org/opensrp/domain/Obs.java +++ b/opensrp-core/src/main/java/org/opensrp/domain/Obs.java @@ -1,6 +1,7 @@ package org.opensrp.domain; import java.util.ArrayList; +import java.util.Arrays; import java.util.List; import org.codehaus.jackson.annotate.JsonIgnore; @@ -182,6 +183,10 @@ public Obs withFormSubmissionField(String formSubmissionField) { public Obs withEffectiveDatetime(DateTime effectiveDatetime) { this.effectiveDatetime = effectiveDatetime; return this; - + } + + public static void main(String[] args) { + Obs o1 = new Obs("concept", "str", "454253425", null, Arrays.asList(new String[]{"55"}), null, "WEIGHT"); + Obs o2 = new Obs("concept", "str", "6565645656", null, Arrays.asList(new String[]{"20"}), null, "HEIGHT"); } } diff --git a/opensrp-core/src/main/java/org/opensrp/domain/RelationShip.java b/opensrp-core/src/main/java/org/opensrp/domain/RelationShip.java new file mode 100644 index 0000000000..c3a47d3a41 --- /dev/null +++ b/opensrp-core/src/main/java/org/opensrp/domain/RelationShip.java @@ -0,0 +1,104 @@ +package org.opensrp.domain; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Map.Entry; + +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.builder.EqualsBuilder; +import org.apache.commons.lang3.builder.HashCodeBuilder; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.codehaus.jackson.annotate.JsonProperty; +import org.ektorp.support.TypeDiscriminator; +import org.joda.time.DateTime; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import org.codehaus.jackson.annotate.JsonIgnore; +import org.codehaus.jackson.annotate.JsonProperty; +import org.joda.time.DateTime; + +public class RelationShip { + + public String getStartDate() { + return startDate; + } + + public void setStartDate(String startDate) { + this.startDate = startDate; + } + + public String getEndDate() { + return endDate; + } + + public void setEndDate(String endDate) { + this.endDate = endDate; + } + + public String getRelationship() { + return relationship; + } + + public void setRelationship(String relationship) { + this.relationship = relationship; + } + + @JsonProperty + private String relationship; + + @JsonProperty + private String person_b; + + public String getPerson_b() { + return person_b; + } + + public void setPerson_b(String person_b) { + this.person_b = person_b; + } + + @JsonProperty + private String startDate; + + @JsonProperty + private String endDate; + + public RelationShip() { + + } + + public RelationShip(String relationship,String person_b, String startDate,String endDate) + { + this.relationship=relationship; + this.person_b=person_b; + this.startDate=startDate; + this.endDate=endDate; + } + + /** + * WARNING: Overrides all existing obs + * @param obs + * @return + */ + + + @Override + public boolean equals(Object o) { + return EqualsBuilder.reflectionEquals(this, o, "; this.d", "revision"); + } + + @Override + public int hashCode() { + return HashCodeBuilder.reflectionHashCode(this, "id", "revision"); + } + + @Override + public String toString() { + return ToStringBuilder.reflectionToString(this); + } +} diff --git a/opensrp-core/src/main/java/org/opensrp/service/XlsFormDownloaderService.java b/opensrp-core/src/main/java/org/opensrp/service/XlsFormDownloaderService.java index 00e9a1a5f3..59587f20d9 100644 --- a/opensrp-core/src/main/java/org/opensrp/service/XlsFormDownloaderService.java +++ b/opensrp-core/src/main/java/org/opensrp/service/XlsFormDownloaderService.java @@ -31,9 +31,9 @@ import org.xml.sax.InputSource; import org.xml.sax.SAXException; -import com.sun.org.apache.xml.internal.serialize.OutputFormat; +/*import com.sun.org.apache.xml.internal.serialize.OutputFormat; import com.sun.org.apache.xml.internal.serialize.XMLSerializer; -import com.sun.xml.internal.txw2.Document; +import com.sun.xml.internal.txw2.Document;*/ /** * @author muhammad.ahmed@ihsinformatics.com @@ -55,10 +55,10 @@ public XlsFormDownloaderService() { public static void main(String[] args) { try { - /*new XlsFormDownloaderService().downloadFormFiles("D:\\opensrpVaccinatorWkspc\\forms", - "maimoonak", "opensrp", JustForFun.Form, "child_vaccination_enrollment", "135187"); + new XlsFormDownloaderService().downloadFormFiles("D:\\forms", + "shakeeb_raza", "shakeeb_raza", "star2326", "woman_tt_enrollement_test_form", "151942"); //------------------------- - new XlsFormDownloaderService().downloadFormFiles("D:\\opensrpVaccinatorWkspc\\forms", + /* new XlsFormDownloaderService().downloadFormFiles("D:\\opensrpVaccinatorWkspc\\forms", "maimoonak", "opensrp", JustForFun.Form, "child_vaccination_followup", "135199"); //--------------------------- new XlsFormDownloaderService().downloadFormFiles("D:\\opensrpVaccinatorWkspc\\forms", @@ -112,16 +112,16 @@ public String format(String unformattedXml) { try { final org.w3c.dom.Document document = parseXmlFile(unformattedXml); - OutputFormat format = new OutputFormat(document); +/* OutputFormat format = new OutputFormat(document); format.setLineWidth(380); - //format.setIndenting(true); + format.setIndenting(true); format.setIndent(2); Writer out = new StringWriter(); XMLSerializer serializer = new XMLSerializer(out, format); serializer.serialize(document); - - return out.toString(); - } catch (IOException e) { +*/ + return ""; + } catch (Exception e) { throw new RuntimeException(e); } } @@ -148,7 +148,7 @@ public boolean downloadFormFiles(String directory,String username ,String formPa String modelData=netClientGet.getModel(xmlData); String formData=fileCreator.prettyFormat(netClientGet.getForm(xmlData)); - modelData=format(modelData); + // modelData=format(modelData); formData = formData.replaceAll("selected\\(", "contains("); formData = formData.replaceAll("", ""); diff --git a/opensrp-core/src/main/java/org/opensrp/service/formSubmission/FormEntityConverter.java b/opensrp-core/src/main/java/org/opensrp/service/formSubmission/FormEntityConverter.java index 6bc194b4f8..167be0227b 100644 --- a/opensrp-core/src/main/java/org/opensrp/service/formSubmission/FormEntityConverter.java +++ b/opensrp-core/src/main/java/org/opensrp/service/formSubmission/FormEntityConverter.java @@ -17,12 +17,14 @@ import org.opensrp.common.FormEntityConstants; import org.opensrp.common.FormEntityConstants.Encounter; import org.opensrp.common.FormEntityConstants.FormEntity; +import org.opensrp.common.FormEntityConstants.Member; import org.opensrp.common.FormEntityConstants.Person; import org.opensrp.common.util.DateUtil; import org.opensrp.domain.Address; import org.opensrp.domain.Client; import org.opensrp.domain.Event; import org.opensrp.domain.Obs; +import org.opensrp.domain.RelationShip; import org.opensrp.form.domain.FormSubmission; import org.opensrp.form.service.FormAttributeParser; import org.opensrp.form.service.FormFieldMap; @@ -66,6 +68,10 @@ public Event getEventFromFormSubmission(FormSubmissionMap fs) throws ParseExcept return createEvent(fs.entityId(), fs.formAttributes().get("encounter_type"), fs.fields(), fs); } + public RelationShip getRelationFromFormSubmission(FormSubmissionMap fs) throws ParseException { + return createRelation(fs); + } + private Event createEvent(String entityId, String eventType, List fields, FormSubmissionMap fs) throws ParseException { String encounterDateField = getFieldName(Encounter.encounter_date, fs); String encounterLocation = getFieldName(Encounter.location_id, fs); @@ -103,6 +109,29 @@ private Event createEvent(String entityId, String eventType, List return e; } + private RelationShip createRelation(FormSubmissionMap fs) throws ParseException { + String relationship= fs.getFieldValue(getFieldName(Member.relationship_type, fs)); + String person_B= fs.getFieldValue(getFieldName(Member.person_B, fs)); + String person_A= fs.entityId(); + + String start= fs.getFieldValue(getFieldName(Member.start_date, fs)); + String end= fs.getFieldValue(getFieldName(Member.end_date, fs)); + + RelationShip r=new RelationShip(relationship,person_B,start,end); + + return r; + } + + public RelationShip getRelationFromFormSubmission(FormSubmission fs) throws IllegalStateException{ + try { + return getRelationFromFormSubmission(formAttributeParser.createFormSubmissionMap(fs)); + } catch (JsonIOException | JsonSyntaxException + | XPathExpressionException | ParseException + | ParserConfigurationException | SAXException | IOException e) { + throw new IllegalStateException(e); + } + } + public Event getEventFromFormSubmission(FormSubmission fs) throws IllegalStateException{ try { return getEventFromFormSubmission(formAttributeParser.createFormSubmissionMap(fs)); @@ -126,6 +155,7 @@ private Event getEventForSubform(FormSubmissionMap fs, String eventType, Subform return createEvent(subformInstance.entityId(), subformInstance.formAttributes().get("openmrs_entity_id"), subformInstance.fields(), fs); } + /** * Get field name for specified openmrs entity in given form submission * @param en @@ -148,9 +178,11 @@ String getFieldName(FormEntity en, SubformMap subf) { } String getFieldName(FormEntity en, List fields) { + for (FormFieldMap f : fields) { if(f.fieldAttributes().containsKey("openmrs_entity") && - f.fieldAttributes().get("openmrs_entity").equalsIgnoreCase(en.entity()) + (f.fieldAttributes().get("openmrs_entity").equalsIgnoreCase(en.entity()) || + f.fieldAttributes().get("openmrs_entity").equalsIgnoreCase("Relationship")) && f.fieldAttributes().get("openmrs_entity_id").equalsIgnoreCase(en.entityId())){ return f.name(); } @@ -158,6 +190,19 @@ String getFieldName(FormEntity en, List fields) { return null; } +String getFieldValue(FormEntity en, List fields) { + + for (FormFieldMap f : fields) { + System.out.println(en.entityId()); + if(f.fieldAttributes().containsKey("openmrs_entity") && + f.fieldAttributes().get("openmrs_entity").equalsIgnoreCase(en.entity()) + && f.fieldAttributes().get("openmrs_entity_id").equalsIgnoreCase(en.entityId())){ + System.out.println(f.name()+": "+f.value()); + return f.value(); + } + } + return null; + } /** * Get field name for specified openmrs attribute mappings in given form submission * @param entity @@ -193,6 +238,15 @@ Map extractAddresses(FormSubmissionMap fs) throws ParseExceptio return paddr; } + Map extractRelation(FormSubmissionMap fs) throws ParseException { + Map paddr = new HashMap<>(); + for (FormFieldMap fl : fs.fields()) { + fillRelationShipFields(fl, paddr); + + } + return paddr; + } + Map extractAddressesForSubform(SubformMap subf) throws ParseException { Map paddr = new HashMap<>(); for (FormFieldMap fl : subf.fields()) { @@ -201,6 +255,18 @@ Map extractAddressesForSubform(SubformMap subf) throws ParseExc return paddr; } + void fillRelationShipFields(FormFieldMap fl, Map relatShip) throws ParseException { + Map att = fl.fieldAttributes(); + System.out.println(fl.name()+" Attributes: "+ att); + if(att.containsKey("openmrs_entity") && att.get("openmrs_entity").equalsIgnoreCase("person_relationship")){ + String relationShipType = att.get("openmrs_entity_id"); + String person_b= fl.value(); + System.out.println("person_b: "+ person_b); + relatShip.put(relationShipType,new RelationShip(relationShipType, person_b, "", "")); + System.out.println("FillRelationShip: "+ relatShip); + } + } + void fillAddressFields(FormFieldMap fl, Map addresses) throws ParseException { Map att = fl.fieldAttributes(); if(att.containsKey("openmrs_entity") && att.get("openmrs_entity").equalsIgnoreCase("person_address")){ @@ -335,7 +401,7 @@ public Client getClientFromFormSubmission(FormSubmissionMap fsubmission) throws return createBaseClient(fsubmission); } - + public ArrayList relationShips; public Client createBaseClient(FormSubmissionMap fs) throws ParseException { String firstName = fs.getFieldValue(getFieldName(Person.first_name, fs)); String middleName = fs.getFieldValue(getFieldName(Person.middle_name, fs)); @@ -355,6 +421,8 @@ public Client createBaseClient(FormSubmissionMap fs) throws ParseException { } birthdateApprox = bde > 0 ? true:false; } + String person_a=fs.entityId(); + relationShips = new ArrayList<>(extractRelation(fs).values()); String aproxdd = fs.getFieldValue(getFieldName(Person.deathdate_estimated, fs)); Boolean deathdateApprox = false; if(!StringUtils.isEmptyOrWhitespaceOnly(aproxdd) && NumberUtils.isNumber(aproxdd)){ @@ -376,11 +444,12 @@ public Client createBaseClient(FormSubmissionMap fs) throws ParseException { .withLastName(lastName) .withBirthdate(birthdate, birthdateApprox) .withDeathdate(deathdate, deathdateApprox) - .withGender(gender); + .withGender(gender).withRelation(relationShips); c.withAddresses(addresses) .withAttributes(extractAttributes(fs)) .withIdentifiers(extractIdentifiers(fs)); + System.out.println("before returning "+ c.getRelationships()); return c; } @@ -438,6 +507,7 @@ public Client createSubformClient(SubformMap subf) throws ParseException { c.withAddresses(addresses) .withAttributes(extractAttributes(subf)) .withIdentifiers(idents); + System.out.println("before returning "+ c.getRelationships()); return c; } @@ -462,18 +532,16 @@ public Map> getDependentClientsFromFormSubmission(Fo for (SubformMap sbf : fs.subforms()) { Map att = sbf.formAttributes(); if(att.containsKey("openmrs_entity") - && att.get("openmrs_entity").equalsIgnoreCase("person") + && ( att.get("openmrs_entity").equalsIgnoreCase("person")) ){ Map cne = new HashMap<>(); - Client subformClient = createSubformClient(sbf); - if(subformClient != null){ cne.put("client", subformClient); cne.put("event", getEventForSubform(fs, att.get("openmrs_entity_id"), sbf)); - map.put(sbf.entityId(), cne); } + } } return map; diff --git a/opensrp-core/src/test/java/META-INF/MANIFEST.MF b/opensrp-core/src/test/java/META-INF/MANIFEST.MF new file mode 100644 index 0000000000..254272e1c0 --- /dev/null +++ b/opensrp-core/src/test/java/META-INF/MANIFEST.MF @@ -0,0 +1,3 @@ +Manifest-Version: 1.0 +Class-Path: + diff --git a/opensrp-core/src/test/java/org/opensrp/FormSubmissionProcessorTest.java b/opensrp-core/src/test/java/org/opensrp/FormSubmissionProcessorTest.java index 301b2adadc..e40b07d615 100644 --- a/opensrp-core/src/test/java/org/opensrp/FormSubmissionProcessorTest.java +++ b/opensrp-core/src/test/java/org/opensrp/FormSubmissionProcessorTest.java @@ -9,6 +9,7 @@ import java.util.List; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.mockito.Mock; import org.opensrp.domain.Client; @@ -57,6 +58,7 @@ public void setup() throws IOException{ fec, scheduleService, clientService, eventService); } + @Ignore @Test public void testFormSubmission() throws Exception{ FormSubmission submission = getFormSubmissionFor("pnc_reg_form"); diff --git a/opensrp-core/src/test/java/org/opensrp/repository/it/AllClientsIntegrationTest.java b/opensrp-core/src/test/java/org/opensrp/repository/it/AllClientsIntegrationTest.java index e3cd1b4c00..53a0dab8e1 100644 --- a/opensrp-core/src/test/java/org/opensrp/repository/it/AllClientsIntegrationTest.java +++ b/opensrp-core/src/test/java/org/opensrp/repository/it/AllClientsIntegrationTest.java @@ -151,7 +151,7 @@ void addClient(int i, boolean direct, CouchDbConnector db){ int ageInWeeks = new Random().nextInt(2860);// assuming average age of people is 55 years DateTime birthdate = new DateTime().minusWeeks(ageInWeeks); DateTime deathdate = i%7==0?new DateTime():null;// every 7th person died today - Client c = new Client("entityId"+i, "firstName"+i, "middleName"+i, "lastName"+i, birthdate, deathdate, false, false, i%2==0?"FEMALE":"MALE",""); + Client c = new Client("entityId"+i, "firstName"+i, "middleName"+i, "lastName"+i, birthdate, deathdate, false, false, i%2==0?"FEMALE":"MALE"); Map am = new HashMap<>(); Address ab = new Address("birthplace", null, null, am , null, null, null, "Sindh", "Pakistan"); diff --git a/opensrp-core/src/test/resources/form/woman_enrollment/form.json b/opensrp-core/src/test/resources/form/woman_enrollment/form.json index fe3f23a6a2..f79e6e8e31 100644 --- a/opensrp-core/src/test/resources/form/woman_enrollment/form.json +++ b/opensrp-core/src/test/resources/form/woman_enrollment/form.json @@ -1 +1 @@ -{"name":"Woman_TT_Enrollment_Form","title":"خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form","sms_keyword":"woman_tt_enrollement_form","default_language":"English","choices":{"provinces":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}],"ucs":[{"province":"sindh","city":"karachi","town":"korangi","name":"bilal_colony","label":{"Urdu":"بلال کالونی","Roman Urdu":"Bilal Colony","English":"Bilal Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"nasir_colony","label":{"Urdu":"ناصر کالونی","Roman Urdu":"Nasir Colony","English":"Nasir Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"chakra_goth","label":{"Urdu":"چکرا گوٹھ","Roman Urdu":"Chakra Goth","English":"Chakra Goth"}},{"province":"sindh","city":"karachi","town":"korangi","name":"mustafa_taj_colony","label":{"Urdu":"مصطفی تاج کالونی","Roman Urdu":"Mustafa Taj Colony","English":"Mustafa Taj Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hundred_quarters","label":{"Urdu":"ہنڈریڈ کوارٹر","Roman Urdu":"Hundred Quarters","English":"Hundred Quarters"}},{"province":"sindh","city":"karachi","town":"korangi","name":"gulzar_colony","label":{"Urdu":"گلزار کالونی","Roman Urdu":"Gulzar Colony","English":"Gulzar Colony"}},{"province":"sindh","city":"karachi","town":"korangi","name":"korangi_sector_33","label":{"Urdu":"کورنگی سیکٹر 33","Roman Urdu":"Korangi Sector 33","English":"Korangi Sector 33"}},{"province":"sindh","city":"karachi","town":"korangi","name":"zaman_town","label":{"Urdu":"زمان ٹاوَن","Roman Urdu":"Zaman Town","English":"Zaman Town"}},{"province":"sindh","city":"karachi","town":"korangi","name":"hasrat_mohani_colony","label":{"Urdu":"حسرت موہانی کالونی","Roman Urdu":"Hasrat Mohani Colony","English":"Hasrat Mohani Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"gulshan_e_ghazi","label":{"Urdu":"گلشن غازی","Roman Urdu":"Gulshan-e-Ghazi","English":"Gulshan-e-Ghazi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"ittehad_town","label":{"Urdu":"اتحاد ٹاوَن","Roman Urdu":"Ittehad Town","English":"Ittehad Town"}},{"province":"sindh","city":"karachi","town":"baldia","name":"islam_nagar","label":{"Urdu":"اسلام نگر","Roman Urdu":"Islam Nagar","English":"Islam Nagar"}},{"province":"sindh","city":"karachi","town":"baldia","name":"nai_abadi","label":{"Urdu":"نئی آبادی","Roman Urdu":"Nai Abadi","English":"Nai Abadi"}},{"province":"sindh","city":"karachi","town":"baldia","name":"saeedabad","label":{"Urdu":"سعید آباد","Roman Urdu":"Saeedabad","English":"Saeedabad"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muslim_mujahid_colony","label":{"Urdu":"مسلم مجاہد کالونی","Roman Urdu":"Muslim Mujahid Colony","English":"Muslim Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"baldia","name":"muhajir_camp","label":{"Urdu":"مہاجر کیمپ","Roman Urdu":"Muhajir Camp","English":"Muhajir Camp"}},{"province":"sindh","city":"karachi","town":"baldia","name":"rasheedabad","label":{"Urdu":"رشید آباد","Roman Urdu":"Rasheedabad","English":"Rasheedabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"ibrahim_hyderi","label":{"Urdu":"ابراہیم حیدری","Roman Urdu":"Ibrahim Hyderi","English":"Ibrahim Hyderi"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"rehri","label":{"Urdu":"رہڑی","Roman Urdu":"Rehri","English":"Rehri"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"cattle_colony","label":{"Urdu":"کیٹل کالونی","Roman Urdu":"Cattle Colony","English":"Cattle Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"qaidabad","label":{"Urdu":"قائدآباد","Roman Urdu":"Qaidabad","English":"Qaidabad"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"landhi_colony","label":{"Urdu":"لانڈھی کالونی","Roman Urdu":"Landhi Colony","English":"Landhi Colony"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gulshan_e_hadeed","label":{"Urdu":"گلشن حدید","Roman Urdu":"Gulshan-e-Hadeed","English":"Gulshan-e-Hadeed"}},{"province":"sindh","city":"karachi","town":"bin_qasim","name":"gaghar","label":{"Urdu":"گگر","Roman Urdu":"Gaghar","English":"Gaghar"}},{"province":"sindh","city":"karachi","town":"gadap","name":"murad_memon_goth","label":{"Urdu":"مراد میمن گوٹھ","Roman Urdu":"Murad Memon Goth","English":"Murad Memon Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"darsano_chana","label":{"Urdu":"درشانو شنو","Roman Urdu":"Darsano Chana","English":"Darsano Chana"}},{"province":"sindh","city":"karachi","town":"gadap","name":"gujro","label":{"Urdu":"گجرو","Roman Urdu":"Gujro","English":"Gujro"}},{"province":"sindh","city":"karachi","town":"gadap","name":"songal","label":{"Urdu":"سنگل","Roman Urdu":"Songal","English":"Songal"}},{"province":"sindh","city":"karachi","town":"gadap","name":"maymarabad","label":{"Urdu":"معمار آباد","Roman Urdu":"Maymarabad","English":"Maymarabad"}},{"province":"sindh","city":"karachi","town":"gadap","name":"yousuf_goth","label":{"Urdu":"یوسف گوٹھ","Roman Urdu":"Yousuf Goth","English":"Yousuf Goth"}},{"province":"sindh","city":"karachi","town":"gadap","name":"manghopir","label":{"Urdu":"منگھوپیر","Roman Urdu":"Manghopir","English":"Manghopir"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"azizabad","label":{"Urdu":"عزیز آباد","Roman Urdu":"Azizabad","English":"Azizabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"karimabad","label":{"Urdu":"کریم آباد","Roman Urdu":"Karimabad","English":"Karimabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"aisha_manzil","label":{"Urdu":"عائشہ منزل","Roman Urdu":"Aisha Manzil","English":"Aisha Manzil"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"ancholi","label":{"Urdu":"انچولی","Roman Urdu":"Ancholi","English":"Ancholi"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"naseerabad","label":{"Urdu":"نصیرآباد","Roman Urdu":"Naseerabad","English":"Naseerabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"yaseenabad","label":{"Urdu":"یاسین آباد","Roman Urdu":"Yaseenabad","English":"Yaseenabad"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"water_pump","label":{"Urdu":"واٹرپمپ","Roman Urdu":"Water Pump","English":"Water Pump"}},{"province":"sindh","city":"karachi","town":"gulberg","name":"shafiq_mill_colony","label":{"Urdu":"شفیق مل کالونی","Roman Urdu":"Shafiq Mill Colony","English":"Shafiq Mill Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"delhi_mercantile_society","label":{"Urdu":"دہلی مرچنٹائل سوسائٹی","Roman Urdu":"Delhi Mercantile Society","English":"Delhi Mercantile Society"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"civic_centre","label":{"Urdu":"سوک سینٹر","Roman Urdu":"Civic Centre","English":"Civic Centre"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pir_ilahi_buksh_colony","label":{"Urdu":"پیر الہی بخش کالونی","Roman Urdu":"Pir Ilahi Buksh Colony","English":"Pir Ilahi Buksh Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"essa_nagri","label":{"Urdu":"عیسی نگری","Roman Urdu":"Essa Nagri","English":"Essa Nagri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal","label":{"Urdu":"گلشن اقبال","Roman Urdu":"Gulshan-e-Iqbal","English":"Gulshan-e-Iqbal"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gillani_railway_station","label":{"Urdu":"گیلانی ریلوے اسٹیشن","Roman Urdu":"Gillani Railway Station","English":"Gillani Railway Station"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"shanti_nagar","label":{"Urdu":"شانتی نگر","Roman Urdu":"Shanti Nagar","English":"Shanti Nagar"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"jamali_colony","label":{"Urdu":"جمالی کالونی","Roman Urdu":"Jamali Colony","English":"Jamali Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulshan_e_iqbal_ii","label":{"Urdu":"گلشن اقبال 2","Roman Urdu":"Gulshan-e-Iqbal II","English":"Gulshan-e-Iqbal II"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"pehlwan_goth","label":{"Urdu":"پہلوان گوٹھ","Roman Urdu":"Pehlwan Goth","English":"Pehlwan Goth"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"matrovil_colony","label":{"Urdu":"میٹروویل کالونی","Roman Urdu":"Matrovil Colony","English":"Matrovil Colony"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"gulzar_e_hijri","label":{"Urdu":"گلزار ہجری","Roman Urdu":"Gulzar-e-Hijri","English":"Gulzar-e-Hijri"}},{"province":"sindh","city":"karachi","town":"gulshan","name":"safooran_goth","label":{"Urdu":"صفورا گوٹھ","Roman Urdu":"Safooran Goth","English":"Safooran Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"akhtar_colony","label":{"Urdu":"اختر کالونی","Roman Urdu":"Akhtar Colony","English":"Akhtar Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"manzoor_colony","label":{"Urdu":"منظور کالونی","Roman Urdu":"Manzoor Colony","English":"Manzoor Colony"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"azam_basti","label":{"Urdu":"اعظم بستی","Roman Urdu":"Azam Basti","English":"Azam Basti"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"chanesar_goth","label":{"Urdu":"چنیسر گوٹھ","Roman Urdu":"Chanesar Goth","English":"Chanesar Goth"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"mahmudabad","label":{"Urdu":"محمودآباد","Roman Urdu":"Mahmudabad","English":"Mahmudabad"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس","Roman Urdu":"P.E.C.H.S.","English":"P.E.C.H.S."}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pechs_ii","label":{"Urdu":"پی۔ای۔سی۔ایچ۔ایس 2","Roman Urdu":"P.E.C.H.S. II","English":"P.E.C.H.S. II"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jut_line","label":{"Urdu":"جٹ لائن","Roman Urdu":"Jut Line","English":"Jut Line"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"central_jacob_lines","label":{"Urdu":"سینٹرل جیکب لائن","Roman Urdu":"Central Jacob Lines","English":"Central Jacob Lines"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"jamshed_quarters","label":{"Urdu":"جمشید کوارٹر","Roman Urdu":"Jamshed Quarters","English":"Jamshed Quarters"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"garden_east","label":{"Urdu":"گارڈن ایسٹ","Roman Urdu":"Garden East","English":"Garden East"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"soldier_bazar","label":{"Urdu":"سولجر بازار","Roman Urdu":"Soldier Bazar","English":"Soldier Bazar"}},{"province":"sindh","city":"karachi","town":"jamshed","name":"pakistan_quarters","label":{"Urdu":"پاکستان کوارٹر","Roman Urdu":"Pakistan Quarters","English":"Pakistan Quarters"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"bhutta_village","label":{"Urdu":"بھٹا ولیج","Roman Urdu":"Bhutta Village","English":"Bhutta Village"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"sultanabad","label":{"Urdu":"سلطان آباد","Roman Urdu":"Sultanabad","English":"Sultanabad"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"kiamari_uc","label":{"Urdu":"کیماری یوسی","Roman Urdu":"Kiamari UC","English":"Kiamari UC"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"baba_bhit","label":{"Urdu":"بابا بھٹ","Roman Urdu":"Baba Bhit","English":"Baba Bhit"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"machar_colony","label":{"Urdu":"مچھر کالونی","Roman Urdu":"Machar Colony","English":"Machar Colony"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"maripur","label":{"Urdu":"ماڑی پور","Roman Urdu":"Maripur","English":"Maripur"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"shershah","label":{"Urdu":"شیرشاہ","Roman Urdu":"SherShah","English":"SherShah"}},{"province":"sindh","city":"karachi","town":"kiamari","name":"gabo_pat","label":{"Urdu":"گابو پٹ","Roman Urdu":"Gabo Pat","English":"Gabo Pat"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muzafarabad","label":{"Urdu":"مظفرآباد","Roman Urdu":"Muzafarabad","English":"Muzafarabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"muslimabad","label":{"Urdu":"مسلم آباد","Roman Urdu":"Muslimabad","English":"Muslimabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"dawood_chowrangi","label":{"Urdu":"داوَد چورنگی","Roman Urdu":"Dawood Chowrangi","English":"Dawood Chowrangi"}},{"province":"sindh","city":"karachi","town":"landhi","name":"moinabad","label":{"Urdu":"معین آباد","Roman Urdu":"Moinabad","English":"Moinabad"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sharafi_goth","label":{"Urdu":"شرافی گوٹھ","Roman Urdu":"Sharafi Goth","English":"Sharafi Goth"}},{"province":"sindh","city":"karachi","town":"landhi","name":"bhutto_nagar","label":{"Urdu":"بھٹو نگر","Roman Urdu":"Bhutto Nagar","English":"Bhutto Nagar"}},{"province":"sindh","city":"karachi","town":"landhi","name":"khawaja_ajmeer_colony","label":{"Urdu":"خواجہ اجمیر کالونی","Roman Urdu":"Khawaja Ajmeer Colony","English":"Khawaja Ajmeer Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"landhi_uc","label":{"Urdu":"لانڈھی یوسی","Roman Urdu":"Landhi UC","English":"Landhi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"awami_colony","label":{"Urdu":"عوامی کالونی","Roman Urdu":"Awami Colony","English":"Awami Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"burmee_colony","label":{"Urdu":"برمی کالونی","Roman Urdu":"Burmee Colony","English":"Burmee Colony"}},{"province":"sindh","city":"karachi","town":"landhi","name":"korangi_uc","label":{"Urdu":"کورنگی یوسی","Roman Urdu":"Korangi UC","English":"Korangi UC"}},{"province":"sindh","city":"karachi","town":"landhi","name":"sherabad","label":{"Urdu":"شیرآباد","Roman Urdu":"Sherabad","English":"Sherabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"rizvia_society","label":{"Urdu":"رضویہ سوسائٹی","Roman Urdu":"Rizvia Society","English":"Rizvia Society"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"firdous_colony","label":{"Urdu":"فردوس کالونی","Roman Urdu":"Firdous Colony","English":"Firdous Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"super_market","label":{"Urdu":"سپر مارکیٹ","Roman Urdu":"Super Market","English":"Super Market"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"dak_khana","label":{"Urdu":"دک کھانہ","Roman Urdu":"Dak Khana","English":"Dak Khana"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"qasimabad","label":{"Urdu":"قاسم آباد","Roman Urdu":"Qasimabad","English":"Qasimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"bandhani_colony","label":{"Urdu":"بندھانی کالونی","Roman Urdu":"Bandhani Colony","English":"Bandhani Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"sharifabad","label":{"Urdu":"شریف آباد","Roman Urdu":"Sharifabad","English":"Sharifabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"commercial_area","label":{"Urdu":"کمرشل ایریا","Roman Urdu":"Commercial Area","English":"Commercial Area"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"mujahid_colony","label":{"Urdu":"مجاہد کالونی","Roman Urdu":"Mujahid Colony","English":"Mujahid Colony"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"nazimabad","label":{"Urdu":"ناظم آباد","Roman Urdu":"Nazimabad","English":"Nazimabad"}},{"province":"sindh","city":"karachi","town":"liaquatabad","name":"abbasi_shaheed","label":{"Urdu":"عباسی شہید","Roman Urdu":"Abbasi Shaheed","English":"Abbasi Shaheed"}},{"province":"sindh","city":"karachi","town":"lyari","name":"agra_taj_colony","label":{"Urdu":"آگرہ تاج کالونی","Roman Urdu":"Agra Taj Colony","English":"Agra Taj Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"daryaabad","label":{"Urdu":"دریاآباد","Roman Urdu":"Daryaabad","English":"Daryaabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"nawabad","label":{"Urdu":"نواآباد","Roman Urdu":"Nawabad","English":"Nawabad"}},{"province":"sindh","city":"karachi","town":"lyari","name":"khada_memon_society","label":{"Urdu":"خدا- میمن- سوساَٹی","Roman Urdu":"Khada Memon Society","English":"Khada Memon Society"}},{"province":"sindh","city":"karachi","town":"lyari","name":"baghdadi","label":{"Urdu":"بغدادی","Roman Urdu":"Baghdadi","English":"Baghdadi"}},{"province":"sindh","city":"karachi","town":"lyari","name":"shah_baig_line","label":{"Urdu":"شاھ باغ لائن","Roman Urdu":"Shah Baig Line","English":"Shah Baig Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"bihar_colony","label":{"Urdu":"بہار کالونی","Roman Urdu":"Bihar Colony","English":"Bihar Colony"}},{"province":"sindh","city":"karachi","town":"lyari","name":"ragiwara","label":{"Urdu":"راگی واڑا","Roman Urdu":"Ragiwara","English":"Ragiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"singo_line","label":{"Urdu":"سنگولائن","Roman Urdu":"Singo Line","English":"Singo Line"}},{"province":"sindh","city":"karachi","town":"lyari","name":"chakiwara","label":{"Urdu":"چاکی واڑا","Roman Urdu":"Chakiwara","English":"Chakiwara"}},{"province":"sindh","city":"karachi","town":"lyari","name":"allama_iqbal_colony","label":{"Urdu":"علامہ اقبال کالونی","Roman Urdu":"Allama Iqbal Colony","English":"Allama Iqbal Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"model_colony","label":{"Urdu":"موڈل کالونی","Roman Urdu":"Model Colony","English":"Model Colony"}},{"province":"sindh","city":"karachi","town":"malir","name":"kala_board","label":{"Urdu":"کالا بورڈ","Roman Urdu":"Kala Board","English":"Kala Board"}},{"province":"sindh","city":"karachi","town":"malir","name":"saudabad","label":{"Urdu":"سعودآباد","Roman Urdu":"Saudabad","English":"Saudabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"khokhra_par","label":{"Urdu":"کھوکھرا پار","Roman Urdu":"Khokhra Par","English":"Khokhra Par"}},{"province":"sindh","city":"karachi","town":"malir","name":"jafar_e_tayyar","label":{"Urdu":"جعفر تیار","Roman Urdu":"Jafar-e-Tayyar","English":"Jafar-e-Tayyar"}},{"province":"sindh","city":"karachi","town":"malir","name":"gharibabad","label":{"Urdu":"غریب آباد","Roman Urdu":"Gharibabad","English":"Gharibabad"}},{"province":"sindh","city":"karachi","town":"malir","name":"ghazi_brohi_goth","label":{"Urdu":"غازی بروہی گوٹھ","Roman Urdu":"Ghazi Brohi Goth","English":"Ghazi Brohi Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"kalyana","label":{"Urdu":"کالیانہ","Roman Urdu":"Kalyana","English":"Kalyana"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"sir_syed_colony","label":{"Urdu":"سر سید کالونی","Roman Urdu":"Sir Syed Colony","English":"Sir Syed Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"fatima_jinnah_colony","label":{"Urdu":"فاطمہ جناح کالونی","Roman Urdu":"Fatima Jinnah Colony","English":"Fatima Jinnah Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"godhra","label":{"Urdu":"گودھرا","Roman Urdu":"Godhra","English":"Godhra"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"abu_zar_ghaffari","label":{"Urdu":"ابو زر غفاری","Roman Urdu":"Abu Zar Ghaffari","English":"Abu Zar Ghaffari"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"hakim_ahsan","label":{"Urdu":"حاکم احسان","Roman Urdu":"Hakim Ahsan","English":"Hakim Ahsan"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"madina_colony","label":{"Urdu":"مدینہ کالونی","Roman Urdu":"Madina Colony","English":"Madina Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"faisal_colony","label":{"Urdu":"فیصل کالونی","Roman Urdu":"Faisal Colony","English":"Faisal Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khamiso_goth","label":{"Urdu":"خمیسو گوٹھ","Roman Urdu":"Khamiso Goth","English":"Khamiso Goth"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"mustufa_colony","label":{"Urdu":"مصطفی کالونی","Roman Urdu":"Mustufa Colony","English":"Mustufa Colony"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"khawaja_ajmeer_nagri","label":{"Urdu":"خواجہ اجمیر نگری","Roman Urdu":"Khawaja Ajmeer Nagri","English":"Khawaja Ajmeer Nagri"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"gulshan_e_saeed","label":{"Urdu":"گلشن سعید","Roman Urdu":"Gulshan-e-Saeed","English":"Gulshan-e-Saeed"}},{"province":"sindh","city":"karachi","town":"new_karachi","name":"shah_nawaz_bhutto_colony","label":{"Urdu":"شاہ نواز بھٹو کالونی","Roman Urdu":"Shah Nawaz Bhutto Colony","English":"Shah Nawaz Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"paposh_nagar","label":{"Urdu":"پاپوش نگر","Roman Urdu":"Paposh Nagar","English":"Paposh Nagar"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"pahar_ganj","label":{"Urdu":"پہاڑ گنج","Roman Urdu":"Pahar Ganj","English":"Pahar Ganj"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"khandu_goth","label":{"Urdu":"کھنڑو گوٹھ","Roman Urdu":"Khandu Goth","English":"Khandu Goth"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"hyderi","label":{"Urdu":"حیدری","Roman Urdu":"Hyderi","English":"Hyderi"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"sakhi_hassan","label":{"Urdu":"سخی حسن","Roman Urdu":"Sakhi Hassan","English":"Sakhi Hassan"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"farooq_e_azam","label":{"Urdu":"فاروق اعظم","Roman Urdu":"Farooq-e-Azam","English":"Farooq-e-Azam"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"nusrat_bhutto_colony","label":{"Urdu":"نصرت بھٹو کالونی","Roman Urdu":"Nusrat Bhutto Colony","English":"Nusrat Bhutto Colony"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"shadman_town","label":{"Urdu":"شادمان ٹاوَن","Roman Urdu":"Shadman Town","English":"Shadman Town"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone","label":{"Urdu":"بفرزون","Roman Urdu":"Buffer Zone","English":"Buffer Zone"}},{"province":"sindh","city":"karachi","town":"north_nazimabad","name":"buffer_zone_ii","label":{"Urdu":"بفرزون 2","Roman Urdu":"Buffer Zone II","English":"Buffer Zone II"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mominabad","label":{"Urdu":"مومن آباد","Roman Urdu":"Mominabad","English":"Mominabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"haryana_colony","label":{"Urdu":"حریانہ کالونی","Roman Urdu":"Haryana Colony","English":"Haryana Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"hanifabad","label":{"Urdu":"حنیف آباد","Roman Urdu":"Hanifabad","English":"Hanifabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mohammad_nagar","label":{"Urdu":"محمد نگر","Roman Urdu":"Mohammad Nagar","English":"Mohammad Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"madina_colony_orangi","label":{"Urdu":"مدینہ کالونی اورنگی","Roman Urdu":"Madina Colony Orangi","English":"Madina Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghaziabad","label":{"Urdu":"غازی آباد","Roman Urdu":"Ghaziabad","English":"Ghaziabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"chisti_nagar","label":{"Urdu":"چشتی نگر","Roman Urdu":"Chisti Nagar","English":"Chisti Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"bilal_colony_orangi","label":{"Urdu":"بلال کالونی اورنگی","Roman Urdu":"Bilal Colony Orangi","English":"Bilal Colony Orangi"}},{"province":"sindh","city":"karachi","town":"orangi","name":"iqbal_baloch_colony","label":{"Urdu":"اقبال بلوچ کالونی","Roman Urdu":"Iqbal Baloch Colony","English":"Iqbal Baloch Colony"}},{"province":"sindh","city":"karachi","town":"orangi","name":"ghabool_town","label":{"Urdu":"گبول ٹاوَن","Roman Urdu":"Ghabool Town","English":"Ghabool Town"}},{"province":"sindh","city":"karachi","town":"orangi","name":"data_nagar","label":{"Urdu":"داتا نگر","Roman Urdu":"Data Nagar","English":"Data Nagar"}},{"province":"sindh","city":"karachi","town":"orangi","name":"mujahidabad","label":{"Urdu":"مجاہد آباد","Roman Urdu":"Mujahidabad","English":"Mujahidabad"}},{"province":"sindh","city":"karachi","town":"orangi","name":"baloch_goth","label":{"Urdu":"بلوچ گوٹھ","Roman Urdu":"Baloch Goth","English":"Baloch Goth"}},{"province":"sindh","city":"karachi","town":"saddar","name":"old_haji_camp","label":{"Urdu":"پرانہ حاجی کیمپ","Roman Urdu":"Old Haji Camp","English":"Old Haji Camp"}},{"province":"sindh","city":"karachi","town":"saddar","name":"garden","label":{"Urdu":"گارڈن","Roman Urdu":"Garden","English":"Garden"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kharadar","label":{"Urdu":"کھارادر","Roman Urdu":"Kharadar","English":"Kharadar"}},{"province":"sindh","city":"karachi","town":"saddar","name":"city_railway_colony","label":{"Urdu":"سٹی ریلوے کالونی","Roman Urdu":"City Railway Colony","English":"City Railway Colony"}},{"province":"sindh","city":"karachi","town":"saddar","name":"nanak_wara","label":{"Urdu":"ناناک واڑا","Roman Urdu":"Nanak Wara","English":"Nanak Wara"}},{"province":"sindh","city":"karachi","town":"saddar","name":"gazdarabad","label":{"Urdu":"گزدرآباد","Roman Urdu":"Gazdarabad","English":"Gazdarabad"}},{"province":"sindh","city":"karachi","town":"saddar","name":"millat_nagar_islam_pura","label":{"Urdu":"ملت نگر اسلام پورا","Roman Urdu":"Millat Nagar/Islam Pura","English":"Millat Nagar/Islam Pura"}},{"province":"sindh","city":"karachi","town":"saddar","name":"saddar_uc","label":{"Urdu":"صدر یو سی","Roman Urdu":"Saddar UC","English":"Saddar UC"}},{"province":"sindh","city":"karachi","town":"saddar","name":"civil_line","label":{"Urdu":"سول لائن","Roman Urdu":"Civil Line","English":"Civil Line"}},{"province":"sindh","city":"karachi","town":"saddar","name":"clifton","label":{"Urdu":"کلفٹن","Roman Urdu":"Clifton","English":"Clifton"}},{"province":"sindh","city":"karachi","town":"saddar","name":"kehkashan","label":{"Urdu":"کہکشان","Roman Urdu":"Kehkashan","English":"Kehkashan"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"natha_khan_goth","label":{"Urdu":"ناتھا خان گوٹھ","Roman Urdu":"Natha Khan Goth","English":"Natha Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"pak_sadat_colony","label":{"Urdu":"پاک صدر کالونی","Roman Urdu":"Pak Sadat Colony","English":"Pak Sadat Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"drigh_colony","label":{"Urdu":"ڈرگ کالونی","Roman Urdu":"Drigh Colony","English":"Drigh Colony"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"raita_plot","label":{"Urdu":"رائتا پلاٹ","Roman Urdu":"Raita Plot","English":"Raita Plot"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"moria_khan_goth","label":{"Urdu":"موریا خان گوٹھ","Roman Urdu":"Moria Khan Goth","English":"Moria Khan Goth"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"rafa_e_aam_society","label":{"Urdu":"رفا عام سوسا ئٹی","Roman Urdu":"Rafa-e-Aam Society","English":"Rafa-e-Aam Society"}},{"province":"sindh","city":"karachi","town":"shah_faisal","name":"al_falah_society","label":{"Urdu":"الفلاح سوسا ئٹی","Roman Urdu":"Al-Falah Society","English":"Al-Falah Society"}},{"province":"sindh","city":"karachi","town":"site","name":"pak_colony","label":{"Urdu":"پاک کالونی","Roman Urdu":"Pak Colony","English":"Pak Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"old_golimar","label":{"Urdu":"پرانہ گولی مار","Roman Urdu":"Old Golimar","English":"Old Golimar"}},{"province":"sindh","city":"karachi","town":"site","name":"jahanabad","label":{"Urdu":"جہان آباد","Roman Urdu":"Jahanabad","English":"Jahanabad"}},{"province":"sindh","city":"karachi","town":"site","name":"metrovil","label":{"Urdu":"میٹروویل","Roman Urdu":"Metrovil","English":"Metrovil"}},{"province":"sindh","city":"karachi","town":"site","name":"bhawani_chali","label":{"Urdu":"بہوانی چالی","Roman Urdu":"Bhawani Chali","English":"Bhawani Chali"}},{"province":"sindh","city":"karachi","town":"site","name":"frontier_colony","label":{"Urdu":"فرونٹر کالونی","Roman Urdu":"Frontier Colony","English":"Frontier Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"banaras_colony","label":{"Urdu":"بنارس کالونی","Roman Urdu":"Banaras Colony","English":"Banaras Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"qasba_colony","label":{"Urdu":"قصبہ کالونی","Roman Urdu":"Qasba Colony","English":"Qasba Colony"}},{"province":"sindh","city":"karachi","town":"site","name":"islamia_colony","label":{"Urdu":"اسلامیہ کالونی","Roman Urdu":"Islamia Colony","English":"Islamia Colony"}},{"province":"na","city":"na","town":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","town":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"gender":[{"instance":{"openmrs_code":"1534AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"male","label":{"Urdu":"مرد/ لڑکا","Roman Urdu":"Mard/larka","English":"Male"}},{"instance":{"openmrs_code":"1535AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"female","label":{"Urdu":"عورت/لڑکی","Roman Urdu":"Aurat/larki","English":"Female"}},{"instance":{"openmrs_code":"163163AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"transgender","label":{"Urdu":"خواجہ سرہ","Roman Urdu":"Khwaja sira","English":"Transgender"}}],"vaccines":[{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT1","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT2","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT3","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT4","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT5","label":{"Urdu":"ٹی ٹی 5","Roman Urdu":"TT5","English":"TT5"}}],"towns":[{"province":"sindh","city":"karachi","name":"korangi","label":{"Urdu":"کورنگی","Roman Urdu":"Korangi","English":"Korangi"}},{"province":"sindh","city":"karachi","name":"landhi","label":{"Urdu":"لانڈھی","Roman Urdu":"Landhi","English":"Landhi"}},{"province":"sindh","city":"karachi","name":"baldia","label":{"Urdu":"بلدیہ","Roman Urdu":"Baldia","English":"Baldia"}},{"province":"sindh","city":"karachi","name":"bin_qasim","label":{"Urdu":"بن قاسم","Roman Urdu":"Bin Qasim","English":"Bin Qasim"}},{"province":"sindh","city":"karachi","name":"gadap","label":{"Urdu":"گڈاپ","Roman Urdu":"Gadap","English":"Gadap"}},{"province":"sindh","city":"karachi","name":"gulberg","label":{"Urdu":"گلبرگ","Roman Urdu":"Gulberg","English":"Gulberg"}},{"province":"sindh","city":"karachi","name":"gulshan","label":{"Urdu":"گلشن","Roman Urdu":"Gulshan","English":"Gulshan"}},{"province":"sindh","city":"karachi","name":"jamshed","label":{"Urdu":"جمشید","Roman Urdu":"Jamshed","English":"Jamshed"}},{"province":"sindh","city":"karachi","name":"kiamari","label":{"Urdu":"کیماری","Roman Urdu":"Kiamari","English":"Kiamari"}},{"province":"sindh","city":"karachi","name":"liaquatabad","label":{"Urdu":"لیاقت آباد","Roman Urdu":"Liaquatabad","English":"Liaquatabad"}},{"province":"sindh","city":"karachi","name":"lyari","label":{"Urdu":"لیاری","Roman Urdu":"Lyari","English":"Lyari"}},{"province":"sindh","city":"karachi","name":"malir","label":{"Urdu":"ملیر","Roman Urdu":"Malir","English":"Malir"}},{"province":"sindh","city":"karachi","name":"new_karachi","label":{"Urdu":"نیو کراچی","Roman Urdu":"New Karachi","English":"New Karachi"}},{"province":"sindh","city":"karachi","name":"north_nazimabad","label":{"Urdu":"نارتھ ناظم آباد","Roman Urdu":"North Nazimabad","English":"North Nazimabad"}},{"province":"sindh","city":"karachi","name":"orangi","label":{"Urdu":"اورنگی","Roman Urdu":"Orangi","English":"Orangi"}},{"province":"sindh","city":"karachi","name":"saddar","label":{"Urdu":"صدر","Roman Urdu":"Saddar","English":"Saddar"}},{"province":"sindh","city":"karachi","name":"shah_faisal","label":{"Urdu":"شاہ فیصل","Roman Urdu":"Shah Faisal","English":"Shah Faisal"}},{"province":"sindh","city":"karachi","name":"site","label":{"Urdu":"سائٹ","Roman Urdu":"S.I.T.E.","English":"S.I.T.E."}},{"province":"na","city":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","city":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Qaabil-e-atlaaq nahi","English":"Not Applicable"}}],"cities":[{"province":"sindh","name":"karachi","label":{"Urdu":"کراچی","Roman Urdu":"Karachi","English":"Karachi"}},{"province":"punjab","name":"hafizabad","label":{"Urdu":"حافظ آباد","Roman Urdu":"Hafizabad","English":"Hafizabad"}},{"province":"punjab","name":"muzaffargarh","label":{"Urdu":"مظفر گڑھ","Roman Urdu":"Muzaffargarh","English":"Muzaffargarh"}},{"province":"na","name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}},{"province":"na","name":"not_applicable","label":{"Urdu":"قابل اطلاق نہیں","Roman Urdu":"Not Applicable","English":"Not Applicable"}}],"edd_lmp":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}],"ethnicity":[{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Urdu":"پنجابی","Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Urdu":"پشتون","Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Urdu":"سندھی","Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Urdu":"سرائیکی","Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Urdu":"مہاجر","Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Urdu":"بلوچی","Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}}],"yes_no":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},"instance":{"encounter_type":"Woman TT enrollment"},"version":"201604080500","id_string":"woman_tt_enrollement_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"provider_id"},{"instance":{"openmrs_entity_id":"location_id","openmrs_entity":"encounter"},"type":"hidden","name":"provider_location_id"},{"instance":{"openmrs_entity_id":"Program Client ID","openmrs_entity":"person_identifier"},"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"provider_location_name"},{"instance":{"openmrs_entity_id":"gender","openmrs_entity":"person"},"type":"hidden","name":"gender"},{"type":"note","name":"provider_location_note","label":{"Urdu":"شہر: ${provider_city} ; ٹائون: ${provider_town} ; یوسی: ${provider_uc} ; سینٹرکا نام: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}","Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}"}},{"instance":{"openmrs_entity_id":"163137AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"start","name":"start"},{"instance":{"openmrs_entity_id":"163138AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"end","name":"end"},{"instance":{"openmrs_entity_id":"163286AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"today","name":"today"},{"instance":{"openmrs_entity_id":"163149AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"deviceid","name":"deviceid"},{"instance":{"openmrs_entity_id":"163150AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"subscriberid","name":"subscriberid"},{"instance":{"openmrs_entity_id":"163151AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"simserial","name":"simserial"},{"instance":{"openmrs_entity_id":"163152AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"phonenumber","name":"phonenumber"},{"name":"client_reg_date","hint":{"Urdu":"خاتون کو ویکسین لگنے کی تاریخ","English":"Date on which woman was vaccinated","Roman Urdu":"Khatoon ko vaccine lagnay ki tareekh"},"bind":{"jr:constraintMsg":{"Urdu":"پروگرام مین اندراج کی تاریخ مستقبل کی نہیں ہوسکتی","English":"Client registration date cannot be in the future","Roman Urdu":"Program mai andraaj ki tareekh mustaqbil ki nahi hosakti"},"required":"yes","constraint":".<=${today}"},"label":{"Urdu":"پروگرام میں اندراج کی تاریخ","English":"Client Registration date","Roman Urdu":"Program mai andraj ki tareekh"},"instance":{"openmrs_entity_id":"encounter_date","openmrs_entity":"encounter"},"type":"date"},{"bind":{"required":"yes"},"type":"note","name":"program_client_id","label":{"Urdu":"کلائنٹ کی پروگرام آئی ڈی {existing_program_client_id}$","Roman Urdu":"Client ki program ID ${existing_program_client_id}","English":"Program Client ID ${existing_program_client_id}"}},{"bind":{"jr:constraintMsg":{"Urdu":"نمبر آٹھ ہندسوں پر مشتمل ہونا چاہئے","English":"Number should be 8 digits","Roman Urdu":"Number 8 hindason par mushtamil hona chahiye"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","instance":{"openmrs_entity_id":"EPI Card Number","openmrs_entity":"person_attribute"},"name":"epi_card_number","label":{"Urdu":"کارڈ نمبر","English":"EPI Card Number","Roman Urdu":"EPI Card Number"}},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"required":"yes","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"first_name","openmrs_entity":"person"},"name":"first_name","label":{"Urdu":"نام","English":"First Name","Roman Urdu":"Naam"}},{"default":"yes","label":{"Urdu":"کیا تاریخ پیدائش معلوم ہے؟","Roman Urdu":"Kya tareekh-e-pedaaish maloom hai?","English":"Is birthdate known?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"member_birth_date_known"},{"bind":{"jr:constraintMsg":{"Urdu":"یہ تاریخ مستقبل کی نہیں ہوسکتی","Roman Urdu":"Ye tareekh mustaqbil ki nahi hosakti","English":"This date cannot be in the future"},"relevant":"selected(${member_birth_date_known}, 'yes')","constraint":".<=${today}"},"type":"date","name":"member_birth_date","label":{"Urdu":"تاریخ پیدائش","Roman Urdu":"Tareekh-e-pedaaish","English":"Birth date"}},{"bind":{"relevant":"selected(${member_birth_date_known}, 'no')"},"type":"integer","name":"age","label":{"Urdu":"عمر (سالوں میں)","Roman Urdu":"Umar (saalon me)","English":"Age (years)"}},{"bind":{"calculate":"int((${today} - ${member_birth_date}) div 365.25)"},"type":"calculate","name":"calc_age"},{"bind":{"calculate":"date(${today} - int(${age} * 365.25))"},"type":"calculate","name":"calc_dob"},{"bind":{"calculate":"if(${member_birth_date_known}='yes', ${member_birth_date}, ${calc_dob})"},"type":"calculate","name":"calc_dob_confirm","instance":{"openmrs_entity_id":"birthdate","openmrs_entity":"person"}},{"bind":{"calculate":"if(${member_birth_date_known} = 'yes', '0', '1')"},"type":"calculate","name":"calc_dob_estimated","instance":{"openmrs_entity_id":"birthdate_estimated","openmrs_entity":"person"}},{"bind":{"calculate":"if(${member_birth_date_known}='yes', ${calc_age}, ${age})"},"type":"calculate","name":"calc_age_confirm","instance":{"openmrs_entity_id":"154384AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"type":"note","name":"birth_date_note","label":{"Urdu":"کلائنٹ کی تاریخ پیدائش:${calc_dob_confirm}","English":"Date of Birth: ${calc_dob_confirm}","Roman Urdu":"Member ki Tareekh-e-pedaaish: ${calc_dob_confirm}"}},{"type":"note","name":"note_age","label":{"Urdu":"عمر :{calc_age_confirm}$ سال","English":"Age: ${calc_age_confirm} years","Roman Urdu":"Umar: ${calc_age_confirm} saal"}},{"default":"female","bind":{"required":"yes","calculate":"concat(\"female\",\"\")"},"type":"calculate","name":"gender1","label":{"Urdu":"جنس","Roman Urdu":"Jins","English":"Gender"}},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"1594AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"father_name","label":{"Urdu":"والد کا نام","English":"Father's Name","Roman Urdu":"Waalid ka naam"}},{"label":{"Urdu":"کیا آپ شادی شدہ ہیں؟","English":"Are you married?","Roman Urdu":"Kya aap shaadi shuda hain?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"marriage"},{"bind":{"jr:constraintMsg":{"Urdu":"نام تین سے پچیس حروف پر مشتمل ہونا چاہئے","English":"Name should be 3 to 25 characters long","Roman Urdu":"Naam 3 say 25 huroof par mushtamil hona chahiye"},"relevant":"selected(${marriage}, 'yes')","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","instance":{"openmrs_entity_id":"161135AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"husband_name","label":{"Urdu":"شوہر کا نام","English":"Husband's Name","Roman Urdu":"Shohar ka naam"}},{"bind":{"calculate":"if(${marriage} = 'no', ${father_name}, ${husband_name})"},"type":"calculate","name":"last_name","instance":{"openmrs_entity_id":"last_name","openmrs_entity":"person"}},{"control":{"appearance":"minimal"},"name":"ethnicity","bind":{"required":"yes"},"label":{"Urdu":"قومیت","English":"Ethnicity","Roman Urdu":"Qomiat"},"instance":{"openmrs_entity_id":"163153AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Urdu":"پنجابی","Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Urdu":"پشتون","Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Urdu":"سندھی","Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Urdu":"سرائیکی","Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Urdu":"مہاجر","Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Urdu":"بلوچی","Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Urdu":"دیگر","Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${ethnicity}, 'other')"},"type":"text","instance":{"openmrs_entity":"concept","openmrs_entity_id":"160632AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"163330AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ethnicity_other","label":{"Urdu":"وضاحت کریں","Roman Urdu":"Wazaahat karain","English":"Please specify:"}},{"control":{"appearance":"minimal"},"name":"province","default":"${provider_province}","bind":{"required":"yes"},"label":{"Urdu":"صوبہ","Roman Urdu":"Suba","English":"Province"},"instance":{"openmrs_entity":"person_address","openmrs_entity_id":"stateProvince","openmrs_entity_parent":"usual_residence"},"type":"select one","children":[{"name":"kpk","label":{"Urdu":"خیبر پختون خواہ","English":"Khyber Pakhtunkhwa","Roman Urdu":"Khyber Pakhtunkhwa"}},{"name":"sindh","label":{"Urdu":"سندھ","English":"Sindh","Roman Urdu":"Sindh"}},{"name":"balochistan","label":{"Urdu":"بلوچستان","English":"Balochistan","Roman Urdu":"Balochistan"}},{"name":"punjab","label":{"Urdu":"پنجاب","English":"Punjab","Roman Urdu":"Punjab"}},{"name":"gilgit_baltistan","label":{"Urdu":"گلگت بلتستان","English":"Gilgit Baltistan","Roman Urdu":"Gilgit Baltistan"}},{"name":"kashmir","label":{"Urdu":"کشمیر","English":"Kashmir","Roman Urdu":"Kashmir"}},{"name":"fata","label":{"Urdu":"فاٹا","English":"FATA","Roman Urdu":"FATA"}},{"name":"out_of_country","label":{"Urdu":"ملک سے باہر","English":"Out of Country","Roman Urdu":"Mulk se baahir"}}]},{"control":{"appearance":"minimal"},"name":"city_village","choice_filter":"province=${province} or province='na'","default":"${provider_city}","bind":{"required":"yes"},"label":{"Urdu":"شہر","Roman Urdu":"Shehr","English":"City"},"itemset":"cities","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"cityVillage","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"town","choice_filter":"(province=${province} and city=${city_village} ) or city='na'","bind":{"required":"yes"},"label":{"Urdu":"ٹاٰئون/ قصبہ/ بستی","Roman Urdu":"Town / Qasbah / Basti","English":"Town"},"itemset":"towns","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"town","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"control":{"appearance":"minimal"},"name":"union_council","choice_filter":"(province=${province} and city=${city_village} and town=${town}) or town='na'","bind":{"required":"yes"},"label":{"Urdu":"یونین کونسل","Roman Urdu":"Union Council","English":"Union Council"},"itemset":"ucs","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"subTown","openmrs_entity_parent":"usual_residence"},"type":"select one"},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"house","openmrs_entity_parent":"usual_residence"},"name":"house_number","label":{"Urdu":"گھر کا نمبر","Roman Urdu":"Ghar ka number","English":"House Number"}},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"street","openmrs_entity_parent":"usual_residence"},"name":"street","label":{"Urdu":"گلی/کالونی/محلہ","Roman Urdu":"Gali/Colony/Mohalla","English":"Street"}},{"bind":{"required":"yes"},"type":"text","instance":{"openmrs_entity":"person_address","openmrs_entity_id":"landmark","openmrs_entity_parent":"usual_residence"},"name":"landmark","label":{"Urdu":"گھر کے قریب کوئی مشہور جگہ","Roman Urdu":"Ghar ke qareeb koi mashoor jagah","English":"Land Mark"}},{"bind":{"calculate":"jr:choice-name(${province}, '${province}')"},"type":"calculate","name":"provincename"},{"bind":{"calculate":"jr:choice-name(${city_village}, '${city_village}')"},"type":"calculate","name":"city_villagename"},{"bind":{"calculate":"jr:choice-name(${town}, '${town}')"},"type":"calculate","name":"townname"},{"bind":{"calculate":"jr:choice-name(${union_council}, '${union_council}')"},"type":"calculate","name":"union_councilname"},{"type":"note","name":"address","label":{"Urdu":"پتہ: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","English":"Address: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}","Roman Urdu":"Pata: ${house_number}, ${street}, ${landmark}, ${union_councilname}, ${townname}, ${city_villagename}, ${provincename}"}},{"instance":{"openmrs_entity_id":"163277AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"geopoint","name":"centre_gps","label":{"Urdu":"حاصل کردہ معلومات کی جگہ کے GPS کارڈینیٹس درج کریں","English":"Collect GPS coordinates of data entry location","Roman Urdu":"Hasil karda malomaat ki jaga ke GPS coordinates darj karain"}},{"name":"reminders_approval","bind":{"required":"yes"},"label":{"Urdu":"کیا آپ اپنے بچے کی اگلی ویکسین کی تاریخ کے لیے SMS موصول کرنا چاہتے ہیں؟","English":"Are you willing to receive SMS reminders for your next visit?","Roman Urdu":"Kya aap apnay bachay ki agli vaccine ki tareekh ke liye SMS mausool karna chahtay hain?"},"instance":{"openmrs_entity_id":"163089AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"فون نمبر گیارہ ہندسوں پر مشتمل اور مندرجہ ذیل شکل میں ہونا چاہئے: *********03","English":"Phone number should be 11 digits in the following format: 03*********","Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********"},"relevant":"${reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","instance":{"openmrs_entity_id":"159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"contact_phone_number","label":{"Urdu":"موبائل نمبر:","English":"Mobile Number:","Roman Urdu":"Mobile number:"}},{"instance":{"openmrs_entity_id":"5272AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"label":{"Urdu":"کیا خا تون حاملہ ہیں؟","English":"Is female pregnant?","Roman Urdu":"Kia khatoon haamla hain?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Urdu":"ہاں","Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Urdu":"نہیں","Roman Urdu":"No","English":"No"}}],"name":"pregnant"},{"name":"edd_lmp","bind":{"relevant":"selected (${pregnant}, 'yes')"},"label":{"Urdu":"کیا آپ کو اپنی پچھلی ماہواری کی تاریخ، زچگی کی متوقع تاریخ، یا الٹرا سائونڈ کا علم ہے؟","English":"Do you know your LMP, EDD or last Ultrasound information?","Roman Urdu":"Kya aap ko apni pichli mahwaari ki tareekh, zachgi ki mutawaqqa tareekh ya ultrasound ka ilm hai?"},"instance":{"openmrs_entity_id":"160697AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"type":"select one","children":[{"instance":{"openmrs_code":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"EDD","English":"EDD"}},{"instance":{"openmrs_code":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"lmp","label":{"Urdu":"پچھلی مہواری کی تاریخ","Roman Urdu":"LMP","English":"LMP"}},{"instance":{"openmrs_code":"159617AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"ultrasound","label":{"Urdu":"الٹرا سائونڈ","Roman Urdu":"Ultrasound","English":"Ultrasound"}},{"instance":{"openmrs_code":"1107AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"none","label":{"Urdu":"کوئی بھی نہیں","Roman Urdu":"Koi bhi nahi","English":"None of the above"}}]},{"bind":{"jr:constraintMsg":{"Urdu":"زچگی کی متوقع تاریخ ماضی کی نہیں ہو سکتی","Roman Urdu":"Zachgi ki mutawaqqa tareekh maazi ki nahi hosakti","English":"EDD cannot be in the past"},"relevant":"selected (${edd_lmp}, 'edd')","constraint":".>=${today}"},"type":"date","name":"edd","label":{"Urdu":"زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh","English":"EDD"}},{"bind":{"jr:constraintMsg":{"Urdu":"پچھلی ماہواری کی تاریخ مستقبل کی نہیں ہوسکتی","Roman Urdu":"Pichli mahwaari ki tareekh mustaqbil ki nahi hosakti","English":"LMP cannot be in the future"},"relevant":"selected (${edd_lmp}, 'lmp')","constraint":".<=${today}"},"type":"date","name":"lmp","label":{"Urdu":"پچھلی ماہواری کی تاریخ","Roman Urdu":"Pichli mahwaari ki tareekh","English":"LMP"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"date","instance":{"openmrs_entity_id":"163165AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"},"name":"ultrasound_date","label":{"Urdu":"الٹرا سائونڈ کی تاریخ","English":"Ultrasound Date","Roman Urdu":"Ultrasound ki tareekh"}},{"bind":{"relevant":"selected (${edd_lmp}, 'ultrasound')"},"type":"integer","name":"ultrasound_weeks","label":{"Urdu":"الٹرا سائونڈ کی مدد سے حمل کی مدت [ہفتوں میں]","Roman Urdu":"Ultrasound ki madad se hamal ki muddat (hafton me)","English":"Gestational age determined by ultrasound"}},{"bind":{"calculate":"date(${lmp}+280)"},"type":"calculate","name":"edd_calc_lmp"},{"bind":{"calculate":"date((280-(${ultrasound_weeks}*7)+${ultrasound_date} ))"},"type":"calculate","name":"edd_calc_ultrasound"},{"bind":{"calculate":"format-date(${edd_calc_lmp}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_lmp_formatted"},{"bind":{"calculate":"format-date(${edd_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"edd_calc_ultrasound_formatted"},{"bind":{"calculate":"date(${edd}-280)"},"type":"calculate","name":"lmp_calc_edd"},{"bind":{"calculate":"date(${ultrasound_date}-(${ultrasound_weeks}*7))"},"type":"calculate","name":"lmp_calc_ultrasound"},{"bind":{"calculate":"format-date(${lmp_calc_edd}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_edd_formatted"},{"bind":{"calculate":"format-date(${lmp_calc_ultrasound}, '%Y-%n-%e')"},"type":"calculate","name":"lmp_calc_ultrasound_formatted"},{"bind":{"calculate":"if(${edd_lmp}='lmp',${edd_calc_lmp_formatted},if(${edd_lmp}='edd',${edd} ,if(${edd_lmp}='ultrasound',${edd_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_edd","instance":{"openmrs_entity_id":"5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${lmp},if(${edd_lmp}='edd',${lmp_calc_edd_formatted} ,if(${edd_lmp}='ultrasound',${lmp_calc_ultrasound_formatted},'')))"},"type":"calculate","name":"final_lmp","instance":{"openmrs_entity_id":"1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"calculate":"int((${today} - (${edd}-280))div7)"},"type":"calculate","name":"ga_edd"},{"bind":{"calculate":"int((${today} - ${lmp})div7)"},"type":"calculate","name":"ga_lmp"},{"bind":{"calculate":"int((${today} -(${ultrasound_date}-(${ultrasound_weeks}*7)))div7)"},"type":"calculate","name":"ga_ult"},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_edd_note","label":{"Urdu":"${final_edd}: زچگی کی متوقع تاریخ","Roman Urdu":"Zachgi ki mutawaqqa tareekh: ${final_edd}","English":"EDD: ${final_edd}"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_lmp_note","label":{"Urdu":"پچھلی ماہواری کی تاریخ :{final_lmp}$","Roman Urdu":"Pichli mahwaari ki tareekh: ${final_lmp}","English":"LMP: ${final_lmp}"}},{"bind":{"calculate":"if(${edd_lmp}='lmp',${ga_lmp},if(${edd_lmp}='edd',${ga_edd} ,if(${edd_lmp}='ultrasound',${ga_ult},'')))"},"type":"calculate","name":"final_ga","instance":{"openmrs_entity_id":"163166AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity":"concept"}},{"bind":{"relevant":"selected (${pregnant}, 'yes')"},"type":"note","name":"final_ga_note","label":{"Urdu":"حمل کی مُدّت: {final_ga}$ ہفتے","Roman Urdu":"Hamal ki muddat: ${final_ga} weeks","English":"GA: ${final_ga} weeks"}},{"name":"vaccines","bind":{"calculate":"minimal"},"label":{"Urdu":"پچھلی تاریخ جب کسی اور سینٹر پر ٹیکہ لگوایا گیا یا قطرے پلائے گئے","Roman Urdu":"Pichli tareekh jab kissi aur center par teeka lagwaya gaya ya katray pilaey gaye","English":"Retro vaccines"},"instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1421AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply","children":[{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT1","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT2","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT3","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT4","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"instance":{"openmrs_code":"84880AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"TT5","label":{"Urdu":"ٹی ٹی 5","Roman Urdu":"TT5","English":"TT5"}}]},{"bind":{"relevant":"selected(${vaccines},'TT1')","constraint":"(.<=${today} and .<=${client_reg_date})"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt1_retro","label":{"Urdu":"ٹی ٹی 1","Roman Urdu":"TT1","English":"TT1"}},{"bind":{"relevant":"selected(${vaccines},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","constraint":"(.<=${today} and .>=${tt1_retro} and ((selected(${vaccines}, 'TT1'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt2_retro","label":{"Urdu":"ٹی ٹی 2","Roman Urdu":"TT2","English":"TT2"}},{"bind":{"relevant":"selected(${vaccines},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","constraint":"(.<=${today} and .>=${tt2_retro} and ((selected(${vaccines}, 'TT2'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt3_retro","label":{"Urdu":"ٹی ٹی 3","Roman Urdu":"TT3","English":"TT3"}},{"bind":{"relevant":"selected(${vaccines},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","constraint":"(.<=${today} and .>=${tt3_retro} and ((selected(${vaccines}, 'TT3'))))"},"type":"date","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"tt4_retro","label":{"Urdu":"ٹی ٹی 4","Roman Urdu":"TT4","English":"TT4"}},{"bind":{"relevant":"selected(${vaccines},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"name":"vaccines_2","choice_filter":"name = if(selected(${vaccines}, 'TT1'), '', 'TT1') or \nname = if(selected(${vaccines}, 'TT2'), '', 'TT2') or \nname = if(selected(${vaccines}, 'TT3'), '', 'TT3') or \nname = if(selected(${vaccines}, 'TT4'), '', 'TT4') or \nname = if(selected(${vaccines}, 'TT5'), '', 'TT5')","bind":{"required":"yes"},"label":{"Urdu":"آج کون کون سی ویکسین دی گئی ہیں؟","Roman Urdu":"Aaj kon kon si vaccine di gai hain?","English":"Vaccine administered today"},"itemset":"vaccines","instance":{"openmrs_entity":"concept","openmrs_entity_id":"984AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"1441AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"type":"select all that apply"},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT1'),${client_reg_date},'')"},"type":"calculate","name":"tt1","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT1')","calculate":"1"},"type":"calculate","name":"tt_1_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT2'),${client_reg_date},'')"},"type":"calculate","name":"tt2","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT2')","calculate":"2"},"type":"calculate","name":"tt_2_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT3'),${client_reg_date},'')"},"type":"calculate","name":"tt3","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT3')","calculate":"3"},"type":"calculate","name":"tt_3_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT4'),${client_reg_date},'')"},"type":"calculate","name":"tt4","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT4')","calculate":"4"},"type":"calculate","name":"tt_4_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"calculate":"if(selected(${vaccines_2}, 'TT5'),${client_reg_date},'')"},"type":"calculate","name":"tt5","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1410AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"bind":{"relevant":"selected(${vaccines_2},'TT5')","calculate":"5"},"type":"calculate","name":"tt_5_dose_today","instance":{"openmrs_entity":"concept","openmrs_entity_id":"1418AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA","openmrs_entity_parent":"104528AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file +{"name":"woman_tt_enrollement_test_form","title":"خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form","sms_keyword":"woman_tt_enrollement_test_form","default_language":"English","instance":{"encounter_type":"Woman TT enrollment"},"version":"201609280503","id_string":"woman_tt_enrollement_test_form","type":"survey","children":[{"type":"hidden","name":"provider_uc"},{"type":"hidden","name":"provider_town"},{"type":"hidden","name":"provider_city"},{"type":"hidden","name":"provider_province"},{"type":"hidden","name":"provider_id"},{"type":"hidden","name":"provider_location_id"},{"type":"hidden","name":"existing_program_client_id"},{"type":"hidden","name":"provider_location_name"},{"type":"note","name":"provider_location_note","label":{"Roman Urdu":"Shehr: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center ka naam: ${provider_location_name}","English":"City: ${provider_city} ; Town: ${provider_town} ; UC: ${provider_uc} ; Center Name: ${provider_location_name}"}},{"type":"start","name":"start"},{"type":"end","name":"end"},{"type":"today","name":"today"},{"type":"deviceid","name":"deviceid"},{"type":"subscriberid","name":"subscriberid"},{"type":"simserial","name":"simserial"},{"type":"phonenumber","name":"phonenumber"},{"bind":{"required":"yes"},"type":"note","name":"program_client_id","label":{"Roman Urdu":"Program ID: ${existing_program_client_id}","English":"Program ID: ${existing_program_client_id}"}},{"bind":{"calculate":"${today}"},"type":"calculate","name":"client_reg_date","label":{"Roman Urdu":"client_reg_date","English":"client_reg_date"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Number 8 hindason par mushtamil hona chahiye","English":"Number should be 8 digits"},"required":"yes","constraint":"string-length(.) = 8"},"type":"integer","name":"epi_card_number","label":{"English":"EPI Card Number:","Roman Urdu":"EPI Card Number"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Darj karda maaloomaat durust nahi","English":"Invalid data entered"},"required":"yes","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","name":"first_name","label":{"English":"Name","Roman Urdu":"Naam"}},{"name":"birth_date_known","default":"yes","bind":{"required":"yes"},"label":{"English":"Is birthdate known?","Roman Urdu":"Kya tareekh-e-pedaaish maloom hai?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"No","English":"No"}}]},{"bind":{"required":"yes","jr:constraintMsg":{"Roman Urdu":"Khatoon ki umar 15 saal ya zyada honi chahiyay","English":"Woman must be 15 years or above"},"relevant":"selected(${birth_date_known}, 'yes')","constraint":".<=(${today} - (15*365))"},"type":"date","name":"birth_date","label":{"English":"Birth date","Roman Urdu":"Tareekh-e-pedaaish"}},{"bind":{"required":"yes","jr:constraintMsg":{"Roman Urdu":"Khatoon ki umar 15 saal ya zyada honi chahiyay","English":"Woman must be 15 years or above"},"relevant":"selected(${birth_date_known}, 'no')","constraint":". >= 15"},"type":"integer","name":"age","label":{"English":"Age (years)","Roman Urdu":"Umar (saal)"}},{"bind":{"calculate":"if(selected(${birth_date_known}, 'yes'), int((${today} - ${birth_date}) div 365), ${age})"},"type":"calculate","name":"calc_age"},{"bind":{"calculate":"format-date (date(${today} - int(${age} * 365.25)), '%Y-%m-%d')"},"type":"calculate","name":"calc_dob"},{"bind":{"calculate":"if(${birth_date_known}='yes', ${birth_date}, ${calc_dob})"},"type":"calculate","name":"dob"},{"bind":{"calculate":"if(${birth_date_known} = 'yes', '0', '1')"},"type":"calculate","name":"dob_estimated"},{"type":"note","name":"birth_date_note","label":{"Roman Urdu":"Tareekh-e-pedaaish: ${dob} (${calc_age} saal)","English":"Date of Birth: ${dob} (${calc_age} years)"}},{"default":"female","bind":{"required":"yes","calculate":"female"},"type":"calculate","name":"gender","label":{"English":"Gender","Roman Urdu":"Jins"}},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Darj karda maaloomaat durust nahi","English":"Invalid data entered"},"constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","name":"father_name","label":{"English":"Father's Name","Roman Urdu":"Waalid ka naam"}},{"bind":{"required":"yes"},"label":{"Roman Urdu":"Kya aap shaadi shuda hain?","English":"Are you married?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"No","English":"No"}}],"name":"marriage"},{"bind":{"jr:constraintMsg":{"Roman Urdu":"Darj karda maaloomaat durust nahi","English":"Invalid data entered"},"relevant":"selected(${marriage}, 'yes')","constraint":"regex(., '^[a-zA-Z\\s\\.\\-]{3,25}$')"},"type":"text","name":"husband_name","label":{"English":"Husband's Name","Roman Urdu":"Shohar ka naam"}},{"bind":{"calculate":"if(${marriage} = 'no', ${father_name}, ${husband_name})"},"type":"calculate","name":"last_name"},{"control":{"appearance":"minimal"},"name":"ethnicity","bind":{"required":"yes"},"label":{"English":"Ethnicity","Roman Urdu":"Qomiat"},"type":"select one","children":[{"instance":{"openmrs_code":"163217AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"sindhi","label":{"Roman Urdu":"Sindhi","English":"Sindhi"}},{"instance":{"openmrs_code":"163219AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"muhajir","label":{"Roman Urdu":"Muhajir","English":"Muhajir"}},{"instance":{"openmrs_code":"163215AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"punjabi","label":{"Roman Urdu":"Punjabi","English":"Punjabi"}},{"instance":{"openmrs_code":"163216AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"pushtuns","label":{"Roman Urdu":"Pushtun","English":"Pushtun"}},{"instance":{"openmrs_code":"163218AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"saraiki","label":{"Roman Urdu":"Saraiki","English":"Saraiki"}},{"instance":{"openmrs_code":"163220AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"balochi","label":{"Roman Urdu":"Balochi","English":"Balochi"}},{"instance":{"openmrs_code":"5622AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"other","label":{"Roman Urdu":"Deegar","English":"Other"}}]},{"bind":{"relevant":"selected(${ethnicity}, 'other')"},"type":"text","name":"ethnicity_other","label":{"Roman Urdu":"Wazaahat karain","English":"Please specify:"}},{"bind":{"required":"yes"},"label":{"Roman Urdu":"Kya aap apnay aglay doray ki yaad-dihani ke liye SMS mausool karna chahti hain?","English":"Are you willing to receive SMS reminders for your next visit?"},"type":"select one","children":[{"instance":{"openmrs_code":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"yes","label":{"Roman Urdu":"Yes","English":"Yes"}},{"instance":{"openmrs_code":"1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"},"name":"no","label":{"Roman Urdu":"No","English":"No"}}],"name":"reminders_approval"},{"bind":{"required":"yes","jr:constraintMsg":{"Roman Urdu":"Phone number 11 hindason par mushtamil aur mundarja zail shakal main hona chahiey: 03*********","English":"Phone number should be 11 digits in the following format: 03*********"},"relevant":"${reminders_approval}='yes'","constraint":"regex(., '^03[0-9]{9}$')"},"type":"text","name":"contact_phone_number","label":{"English":"Mobile Number:","Roman Urdu":"Mobile number:"}},{"control":{"bodyless":true},"type":"group","children":[{"bind":{"readonly":"true()","calculate":"concat('uuid:', uuid())"},"type":"calculate","name":"instanceID"}],"name":"meta"}]} \ No newline at end of file diff --git a/opensrp-core/src/test/resources/form/woman_enrollment/form.xml b/opensrp-core/src/test/resources/form/woman_enrollment/form.xml index ebbd597bbb..ca522a3232 100644 --- a/opensrp-core/src/test/resources/form/woman_enrollment/form.xml +++ b/opensrp-core/src/test/resources/form/woman_enrollment/form.xml @@ -1,1550 +1,211 @@ -
- - -

خواتین انرولمنٹ فارم برائے ٹی ٹی ٹیکاجات - Woman TT Enrollment Form

-