iupui-soic / mHBS-trainer

Moved here: https://gitlab.com/librehealth/incubating-projects/mhbs/mHBS-trainer
https://neoinfo.iu.edu
Mozilla Public License 2.0
10 stars 15 forks source link

create dynamic program to collect enrollments from mhbs #182

Closed Premchand95 closed 5 years ago

Premchand95 commented 6 years ago

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)

Premchand95 commented 5 years ago

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

sunbiz commented 5 years ago

@Premchand95 please upload the python notebook here.

Premchand95 commented 5 years ago

python notebook link: https://plhi.us/user/pavaniga/notebooks/program%20to%20get%20enrollments.ipynb

Premchand95 commented 5 years ago

program to get enrollments.txt

Python script to pull enrollments from Mhbs server