FHIR contained practionner in generalPractitioner

329 views Asked by At

In the (last) FHIR specification (v1.8.0), it's mentioned that a contained resource can be embedded in a Reference (documentation), when no reference exists.

But, by looking at the XSD, I can't figure out how to validate the XML against the patient.xsd with such a mechanism.

Here is my attempt

<?xml version="1.0" encoding="UTF-8"?>
<Patient xmlns="http://hl7.org/fhir">
    <identifier>
        <system value="urn:oid:1.2.250.1.311.1.1"/>
        <value value="2000100439"/>
        <assigner>
            <display value="ap-hm"/>
        </assigner>
    </identifier>
    <name>
        <use value="official"/>
        <family value="COPTER"/>
        <given value="ELI"/>
    </name>
    <gender value="male"/>
    <birthDate value="1954-08-14"/>
    <deceasedBoolean value="false"/>
    <address>
        <use value="home"/>
        <line value="45 boulevard des cigales"/>
        <city value="MARSEILLE 10"/>
        <postalCode value="13010"/>
    </address>
    <maritalStatus>
        <coding>
            <system value="http://hl7.org/fhir/v3/MaritalStatus"/>
            <code value="U"/>
        </coding>
    </maritalStatus>
    <generalPractitioner>
        <contained>
            <Practitioner>
                <id value="p1"/>
                <name>
                    <family value="PASTEUR"/>
                    <given value="LOUIS"/>
                </name>
                <address>
                    <city>MARSEILLE</city>
                    <postalCode>13005</postalCode>
                </address>
                <gender value="male"/>
            </Practitioner>
        </contained>
    </generalPractitioner>
</Patient>

What is the correct way to have a contained reference ?

1

There are 1 answers

3
Lloyd McKenzie On

All contained resources are sent near the top using the "contained" element. They are then referenced as a local reference. So your example would look as follows:

<?xml version="1.0" encoding="UTF-8"?>
<Patient xmlns="http://hl7.org/fhir">
    <contained>
        <Practitioner>
            <id value="p1"/>
            <name>
                <family value="PASTEUR"/>
                <given value="LOUIS"/>
            </name>
            <address>
                <city>MARSEILLE</city>
                <postalCode>13005</postalCode>
            </address>
            <gender value="male"/>
        </Practitioner>
    </contained>
    <identifier>
        <system value="urn:oid:1.2.250.1.311.1.1"/>
        <value value="2000100439"/>
        <assigner>
            <display value="ap-hm"/>
        </assigner>
    </identifier>
    <name>
        <use value="official"/>
        <family value="COPTER"/>
        <given value="ELI"/>
    </name>
    <gender value="male"/>
    <birthDate value="1954-08-14"/>
    <deceasedBoolean value="false"/>
    <address>
        <use value="home"/>
        <line value="45 boulevard des cigales"/>
        <city value="MARSEILLE 10"/>
        <postalCode value="13010"/>
    </address>
    <maritalStatus>
        <coding>
            <system value="http://hl7.org/fhir/v3/MaritalStatus"/>
            <code value="U"/>
        </coding>
    </maritalStatus>
    <generalPractitioner>
        <reference value="#p1"/>
    </generalPractitioner>
</Patient>