User Tools

Site Tools



The use of UCUM for units of measurement in ODM

Author: Jozef Aerts, XML4Pharma

Applicable to: ODM version 1.3

The use of UCUM notation for units of measurement is rapidly growing. CDISC ODM itself does not prescribe a particular notation for units of measurement. All it does is stating that a unit of measurement (ODM element “MeasurementUnit”) must have an OID (identifier) and a Name (short description). So the following snippets may describe exactly the same unit:

  <MeasurementUnit OID="MU.MMGG" Name="mm Hg">...</MeasurementUnit>
  <MeasurementUnit OID="MMHG" Name="millimeter mercury">...</MeasurementUnit>

This of course does not allow any semantic interoperability. And what to think if one of the sites has an apparatus that measures blood pressures in Pascal instead of mm Hg, meaning that in the ODM also the following unit of measurement is defined:

  <MeasurementUnit OID="MU.PA" Name="Pascal">...</MeasurementUnit>

and the ItemDef for systolic blood pressure thus states:

  <ItemDef OID="IT.SYSBP" Name="Systolic Blood Pressure" DataType="float">
      <MeasurementUnitRef MeasurementUnitOID="MU.MMHG"/>
      <MeasurementUnitRef MeasurementUnitOID="MU.PA"/>

stating that one of either “millimeter mercury” or “Pascal” can be used to measure the systolic blood pressure. What is does not say, is what the conversion factor between the two units is. And as the notation is not standardized, a lookup in a database or other system will not help either.

This is where UCUM notations come into play.

In UCUM, every unit has a code, which can be a composite code. For example, the code for “meter” is “m”, the code for “centi” is “c”, so the code for centimeter is “cm”. Similarly, the (composite) code for “millimeter” is “mm”. Simple isn't it?

The code for “inches” is “[in_i]” (case sensitive) or “[IN_I”]” when uppercase is allowed only.

For “millimeter mercury” the UCUM notation is “mm[Hg]”. For “Pascal” it is “Pa” or “PAL”. We will further on only use the case-sensitive notation. Similary, if one would like to express a pressure as the number of meters of a water column (who still does?), then the UCUM notation is “m[H2O]”.

So how do we add these UCUM notations to the ODM MeasurementUnit element?

One possibility is to use the “OID” attribute (which makes sense) but which will not always work as some systems use conventions to assign OIDs, for example to use the prefix “MU.” as in the above example. The other is to use the “Name” attribute, but this is not in the spirit of ODM which states that the “Name” attribute should contain a short description.

This is where the “Alias” element comes to help (as of ODM 1.3.1). The “Alias” element is meant to describe a “meaning in the context of …”. So we can write:

  <MeasurementUnit OID="MU.MMHG" Name="millimeter mercury">
      <Alias Context="UCUM" Name="mm[Hg]"/>

and in case we want to allow that (in some countries) the height of a person is measured in inches instead of centimter, we would have:

  <MeasurementUnit OID="MU.CM" Name="centimeters">
      <Alias Context="UCUM" Name="cm"/>
  <MeasurementUnit OID="MU.INCH" Name="inches">
      <Alias Context="UCUM" Name="[in_i]"/>

so that we have at least semantic interoperability with systems that also use UCUM.

One of the desires of some of the ODM users is that ODM allows to define the conversion factors between units of measurement, so that that information can be used to do the necessary calculations/transformations e.g. when generating SDTM datasets.

This is currently not possible with ODM. However, the UCUM XML gives us some ways or hints to do so.

Here is the UCUM XML description for the “atmosphere”

  <unit Code="atm" CODE="ATM" isMetric="no" class="const">
      <name>standard atmosphere</name> 
      <value Unit="Pa" UNIT="PAL" value="101325">101325</value> 

The “value” element describes that 1 atmosphere is 101325 Pascal

Similarly, for “millimeter Hg” we can write:

  <unit Code="mm[Hg]" CODE="MM[HG]" isMetric="yes" class="clinical">
      <name>meter of mercury column</name> 
      <printSymbol>mm Hg</printSymbol> 
      <value Unit="Pa" UNIT="PAL" value="133.3220">133.3220</value> 

It can also describe more complicated conversions, such as the one from Fahrenheit to degrees Celcius:

  <unit Code="[degF]" CODE="[DEGF]" isMetric="no" isSpecial="yes" class="heat">
      <name>degree Fahrenheit</name> 
      <value Unit="degf(5 K/9)" UNIT="DEGF(5 K/9)">
          <function name="degF" value="5" Unit="K/9" /> 

For more details about how this exactly works, please refer to the

So why not these snippets of UCUM-XML in our ODM? Wait a minute … this may only be done through “vendor extensions” isn't it? And this requires a separate namespace isn't it? But the UCUM-XML unfortunately does not state a namespace (though a ”ticket” seems to have been submitted with the request to add one). So for the moment, we will just suppose there is one, and assign the prefix “ucum:” to it.

So for “millimeter mercury” the extended ODM could be:

  <MeasurementUnit OID="MU.MMHG" Name="millimeter mercury">
      <ucum:unit Code="mm[Hg]" CODE="MM[HG]" isMetric="yes" class="clinical">
          <ucum:name>meter of mercury column</ucum:name> 
          <ucum:printSymbol>mm Hg</ucum:printSymbol> 
          <ucum:value Unit="Pa" UNIT="PAL" value="133.3220">133.3220</ucum:value> 

and for the “Fahrenheit” unit it could be:

  <MeasurementUnit OID="MU.FAHRENHEIT" Name="Fahrenheit">
      <ucum:unit Code="[degF]" CODE="[DEGF]" isMetric="no" isSpecial="yes" class="heat">
          <ucum:name>degree Fahrenheit</ucum:name> 
          <ucum:value Unit="degf(5 K/9)" UNIT="DEGF(5 K/9)">
              <ucum:function name="degF" value="5" Unit="K/9" /> 

allowing to implement conversion factors from the information in the ODM itself.

REMARK: the use of UCUM notation alone already guarantees that conversions can be done, as the UCUM codes can be looked up in a database or system, and the conversions extracted from that.

A note about CDISC Controlled Terminology

CDISC regularly publishes lists of controlled terminology (CT) to be used in clinical studies, also for units of measurement. I had a quick look, and it seems as the CT does not follow the UCUM notation. So for example, the CDISC CT for “millimeter mercury” is “mmHg” whereas the UCUM notation is “mm[Hg]”.

Does it matter?

Yes and no! I would think that as long as data is not retrieved from other systems (such as electronic health records - EHRs) it doesn't matter. We all (within CDISC) know what “mmHg” is as it is CDISC-CT. However, if we e.g. extract the systolic blood pressure from an EHR in HL7 CCD format, we can find:

      <observation classcode="OBS" moodCode="EVN">
          <templateId root="2.16.840.1.113883.10.20.31"/>
          <id root="..."/>
          <code code="271649006" codeSystem="2.16.840.1.113883.6.96" displayName="Systolic BP"/>
          <statusCode code="completed"/>
          <effectiveTime value="20110317"/>
          <value xsi:type="PQ" value="132" unit="mm[Hg]"/>

As HL7-CCD uses (or tries to use) UCUM for units of physical quantities “PQ”, the second last line (the “value” element) states that the value of the systolic blood pressure (code 271649006 in codesystem 2.16.840.1.113883.10.20.31 which is SNOMED-CT) is 132 with the UCUM unit “mm[Hg]”.

So how can ODM (without UCUM-extension or UCUM-Alias) know that this is “millimeter mercury”? It can't! So we do either need the UCUM-Alias OR the UCUM-extension.

Any comments are highly welcome! Please send them to

odm_units_of_measurement_and_ucum.txt · Last modified: 2013/12/21 09:19 (external edit)