FHIR Chat · Valid values for a Quantity · implementers

Stream: implementers

Topic: Valid values for a Quantity


view this post on Zulip Diego Bosca (Jul 10 2019 at 14:04):

Is there any way to define in a profile what is the valid value range of a quantity?
for example, I want to define that a length is between 0 and 1000 meters.
Should this be modeled with an invariant or maybe define an extension?

view this post on Zulip Diego Bosca (Jul 10 2019 at 14:55):

In Forge it is possible to define the values for minValueDecimal and maxValueDecimal, but I haven't been able to find these on the data types specification

view this post on Zulip Grahame Grieve (Jul 10 2019 at 22:58):

ElementDefinition has minValue and maxValue

view this post on Zulip Diego Bosca (Jul 11 2019 at 08:06):

oh, so there they are!
Thanks Grahame

view this post on Zulip Diego Bosca (Jul 11 2019 at 19:01):

What is preferred, to constraint each attribute with the minValueDecimal (for value attribute), fixedCode (for code attribute)& fixedUri (for system attribute) or just put a minValueQuantity with all the values? is minValueQuantity.system (or code) interpreted as the needed value? in this case should I also define maxValueQuantity with value, system and code if I have to provide a max value?

view this post on Zulip Grahame Grieve (Jul 11 2019 at 20:22):

those are good questions. The first question is whether you want to fix the unit or not

view this post on Zulip Grahame Grieve (Jul 11 2019 at 20:23):

you can specify a min/max value without fixing the units.

view this post on Zulip Grahame Grieve (Jul 11 2019 at 20:23):

and I think I'd do it that way anyway - minValueQuantity and maxValueQuantity, and also fix the unit

view this post on Zulip John Silva (Jul 11 2019 at 20:30):

would it make sense if you expect different units that you would need to spec the units? -- 40 to 240 cm is quite different from 40 to 240 m (or inches)

view this post on Zulip Diego Bosca (Jul 12 2019 at 08:01):

yes, actually I need to constraint 2 (or more) different quantities as alternatives with their own ranges and units. I don't think I've seen an observation with this kind of alternative on Observation.value[x]


Last updated: Apr 12 2022 at 19:14 UTC