iupui-soic/mHBS-trainer

create dynamic program to collect enrollments from mhbs

Closed this issue · 4 comments

PLAN B

write a python program to collect enrollmentId's, OrgUnit and enrollment date of enrollees for every week from Monday to Sunday.
Access the scripts from https://docs.dhis2.org/2.30/en/developer/html/webapi_tracker_api.html#webapi_enrollment_management
Step 1:
enrollments associated with a specific organization unit:
/api/29/enrollments.json?ou=DiszpKrYNg8
Step 2:
program enrollment dates as part of the query:
/api/29/enrollments.json?&ou=O6uvpzGd5pu&program=ur1Edk5Oe2n&programStartDate=2013-01-01&programEndDate=2013-09-01
Step 3
{
"enrollments": [
{
"lastUpdated": "2014-03-28T05:27:48.512+0000",
"trackedEntity": "cyl5vuJ5ETQ",
"created": "2014-03-28T05:27:48.500+0000",
"orgUnit": "DiszpKrYNg8",
"program": "ur1Edk5Oe2n",
"enrollment": "HLFOK0XThjr",
"trackedEntityInstance": "qv0j4JBXQX0",
"followup": false,
"enrollmentDate": "2013-05-23T05:27:48.490+0000",
"incidentDate": "2013-05-10T05:27:48.490+0000",
"status": "ACTIVE"
}
]
}

make .csv files and mail to the concerned entities (automatic mails from the program)

add "pin" along with enrollmentId's, OrgUnit and enrollment date

@Premchand95 please upload the python notebook here.

program to get enrollments.txt

Python script to pull enrollments from Mhbs server