{
  "resourceType": "StructureDefinition",
  "id": "5b0b615f-5d0f-415c-bf39-de89ee0ad68d",
  "meta": {
    "lastUpdated": "2023-02-23T13:10:59.4861913+00:00"
  },
  "url": "https://fhir.cambio.se/StructureDefinition/InvoiceSe",
  "name": "InvoiceSe",
  "status": "retired",
  "date": "2023-02-23T13:13:38.4425678+00:00",
  "description": "Please note that this version of the Invoice profile is deprecated and the recommended profile to use is InvoiceSe(version 2).",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "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"
    },
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Invoice",
  "baseDefinition": "https://fhir.cambio.se/StructureDefinition/InvoiceCore",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Invoice.extension",
        "path": "Invoice.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Invoice.extension:businessStatus",
        "path": "Invoice.extension",
        "sliceName": "businessStatus",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.cambio.se/StructureDefinition/common-businessStatus/v1"
            ]
          }
        ]
      },
      {
        "id": "Invoice.extension:businessStatus.value[x]",
        "path": "Invoice.extension.value[x]",
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.cambio.se/ValueSet/InvoiceBusinessStatus/v1"
        }
      },
      {
        "id": "Invoice.extension:registeredPaymentMethod",
        "path": "Invoice.extension",
        "sliceName": "registeredPaymentMethod",
        "definition": "Support only for \"Cash, Invoice, CreditCard, Swish,Other\" values.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.cambio.se/StructureDefinition/invoice-registeredPaymentMethod/v1"
            ]
          }
        ]
      },
      {
        "id": "Invoice.extension:registeredPaymentMethod.value[x]",
        "path": "Invoice.extension.value[x]",
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.cambio.se/ValueSet/RegisteredPaymentMethod/v1"
        }
      },
      {
        "id": "Invoice.extension:paymentMethodOption",
        "path": "Invoice.extension",
        "sliceName": "paymentMethodOption",
        "min": 0,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://fhir.cambio.se/StructureDefinition/invoice-paymentMethodOption/v1"
            ]
          }
        ]
      },
      {
        "id": "Invoice.identifier",
        "path": "Invoice.identifier",
        "max": "0"
      },
      {
        "id": "Invoice.status",
        "path": "Invoice.status",
        "definition": "Support statuses are issued and balanced.\r\nOther statuses are not supported (draft,cancelled,,entered-in-error)."
      },
      {
        "id": "Invoice.cancelledReason",
        "path": "Invoice.cancelledReason",
        "max": "0"
      },
      {
        "id": "Invoice.type",
        "path": "Invoice.type",
        "definition": "Type of Invoice depending on domain, realm an usage (e.g. internal/external, dental, preliminary).\r\n\r\nCould we say that this is an invoice with type Swish?",
        "max": "0"
      },
      {
        "id": "Invoice.subject",
        "path": "Invoice.subject",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Patient"
            ]
          }
        ]
      },
      {
        "id": "Invoice.recipient",
        "path": "Invoice.recipient",
        "max": "0",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Organization"
            ]
          }
        ]
      },
      {
        "id": "Invoice.participant",
        "path": "Invoice.participant",
        "max": "0"
      },
      {
        "id": "Invoice.issuer",
        "path": "Invoice.issuer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.cambio.se/StructureDefinition/OrganizationInvoiceSe"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Invoice.account",
        "path": "Invoice.account",
        "max": "0",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.cambio.se/StructureDefinition/AccountSe"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Invoice.lineItem.sequence",
        "path": "Invoice.lineItem.sequence",
        "max": "0"
      },
      {
        "id": "Invoice.lineItem.chargeItem[x]",
        "path": "Invoice.lineItem.chargeItem[x]",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.cambio.se/StructureDefinition/ChargeItemSe"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "Invoice.lineItem.priceComponent",
        "path": "Invoice.lineItem.priceComponent",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "code.coding.id"
            }
          ],
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Invoice.lineItem.priceComponent.code.coding",
        "path": "Invoice.lineItem.priceComponent.code.coding",
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.cambio.se/ValueSet/CostTypes/v1"
        }
      },
      {
        "id": "Invoice.lineItem.priceComponent.code.coding.system",
        "path": "Invoice.lineItem.priceComponent.code.coding.system",
        "fixedUri": "https://cambio.codes/cs/cost-types"
      },
      {
        "id": "Invoice.lineItem.priceComponent.amount.currency",
        "path": "Invoice.lineItem.priceComponent.amount.currency",
        "fixedCode": "SEK"
      },
      {
        "id": "Invoice.lineItem.priceComponent:basePrice",
        "path": "Invoice.lineItem.priceComponent",
        "sliceName": "basePrice",
        "short": "Base price",
        "definition": "The total price before applying discount",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Invoice.lineItem.priceComponent:basePrice.type",
        "path": "Invoice.lineItem.priceComponent.type",
        "fixedCode": "base"
      },
      {
        "id": "Invoice.lineItem.priceComponent:basePrice.code.coding",
        "path": "Invoice.lineItem.priceComponent.code.coding",
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.cambio.se/ValueSet/CostTypes/v1"
        }
      },
      {
        "id": "Invoice.lineItem.priceComponent:basePrice.code.coding.system",
        "path": "Invoice.lineItem.priceComponent.code.coding.system",
        "fixedUri": "https://cambio.codes/cs/cost-types"
      },
      {
        "id": "Invoice.lineItem.priceComponent:basePrice.amount.currency",
        "path": "Invoice.lineItem.priceComponent.amount.currency",
        "fixedCode": "SEK"
      },
      {
        "id": "Invoice.lineItem.priceComponent:discount",
        "path": "Invoice.lineItem.priceComponent",
        "sliceName": "discount"
      },
      {
        "id": "Invoice.lineItem.priceComponent:discount.type",
        "path": "Invoice.lineItem.priceComponent.type",
        "definition": "The discount applied on the base price.",
        "fixedCode": "discount"
      },
      {
        "id": "Invoice.lineItem.priceComponent:discount.code.coding.system",
        "path": "Invoice.lineItem.priceComponent.code.coding.system",
        "fixedUri": "https://cambio.codes/cs/cost-types"
      },
      {
        "id": "Invoice.lineItem.priceComponent:discount.amount.currency",
        "path": "Invoice.lineItem.priceComponent.amount.currency",
        "fixedCode": "SEK"
      },
      {
        "id": "Invoice.lineItem.priceComponent:surcharge",
        "path": "Invoice.lineItem.priceComponent",
        "sliceName": "surcharge"
      },
      {
        "id": "Invoice.lineItem.priceComponent:surcharge.type",
        "path": "Invoice.lineItem.priceComponent.type",
        "fixedCode": "surcharge"
      },
      {
        "id": "Invoice.lineItem.priceComponent:surcharge.code.coding",
        "path": "Invoice.lineItem.priceComponent.code.coding",
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.cambio.se/ValueSet/CostTypes/v1"
        }
      },
      {
        "id": "Invoice.lineItem.priceComponent:surcharge.code.coding.system",
        "path": "Invoice.lineItem.priceComponent.code.coding.system",
        "fixedUri": "https://cambio.codes/cs/cost-types"
      },
      {
        "id": "Invoice.lineItem.priceComponent:surcharge.code.text",
        "path": "Invoice.lineItem.priceComponent.code.text",
        "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user. This is a description or a comment about the priceComponent."
      },
      {
        "id": "Invoice.lineItem.priceComponent:surcharge.amount.currency",
        "path": "Invoice.lineItem.priceComponent.amount.currency",
        "fixedCode": "SEK"
      },
      {
        "id": "Invoice.totalPriceComponent",
        "path": "Invoice.totalPriceComponent",
        "max": "0"
      },
      {
        "id": "Invoice.totalNet",
        "path": "Invoice.totalNet",
        "min": 1
      },
      {
        "id": "Invoice.totalGross",
        "path": "Invoice.totalGross",
        "max": "0"
      },
      {
        "id": "Invoice.totalGross.currency",
        "path": "Invoice.totalGross.currency",
        "fixedCode": "SEK"
      },
      {
        "id": "Invoice.paymentTerms",
        "path": "Invoice.paymentTerms",
        "max": "0"
      },
      {
        "id": "Invoice.note",
        "path": "Invoice.note",
        "max": "0"
      }
    ]
  }
}