### ----------------------------------------------------
### -- FHIR
### -- Licenses: Artistic-2.0
### -- Authors: Hugh Simpson
### -- File: t/resources/structureDefinition/Medication.json
### ----------------------------------------------------
### -- Chunk 5 of 5
alias" : ["extensions",
      "user content",
      "modifiers"],
      "min" : 0,
      "max" : "*",
      "base" : {
        "path" : "BackboneElement.modifierExtension",
        "min" : 0,
        "max" : "*"
      },
      "type" : [{
        "code" : "Extension"
      }],
      "isModifier" : true,
      "isModifierReason" : "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
      "isSummary" : true,
      "mapping" : [{
        "identity" : "rim",
        "map" : "N/A"
      }]
    },
    {
      "id" : "Medication.batch.lotNumber",
      "path" : "Medication.batch.lotNumber",
      "short" : "Identifier assigned to batch",
      "definition" : "The assigned lot number of a batch of the specified product.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Medication.batch.lotNumber",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "string"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "no mapping"
      },
      {
        "identity" : "v2",
        "map" : "RXA-15 Substance Lot Number / RXG-19 Substance Lot Number"
      },
      {
        "identity" : "rim",
        "map" : ".id"
      }]
    },
    {
      "id" : "Medication.batch.expirationDate",
      "path" : "Medication.batch.expirationDate",
      "short" : "When batch will expire",
      "definition" : "When this specific batch of product will expire.",
      "min" : 0,
      "max" : "1",
      "base" : {
        "path" : "Medication.batch.expirationDate",
        "min" : 0,
        "max" : "1"
      },
      "type" : [{
        "code" : "dateTime"
      }],
      "isModifier" : false,
      "isSummary" : false,
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "no mapping"
      },
      {
        "identity" : "v2",
        "map" : "RXA-16 Substance Expiration Date / RXG-20 Substance Expiration Date"
      },
      {
        "identity" : "rim",
        "map" : "participation[typeCode=CSM].role[classCode=INST].scopedRole.scoper[classCode=MMAT].expirationTime"
      }]
    }]
  },
  "differential" : {
    "element" : [{
      "id" : "Medication",
      "path" : "Medication",
      "short" : "Definition of a Medication",
      "definition" : "This resource is primarily used for the identification and definition of a medication for the purposes of prescribing, dispensing, and administering a medication as well as for making statements about medication use.",
      "min" : 0,
      "max" : "*",
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "NewRx/MedicationPrescribed\r-or-\rRxFill/MedicationDispensed\r-or-\rRxHistoryResponse/MedicationDispensed\r-or-\rRxHistoryResponse/MedicationPrescribed"
      },
      {
        "identity" : "rim",
        "map" : "ManufacturedProduct[classCode=ADMM]"
      }]
    },
    {
      "id" : "Medication.identifier",
      "path" : "Medication.identifier",
      "short" : "Business identifier for this medication",
      "definition" : "Business identifier for this medication.",
      "comment" : "The serial number could be included as an identifier.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "Identifier"
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "w5",
        "map" : "FiveWs.identifier"
      },
      {
        "identity" : "rim",
        "map" : ".id"
      }]
    },
    {
      "id" : "Medication.code",
      "path" : "Medication.code",
      "short" : "Codes that identify this medication",
      "definition" : "A code (or set of codes) that specify this medication, or a textual description if no code is available. Usage note: This could be a standard medication code such as a code from RxNorm, SNOMED CT, IDMP etc. It could also be a national or local formulary code, optionally with translations to other code systems.",
      "comment" : "Depending on the context of use, the code that was actually selected by the user (prescriber, dispenser, etc.) will have the coding.userSelected set to true.  As described in the coding datatype: \"A coding may be marked as a \"userSelected\" if a user selected the particular coded value in a user interface (e.g. the user selects an item in a pick-list). If a user selected coding exists, it is the preferred choice for performing translations etc. Other codes can only be literal translations to alternative code systems, or codes at a lower level of granularity (e.g. a generic code for a vendor-specific primary one).",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "MedicationFormalRepresentation"
        }],
        "strength" : "example",
        "description" : "A coded concept that defines the type of a medication.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/medication-codes"
      },
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "coding.code = //element(*,MedicationType)/DrugCoded/ProductCode\r\rcoding.system = //element(*,MedicationType)/DrugCoded/ProductCodeQualifier\r\rcoding.display = //element(*,MedicationType)/DrugDescription"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.class"
      },
      {
        "identity" : "v2",
        "map" : "RXO-1.1-Requested Give Code.code / RXE-2.1-Give Code.code / RXD-2.1-Dispense/Give Code.code / RXG-4.1-Give Code.code /RXA-5.1-Administered Code.code / RXC-2.1 Component Code"
      },
      {
        "identity" : "rim",
        "map" : ".code"
      }]
    },
    {
      "id" : "Medication.status",
      "path" : "Medication.status",
      "short" : "active | inactive | entered-in-error",
      "definition" : "A code to indicate if the medication is in active use.",
      "comment" : "This status is intended to identify if the medication in a local system is in active use within a drug database or inventory.  For example, a pharmacy system may create a new drug file record for a compounded product \"ABC Hospital Special Cream\" with an active status.  At some point in the future, it may be determined that the drug record was created with an error and the status is changed to \"entered in error\".   This status is not intended to specify if a medication is part of a particular formulary.  It is possible that the drug record may be referenced by multiple formularies or catalogues and each of those entries would have a separate status.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "code"
      }],
      "isModifier" : true,
      "isModifierReason" : "This element changes the interpretation of all descriptive attributes.",
      "isSummary" : true,
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "MedicationStatus"
        }],
        "strength" : "required",
        "description" : "A coded concept defining if the medication is in active use.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/medication-status|4.0.0"
      },
      "mapping" : [{
        "identity" : "rim",
        "map" : ".statusCode"
      }]
    },
    {
      "id" : "Medication.manufacturer",
      "path" : "Medication.manufacturer",
      "short" : "Manufacturer of the item",
      "definition" : "Describes the details of the manufacturer of the medication product.  This is not intended to represent the distributor of a medication product.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Organization"]
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "no mapping"
      },
      {
        "identity" : "w5",
        "map" : "FiveWs.actor"
      },
      {
        "identity" : "v2",
        "map" : "RXD-20-Substance Manufacturer Name / RXG-21-Substance Manufacturer Name / RXA-17-Substance Manufacturer Name"
      },
      {
        "identity" : "rim",
        "map" : ".player.scopingRole[typeCode=MANU].scoper"
      }]
    },
    {
      "id" : "Medication.form",
      "path" : "Medication.form",
      "short" : "powder | tablets | capsule +",
      "definition" : "Describes the form of the item.  Powder; tablets; capsule.",
      "comment" : "When Medication is referenced from MedicationRequest, this is the ordered form.  When Medication is referenced within MedicationDispense, this is the dispensed form.  When Medication is referenced within MedicationAdministration, this is administered form.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "CodeableConcept"
      }],
      "binding" : {
        "extension" : [{
          "url" : "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
          "valueString" : "MedicationForm"
        }],
        "strength" : "example",
        "description" : "A coded concept defining the form of a medication.",
        "valueSet" : "http://hl7.org/fhir/ValueSet/medication-form-codes"
      },
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "coding.code =  //element(*,DrugCodedType)/FormCode\r\rcoding.system = //element(*,DrugCodedType)/FormSourceCode"
      },
      {
        "identity" : "v2",
        "map" : "RXO-5-Requested Dosage Form / RXE-6-Give Dosage Form / RXD-6-Actual Dosage Form / RXG-8-Give Dosage Form / RXA-8-Administered Dosage Form"
      },
      {
        "identity" : "rim",
        "map" : ".formCode"
      }]
    },
    {
      "id" : "Medication.amount",
      "path" : "Medication.amount",
      "short" : "Amount of drug in package",
      "definition" : "Specific amount of the drug in the packaged product.  For example, when specifying a product that has the same strength (For example, Insulin glargine 100 unit per mL solution for injection), this attribute provides additional clarification of the package amount (For example, 3 mL, 10mL, etc.).",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Ratio"
      }],
      "isSummary" : true,
      "mapping" : [{
        "identity" : "rim",
        "map" : ".quantity"
      }]
    },
    {
      "id" : "Medication.ingredient",
      "path" : "Medication.ingredient",
      "short" : "Active or inactive ingredient",
      "definition" : "Identifies a particular constituent of interest in the product.",
      "comment" : "The ingredients need not be a complete list.  If an ingredient is not specified, this does not indicate whether an ingredient is present or absent.  If an ingredient is specified it does not mean that all ingredients are specified.  It is possible to specify both inactive and active ingredients.",
      "min" : 0,
      "max" : "*",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : ".scopesRole[typeCode=INGR]"
      }]
    },
    {
      "id" : "Medication.ingredient.item[x]",
      "path" : "Medication.ingredient.item[x]",
      "short" : "The actual ingredient or content",
      "definition" : "The actual ingredient - either a substance (simple ingredient) or another medication of a medication.",
      "requirements" : "The ingredient may reference a substance (for example, amoxicillin) or another medication (for example in the case of a compounded product, Glaxal Base).",
      "min" : 1,
      "max" : "1",
      "type" : [{
        "code" : "CodeableConcept"
      },
      {
        "code" : "Reference",
        "targetProfile" : ["http://hl7.org/fhir/StructureDefinition/Substance",
        "http://hl7.org/fhir/StructureDefinition/Medication"]
      }],
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "coding.code = //element(*,MedicationType)/DrugCoded/ProductCode\r\rcoding.system = //element(*,MedicationType)/DrugCoded/ProductCodeQualifier\r\rcoding.display = //element(*,MedicationType)/DrugDescription"
      },
      {
        "identity" : "v2",
        "map" : "RXC-2-Component Code  if medication: RXO-1-Requested Give Code / RXE-2-Give Code / RXD-2-Dispense/Give Code / RXG-4-Give Code / RXA-5-Administered Code"
      },
      {
        "identity" : "rim",
        "map" : ".player"
      }]
    },
    {
      "id" : "Medication.ingredient.isActive",
      "path" : "Medication.ingredient.isActive",
      "short" : "Active ingredient indicator",
      "definition" : "Indication of whether this ingredient affects the therapeutic action of the drug.",
      "requirements" : "True indicates that the ingredient affects the therapeutic action of the drug (i.e. active). \rFalse indicates that the ingredient does not affect the therapeutic action of the drug (i.e. inactive).",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "boolean"
      }],
      "mapping" : [{
        "identity" : "rim",
        "map" : "NA"
      }]
    },
    {
      "id" : "Medication.ingredient.strength",
      "path" : "Medication.ingredient.strength",
      "short" : "Quantity of ingredient present",
      "definition" : "Specifies how many (or how much) of the items there are in this Medication.  For example, 250 mg per tablet.  This is expressed as a ratio where the numerator is 250mg and the denominator is 1 tablet.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "Ratio"
      }],
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "//element(*,DrugCodedType)/Strength"
      },
      {
        "identity" : "v2",
        "map" : "RXC-3-Component Amount & RXC-4-Component Units  if medication: RXO-2-Requested Give Amount - Minimum & RXO-4-Requested Give Units / RXO-3-Requested Give Amount - Maximum & RXO-4-Requested Give Units / RXO-11-Requested Dispense Amount & RXO-12-Requested Dispense Units / RXE-3-Give Amount - Minimum & RXE-5-Give Units / RXE-4-Give Amount - Maximum & RXE-5-Give Units / RXE-10-Dispense Amount & RXE-10-Dispense Units"
      },
      {
        "identity" : "rim",
        "map" : ".quantity"
      }]
    },
    {
      "id" : "Medication.batch",
      "path" : "Medication.batch",
      "short" : "Details about packaged medications",
      "definition" : "Information that only applies to packages (not products).",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "BackboneElement"
      }],
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "no mapping"
      },
      {
        "identity" : "rim",
        "map" : ".player[classCode=CONT]"
      }]
    },
    {
      "id" : "Medication.batch.lotNumber",
      "path" : "Medication.batch.lotNumber",
      "short" : "Identifier assigned to batch",
      "definition" : "The assigned lot number of a batch of the specified product.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "string"
      }],
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "no mapping"
      },
      {
        "identity" : "v2",
        "map" : "RXA-15 Substance Lot Number / RXG-19 Substance Lot Number"
      },
      {
        "identity" : "rim",
        "map" : ".id"
      }]
    },
    {
      "id" : "Medication.batch.expirationDate",
      "path" : "Medication.batch.expirationDate",
      "short" : "When batch will expire",
      "definition" : "When this specific batch of product will expire.",
      "min" : 0,
      "max" : "1",
      "type" : [{
        "code" : "dateTime"
      }],
      "mapping" : [{
        "identity" : "script10.6",
        "map" : "no mapping"
      },
      {
        "identity" : "v2",
        "map" : "RXA-16 Substance Expiration Date / RXG-20 Substance Expiration Date"
      },
      {
        "identity" : "rim",
        "map" : "participation[typeCode=CSM].role[classCode=INST].scopedRole.scoper[classCode=MMAT].expirationTime"
      }]
    }]
  }
}


