{
  "resourceType": "StructureDefinition",
  "id": "GEM-ERP-PR-ChargeItem",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Financial.General"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    }
  ],
  "url": "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_ChargeItem",
  "version": "1.2",
  "name": "GEM_ERP_PR_ChargeItem",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "ChargeItem",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/ChargeItem",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "ChargeItem.extension",
        "path": "ChargeItem.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "description": "Extensions are always sliced by (at least) url",
          "rules": "closed"
        }
      },
      {
        "id": "ChargeItem.extension:markingFlag",
        "path": "ChargeItem.extension",
        "sliceName": "markingFlag",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_EX_MarkingFlag"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "ChargeItem.identifier",
        "path": "ChargeItem.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "description": "The task ressource contains three identifier. The first one is the identifier for the ask representing one e-prescription. The other identifier are representing the patient as owner of the prescription. One is the \"Krankenversichertennummer\" wich identify each patient by his health insurance company and the other is \"Institutionskennzeichen\".",
          "rules": "closed"
        },
        "min": 1
      },
      {
        "id": "ChargeItem.identifier:PrescriptionID",
        "path": "ChargeItem.identifier",
        "sliceName": "PrescriptionID",
        "short": "Prescription Identifier",
        "definition": "The prescription identifier is the main identifier for all the ePrecscription related ressources and the whole prescription workflow. This identifier is genereted by the \"E-Rezept Fachdienst\" and must not be changed manually.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_PrescriptionId"
            ]
          }
        ]
      },
      {
        "id": "ChargeItem.identifier:AccessCode",
        "path": "ChargeItem.identifier",
        "sliceName": "AccessCode",
        "short": "AccessCode Identifier",
        "definition": "Generated by the \"E-Rezept Fachdienst\". This identifier grants access to others than the patient.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "ChargeItem.identifier:AccessCode.system",
        "path": "ChargeItem.identifier.system",
        "min": 1,
        "fixedUri": "https://gematik.de/fhir/erp/NamingSystem/GEM_ERP_NS_AccessCode"
      },
      {
        "id": "ChargeItem.identifier:AccessCode.value",
        "path": "ChargeItem.identifier.value",
        "min": 1
      },
      {
        "id": "ChargeItem.status",
        "path": "ChargeItem.status",
        "mustSupport": true
      },
      {
        "id": "ChargeItem.code",
        "path": "ChargeItem.code",
        "mustSupport": true
      },
      {
        "id": "ChargeItem.code.coding.system",
        "path": "ChargeItem.code.coding.system",
        "fixedUri": "http://terminology.hl7.org/CodeSystem/data-absent-reason"
      },
      {
        "id": "ChargeItem.code.coding.code",
        "path": "ChargeItem.code.coding.code",
        "fixedCode": "not-applicable"
      },
      {
        "id": "ChargeItem.subject",
        "path": "ChargeItem.subject",
        "mustSupport": true
      },
      {
        "id": "ChargeItem.subject.identifier",
        "path": "ChargeItem.subject.identifier",
        "min": 1,
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://fhir.de/StructureDefinition/identifier-kvid-10"
            ]
          }
        ]
      },
      {
        "id": "ChargeItem.enterer",
        "path": "ChargeItem.enterer",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ChargeItem.enterer.identifier",
        "path": "ChargeItem.enterer.identifier",
        "min": 1,
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_TelematikId"
            ]
          }
        ]
      },
      {
        "id": "ChargeItem.enteredDate",
        "path": "ChargeItem.enteredDate",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "ChargeItem.supportingInformation",
        "path": "ChargeItem.supportingInformation",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "closed"
        },
        "mustSupport": true
      },
      {
        "id": "ChargeItem.supportingInformation:prescriptionItem",
        "path": "ChargeItem.supportingInformation",
        "sliceName": "prescriptionItem",
        "definition": "In analogie zu Task.inputwird die Patientenkopie der Verordnung als Bundle gespeichert und trägt in Bundle.signature die Verordnungs-Signatur im JWS-detached Format.",
        "min": 0,
        "max": "*"
      },
      {
        "id": "ChargeItem.supportingInformation:prescriptionItem.type",
        "path": "ChargeItem.supportingInformation.type",
        "min": 1,
        "fixedUri": "https://fhir.kbv.de/StructureDefinition/KBV_PR_ERP_Bundle"
      },
      {
        "id": "ChargeItem.supportingInformation:dispenseItem",
        "path": "ChargeItem.supportingInformation",
        "sliceName": "dispenseItem",
        "min": 0,
        "max": "*"
      },
      {
        "id": "ChargeItem.supportingInformation:dispenseItem.type",
        "path": "ChargeItem.supportingInformation.type",
        "min": 1,
        "fixedUri": "http://fhir.abda.de/eRezeptAbgabedaten/StructureDefinition/DAV-PKV-PR-ERP-AbgabedatenBundle"
      },
      {
        "id": "ChargeItem.supportingInformation:receipt",
        "path": "ChargeItem.supportingInformation",
        "sliceName": "receipt",
        "definition": "In analogie zu Task.output wird die Quittung als Bundle gespeichert und trägt in Bundle.signature die Quittungs-Signatur im CAdES-enveloping Format [RFC 5652].",
        "min": 0,
        "max": "*"
      },
      {
        "id": "ChargeItem.supportingInformation:receipt.type",
        "path": "ChargeItem.supportingInformation.type",
        "min": 1,
        "fixedUri": "https://gematik.de/fhir/erp/StructureDefinition/GEM_ERP_PR_Bundle"
      }
    ]
  }
}