Reminders and Schedules are generated for various services e.g ANC and Child services, Deaths in a country.
For ANC visits, when a pregnant woman is registered she is enrolled for the ANC Visits, Hb Tests and TT doses. Similarly, when a new child is registered, the child is enrolled for various immunizations like BCG, OPV etc.
Some of these reminders are dependent on each other, these in OpenSRP are called, HookedEvents. For example, when the mother does her first ANC Visit, the ANC visit 1 is fulfilled and then the mother is enrolled for the second ANC visit. Therefore, enrollment of the second ANC visit is dependent on the completion if the milestones on the first ANC visit.
The workflow of the reminders happens as follows. For reminders, let us take ANC Registration as an example:
- An ANC Registration form is filled and saved
- The ziggy on the app creates the corresponding mother entity
- The form gets submitted to the server
- The server processes the form and creates the corresponding mother entity on the CouchDB
- The server then enrolls this mother to the list of services like (ANC Visit1, Hb/Test, TT dose)
- The reminders are generated at a stipulated time at the server (4 pm. in case of Dristhi)
- These reminders are pushed to the app the next time the app syncs with the server
- These reminders get displayed in the app with a particular colour which corresponds to how soon is the reminder due
The reminders are colour coded as follows:
- Light Blue – The reminder is in the early window, which means that it is due but not anytime soon
- Dark Blue – The reminder is in the due window, the due date of the reminder/service is close
- Red – The reminder is in the late window, the due date for the reminder/service is already past
This being an example of a HealthSchedule, using the last menstrual period date as the start date, we will have ANC1, ANC2, ANC3 and ANC4 as milestones for this pregnant woman. Using ANC1 visit as an example, the pregnancy registration will schedule alerts for reminding the ANM about the ANC visits; with the alerts scheduled as:
- 1st alert at 0 week
- 2nd alerts at 12 weeks
- 3rd alert at 14 weeks
Consider a DeathRegister that handles info for deaths in a country.
In web system we need a service that is executed everyday at 12am (to prevent server load on peak times)
- Sends an email with CSV of records to data admins with different inconsistencies in data like DeathDate not matching with other data, OR Any symptom not valid for gender or age group
- Do cleanup operations on server
And many more which could be repeated with a fixed delay and fixed repeat delay and this is "RepeatingSchedule"
We have many other registers not directly connected with each other which needs to take decisions based on any Death like ANC/PNC on mother death, Child on foetal / infant death, Crime investigation on Accidental death, TrendResearcher on death by disease etc. We can not maintain logic in a single central point maintain by central developer modifying every-time a new decision is needed based on death. Rather we notify the system with deathEvent and each register implementing Listeners for Death notification would do their work independently. This is "SystemEvent"
Lets say each death has to be enrolled in different types of schedules with different milestones and alert for FieldWorkers like each death notification would lead to an enrollment into schedule starting after 20days of death for a VerbalAutopsy and VA has to be completed within 60days. ANM after contacting relatives needs to fill VA before 60th day as this is MAX timeWindow. Also an accidental death would schedule alerts for Investigation for Opening case and Closing within 2years the last month of 2nd year is the MAX timeWindow for this.
These schedules which have different milestones and different timeWindows with different Alerts are "TrackableSchedule" or "HealthSchedule"
Now there could be different institution Registers in Country which want to get notified or run their logic when a certain timeWindow or milestone alert is notified. For ex: Police wants to get an alert when a case has not been closed until the end of 2nd year of Opening and CrimeResearch Register also want an alert when case has not been closed within 2nd years. There could be 3rd , 4th and 5th Registers which want notification on passing some schedule`s timeWindow. One register dev can not keep adding logic to this. Now we need to hook an event to DeathCaseClosing schedule so that different systems could be alert of certain milestones timeWindows. This would be done by Register dev by implementing a "HookedEvent" with schedule DeathCaseClosing, milestone LastQuarter, and timeWindow MAX.
This site is no longer maintained. Please visit docs.opensrp.io for current documentation.