Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page includes sample plan definitions for achieving the dynamic tasking across the platform. These are all considered a work in progress until they are deployed in actual products. Then, we can codify them in other documentation.

Table of Contents

PNC Module Tasks

The PNC module will generate tasks when there is a pregnancy outcome form submitted for a particular child. Then, there are numerous visits which are made by a healthcare worker. Below is a table which shows a sample visit schedule with the logic that we want to define for each visit.

...

  • Trigger on plan activation to identify any children who may already be registered in the system.

    • Create an event for any person in the system that is greater than 48 days old but less than 1 year.

    • Do not create a duplicate task if there is already a Day 49 visit task in the system for that person.

  • Trigger on event submission when a birth outcome event is created

    • Check to see if the DOB is before today minus 49 days. So, if today is 1 Oct 2020, the DOB must be earlier than 13 Aug 2020.

    • Check to see if there is a task already created for the Day 49 visit for this patient. Do not create a duplicate task.

  • Trigger on event submission when a Day 28 visit is created.

    • Check to see if there is a task already created for the Day 49 visit for this patient. Do not create a duplicate task.

Sample Plan

This section includes a sample plan

Code Block
languagejs
{
  "identifier": "86d6afc1-a20a-49ca-9b4c-467b7ee2aeeb",
  "version": "1",
  "name": "Sample_PNC_Plan_Template",
  "title": "Sample PNC Plan Template",
  "status": "active",
  "date": "2020-10-20",
  "effectivePeriod": {
    "start": "2020-10-20",
    "end": "2021-10-19"
  },
  "useContext": [
    {
      "code": "interventionType",
      "valueCodableConcept": "Linked-PNC"
    },
    {
      "code": "taskGenerationStatus",
      "valueCodableConcept": "internal"
    }
  ],
  "jurisdiction": [
    {
      "code": "ce13e7f4-6926-4be0-9117-519bd1cc4bb2"
    }
  ],
  "goal": [
    {
      "id": "Day_2_Visit",
      "description": "Complete the Day 2 Visit form for each child.",
      "priority": "medium-priority",
      "target": [
        {
          "measure": "Percent of children with completed Day 2 Visit form completed.",
          "detail": {
            "detailQuantity": {
              "value": 80,
              "comparator": ">=",
              "unit": "Percent"
            }
          },
          "due": "2021-10-19"
        }
      ]
    },
    {
      "id": "Day_3_Visit",
      "description": "Complete the Day 3 Visit form for each child.",
      "priority": "medium-priority",
      "target": [
        {
          "measure": "Percent of children with completed Day 3 Visit form completed.",
          "detail": {
            "detailQuantity": {
              "value": 80,
              "comparator": ">=",
              "unit": "Percent"
            }
          },
          "due": "2021-10-19"
        }
      ]
    },
    {
      "id": "Day_14_Visit",
      "description": "Complete the Day 14 Visit form for each child.",
      "priority": "medium-priority",
      "target": [
        {
          "measure": "Percent of children with completed Day 14 Visit form completed.",
          "detail": {
            "detailQuantity": {
              "value": 80,
              "comparator": ">=",
              "unit": "Percent"
            }
          },
          "due": "2021-10-19"
        }
      ]
    },
    {
      "id": "Day_21_Visit",
      "description": "Complete the Day 21 Visit form for each child.",
      "priority": "medium-priority",
      "target": [
        {
          "measure": "Percent of children with completed Day 21 Visit form completed.",
          "detail": {
            "detailQuantity": {
              "value": 80,
              "comparator": ">=",
              "unit": "Percent"
            }
          },
          "due": "2021-10-19"
        }
      ]
    },
    {
      "id": "Day_28_Visit",
      "description": "Complete the Day 28 Visit form for each child.",
      "priority": "medium-priority",
      "target": [
        {
          "measure": "Percent of children with completed Day 28 Visit form completed.",
          "detail": {
            "detailQuantity": {
              "value": 80,
              "comparator": ">=",
              "unit": "Percent"
            }
          },
          "due": "2021-10-19"
        }
      ]
    },
    {
      "id": "Day_49_Visit",
      "description": "Complete the Day 49 Visit form for each child.",
      "priority": "medium-priority",
      "target": [
        {
          "measure": "Percent of children with completed Day 49 Visit forms completed.",
          "detail": {
            "detailQuantity": {
              "value": 80,
              "comparator": ">=",
              "unit": "Percent"
            }
          },
          "due": "2021-10-19"
        }
      ]
    }
  ],
  "action": [
    {
      "identifier": "7c88b1f2-9c87-4a91-8a5b-0b5a7ed19c96",
      "prefix": 1,
      "title": "Day 2 Visit",
      "description": "Complete the Day 2 Visit form for each child.",
      "code": "Day 2 Visit",
      "timingPeriod": {
        "start": "2020-10-20",
        "end": "2021-10-19"
      },
      "reason": "Routine",
      "goalId": "Day_2_Visit",
      "subjectCodableConcept": {
        "text": "Person"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "plan-activation"
        },
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Pregnancy_Outcome or Family_Member_Registration event is submitted",
            "expression": "questionnaire = 'Pregnancy_Outcome' or questionnaire = 'Family_Member_Registration'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Person is 0 to 2 days old",
            "expression": "($this.is(FHIR.Patient) and $this.birthDate >= today() - 2 'days') or ($this.contained.where(Patient.birthDate >= today() - 2 'days').exists())"
          }
        }
      ],
      "definitionUri": "pnc_visit_form.json",
      "type": "create"
    },
    {
      "identifier": "f30acf5c-a894-4aa8-b032-8bf7b9dd2ab7",
      "prefix": 2,
      "title": "Day 3 Visit",
      "description": "Complete the Day 3 Visit form for each child.",
      "code": "Day 3 Visit",
      "timingPeriod": {
        "start": "2020-10-20",
        "end": "2021-10-19"
      },
      "reason": "Routine",
      "goalId": "Day_3_Visit",
      "subjectCodableConcept": {
        "text": "Person"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "plan-activation"
        },
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Pregnancy_Outcome, Family_Member_Registration, or PNC_Visit_Form event is submitted",
            "expression": "questionnaire = 'Pregnancy_Outcome' or questionnaire = 'Family_Member_Registration' or questionnaire = 'PNC_VISIT_FORM'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Person is 3 to 13 days old",
            "expression": "($this.is(FHIR.Patient) and $this.birthDate <= today() - 3 'days' and $this.birthDate >= today() - 13 'days') or ($this.contained.where(Patient.birthDate <= today() - 3 'days' and Patient.birthDate >= today() - 13 'days').exists())"
          }
        }
      ],
      "definitionUri": "pnc_visit_form.json",
      "type": "create"
    },
    {
      "identifier": "610b6e14-2098-47f9-84e9-1b97c23e9bd1",
      "prefix": 3,
      "title": "Day 14 Visit",
      "description": "Complete the Day 14 Visit form for each child.",
      "code": "Day 14 Visit",
      "timingPeriod": {
        "start": "2020-10-20",
        "end": "2021-10-19"
      },
      "reason": "Routine",
      "goalId": "Day_14_Visit",
      "subjectCodableConcept": {
        "text": "Person"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "plan-activation"
        },
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Pregnancy_Outcome, Family_Member_Registration, or PNC_Visit_Form event is submitted",
            "expression": "questionnaire = 'Pregnancy_Outcome' or questionnaire = 'Family_Member_Registration' or questionnaire = 'PNC_VISIT_FORM'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Person is 14 to 20 days old",
            "expression": "($this.is(FHIR.Patient) and $this.birthDate <= today() - 14 'days' and $this.birthDate >= today() - 20 'days') or ($this.contained.where(Patient.birthDate <= today() - 14 'days' and Patient.birthDate >= today() - 20 'days').exists())"
          }
        }
      ],
      "definitionUri": "pnc_visit_form.json",
      "type": "create"
    },
    {
      "identifier": "073e5eb1-5212-4526-9fad-40116bb7e84f",
      "prefix": 4,
      "title": "Day 21 Visit",
      "description": "Complete the Day 21 Visit form for each child.",
      "code": "Day 21 Visit",
      "timingPeriod": {
        "start": "2020-10-20",
        "end": "2021-10-19"
      },
      "reason": "Routine",
      "goalId": "Day_21_Visit",
      "subjectCodableConcept": {
        "text": "Person"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "plan-activation"
        },
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Pregnancy_Outcome, Family_Member_Registration, or PNC_Visit_Form event is submitted",
            "expression": "questionnaire = 'Pregnancy_Outcome' or questionnaire = 'Family_Member_Registration' or questionnaire = 'PNC_VISIT_FORM'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Person is 21 to 27 days old",
            "expression": "($this.is(FHIR.Patient) and $this.birthDate <= today() - 21 'days' and $this.birthDate >= today() - 27 'days') or ($this.contained.where(Patient.birthDate <= today() - 21 'days' and Patient.birthDate >= today() - 27 'days').exists())"
          }
        }
      ],
      "definitionUri": "pnc_visit_form.json",
      "type": "create"
    },
    {
      "identifier": "605ce7e7-f5bc-4849-95c6-6998bc44e6e1",
      "prefix": 5,
      "title": "Day 28 Visit",
      "description": "Complete the Day 28 Visit form for each child.",
      "code": "Day 28 Visit",
      "timingPeriod": {
        "start": "2020-10-20",
        "end": "2021-10-19"
      },
      "reason": "Routine",
      "goalId": "Day_28_Visit",
      "subjectCodableConcept": {
        "text": "Person"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "plan-activation"
        },
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Pregnancy_Outcome, Family_Member_Registration, or PNC_Visit_Form event is submitted",
            "expression": "questionnaire = 'Pregnancy_Outcome' or questionnaire = 'Family_Member_Registration' or questionnaire = 'PNC_VISIT_FORM'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Person is 28 to 48 days old",
            "expression": "($this.is(FHIR.Patient) and $this.birthDate <= today() - 28 'days' and $this.birthDate >= today() - 48 'days') or ($this.contained.where(Patient.birthDate <= today() - 28 'days' and Patient.birthDate >= today() - 48 'days').exists())"
          }
        }
      ],
      "definitionUri": "pnc_visit_form.json",
      "type": "create"
    },
    {
      "identifier": "7c2746f5-9aed-43f6-926a-c30af62b2001",
      "prefix": 6,
      "title": "Day 49 Visit",
      "description": "Complete the Day 49 Visit form for each child.",
      "code": "Day 49 Visit",
      "timingPeriod": {
        "start": "2020-10-20",
        "end": "2021-10-19"
      },
      "reason": "Routine",
      "goalId": "Day_49_Visit",
      "subjectCodableConcept": {
        "text": "Person"
      },
      "trigger": [
        {
          "type": "named-event",
          "name": "plan-activation"
        },
        {
          "type": "named-event",
          "name": "event-submission",
          "expression": {
            "description": "Trigger when a Pregnancy_Outcome, Family_Member_Registration, or PNC_Visit_Form event is submitted",
            "expression": "questionnaire = 'Pregnancy_Outcome' or questionnaire = 'Family_Member_Registration' or questionnaire = 'PNC_VISIT_FORM'"
          }
        }
      ],
      "condition": [
        {
          "kind": "applicability",
          "expression": {
            "description": "Person is  to  days old",
            "expression": "($this.is(FHIR.Patient) and $this.birthDate <= today() - 49 'days') or ($this.contained.where(Patient.birthDate <= today() - 49 'days').exists())"
          }
        }
      ],
      "definitionUri": "pnc_visit_form.json",
      "type": "create"
    }
  ],
  "experimental": false
}

Notes:

  • Action 1 is for the day 2 visit and can be triggered by a family member registration or a birth outcome form is completed

  • Action 6 is for someone who is older than 49 days

Test Cases - Daisy Chain Approach

...