opensrp / opensrp-client-eusm

OpenSRP client for EUSM
Other
0 stars 1 forks source link

Update Plan actions Template #83

Closed bennsimon closed 3 years ago

bennsimon commented 3 years ago
[
            {
                "identifier": "1658008d-57c5-5a87-89d6-eaafd6b94d70",
                "prefix": 1,
                "title": "Product Check",
                "description": "Check for all products (100%) within the jurisdiction",
                "code": "product_check",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "product_check",
                "subjectCodableConcept": {
                    "text": "Device"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Product exists",
                            "expression": "$this.is(FHIR.Bundle)"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Product is active",
                            "expression": "Bundle.entry.resource.ofType(SupplyDelivery).identifier.where(system='isPastAccountabilityDate' and value='false').exists()"
                        }
                    }
                ],
                "definitionUri": "product_check.json",
                "dynamicValue": [
                    {
                        "path": "structureId",
                        "expression": {
                            "expression": "$this.entry.resource.as(Device).location.reference.substring(9)"
                        }
                    }
                ],
                "type": "create"
            },
            {
                "identifier": "4352fe56-f696-5bc2-b8d6-a437faa11ec7",
                "prefix": 2,
                "title": "Complete Looks Good",
                "description": "Complete full check for product",
                "code": "looks_good",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "looks_good",
                "subjectCodableConcept": {
                    "text": "Task"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Looks Good event is submitted",
                            "expression": "questionnaire = 'looks_good'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Product exists",
                            "expression": "$this.is(FHIR.QuestionnaireResponse)"
                        }
                    }
                ],
                "definitionUri": "looks_good.json",
                "dynamicValue": [
                    {
                        "path": "businessStatus",
                        "expression": {
                            "expression": "'Visited'"
                        }
                    },
                    {
                        "path": "status",
                        "expression": {
                            "expression": "'Completed'"
                        }
                    }
                ],
                "type": "update"
            },
            {
                "identifier": "c49d651c-4f06-544c-9e25-cb15c70be17c",
                "prefix": 3,
                "title": "Complete Fix problem task",
                "description": "Completes Fix problem task",
                "code": "complete_fix_problem",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "complete_fix_problem",
                "subjectCodableConcept": {
                    "text": "Task"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Fix Problem event is submitted",
                            "expression": "questionnaire = 'fix_problem'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Problem Fixed",
                            "expression": "$this.is(FHIR.QuestionnaireResponse)"
                        }
                    }
                ],
                "definitionUri": "fix_problem.json",
                "dynamicValue": [
                    {
                        "path": "businessStatus",
                        "expression": {
                            "expression": "'Visited'"
                        }
                    },
                    {
                        "path": "status",
                        "expression": {
                            "expression": "'Completed'"
                        }
                    }
                ],
                "type": "update"
            },
            {
                "identifier": "0048c49f-0552-5408-a57a-8d2574af56a8",
                "prefix": 4,
                "title": "Complete Flag Problem",
                "description": "Completes Flag problem task",
                "code": "complete_flag_problem",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "complete_flag_problem",
                "subjectCodableConcept": {
                    "text": "Task"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Flag Problem event is submitted",
                            "expression": "questionnaire = 'flag_problem'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Problem Flagged",
                            "expression": "$this.is(FHIR.QuestionnaireResponse)"
                        }
                    }
                ],
                "definitionUri": "flag_problem.json",
                "dynamicValue": [
                    {
                        "path": "businessStatus",
                        "expression": {
                            "expression": "'has_problem'"
                        }
                    },
                    {
                        "path": "status",
                        "expression": {
                            "expression": "'Completed'"
                        }
                    }
                ],
                "type": "update"
            },
            {
                "identifier": "1b1abb17-9100-57e6-87ba-403d9280030c",
                "prefix": 6,
                "title": "Record GPS",
                "description": "Record GPS for all service points (100%) without GPS within the jurisdiction",
                "code": "record_gps",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "record_gps",
                "subjectCodableConcept": {
                    "text": "Location.Stock"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Service point does not have geometry",
                            "expression": "Bundle.entry.resource.ofType(Location).identifier.where(system='hasGeometry').value='false'"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Check if service point has stock",
                            "expression": "Bundle.entry.resource.ofType(SupplyDelivery).exists()"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Check if service point has active stock",
                            "expression": "Bundle.entry.resource.ofType(SupplyDelivery).identifier.where(system='isPastAccountabilityDate' and value='false').exists()"
                        }
                    }
                ],
                "definitionUri": "record_gps.json",
                "dynamicValue": [
                    {
                        "path": "structureId",
                        "expression": {
                            "expression": "$this.id"
                        }
                    }
                ],
                "type": "create"
            },
            {
                "identifier": "cd09a413-1b15-5405-a882-fcb999d7ead7",
                "prefix": 7,
                "title": "Complete Record GPS",
                "description": "Completes Record GPS activity for structure",
                "code": "complete_record_gps",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "complete_record_gps",
                "subjectCodableConcept": {
                    "text": "Task"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Record Gps event is submitted",
                            "expression": "questionnaire = 'record_gps'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "GPS recorded",
                            "expression": "$this.is(FHIR.QuestionnaireResponse)"
                        }
                    }
                ],
                "definitionUri": "record_gps.json",
                "dynamicValue": [
                    {
                        "path": "businessStatus",
                        "expression": {
                            "expression": "'Visited'"
                        }
                    },
                    {
                        "path": "status",
                        "expression": {
                            "expression": "'Completed'"
                        }
                    }
                ],
                "type": "update"
            },
            {
                "identifier": "f649c802-ee48-51ee-bcc3-1556e37ed829",
                "prefix": 8,
                "title": "Service Point Check",
                "description": "Conduct checks for all service point (100%) within the Jurisdiction",
                "code": "service_point_check",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "service_point_check",
                "subjectCodableConcept": {
                    "text": "Location.Stock"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "plan-activation"
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "All service points",
                            "expression": "$this.is(FHIR.Bundle)"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Check if service point has stock",
                            "expression": "Bundle.entry.resource.ofType(SupplyDelivery).exists()"
                        }
                    },
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Check if service point has active stock",
                            "expression": "Bundle.entry.resource.ofType(SupplyDelivery).identifier.where(system='isPastAccountabilityDate' and value='false').exists()"
                        }
                    }
                ],
                "definitionUri": "service_point_check.json",
                "dynamicValue": [
                    {
                        "path": "structureId",
                        "expression": {
                            "expression": "$this.id"
                        }
                    }
                ],
                "type": "create"
            },
            {
                "identifier": "9b37ce64-d60d-57de-aa1c-9e62e0c24546",
                "prefix": 9,
                "title": "Complete Service Point Check",
                "description": "Completes Service Point Check",
                "code": "complete_service_point_check",
                "timingPeriod": {
                    "start": "2021-07-24",
                    "end": "2021-07-31"
                },
                "reason": "Routine",
                "goalId": "complete_service_point_check",
                "subjectCodableConcept": {
                    "text": "Task"
                },
                "trigger": [
                    {
                        "type": "named-event",
                        "name": "event-submission",
                        "expression": {
                            "description": "Trigger when a Service Point Check event is submitted",
                            "expression": "questionnaire = 'service_point_check'"
                        }
                    }
                ],
                "condition": [
                    {
                        "kind": "applicability",
                        "expression": {
                            "description": "Service Point Checked",
                            "expression": "$this.is(FHIR.QuestionnaireResponse)"
                        }
                    }
                ],
                "definitionUri": "service_point_check.json",
                "dynamicValue": [
                    {
                        "path": "businessStatus",
                        "expression": {
                            "expression": "'Visited'"
                        }
                    },
                    {
                        "path": "status",
                        "expression": {
                            "expression": "'Completed'"
                        }
                    }
                ],
                "type": "update"
            }
        ]
bennsimon commented 3 years ago

Related goal can be removed.