At present in DHIS2, we have Number, Text, Bool and Date as valuetype for dataelement.
May be it could be better if we split Number value type as Integer and Double with the option Allow -ve Values.
The need for this is:
For ex:- there is one dataelement Number of ANC Registration which is +ve Integer, but in dataentry i can enter -ve value, double value.
Similarly some finincial dataelements which should allow +ve double values etc.
I think we currently use the value type to i) decide input field type
in data entry, ii) validation of entered data in data entry and iii)
restrictions for indicator formulas (can only contain int
dataelements) iv) aggregation strategy in datamart. Variants for
positive/negative numbers and discrete/decimal numbers will only
affect ii). This means that if we are going to introduce new value
types for all of these then when deciding data entry input field and
aggregation strategy we must make code ala
if ( valuetype = int-positive || valuetype = int-negative || valuetype
= double-positive || valuetype = double-negative ) which is not so
good..
I suggest we add boolean properties allowDecimals and
allowNegativeValues to DataElement. This means that datamart and most
of the data entry code can remain untouched. Feel free to suggest
better solutions..
Lars
···
2010/7/12 bharath kumar <chbharathk@gmail.com>:
Sorry for shortcuts
+ve means Positive Value say 300, 2.5 etc
-ve means Negative Values say -300, -0.3 etc