简体   繁体   中英

Can a FHIR extension be defined within the StructureDefinition of a profiled resource?

Does a FHIR extension always have to be defined in its own StructureDefinition before it can be used in a resource profile?

Or can its definition exist solely within the StructureDefinition of a profiled resource?

Eg

<StructureDefinition xmlns="http://hl7.org/fhir">
        <base value="http://hl7.org/fhir/StructureDefinition/Order" />
        <name value="Order" />
        ...
            <differential>
                <element>
                    <path value="Order.extension" />
                    <name value="type" />
                    <label value="Type" />
                    <short value="BookAppointment | TelephonePatient | PatientNote | Note | Other" />
                    <definition value="Order type" />
                    <min value="1" />
                    <max value="1" />
                    <type>
                        <code value="code" />
                    </type>
                    <binding>
                        <strength value="required" />
                        <valueSetReference>
                            <reference value="http://test.org/fhir/ValueSet/task-type" />
                        </valueSetReference>
                    </binding>
                </element>
            ...

Is the above valid?

No, that's not valid - because Order.extension can't have a type of "code". You could, in theory, slice extension and constrain the value[x] type to be valueCode with the specified properties. You'd also have to constrain the URL to a specified fixed value. The tricky part is that the URL you indicate as the fixed value is supposed to resolve to a StructureDefinition that defines the extension. So you really won't have saved yourself any work. Sending an instance where any immediate receiver can't discover the extension definition would make you automatically non-conformant.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM