{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_PracticeSupply",
  "version": "1.0.2",
  "name": "KBV_PR_ERP_PracticeSupply",
  "status": "active",
  "date": "2021-09-13",
  "publisher": "Kassenärztliche Bundesvereinigung",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "SupplyRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/SupplyRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "SupplyRequest",
        "path": "SupplyRequest",
        "constraint": [
          {
            "key": "-erp-begrenzungDate",
            "severity": "error",
            "human": "Begrenzung der Datumsangabe auf 10 Zeichen JJJJ-MM-TT",
            "expression": "authoredOn.toString().length()=10",
            "source": "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_PracticeSupply"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.id",
        "path": "SupplyRequest.id",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.meta",
        "path": "SupplyRequest.meta",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.meta.versionId",
        "path": "SupplyRequest.meta.versionId",
        "max": "0"
      },
      {
        "id": "SupplyRequest.meta.lastUpdated",
        "path": "SupplyRequest.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "SupplyRequest.meta.source",
        "path": "SupplyRequest.meta.source",
        "max": "0"
      },
      {
        "id": "SupplyRequest.meta.profile",
        "path": "SupplyRequest.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_PracticeSupply|1.0.2"
      },
      {
        "id": "SupplyRequest.meta.security",
        "path": "SupplyRequest.meta.security",
        "max": "0"
      },
      {
        "id": "SupplyRequest.meta.tag",
        "path": "SupplyRequest.meta.tag",
        "max": "0"
      },
      {
        "id": "SupplyRequest.implicitRules",
        "path": "SupplyRequest.implicitRules",
        "max": "0"
      },
      {
        "id": "SupplyRequest.language",
        "path": "SupplyRequest.language",
        "max": "0"
      },
      {
        "id": "SupplyRequest.text",
        "path": "SupplyRequest.text",
        "max": "0"
      },
      {
        "id": "SupplyRequest.contained",
        "path": "SupplyRequest.contained",
        "max": "0"
      },
      {
        "id": "SupplyRequest.extension",
        "path": "SupplyRequest.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger",
        "path": "SupplyRequest.extension",
        "sliceName": "Kostentraeger",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_EX_ERP_PracticeSupply_Payor"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:ik",
        "path": "SupplyRequest.extension.extension",
        "sliceName": "ik",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:ik.value[x]",
        "path": "SupplyRequest.extension.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:ik.value[x]:valueIdentifier",
        "path": "SupplyRequest.extension.extension.value[x]",
        "sliceName": "valueIdentifier",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:ik.value[x]:valueIdentifier.system",
        "path": "SupplyRequest.extension.extension.value[x].system",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:ik.value[x]:valueIdentifier.value",
        "path": "SupplyRequest.extension.extension.value[x].value",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:name",
        "path": "SupplyRequest.extension.extension",
        "sliceName": "name",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:name.value[x]",
        "path": "SupplyRequest.extension.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:name.value[x]:valueString",
        "path": "SupplyRequest.extension.extension.value[x]",
        "sliceName": "valueString",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:kostentraegertyp",
        "path": "SupplyRequest.extension.extension",
        "sliceName": "kostentraegertyp",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:kostentraegertyp.value[x]",
        "path": "SupplyRequest.extension.extension.value[x]",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:kostentraegertyp.value[x]:valueCoding",
        "path": "SupplyRequest.extension.extension.valueCoding",
        "sliceName": "valueCoding",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:kostentraegertyp.value[x]:valueCoding.system",
        "path": "SupplyRequest.extension.extension.valueCoding.system",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.extension:Kostentraeger.extension:kostentraegertyp.value[x]:valueCoding.code",
        "path": "SupplyRequest.extension.extension.valueCoding.code",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.identifier",
        "path": "SupplyRequest.identifier",
        "max": "0"
      },
      {
        "id": "SupplyRequest.status",
        "path": "SupplyRequest.status",
        "max": "0"
      },
      {
        "id": "SupplyRequest.category",
        "path": "SupplyRequest.category",
        "max": "0"
      },
      {
        "id": "SupplyRequest.priority",
        "path": "SupplyRequest.priority",
        "max": "0"
      },
      {
        "id": "SupplyRequest.item[x]",
        "path": "SupplyRequest.item[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "closed"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_FreeText|1.0.2",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_PZN|1.0.2",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_Compounding|1.0.2",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_Ingredient|1.0.2"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.item[x]:itemReference",
        "path": "SupplyRequest.item[x]",
        "sliceName": "itemReference",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_FreeText|1.0.2",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_PZN|1.0.2",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_Compounding|1.0.2",
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Medication_Ingredient|1.0.2"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.item[x]:itemReference.reference",
        "path": "SupplyRequest.item[x].reference",
        "min": 1
      },
      {
        "id": "SupplyRequest.item[x]:itemReference.type",
        "path": "SupplyRequest.item[x].type",
        "max": "0"
      },
      {
        "id": "SupplyRequest.item[x]:itemReference.identifier",
        "path": "SupplyRequest.item[x].identifier",
        "max": "0"
      },
      {
        "id": "SupplyRequest.item[x]:itemReference.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "SupplyRequest.item[x].display",
        "max": "0"
      },
      {
        "id": "SupplyRequest.quantity",
        "path": "SupplyRequest.quantity",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.quantity.value",
        "path": "SupplyRequest.quantity.value",
        "short": "Anzahl der verordneten Packungen",
        "definition": "Anzahl der verordneten Packungen",
        "min": 1,
        "maxValueDecimal": 999,
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.quantity.comparator",
        "path": "SupplyRequest.quantity.comparator",
        "max": "0"
      },
      {
        "id": "SupplyRequest.quantity.unit",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "SupplyRequest.quantity.unit",
        "max": "0"
      },
      {
        "id": "SupplyRequest.quantity.system",
        "path": "SupplyRequest.quantity.system",
        "min": 1,
        "fixedUri": "http://unitsofmeasure.org",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.quantity.code",
        "path": "SupplyRequest.quantity.code",
        "min": 1,
        "fixedCode": "{Package}",
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.parameter",
        "path": "SupplyRequest.parameter",
        "max": "0"
      },
      {
        "id": "SupplyRequest.occurrence[x]",
        "path": "SupplyRequest.occurrence[x]",
        "max": "0"
      },
      {
        "id": "SupplyRequest.authoredOn",
        "path": "SupplyRequest.authoredOn",
        "short": "Ausstellungsdatum",
        "definition": "Ausstellungsdatum der Verordnung",
        "min": 1,
        "condition": [
          "begrenzungDate"
        ],
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.requester",
        "path": "SupplyRequest.requester",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.kbv.de/StructureDefinition/KBV_PR_FOR_Practitioner|1.0.3"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.requester.reference",
        "path": "SupplyRequest.requester.reference",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "SupplyRequest.requester.type",
        "path": "SupplyRequest.requester.type",
        "max": "0"
      },
      {
        "id": "SupplyRequest.requester.identifier",
        "path": "SupplyRequest.requester.identifier",
        "max": "0"
      },
      {
        "id": "SupplyRequest.requester.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "SupplyRequest.requester.display",
        "max": "0"
      },
      {
        "id": "SupplyRequest.supplier",
        "path": "SupplyRequest.supplier",
        "max": "0"
      },
      {
        "id": "SupplyRequest.reasonCode",
        "path": "SupplyRequest.reasonCode",
        "max": "0"
      },
      {
        "id": "SupplyRequest.reasonReference",
        "path": "SupplyRequest.reasonReference",
        "max": "0"
      },
      {
        "id": "SupplyRequest.deliverFrom",
        "path": "SupplyRequest.deliverFrom",
        "max": "0"
      },
      {
        "id": "SupplyRequest.deliverTo",
        "path": "SupplyRequest.deliverTo",
        "max": "0"
      }
    ]
  }
}