FHIR Chat · Validation error · conformance

Stream: conformance

Topic: Validation error


view this post on Zulip David Hay (Aug 08 2019 at 22:16):

What does the following error mean (from the hapi 4 validator):

Could not match discriminator (url) for slice Patient.extension:dhb in profile http://clinfhir.com/fhir/StructureDefinition/MyPatient - does not have fixed value, binding or existence assertions

I'm using forge to add a simple extension to a profile on Patient (I also used forge to create the extension, and then just added it to the profile and saved.

Am I missing a step in Forge perhaps?

here's the profile XML (from forge) with the extraneous bits removed for clarify:

<element id="Patient.extension">
        <path value="Patient.extension" />
        <slicing>
            <discriminator>
                <type value="value" />
                <path value="url" />
            </discriminator>
            <description value="Extensions are always sliced by (at least) url" />
            <rules value="open" />
        </slicing>

        <min value="0" />
        <max value="*" />
        <base>
            <path value="DomainResource.extension" />
            <min value="0" />
            <max value="*" />
        </base>
        <type>
            <code value="Extension" />
        </type>

    </element>
    <element id="Patient.extension:dhb">
        <path value="Patient.extension" />
        <sliceName value="dhb" />

        <min value="0" />
        <max value="1" />
        <base>
            <path value="DomainResource.extension" />
            <min value="0" />
            <max value="*" />
        </base>
        <type>
            <code value="Extension" />
            <profile value="http://clinfhir.com/fhir/StructureDefinition/dhb" />
        </type>

    </element>

view this post on Zulip David Hay (Aug 08 2019 at 22:43):

and the sample patient:

<Patient xmlns="http://hl7.org/fhir">
    <id value="patientTest"/>
    <meta>
        <versionId value="7"/>
        <lastUpdated value="2019-06-20T03:29:47.050+00:00"/>
        <profile value="http://clinfhir.com/fhir/StructureDefinition/MyPatient"/>
    </meta>
    <text>
        <status value="generated"/>
        <div xmlns="http://www.w3.org/1999/xhtml">Patient 2</div>
    </text>

    <extension url="http://clinfhir.com/fhir/StructureDefinition/dhb">
        <valueCodeableConcept>
            <coding>
                <system value="http://standards.digital.health.nz/fhir/CodeSystem/nzinfosource"/>
                <code value="BREG"/>
            </coding>

        </valueCodeableConcept>

    </extension>
</Patient>

view this post on Zulip Grahame Grieve (Aug 08 2019 at 23:11):

Is it a problem if you use the stand alone validator (the current one)?

view this post on Zulip David Hay (Aug 08 2019 at 23:16):

Haven't checked - will download and have a try.

view this post on Zulip David Hay (Aug 08 2019 at 23:19):

Got it! the Extension.url element in the definition was missing the fixedUrl element. I added that manually and the error disappeared. So I need to figure out how to add that in forge...

view this post on Zulip Michel Rutten (Aug 12 2019 at 11:02):

Indeed, there is a known bug in the latest Forge R4 release, which causes the (mandatory) Extension.url element in an Extension definition to be omitted from the generated output. According to FHIR, this is invalid. This bug will be fixed in the next release.


Last updated: Apr 12 2022 at 19:14 UTC