Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update relevance for informant details and official details in death … #2057

Merged
merged 3 commits into from
Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 82 additions & 5 deletions opensrp-chw/src/crvs/assets/json.form/death_certification.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,14 @@
"openmrs_entity": "concept",
"openmrs_entity_id": "",
"type": "label",
"text": "{{death_certification.step1.informant_fields.text}}"
"text": "{{death_certification.step1.informant_fields.text}}",
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
"key": "informant_name",
Expand All @@ -183,6 +190,13 @@
"v_required": {
"value": "true",
"err": "{{death_certification.step1.mandatory_field.v_required.err}}"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
Expand Down Expand Up @@ -214,6 +228,13 @@
"v_required": {
"value": "true",
"err": "{{death_certification.step1.mandatory_field.v_required.err}}"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
Expand All @@ -223,7 +244,14 @@
"openmrs_entity_id": "",
"label": "{{death_certification.step1.informant_address.label}}",
"hint": "{{death_certification.step1.informant_address.hint}}",
"type": "edit_text"
"type": "edit_text",
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
"key": "informant_phone",
Expand All @@ -236,6 +264,13 @@
"v_numeric": {
"value": "true",
"err": "{{death_certification.step1.informant_phone.v_numeric.err}}"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
Expand All @@ -244,7 +279,14 @@
"openmrs_entity": "concept",
"openmrs_entity_id": "",
"type": "label",
"text": "{{death_certification.step1.official_fields.text}}"
"text": "{{death_certification.step1.official_fields.text}}",
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
"key": "official_name",
Expand All @@ -257,6 +299,13 @@
"v_required": {
"value": "true",
"err": "{{death_certification.step1.mandatory_field.v_required.err}}"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
Expand All @@ -266,7 +315,14 @@
"openmrs_entity_id": "officialId",
"label": "{{death_certification.step1.official_id.label}}",
"hint": "{{death_certification.step1.official_id.hint}}",
"type": "edit_text"
"type": "edit_text",
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
"key": "official_position",
Expand All @@ -279,6 +335,13 @@
"v_required": {
"value": "true",
"err": "{{death_certification.step1.mandatory_field.v_required.err}}"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
Expand All @@ -288,7 +351,14 @@
"openmrs_entity_id": "",
"label": "{{death_certification.step1.official_address.label}}",
"hint": "{{death_certification.step1.official_address.hint}}",
"type": "edit_text"
"type": "edit_text",
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
},
{
"key": "official_number",
Expand All @@ -301,6 +371,13 @@
"v_numeric": {
"value": "true",
"err": "{{death_certification.step1.official_number.v_numeric.err}}"
},
"relevance": {
"rules-engine": {
"ex-rules": {
"rules-file": "death_certification_relevance.yml"
}
}
}
}
]
Expand Down
77 changes: 77 additions & 0 deletions opensrp-chw/src/crvs/assets/rule/death_certification_relevance.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
name: step1_informant_fields
description: informant_fields
priority: 1
condition: "step1_received_death_certificate('Yes') || step1_death_notification_done('Yes')"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This appears to be missing the comparison operation .equals() which breaks the relevance for the informant_fields step in the form.
The label currently doesn't show on the form. Please fix this

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Noted.

actions:
- "isRelevant = true"
---
name: step1_informant_name
description: informant_name
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_informant_relationship
description: informant_relationship
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_informant_address
description: informant_address
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_informant_phone
description: informant_phone
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_official_fields
description: official_fields
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_official_name
description: official_name
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_official_ID
description: official_ID
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_official_position
description: official_position
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_official_address
description: official_address
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"
---
name: step1_official_number
description: official_number
priority: 1
condition: "step1_received_death_certificate.equals('Yes') || step1_death_notification_done.equals('Yes')"
actions:
- "isRelevant = true"