opensrp / opensrp-client-reveal

OpenSRP Client Reveal App
Other
7 stars 8 forks source link

Dynamic Tasking- One cannot load the newly created structures - RVL-1078 #886

Open Naima-Bashir opened 4 years ago

Naima-Bashir commented 4 years ago

login to the app opensrp-reveal-release-6.0.0.RC1.apk
Username: r6test1
Password: Click on Thailand plan eg Dynamic-FI 2020-08-13 R6 Test Reuben Create a new structure and try to load it. Observe the error (image) image

githengi commented 4 years ago

This is due to wrong conditions on the plan. Updating the plan to use correct conditions.

githengi commented 4 years ago

@craigappl I have update the wrong FI plan. This is now working


    {
        "identifier": "8c4a2243-4495-5c8c-8e46-ea9d73dd9054",
        "version": "1",
        "name": "Dynamic-FI-2020-08-13",
        "title": "Dynamic-FI 2020-08-13 R6 Test Reuben",
        "status": "active",
        "date": "2020-08-13",
        "effectivePeriod": {
            "start": "2020-08-13",
            "end": "2020-09-02"
        },
        "useContext": [
            {
                "code": "interventionType",
                "valueCodableConcept": "Dynamic-FI"
            },
            {
                "code": "fiStatus",
                "valueCodableConcept": "A1"
            },
            {
                "code": "fiReason",
                "valueCodableConcept": "Routine"
            },
            {
                "code": "taskGenerationStatus",
                "valueCodableConcept": "False"
            }
        ],
        "jurisdiction": [
            {
                "code": "ab7e1954-0ac8-475e-b70a-e896babdb649"
            }
        ],
        "serverVersion": 1597315012252,
        "goal": [
            {
                "id": "RACD_register_families",
                "description": "Register all families & family members in all residential structures enumerated (100%) within the operational area",
                "priority": "medium-priority",
                "target": [
                    {
                        "measure": "Percent of residential structures with full family registration",
                        "detail": {
                            "detailQuantity": {
                                "value": 100,
                                "comparator": ">=",
                                "unit": "Percent"
                            }
                        },
                        "due": "2020-08-20"
                    }
                ]
            },
            {
                "id": "RACD_Blood_Screening",
                "description": "Visit all residential structures (100%) within a 1 km radius of a confirmed index case and test each registered person",
                "priority": "medium-priority",
                "target": [
                    {
                        "measure": "Number of registered people tested",
                        "detail": {
                            "detailQuantity": {
                                "value": 100,
                                "comparator": ">=",
                                "unit": "Person(s)"
                            }
                        },
                        "due": "2020-08-20"
                    }
                ]
            },
            {
                "id": "RACD_bednet_distribution",
                "description": "Visit 100% of residential structures in the operational area and provide nets",
                "priority": "medium-priority",
                "target": [
                    {
                        "measure": "Percent of residential structures received nets",
                        "detail": {
                            "detailQuantity": {
                                "value": 100,
                                "comparator": ">=",
                                "unit": "Percent"
                            }
                        },
                        "due": "2020-08-20"
                    }
                ]
            },
            {
                "id": "Larval_Dipping",
                "description": "Perform a minimum of three larval dipping activities in the operational area",
                "priority": "medium-priority",
                "target": [
                    {
                        "measure": "Number of larval dipping activities completed",
                        "detail": {
                            "detailQuantity": {
                                "value": 3,
                                "comparator": ">=",
                                "unit": "activit(y|ies)"
                            }
                        },
                        "due": "2020-08-20"
                    }
                ]
            },
            {
                "id": "Mosquito_Collection",
                "description": "Set a minimum of three mosquito collection traps and complete the mosquito collection process",
                "priority": "medium-priority",
                "target": [
                    {
                        "measure": "Number of mosquito collection activities completed",
                        "detail": {
                            "detailQuantity": {
                                "value": 3,
                                "comparator": ">=",
                                "unit": "activit(y|ies)"
                            }
                        },
                        "due": "2020-08-20"
                    }
                ]
            },
            {
                "id": "BCC_Focus",
                "description": "Complete at least 1 BCC activity for the operational area",
                "priority": "medium-priority",
                "target": [
                    {
                        "measure": "BCC Activities Completed",
                        "detail": {
                            "detailQuantity": {
                                "value": 1,
                                "comparator": ">=",
                                "unit": "activit(y|ies)"
                            }
                        },
                        "due": "2020-08-20"
                    }
                ]
            }
        ],
        "action": [
            {
                "identifier": "5bc2b863-9127-5b5b-a7ee-7a52775576e7",
                "prefix": 1,
                "title": "Family Registration",
                "description": "Register all families & family members in all residential structures enumerated (100%) within the operational area",
                "code": "RACD Register Family",
                "timingPeriod": {
                    "start": "2020-08-13",
                    "end": "2020-08-20"
                },
                "reason": "Routine",
                "goalId": "RACD_register_families",
                "subjectCodableConcept": {
                    "text": "Location"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    },
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Register_Structure event is submitted",
                            "expression": "questionnaire = 'Register_Structure'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Structure is residential or type does not exist",
                            "expression": "$this.type.where(id='locationType').exists().not() or $this.type.where(id='locationType').text = 'Residential Structure'"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Family does not exist for structure",
                            "expression": "$this.contained.exists().not()"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Apply to residential structures in Register_Structure questionnaires",
                            "expression": "questionnaire = 'Register_Structure' and $this.item.where(linkId='structureType').answer.value ='Residential Structure'"
                        }
                    }
                ],
                "definitionUri": "family_register.json",
                "type": "create"
            },
            {
                "identifier": "28e7da08-aad7-5c4a-87ad-e955e54bb324",
                "prefix": 2,
                "title": "Blood Screening",
                "description": "Visit all residential structures (100%) within a 1 km radius of a confirmed index case and test each registered person",
                "code": "Blood Screening",
                "timingPeriod": {
                    "start": "2020-08-13",
                    "end": "2020-08-20"
                },
                "reason": "Investigation",
                "goalId": "RACD_Blood_Screening",
                "subjectCodableConcept": {
                    "text": "Person"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    },
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Family Registration or Family Member Registration event is submitted",
                            "expression": "questionnaire = 'Family_Registration' or questionnaire = 'Family_Member_Registration'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Person is older than 5 years or person associated with questionnaire response if older than 5 years",
                            "expression": "($this.is(FHIR.Patient) and $this.birthDate <= today() - 5 'years') or ($this.contained.where(Patient.birthDate <= today() - 5 'years').exists())"
                        }
                    }
                ],
                "definitionUri": "blood_screening.json",
                "type": "create"
            },
            {
                "identifier": "2796fba9-1a0a-54a0-8bc4-31f654094614",
                "prefix": 3,
                "title": "Bednet Distribution",
                "description": "Visit 100% of residential structures in the operational area and provide nets",
                "code": "Bednet Distribution",
                "timingPeriod": {
                    "start": "2020-08-13",
                    "end": "2020-08-20"
                },
                "reason": "Routine",
                "goalId": "RACD_bednet_distribution",
                "subjectCodableConcept": {
                    "text": "Location"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    },
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Family Registration event is submitted",
                            "expression": "questionnaire = 'Family_Registration'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Structure is residential or type does not exist",
                            "expression": "$this.type.where(id='locationType').exists().not() or $this.type.where(id='locationType').text = 'Residential Structure'"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Family exists for structure",
                            "expression": "$this.contained.exists()"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Register structure event submitted for a residential structure",
                            "expression": "questionnaire = 'Register_Structure' and $this.item.where(linkId='structureType').answer.value ='Residential Structure'"
                        }
                    }
                ],
                "definitionUri": "bednet_distribution.json",
                "type": "create"
            },
            {
                "identifier": "14e7ba9b-76d0-504a-b098-effe6c146f95",
                "prefix": 4,
                "title": "Larval Dipping",
                "description": "Perform a minimum of three larval dipping activities in the operational area",
                "code": "Larval Dipping",
                "timingPeriod": {
                    "start": "2020-08-13",
                    "end": "2020-08-20"
                },
                "reason": "Investigation",
                "goalId": "Larval_Dipping",
                "subjectCodableConcept": {
                    "text": "Location"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    },
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Register_Structure event is submitted",
                            "expression": "questionnaire = 'Register_Structure'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Structure is a larval breeding site",
                            "expression": "$this.type.where(id='locationType').text = 'Larval Breeding Site'"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Apply to larval breeding sites in Register_Structure questionnaires",
                            "expression": "questionnaire = 'Register_Structure' and $this.item.where(linkId='structureType').answer.value ='Larval Breeding Site'"
                        }
                    }
                ],
                "definitionUri": "larval_dipping_form.json",
                "type": "create"
            },
            {
                "identifier": "183a1a40-e517-5e0b-ade1-c4a540056706",
                "prefix": 5,
                "title": "Mosquito Collection",
                "description": "Set a minimum of three mosquito collection traps and complete the mosquito collection process",
                "code": "Mosquito Collection",
                "timingPeriod": {
                    "start": "2020-08-13",
                    "end": "2020-08-20"
                },
                "reason": "Investigation",
                "goalId": "Mosquito_Collection",
                "subjectCodableConcept": {
                    "text": "Location"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    },
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Register_Structure event is submitted",
                            "expression": "questionnaire = 'Register_Structure'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Structure is a mosquito collection point",
                            "expression": "$this.type.where(id='locationType').text = 'Mosquito Collection Point'"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Apply to mosquito collection point in Register_Structure questionnaires",
                            "expression": "questionnaire = 'Register_Structure' and $this.item.where(linkId='structureType').answer.value ='Mosquito Collection Point'"
                        }
                    }
                ],
                "definitionUri": "mosquito_collection_form.json",
                "type": "create"
            },
            {
                "identifier": "302b00cc-7817-5663-b7a5-fb053fecc698",
                "prefix": 6,
                "title": "Behaviour Change Communication",
                "description": "Conduct BCC activity",
                "code": "BCC",
                "timingPeriod": {
                    "start": "2020-08-13",
                    "end": "2020-08-20"
                },
                "reason": "Routine",
                "goalId": "BCC_Focus",
                "subjectCodableConcept": {
                    "text": "Jurisdiction"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Jurisdiction type location",
                            "expression": "Location.physicalType.text = 'jdn'"
                        }
                    }
                ],
                "definitionUri": "behaviour_change_communication.json",
                "type": "create"
            }
        ],
        "experimental": false
    }