← Back to team overview

dhis2-devs-core team mailing list archive

value types and option sets

 

Hi,

*1. *We have a problem in the way value types work for data
element/attributes in combination with option sets.

For data elements, you first select value type, then option set. This has
the problem that the value type of the options in the option set is
corresponding to the value type in the data element/attribute.

For attributes, you select option set as a specific value type. This has
the problem that you cannot use other value types, e.g. sometimes it is
necessary to have numeric value type with numeric options / sets in order
to use the attributes in indicator calculations.

*Suggestion:* We introduce a value type property on OptionSet. We have
option set as a value type for data element. When option set is selected as
a data element/attribute value type, we derive the value type from the
option set.


*2.* The value types for data elements are split in 3 properties on data
element (my fault): type, valueType and textType. This is pretty
unnecessary and cumbersome.

*Suggestion:* We merge all three value types into a single valueType
property.


*3.* The value types for data element / attributes are using String
constants for the various values. It should use Enums for better
readability in the API and possibility of generation of web components.

*Suggestion:* Introduce a single ValueType enum which we use across
OptionSet, DataElement, TrackedEntityAttribute, FormUtils/Web API
(InputType).


Sounds okay?

Lars