The BA project requires the ability to generate referrals in the CHW application and have those synchronized to the health facility application.
This section defines the high level workflow for generating referrals in the CHW application, syncing and to the server, viewing the task in the Facility application and closing the loop.Additional details and mock-ups have been created by the BA team.
Constraints
Steps:
The core of this innovation is a relationship between events, tasks and entities in the Android client. These relationships are important in both the Android client and OpenSRP server. Note that Reveal includes a location component that's not critical in this case, so the implementation may be slightly different. (Reference the definitions above for more information) This section defines the relationship and impact of each component of the data model.
The Reveal team implemented a task state machine in the Android client. We need to implement the same in OpenSRP for the BA project. Below is a representation of that state machine, which is a number of processes that update the state of tasks. We don't need to implement all states in the Android client for this project.
{ "identifier": "UUID()", "planIdentifier": "", "groupIdentifier": "healthFacilityLocation", "status": "Ready", "businessStatus": "Not Visited", "priority": 3, "code": "referralType", "description": "referralDescription", "focus": "", "for": "patientBaseEntityId", "executionStartDate": "now()", "executionEndDate": "now() + 7 days", "reasonReference": "referralFormEventId", "owner": "username", "note": null, "serverVersion": 0 } |
Name | Description | Type | Choices | Calculation | Constraint(s) | Required | Editable? |
---|---|---|---|---|---|---|---|
identifier | This is a globally unique id (GUID) of the task | String | Hidden | Yes | No | ||
planIdentifier | This is the GUID of the plan related to this task (We will not use this for BA) | String | Hidden | No | No | ||
groupIdentifier | This is the location id of the facility where the task is assigned | String | Hidden | Yes | No | ||
status | This is the status of the task | select_one | "Draft", "Ready", "Cancelled", "In Progress", "Completed", "Failed" | Default Value = "Ready" | Yes | Yes | |
businessStatus | This is the business status of the task that's displayed in the UI | String | "Referred", "In-Progress", "Complete", "Expired" | Default Value = "Referred" | Yes | Yes | |
priority | This is the priority of the task (1 being low priority, 5 being high priority) | select_one | "1","2","3","4","5" | Default value = "3" | Yes | Yes | |
code | This is the type of task and is dependent on the intervention | select_one | "Referral" | Default value = "Referral" | Yes | Yes | |
description | This is a human readable description of the task | string | Default value = "Review and perform the referral for the client" | No | Yes | ||
focus | This is the type of referral that needs to be done | select_one | "Sick Child", "Suspected Malaria", "Pregnancy Test or Confirmation", "ANC Danger Signs","PNC Danger Signs","FP initiation","Home Birth","Woman in Labour" | Yes | Yes | ||
for | This is the target entity that benefits from the task. (i.e. patient baseEntityId) | String | Yes | Yes | |||
executionStartDate | Start dateTime for the executionPeriod | dateTime | No | Yes | |||
executionEndDate | End dateTime for the executionPeriod | dateTime | No | Yes | |||
reasonReference | This is the id of the form that was submitted that kicked off this task. This is used to link to the referral that was generated | UUID | No | No | |||
authoredOn | This is the dateTime that the task was created | dateTime | Yes | No | |||
lastModified | This is a dateTime that the task was last modified | dateTime | Yes | No | |||
owner | This is the Username of the person who generated this task | string | Yes | Yes | |||
note | This is a repeating group that allows users to keep notes on the status of a task over time. | Repeating Group | No | Yes | |||
note.authorString | This is the username of the user who authored the note | String | Hidden | Yes | No | ||
note.time | This is the dateTime the note was added | dateTime | Hidden | Yes | No | ||
note.text | This is the text content of the note | String (may include paragraphs) | Yes | Yes |
We need to create a plan in the system to be able to link tasks to particular actions within the plan.
{ "identifier": "${UUID()}", "version": "1", "name": "baCatchAllReferral Plan", "title": "BA Catch All Referral Plan", "status": "active", "date": "2019-08-06", "effectivePeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "jurisdiction": [ { "code": "UUID_OF_FACILITY_1" }, { "code": "UUID_OF_FACILITY_2" }, { "code": "UUID_OF_FACILITY_3" }, { "code": "UUID_OF_FACILITY_4" }, { "code": "UUID_OF_FACILITY_5" } ], "serverVersion": 0, "goal": [ { "id": "sickChildReferralGoal", "description": "Sick Child Referral Goal", "priority": "medium-priority", "target": [ { "measure": "Percent of referrals closed", "detail": { "detailQuantity": { "value": 80, "comparator": ">=", "unit": "Percent" } }, "due": "2020-08-06" } ] }, { "id": "suspectedMalariaReferralGoal", "description": "Suspected Malaria Referral Goal", "priority": "medium-priority", "target": [ { "measure": "Percent of referrals closed", "detail": { "detailQuantity": { "value": 80, "comparator": ">=", "unit": "Percent" } }, "due": "2020-08-06" } ] }, { "id": "pregnancyTestReferralGoal", "description": "Pregnancy Test Referral Goal", "priority": "medium-priority", "target": [ { "measure": "Percent of referrals closed", "detail": { "detailQuantity": { "value": 80, "comparator": ">=", "unit": "Percent" } }, "due": "2020-08-06" } ] }, { "id": "ancDangerSignsReferralGoal", "description": "ANC Danger Signs Referral Goal", "priority": "medium-priority", "target": [ { "measure": "Percent of referrals closed", "detail": { "detailQuantity": { "value": 80, "comparator": ">=", "unit": "Percent" } }, "due": "2020-08-06" } ] }, { "id": "pncDangerSignsReferralGoal", "description": "PNC Danger Signs Referral Goal", "priority": "medium-priority", "target": [ { "measure": "Percent of referrals closed", "detail": { "detailQuantity": { "value": 80, "comparator": ">=", "unit": "Percent" } }, "due": "2020-08-06" } ] }, { "id": "fpInitiationReferralGoal", "description": "Family Planning Referral Goal", "priority": "medium-priority", "target": [ { "measure": "Percent of referrals closed", "detail": { "detailQuantity": { "value": 80, "comparator": ">=", "unit": "Percent" } }, "due": "2020-08-06" } ] } ], "action": [ { "identifier": "${UUID()}", "prefix": 1, "title": "Sick Child Referral", "description": "Receive referral, perform patient action and close it", "code": "Referral", "timingPeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "reason": "Sick Child", "goalId": "sickChildReferralGoal", "subjectCodableConcept": { "text": "Referral" }, "taskTemplate": "Referral" }, { "identifier": "${UUID()}", "prefix": 2, "title": "Suspected Malaria Referral", "description": "Receive referral, perform patient action and close it", "code": "Referral", "timingPeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "reason": "Suspected Malaria", "goalId": "suspectedMalariaReferralGoal", "subjectCodableConcept": { "text": "Referral" }, "taskTemplate": "Referral" }, { "identifier": "${UUID()}", "prefix": 3, "title": "Pregnancy Test or Confirmation Referral", "description": "Receive referral, perform patient action and close it", "code": "Referral", "timingPeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "reason": "Pregnancy Test", "goalId": "pregnancyTestReferralGoal", "subjectCodableConcept": { "text": "Referral" }, "taskTemplate": "Referral" }, { "identifier": "${UUID()}", "prefix": 4, "title": "ANC Danger Signs Referral", "description": "Receive referral, perform patient action and close it", "code": "Referral", "timingPeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "reason": "ANC Danger Signs", "goalId": "ancDangerSignsReferralGoal", "subjectCodableConcept": { "text": "Referral" }, "taskTemplate": "Referral" }, { "identifier": "${UUID()}", "prefix": 5, "title": "PNC Danger Signs Referral", "description": "Receive referral, perform patient action and close it", "code": "Referral", "timingPeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "reason": "PNC Danger Signs", "goalId": "pncDangerSignsReferralGoal", "subjectCodableConcept": { "text": "Referral" }, "taskTemplate": "Referral" }, { "identifier": "${UUID()}", "prefix": 6, "title": "Family Planning Initiation Referral", "description": "Receive referral, perform patient action and close it", "code": "Referral", "timingPeriod": { "start": "2019-08-07", "end": "2020-08-06" }, "reason": "Family Planning Initiation", "goalId": "fpInitiationReferralGoal", "subjectCodableConcept": { "text": "Referral" }, "taskTemplate": "Referral" } ] } |
This section defines the software that needs to be developed to realize this feature. I have broken this down into a set of features that need to be implemented in the CHW app, the health facility app and the OpenSRP server. This section does not include reporting.
We need to develop the following core features.
This section defines the views that are impacted and the core data elements that define these views.
Row 1: (Given Name) (Family Name), (Age) (DateTime)
Row 2: (Referral Reason)
Row 3: Referred by CHW (CHW Username)
Field | Source | Logic | Example |
---|---|---|---|
Given Name | patient.givenName | The task.for value has the baseEntityId of the person impacted. query the client table and find these person attributes | Charity |
Family Name | patient.familyName | The task.for value has the baseEntityId of the person impacted. query the client table and find these person attributes | Mikulo |
Age | patient.age | The task.for value has the baseEntityId of the person impacted. query the client table and find these person attributes | 22 |
Referral Reason | task.focus | FP Initiation | |
CHW Username | task.owner | jmajufuli | |
DateTime | task.executionStartDate | We need to calculate this field based on the time since the executionStartDate with dynamic values set within the last 24 hours, "Yesterday" or date (This is similar to how we display sync time in multiple OpenSRP apps | 1h ago |