# Possible bug: Proportion with no type

**URL:** <https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162>\
**Category:** Clinical\
**Tags:** archetype\
**Created:** [2 May 2024 04:51 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162 "2024-05-02T04:51:44Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [2 May 2024 04:51 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/1 "2024-05-02T04:51:45Z")

</div>

The [ACTION transfusion archetype](https://ckm.openehr.org/ckm/archetypes/1013.1.192) has the field ‘Proportion administered’ [at0016] of type DV\_PROPORTION. However, there is no PROPORTION\_TYPE; it should be 2, indicating a percentage. This archetype would presumably not parse properly in at least some tools.

---

<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:** [2 May 2024 06:32 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/2 "2024-05-02T06:32:38Z")

</div>

Thanks Thomas! This archetype hasn’t been worked on for a while, and as it was originally created more than 15 years ago the tooling at the time probably didn’t enforce this. Could I ask you to [add a change request](https://ckm.openehr.org/ckm/archetypes/1013.1.192/changerequests) for this in the CKM, so we can track it?

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [3 May 2024 03:12 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/3 "2024-05-03T03:12:41Z")

</div>

> [@thomas.beale](#):
>
> The [ACTION transfusion archetype](https://ckm.openehr.org/ckm/archetypes/1013.1.192) has the field ‘Proportion administered’ [at0016] of type DV\_PROPORTION. However, there is no PROPORTION\_TYPE; it should be 2, indicating a percentage. This archetype would presumably not parse properly in at least some tools.

It’s done.

Possibly all archetypes with fields of type DV\_PROPORTION and type = 2 (percentage) should have those fields changed to DV\_QUANTITY with % units? THat wasn’t a thing we could do with UCUM in the old days, but it is now.

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [3 May 2024 06:25 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/4 "2024-05-03T06:25:45Z")

</div>

I’d hesitate to make those changes for established, published archetypes, unless another breaking change is required. And there are some exceptions like FiO2 where a proportion is actually a better fit.

Probably good advice, in general though that UCUM % should be the goto option in most cases. Is this worth documenting in the specs?

Are those edge cases where a particular datapoint like FiO2, is expressed as ‘equivalent ’ ratio/percent’ i.e FiO2/%O2 ,so rare that in time we should deprecate the percent type on proportion?

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [3 May 2024 06:32 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/5 "2024-05-03T06:32:55Z")

</div>

> [@ian.mcnicoll](#):
>
> Are those edge cases where a particular datapoint like FiO2, is expressed as ‘equivalent ’ ratio/percent’ i.e FiO2/%O2 ,so rare that in time we should deprecate the percent type on proportion

I would suggest doing that anyway. It just means: don’t create new archetypes / data points that represent percentage this way, it doesn’t stop the existing ones working.

---

<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:** [3 May 2024 11:12 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/6 "2024-05-03T11:12:23Z")

</div>

Just to remind everyone, we’ve discussed this before, but I don’t think we had a clear conclusion back then. What has made you more sure now than you were then, @thomas.beale?

[Percent as DV\_PROPORTION or DV\_QUANTITY - Clinical - openEHR](https://discourse.openehr.org/t/percent-as-dv-proportion-or-dv-quantity/2331)

---

<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:** [3 May 2024 14:54 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/7 "2024-05-03T14:54:17Z")

</div>

> [@thomas.beale](#):
>
> This archetype would presumably not parse properly in at least some tools.

I agree with you that this should be “2” in this case and that UCUM % may be helpful here as well and that this removes the need for a DV\_PROPORTION in some cases in favour of a DV\_QUANTITY nowadays (whether that is desirable or not I will not comment on here).

However, one question fro my understanding: why should this archetype not parse or not be validated if the _type_ is not pre-constrained in the archetype, what am I missing?

Yes, _type_ is a mandatory attribute of [DV\_PROPORTION](https://specifications.openehr.org/releases/RM/latest/data_types.html#_dv_proportion_class), but so are _nominator_ and _denominator_. So in data, they need to be present, but neither of them absolutely needs to be constrained at archetype level? (For _type_ it may be a lot more common to constrain on archetype level than especially for the _nominator_ of course.)

You can do the same in Archetype Designer today as well btw - just leave all 5 PROPORTION\_KINDs checked for DV\_PROPORTION and it will not constrain the type (or just check a few).

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [3 May 2024 15:56 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/8 "2024-05-03T15:56:28Z")

</div>

> [@sebastian.garde](#):
>
> Yes, _type_ is a mandatory attribute of [DV\_PROPORTION](https://specifications.openehr.org/releases/RM/latest/data_types.html#_dv_proportion_class), but so are _nominator_ and _denominator_. So in data, they need to be present, but neither of them absolutely needs to be constrained at archetype level? (For _type_ it may be a lot more common to constrain on archetype level than especially for the _nominator_ of course.)

All true (as usual 😉 - but I would say that if DV\_PROPORTION is going to be constrained at all (rather than just stating that the data point is of that type), I’m not sure if it makes sense to not constrain the type field, since that’s pretty integral to what that data point means.

---

<div class="post-metadata">

**Author:** ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)\
**Post date:** [3 May 2024 17:48 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/9 "2024-05-03T17:48:46Z")

</div>

> [@sebastian.garde](#):
>
> However, one question fro my understanding: why should this archetype not parse or not be validated if the _type_ is not pre-constrained in the archetype, what am I missing?

That is the sign we are missing a formalization layer. In the RM the field is required but have the choice of any values from the PROPORTION\_KIND.

AOM is totally independent from the RM, so doesn’t know it needs to have a constraint for a specific value, just say a value is required.

At this level, in terms of formal conformance, the archetypes is totally valid.

You know all that, this is my point: we have this informal “does/doesn’t make sense” thing, and this is not the first time. IMO we need to find a way to express those kinds of informal agreements or patterns in guides the whole community can follow. Without that, all the “agreements” are buried in some conversation somewhere.

We could define different levels of guides, from “recommendations” to more strong rules to avoid issues when modeling or implementing, and only for things that are not RM or AOM but are kind of in between or on top of those specs. That way we could implement a whole set of extra rules and automate their checking, without breaking the specs, which will also contribute to conformance verification as another layer.

---

<div class="post-metadata">

**Author:** ![joostholslag](https://discourse.openehr.org/user_avatar/discourse.openehr.org/joostholslag/32/1981_2.png) [@joostholslag](https://discourse.openehr.org/u/joostholslag)\
**Post date:** [4 May 2024 07:44 UTC](https://discourse.openehr.org/t/possible-bug-proportion-with-no-type/5162/10 "2024-05-04T07:44:29Z")

</div>

> [@pablo](#):
>
> You know all that, this is my point: we have this informal “does/doesn’t make sense” thing, and this is not the first time. IMO we need to find a way to express those kinds of informal agreements or patterns in guides the whole community can follow. Without that, all the “agreements” are buried in some conversation somewhere.

Agreed. The clinical program has a style guide on confluence. Let’s at least start collecting these examples on the specifications confluence. Can be scrap book level for now, and work from there.
