{
  "resourceType": "StructureDefinition",
  "id": "hso-lib-MedicationStatement",
  "url": "https://hso.no/fhir/StructureDefinition/HsoLibMedicationStatement",
  "name": "HsoLibMedicationStatement",
  "status": "draft",
  "description": "HSØ implementation profile for Active Medications - Legemidler i Bruk (LiB).",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationStatement",
  "baseDefinition": "http://hl7.no/fhir/StructureDefinition/no-basis-MedicationStatement",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationStatement.extension:applicationArea",
        "path": "MedicationStatement.extension",
        "sliceName": "applicationArea",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibApplicationArea"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.extension:adherence",
        "path": "MedicationStatement.extension",
        "sliceName": "adherence",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibAdherence"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.extension:shortDosage",
        "path": "MedicationStatement.extension",
        "sliceName": "shortDosage",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibShortDosage"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.extension:use",
        "path": "MedicationStatement.extension",
        "sliceName": "use",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibUse"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.extension:updatedSinceImport",
        "path": "MedicationStatement.extension",
        "sliceName": "updatedSinceImport",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibUpdatedSinceImport"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.extension:genericMedication",
        "path": "MedicationStatement.extension",
        "sliceName": "genericMedication",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibGenericMedication"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.extension:medicationInfo",
        "path": "MedicationStatement.extension",
        "sliceName": "medicationInfo",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibMedicationInfo"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.identifier",
        "path": "MedicationStatement.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "ordered": true,
          "rules": "open"
        }
      },
      {
        "id": "MedicationStatement.identifier:eresept-id",
        "path": "MedicationStatement.identifier",
        "sliceName": "eresept-id",
        "short": "E-resept id",
        "definition": "Id of the related e-resept, if exists.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "MedicationStatement.identifier:eresept-id.system",
        "path": "MedicationStatement.identifier.system",
        "min": 1,
        "fixedUri": "eresept-id"
      },
      {
        "id": "MedicationStatement.identifier:hsolib-id",
        "path": "MedicationStatement.identifier",
        "sliceName": "hsolib-id",
        "short": "Id in HSØ",
        "definition": "Id of the related record in HSØ.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "MedicationStatement.identifier:hsolib-id.system",
        "path": "MedicationStatement.identifier.system",
        "min": 1,
        "fixedUri": "http://hso.no/fhir/identifier/lib-medication"
      },
      {
        "id": "MedicationStatement.medication[x]:medicationReference",
        "path": "MedicationStatement.medication[x]",
        "sliceName": "medicationReference",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibMedication"
            ],
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.derivedFrom",
        "path": "MedicationStatement.derivedFrom",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibMedicationRequest",
              "http://hl7.org/fhir/StructureDefinition/Resource"
            ]
          }
        ]
      },
      {
        "id": "MedicationStatement.dosage.additionalInstruction.coding.system",
        "path": "MedicationStatement.dosage.additionalInstruction.coding.system",
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.1.7479"
      }
    ]
  }
}