Wiki Spaces

Documentation
Projects
Resources

Get Help from Others

Q&A: Ask OpenMRS
Discussion: OpenMRS Talk
Real-Time: IRC Chat | Slack

Documentation

Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Cleaned up xml formatting (fixes Chrome/Firefox crashes)

...

Code Block
<structure:Dimension conceptRef="GENDER" conceptSchemeRef="CS_COMMON"  conceptVersion="1.0" 
  conceptSchemeAgency="SDMX-HD"  codelist="CL_GENDER_TRAC" codelistVersion="1.0"  codelistAgency="TRACPLUS"/>

...

Code Block
<structure:CodeList id="CL_GENDER_TRAC" agencyID="TRACPLUS" version="1.0" isFinal="false" 
  urn="urn:sdmx:org.sdmx.infomodel.codelist=TRACPLUS:CL_GENDER_TRAC" isExternalReference="true" 
  uri="./CUSTOM/TRACPLUS/v1.0/codelists/CL_GENDER+TRACPLUS+1.0.xml"><structure>
  <structure:Name xml:lang="en">Gender</structure:Name><Name>
</structure:CodeList>

This then points to the file ./Custom/TRACPLUS/v1.0/codelists/CL_GENDER+TRACPLUS+1.0.xml

...

Code Block
<structure:Hierarchy id="HY_INDICATOR_DISAGGREGATION">
                <structure<structure:Name>Indicator to Disaggregation Hierarchy</structure:Name>
                <  <!-- ADD THE CODEREFs HERE -->
                <  <!-- Explicitly list all indicators, even if there are no associated dimensions.-->
                <  <!-- If an indicator is not mentioned here it will default to all possible dimensions being calculated.-->
                <structure  <structure:CodeRef>
                      <structure:CodelistAliasRef>AL_INDICATOR</structure:CodelistAliasRef>
                      <structure:CodeID>1</structure:CodeID>
                      <structure:CodeRef>
                        <structure<structure:CodelistAliasRef>AL_GENDER_TRAC</structure:CodelistAliasRef>
                        <structure<structure:CodeID>0</structure:CodeID>
                      </structure:CodeRef>
                      <structure:CodeRef>
                        <structure<structure:CodelistAliasRef>AL_GENDER_TRAC</structure:CodelistAliasRef>
                        <structure<structure:CodeID>1</structure:CodeID>
                      </structure:CodeRef>
                <</structure:CodeRef>
                                 <structure:CodeRef>
                      <structure:CodelistAliasRef>AL_INDICATOR</structure:CodelistAliasRef>
                      <structure:CodeID>2</structure:CodeID>
                      <structure:CodeRef>
                        <structure<structure:CodelistAliasRef>AL_GENDER_TRAC</structure:CodelistAliasRef>
                        <structure<structure:CodeID>0</structure:CodeID>
                        <structure<structure:CodeRef>
                            <structure <structure:CodelistAliasRef>AL_AGE_GROUP_TRAC</structure:CodelistAliasRef>
                            <structure <structure:CodeID>0</structure:CodeID>
                          <</structure:CodeRef>
                      </structure:CodeRef>
                      <structure:CodeRef>
                        <structure<structure:CodelistAliasRef>AL_GENDER_TRAC</structure:CodelistAliasRef>
                        <structure<structure:CodeID>1</structure:CodeID>
                      </structure:CodeRef>
                <</structure:CodeRef>
            <</structure:Hierarchy>

In this example, you can see how Gender is applied to the two indicators.  Indicator 1 is disaggregated into Male And Female.  Indicator 2 is disaggregated into Male And Female, with Males being broken down by another Age Group dimension.  

You will also notice that this section uses aliases to refer to CodeLists.  This seems to be standard practice for hierarchies in the DSD, and you'll notice that the code lists are matched with their aliases at the beginning of the heirarchy section in the DSD:

<structure:CodelistRef> <structure:AgencyID>SDMX-HD</structure:AgencyID> <structure:CodelistID>CL_INDICATOR</structure:CodelistID> <structure:Version>1.0</structure:Version> <structure:Alias>AL_INDICATOR</structure:Alias> </structure:CodelistRef> <structure:CodelistRef> <structure:AgencyID>TRACPLUS</structure:AgencyID> <structure:CodelistID>CL_AGE_GROUP_TRAC</structure:CodelistID> <structure:Version>1.0</structure:Version> <structure:Alias>AL_AGE_GROUP_TRAC</structure:Alias> </structure:CodelistRef> <structure:CodelistRef> <structure:AgencyID>TRACPLUS</structure:AgencyID> <structure:CodelistID>CL_GENDER_TRAC</structure:CodelistID> <structure:Version>1.0</structure:Version> <structure:Alias>AL_GENDER_TRAC</structure:Alias> </structure:CodelistRef> <structure:CodelistRef> <structure:AgencyID>TRACPLUS</structure:AgencyID> <structure:CodelistID>CL_ISET</structure:CodelistID> <structure:Version>1.0</structure:Version> <structure:Alias>AL_ISET</structure:Alias> </structure:CodelistRef>

Code Block
<structure:CodelistRef>
				  <structure:AgencyID>SDMX-HD</structure:AgencyID>
				  <structure:CodelistID>CL_INDICATOR</structure:CodelistID>
				  <structure:Version>1.0</structure:Version>
				  <structure:Alias>AL_INDICATOR</structure:Alias>
			</structure:CodelistRef>
			<structure:CodelistRef>
				  <structure:AgencyID>TRACPLUS</structure:AgencyID>
				  <structure:CodelistID>CL_AGE_GROUP_TRAC</structure:CodelistID>
				  <structure:Version>1.0</structure:Version>
				  <structure:Alias>AL_AGE_GROUP_TRAC</structure:Alias>
			</structure:CodelistRef>
			<structure:CodelistRef>
				  <structure:AgencyID>TRACPLUS</structure:AgencyID>
				  <structure:CodelistID>CL_GENDER_TRAC</structure:CodelistID>
				  <structure:Version>1.0</structure:Version>
				  <structure:Alias>AL_GENDER_TRAC</structure:Alias>
			</structure:CodelistRef>
			<structure:CodelistRef>
				  <structure:AgencyID>TRACPLUS</structure:AgencyID>
				  <structure:CodelistID>CL_ISET</structure:CodelistID>
				  <structure:Version>1.0</structure:Version>
				  <structure:Alias>AL_ISET</structure:Alias>
			</structure:CodelistRef> 

...

Code Block
<ns:OBS_VALUE GENDER="0" value="37" INDICATOR="1"/>
 <ns<ns:OBS_VALUE GENDER="1" value="45" INDICATOR="1"/>
 <ns:OBS_VALUE AGROUP="0" GENDER="99" value="0" INDICATOR="2"/>
 <ns<ns:OBS_VALUE GENDER="1" value="55" INDICATOR="2"/>

...

IMPORTANT NOTE ABOUT DIMENSION HIERARCHIES: By default, if you have dimensions defined in your KeyFamily in your DSD, all indicators that you don't include in the HY_INDICATOR_DISAGGREGATION hierarchy in your DSD will automatically have all possible dimensions applied to them.  So, for example, if you built a DSD with the gender dimension in the KeyFamily, but you didn't explicitly relate Gender to your indicators in HY_INDICATOR_DISAGGREGATION, the result would be that both indicator 1 and 2 would be disaggregated in the result file by Gender.  If you only wanted indicator 1 to be disaggregated, but not indicator 2, you need to explicitly say so in the HY_INDICATOR_DISAGGREGATION section, like so:

Code Block
                <structure:Hierarchy id="HY_INDICATOR_DISAGGREGATION">
                <structure<structure:Name>Indicator to Disaggregation Hierarchy</structure:Name>
                <structure<structure:CodeRef>
                      <structure:CodelistAliasRef>AL_INDICATOR</structure:CodelistAliasRef>
                      <structure:CodeID>1</structure:CodeID>
                      <structure:CodeRef>
                        <structure<structure:CodelistAliasRef>AL_GENDER_TRAC</structure:CodelistAliasRef>
                        <structure<structure:CodeID>0</structure:CodeID>
                      </structure:CodeRef>
                      <structure:CodeRef>
                        <structure<structure:CodelistAliasRef>AL_GENDER_TRAC</structure:CodelistAliasRef>
                        <structure<structure:CodeID>1</structure:CodeID>
                      </structure:CodeRef>
                <</structure:CodeRef>
                <structure:CodeRef>
                      <structure:CodelistAliasRef>AL_INDICATOR</structure:CodelistAliasRef>
                      <structure:CodeID>2</structure:CodeID>
                <</structure:CodeRef>
            <</structure:Hierarchy>

You'll notice here that indicator 2 is referenced, but has no Gender applied.  The output file for this descriptor will be something like:

...

Code Block
<structure:Hierarchy id="INDICATOR_SET_INDICATOR_HIERARCHY"><structure:Name>Indicator Set to Indicator Hierarchy</structure:Name>
   <structure:CodeRef>
    <structure:CodelistAliasRef>AL_ISET</structure:CodelistAliasRef>
    <structure:CodeID>0</structure:CodeID>
      <structure:CodeRef>
         <structure:CodelistAliasRef>AL_INDICATOR</structure:CodelistAliasRef>
         <structure:CodeID>1</structure:CodeID>
      </structure:CodeRef>
   </structure:CodeRef>
   <structure:CodeRef>
    <structure:CodelistAliasRef>AL_ISET</structure:CodelistAliasRef>
    <structure:CodeID>1</structure:CodeID>
      <structure:CodeRef>
         <structure:CodelistAliasRef>AL_INDICATOR</structure:CodelistAliasRef>
         <structure:CodeID>2</structure:CodeID>
      </structure:CodeRef>
   </structure:CodeRef>
</structure:Hierarchy>

...

Code Block
<CrossSectionalData xmlns="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/message" xmlns:ns="urn:sdmx:org.sdmx.infomodel.keyfamily.KeyFamily=WHO:SDMX-HD:1.0:cross" xmlns:cross="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/cross" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.SDMX.org/resources/SDMXML/schemas/v2_0/structure SDMXMessage.xsd urn:sdmx:org.sdmx.infomodel.keyfamily.KeyFamily=WHO:SDMX-HD:1.0:cross CrossSectional.xsd http://www.SDMX.org/resources/SDMXML/schemas/v2_0/cross SDMXCrossSectionalData.xsd">
  <Header>
    <ID>SDMX-HD-CSDS</ID>
    <Test>false</Test>
    <Truncated>false</Truncated>
    <Name xml:lang="en">OpenMRS SDMX-HD Export</Name>
    <Prepared>2012-01-04</Prepared>
    <Sender id="OMRS">
      <Name>OpenMRS</Name>
    </Sender>
    <ReportingBegin>2012-01-01</ReportingBegin>
    <ReportingEnd>2012-01-31</ReportingEnd>
  </Header>
  <ns:DataSet reportingBeginDate="2012-01-01" reportingEndDate="2012-01-31" dataProviderID="417">
    <ns:Group TIME_PERIOD="2012-01" FREQ="M">
      <ns:Section description="PRE-ART">
        <ns:OBS_VALUE GENDER="0" value="0" INDICATOR="1"/>
        <ns:OBS_VALUE GENDER="1" value="0" INDICATOR="1"/>
      </ns:Section>
      <ns:Section description="ART">
        <ns:OBS_VALUE AGROUP="0" GENDER="0" value="0" INDICATOR="2"/>
        <ns:OBS_VALUE GENDER="1" value="0" INDICATOR="2"/>
      </ns:Section>
    </ns:Group>
  </ns:DataSet>
</CrossSectionalData>

...

Code Block
<structure:Attribute conceptRef="FREQ" conceptSchemeRef="CS_COMMON" conceptVersion="1.0" conceptSchemeAgency 
  conceptSchemeAgency="SDMX-HD" codelist="CL_FREQ" codelistVersion="1.0" codelistAgency="SDMX-HD" 
  attachmentLevel="Group" assignmentStatus="Mandatory"/>

...

Code Block
<structure:CodeList id="CL_FREQ" agencyID="TRACPLUS" version="1.0" isFinal="false" 
  urn="urn:sdmx:org.sdmx.infomodel.codelist=TRACPLUS:CL_FREQ_TRAC" isExternalReference="true" 
  uri="./CUSTOM/TRACPLUS/v1.0/codelists/CL_FREQ+TRACPLUS+1.0.xml"><structure>
  <structure:Name xml:lang="en">Report Frequency</structure:Name><Name>
</structure:CodeList>

which then points to the file CL_FREQ+TRACPLUS+1.0.xml, which contains the CodeList values.

...