{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta_ServiceRequest",
  "name": "HESConnecta_ServiceRequest",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "ServiceRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ServiceRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "ServiceRequest.identifier",
        "path": "ServiceRequest.identifier",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.identifier.value",
        "path": "ServiceRequest.identifier.value",
        "min": 1
      },
      {
        "id": "ServiceRequest.status",
        "path": "ServiceRequest.status",
        "short": "active | revoked | completed | entered-in-error",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.intent",
        "path": "ServiceRequest.intent",
        "short": "order",
        "fixedCode": "order",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.code",
        "path": "ServiceRequest.code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.catsalut.cat/r4/mConnectaHES/ValueSet/Verticals-mConnecta"
        }
      },
      {
        "id": "ServiceRequest.subject",
        "path": "ServiceRequest.subject",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.subject.identifier",
        "path": "ServiceRequest.subject.identifier",
        "min": 1,
        "mustSupport": false
      },
      {
        "id": "ServiceRequest.subject.identifier.type.coding.code",
        "path": "ServiceRequest.subject.identifier.type.coding.code",
        "fixedCode": "CIP-CatSalut"
      },
      {
        "id": "ServiceRequest.subject.identifier.type.coding.display",
        "path": "ServiceRequest.subject.identifier.type.coding.display",
        "fixedString": "Codi d'identificació personal únic del Servei Català de la Salut (CIP-CatSalut)"
      },
      {
        "id": "ServiceRequest.subject.identifier.system",
        "path": "ServiceRequest.subject.identifier.system",
        "fixedUri": "urn:oid:2.16.724.4.9.10.1"
      },
      {
        "id": "ServiceRequest.encounter",
        "path": "ServiceRequest.encounter",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.occurrence[x]",
        "path": "ServiceRequest.occurrence[x]",
        "min": 1,
        "type": [
          {
            "code": "Period"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.occurrence[x].start",
        "path": "ServiceRequest.occurrence[x].start",
        "min": 1
      },
      {
        "id": "ServiceRequest.requester",
        "path": "ServiceRequest.requester",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.requester.identifier",
        "path": "ServiceRequest.requester.identifier",
        "min": 1
      },
      {
        "id": "ServiceRequest.locationCode",
        "path": "ServiceRequest.locationCode",
        "min": 0,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.catsalut.cat/r4/mConnectaHES/ValueSet/Entorns"
        }
      },
      {
        "id": "ServiceRequest.locationCode.coding",
        "path": "ServiceRequest.locationCode.coding",
        "min": 1
      },
      {
        "id": "ServiceRequest.reasonCode",
        "path": "ServiceRequest.reasonCode",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.reasonCode.coding",
        "path": "ServiceRequest.reasonCode.coding",
        "min": 1
      },
      {
        "id": "ServiceRequest.reasonReference",
        "path": "ServiceRequest.reasonReference",
        "max": "0"
      },
      {
        "id": "ServiceRequest.insurance",
        "path": "ServiceRequest.insurance",
        "max": "0"
      },
      {
        "id": "ServiceRequest.supportingInfo",
        "path": "ServiceRequest.supportingInfo",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.catsalut.cat/r4/mConnectaHES/StructureDefinition/HESConnecta_Device"
            ]
          }
        ]
      },
      {
        "id": "ServiceRequest.supportingInfo.reference",
        "path": "ServiceRequest.supportingInfo.reference",
        "min": 1
      },
      {
        "id": "ServiceRequest.specimen",
        "path": "ServiceRequest.specimen",
        "max": "0"
      },
      {
        "id": "ServiceRequest.bodySite",
        "path": "ServiceRequest.bodySite",
        "max": "0"
      },
      {
        "id": "ServiceRequest.note",
        "path": "ServiceRequest.note",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "ServiceRequest.patientInstruction",
        "path": "ServiceRequest.patientInstruction",
        "max": "0"
      },
      {
        "id": "ServiceRequest.relevantHistory",
        "path": "ServiceRequest.relevantHistory",
        "max": "0"
      }
    ]
  }
}