{
  "resourceType": "StructureDefinition",
  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseDispConsent",
  "name": "NLLMultiDoseDispConsent",
  "status": "draft",
  "fhirVersion": "4.0.0",
  "mapping": [
    {
      "identity": "EHM",
      "name": "E-hälsomyndigheten Information Model"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Consent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Consent",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Consent",
        "path": "Consent",
        "short": "Consent for a patient receiving medications in multi dose dispense packaging",
        "definition": "This consent represents the amount of information needed when a patient starts (or stops) receiving medication in multi dose dispense bags (sv: blir dospatient)",
        "mapping": [
          {
            "identity": "EHM",
            "map": "Dossamtycke"
          }
        ]
      },
      {
        "id": "Consent.extension",
        "path": "Consent.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Consent.extension:eventHistory",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.extension",
        "sliceName": "eventHistory",
        "short": "A list of events of interest in the lifecycle",
        "definition": "Links to Provenance records for past versions of this resource that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.",
        "min": 1,
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLMultiDoseEvent"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "EHM",
            "map": "Händelse avseende patientens läkemedelslista"
          }
        ]
      },
      {
        "id": "Consent.category",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.category",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.system"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Consent.category:consentDoseDisp",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.category",
        "sliceName": "consentDoseDisp",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Consent.category:consentDoseDisp.coding.system",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.category.coding.system",
        "fixedUri": "http://electronichealth.se/fhir/ValueSet/consent-types-1"
      },
      {
        "id": "Consent.category:consentDoseDisp.coding.code",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.category.coding.code",
        "fixedCode": "consent-dose-disp"
      },
      {
        "id": "Consent.patient",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.patient",
        "definition": "The patient to whom this multi dose dispense consent applies.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLPatient"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Dospatient"
          }
        ]
      },
      {
        "id": "Consent.dateTime",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.dateTime",
        "short": "When this Consent was created",
        "definition": "Defines when this consent for being a multi dose dispense patient was issued / created. Will be set to the date and time that the consent was registered. Read only.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Registreringstidpunkt"
          }
        ]
      },
      {
        "id": "Consent.provision.period",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.provision.period",
        "mustSupport": true
      },
      {
        "id": "Consent.provision.period.end",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "Consent.provision.period.end",
        "short": "End time, used when consent should be ended.",
        "definition": "The end of the period. Used when the consent for receiving multi dose dispensed medication should be ended. In this scenario, the end date should be defined in an update action.",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Giltig till och med"
          }
        ]
      }
    ]
  }
}