← Back to team overview

dhis2-users team mailing list archive

Re: CategoryOptionCombos: Confusing behavior with shared options

 

Hi Uwe,

you are right. It is best not to share category options between categories
inside the same category combo. It is a problem with the current design. I
am aware of it and we will try to get it fixed. It has implications on
several aspects so might not be fixed this week. For now it's better to not
reuse options inside the same combo.

regards,

Lars






On Mon, Nov 30, 2015 at 10:11 AM, Uwe Wahser <uwe@xxxxxxxxx> wrote:

> Dear all,
>
> this might be a result of me misunderstanding the concept of
> CategoryCombos and
> CategoryOptionCombos, but this is strange: when I share options between two
> categories which are members of the same CategoryCombo, the generation of
> CategoryOptionCombos seems to produce funny results.
>
> I just reproduced this on the demo-site with the CategoryCombo
> "Implementing
> Partners and Projects" (O4VaNks6tta) which comes close to what I need for
> my
> dataSets with lots of custom dimensions. Hope you are not having a
> presentation
> on that one right now ;-)
>
> Given a CategoryCombo with two Categories, I'd normally expect to get a
> list of
> CategoryOptionCombos with all the possible combinations of Options from
> the two
> Categories. Of course, each CategoryOptionCombo should consist of only two
> Options.
>
> In the example I added two shared Options ("Missing" and "Others") to each
> of
> the Categories. As a result I get CategoryOptionCombos with three Options
> (https://play.dhis2.org/demo/api/categoryCombos/O4VaNks6tta.json) which
> should
> not happen in my understanding. In my own test-scenario with 5 Categories
> in one
> CategoryCombo, I even found CategoryOptionCombos with nine Options, while
> others
> only have three.
>
> Is it allowed to use shared options at all in this context?
>
> Related question: given a valid CategoryOptionCombo from the above example
> with
> the Combination ("Missing", "Others") - how can I tell, which Category is
> "Missing" and which Category is "Others", e.g when I want to read the
> metadata
> via api? The result is just an unordered list, I assume ...
>
> Thanks for shedding light on this,
>
> Uwe
>
> _______________________________________________
> Mailing list: https://launchpad.net/~dhis2-users
> Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~dhis2-users
> More help   : https://help.launchpad.net/ListHelp
>



-- 
Lars Helge Øverland
Lead developer, DHIS 2
University of Oslo
Skype: larshelgeoverland
http://www.dhis2.org <https://www.dhis2.org>

References