Closed ArdonToonstra closed 1 year ago
see #55
my regex
from fhir.resources.fhirtypes import Id
Id.configure_constraints(regex=re.compile(r"^[A-Za-z0-9\-\.]+(\[x\](\.[a-zA-Z]+)?)?(:[A-Za-z0-9\-.]+(\[x\](\.[a-zA-Z]+)?)?)?$"))
Id.configure_constraints(max_length=128)
``
Thanks! That works. Will close the issue.
Description
I am trying to parse our created logical models in StructueDefinitions. For a few elements, we have defined polymorphic elements, like the JSON snippet below. I believe this is valid FHIR.
However, If I try to parse this resource, I get errors, like this:
This is the related definition of the FHIR element: https://www.hl7.org/fhir/element-definitions.html#Element.id which is of type string The constraint is based on: https://www.hl7.org/fhir/datatypes.html#id for type id.
Should this constraint apply to
ElementDefinition.id
? Also, FHIR itself uses [x] in the Element.id : https://www.hl7.org/fhir/observation.profile.json.htmlWhat I Did