Skip to content

Commit

Permalink
Merge pull request #382 from OpenSRP/anc_hv_datepicker
Browse files Browse the repository at this point in the history
ANC Home Visit Date Picker
  • Loading branch information
rkodev authored Jun 11, 2019
2 parents 0a54ffd + f77ddc2 commit 26968c9
Show file tree
Hide file tree
Showing 53 changed files with 1,703 additions and 147 deletions.
2 changes: 1 addition & 1 deletion opensrp-chw/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ dependencies {
exclude group: 'com.android.support', module: 'appcompat-v7'
}

implementation('org.smartregister:opensrp-client-chw-anc:0.0.1-SNAPSHOT@aar') {
implementation('org.smartregister:opensrp-client-chw-anc:0.0.4-SNAPSHOT@aar') {
transitive = true
exclude group: 'org.smartregister', module: 'opensrp-client-core'
exclude group: 'com.android.support', module: 'appcompat-v7'
Expand Down
7 changes: 7 additions & 0 deletions opensrp-chw/src/ba/assets/ec_client_classification.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@
"creates_case": [
"ec_anc_register"
]
},
{
"field": "eventType",
"field_value": "ANC Home Visit",
"creates_case": [
"ec_anc_register"
]
}
]
}
Expand Down
16 changes: 16 additions & 0 deletions opensrp-chw/src/ba/assets/ec_client_fields.json
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,22 @@
"field": "obs.fieldCode",
"concept": "1054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
},
{
"column_name": "last_home_visit",
"type": "Event",
"json_mapping": {
"field": "obs.fieldCode",
"concept": "anc_visit_date"
}
},
{
"column_name": "visit_not_done",
"type": "Event",
"json_mapping": {
"field": "obs.fieldCode",
"concept": "anc_visit_not_done_date"
}
}
]
}
Expand Down
152 changes: 128 additions & 24 deletions opensrp-chw/src/ba/assets/json.form/anc_member_registration.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
"openmrs_entity": "concept",
"openmrs_entity_id": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"type": "date_picker",
"label_info_title": "LMP",
"label_info_text": "First day of Last Menstrual Period. If the exact date is unknown, but the period of the month is known, use day 5 for beginning of the month, day 15 for middle of the month and day 25 for end of the month.",
"hint": "Last Menstrual Period (LMP)",
"label_info_title": "LMP",
"label_info_text": "LMP = first day of Last Menstrual Period. If the exact date is unknown, but the period of the month is known, use day 5 for beginning of the month, day 15 for middle of the month and day 25 for end of the month.",
"expanded": false,
"duration": {
"label": "lmp"
Expand All @@ -68,6 +68,22 @@
"err": "LMP required"
}
},
{
"key": "gest_age_note",
"openmrs_entity_parent": "",
"openmrs_entity": "",
"openmrs_entity_id": "",
"type": "edit_text",
"hint": "Gestational Age (GA)",
"read_only": true,
"calculation": {
"rules-engine": {
"ex-rules": {
"rules-file": "anc_member_registration_calculation.yml"
}
}
}
},
{
"key": "gest_age",
"openmrs_entity_parent": "",
Expand All @@ -87,7 +103,9 @@
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "5596AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"type": "hidden",
"type": "edit_text",
"hint": "Expected Date of Delivery (EDD)",
"read_only": true,
"calculation": {
"rules-engine": {
"ex-rules": {
Expand All @@ -99,8 +117,8 @@
{
"key": "no_prev_preg",
"openmrs_entity_parent": "",
"openmrs_entity": "",
"openmrs_entity_id": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "no_prev_preg",
"type": "edit_text",
"edit_type": "number",
"hint": "No. of previous pregnancies",
Expand All @@ -114,7 +132,7 @@
},
"v_min": {
"value": "0",
"err": "Age must be equal or greater than 0"
"err": "Number must be equal or greater than 0"
}
},
{
Expand All @@ -131,6 +149,27 @@
}
}
},
{
"key": "delivery_method",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "5630AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"openmrs_data_type": "select one",
"type": "spinner",
"hint": "Have you delivered your child(ren) vaginally or by ceasarian section?",
"v_required": {
"value": "true",
"err": "Please select one option"
},
"values": [
"Vaginally",
"Caesarian section"
],
"openmrs_choice_ids": {
"Vaginally": "1170AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Caesarian section": "1171AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
},
{
"key": "no_surv_children",
"openmrs_entity_parent": "",
Expand All @@ -152,13 +191,40 @@
"err": "Age must be equal or greater than 0"
}
},
{
"key": "marital_status",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "1054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"openmrs_data_type": "select one",
"type": "spinner",
"hint": "Marital status",
"v_required": {
"value": "true",
"err": "Please select one option"
},
"values": [
"Married",
"Co-habiting",
"Single"
],
"openmrs_choice_ids": {
"Married": "5555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Co-habiting": "1060AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Single": "5615AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
},
{
"key": "phone_number",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"type": "edit_text",
"hint": "Phone number",
"v_required": {
"value": true,
"err": "Please specify the phone number"
},
"v_numeric": {
"value": "true",
"err": "Number must be a total of 10 digits in length"
Expand All @@ -170,36 +236,74 @@
"v_required": {
"value": false,
"err": "Please specify the phone number"
}
},
{
"key": "person_assist",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "159771AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"openmrs_data_type": "select one",
"type": "spinner",
"hint": "Does the mother have anyone, 18 years or older, who would be able to assist her during her pregnancy?",
"v_required": {
"value": "true",
"err": "Please select one option"
},
"values": [
"Yes",
"No"
],
"openmrs_choice_ids": {
"Yes": "1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"No": "1066AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
},
{
"key": "name_person_assist",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "160638AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"type": "edit_text",
"hint": "Name of close person/relative who lives with her and is 18 years or olders",
"edit_type": "name",
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "family_member_relevance.yml"
"rules-file": "anc_member_registration_relevance.yml"
}
}
},
"v_required": {
"value": "true",
"err": "Please enter the family name"
}
},
{
"key": "marital_status",
"key": "phone_person_assist",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "1054AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"openmrs_data_type": "select one",
"type": "spinner",
"hint": "Marital status",
"values": [
"Married",
"Co-habiting",
"Single"
],
"openmrs_choice_ids": {
"Married": "5555AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Co-habiting": "1060AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"Single": "5615AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"v_required": {
"value": "true",
"err": "Please select one option"
"openmrs_entity_id": "159635AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"type": "edit_text",
"hint": "Phone number",
"v_required": {
"value": true,
"err": "Please specify the phone number"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "anc_member_registration_relevance.yml"
}
}
},
"v_numeric": {
"value": "true",
"err": "Number must be a total of 10 digits in length"
},
"v_regex": {
"value": "(0[0-9]{9})|\\s*",
"err": "Number must be 10 digits and must start with 0."
}
}
]
Expand Down
44 changes: 44 additions & 0 deletions opensrp-chw/src/ba/assets/rule/anc-home-visit-rules.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
---
name: expiry
description: expire lmp greter than 1 yr
priority: 1
condition: "ancVisitAlertRule.isExpiry()"
actions:
- "ancVisitAlertRule.buttonStatus = 'EXPIRY'"
---
name: visit_not_done
description: press visit not done in this month
priority: 1
condition: "ancVisitAlertRule.isVisitNotDone()"
actions:
- "ancVisitAlertRule.buttonStatus = 'NOT_VISIT_THIS_MONTH'"
---
name: visit_twenty_four
description: visit within twenty four hours
priority: 2
condition: "ancVisitAlertRule.isVisitWithinTwentyFour()"
actions:
- "ancVisitAlertRule.buttonStatus = 'LESS_TWENTY_FOUR'"
---
name: visit_this_month
description: visit grether than 24 hours but within this month
priority: 3
condition: "ancVisitAlertRule.isVisitWithinThisMonth()"
actions:
- "ancVisitAlertRule.buttonStatus = 'VISIT_THIS_MONTH'"
---
name: overdue
description: previous month not visited
priority: 2
condition: "ancVisitAlertRule.isOverdueWithinMonth(1)"
actions:
- "ancVisitAlertRule.buttonStatus = 'OVERDUE'"
---
name: due
description: due first day of month and same month
priority: 3
condition: "ancVisitAlertRule.isDueWithinMonth()"
actions:
- "ancVisitAlertRule.buttonStatus = 'DUE'"


Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,14 @@ condition: "true"
actions:
- "calculation = (helper.getDifferenceDays(step1_last_menstrual_period)-helper.getDifferenceDays(helper.getDateToday())) /7"

---
name: step1_gest_age_note
description: Gestational age calculated
priority: 1
condition: "true"
actions:
- "calculation = step1_gest_age + ' weeks'"

---
name: step1_edd
description: Edd calculated
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
name: step1_name_person_assist
description: assist person relevance
priority: 1
condition: "step1_person_assist == 'Yes'"
actions:
- "isRelevant = true"
---
name: step1_phone_person_assist
description: assist person phone number relevance
priority: 1
condition: "step1_person_assist == 'Yes'"
actions:
- "isRelevant = true"
Loading

0 comments on commit 26968c9

Please sign in to comment.