<StructureDefinition xmlns="http://hl7.org/fhir">
    <id value="Referral" />
    <meta>
        <lastUpdated value="2024-03-13T15:44:30.9674953+00:00" />
    </meta>
    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
        <valueInteger value="1" />
    </extension>
    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
        <valueCode value="pc" />
    </extension>
    <url value="http://hl7.org/fhir/StructureDefinition/Referral" />
    <name value="Referral" />
    <status value="draft" />
    <date value="2024-03-12T14:43:00+01:00" />
    <publisher value="Topicus .Healthcare" />
    <contact>
        <telecom>
            <system value="url" />
            <value value="https://topicus.nl/en/sectors/healthcare" />
        </telecom>
    </contact>
    <description value="Base StructureDefinition for Referral Resource" />
    <fhirVersion value="3.0.2" />
    <mapping>
        <identity value="hcim-healthprofessional-v3.2-2017EN" />
        <uri value="https://zibs.nl/wiki/HealthProfessional-v3.2(2017EN)" />
        <name value="HCIM HealthProfessional-v3.2(2017EN)" />
    </mapping>
    <mapping>
        <identity value="hcim-patient-v3.1-2017EN" />
        <uri value="https://zibs.nl/wiki/Patient-v3.1(2017EN)" />
        <name value="HCIM Patient-v3.1(2017EN)" />
    </mapping>
    <mapping>
        <identity value="hcim-basicelements-v1.0-2017EN" />
        <uri value="https://zibs.nl/wiki/BasicElements-v1.0(2017EN)" />
        <name value="HCIM BasicElements-v1.0(2017EN)" />
    </mapping>
    <kind value="resource" />
    <abstract value="false" />
    <type value="ReferralRequest" />
    <baseDefinition value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
    <derivation value="specialization" />
    <differential>
        <element id="ReferralRequest">
            <path value="ReferralRequest" />
            <short value="A request for referral or transfer of care" />
            <definition value="Used to record and send details about a request for referral service or transfer of a patient to the care of another provider or provider organization." />
            <alias value="ReferralRequest TransferOfCare Request" />
            <constraint>
                <key value="dom-2" />
                <severity value="error" />
                <human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
                <expression value="contained.contained.empty()" />
                <source value="DomainResource" />
            </constraint>
            <constraint>
                <key value="dom-1" />
                <severity value="error" />
                <human value="If the resource is contained in another resource, it SHALL NOT contain any narrative" />
                <expression value="contained.text.empty()" />
                <source value="DomainResource" />
            </constraint>
            <constraint>
                <key value="dom-4" />
                <severity value="error" />
                <human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
                <expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
                <source value="DomainResource" />
            </constraint>
            <constraint>
                <key value="dom-3" />
                <severity value="error" />
                <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource" />
                <expression value="contained.where((&#39;#&#39;+id in %resource.descendants().reference).not()).empty()" />
                <source value="DomainResource" />
            </constraint>
        </element>
        <element id="ReferralRequest.identifier">
            <path value="ReferralRequest.identifier" />
            <short value="Business identifier" />
            <definition value="Business identifier that uniquely identifies the referral/care transfer request instance." />
            <type>
                <code value="Identifier" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.definition">
            <path value="ReferralRequest.definition" />
            <short value="Instantiates protocol or definition" />
            <definition value="A protocol, guideline, orderset or other definition that is adhered to in whole or in part by this request." />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ActivityDefinition" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/PlanDefinition" />
            </type>
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.basedOn">
            <path value="ReferralRequest.basedOn" />
            <short value="Request fulfilled by this request" />
            <definition value="Indicates any plans, proposals or orders that this request is intended to satisfy - in whole or in part." />
            <alias value="fulfills" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/CarePlan" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ProcedureRequest" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.replaces">
            <path value="ReferralRequest.replaces" />
            <short value="Request(s) replaced by this request" />
            <definition value="Completed or terminated request(s) whose function is taken by this new request." />
            <comment value="The replacement could be because the initial request was immediately rejected (due to an issue) or because the previous request was completed, but the need for the action described by the request remains ongoing." />
            <requirements value="Allows tracing the continuation of a therapy or administrative process instantiated through multiple requests." />
            <alias value="supersedes" />
            <alias value="prior" />
            <alias value="renewed order" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
            </type>
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.groupIdentifier">
            <path value="ReferralRequest.groupIdentifier" />
            <short value="Composite request this is part of" />
            <definition value="The business identifier of the logical &quot;grouping&quot; request/order that this referral is a part of." />
            <requirements value="Allows multiple orders to be collected as part of a single requisition." />
            <alias value="grouperId" />
            <alias value="requisition" />
            <max value="1" />
            <type>
                <code value="Identifier" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.status">
            <path value="ReferralRequest.status" />
            <short value="draft | active | suspended | cancelled | completed | entered-in-error | unknown" />
            <definition value="The status of the authorization/intention reflected by the referral request record." />
            <comment value="This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid." />
            <requirements value="Workflow status is handled by the Task resource." />
            <min value="1" />
            <max value="1" />
            <type>
                <code value="code" />
            </type>
            <isModifier value="true" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="ReferralRequestStatus" />
                </extension>
                <strength value="required" />
                <description value="The status of the referral." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/request-status" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.status.completionReason">
            <path value="ReferralRequest.status.completionReason" />
            <short value="Completion reason" />
            <definition value="Reason the referral was completed." />
            <max value="1" />
            <type>
                <code value="Extension" />
                <profile value="http://nictiz.nl/fhir/StructureDefinition/Comment" />
            </type>
        </element>
        <element id="ReferralRequest.status.completionReason.url">
            <path value="ReferralRequest.status.completionReason.url" />
            <fixedUri value="CompletionReason" />
        </element>
        <element id="ReferralRequest.status.completionReason.value[x]:valueString">
            <path value="ReferralRequest.status.completionReason.valueString" />
            <sliceName value="valueString" />
            <type>
                <code value="string" />
            </type>
        </element>
        <element id="ReferralRequest.status.completedBy">
            <path value="ReferralRequest.status.completedBy" />
            <short value="Completed by" />
            <definition value="The practitioner who completed the referral." />
            <max value="1" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-practitioner" />
            </type>
            <mapping>
                <identity value="hcim-healthprofessional-v3.2-2017EN" />
                <map value="NL-CM:17.1.1" />
                <comment value="Practitioner" />
            </mapping>
        </element>
        <element id="ReferralRequest.intent">
            <path value="ReferralRequest.intent" />
            <definition value="Distinguishes the &quot;level&quot; of authorization/demand implicit in this request." />
            <requirements value="The same resource structure is used when capturing proposals/recommendations, plans and actual requests." />
            <alias value="category" />
            <min value="1" />
            <max value="1" />
            <type>
                <code value="code" />
            </type>
            <fixedCode value="plan" />
            <isModifier value="true" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="ReferralCategory" />
                </extension>
                <strength value="required" />
                <description value="Codes identifying the stage lifecycle stage of a request" />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/request-intent" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.type">
            <path value="ReferralRequest.type" />
            <short value="Referral/Transition of care request type" />
            <definition value="An indication of the type of referral (or where applicable the type of transfer of care) request." />
            <max value="1" />
            <type>
                <code value="CodeableConcept" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="ReferralType" />
                </extension>
                <strength value="example" />
                <description value="Codes for types of referral; e.g. consult, transfer, temporary transfer." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/referral-type" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.priority">
            <path value="ReferralRequest.priority" />
            <short value="Urgency of referral / transfer of care request" />
            <definition value="An indication of the urgency of referral (or where applicable the type of transfer of care) request." />
            <max value="1" />
            <type>
                <code value="code" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="ReferralPriority" />
                </extension>
                <strength value="required" />
                <description value="Codes indicating the relative priority of the referral." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/request-priority" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.serviceRequested">
            <path value="ReferralRequest.serviceRequested" />
            <short value="Actions requested as part of the referral" />
            <definition value="The service(s) that is/are requested to be provided to the patient.  For example: cardiac pacemaker insertion." />
            <type>
                <code value="CodeableConcept" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="RequestedService" />
                </extension>
                <strength value="example" />
                <description value="Codes indicating the types of services that might be requested as part of a referral." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/c80-practice-codes" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.subject">
            <path value="ReferralRequest.subject" />
            <short value="Patient referred to care or transfer" />
            <definition value="The patient who is the subject of a referral or transfer of care request." />
            <min value="1" />
            <max value="1" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-patient" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
            <mapping>
                <identity value="hcim-patient-v3.1-2017EN" />
                <map value="NL-CM:0.1.1" />
                <comment value="Patient" />
            </mapping>
        </element>
        <element id="ReferralRequest.context">
            <path value="ReferralRequest.context" />
            <short value="Originating encounter" />
            <definition value="The encounter at which the request for referral or transfer of care is initiated." />
            <alias value="encounter" />
            <max value="1" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.occurrence">
            <path value="ReferralRequest.occurrence" />
            <short value="When the service(s) requested in the referral should occur" />
            <definition value="The period of time within which the services identified in the referral/transfer of care is specified or required to occur." />
            <requirements value="Use cases: saving the start date in Period.start; (1) to indicate that the requested service must happen before a specified date, and saving the end date in Period.end; (2) to indicate that the requested service must happen during the specified dates (&quot;start&quot; and &quot;end&quot; values)." />
            <alias value="timing" />
            <min value="1" />
            <max value="1" />
            <type>
                <code value="Period" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.authoredOn">
            <path value="ReferralRequest.authoredOn" />
            <short value="Date of creation/activation" />
            <definition value="Date/DateTime of creation for draft requests and date of activation for active requests." />
            <alias value="createdOn" />
            <max value="1" />
            <type>
                <code value="dateTime" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.requester">
            <path value="ReferralRequest.requester" />
            <short value="Who/what is requesting service" />
            <definition value="The individual who initiated the request and has responsibility for its activation." />
            <alias value="author" />
            <max value="1" />
            <type>
                <code value="BackboneElement" />
            </type>
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <source value="Element" />
            </constraint>
            <constraint>
                <key value="rfr-1" />
                <severity value="error" />
                <human value="onBehalfOf can only be specified if agent is practitioner or device" />
                <expression value="(agent.resolve() is Device) or (agent.resolve() is Practitioner) or onBehalfOf.exists().not()" />
                <xpath value="contains(f:agent/f:reference/@value, &#39;/Practitioner/&#39;) or contains(f:agent/f:reference/@value, &#39;/Device/&#39;) or not(exists(f:onBehalfOf))" />
            </constraint>
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.requester.agent">
            <path value="ReferralRequest.requester.agent" />
            <short value="Individual making the request" />
            <definition value="The practitioner who initiated the request." />
            <min value="1" />
            <max value="1" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-practitioner" />
            </type>
            <isSummary value="true" />
            <mapping>
                <identity value="hcim-healthprofessional-v3.2-2017EN" />
                <map value="NL-CM:17.1.1" />
                <comment value="Practitioner" />
            </mapping>
        </element>
        <element id="ReferralRequest.requester.onBehalfOf">
            <path value="ReferralRequest.requester.onBehalfOf" />
            <short value="Organization agent is acting for" />
            <definition value="The organization the practitioner was acting on behalf of." />
            <requirements value="Practitioners can be associated with multiple organizations. This element indicates which organization they were acting on behalf of when authoring the request." />
            <max value="1" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-organization" />
            </type>
            <condition value="rfr-1" />
            <isSummary value="true" />
            <mapping>
                <identity value="hcim-healthprofessional-v3.2-2017EN" />
                <map value="NL-CM:17.1.1" />
                <comment value="Practitioner" />
            </mapping>
        </element>
        <element id="ReferralRequest.specialty">
            <path value="ReferralRequest.specialty" />
            <short value="The clinical specialty (discipline) that the referral is requested for" />
            <definition value="Indication of the clinical domain or discipline to which the referral or transfer of care request is sent.  For example: Cardiology Gastroenterology Diabetology." />
            <max value="1" />
            <type>
                <code value="CodeableConcept" />
            </type>
            <isModifier value="false" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="ReferralSpecialty" />
                </extension>
                <strength value="example" />
                <description value="Codes indicating the types of capability the referred to service provider must have." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/practitioner-specialty" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.recipient">
            <path value="ReferralRequest.recipient" />
            <short value="Receiver of referral / transfer of care request" />
            <definition value="The healthcare provider(s) or provider organization(s) who/which is to receive the referral/transfer of care request." />
            <comment value="There will be a primary receiver. But the request can be received by any number of &quot;copied to&quot; providers or organizations." />
            <type>
                <code value="Reference" />
                <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-practitioner" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://fhir.nl/fhir/StructureDefinition/nl-core-organization" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.reasonCode">
            <path value="ReferralRequest.reasonCode" />
            <short value="Reason for referral / transfer of care request" />
            <definition value="Description of clinical condition indicating why referral/transfer of care is requested.  For example:  Pathological Anomalies, Disabled (physical or mental),  Behavioral Management." />
            <type>
                <code value="CodeableConcept" />
            </type>
            <isModifier value="false" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="ReferralReason" />
                </extension>
                <strength value="example" />
                <description value="Codes indicating why the referral is being requested." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/clinical-findings" />
                </valueSetReference>
            </binding>
        </element>
        <element id="ReferralRequest.reasonReference">
            <path value="ReferralRequest.reasonReference" />
            <short value="Why is service needed?" />
            <definition value="Indicates another resource whose existence justifies this request." />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
            </type>
            <isSummary value="true" />
        </element>
        <element id="ReferralRequest.description">
            <path value="ReferralRequest.description" />
            <short value="A textual description of the referral" />
            <definition value="The reason element gives a short description of why the referral is being made, the description expands on this to support a more complete clinical summary." />
            <max value="1" />
            <type>
                <code value="string" />
            </type>
            <isModifier value="false" />
        </element>
        <element id="ReferralRequest.supportingInfo">
            <path value="ReferralRequest.supportingInfo" />
            <short value="Additonal information to support referral or transfer of care request" />
            <definition value="Any additional (administrative, financial or clinical) information required to support request for referral or transfer of care.  For example: Presenting problems/chief complaints Medical History Family History Alerts Allergy/Intolerance and Adverse Reactions Medications Observations/Assessments (may include cognitive and fundtional assessments) Diagnostic Reports Care Plan." />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
            </type>
            <isModifier value="false" />
        </element>
        <element id="ReferralRequest.note">
            <path value="ReferralRequest.note" />
            <short value="Comments made about referral request" />
            <definition value="Comments made about the referral request by any of the participants." />
            <type>
                <code value="Annotation" />
            </type>
        </element>
        <element id="ReferralRequest.relevantHistory">
            <path value="ReferralRequest.relevantHistory" />
            <short value="Key events in history of request" />
            <definition value="Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource." />
            <comment value="This element does not point to the Provenance associated with the *current* version of the resource - as it would be created after this version existed.  The Provenance for the current version can be retrieved with a _revinclude." />
            <alias value="eventHistory" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Provenance" />
            </type>
        </element>
    </differential>
</StructureDefinition>