← Back to team overview

dhis2-devs team mailing list archive

Re: Double & Integer (+ve and -ve) Valutypes for DataElement

 

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@xxxxxxxxx>:
> Sorry for shortcuts :-)
>
> +ve means Positive Value say 300, 2.5 etc
> -ve means Negative Values say -300, -0.3 etc



References