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 all commits
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
95 changes: 82 additions & 13 deletions opensrp-chw/src/crvs/assets/json.form/death_certification.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,6 @@
"step1": {
"title": "{{death_certification.step1.title}}",
"fields": [
{
"key": "death_certificate_fields",
"openmrs_entity_parent": "",
"openmrs_entity": "concept",
"openmrs_entity_id": "",
"type": "label",
"text": "{{death_certification.step1.death_certificate_fields.text}}"
},
{
"key": "received_death_certificate",
"openmrs_entity_parent": "",
Expand Down Expand Up @@ -170,7 +162,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 +182,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 +220,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 +236,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 +256,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 +271,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 +291,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 +307,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 +327,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 +343,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 +363,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.equals('Yes') || step1_death_notification_done.equals('Yes')"
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"