{
  "resourceType": "StructureDefinition",
  "id": "no-basis-MedicationRequest",
  "url": "http://hl7.no/fhir/StructureDefinition/no-basis-MedicationRequest",
  "version": "0.1",
  "name": "no-basis-MedicationRequest",
  "status": "draft",
  "date": "2018-10-26",
  "fhirVersion": "3.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "MedicationRequest",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationRequest",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "MedicationRequest.identifier",
        "path": "MedicationRequest.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type.text"
            }
          ],
          "ordered": true,
          "rules": "openAtEnd"
        }
      },
      {
        "id": "MedicationRequest.identifier:PLL-id",
        "path": "MedicationRequest.identifier",
        "sliceName": "PLL-id",
        "max": "1"
      },
      {
        "id": "MedicationRequest.identifier:PLL-id.type",
        "path": "MedicationRequest.identifier.type",
        "min": 1
      },
      {
        "id": "MedicationRequest.identifier:PLL-id.type.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "MedicationRequest.identifier.type.text",
        "min": 1,
        "fixedString": "PLL"
      },
      {
        "id": "MedicationRequest.identifier:PLL-id.system",
        "path": "MedicationRequest.identifier.system",
        "max": "0"
      },
      {
        "id": "MedicationRequest.identifier:PLL-id.value",
        "path": "MedicationRequest.identifier.value",
        "min": 1
      },
      {
        "id": "MedicationRequest.identifier:PLL-id.period",
        "path": "MedicationRequest.identifier.period",
        "max": "0"
      },
      {
        "id": "MedicationRequest.identifier:PLL-id.assigner",
        "path": "MedicationRequest.identifier.assigner",
        "max": "0"
      },
      {
        "id": "MedicationRequest.status",
        "path": "MedicationRequest.status",
        "definition": "A code specifying the current state of the order.  Generally this will be active or completed state.\r\nactive = start date has passed and end date is not reached\r\ncompleted = end date is passed (for treatement that had an initial stop date)\r\nentered-in-error = deleted (ref Norwegian laws)\r\nintended = start date is not reached\r\nstopped = end date is passed and it was an active desition to stop the treatment\r\non-hold = the treatment is paused"
      },
      {
        "id": "MedicationRequest.medication[x]",
        "path": "MedicationRequest.medication[x]",
        "type": [
          {
            "code": "CodeableConcept"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Medication"
          },
          {
            "code": "Reference",
            "targetProfile": "http://ehelse.no/fhir/StructureDefinition/no-basis-Medication",
            "aggregation": [
              "bundled"
            ]
          }
        ]
      },
      {
        "id": "MedicationRequest.subject",
        "path": "MedicationRequest.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Group"
          },
          {
            "code": "Reference",
            "targetProfile": "http://ehelse.no/fhir/StructureDefinition/no-basis-Patient"
          }
        ]
      }
    ]
  }
}