{
  "resourceType": "StructureDefinition",
  "id": "TMTServiceRequest",
  "url": "http://hl7.org.nz/StructureDefinition/TMTServiceRequest",
  "version": "0.1",
  "name": "TMTServiceRequest",
  "title": "TMT Referral FHIR Profile",
  "status": "active",
  "contact": [
    {
      "name": "WenYi Lin",
      "telecom": [
        {
          "system": "email",
          "value": "WenYi.Lin@healthshare.co.nz",
          "use": "work"
        }
      ]
    }
  ],
  "description": "The referral FHIR resource profile for Te Manawa Taki region.",
  "purpose": "To be used for building referral resource within Te Manawa Taki region.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "ServiceRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ServiceRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "ServiceRequest.extension",
        "path": "ServiceRequest.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "ServiceRequest.extension:referralpriority",
        "path": "ServiceRequest.extension",
        "sliceName": "referralpriority",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org.nz/fhir/StructureDefinition/referral-priority"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "ServiceRequest.identifier",
        "path": "ServiceRequest.identifier",
        "label": "Referral ID",
        "short": "Identifiers assigned to this service request",
        "definition": "Identifiers assigned to this service request instance by the referrer and/or the receiver and/or order fulfiller."
      },
      {
        "id": "ServiceRequest.instantiatesCanonical",
        "path": "ServiceRequest.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "ServiceRequest.instantiatesUri",
        "path": "ServiceRequest.instantiatesUri",
        "max": "0"
      },
      {
        "id": "ServiceRequest.basedOn",
        "path": "ServiceRequest.basedOn",
        "label": "Linking Referral",
        "max": "1"
      },
      {
        "id": "ServiceRequest.replaces",
        "path": "ServiceRequest.replaces",
        "max": "0"
      },
      {
        "id": "ServiceRequest.requisition",
        "path": "ServiceRequest.requisition",
        "max": "0"
      },
      {
        "id": "ServiceRequest.status",
        "path": "ServiceRequest.status",
        "label": "Referral Status",
        "short": "draft | active | on-hold | revoked | completed | entered-in-error | unknown | accepted | expired | pending | rejected",
        "example": [
          {
            "label": "Status",
            "valueCode": "Accepted"
          }
        ],
        "isModifierReason": "Need to map this HL7 User Defined Table 0283 - Referral Status."
      },
      {
        "id": "ServiceRequest.category",
        "path": "ServiceRequest.category",
        "label": "Referred to Service",
        "comment": "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.\r\n\r\n461000210102 New Zealand health service type reference set"
      },
      {
        "id": "ServiceRequest.priority",
        "path": "ServiceRequest.priority",
        "label": "Referral Priority",
        "short": "routine | urgent | asap | stat | semi urgent",
        "requirements": "Need to map this to User Defined 99 NZPriority - Referral Priority"
      },
      {
        "id": "ServiceRequest.doNotPerform",
        "path": "ServiceRequest.doNotPerform",
        "max": "0"
      },
      {
        "id": "ServiceRequest.code",
        "path": "ServiceRequest.code",
        "label": "Intended Procedure Code",
        "comment": "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.\r\nSNOMED CT Procedure (71388002) Hierarchy"
      },
      {
        "id": "ServiceRequest.orderDetail",
        "path": "ServiceRequest.orderDetail",
        "definition": "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. \r\n\r\nReferral Source : 397663001 Referral source\r\nFaster cancer Treatment Indicator\r\nSuspcion of Cancer: 162572001 Suspected malignancy (situation)"
      },
      {
        "id": "ServiceRequest.quantity[x]",
        "path": "ServiceRequest.quantity[x]",
        "max": "0"
      },
      {
        "id": "ServiceRequest.subject",
        "path": "ServiceRequest.subject",
        "label": "Patient",
        "comment": "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.\r\nPatient NHI"
      },
      {
        "id": "ServiceRequest.occurrence[x]",
        "path": "ServiceRequest.occurrence[x]",
        "label": "Optimal Date for Service"
      },
      {
        "id": "ServiceRequest.authoredOn",
        "path": "ServiceRequest.authoredOn",
        "label": "Referral Received Date"
      },
      {
        "id": "ServiceRequest.requester",
        "path": "ServiceRequest.requester",
        "label": "Referrer",
        "comment": "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.\r\nHPI CPN, Facility, Organisation"
      },
      {
        "id": "ServiceRequest.requester.identifier",
        "path": "ServiceRequest.requester.identifier",
        "label": "HPI CPN",
        "example": [
          {
            "label": "HPI CPN",
            "valueIdentifier": {
              "use": "official",
              "system": "HPICPNFHIRResource",
              "value": "00XXXX"
            }
          }
        ]
      },
      {
        "id": "ServiceRequest.performer",
        "path": "ServiceRequest.performer",
        "comment": "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).\r\nHPI CPN, HPI Facility, HPI Organisation"
      },
      {
        "id": "ServiceRequest.locationCode",
        "path": "ServiceRequest.locationCode",
        "label": "Organisation of Receiving Service",
        "comment": "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.\r\nHPI Facility, HPI Organisation",
        "example": [
          {
            "label": "Organisation GCode",
            "valueCodeableConcept": {
              "text": "G000XX"
            }
          }
        ]
      },
      {
        "id": "ServiceRequest.locationReference.identifier",
        "path": "ServiceRequest.locationReference.identifier",
        "label": "HPI",
        "example": [
          {
            "label": "Facility Id",
            "valueIdentifier": {
              "use": "official",
              "system": "HPIFHIRResourceURI",
              "value": "F03076"
            }
          }
        ]
      },
      {
        "id": "ServiceRequest.reasonCode",
        "path": "ServiceRequest.reasonCode",
        "label": "Reason for Referral",
        "comment": "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).\r\n\r\n404684003 Clinical finding"
      },
      {
        "id": "ServiceRequest.insurance",
        "path": "ServiceRequest.insurance",
        "max": "0"
      },
      {
        "id": "ServiceRequest.specimen",
        "path": "ServiceRequest.specimen",
        "max": "0"
      },
      {
        "id": "ServiceRequest.bodySite",
        "path": "ServiceRequest.bodySite",
        "max": "0"
      },
      {
        "id": "ServiceRequest.patientInstruction",
        "path": "ServiceRequest.patientInstruction",
        "max": "0"
      },
      {
        "id": "ServiceRequest.relevantHistory.identifier",
        "path": "ServiceRequest.relevantHistory.identifier",
        "label": "Referrer Referral ID"
      }
    ]
  }
}