FHIR Chat · SimpleQuantity to Quantity · shorthand

Stream: shorthand

Topic: SimpleQuantity to Quantity


view this post on Zulip Osaid Nabulsi (Aug 03 2021 at 10:25):

hello all, I am new in FHIR, I am trying to convert the datatype of an element from "SimpleQuantity" to "Quantity" but when I run SUSHI it gets an error, could anyone help me to explain that ?

  • element only Quantity

view this post on Zulip Ewout Kramer (Aug 03 2021 at 10:31):

(removed)

view this post on Zulip Chris Moesel (Aug 03 2021 at 12:39):

Hi @Osaid Nabulsi -- one of the rules about creating profiles in FHIR is that you can only constrain things to be narrower. For example, if something has cardinality 0..1, you can constrain it to 1..1 because that is narrower than 0..1, but you cannot constrain it to 0..2 because that is wider (e.g., there are values in 0..2 that would not fit into the original 0..1 cardinality).

This applies to types as well. SimpleQuantity constrains normal Quantity by applying more rules/requirements to it. So... you cannot replace SimpleQuantity with Quantity because Quantity is "wider" than SimpleQuantity. You can only replace SimpleQuantity with a type that constrains SimpleQuantity further.

It can be a hard concept to explain. Hopefully I have explained it ok.


Last updated: Apr 12 2022 at 19:14 UTC