FHIR Chat · Issues using Range as a Pattern · IG creation

Stream: IG creation

Topic: Issues using Range as a Pattern


view this post on Zulip Kurt Allen (Jan 14 2020 at 18:25):

So I want to use a Range item as a pattern as follows:
{
"id": "Observation.component:observedCount.value[x]:observedCount/range",
"path": "Observation.component.value[x]",
"sliceName": "observedCount/range",
...
"patternRange": {
"low": {
"system": "http://unitsofmeasure.org",
"code": "tot"
},
"high": {
"system": "http://unitsofmeasure.org",
"code": "tot"
}
},
...
}

I intentionally do not set values for the high and low range, because I am only intending to constrain the system and code values.

When I run the IG publisher, I get the following (non fatal) errors.

StructureDefinition/AbnormalityCyst: StructureDefinition.snapshot.element[75].pattern.ofType(Range) error
rng-2: If present, low SHALL have a lower value than high [low.empty() or high.empty() or (low <= high)]
StructureDefinition/AbnormalityCyst: StructureDefinition.snapshot.element[113].pattern.ofType(Range)
error rng-2: If present, low SHALL have a lower value than high [low.empty() or high.empty() or (low <= high)]

Obviously the rule is that the low value should be greater than the high value and since neither are set that is not true,
though it is also not false (kinda a quantum mechanics kind of thing :-)).

Should the rule be changed to ignore unset values in patterns?

The same problem occurs with Quantity.

view this post on Zulip Lloyd McKenzie (Jan 14 2020 at 18:29):

There could be situations where the low or high value are expressed with an extension (e.g. because it's a formula rather than a fixed value), so this would be a problem there too. I'd be in favor of revising the invariant to say low.value.empty() or high.value.empty() instead, which would address this issue.


Last updated: Apr 12 2022 at 19:14 UTC