← Back to team overview

dhis2-devs team mailing list archive

Re: Current Dis-aggregation vs Historical via API

 

Proof reading isn't my strong suit today:

---
API question for the API Gurus:

During configuration on a recent project, many dis-aggregation groups were
changed and updated after their Category Option Combos were initially
generated. They do not have data associated with them, but I think that is
beside the point for my question. Even if they did have data, I'm asking
for a way to get the "current" CatOptCombos, rather than "every"
CatOptCombo that has ever been assigned to this Catcombo.
---



*Timothy Harding*
Sr. Systems Analyst, BAO Systems
+1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007

On Mon, Nov 16, 2015 at 11:17 AM, Timothy Harding <tharding@xxxxxxxxxxxxxx>
wrote:

> Hello DHIS2 Devs!
>
> API question for the API Gurus:
>
> During configuration on a recent project, maybe dis-aggregation groups
> were changed and updated after their Category Option Combos were initially
> generated. They do not have data associated with them, but I think that is
> beside the point for my question. Even if they did have data, I'm asking
> for a why to get the "current" CatOptCombos, rather than "every"
> CatOptCombo that has ever been assigned to this Catcombo.
>
> Using the demo server, say I change:
> Morbidity Cases
> to
> Morbidity Cases + Gender
>
> https://apps.dhis2.org/demo/api/categoryCombos/t3aNCvHsoSn
>
> The API response for this one will go from:
> <categoryOptionCombos>
>     <categoryOptionCombo id="S34ULMcHMca" code="COC_358963"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/S34ULMcHMca";>
>         <name>0-11m</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="jOkIbJVhECg" code="COC_358966"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/jOkIbJVhECg";>
>         <name>15y+</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="wHBMVthqIX4" code="COC_358964"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/wHBMVthqIX4";>
>         <name>12-59m</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="SdOUI2yT46H" code="COC_358965"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/SdOUI2yT46H";>
>         <name>5-14y</name>
>     </categoryOptionCombo>
> </categoryOptionCombos>
>
>
> To:
> <categoryOptionCombos>
>     <categoryOptionCombo id="Q1wnnh5N6xV"
> created="2015-11-16T19:07:02.228+0000"
> lastUpdated="2015-11-16T19:07:02.228+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/Q1wnnh5N6xV";>
>         <name>0-11m, Female</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="wHBMVthqIX4" code="COC_358964"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/wHBMVthqIX4";>
>         <name>*12-59m*</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="uTaBiwZwiPL"
> created="2015-11-16T19:07:02.230+0000"
> lastUpdated="2015-11-16T19:07:02.230+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/uTaBiwZwiPL";>
>         <name>0-11m, Male</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="Up9OdlykfWA"
> created="2015-11-16T19:07:02.233+0000"
> lastUpdated="2015-11-16T19:07:02.233+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/Up9OdlykfWA";>
>         <name>5-14y, Female</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="iKsHpNDzlwC"
> created="2015-11-16T19:07:02.237+0000"
> lastUpdated="2015-11-16T19:07:02.238+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/iKsHpNDzlwC";>
>         <name>15y+, Female</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="OvNfjvOJCoK"
> created="2015-11-16T19:07:02.231+0000"
> lastUpdated="2015-11-16T19:07:02.231+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/OvNfjvOJCoK";>
>         <name>12-59m, Female</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="wIZ6pgCauQZ"
> created="2015-11-16T19:07:02.232+0000"
> lastUpdated="2015-11-16T19:07:02.232+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/wIZ6pgCauQZ";>
>         <name>12-59m, Male</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="SdOUI2yT46H" code="COC_358965"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/SdOUI2yT46H";>
>         <name>*5-14y*</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="S34ULMcHMca" code="COC_358963"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/S34ULMcHMca";>
>         <name>*0-11m*</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="jOkIbJVhECg" code="COC_358966"
> created="2011-12-24T12:24:25.319+0000"
> lastUpdated="2011-12-24T12:24:25.319+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/jOkIbJVhECg";>
>         <name>*15y+*</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="YfbYe5fnM0M"
> created="2015-11-16T19:07:02.234+0000"
> lastUpdated="2015-11-16T19:07:02.235+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/YfbYe5fnM0M";>
>         <name>5-14y, Male</name>
>     </categoryOptionCombo>
>     <categoryOptionCombo id="wSlHZb6eO6B"
> created="2015-11-16T19:07:02.239+0000"
> lastUpdated="2015-11-16T19:07:02.239+0000" href="
> https://apps.dhis2.org/demo/api/categoryOptionCombos/wSlHZb6eO6B";>
>         <name>15y+, Male</name>
>     </categoryOptionCombo>
> </categoryOptionCombos>
>
>
>
> So *rightly*, it retains its older CatOptCombos, because of course there
> might be data associated with those in the datavalue table. So I'm not
> looking to prune these. Without writing something to crawl through the api
> to figure out the "current" state, is there an existing API call that can
> do this? I know there must be, or someone has done it in JAVA because the
> data entry forms all can tell the "current" dis-aggregations without issue.
> Thanks and let me know if I can clarify my ask any better.
>
> Cheers!
>
> *Timothy Harding*
> Sr. Systems Analyst, BAO Systems
> +1 202-536-1541 | tharding@xxxxxxxxxxxxxx | http://www.baosystems.com | Skype:
> hardingt@xxxxxxxxx | 2900 K Street, Suite 404, Washington D.C. 20007
>

PNG image


References