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


Pharmacy Work GroupMaturity Level: N/AStandards 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#> 

IMPORT <code.shex>
IMPORT <Ratio.shex>
IMPORT <string.shex>
IMPORT <boolean.shex>
IMPORT <Quantity.shex>
IMPORT <dateTime.shex>
IMPORT <Reference.shex>
IMPORT <Identifier.shex>
IMPORT <Organization.shex>
IMPORT <DomainResource.shex>
IMPORT <CodeableConcept.shex>
IMPORT <BackboneElement.shex>
IMPORT <CodeableReference.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:link 
    			@<Organization> ? }?;  # Organization that has 
                                            # authorization to market medication 
    fhir:doseForm @<CodeableConcept>?;      # powder | tablets | capsule +
    fhir:totalVolume @<Quantity>?;          # When the specified product code 
                                            # does not infer a package size, 
                                            # this is the specific amount of 
                                            # drug in the product 
    fhir:ingredient @<OneOrMore_Medication.ingredient>?;  # Active or inactive ingredient
    fhir:batch @<Medication.batch>?;        # Details about packaged medications
    fhir:definition @<Reference> AND {fhir:link 
    			@<MedicationKnowledge> ? }?;  # Knowledge about this medication

# Details about packaged medications
<Medication.batch> EXTENDS @<BackboneElement> CLOSED {   
    fhir:lotNumber @<string>?;              # Identifier assigned to batch
    fhir:expirationDate @<dateTime>?;       # When batch will expire

# Active or inactive ingredient
<Medication.ingredient> EXTENDS @<BackboneElement> CLOSED {   
    fhir:item @<CodeableReference>;         # The ingredient (substance or 
                                            # medication) that the 
                                            # ingredient.strength relates to 
    fhir:isActive @<boolean>?;              # Active ingredient indicator
    fhir:strength @<Ratio>  OR 
    			@<CodeableConcept>  OR 
    			@<Quantity>  ?;  # Quantity of ingredient present

#---------------------- 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.