FHIR CI-Build

This is the Continuous Integration Build of FHIR (will be incorrect/inconsistent at times).
See the Directory of published versions

Medication.shex

Responsible Owner: Pharmacy Work GroupStandards Status: InformativeCompartments: No defined compartments

Raw ShEx

ShEx statement for medication

PREFIX fhir: <http://hl7.org/fhir/> 
PREFIX fhirvs: <http://hl7.org/fhir/ValueSet/>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#> 
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> 

# ShEx Version 2.2
IMPORT <Code.shex>
IMPORT <Ratio.shex>
IMPORT <String.shex>
IMPORT <Boolean.shex>
IMPORT <DateTime.shex>
IMPORT <Quantity.shex>
IMPORT <Reference.shex>
IMPORT <Identifier.shex>
IMPORT <Organization.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <CodeableReference.shex>
IMPORT <PackagedProductDefinition.shex>
IMPORT <ManufacturedItemDefinition.shex>
IMPORT <MedicinalProductDefinition.shex>
IMPORT <AdministrableProductDefinition.shex>

start=@<Medication> AND {fhir:nodeRole [fhir:treeRoot]}

# Definition of a Medication
<Medication> EXTENDS @<DomainResource> CLOSED {   
    a [fhir:Medication]?;fhir:nodeRole [fhir:treeRoot]?;

    fhir:identifier @<OneOrMore_Identifier>?;  # Business identifier for this 
                                            # medication 
    fhir:code @<CodeableConcept>?;          # Codes that identify this medication
    fhir:status @<Code> AND
    	{fhir:v @fhirvs:medication-status}?;  # active | inactive | 
                                            # entered-in-error 
    fhir:marketingAuthorizationHolder @<Reference> AND {fhir:l 
    			@<Organization> ? }?;  # Organization that has 
                                            # authorization to market medication 
    fhir:doseForm @<CodeableConcept>?;      # powder | tablets | capsule +
    fhir:packageSize @<Medication.packageSize>?;  # When the code does not specify the 
                                            # package size, this backbone 
                                            # element can be used to specify the 
                                            # overall amount of medication in 
                                            # the package 
    fhir:ingredient @<OneOrMore_Medication.ingredient>?;  # Components of a medication. These 
                                            # can be ingredient substances or 
                                            # other medications, in the case of 
                                            # combination packaged medications 
    fhir:instance @<Medication.instance>?;  # Details about packaged medications
    fhir:definition @<Reference> AND {fhir:l 
    			@<AdministrableProductDefinition> OR 
    			@<ManufacturedItemDefinition> OR 
    			@<MedicinalProductDefinition> OR 
    			@<PackagedProductDefinition> ? }?;  # Formal definition of the medication
}  

# Details about packaged medications
<Medication.instance> EXTENDS @<BackboneElement> CLOSED {   
    fhir:identifier @<OneOrMore_Identifier>?;  # Identifier for the physical 
                                            # instance, typically a serial 
                                            # number 
    fhir:lotNumber @<String>?;              # Identifier assigned to batch
    fhir:expirationDate @<DateTime>?;       # When instance will expire
}  

# Components of a medication. These can be ingredient substances or other medications, in the case of combination packaged medications
<Medication.ingredient> EXTENDS @<BackboneElement> CLOSED {   
    fhir:item @<CodeableReference>;         # The specific substance or 
                                            # medication that is the ingredient 
    fhir:isActive @<Boolean>?;              # Active ingredient indicator
    fhir:role @<CodeableConcept>?;          # A code that defines the type of 
                                            # ingredient, active, base, etc. 
    fhir:strength @<Ratio>  OR 
    			@<CodeableConcept>  OR 
    			@<Quantity>  ?;  # Quantity of ingredient present
}  

# When the code does not specify the package size, this backbone element can be used to specify the overall amount of medication in the package
<Medication.packageSize> EXTENDS @<BackboneElement> CLOSED {   
    fhir:numberOfItems @<Quantity>?;        # The number of items in the package 
                                            # that are represented by the code 
    fhir:amountPerItem @<Ratio>?;           # The amount per each item
}  

#---------------------- Cardinality Types (OneOrMore) -------------------
<OneOrMore_Identifier> CLOSED {
    rdf:first @<Identifier>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Identifier> 
}
<OneOrMore_Medication.ingredient> CLOSED {
    rdf:first @<Medication.ingredient>  ;
    rdf:rest [rdf:nil] OR @<OneOrMore_Medication.ingredient> 
}

#---------------------- Value Sets ------------------------

# Medication Status Codes
fhirvs:medication-status ["active" "inactive" "entered-in-error"]


Usage note: every effort has been made to ensure that the ShEx files are correct and useful, but they are not a normative part of the specification.