Stream: shorthand
Topic: id datatype
Osaid Nabulsi (Jul 28 2021 at 11:19):
hello, I am new in FHIR and I am trying to change the datatype of "id" element into "id" instead of "string" as follows:
- id only id
but when I run SUSHI on the FH files it throws the following error:
"error The type string is not abstract, so it cannot be constrained to the specialization id."
Could anyone help me in explain that or how could I do it ?
Diana_Ovelgoenne (Jul 28 2021 at 11:56):
you cannot change the data type definition
Osaid Nabulsi (Jul 28 2021 at 12:41):
could you explain more in details please ?
Jean Duteau (Jul 28 2021 at 13:13):
there's not much more to say. string has no specializations so you can't change the datatype of an attribute that is declared as string. it will always be string.
Chris Moesel (Jul 28 2021 at 13:35):
Technically, id
is a specialization of string
(see id json), but you cannot constrain a concrete element type to a specialization. You can only constrain it to a profile (e.g., derivation: constraint
). The rules are a bit different if the element type is abstract -- in which case you can constrain it to a specialization. By way of example:
- You cannot constrain
Quantity
toAge
becauseAge
is a specialization of concrete typeQuantity
- You can constrain
Quantity
toSimpleQuantity
becauseSimpleQuantity
is a profile (constraint) ofQuantity
- You can constrain
Resource
to any resource (specialization or profile) becauseResource
is abstract
Last updated: Apr 12 2022 at 19:14 UTC