FHIR Chat · Requested change for Range Constraint rng-2 · fhir/infrastructure-wg

Stream: fhir/infrastructure-wg

Topic: Requested change for Range Constraint rng-2


view this post on Zulip Kurt Allen (Jan 24 2020 at 14:35):

I am seeing an issue with the Range constraint rng-2 when I use a range or quantity as a pattern and don't set the range value.
i.e. I am constraining the system and code, but not the value.

"patternRange": {
"low": {
"system": "http://unitsofmeasure.org",
"code": "tot"
},
"high": {
"system": "http://unitsofmeasure.org",
"code": "tot"
}

When I run the IG publisher, I get an error from Range constraint rng-2

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: tructureDefinition.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 Range constraint rng-2 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?

@Lloyd McKenzie had the following comment about this in the original thread.
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.

view this post on Zulip Grahame Grieve (Jan 24 2020 at 20:06):

yew please create a task

view this post on Zulip Kurt Allen (Jan 30 2020 at 15:23):

thx...
https://jira.hl7.org/browse/FHIR-25736


Last updated: Apr 12 2022 at 19:14 UTC