...
In Version 2.0, OpenSRP server app will be using events/clients data to generate enroll clients into various schedules. The diagram below highlights the hierarchical order of the classes involved in implementing the logic for enrolling, fulfilling, unenrolling clients into/from different milestones based on the events generated from the form submissions and also creating actions/alerts in the couchdb for syncing to the client app.
Anchor |
---|
| Schedule Config Files |
---|
| Schedule Config Files |
---|
|
Schedule Config FilesSince it's events that lead to clients joining schedules, some JSON config files are required to serve as a guide to the EventsRouter class when determining which event leads to a client joining a given schedule and forwarding this event to the respective ScheduleHandler for processing. Authoring a schedule config file mainly involves specifying events, action,reference_date_fields and enrollment/unenrolment/fulfillment_fields that the scheduling logic should look out for in an event to automatically determine which schedule a client quailifies to join, fulfill or unenroll. These fields are questions and answers from the form submissions most of the times in form of OpenMRS concepts. In particular in the events object:
...
Code Block |
---|
language | js |
---|
title | Sample schedule config file |
---|
|
{
"name": "Ante Natal Care - Normal",
"handler": "ANCScheduleHandler",
"events": [
{
"types": ["Pregnancy Surveillance and Registration"],
"pass_logic": "AND",
"enrollment_fields": [
{
"concept": "162942AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"value":"1065AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
}
],
"milestone": "ANC 1",
"reference_date_fields": [
{
"concept": "1427AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA",
"value": "NOT_EMPTY"
}
],
"action": "enroll"
},
{
"types": ["ANC Reminder Visit 1"],
"pass_logic": "AND",
"fulfillment_date_fields": [
{
"field": "eventDate",
"value": "NOT_EMPTY"
}
],
"milestone": "ANC 1",
"action": "fulfill"
}
]
} |
Class | Module | Notes |
---|
ApplicationStartupListener | opensrp-web |
|
EventsListener | opensrp-core |
|
| opensrp-core |
|
Anchor |
---|
| ScheduleHandlers |
---|
| ScheduleHandlers |
---|
| ScheduleHandlers | opensrp-register |
|
HealthSchedulerService | opensrp-core |
|
ScheduleService | opensrp-core |
|
AlertRouter | opensrp-core |
|
ECAlertCreationAction | opensrp-core |
|
ActionService | opensrp-core |
|