Versions Compared

Key

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

...

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 Files

Since 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
languagejs
titleSample 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"
                        }
                    ]
    
}




ClassModuleNotes
ApplicationStartupListeneropensrp-web
EventsListeneropensrp-core

Anchor
EventsRouter
EventsRouter
EventsRouter

opensrp-core

Anchor
ScheduleHandlers
ScheduleHandlers
ScheduleHandlers

opensrp-register
HealthSchedulerServiceopensrp-core
ScheduleServiceopensrp-core
AlertRouteropensrp-core
ECAlertCreationActionopensrp-core
ActionServiceopensrp-core