<StructureDefinition xmlns="http://hl7.org/fhir">
  <id value="TMTServiceRequest" />
  <url value="http://hl7.org.nz/StructureDefinition/TMTServiceRequest" />
  <version value="0.1" />
  <name value="TMTServiceRequest" />
  <title value="TMT Referral FHIR Profile" />
  <status value="active" />
  <contact>
    <name value="WenYi Lin" />
    <telecom>
      <system value="email" />
      <value value="WenYi.Lin@healthshare.co.nz" />
      <use value="work" />
    </telecom>
  </contact>
  <description value="The referral FHIR resource profile for Te Manawa Taki region." />
  <purpose value="To be used for building referral resource within Te Manawa Taki region." />
  <fhirVersion value="4.0.1" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="ServiceRequest" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/ServiceRequest" />
  <derivation value="constraint" />
  <differential>
    <element id="ServiceRequest.extension">
      <path value="ServiceRequest.extension" />
      <slicing>
        <discriminator>
          <type value="value" />
          <path value="url" />
        </discriminator>
        <rules value="open" />
      </slicing>
      <min value="0" />
    </element>
    <element id="ServiceRequest.extension:referralpriority">
      <path value="ServiceRequest.extension" />
      <sliceName value="referralpriority" />
      <min value="0" />
      <type>
        <code value="Extension" />
        <profile value="http://hl7.org.nz/fhir/StructureDefinition/referral-priority" />
      </type>
      <isModifier value="false" />
    </element>
    <element id="ServiceRequest.identifier">
      <path value="ServiceRequest.identifier" />
      <label value="Referral ID" />
      <short value="Identifiers assigned to this service request" />
      <definition value="Identifiers assigned to this service request instance by the referrer and/or the receiver and/or order fulfiller." />
    </element>
    <element id="ServiceRequest.instantiatesCanonical">
      <path value="ServiceRequest.instantiatesCanonical" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.instantiatesUri">
      <path value="ServiceRequest.instantiatesUri" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.basedOn">
      <path value="ServiceRequest.basedOn" />
      <label value="Linking Referral" />
      <max value="1" />
    </element>
    <element id="ServiceRequest.replaces">
      <path value="ServiceRequest.replaces" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.requisition">
      <path value="ServiceRequest.requisition" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.status">
      <path value="ServiceRequest.status" />
      <label value="Referral Status" />
      <short value="draft | active | on-hold | revoked | completed | entered-in-error | unknown | accepted | expired | pending | rejected" />
      <example>
        <label value="Status" />
        <valueCode value="Accepted" />
      </example>
      <isModifierReason value="Need to map this HL7 User Defined Table 0283 - Referral Status." />
    </element>
    <element id="ServiceRequest.category">
      <path value="ServiceRequest.category" />
      <label value="Referred to Service" />
      <comment value="There may be multiple axis of categorization depending on the context or use case for retrieving or displaying the resource.  The level of granularity is defined by the category concepts in the value set.&#xD;&#xA;&#xD;&#xA;461000210102 New Zealand health service type reference set" />
    </element>
    <element id="ServiceRequest.priority">
      <path value="ServiceRequest.priority" />
      <label value="Referral Priority" />
      <short value="routine | urgent | asap | stat | semi urgent" />
      <requirements value="Need to map this to User Defined 99 NZPriority - Referral Priority" />
    </element>
    <element id="ServiceRequest.doNotPerform">
      <path value="ServiceRequest.doNotPerform" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.code">
      <path value="ServiceRequest.code" />
      <label value="Intended Procedure Code" />
      <comment value="Many laboratory and radiology procedure codes embed the specimen/organ system in the test order name, for example,  serum or serum/plasma glucose, or a chest x-ray. The specimen might not be recorded separately from the test code.&#xD;&#xA;SNOMED CT Procedure (71388002) Hierarchy" />
    </element>
    <element id="ServiceRequest.orderDetail">
      <path value="ServiceRequest.orderDetail" />
      <definition value="Additional details and instructions about the how the services are to be delivered.   For example, and order for a urinary catheter may have an order detail for an external or indwelling catheter, or an order for a bandage may require additional instructions specifying how the bandage should be applied. &#xD;&#xA;&#xD;&#xA;Referral Source : 397663001 Referral source&#xD;&#xA;Faster cancer Treatment Indicator&#xD;&#xA;Suspcion of Cancer: 162572001 Suspected malignancy (situation)" />
    </element>
    <element id="ServiceRequest.quantity[x]">
      <path value="ServiceRequest.quantity[x]" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.subject">
      <path value="ServiceRequest.subject" />
      <label value="Patient" />
      <comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.&#xD;&#xA;Patient NHI" />
    </element>
    <element id="ServiceRequest.occurrence[x]">
      <path value="ServiceRequest.occurrence[x]" />
      <label value="Optimal Date for Service" />
    </element>
    <element id="ServiceRequest.authoredOn">
      <path value="ServiceRequest.authoredOn" />
      <label value="Referral Received Date" />
    </element>
    <element id="ServiceRequest.requester">
      <path value="ServiceRequest.requester" />
      <label value="Referrer" />
      <comment value="This not the dispatcher, but rather who is the authorizer.  This element is not intended to handle delegation which would generally be managed through the Provenance resource.&#xD;&#xA;HPI CPN, Facility, Organisation" />
    </element>
    <element id="ServiceRequest.requester.identifier">
      <path value="ServiceRequest.requester.identifier" />
      <label value="HPI CPN" />
      <example>
        <label value="HPI CPN" />
        <valueIdentifier>
          <use value="official" />
          <system value="HPICPNFHIRResource" />
          <value value="00XXXX" />
        </valueIdentifier>
      </example>
    </element>
    <element id="ServiceRequest.performer">
      <path value="ServiceRequest.performer" />
      <comment value="If multiple performers are present, it is interpreted as a list of *alternative* performers without any preference regardless of order.  If order of preference is needed use the [request-performerOrder extension](extension-request-performerorder.html).  Use CareTeam to represent a group of performers (for example, Practitioner A *and* Practitioner B).&#xD;&#xA;HPI CPN, HPI Facility, HPI Organisation" />
    </element>
    <element id="ServiceRequest.locationCode">
      <path value="ServiceRequest.locationCode" />
      <label value="Organisation of Receiving Service" />
      <comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.&#xD;&#xA;HPI Facility, HPI Organisation" />
      <example>
        <label value="Organisation GCode" />
        <valueCodeableConcept>
          <text value="G000XX" />
        </valueCodeableConcept>
      </example>
    </element>
    <element id="ServiceRequest.locationReference.identifier">
      <path value="ServiceRequest.locationReference.identifier" />
      <label value="HPI" />
      <example>
        <label value="Facility Id" />
        <valueIdentifier>
          <use value="official" />
          <system value="HPIFHIRResourceURI" />
          <value value="F03076" />
        </valueIdentifier>
      </example>
    </element>
    <element id="ServiceRequest.reasonCode">
      <path value="ServiceRequest.reasonCode" />
      <label value="Reason for Referral" />
      <comment value="This element represents why the referral is being made and may be used to decide how the service will be performed, or even if it will be performed at all.   Use `CodeableConcept.text` element if the data is free (uncoded) text as shown in the [CT Scan example](servicerequest-example-di.html).&#xD;&#xA;&#xD;&#xA;404684003 Clinical finding" />
    </element>
    <element id="ServiceRequest.insurance">
      <path value="ServiceRequest.insurance" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.specimen">
      <path value="ServiceRequest.specimen" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.bodySite">
      <path value="ServiceRequest.bodySite" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.patientInstruction">
      <path value="ServiceRequest.patientInstruction" />
      <max value="0" />
    </element>
    <element id="ServiceRequest.relevantHistory.identifier">
      <path value="ServiceRequest.relevantHistory.identifier" />
      <label value="Referrer Referral ID" />
    </element>
  </differential>
</StructureDefinition>