Option Set uniqueness constraint appears to be universal rather than restrict to a specific option set for v2.3

Morning all,

It’s been a while since I’ve communicated with the list… but am in the middle of building interfaces from lab equipment into DHIS2… and came across an apparent minor bug (unless I am reading this wrong)…

In this use case… the result option ‘indeterminate’ needs to be used in a number of different option sets. According to the ‘warning’ message below, options (of course) need to be unique within a given option set… but as can be seen, when I go to add this as an option to this small option set, the fact that it has already been defined and used as an option elsewhere appears to be stopping it from being added.

Any thoughts?

I’m on

Version: 2.30
Build revision: 1a314a5
Build date: 2018-08-14 06:07

All the best,

David Hagan

···

David Hagan

SageHagan GmbH, eSHIfT Partner Network

Mob: +41 79 848 5359

Skype: david.j.hagan

bump

···

David Hagan

SageHagan GmbH, eSHIfT Partner Network

Mob: +41 79 848 5359

Skype: david.j.hagan

David,

What is supported and not supported from version to version is anybody’s guess, sometimes. And the error message you are displaying does not make sense, in any case…

In terms of option sets and option values, I frequently re-use option value NAMES (no problem with that, at least up to version 2.29), but i prefer to use unique option value CODES. Ref this small example below - sometimes I prefix the optionvalue code with the full optionset code, sometimes (like here) I use an abbreviated version. The key point is that this approach ensures that all optionvalue codes stored in the relevant datavalue table don’t get “mixed up”, which - for instance - makes it easier to review value frequencies to pick up redundant values etc (common for a database under development, where administrators/developers might make meta-data changes without ensuring that all existing values are updated AND all users’ browser cache refreshed - I have had cases where some users kept on using and outdated browser cache and thus submitted outdated option values for six month!)

I also do not like copying the name into the code, by the way - why have a code field at all if you do that…

My 2c worth

Regards

Calle

Query26
set
setcode
optvalue
valuecode
YesNoNA
YESNONA
Yes
YNNA_YES
YesNoNA
YESNONA
Not Applicable
YNNA_NA
YesNoNA
YESNONA
No
YNNA_NO
YesNoUnknown
YESNOUNK
No
YNUNK_NO
YesNoUnknown
YESNOUNK
Yes
YNUNK_YES
YesNoUnknown
YESNOUNK
Unknown
YNUNK_UNK

···

Calle Hedberg

46D Alma Road, 7700 Rosebank, SOUTH AFRICA

Tel/fax (home): +27-21-685-6472

Cell: +27-82-853-5352

Iridium SatPhone: +8816-315-19119

Email: calle.hedberg@gmail.com

Skype: calle_hedberg