{
  "resourceType": "StructureDefinition",
  "id": "hso-lib-MedicationRequest",
  "url": "https://hso.no/fhir/StructureDefinition/HsoLibMedicationRequest",
  "name": "HsoLibMedicationRequest",
  "status": "draft",
  "description": "HSØ implementation profile for Active Medications - Legemidler i Bruk (LiB).",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "script10.6",
      "uri": "http://ncpdp.org/SCRIPT10_6",
      "name": "Mapping to NCPDP SCRIPT 10.6"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "MedicationRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationRequest.extension",
        "path": "MedicationRequest.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.extension:applicationArea",
        "path": "MedicationRequest.extension",
        "sliceName": "applicationArea",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibApplicationArea"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.extension:shortDosage",
        "path": "MedicationRequest.extension",
        "sliceName": "shortDosage",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibShortDosage"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.extension:use",
        "path": "MedicationRequest.extension",
        "sliceName": "use",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibUse"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.extension:effectiveDosePeriod",
        "path": "MedicationRequest.extension",
        "sliceName": "effectiveDosePeriod",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibEffectiveDosePeriod"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.extension:renderedDosageInstruction",
        "path": "MedicationRequest.extension",
        "sliceName": "renderedDosageInstruction",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibRenderedDosageInstruction"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.identifier",
        "path": "MedicationRequest.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.identifier:eresept-id",
        "path": "MedicationRequest.identifier",
        "sliceName": "eresept-id",
        "short": "E-resept id",
        "definition": "Id of the related e-resept, if exists.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "MedicationRequest.identifier:eresept-id.system",
        "path": "MedicationRequest.identifier.system",
        "min": 1,
        "fixedUri": "eresept-id"
      },
      {
        "id": "MedicationRequest.identifier:hsolib-id",
        "path": "MedicationRequest.identifier",
        "sliceName": "hsolib-id",
        "short": "Id in HSØ",
        "definition": "Id of the related record in HSØ.",
        "min": 0,
        "max": "1"
      },
      {
        "id": "MedicationRequest.identifier:hsolib-id.system",
        "path": "MedicationRequest.identifier.system",
        "min": 1,
        "fixedUri": "http://hso.no/fhir/identifier/lib-medication"
      },
      {
        "id": "MedicationRequest.medication[x]",
        "path": "MedicationRequest.medication[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.medication[x]:medicationReference",
        "path": "MedicationRequest.medication[x]",
        "sliceName": "medicationReference",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://hso.no/fhir/StructureDefinition/HsoLibMedication"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.subject",
        "path": "MedicationRequest.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.requester",
        "path": "MedicationRequest.requester",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Organization",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.performer",
        "path": "MedicationRequest.performer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Organization",
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient",
              "http://hl7.no/fhir/StructureDefinition/no-basis-RelatedPerson"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.recorder",
        "path": "MedicationRequest.recorder",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Practitioner",
              "http://hl7.no/fhir/StructureDefinition/no-basis-PractitionerRole"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.reasonCode",
        "path": "MedicationRequest.reasonCode",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "coding.system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "MedicationRequest.reasonCode:ICPC2",
        "path": "MedicationRequest.reasonCode",
        "sliceName": "ICPC2",
        "min": 0,
        "max": "1"
      },
      {
        "id": "MedicationRequest.reasonCode:ICPC2.coding.system",
        "path": "MedicationRequest.reasonCode.coding.system",
        "min": 1,
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.1.7170"
      },
      {
        "id": "MedicationRequest.reasonCode:ICPC2.coding.code",
        "path": "MedicationRequest.reasonCode.coding.code",
        "min": 1
      },
      {
        "id": "MedicationRequest.reasonCode:ICPC2.coding.display",
        "path": "MedicationRequest.reasonCode.coding.display",
        "min": 1
      },
      {
        "id": "MedicationRequest.reasonCode:ICD10",
        "path": "MedicationRequest.reasonCode",
        "sliceName": "ICD10",
        "min": 0,
        "max": "1"
      },
      {
        "id": "MedicationRequest.reasonCode:ICD10.coding.system",
        "path": "MedicationRequest.reasonCode.coding.system",
        "min": 1,
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.1.7110"
      },
      {
        "id": "MedicationRequest.reasonCode:ICD10.coding.code",
        "path": "MedicationRequest.reasonCode.coding.code",
        "min": 1
      },
      {
        "id": "MedicationRequest.reasonCode:ICD10.coding.display",
        "path": "MedicationRequest.reasonCode.coding.display",
        "min": 1
      },
      {
        "id": "MedicationRequest.dosageInstruction.additionalInstruction.coding.system",
        "path": "MedicationRequest.dosageInstruction.additionalInstruction.coding.system",
        "fixedUri": "urn:oid:2.16.578.1.12.4.1.1.7479"
      }
    ]
  }
}