{
  "resourceType": "StructureDefinition",
  "id": "EPMedicationNoRef-746ad94a-388f-4d98-82e8-91f0f58932dc",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Clinical.Medications"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "business"
    }
  ],
  "url": "https://www.esante.lu/fhir-spec/StructureDefinition/EPMedicationNoRef",
  "version": "0.1.0",
  "name": "EPMedicationNoRef",
  "status": "draft",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "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": "Medication",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Medication",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Medication",
        "path": "Medication",
        "definition": "A medication that is not in the referential"
      },
      {
        "id": "Medication.id",
        "path": "Medication.id",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.\r\nIs assigned by the server, do not provide a value."
      },
      {
        "id": "Medication.meta",
        "path": "Medication.meta",
        "min": 1
      },
      {
        "id": "Medication.meta.id",
        "path": "Medication.meta.id",
        "max": "0"
      },
      {
        "id": "Medication.meta.versionId",
        "path": "Medication.meta.versionId",
        "max": "0"
      },
      {
        "id": "Medication.meta.lastUpdated",
        "path": "Medication.meta.lastUpdated",
        "max": "0"
      },
      {
        "id": "Medication.meta.source",
        "path": "Medication.meta.source",
        "max": "0"
      },
      {
        "id": "Medication.meta.profile",
        "path": "Medication.meta.profile",
        "min": 1,
        "max": "1",
        "fixedCanonical": "https://www.esante.lu/fhir-spec/StructureDefinition/EPMedicationNoRef"
      },
      {
        "id": "Medication.meta.security",
        "path": "Medication.meta.security",
        "max": "0"
      },
      {
        "id": "Medication.meta.tag",
        "path": "Medication.meta.tag",
        "max": "0"
      },
      {
        "id": "Medication.implicitRules",
        "path": "Medication.implicitRules",
        "max": "0"
      },
      {
        "id": "Medication.language",
        "path": "Medication.language",
        "max": "0"
      },
      {
        "id": "Medication.text",
        "path": "Medication.text",
        "max": "0"
      },
      {
        "id": "Medication.contained",
        "path": "Medication.contained",
        "max": "0"
      },
      {
        "id": "Medication.identifier",
        "path": "Medication.identifier",
        "short": "Identifier",
        "definition": "A v4 UUID prefixed by urn:uuid:",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://www.esante.lu/fhir-spec/StructureDefinition/EPSimpleIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Medication.code",
        "path": "Medication.code",
        "short": "Identification of this medication",
        "min": 1
      },
      {
        "id": "Medication.code.id",
        "path": "Medication.code.id",
        "max": "0"
      },
      {
        "id": "Medication.code.coding",
        "path": "Medication.code.coding",
        "max": "0"
      },
      {
        "id": "Medication.code.text",
        "path": "Medication.code.text",
        "short": "Plain text representation of the medication",
        "definition": "The free-text description of the medication.\r\nFor the prescription it contains the description as written by the prescriber, for the dispensaiton it may also contains the packaging information",
        "min": 1,
        "example": [
          {
            "label": "Prescription",
            "valueString": "Tahor 10mg"
          },
          {
            "label": "Dispensation",
            "valueString": "Tahor 10mg 90 comprimés"
          }
        ]
      },
      {
        "id": "Medication.status",
        "path": "Medication.status",
        "short": "Constant value",
        "definition": "As the medication is created on the fly when it's not in the referetial, it can only be active",
        "max": "0",
        "fixedCode": "active"
      },
      {
        "id": "Medication.manufacturer",
        "path": "Medication.manufacturer",
        "max": "0"
      },
      {
        "id": "Medication.form",
        "path": "Medication.form",
        "short": "Pharmaceutical form",
        "max": "0"
      },
      {
        "id": "Medication.form.id",
        "path": "Medication.form.id",
        "max": "0"
      },
      {
        "id": "Medication.form.coding",
        "path": "Medication.form.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.esante.lu/fhir-spec/ValueSet/PharFormCodes"
        }
      },
      {
        "id": "Medication.form.coding.id",
        "path": "Medication.form.coding.id",
        "max": "0"
      },
      {
        "id": "Medication.form.coding.system",
        "path": "Medication.form.coding.system",
        "min": 1
      },
      {
        "id": "Medication.form.coding.version",
        "path": "Medication.form.coding.version",
        "max": "0"
      },
      {
        "id": "Medication.form.coding.code",
        "path": "Medication.form.coding.code",
        "short": "Code of the pharmaceutical form",
        "min": 1
      },
      {
        "id": "Medication.form.coding.userSelected",
        "path": "Medication.form.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Medication.form.text",
        "path": "Medication.form.text",
        "max": "0"
      },
      {
        "id": "Medication.amount",
        "path": "Medication.amount",
        "max": "0"
      },
      {
        "id": "Medication.ingredient",
        "path": "Medication.ingredient",
        "short": "Active ingredients",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.id",
        "path": "Medication.ingredient.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item[x]",
        "path": "Medication.ingredient.item[x]",
        "short": "The actual ingredient",
        "type": [
          {
            "code": "CodeableConcept"
          }
        ]
      },
      {
        "id": "Medication.ingredient.item[x].id",
        "path": "Medication.ingredient.item[x].id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item[x].coding",
        "path": "Medication.ingredient.item[x].coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "https://www.esante.lu/fhir-spec/ValueSet/PharActivIngrCodes"
        }
      },
      {
        "id": "Medication.ingredient.item[x].coding.id",
        "path": "Medication.ingredient.item[x].coding.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item[x].coding.system",
        "path": "Medication.ingredient.item[x].coding.system",
        "min": 1
      },
      {
        "id": "Medication.ingredient.item[x].coding.version",
        "path": "Medication.ingredient.item[x].coding.version",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item[x].coding.code",
        "path": "Medication.ingredient.item[x].coding.code",
        "short": "Code of the ingredient",
        "min": 1
      },
      {
        "id": "Medication.ingredient.item[x].coding.userSelected",
        "path": "Medication.ingredient.item[x].coding.userSelected",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.item[x].text",
        "path": "Medication.ingredient.item[x].text",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.isActive",
        "path": "Medication.ingredient.isActive",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength",
        "path": "Medication.ingredient.strength",
        "definition": "Specifies how many (or how much) of the items there are in this Medication.",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength.id",
        "path": "Medication.ingredient.strength.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.numerator",
        "path": "Medication.ingredient.strength.numerator",
        "short": "The strength",
        "definition": "In our case, the strength is fully defined by the numerator element and shall not be understood as a ration.",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength.numerator.id",
        "path": "Medication.ingredient.strength.numerator.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.numerator.value",
        "path": "Medication.ingredient.strength.numerator.value",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength.numerator.comparator",
        "path": "Medication.ingredient.strength.numerator.comparator",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.numerator.unit",
        "path": "Medication.ingredient.strength.numerator.unit",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength.numerator.system",
        "path": "Medication.ingredient.strength.numerator.system",
        "min": 1,
        "fixedUri": "urn:oid:1.3.182.5.55"
      },
      {
        "id": "Medication.ingredient.strength.numerator.code",
        "path": "Medication.ingredient.strength.numerator.code",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSet": "https://www.esante.lu/fhir-spec/ValueSet/MedUnits"
        }
      },
      {
        "id": "Medication.ingredient.strength.denominator",
        "path": "Medication.ingredient.strength.denominator",
        "definition": "The denominator is always 1 because the quantity in our case is not defined as a ratio",
        "min": 1
      },
      {
        "id": "Medication.ingredient.strength.denominator.id",
        "path": "Medication.ingredient.strength.denominator.id",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.denominator.value",
        "path": "Medication.ingredient.strength.denominator.value",
        "short": "Fixed value",
        "min": 1,
        "fixedDecimal": 1
      },
      {
        "id": "Medication.ingredient.strength.denominator.comparator",
        "path": "Medication.ingredient.strength.denominator.comparator",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.denominator.unit",
        "path": "Medication.ingredient.strength.denominator.unit",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.denominator.system",
        "path": "Medication.ingredient.strength.denominator.system",
        "max": "0"
      },
      {
        "id": "Medication.ingredient.strength.denominator.code",
        "path": "Medication.ingredient.strength.denominator.code",
        "max": "0"
      },
      {
        "id": "Medication.batch",
        "path": "Medication.batch",
        "max": "0"
      }
    ]
  }
}