Skip to content

Commit

Permalink
KP missed validations on required fields and dates (#186)
Browse files Browse the repository at this point in the history
  • Loading branch information
ckote authored Sep 7, 2023
1 parent ebbe48f commit 4ee4244
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
28 changes: 14 additions & 14 deletions configuration/ampathforms/Clinic_visit.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"label": "KP Clinical Visit",
"sections": [
{
"label": "Visit Details",
"label": "Encounter Details",
"isExpanded": "true",
"questions": [
{
Expand Down Expand Up @@ -139,7 +139,7 @@
]
},
"id": "stiScreened",
"required": "Yes"
"required": "true"
},
{
"label": "STI Results",
Expand Down Expand Up @@ -241,7 +241,7 @@
]
},
"id": "tbScreened",
"required": "Yes"
"required": "true"
},
{
"label": "TB Results",
Expand Down Expand Up @@ -448,7 +448,7 @@
]
},
"id": "hepcScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Hepatitis C Results",
Expand Down Expand Up @@ -550,7 +550,7 @@
]
},
"id": "overdoseScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Overdose management Results",
Expand Down Expand Up @@ -675,7 +675,7 @@
]
},
"id": "abscessScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Abscess Results",
Expand Down Expand Up @@ -777,7 +777,7 @@
]
},
"id": "alcoholScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Alcohol and drug abuse Results",
Expand Down Expand Up @@ -882,7 +882,7 @@
"hideWhenExpression": "sex !== 'F'"
},
"id": "cervScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Cervical Cancer Results",
Expand Down Expand Up @@ -988,7 +988,7 @@
]
},
"id": "prepScreened",
"required": "Yes"
"required": "true"
},
{
"label": "PrEP Results",
Expand Down Expand Up @@ -1090,7 +1090,7 @@
]
},
"id": "vioScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Violence exists",
Expand Down Expand Up @@ -1231,7 +1231,7 @@
]
},
"id": "riskScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Risk Reduction Counselling Results",
Expand Down Expand Up @@ -1333,7 +1333,7 @@
]
},
"id": "famScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Family Planning Results",
Expand Down Expand Up @@ -1462,7 +1462,7 @@
]
},
"id": "menScreened",
"required": "Yes"
"required": "true"
},
{
"label": "Mental health Results",
Expand Down Expand Up @@ -1674,7 +1674,7 @@
},
"id": "hivTested",
"validators": [],
"required": "Yes",
"required": "true",
"hide": {
"hideWhenExpression": "isEmpty(hivSettingoflasttest) || hivSettingoflasttest == '1402AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' || isEmpty(hivSelfreportedFacility) || hivSelfreportedFacility == '703AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' "
}
Expand Down
7 changes: 3 additions & 4 deletions configuration/ampathforms/KP_Contact.json
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,6 @@
"label": "Implementation ward",
"type": "obs",
"id": "ward",
"required": "true",
"questionOptions": {
"concept": "161550AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"rendering": "text"
Expand Down Expand Up @@ -607,7 +606,7 @@
},
{
"type": "js_expression",
"failsWhenExpression": "moment(myValue).isBefore(moment(birthdate), 'day')",
"failsWhenExpression": "moment(birthdate).isBefore(moment(myValue), 'day')",
"message": "Should not be less than the date of birth."
}
]
Expand All @@ -626,7 +625,7 @@
},
{
"type": "js_expression",
"failsWhenExpression": "moment(myValue).isBefore(moment(birthdate), 'day')",
"failsWhenExpression": "moment(birthdate).isBefore(moment(myValue), 'day')",
"message": "Should not be less than the date of birth."
}
],
Expand All @@ -648,7 +647,7 @@
},
{
"type": "js_expression",
"failsWhenExpression": "moment(myValue).isBefore(moment(birthdate), 'day')",
"failsWhenExpression": "moment(birthdate).isBefore(moment(myValue), 'day')",
"message": "Should not be less than the date of birth."
}
],
Expand Down

0 comments on commit 4ee4244

Please sign in to comment.