← Back to team overview

dhis2-devs team mailing list archive

Re: [Dhis-dev] DataElement -> PeriodType association

 

Hi Lars

2009/3/13 Lars Helge Øverland <larshelge@xxxxxxxxx>:
>
> Hi,
>
> I see the need for introducing an association between DataElement and
> PeriodType in the DHIS 2 data model. Currently you can look up the
> PeriodType of the DataSet of which the DataElement is a member, but this is
> not enforced as a DataElement can be a member of many DataSets. The need is
> based on a few new requirements:
>
> - Sierra Leone: Regression analysis where missing values are left out of the
> aggregated indicator value. In order to define a missing value for a data
> element, we need to know the PeriodType of the Periods to look for.
>
> - South Africa: Gap analysis. In order to define a gap, we need to know the
> PeriodType of the Periods to look for.
>
> - South Africa: Alignment of the DHIS 2 and DHIS 1.4 data model which is
> necessary for migration and data dictionary use.
>
> - India: Aggregated data export. We must know the PeriodType of the Periods
> that should be used to aggregate data for each DataElement in order to avoid
> duplication of data on higher levels.
>
> - General: Improved performance in datamart as you can reduce the number of
> crosstabulated Periods.
>
>
> The downside of this is that all current DHIS 2 databases must be updated by
> assigning a PeriodType to each DataElement. Also this will affect places
> where data is captured with different frequencies for the same DataElement
> (this might be considered a bad practise anyway).

If I read you correctly, you are effectively moving the association
down from the dataset to the dataelement.  I do agree, this looks like
a move in the right direction.  From: <dataset name='aDataset'
periodtype='xxx'> to <dataelement name='aDataelement'
periodtype='xxx'>.

I can't help wondering at the merits of taking it a step further, ie
associating the periodtype with the datavalue:
<datelement name='aDataelement'>
   <value periodtype='xxx' >23</value>
   <value periodtype='yyy' >2</value>
   <value periodtype='xxx' >3</value>
</dataelement>

This would obviously be more costly in terms of efficiency (an extra
FK field per value rather than per element) but with the upside that
you can flexibly cater for the 'bad practice'.  I am too inexperienced
in the domain to know whether the added flexibility would justify the
cost, and what does or does not constitute good practice, but it is
perhaps something to consider.  In the end what you gain on the swings
you lose on the roundabouts :-)

Regards
Bob

> As an intermediate step we could disable this functionality for databases
> where DataElements registered for DataSets with different PeriodTypes exist.
>
>
> I would prefer introducing this association. Please comment on this.
>
>
> regards, Lars
>
>



Follow ups

References