Skip to content

Commit

Permalink
endpoints update for DHIS2 v2.35
Browse files Browse the repository at this point in the history
  • Loading branch information
benzerbett committed May 18, 2021
1 parent e33c67c commit 5675141
Show file tree
Hide file tree
Showing 18 changed files with 58 additions and 58 deletions.
8 changes: 4 additions & 4 deletions assets/extra-libs/landing/filter.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ function filterMain(countyid, subcountyid, periodid) {

//load the mos by commodity
// var url = 'https://testhis.uonbi.ac.ke/api/29/analytics.json?dimension=dx:zLR3PBVPgN5;bJILAolJsSJ;jtGNoWcdNcx;p2aNqT2HVyr;Y4O2r9a9QRQ;DUnK0MqACvs;goYRWZ7kJAA;R4VD8EvRxyN&dimension=ou:' + countyid + '&filter=pe:' + periodid + '&displayProperty=NAME&outputIdScheme=UID`;
var url = `https://hiskenya.org/api/26/analytics.json?dimension=pe:'+periodid+'&dimension=dx:HfGVoCZAwtd;nK8sqMAeQHY;ZcngDQJKiEg;wOKbEd8Dbi3;lHPLS1G5CUc;SSARcWY2Ge1;AX1co0SXobM;UUNwkYQhYgX&dimension=ou:'+countyid+'&displayProperty=NAME&outputIdScheme=UID`;
var url = `https://hiskenya.org/api/analytics.json?dimension=pe:'+periodid+'&dimension=dx:HfGVoCZAwtd;nK8sqMAeQHY;ZcngDQJKiEg;wOKbEd8Dbi3;lHPLS1G5CUc;SSARcWY2Ge1;AX1co0SXobM;UUNwkYQhYgX&dimension=ou:'+countyid+'&displayProperty=NAME&outputIdScheme=UID`;
fetchMosbycombox(url);



//% of health facilities
// var urlfa = 'https://testhis.uonbi.ac.ke/api/29/analytics.json?dimension=dx:zLR3PBVPgN5;bJILAolJsSJ;jtGNoWcdNcx;p2aNqT2HVyr;DUnK0MqACvs;goYRWZ7kJAA;R4VD8EvRxyN&dimension=ou:' + countyid + ';LEVEL-5&filter=pe:' + periodid + '&displayProperty=NAME&outputIdScheme=UID`;
var urlfa = `https://hiskenya.org/api/26/analytics.json?dimension=dx:HfGVoCZAwtd;nK8sqMAeQHY;ZcngDQJKiEg;wOKbEd8Dbi3;SSARcWY2Ge1;AX1co0SXobM;UUNwkYQhYgX&dimension=ou:'+countyid+';LEVEL-5&filter=pe:'+periodid+'&displayProperty=NAME&outputIdScheme=UID`;
var urlfa = `https://hiskenya.org/api/analytics.json?dimension=dx:HfGVoCZAwtd;nK8sqMAeQHY;ZcngDQJKiEg;wOKbEd8Dbi3;SSARcWY2Ge1;AX1co0SXobM;UUNwkYQhYgX&dimension=ou:'+countyid+';LEVEL-5&filter=pe:'+periodid+'&displayProperty=NAME&outputIdScheme=UID`;

//define the name holder
var itemnames = ["AL6", "AL12", "AL18", "AL24", "AS inj", "SP tabs", "RDTs"];
Expand All @@ -39,11 +39,11 @@ function filterMain(countyid, subcountyid, periodid) {

//adjc FA
// var urlcon = 'https://testhis.uonbi.ac.ke/api/29/analytics.json?dimension=dx:Wg31yLDAehm;CK20eip3oTe;BiwM8SUgpJ1;KLoeF6isJCz;jwofVi31cHY;nvJsVaN8FOB;f5mBCkj0aSu;Vw7Yg5sKLkW&dimension=ou:' + countyid + '&filter=pe:' + periodid + '&displayProperty=NAME&outputIdScheme=UID`;
var urlcon = `https://hiskenya.org/api/26/analytics.json?dimension=pe:'+periodid+'&dimension=dx:HfGVoCZAwtd;nK8sqMAeQHY;ZcngDQJKiEg;wOKbEd8Dbi3;lHPLS1G5CUc;SSARcWY2Ge1;AX1co0SXobM;UUNwkYQhYgX;BnGDrFwyQp9.rPAsF4cpNxm;c0MB4RmVjxk.rPAsF4cpNxm;qnZmg5tNSMy.rPAsF4cpNxm;gVp1KSFI69G.rPAsF4cpNxm;Mmy9MoUdbhZ;iOARK31NdLp.rPAsF4cpNxm;imheYfA1Kiw.rPAsF4cpNxm;cPlWFYbBacW.rPAsF4cpNxm;jfUzb86mBSP.miM6uIJ2cWx;HwvUHnslwbh.miM6uIJ2cWx;OLYLVMDHEj8.miM6uIJ2cWx;UJeKVZzAnfS.miM6uIJ2cWx;fiVSJyM5cDs;naztfZrbMtd.miM6uIJ2cWx;EtG9ozt2joA.miM6uIJ2cWx;Umi8ZsiqBHw.miM6uIJ2cWx&dimension=ou:'+countyid+'&displayProperty=NAME&outputIdScheme=UID`;
var urlcon = `https://hiskenya.org/api/analytics.json?dimension=pe:'+periodid+'&dimension=dx:HfGVoCZAwtd;nK8sqMAeQHY;ZcngDQJKiEg;wOKbEd8Dbi3;lHPLS1G5CUc;SSARcWY2Ge1;AX1co0SXobM;UUNwkYQhYgX;BnGDrFwyQp9.rPAsF4cpNxm;c0MB4RmVjxk.rPAsF4cpNxm;qnZmg5tNSMy.rPAsF4cpNxm;gVp1KSFI69G.rPAsF4cpNxm;Mmy9MoUdbhZ;iOARK31NdLp.rPAsF4cpNxm;imheYfA1Kiw.rPAsF4cpNxm;cPlWFYbBacW.rPAsF4cpNxm;jfUzb86mBSP.miM6uIJ2cWx;HwvUHnslwbh.miM6uIJ2cWx;OLYLVMDHEj8.miM6uIJ2cWx;UJeKVZzAnfS.miM6uIJ2cWx;fiVSJyM5cDs;naztfZrbMtd.miM6uIJ2cWx;EtG9ozt2joA.miM6uIJ2cWx;Umi8ZsiqBHw.miM6uIJ2cWx&dimension=ou:'+countyid+'&displayProperty=NAME&outputIdScheme=UID`;

//physical count/SOH
// var urlphy = 'https://testhis.uonbi.ac.ke/api/29/analytics.json?dimension=dx:BnGDrFwyQp9.rPAsF4cpNxm;c0MB4RmVjxk.rPAsF4cpNxm;qnZmg5tNSMy.rPAsF4cpNxm;gVp1KSFI69G.rPAsF4cpNxm;MUxtqmB3VL6;iOARK31NdLp.rPAsF4cpNxm;imheYfA1Kiw.rPAsF4cpNxm;cPlWFYbBacW.rPAsF4cpNxm&dimension=ou:' + countyid + '&filter=pe:' + periodid + '&displayProperty=NAME&outputIdScheme=UID`;
var urlphy = `https://hiskenya.org/api/26/analytics.json?dimension=dx:BnGDrFwyQp9.rPAsF4cpNxm;c0MB4RmVjxk.rPAsF4cpNxm;qnZmg5tNSMy.rPAsF4cpNxm;gVp1KSFI69G.rPAsF4cpNxm;Mmy9MoUdbhZ;iOARK31NdLp.rPAsF4cpNxm;imheYfA1Kiw.rPAsF4cpNxm;eFqDcjgvt39.ZxUQw1ay1cw&dimension=pe:'+periodid+'&filter=ou:'+countyid+'&displayProperty=NAME&outputIdScheme=UID`;
var urlphy = `https://hiskenya.org/api/analytics.json?dimension=dx:BnGDrFwyQp9.rPAsF4cpNxm;c0MB4RmVjxk.rPAsF4cpNxm;qnZmg5tNSMy.rPAsF4cpNxm;gVp1KSFI69G.rPAsF4cpNxm;Mmy9MoUdbhZ;iOARK31NdLp.rPAsF4cpNxm;imheYfA1Kiw.rPAsF4cpNxm;eFqDcjgvt39.ZxUQw1ay1cw&dimension=pe:'+periodid+'&filter=ou:'+countyid+'&displayProperty=NAME&outputIdScheme=UID`;

//get the physical count into an array
var sohval = [];
Expand Down
6 changes: 3 additions & 3 deletions html/childHealth.html
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ <h4>Change in DPT3 doses administered - All counties</h4>
let lvl = "2"
if(ouFilterType == "county"){ lvl = "3" } else if(ouFilterType == "subcounty"){ lvl = "4" }else{ lvl = "2" }
// $.getJSON("../assets/json/rmncah/skilled_deliveries.json", function (data, textStatus, jqXHR) {
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:fzQbGiENdJo&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:fzQbGiENdJo&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})


.then(response=>{
Expand Down Expand Up @@ -288,7 +288,7 @@ <h4>Change in DPT3 doses administered - All counties</h4>


// $.getJSON("../assets/json/rmncah/adolesent_among_anc_clients.json", function (data, textStatus, jqXHR) {
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:Cblp7TAdj9W&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:Cblp7TAdj9W&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Months', "Values"]]

Expand Down Expand Up @@ -348,7 +348,7 @@ <h4>Change in DPT3 doses administered - All counties</h4>

const plotBar = (last_per, this_per) => {
$('#ldng').html(loading_svg_small)
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:Cblp7TAdj9W&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:Cblp7TAdj9W&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
.then(response=>{
let data = [['County', "Values"]]
response.metaData.dimensions.ou.map(o_ou=>{
Expand Down
12 changes: 6 additions & 6 deletions html/communicable-hiv.html
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ <h4> Change in PLWHIV on ART by county</h4>
let ouFilterType = window.sessionStorage.getItem("ouFilterType") || "national"
let lvl = "2"
if(ouFilterType == "county"){ lvl = "3" } else if(ouFilterType == "subcounty"){ lvl = "4" }else{ lvl = "2" }
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:nVx4FiV8hXq&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:nVx4FiV8hXq&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -302,7 +302,7 @@ <h4> Change in PLWHIV on ART by county</h4>
});


justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:xfdnpoNEkKG&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:xfdnpoNEkKG&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -352,7 +352,7 @@ <h4> Change in PLWHIV on ART by county</h4>
});


justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:RsGHNwSlhrR&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:RsGHNwSlhrR&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -402,7 +402,7 @@ <h4> Change in PLWHIV on ART by county</h4>
});


justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:BmWlyhX3ERL&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:BmWlyhX3ERL&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -437,7 +437,7 @@ <h4> Change in PLWHIV on ART by county</h4>
});


justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:nVx4FiV8hXq&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:nVx4FiV8hXq&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -483,7 +483,7 @@ <h4> Change in PLWHIV on ART by county</h4>

const plotBar = (last_per, this_per) => {
$('#ldng').html(loading_svg_small)
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:nVx4FiV8hXq&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:nVx4FiV8hXq&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
.then(response=>{
let data = [['County', "Values"]]
response.metaData.dimensions.ou.map(o_ou=>{
Expand Down
8 changes: 4 additions & 4 deletions html/communicable-malaria.html
Original file line number Diff line number Diff line change
Expand Up @@ -220,10 +220,10 @@ <h4>Change in confirmed malaria cases by County</h4>
let prd_wk_pre = prd_wk.split('2020W42;')[0]+'2020W42;'
let dx_post2020rev = 'q3zSDDKBjqL'
let prd_wk_post2020_rev = prd_wk.split('2020W42;')[1]
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:${dx_pre}&dimension=pe:${prd_wk_pre}&dimension=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:${dx_pre}&dimension=pe:${prd_wk_pre}&dimension=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{})
.then(reply=>{
let response = reply
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:${dx_post2020rev}&dimension=pe:${prd_wk_post2020_rev}&dimension=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{showLoading: 'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:${dx_post2020rev}&dimension=pe:${prd_wk_post2020_rev}&dimension=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{showLoading: 'false'})
.then(reply2=>{
Object.keys(reply2.metaData.items).map(tr=>{
if(!Object.keys(response.metaData.items).includes(tr)){
Expand Down Expand Up @@ -291,7 +291,7 @@ <h4>Change in confirmed malaria cases by County</h4>



justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:ssmk1hgU4ok&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:ssmk1hgU4ok&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`,{})
.then(response=>{
let data = [['Period', "Cases"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -335,7 +335,7 @@ <h4>Change in confirmed malaria cases by County</h4>

const plotBar = (last_per, this_per) => {
$('#ldng').html(loading_svg_small)
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:ssmk1hgU4ok&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:ssmk1hgU4ok&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
.then(response=>{
let data = [['County', "Values"]]
response.metaData.dimensions.ou.map(o_ou=>{
Expand Down
2 changes: 1 addition & 1 deletion html/communicable-tb.html
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ <h4>Comparison of TB Case Finding for April- June in 2019 and 2020 </h4>

const plotBar = (last_per, this_per) => {
$('#ldng').html(loading_svg_small)
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:OVMhCuFXB7s&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:OVMhCuFXB7s&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
.then(response=>{
let data = [['County', "Values"]]
response.metaData.dimensions.ou.map(o_ou=>{
Expand Down
10 changes: 5 additions & 5 deletions html/hsu.html
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ <h4>% difference in bed occupancy by county</h4>
if(prop && prop.pe_to){
prd = getPeriodBtwnYears(prop.pe, prop.pe_to, 'months')
}
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:Rsus0ojKqPe&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:Rsus0ojKqPe&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "OPD Visits"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -330,7 +330,7 @@ <h4>% difference in bed occupancy by county</h4>


// $.getJSON("../assets/json/essential/opd-visits-children-under5.json", function (data, textStatus, jqXHR) {
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:r7WOa2TrWSr&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:r7WOa2TrWSr&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -391,7 +391,7 @@ <h4>% difference in bed occupancy by county</h4>

const plotBar = (last_per, this_per) => {
$('#ldng').html(loading_svg_small)
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:r7WOa2TrWSr&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:r7WOa2TrWSr&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
.then(response=>{
let data = [['County', "Values"]]
response.metaData.dimensions.ou.map(o_ou=>{
Expand Down Expand Up @@ -445,7 +445,7 @@ <h4>% difference in bed occupancy by county</h4>



justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:MRllWHKmVua&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:MRllWHKmVua&dimension=pe:${prd}&filter=ou:${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {})
.then(response=>{
let data = [['Period', "Value"]]
response.metaData.dimensions.pe.map(o_pe=>{
Expand Down Expand Up @@ -505,7 +505,7 @@ <h4>% difference in bed occupancy by county</h4>

const plotBarBed = (last_per, this_per) => {
$('#ldng').html(loading_svg_small)
justFetch(`https://hiskenya.org/api/26/analytics.json?dimension=dx:MRllWHKmVua&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
justFetch(`https://hiskenya.org/api/analytics.json?dimension=dx:MRllWHKmVua&dimension=pe:${last_per};${this_per}&dimension=ou:LEVEL-${lvl};${org_unit}&displayProperty=NAME&outputIdScheme=UID`, {'showLoading':'false'})
.then(response=>{
let data = [['County', "Values"]]
response.metaData.dimensions.ou.map(o_ou=>{
Expand Down
Loading

0 comments on commit 5675141

Please sign in to comment.