Dashboard > DHIS-2 > ... > DHIS 2 development > Meeting 2005-11-17 DataSetElements
  DHIS-2 Log In | Sign Up   View a printable version of the current page.  
  Meeting 2005-11-17 DataSetElements
Added by Hans S. Tømmerholt, last edited by margrsto on Nov 14, 2006  (view change)
Labels: 
(None)

Meeting 2005-11-17 DataSetElements

A few notes from the meeting with Ola, Kristian, Torgeir and Hans.
Will update them as I have time.

An orgunit defines the DataSets (with a set of DataSetElements) which it wants data for.

A child unit may extend this set with a new DataSet, and add additional elements, and expand/replace elements from the parent, to be used by child units of itself. The reason for doing this, is to be able to register more details at a lower level.

The subunit will report only the elements in the set it received back to its parent.

Example:
The OrgUnit o1 defines a DataSet s1. It contains three DataSetElements,
dse1, dse2, dse3, which point to the DataElements d1, d2 and d3 respectively.

o1
  ds1
    dse1 - de1
    dse2 - de2
    dse3 - de3

The OrgUnit o2 (a child of o1) copies extends the DataSet ds1, and thus has dse1, dse2, dse3. However, it expands dse3. Instead of using dse3 directly, it wants child units of itself to register dse4 and dse5, which together form dse1.

o2
  ds2 {ds1}
    (dse1 - de1)
    (dse2 - de2)
    dse3 - {dse4, dse5}
    dse4 - de 4
    dse5 - de 5

Child units will now enter values for dse4 and dse5, which will be aggreated in o2, and reported to o1 as dse3.

Validation should not be connected to a DataSet, but take an OrgUnit, Period and Data Element as arguments. This way, the DataSet logic and the validation logic is separated.

Q: Will/should dse2 need to be copied into ds2?
A: No.

When getting values for a CompositeDataSetElement, one should be able to get the aggregated value of all it's child elements, which forms the value of the parent element.

Model

(This is also a possibility: http://www.hisp.info/confluence/download/attachments/5963/simple.png)

public class DataSet
{
    private int id;
    private String name;
    private DataSet parent;
    private String source;      // OrganizationUnit
    private Interval interval;
    private Set dataSetElements;
    private Set replacements;

    // Getters and setters

    /* Methods that return all Data(Set)Elements that are supposed to
     * be registered by this OrganizationUnit. getAllDataSetElements
     * returns all and no other DataSetElements than the
     * DataSetElements corresponding to the DataElements returned by
     * getAllDataElements(). The objects are fetched from all the
     * DataSets in the hierarchy, but all the replaced
     * Data(Set)Elements as defined in the Replacements are not
     * returned. The returned DataSetElements are all and the only
     * DataSetElements that are allowed to be replaced by a new
     * Replacement.
     */
    public Collection getAllDataSetElements() {...}
    public Collection getAllDataElements() {...}
}

public class DataSetElement
{
    private DataElement dataElement;

    // Getter and setter
}

public class Replacement
{
    private DataSetElement replacedDataSetElement;
    private Set replacingDataSetElements;

    // Getters and setters
}

Important stuff

  • Unless explicitly stated, all getters and setters return and set the locally declared properties.
  • A child OrganizationUnit will always extend a DataSet from a parent (i.e. have it's own DataSet object with the correct parent reference, regardless of the child DataSet is redefining some of the properties of the parent DataSet or not).
  • When using a DataSet (not editing it), there's no point in accessing the DataSetElements. The structure of the DataSetElements is hidden by the getAllDataElements() method.
  • In the Replacement, the replacing DataElements (referenced to by the DataSetElements) are always the complete set of children of the replaced DataElement (referenced to by the DataSetElement).
  • dataSet.getParent().getAllDataElements() will automatically always return all the DataElements to report to the parent OrganizationUnit.

Objects and methods that might deserve better names

  • getAllDataSetElements()
  • getAllDataElements()
  • Replacement (Expansion?)

Site powered by a free Open Source Project / Non-profit License (more) of Confluence - the Enterprise wiki.
Learn more or evaluate Confluence for your organisation.
Powered by Atlassian Confluence, the Enterprise Wiki. (Version: 2.5.6 Build:#812 Aug 06, 2007) - Bug/feature request - Contact Administrators