FHIR Chat · pattern & Extensions · implementers

Stream: implementers

Topic: pattern & Extensions


view this post on Zulip Patrick Werner (Feb 04 2021 at 11:41):

The java validator throws an error if i add an Extension to a primitive datatype which is pattern constrained. I always was under the impression if i add a pattern to a field it is still valid to add extensions and still fulfil the pattern.

view this post on Zulip Patrick Werner (Feb 04 2021 at 11:41):

Maybe my impression was wrong, but how can i add an extension to a pattern on string?

view this post on Zulip Patrick Werner (Feb 04 2021 at 11:41):

fyi: @Maximilian Reith feel free to add the test case and/or validator output

view this post on Zulip Maximilian Reith (Feb 04 2021 at 11:59):

For Example:

<element id="AllergyIntolerance.category">
<path value="AllergyIntolerance.category"/>
<patternCode value="food"/>
</element>
<element id="AllergyIntolerance.category.extension">
<path value="AllergyIntolerance.category.extension"/>
<slicing>
<discriminator>
<type value="value"/>
<path value="url"/>
</discriminator>
<rules value="open"/>
</slicing>
</element>
<element id="AllergyIntolerance.category.extension:myExtension">
<path value="AllergyIntolerance.category.extension"/>
<sliceName value="myExtension"/>
<type>
<code value="Extension"/>
<profile value="https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Terminology_German"/>
</type>
</element>

This will lead to failure:
No extension allowed, since the fixedValue does not inherit any extensions. (German Translation)

It is a fictive example, but demonstrates the problem

view this post on Zulip Maximilian Reith (Feb 04 2021 at 13:19):

Excerpt of example
<category value="food">
<extension url="https://fhir.kbv.de/StructureDefinition/KBV_EX_Base_Terminology_German">
<extension url="content">
<valueString value="Nahrungsmittel" />
</extension>
</extension>
</category>

view this post on Zulip Lloyd McKenzie (Feb 04 2021 at 15:20):

Can you capture this as an issue against the Java validator? (https://github.com/hapifhir/org.hl7.fhir.core)

view this post on Zulip Grahame Grieve (Feb 04 2021 at 20:13):

and provide a test case for the validator test cases

view this post on Zulip Grahame Grieve (Feb 04 2021 at 20:13):

a PR against the test cases would be nice


Last updated: Apr 12 2022 at 19:14 UTC