# PropertyUnitData.xml and conversion information

**URL:** https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968
**Category:** Terminology
**Tags:** archetype-designer
**Created:** [26 February 2024 09:56 UTC](https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968 "2024-02-26T09:56:08Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [26 February 2024 09:56 UTC](https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968/1 "2024-02-26T09:56:08Z")

</div>

Continuing the discussion from [Invalid UCUM units in Archetype Designer](https://discourse.openehr.org/t/invalid-ucum-units-in-archetype-designer/1261/14):

The [PropertyUnitData.xml](https://github.com/openEHR/specifications-TERM/blob/master/computable/XML/PropertyUnitData.xml) file is important to Archetype Designer as a way to specify which units are valid and available. However, the file also contains a lot of information about conversion factors between units, much of which is erroneous and/or imprecise.

This information was probably important to maintain when this file was first created, but now there’s [a maintained JS library](https://github.com/lhncbc/ucum-lhc/tree/master) for doing conversions, as well as validation of UCUM expressions.

I suggest we remove the conversion information from the file, and point to the ucum-lhc library for doing conversions.

---

<div class="post-metadata">

### Author: ![sebastian.iancu](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.iancu/32/31_2.png) [@sebastian.iancu](https://discourse.openehr.org/u/sebastian.iancu)
#### Post date: [26 February 2024 21:50 UTC](https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968/2 "2024-02-26T21:50:53Z")

</div>

Interesting library 😉

Who is more entitled to give feedback here? @borut.fabjan what do you think on this proposal?

I would not dare to take sights on whether we should remove it - I would to listen to what AD or CPB needs. The only “issue” I see is the library you mention is in JS, whereas the rules we have are in XML - so a bit more tech-language-agnostic.

---

<div class="post-metadata">

### Author: ![sebastian.garde](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.garde/32/3070_2.png) [@sebastian.garde](https://discourse.openehr.org/u/sebastian.garde)
#### Post date: [27 February 2024 12:31 UTC](https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968/3 "2024-02-27T12:31:27Z")

</div>

Also, a few conversions are more complicated than just a conversion factor + coefficient. The information provided to convert °Fahrenheit to °Celsius is simply not sufficient for example.

Graeme (and probably others from the fhir camp) have done lots of good work on this:

There is a ucum\_essence file [Ucum-java/src/main/resources/ucum-essence.xml at master · FHIR/Ucum-java · GitHub](https://github.com/FHIR/Ucum-java/blob/master/src/main/resources/ucum-essence.xml)

and services based on this to e.g. validate and convert.

For a few units, conversion requires special handling and is managed in special handlers, e.g. [Ucum-java/src/main/java/org/fhir/ucum/special/CelsiusHandler.java at master · FHIR/Ucum-java · GitHub](https://github.com/FHIR/Ucum-java/blob/master/src/main/java/org/fhir/ucum/special/CelsiusHandler.java)

To me openEHR’s property units file is mainly relevant to list common units + properties and groupings and as such is probably useful for some tools.

Conversion cannot be reliably done based on this file in all cases, even if we fix the errors.

So, I agree with Silje that this (mis-)information is best removed as ‘beyond scope’ and we can point to the _JS lhncbc/ucum-lhc lib_ and the _FHIR UCUM Java lib_ as well where needed.

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [27 February 2024 13:12 UTC](https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968/4 "2024-02-27T13:12:56Z")

</div>

Thanks @sebastian.iancu and @sebastian.garde!

Another potential direction could be to strip the PropertyUnitData.xml file not only of the conversion information, but also of all the base (“primitive”) units and properties, and point to [ucum-essence.xml](https://github.com/ucum-org/ucum/blob/main/ucum-essence.xml) for this information. This would constrain our xml file to only the compound units and properties we need to maintain to be able to use modelling tools efficiently, leaving it a fraction of the size and much more maintainable.

---

<div class="post-metadata">

### Author: ![sebastian.iancu](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.iancu/32/31_2.png) [@sebastian.iancu](https://discourse.openehr.org/u/sebastian.iancu)
#### Post date: [28 February 2024 08:39 UTC](https://discourse.openehr.org/t/propertyunitdata-xml-and-conversion-information/4968/5 "2024-02-28T08:39:01Z")

</div>

Ok clear; we could do this.  
But we’ll need AD to adapt to it, as perhaps it is being still in use somewhere. Would it be ok @borut.fabjan ?
