{
  "resourceType": "StructureDefinition",
  "id": "ServiceRequest",
  "url": "https://fhir.centraxx.de/StructureDefinition/ServiceRequest",
  "version": "2025.4.0",
  "name": "ServiceRequest",
  "status": "active",
  "publisher": "Kairos an IQVIA business",
  "description": "Represents a CentraXX ServiceRequest.",
  "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": "closed"
        },
        "min": 2,
        "max": "4",
        "type": [
          {
            "code": "Extension"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.extension:updateWithOverwrite",
        "path": "ServiceRequest.extension",
        "sliceName": "updateWithOverwrite",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.centraxx.de/extension/updateWithOverwrite"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.extension:status",
        "path": "ServiceRequest.extension",
        "sliceName": "status",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.centraxx.de/extension/serviceRequest/status"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.extension:requester",
        "path": "ServiceRequest.extension",
        "sliceName": "requester",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.centraxx.de/extension/serviceRequest/requester"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.extension:laborMappings",
        "path": "ServiceRequest.extension",
        "sliceName": "laborMappings",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.centraxx.de/extension/serviceRequest/laborMappings"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier",
        "path": "ServiceRequest.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "exists",
              "path": "type"
            }
          ],
          "rules": "closed"
        },
        "min": 1,
        "max": "*",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier:requestId",
        "path": "ServiceRequest.identifier",
        "sliceName": "requestId",
        "min": 1,
        "max": "1",
        "constraint": [
          {
            "key": "sre-cxx-1",
            "severity": "error",
            "human": "ServiceRequest must consist of numbers only",
            "expression": "value.matches('^[0-9]+$')",
            "source": "https://fhir.centraxx.de/StructureDefinition/ServiceRequest"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier:requestId.type",
        "path": "ServiceRequest.identifier.type",
        "min": 0,
        "max": "0",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier:requestId.system",
        "path": "ServiceRequest.identifier.system",
        "min": 1,
        "max": "1",
        "fixedString": "https://fhir.centraxx.de/system/serviceRequest/requestId",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier:requestId.value",
        "path": "ServiceRequest.identifier.value",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier:idContainerType",
        "path": "ServiceRequest.identifier",
        "sliceName": "idContainerType",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.centraxx.de/StructureDefinition/IdContainerType"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.status",
        "path": "ServiceRequest.status",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.intent",
        "path": "ServiceRequest.intent",
        "min": 1,
        "fixedString": "order",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.category",
        "path": "ServiceRequest.category",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.centraxx.de/valueSet/serviceRequest/type"
        }
      },
      {
        "id": "ServiceRequest.subject",
        "path": "ServiceRequest.subject",
        "comment": "A CXX service request does not have a patient reference yet.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.centraxx.de/StructureDefinition/Patient"
            ]
          }
        ],
        "fixedReference": {
          "reference": "Patient/notexisting"
        },
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.occurrence[x]",
        "path": "ServiceRequest.occurrence[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.authoredOn",
        "path": "ServiceRequest.authoredOn",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.performer",
        "path": "ServiceRequest.performer",
        "min": 0,
        "max": "2",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.centraxx.de/StructureDefinition/Organization",
              "https://fhir.centraxx.de/StructureDefinition/Person"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.supportingInfo",
        "path": "ServiceRequest.supportingInfo",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.centraxx.de/StructureDefinition/ResearchStudy",
              "https://fhir.centraxx.de/StructureDefinition/Organization",
              "https://fhir.centraxx.de/StructureDefinition/DocumentReference"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.specimen",
        "path": "ServiceRequest.specimen",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.centraxx.de/StructureDefinition/Specimen"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.note",
        "path": "ServiceRequest.note",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.note.text",
        "path": "ServiceRequest.note.text",
        "min": 1,
        "max": "1",
        "mustSupport": true
      }
    ]
  }
}