Last active
May 4, 2017 17:42
-
-
Save chathurawidanage/89752188aaee2ff34cf6e58b257c3f4b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.get("http://dhis.pgim.cmb.ac.lk/nss/api/organisationUnits.json?fields=[id,level,name]&filter=level:eq:3").then(function(data){ | |
data.organisationUnits.forEach(function(ou){ | |
$.get("http://dhis.pgim.cmb.ac.lk/nss/api/enrollments.json?ou="+ou.id+"&ouMode=DESCENDANTS&totalPages=true&skipPaging=true&programStatus=ACTIVE&program=MmGml1Gyb7K").then(function(data){ | |
console.log(ou.name+":"+data.enrollments.length); | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment