opensrp / opensrp-client-eusm

OpenSRP client for EUSM
Other
0 stars 1 forks source link

Update Plan Definition Actions template #74

Closed bennsimon closed 3 years ago

bennsimon commented 3 years ago

Kindly update the current plan definition template with the following:

 "action": [
    {
      "identifier": "5d97ae76-1896-5767-9818-685d64f90914",
      "prefix": 1,
      "title": "Product Check",
      "description": "Check for all products (100%) within the jurisdiction",
      "code": "product_check",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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)"
          }
        }
      ],
      "definitionUri": "product_check.json",
      "dynamicValue": [
        {
          "path": "structureId",
          "expression": {
            "expression": "$this.entry.resource.as(Device).location.reference.substring(9)"
          }
        }
      ],
      "type": "create"
    },
    {
      "identifier": "4d41ef52-37c0-5a70-b673-c244d3f80ba1",
      "prefix": 2,
      "title": "Complete Looks Good",
      "description": "Complete full check for product",
      "code": "looks_good",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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": "734c1341-7967-5ac6-854f-c12613fbb3f2",
      "prefix": 3,
      "title": "Complete Fix problem task",
      "description": "Completes Fix problem task",
      "code": "complete_fix_problem",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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": "34327b0b-6574-5ebf-a778-a2ed961564b4",
      "prefix": 4,
      "title": "Complete Flag Problem",
      "description": "Completes Flag problem task",
      "code": "complete_flag_problem",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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": "78827fa2-9fcf-5775-8796-4357205653e2",
      "prefix": 5,
      "title": "Fix Problem",
      "description": "Fix problems for all products (100%) within the jurisdiction",
      "code": "fix_problem",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "reason": "Routine",
      "goalId": "fix_problem",
      "subjectCodableConcept": {
        "text": "Device"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Fix Product event is submitted",
            "expression": "questionnaire = 'flag_problem'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Product exists",
            "expression": "$this.is(FHIR.QuestionnaireResponse)"
          }
        }
      ],
      "definitionUri": "fix_problem.json",
      "type": "create"
    },
    {
      "identifier": "20e177d7-2720-55ee-912b-21d1ab60d775",
      "prefix": 6,
      "title": "Record GPS",
      "description": "Record GPS for all service points (100%) without GPS within the jurisdiction",
      "code": "record_gps",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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()"
          }
        }
      ],
      "definitionUri": "record_gps.json",
      "dynamicValue": [
        {
          "path": "structureId",
          "expression": {
            "expression": "$this.id"
          }
        }
      ],
      "type": "create"
    },
    {
      "identifier": "9d4afeed-9c91-5cef-974e-358e667e82f5",
      "prefix": 7,
      "title": "Complete Record GPS",
      "description": "Completes Record GPS activity for structure",
      "code": "complete_record_gps",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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": "4d296c2a-ddfb-5763-9998-34fe4233b4bd",
      "prefix": 8,
      "title": "Service Point Check",
      "description": "Conduct checks for all service point (100%) within the Jurisdiction",
      "code": "service_point_check",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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()"
          }
        }
      ],
      "definitionUri": "service_point_check.json",
      "dynamicValue": [
        {
          "path": "structureId",
          "expression": {
            "expression": "$this.id"
          }
        }
      ],
      "type": "create"
    },
    {
      "identifier": "a140a4e7-ce84-57c3-979f-3c01ed7c9b2b",
      "prefix": 9,
      "title": "Complete Service Point Check",
      "description": "Completes Service Point Check",
      "code": "complete_service_point_check",
      "timingPeriod": {
        "start": "2021-06-21",
        "end": "2021-06-28"
      },
      "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"
    }
  ]