FHIR Chat · id datatype · shorthand

Stream: shorthand

Topic: id datatype


view this post on Zulip 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 ?

view this post on Zulip Diana_Ovelgoenne (Jul 28 2021 at 11:56):

you cannot change the data type definition

view this post on Zulip Osaid Nabulsi (Jul 28 2021 at 12:41):

could you explain more in details please ?

view this post on Zulip 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.

view this post on Zulip 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 to Age because Age is a specialization of concrete type Quantity
  • You can constrain Quantity to SimpleQuantity because SimpleQuantity is a profile (constraint) of Quantity
  • You can constrain Resource to any resource (specialization or profile) because Resource is abstract

Last updated: Apr 12 2022 at 19:14 UTC