FHIR Chat · LoMo specify units for Quantity · conformance

Stream: conformance

Topic: LoMo specify units for Quantity


view this post on Zulip Alexander Henket (May 09 2017 at 09:31):

How would I specify a particular set of units on a Quantity in a Logical Model? I came across this extension http://hl7.org/fhir/extension-elementdefinition-allowedunits.html but it contains limited help on where to apply, and either way it looks as if Forge would not be of help in configuring it.

view this post on Zulip Grahame Grieve (May 09 2017 at 10:07):

it applies to any element - that's what you'd use

view this post on Zulip Grahame Grieve (May 09 2017 at 10:07):

Have to talk to Forge about supporting it

view this post on Zulip Alexander Henket (May 09 2017 at 10:14):

@Michel Rutten Could you consider supporting this extension on Quantity type elements? The first issue that Forge doesn’t allow extensions on Logical Models at all

view this post on Zulip Alexander Henket (May 09 2017 at 10:23):

@Grahame Grieve I have a feeling that either Forge or Logical Models in general lack here.
- In a profile I would just apply a value set on Quantity.code and fix Quantity.system to UCUM. In case of multi datatype elements like Observation.value[x] I would first type slice to reach Quantity -- no need to use the extension, I think

The added benefit of not using the extension is that more tooling would consider a value set binding than an extension.

  • In a Logical Model I cannot slice or extend and I'm unsure how much of that is a limitation of Forge or FHIR core.

view this post on Zulip Alexander Henket (May 09 2017 at 10:24):

Adding @Marc de Graauw

view this post on Zulip Grahame Grieve (May 09 2017 at 12:13):

the limitations are a bit of both. But I think that the right thing to do is to create a task about 'what is the right way to constrain units' because i think the way you do it in profiles has problems, and we need a better way

view this post on Zulip Grahame Grieve (May 09 2017 at 12:29):

(deleted)

view this post on Zulip Alexander Henket (May 09 2017 at 12:32):

GF#13353 added

view this post on Zulip Grahame Grieve (May 09 2017 at 15:39):

thx

view this post on Zulip Michel Rutten (May 09 2017 at 19:06):

FYI Forge does not (yet) support slicing & extensions in Logical Models simply because we didn't implement it yet. It is not a technical limitation. But users haven't asked for this until now; you're the first. Some guidelines by FHIR spec about this would be helpful.

view this post on Zulip Richard Kavanagh (May 12 2017 at 08:21):

@Alexander Henket Out of interest, what is the use case for an extension on a LoMo?

view this post on Zulip Alexander Henket (May 12 2017 at 10:13):

Normally probably seldomly so, but currently, by the looks of it if you want to say "Weight in kg or g" you cannot specify this unless you use a core extension that exists for that.

view this post on Zulip Grahame Grieve (May 12 2017 at 11:02):

Are you asking about extensions in the logical model instances, or in the definition of the logical model? Usually not much in the first case, bu quite a bit in the second

view this post on Zulip Eric Haas (May 12 2017 at 21:45):

I am unclear what you all mean - is there an example of the second use case I can look at?

view this post on Zulip Grahame Grieve (May 12 2017 at 22:56):

Well, the cda logical model has extensions for namespace etc

view this post on Zulip Alexander Henket (Jun 06 2017 at 08:21):

I finally got to implementing the extension. In DECOR we have separate units as a list on a concept. The logical mapping would be to add as many allowedUnits extensions as there are units listed in DECOR. But the extension seems to tell me, I can only add it once per context. Is this legal or not?

    <element>
        <!-- unit is kg or g -->
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits">
            <valueCodeableConcept>
                <coding>
                    <system value="http://unitsofmeasure.org/"/>
                    <code value="kg"/>
                </coding>
            </valueCodeableConcept>
        </extension>
        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits">
            <valueCodeableConcept>
                <coding>
                    <system value="http://unitsofmeasure.org/"/>
                    <code value="g"/>
                </coding>
            </valueCodeableConcept>
        </extension>
        <path value="measurement_message.weight"/>

Secondly at dataset level we allow MD's to enter the units free text. The MD's do not necessarily use UCUM to express what they meant. We solve that mapping in the implementation and leave the free text unit as is. When the unit happens to be a valid UCUM unit I produce what's above, but if not I produce:

        <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-allowedUnits">
            <valueCodeableConcept>
                <text value="kilogram"/>
            </valueCodeableConcept>
        </extension>

I'm sure it's undesirable, but is it invalid?

view this post on Zulip Lloyd McKenzie (Jun 06 2017 at 08:28):

As defined, you can only have one repetition of that type of extension. And because there's a required binding to UCUM, you couldn't use plain text by itself either

view this post on Zulip Grahame Grieve (Jun 07 2017 at 01:07):

shouldn't you do the first as a mapping to a value set?

view this post on Zulip Grahame Grieve (Jun 07 2017 at 01:07):

and are you constraining the unit, or the system/code in the second case?


Last updated: Apr 12 2022 at 19:14 UTC