Medication Statement

The MedicationStatement resource is used to record a medications or substances that the patient reports as being taken, not taking, have taken in the past or may take in the future.

Overview

The below overview shows the elements of the resource, data type and the cardinality of each. Further details like "Binding"/"Fixed values"/"contraints" etc can be found on clicking on each element.

Canonical URL - http://roche.com/fhir/rdc/StructureDefinition/medication-statement

idΣ0..1id
metaΣ0..1Meta
implicitRulesΣ ?!0..1uri
language0..1codeBinding
textC0..1Narrative
contained0..*Resource
parentDeviceMetricC0..1Extension(Reference(dm-devicemetric))
modifierExtension?! C0..*Extension
identifierΣ0..*Identifier
basedOnΣ C0..*Reference(CarePlan | MedicationRequest | ProcedureRequest | ReferralRequest)
partOfΣ C0..*Reference(MedicationAdministration | MedicationDispense | MedicationStatement | Observation | Procedure)
contextΣ C0..0Reference(Encounter | EpisodeOfCare)
statusΣ ?!1..1codeBinding
categoryΣ0..1CodeableConceptBinding
medicationCodeableConceptΣ1..1CodeableConceptBinding
effectiveDateTimedateTime
effectivePeriodPeriod
dateAssertedΣ0..0dateTime
informationSourceC0..0Reference(Organization | Patient | Practitioner | RelatedPerson)
subjectΣ C1..1Reference(Group | Patient)
derivedFromC0..0Reference(Resource)
takenΣ ?!1..1codeBinding
reasonNotTakenC0..0CodeableConcept
reasonCode0..0CodeableConcept
reasonReferenceC0..0Reference(Condition | Observation)
note0..0Annotation
dosage0..*Dosage

Details

MedicationStatement
ShortRecord of medication being taken by a patient
Definition

A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains

The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information.

Cardinality0..*
Comments

When interpreting a medicationStatement, the value of the status and NotTaken needed to be considered: MedicationStatement.status + MedicationStatement.wasNotTaken Status=Active + NotTaken=T = Not currently taking Status=Completed + NotTaken=T = Not taken in the past Status=Intended + NotTaken=T = No intention of taking Status=Active + NotTaken=F = Taking, but not as prescribed Status=Active + NotTaken=F = Taking Status=Intended +NotTaken= F = Will be taking (not started) Status=Completed + NotTaken=F = Taken in past Status=In Error + NotTaken=N/A = In Error.

Constraints
  • dom-2: If the resource is contained in another resource, it SHALL NOT contain nested Resources
    contained.contained.empty()
  • dom-1: If the resource is contained in another resource, it SHALL NOT contain any narrative
    contained.text.empty()
  • dom-4: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
    contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
  • dom-3: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource
    contained.where(('#'+id in %resource.descendants().reference).not()).empty()
  • mst-1: Reason not taken is only permitted if Taken is No
    reasonNotTaken.exists().not() or (taken = 'n')
Mappings
  • rim: Entity. Role, or Act
  • workflow: ..Event
  • rim: SubstanceAdministration
  • w5: clinical.medication
MedicationStatement.id
ShortLogical id of this artifact
Definition

The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.

Cardinality0..1
Typeid
SummaryTrue
Comments

The only time that a resource does not have an id is when it is being submitted to the server using a create operation.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.meta
ShortMetadata about the resource
Definition

The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.

Cardinality0..1
TypeMeta
SummaryTrue
ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.implicitRules
ShortA set of rules under which this content was created
Definition

A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.

Cardinality0..1
Typeuri
ModifierTrue
SummaryTrue
Comments

Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element.

This element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.language
ShortLanguage of the resource content
Definition

The base language in which the resource is written.

Cardinality0..1
Typecode
Binding

A human language.

Common Languages (extensible)

Binding extensions
maxValueSetAll Languages
Comments

Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.text
ShortText summary of the resource, for human interpretation
Definition

A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.

Cardinality0..1
TypeNarrative
Aliasnarrative, html, xhtml, display
Comments

Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded in formation is added later.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1, dom-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: N/A
  • rim: Act.text?
MedicationStatement.contained
ShortContained, inline Resources
Definition

These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.

Cardinality0..*
TypeResource
Aliasinline resources, anonymous resources, contained resources
Comments

This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again.

Mappings
  • rim: Entity. Role, or Act
  • rim: N/A
MedicationStatement.extension
ShortAdditional Content defined by implementations
Definition

May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.

Cardinality0..*
TypeExtension
Aliasextensions, user content
Comments

There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.

Slicing

Unordered, Open, by url(Value)

Extensions are always sliced by (at least) url

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.extension:parentDeviceMetric
ShortOptional Extension Element
Definition

Optional Extension Element - found in all resources.

Cardinality0..1
TypeExtension(Reference(dm-devicemetric))
Aliasextensions, user content
Comments

There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.modifierExtension
ShortExtensions that cannot be ignored
Definition

May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.

Cardinality0..*
TypeExtension
ModifierTrue
Aliasextensions, user content
Comments

There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.

Slicing

Unordered, Open, by url(Value)

Extensions are always sliced by (at least) url

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ext-1: Must have either extensions or value[x], not both
    extension.exists() != value.exists()
Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.identifier
ShortExternal identifier
Definition

External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.

Cardinality0..*
TypeIdentifier
SummaryTrue
ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CX / EI (occasionally, more often EI maps to a resource id or a URL)
  • rim: II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs. Also maps to Role[classCode=IDENT]
  • servd: Identifier
  • workflow: …identifer
  • rim: .id
  • w5: id
MedicationStatement.basedOn
ShortFulfils plan, proposal or order
Definition

A plan, proposal or order that is fulfilled in whole or in part by this event.

Cardinality0..*
TypeReference(CarePlan | MedicationRequest | ProcedureRequest | ReferralRequest)
SummaryTrue
Requirements

Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.

Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • workflow: …basedOn
  • rim: .outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]
MedicationStatement.partOf
ShortPart of referenced event
Definition

A larger event of which this particular event is a component or step.

Cardinality0..*
TypeReference(MedicationAdministration | MedicationDispense | MedicationStatement | Observation | Procedure)
SummaryTrue
Requirements

This should not be used when indicating which resource a MedicationStatement has been derived from. If that is the use case, then MedicationStatement.derivedFrom should be used.

Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • workflow: …part of
  • rim: .outboundRelationship[typeCode=COMP]/target[classCode=SPLY or SBADM or PROC or OBS,moodCode=EVN]
MedicationStatement.context
ShortEncounter / Episode associated with MedicationStatement
Definition

The encounter or episode of care that establishes the context for this MedicationStatement.

Cardinality0..0
TypeReference(Encounter | EpisodeOfCare)
SummaryTrue
Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • workflow: …context
  • rim: .inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code="type of encounter or episode"]
MedicationStatement.status
Shortactive | completed | entered-in-error | intended | stopped | on-hold
Definition

A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.

Cardinality1..1
Typecode
Binding

A coded concept indicating the current status of a MedicationStatement.

MedicationStatementStatus (required)

ModifierTrue
SummaryTrue
Comments

MedicationStatement is a statement at a point in time. The status is only representative at the point when it was asserted. The value set for MedicationStatement.status contains codes that assert the status of the use of the medication by the patient (for example, stopped or on hold) as well as codes that assert the status of the medication statement itself (for example, entered in error).

This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • workflow: …status
  • rim: .statusCode
  • w5: status
MedicationStatement.category
ShortType of medication usage
Definition

Indicates where type of medication statement and where the medication is expected to be consumed or administered.

Cardinality0..1
TypeCodeableConcept
Binding

A coded concept identifying where the medication included in the medicationstatement is expected to be consumed or administered

MedicationStatementCategory (preferred)

SummaryTrue
Comments

Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE
  • rim: CD
  • orim: fhir:CodeableConcept rdfs:subClassOf dt:CD
  • rim: .inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code="type of medication usage"].value
  • w5: class
MedicationStatement.medication[x]:medicationCodeableConcept
ShortWhat medication was taken
Definition

Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.

Cardinality1..1
TypeCodeableConcept
Binding

A coded concept identifying the substance or product being taken.

medication-codes (required)

SummaryTrue
Comments

If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example if you require form or lot number, then you must reference the Medication resource. .

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • workflow: …code
  • rim: .participation[typeCode=CSM].role[classCode=ADMM or MANU]
  • w5: what
MedicationStatement.effective[x]
ShortThe date/time or interval when the medication was taken
Definition

The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).

Cardinality0..1
TypedateTime | Period
SummaryTrue
Comments

This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the majority of Medication Statements. If the medication is still being taken at the time the statement is recorded, the "end" date will be omitted.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • workflow: …occurrence[x]
  • rim: .effectiveTime
  • w5: when.done
MedicationStatement.dateAsserted
ShortWhen the statement was asserted?
Definition

The date when the medication statement was asserted by the information source.

Cardinality0..0
TypedateTime
SummaryTrue
ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .participation[typeCode=AUT].time
  • w5: when.recorded
MedicationStatement.informationSource
ShortPerson or organization that provided the information about the taking of this medication
Definition

The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest.

Cardinality0..0
TypeReference(Organization | Patient | Practitioner | RelatedPerson)
Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • rim: .participation[typeCode=INF].role[classCode=PAT, or codes for Practioner or Related Person (if PAT is the informer, then syntax for self-reported =true)
  • w5: who.source
MedicationStatement.subject
ShortWho is/was taking the medication
Definition

The person, animal or group who is/was taking the medication.

Cardinality1..1
TypeReference(Group | Patient)
SummaryTrue
Comments

References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • workflow: …subject
  • v2: PID-3-Patient ID List
  • rim: .participation[typeCode=SBJ].role[classCode=PAT]
  • w5: who
MedicationStatement.derivedFrom
ShortAdditional supporting information
Definition

Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.

Cardinality0..0
TypeReference(Resource)
Comments

Likely references would be to MedicationRequest, MedicationDispense, Claim, Observation or QuestionnaireAnswers. The most common use cases for deriving a MedicationStatement comes from creating a MedicationStatement from a MedicationRequest or from a lab observation or a claim. it should be noted that the amount of information that is available varies from the type resource that you derive the MedicationStatement from.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • rim: .outboundRelationship[typeCode=SPRT]/target[classCode=ACT,moodCode=EVN]
MedicationStatement.taken
Shorty | n | unk | na
Definition

Indicator of the certainty of whether the medication was taken by the patient.

Cardinality1..1
Typecode
Binding

A coded concept identifying level of certainty if patient has taken or has not taken the medication

MedicationStatementTaken (required)

ModifierTrue
SummaryTrue
Comments

This element is labeled as a modifier because it indicates that the medication was not taken.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • workflow: …notDone
  • rim: .actionNegationInd
MedicationStatement.reasonNotTaken
ShortTrue if asserting medication was not given
Definition

A code indicating why the medication was not taken.

Cardinality0..0
TypeCodeableConcept
Binding

A coded concept indicating the reason why the medication was not taken

SNOMED CT Drugs not taken/completed Codes (example)

Comments

Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1, mst-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE
  • rim: CD
  • orim: fhir:CodeableConcept rdfs:subClassOf dt:CD
  • rim: .outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code="reason not taken"].value
MedicationStatement.reasonCode
ShortReason for why the medication is being/was taken
Definition

A reason for why the medication is being/was taken.

Cardinality0..0
TypeCodeableConcept
Binding

A coded concept identifying why the medication is being taken.

Condition/Problem/Diagnosis Codes (example)

Comments

This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonForUseReference.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE
  • rim: CD
  • orim: fhir:CodeableConcept rdfs:subClassOf dt:CD
  • workflow: …reasoneCodeableConcept
  • rim: .reasonCode
  • w5: why
MedicationStatement.reasonReference
ShortCondition or observation that supports why the medication is being/was taken
Definition

Condition or observation that supports why the medication is being/was taken.

Cardinality0..0
TypeReference(Condition | Observation)
Comments

This is a reference to a condition that is the reason why the medication is being/was taken. If only a code exists, use reasonForUseCode.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • ref-1: SHALL have a contained resource if a local reference is provided
    reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))
Mappings
  • rim: n/a
  • rim: The target of a resource reference is a RIM entry point (Act, Role, or Entity)
  • workflow: …reasonReference
  • rim: .outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code="reason for use"].value
  • w5: why
MedicationStatement.note
ShortFurther information about the statement
Definition

Provides extra information about the medication statement that is not conveyed by the other attributes.

Cardinality0..0
TypeAnnotation
Comments

For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time. This element may need to be included in narrative because of the potential for modifying information. Annotations SHOULD NOT be used to communicate "modifying" information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible).

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: N/A
  • rim: Act
  • workflow: …note
  • rim: .inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code="annotation"].value
MedicationStatement.dosage
ShortDetails of how medication is/was taken or should be taken
Definition

Indicates how the medication is/was or should be taken by the patient.

Cardinality0..*
TypeDosage
Comments

The dates included in the dosage on a Medication Statement reflect the dates for a given dose. For example, "from November 1, 2016 to November 3, 2016, take one tablet daily and from November 4, 2016 to November 7, 2016, take two tablets daily." It is expected that this specificity may only be populated where the patient brings in their labeled container or where the Medication Statement is derived from a MedicationRequest.

ConditionsThe cardinality or value of this element may be affected by these constraints: ele-1
Constraints
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=INT]
  • rim: refer dosageInstruction mapping

Table

MedicationStatement0..*
MedicationStatement.idid0..1
MedicationStatement.metaMeta0..1
MedicationStatement.implicitRulesuri0..1
MedicationStatement.languagecode0..1
MedicationStatement.textNarrative0..1
MedicationStatement.containedResource0..*
MedicationStatement.extensionExtension0..*
MedicationStatement.extension:parentDeviceMetricExtension0..1
MedicationStatement.modifierExtensionExtension0..*
MedicationStatement.identifierIdentifier0..*
MedicationStatement.basedOnReference(CarePlan | MedicationRequest | ProcedureRequest | ReferralRequest)0..*
MedicationStatement.partOfReference(MedicationAdministration | MedicationDispense | MedicationStatement | Observation | Procedure)0..*
MedicationStatement.contextReference(Encounter | EpisodeOfCare)0..0
MedicationStatement.statuscode1..1
MedicationStatement.categoryCodeableConcept0..1
MedicationStatement.medication[x]:medicationCodeableConceptCodeableConcept1..1
MedicationStatement.effective[x]dateTime | Period0..1
MedicationStatement.dateAsserteddateTime0..0
MedicationStatement.informationSourceReference(Organization | Patient | Practitioner | RelatedPerson)0..0
MedicationStatement.subjectReference(Group | Patient)1..1
MedicationStatement.derivedFromReference(Resource)0..0
MedicationStatement.takencode1..1
MedicationStatement.reasonNotTakenCodeableConcept0..0
MedicationStatement.reasonCodeCodeableConcept0..0
MedicationStatement.reasonReferenceReference(Condition | Observation)0..0
MedicationStatement.noteAnnotation0..0
MedicationStatement.dosageDosage0..*

XML

<StructureDefinition xmlns="http://hl7.org/fhir">
<id value="d21cace3-a228-445d-9fe6-171662752ee2" />
<url value="http://roche.com/fhir/rdc/StructureDefinition/medication-statement" />
<name value="medicationstatement" />
<status value="active" />
<fhirVersion value="3.0.2" />
<kind value="resource" />
<abstract value="false" />
<type value="MedicationStatement" />
<baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
<derivation value="constraint" />
<element id="MedicationStatement">
<path value="MedicationStatement" />
<short value="Record of medication being taken by a patient" />
<definition value="A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \n\nThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information." />
<comment value="When interpreting a medicationStatement, the value of the status and NotTaken needed to be considered:\nMedicationStatement.status + MedicationStatement.wasNotTaken\nStatus=Active + NotTaken=T = Not currently taking\nStatus=Completed + NotTaken=T = Not taken in the past\nStatus=Intended + NotTaken=T = No intention of taking\nStatus=Active + NotTaken=F = Taking, but not as prescribed\nStatus=Active + NotTaken=F = Taking\nStatus=Intended +NotTaken= F = Will be taking (not started)\nStatus=Completed + NotTaken=F = Taken in past\nStatus=In Error + NotTaken=N/A = In Error." />
<min value="0" />
<max value="*" />
<path value="Resource" />
<min value="0" />
<max value="*" />
</base>
<key value="dom-2" />
<severity value="error" />
<human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
<expression value="contained.contained.empty()" />
<xpath value="not(parent::f:contained and f:contained)" />
</constraint>
<key value="dom-1" />
<severity value="error" />
<human value="If the resource is contained in another resource, it SHALL NOT contain any narrative" />
<expression value="contained.text.empty()" />
<xpath value="not(parent::f:contained and f:text)" />
</constraint>
<key value="dom-4" />
<severity value="error" />
<human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
<expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
<xpath value="not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))" />
</constraint>
<key value="dom-3" />
<severity value="error" />
<human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource" />
<expression value="contained.where(('#'+id in %resource.descendants().reference).not()).empty()" />
<xpath value="not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))" />
</constraint>
<key value="mst-1" />
<severity value="error" />
<human value="Reason not taken is only permitted if Taken is No" />
<expression value="reasonNotTaken.exists().not() or (taken = 'n')" />
<xpath value="not(exists(f:reasonNotTaken)) or f:taken/@value='n'" />
</constraint>
<identity value="rim" />
<map value="Entity. Role, or Act" />
</mapping>
<identity value="workflow" />
<map value="..Event" />
</mapping>
<identity value="rim" />
<map value="SubstanceAdministration" />
</mapping>
<identity value="w5" />
<map value="clinical.medication" />
</mapping>
</element>
<element id="MedicationStatement.id">
<path value="MedicationStatement.id" />
<short value="Logical id of this artifact" />
<definition value="The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes." />
<comment value="The only time that a resource does not have an id is when it is being submitted to the server using a create operation." />
<min value="0" />
<max value="1" />
<path value="Resource.id" />
<min value="0" />
<max value="1" />
</base>
<code value="id" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
</element>
<element id="MedicationStatement.meta">
<path value="MedicationStatement.meta" />
<short value="Metadata about the resource" />
<definition value="The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource." />
<min value="0" />
<max value="1" />
<path value="Resource.meta" />
<min value="0" />
<max value="1" />
</base>
<code value="Meta" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.implicitRules">
<path value="MedicationStatement.implicitRules" />
<short value="A set of rules under which this content was created" />
<definition value="A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content." />
<comment value="Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. \n\nThis element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation." />
<min value="0" />
<max value="1" />
<path value="Resource.implicitRules" />
<min value="0" />
<max value="1" />
</base>
<code value="uri" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isModifier value="true" />
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
</element>
<element id="MedicationStatement.language">
<path value="MedicationStatement.language" />
<short value="Language of the resource content" />
<definition value="The base language in which the resource is written." />
<comment value="Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute)." />
<min value="0" />
<max value="1" />
<path value="Resource.language" />
<min value="0" />
<max value="1" />
</base>
<code value="code" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
<reference value="http://hl7.org/fhir/ValueSet/all-languages" />
</valueReference>
</extension>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="Language" />
</extension>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
<valueBoolean value="true" />
</extension>
<strength value="extensible" />
<description value="A human language." />
<reference value="http://hl7.org/fhir/ValueSet/languages" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
</element>
<element id="MedicationStatement.text">
<path value="MedicationStatement.text" />
<short value="Text summary of the resource, for human interpretation" />
<definition value="A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it "clinically safe" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety." />
<comment value="Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a "text blob" or where text is additionally entered raw or narrated and encoded in formation is added later." />
<alias value="narrative" />
<alias value="html" />
<alias value="xhtml" />
<alias value="display" />
<min value="0" />
<max value="1" />
<path value="DomainResource.text" />
<min value="0" />
<max value="1" />
</base>
<code value="Narrative" />
</type>
<condition value="ele-1" />
<condition value="dom-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
<identity value="rim" />
<map value="Act.text?" />
</mapping>
</element>
<element id="MedicationStatement.contained">
<path value="MedicationStatement.contained" />
<short value="Contained, inline Resources" />
<definition value="These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope." />
<comment value="This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again." />
<alias value="inline resources" />
<alias value="anonymous resources" />
<alias value="contained resources" />
<min value="0" />
<max value="*" />
<path value="DomainResource.contained" />
<min value="0" />
<max value="*" />
</base>
<code value="Resource" />
</type>
<identity value="rim" />
<map value="Entity. Role, or Act" />
</mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.extension">
<path value="MedicationStatement.extension" />
<type value="value" />
<path value="url" />
</discriminator>
<description value="Extensions are always sliced by (at least) url" />
<rules value="open" />
</slicing>
<short value="Additional Content defined by implementations" />
<definition value="May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension." />
<comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
<alias value="extensions" />
<alias value="user content" />
<min value="0" />
<max value="*" />
<path value="DomainResource.extension" />
<min value="0" />
<max value="*" />
</base>
<code value="Extension" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ext-1" />
<severity value="error" />
<human value="Must have either extensions or value[x], not both" />
<expression value="extension.exists() != value.exists()" />
<xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.extension:parentDeviceMetric">
<path value="MedicationStatement.extension" />
<sliceName value="parentDeviceMetric" />
<short value="Optional Extension Element" />
<definition value="Optional Extension Element - found in all resources." />
<comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
<alias value="extensions" />
<alias value="user content" />
<min value="0" />
<max value="1" />
<path value="DomainResource.extension" />
<min value="0" />
<max value="*" />
</base>
<code value="Extension" />
<profile value="http://roche.com/fhir/rdc/StructureDefinition/parent-device-metric" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ext-1" />
<severity value="error" />
<human value="Must have either extensions or value[x], not both" />
<expression value="extension.exists() != value.exists()" />
<xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.modifierExtension">
<path value="MedicationStatement.modifierExtension" />
<type value="value" />
<path value="url" />
</discriminator>
<description value="Extensions are always sliced by (at least) url" />
<rules value="open" />
</slicing>
<short value="Extensions that cannot be ignored" />
<definition value="May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions." />
<comment value="There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone." />
<alias value="extensions" />
<alias value="user content" />
<min value="0" />
<max value="*" />
<path value="DomainResource.modifierExtension" />
<min value="0" />
<max value="*" />
</base>
<code value="Extension" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ext-1" />
<severity value="error" />
<human value="Must have either extensions or value[x], not both" />
<expression value="extension.exists() != value.exists()" />
<xpath value="exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])" />
</constraint>
<isModifier value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="N/A" />
</mapping>
</element>
<element id="MedicationStatement.identifier">
<path value="MedicationStatement.identifier" />
<short value="External identifier" />
<definition value="External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated." />
<min value="0" />
<max value="*" />
<path value="MedicationStatement.identifier" />
<min value="0" />
<max value="*" />
</base>
<code value="Identifier" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="v2" />
<map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
</mapping>
<identity value="rim" />
<map value="II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs. Also maps to Role[classCode=IDENT]" />
</mapping>
<identity value="servd" />
<map value="Identifier" />
</mapping>
<identity value="workflow" />
<map value="…identifer" />
</mapping>
<identity value="rim" />
<map value=".id" />
</mapping>
<identity value="w5" />
<map value="id" />
</mapping>
</element>
<element id="MedicationStatement.basedOn">
<path value="MedicationStatement.basedOn" />
<short value="Fulfils plan, proposal or order" />
<definition value="A plan, proposal or order that is fulfilled in whole or in part by this event." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<requirements value="Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon." />
<min value="0" />
<max value="*" />
<path value="MedicationStatement.basedOn" />
<min value="0" />
<max value="*" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationRequest" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/CarePlan" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/ProcedureRequest" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="workflow" />
<map value="…basedOn" />
</mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]" />
</mapping>
</element>
<element id="MedicationStatement.partOf">
<path value="MedicationStatement.partOf" />
<short value="Part of referenced event" />
<definition value="A larger event of which this particular event is a component or step." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<requirements value="This should not be used when indicating which resource a MedicationStatement has been derived from. If that is the use case, then MedicationStatement.derivedFrom should be used." />
<min value="0" />
<max value="*" />
<path value="MedicationStatement.partOf" />
<min value="0" />
<max value="*" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationDispense" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Procedure" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="workflow" />
<map value="…part of" />
</mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=COMP]/target[classCode=SPLY or SBADM or PROC or OBS,moodCode=EVN]" />
</mapping>
</element>
<element id="MedicationStatement.context">
<path value="MedicationStatement.context" />
<short value="Encounter / Episode associated with MedicationStatement" />
<definition value="The encounter or episode of care that establishes the context for this MedicationStatement." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.context" />
<min value="0" />
<max value="1" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Encounter" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="workflow" />
<map value="…context" />
</mapping>
<identity value="rim" />
<map value=".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code="type of encounter or episode"]" />
</mapping>
</element>
<element id="MedicationStatement.status">
<path value="MedicationStatement.status" />
<short value="active | completed | entered-in-error | intended | stopped | on-hold" />
<definition value="A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed." />
<comment value="MedicationStatement is a statement at a point in time. The status is only representative at the point when it was asserted. The value set for MedicationStatement.status contains codes that assert the status of the use of the medication by the patient (for example, stopped or on hold) as well as codes that assert the status of the medication statement itself (for example, entered in error).\n\nThis element is labeled as a modifier because the status contains codes that mark the resource as not currently valid." />
<min value="1" />
<max value="1" />
<path value="MedicationStatement.status" />
<min value="1" />
<max value="1" />
</base>
<code value="code" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isModifier value="true" />
<isSummary value="true" />
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationStatementStatus" />
</extension>
<strength value="required" />
<description value="A coded concept indicating the current status of a MedicationStatement." />
<reference value="http://hl7.org/fhir/ValueSet/medication-statement-status" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="workflow" />
<map value="…status" />
</mapping>
<identity value="rim" />
<map value=".statusCode" />
</mapping>
<identity value="w5" />
<map value="status" />
</mapping>
</element>
<element id="MedicationStatement.category">
<path value="MedicationStatement.category" />
<short value="Type of medication usage" />
<definition value="Indicates where type of medication statement and where the medication is expected to be consumed or administered." />
<comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
<min value="0" />
<max value="1" />
<path value="MedicationStatement.category" />
<min value="0" />
<max value="1" />
</base>
<code value="CodeableConcept" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationStatementCategory" />
</extension>
<strength value="preferred" />
<description value="A coded concept identifying where the medication included in the medicationstatement is expected to be consumed or administered" />
<reference value="http://hl7.org/fhir/ValueSet/medication-statement-category" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="v2" />
<map value="CE/CNE/CWE" />
</mapping>
<identity value="rim" />
<map value="CD" />
</mapping>
<identity value="orim" />
<map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
</mapping>
<identity value="rim" />
<map value=".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code="type of medication usage"].value" />
</mapping>
<identity value="w5" />
<map value="class" />
</mapping>
</element>
<element id="MedicationStatement.medication[x]:medicationCodeableConcept">
<path value="MedicationStatement.medicationCodeableConcept" />
<sliceName value="medicationCodeableConcept" />
<short value="What medication was taken" />
<definition value="Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications." />
<comment value="If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example if you require form or lot number, then you must reference the Medication resource. ." />
<min value="1" />
<max value="1" />
<path value="MedicationStatement.medication[x]" />
<min value="1" />
<max value="1" />
</base>
<code value="CodeableConcept" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<strength value="required" />
<description value="A coded concept identifying the substance or product being taken." />
<reference value="http://roche.com/fhir/rdc/ValueSet/medication-codes" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="v2" />
<map value="CE/CNE/CWE" />
</mapping>
<identity value="rim" />
<map value="CD" />
</mapping>
<identity value="orim" />
<map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
</mapping>
<identity value="workflow" />
<map value="…code" />
</mapping>
<identity value="rim" />
<map value=".participation[typeCode=CSM].role[classCode=ADMM or MANU]" />
</mapping>
<identity value="w5" />
<map value="what" />
</mapping>
</element>
<element id="MedicationStatement.effective[x]">
<path value="MedicationStatement.effective[x]" />
<short value="The date/time or interval when the medication was taken" />
<definition value="The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true)." />
<comment value="This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the majority of Medication Statements. If the medication is still being taken at the time the statement is recorded, the "end" date will be omitted." />
<min value="0" />
<max value="1" />
<path value="MedicationStatement.effective[x]" />
<min value="0" />
<max value="1" />
</base>
<code value="dateTime" />
</type>
<code value="Period" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="workflow" />
<map value="…occurrence[x]" />
</mapping>
<identity value="rim" />
<map value=".effectiveTime" />
</mapping>
<identity value="w5" />
<map value="when.done" />
</mapping>
</element>
<element id="MedicationStatement.dateAsserted">
<path value="MedicationStatement.dateAsserted" />
<short value="When the statement was asserted?" />
<definition value="The date when the medication statement was asserted by the information source." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.dateAsserted" />
<min value="0" />
<max value="1" />
</base>
<code value="dateTime" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value=".participation[typeCode=AUT].time" />
</mapping>
<identity value="w5" />
<map value="when.recorded" />
</mapping>
</element>
<element id="MedicationStatement.informationSource">
<path value="MedicationStatement.informationSource" />
<short value="Person or organization that provided the information about the taking of this medication" />
<definition value="The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.informationSource" />
<min value="0" />
<max value="1" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Practitioner" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="rim" />
<map value=".participation[typeCode=INF].role[classCode=PAT, or codes for Practioner or Related Person (if PAT is the informer, then syntax for self-reported =true)" />
</mapping>
<identity value="w5" />
<map value="who.source" />
</mapping>
</element>
<element id="MedicationStatement.subject">
<path value="MedicationStatement.subject" />
<short value="Who is/was taking the medication" />
<definition value="The person, animal or group who is/was taking the medication." />
<comment value="References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository." />
<min value="1" />
<max value="1" />
<path value="MedicationStatement.subject" />
<min value="1" />
<max value="1" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Patient" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<isSummary value="true" />
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="workflow" />
<map value="…subject" />
</mapping>
<identity value="v2" />
<map value="PID-3-Patient ID List" />
</mapping>
<identity value="rim" />
<map value=".participation[typeCode=SBJ].role[classCode=PAT]" />
</mapping>
<identity value="w5" />
<map value="who" />
</mapping>
</element>
<element id="MedicationStatement.derivedFrom">
<path value="MedicationStatement.derivedFrom" />
<short value="Additional supporting information" />
<definition value="Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement." />
<comment value="Likely references would be to MedicationRequest, MedicationDispense, Claim, Observation or QuestionnaireAnswers. The most common use cases for deriving a MedicationStatement comes from creating a MedicationStatement from a MedicationRequest or from a lab observation or a claim. it should be noted that the amount of information that is available varies from the type resource that you derive the MedicationStatement from." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.derivedFrom" />
<min value="0" />
<max value="*" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=SPRT]/target[classCode=ACT,moodCode=EVN]" />
</mapping>
</element>
<element id="MedicationStatement.taken">
<path value="MedicationStatement.taken" />
<short value="y | n | unk | na" />
<definition value="Indicator of the certainty of whether the medication was taken by the patient." />
<comment value="This element is labeled as a modifier because it indicates that the medication was not taken." />
<min value="1" />
<max value="1" />
<path value="MedicationStatement.taken" />
<min value="1" />
<max value="1" />
</base>
<code value="code" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<isModifier value="true" />
<isSummary value="true" />
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationStatementTaken" />
</extension>
<strength value="required" />
<description value="A coded concept identifying level of certainty if patient has taken or has not taken the medication" />
<reference value="http://hl7.org/fhir/ValueSet/medication-statement-taken" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="workflow" />
<map value="…notDone" />
</mapping>
<identity value="rim" />
<map value=".actionNegationInd" />
</mapping>
</element>
<element id="MedicationStatement.reasonNotTaken">
<path value="MedicationStatement.reasonNotTaken" />
<short value="True if asserting medication was not given" />
<definition value="A code indicating why the medication was not taken." />
<comment value="Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.reasonNotTaken" />
<min value="0" />
<max value="*" />
</base>
<code value="CodeableConcept" />
</type>
<condition value="ele-1" />
<condition value="mst-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationStatementNotTakenReason" />
</extension>
<strength value="example" />
<description value="A coded concept indicating the reason why the medication was not taken" />
<reference value="http://hl7.org/fhir/ValueSet/reason-medication-not-taken-codes" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="v2" />
<map value="CE/CNE/CWE" />
</mapping>
<identity value="rim" />
<map value="CD" />
</mapping>
<identity value="orim" />
<map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
</mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code="reason not taken"].value" />
</mapping>
</element>
<element id="MedicationStatement.reasonCode">
<path value="MedicationStatement.reasonCode" />
<short value="Reason for why the medication is being/was taken" />
<definition value="A reason for why the medication is being/was taken." />
<comment value="This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonForUseReference." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.reasonCode" />
<min value="0" />
<max value="*" />
</base>
<code value="CodeableConcept" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
<valueString value="MedicationReason" />
</extension>
<strength value="example" />
<description value="A coded concept identifying why the medication is being taken." />
<reference value="http://hl7.org/fhir/ValueSet/condition-code" />
</valueSetReference>
</binding>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="v2" />
<map value="CE/CNE/CWE" />
</mapping>
<identity value="rim" />
<map value="CD" />
</mapping>
<identity value="orim" />
<map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
</mapping>
<identity value="workflow" />
<map value="…reasoneCodeableConcept" />
</mapping>
<identity value="rim" />
<map value=".reasonCode" />
</mapping>
<identity value="w5" />
<map value="why" />
</mapping>
</element>
<element id="MedicationStatement.reasonReference">
<path value="MedicationStatement.reasonReference" />
<short value="Condition or observation that supports why the medication is being/was taken" />
<definition value="Condition or observation that supports why the medication is being/was taken." />
<comment value="This is a reference to a condition that is the reason why the medication is being/was taken. If only a code exists, use reasonForUseCode." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.reasonReference" />
<min value="0" />
<max value="*" />
</base>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Condition" />
</type>
<code value="Reference" />
<targetProfile value="http://hl7.org/fhir/StructureDefinition/Observation" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<key value="ref-1" />
<severity value="error" />
<human value="SHALL have a contained resource if a local reference is provided" />
<expression value="reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))" />
<xpath value="not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
</mapping>
<identity value="workflow" />
<map value="…reasonReference" />
</mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code="reason for use"].value" />
</mapping>
<identity value="w5" />
<map value="why" />
</mapping>
</element>
<element id="MedicationStatement.note">
<path value="MedicationStatement.note" />
<short value="Further information about the statement" />
<definition value="Provides extra information about the medication statement that is not conveyed by the other attributes." />
<comment value="For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time. This element may need to be included in narrative because of the potential for modifying information. *Annotations SHOULD NOT* be used to communicate "modifying" information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible)." />
<min value="0" />
<max value="0" />
<path value="MedicationStatement.note" />
<min value="0" />
<max value="*" />
</base>
<code value="Annotation" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="v2" />
<map value="N/A" />
</mapping>
<identity value="rim" />
<map value="Act" />
</mapping>
<identity value="workflow" />
<map value="…note" />
</mapping>
<identity value="rim" />
<map value=".inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code="annotation"].value" />
</mapping>
</element>
<element id="MedicationStatement.dosage">
<path value="MedicationStatement.dosage" />
<short value="Details of how medication is/was taken or should be taken" />
<definition value="Indicates how the medication is/was or should be taken by the patient." />
<comment value="The dates included in the dosage on a Medication Statement reflect the dates for a given dose. For example, "from November 1, 2016 to November 3, 2016, take one tablet daily and from November 4, 2016 to November 7, 2016, take two tablets daily." It is expected that this specificity may only be populated where the patient brings in their labeled container or where the Medication Statement is derived from a MedicationRequest." />
<min value="0" />
<max value="*" />
<path value="MedicationStatement.dosage" />
<min value="0" />
<max value="*" />
</base>
<code value="Dosage" />
</type>
<condition value="ele-1" />
<key value="ele-1" />
<severity value="error" />
<human value="All FHIR elements must have a @value or children" />
<expression value="hasValue() | (children().count() > id.count())" />
<xpath value="@value|f:*|h:div" />
</constraint>
<identity value="rim" />
<map value="n/a" />
</mapping>
<identity value="rim" />
<map value=".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=INT]" />
</mapping>
<identity value="rim" />
<map value="refer dosageInstruction mapping" />
</mapping>
</element>
</snapshot>
<element id="MedicationStatement.extension">
<path value="MedicationStatement.extension" />
<type value="value" />
<path value="url" />
</discriminator>
<rules value="open" />
</slicing>
</element>
<element id="MedicationStatement.extension:parentDeviceMetric">
<path value="MedicationStatement.extension" />
<sliceName value="parentDeviceMetric" />
<short value="Optional Extension Element" />
<definition value="Optional Extension Element - found in all resources." />
<min value="0" />
<max value="1" />
<code value="Extension" />
<profile value="http://roche.com/fhir/rdc/StructureDefinition/parent-device-metric" />
</type>
</element>
<element id="MedicationStatement.context">
<path value="MedicationStatement.context" />
<max value="0" />
</element>
<element id="MedicationStatement.medication[x]:medicationCodeableConcept">
<path value="MedicationStatement.medicationCodeableConcept" />
<sliceName value="medicationCodeableConcept" />
<code value="CodeableConcept" />
</type>
<strength value="required" />
<reference value="http://roche.com/fhir/rdc/ValueSet/medication-codes" />
</valueSetReference>
</binding>
</element>
<element id="MedicationStatement.dateAsserted">
<path value="MedicationStatement.dateAsserted" />
<max value="0" />
</element>
<element id="MedicationStatement.informationSource">
<path value="MedicationStatement.informationSource" />
<max value="0" />
</element>
<element id="MedicationStatement.derivedFrom">
<path value="MedicationStatement.derivedFrom" />
<max value="0" />
</element>
<element id="MedicationStatement.reasonNotTaken">
<path value="MedicationStatement.reasonNotTaken" />
<max value="0" />
</element>
<element id="MedicationStatement.reasonCode">
<path value="MedicationStatement.reasonCode" />
<max value="0" />
</element>
<element id="MedicationStatement.reasonReference">
<path value="MedicationStatement.reasonReference" />
<max value="0" />
</element>
<element id="MedicationStatement.note">
<path value="MedicationStatement.note" />
<max value="0" />
</element>
</differential>
</StructureDefinition>

JSON

{
"resourceType": "StructureDefinition",
"id": "d21cace3-a228-445d-9fe6-171662752ee2",
"url": "http://roche.com/fhir/rdc/StructureDefinition/medication-statement",
"name": "medicationstatement",
"status": "active",
"fhirVersion": "3.0.2",
"kind": "resource",
"abstract": false,
"type": "MedicationStatement",
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationStatement",
"derivation": "constraint",
"element": [
{
"id": "MedicationStatement",
"path": "MedicationStatement",
"short": "Record of medication being taken by a patient",
"definition": "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \n\nThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information.",
"comment": "When interpreting a medicationStatement, the value of the status and NotTaken needed to be considered:\nMedicationStatement.status + MedicationStatement.wasNotTaken\nStatus=Active + NotTaken=T = Not currently taking\nStatus=Completed + NotTaken=T = Not taken in the past\nStatus=Intended + NotTaken=T = No intention of taking\nStatus=Active + NotTaken=F = Taking, but not as prescribed\nStatus=Active + NotTaken=F = Taking\nStatus=Intended +NotTaken= F = Will be taking (not started)\nStatus=Completed + NotTaken=F = Taken in past\nStatus=In Error + NotTaken=N/A = In Error.",
"min": 0,
"max": "*",
"base": {
"path": "Resource",
"min": 0,
"max": "*"
},
{
"key": "dom-2",
"severity": "error",
"human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources",
"expression": "contained.contained.empty()",
"xpath": "not(parent::f:contained and f:contained)"
},
{
"key": "dom-1",
"severity": "error",
"human": "If the resource is contained in another resource, it SHALL NOT contain any narrative",
"expression": "contained.text.empty()",
"xpath": "not(parent::f:contained and f:text)"
},
{
"key": "dom-4",
"severity": "error",
"human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",
"expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()",
"xpath": "not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))"
},
{
"key": "dom-3",
"severity": "error",
"human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource",
"expression": "contained.where(('#'+id in %resource.descendants().reference).not()).empty()",
"xpath": "not(exists(for $id in f:contained/*/@id return $id[not(ancestor::f:contained/parent::*/descendant::f:reference/@value=concat('#', $id))]))"
},
{
"key": "mst-1",
"severity": "error",
"human": "Reason not taken is only permitted if Taken is No",
"expression": "reasonNotTaken.exists().not() or (taken = 'n')",
"xpath": "not(exists(f:reasonNotTaken)) or f:taken/@value='n'"
}
],
"mapping": [
{
"identity": "rim",
"map": "Entity. Role, or Act"
},
{
"identity": "workflow",
"map": "..Event"
},
{
"identity": "rim",
"map": "SubstanceAdministration"
},
{
"identity": "w5",
"map": "clinical.medication"
}
]
},
{
"id": "MedicationStatement.id",
"path": "MedicationStatement.id",
"short": "Logical id of this artifact",
"definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.",
"comment": "The only time that a resource does not have an id is when it is being submitted to the server using a create operation.",
"min": 0,
"max": "1",
"base": {
"path": "Resource.id",
"min": 0,
"max": "1"
},
"type": [
{
"code": "id"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
}
]
},
{
"id": "MedicationStatement.meta",
"path": "MedicationStatement.meta",
"short": "Metadata about the resource",
"definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content may not always be associated with version changes to the resource.",
"min": 0,
"max": "1",
"base": {
"path": "Resource.meta",
"min": 0,
"max": "1"
},
"type": [
{
"code": "Meta"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "N/A"
}
]
},
{
"id": "MedicationStatement.implicitRules",
"path": "MedicationStatement.implicitRules",
"short": "A set of rules under which this content was created",
"definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content.",
"comment": "Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. \n\nThis element is labelled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation.",
"min": 0,
"max": "1",
"base": {
"path": "Resource.implicitRules",
"min": 0,
"max": "1"
},
"type": [
{
"code": "uri"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isModifier": true,
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
}
]
},
{
"id": "MedicationStatement.language",
"path": "MedicationStatement.language",
"short": "Language of the resource content",
"definition": "The base language in which the resource is written.",
"comment": "Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).",
"min": 0,
"max": "1",
"base": {
"path": "Resource.language",
"min": 0,
"max": "1"
},
"type": [
{
"code": "code"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"binding": {
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
"reference": "http://hl7.org/fhir/ValueSet/all-languages"
}
},
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
"valueString": "Language"
},
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
"valueBoolean": true
}
],
"strength": "extensible",
"description": "A human language.",
"reference": "http://hl7.org/fhir/ValueSet/languages"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
}
]
},
{
"id": "MedicationStatement.text",
"path": "MedicationStatement.text",
"short": "Text summary of the resource, for human interpretation",
"definition": "A human-readable narrative that contains a summary of the resource, and may be used to represent the content of the resource to a human. The narrative need not encode all the structured data, but is required to contain sufficient detail to make it \"clinically safe\" for a human to just read the narrative. Resource definitions may define what content should be represented in the narrative to ensure clinical safety.",
"comment": "Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied). This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded in formation is added later.",
"alias": [
"narrative",
"html",
"xhtml",
"display"
],
"min": 0,
"max": "1",
"base": {
"path": "DomainResource.text",
"min": 0,
"max": "1"
},
"type": [
{
"code": "Narrative"
}
],
"ele-1",
"dom-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "N/A"
},
{
"identity": "rim",
"map": "Act.text?"
}
]
},
{
"id": "MedicationStatement.contained",
"path": "MedicationStatement.contained",
"short": "Contained, inline Resources",
"definition": "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.",
"comment": "This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again.",
"alias": [
"inline resources",
"anonymous resources",
"contained resources"
],
"min": 0,
"max": "*",
"base": {
"path": "DomainResource.contained",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Resource"
}
],
"mapping": [
{
"identity": "rim",
"map": "Entity. Role, or Act"
},
{
"identity": "rim",
"map": "N/A"
}
]
},
{
"id": "MedicationStatement.extension",
"path": "MedicationStatement.extension",
"slicing": {
{
"type": "value",
"path": "url"
}
],
"description": "Extensions are always sliced by (at least) url",
"rules": "open"
},
"short": "Additional Content defined by implementations",
"definition": "May be used to represent additional information that is not part of the basic definition of the resource. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
"comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
"alias": [
"extensions",
"user content"
],
"min": 0,
"max": "*",
"base": {
"path": "DomainResource.extension",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Extension"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ext-1",
"severity": "error",
"human": "Must have either extensions or value[x], not both",
"expression": "extension.exists() != value.exists()",
"xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "N/A"
}
]
},
{
"id": "MedicationStatement.extension:parentDeviceMetric",
"path": "MedicationStatement.extension",
"sliceName": "parentDeviceMetric",
"short": "Optional Extension Element",
"definition": "Optional Extension Element - found in all resources.",
"comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
"alias": [
"extensions",
"user content"
],
"min": 0,
"max": "1",
"base": {
"path": "DomainResource.extension",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Extension",
"profile": "http://roche.com/fhir/rdc/StructureDefinition/parent-device-metric"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ext-1",
"severity": "error",
"human": "Must have either extensions or value[x], not both",
"expression": "extension.exists() != value.exists()",
"xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "N/A"
}
]
},
{
"id": "MedicationStatement.modifierExtension",
"path": "MedicationStatement.modifierExtension",
"slicing": {
{
"type": "value",
"path": "url"
}
],
"description": "Extensions are always sliced by (at least) url",
"rules": "open"
},
"short": "Extensions that cannot be ignored",
"definition": "May be used to represent additional information that is not part of the basic definition of the resource, and that modifies the understanding of the element that contains it. Usually modifier elements provide negation or qualification. In order to make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.",
"comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions. The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
"alias": [
"extensions",
"user content"
],
"min": 0,
"max": "*",
"base": {
"path": "DomainResource.modifierExtension",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Extension"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ext-1",
"severity": "error",
"human": "Must have either extensions or value[x], not both",
"expression": "extension.exists() != value.exists()",
"xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])"
}
],
"isModifier": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "N/A"
}
]
},
{
"id": "MedicationStatement.identifier",
"path": "MedicationStatement.identifier",
"short": "External identifier",
"definition": "External identifier - FHIR will generate its own internal identifiers (probably URLs) which do not need to be explicitly managed by the resource. The identifier here is one that would be used by another non-FHIR system - for example an automated medication pump would provide a record each time it operated; an administration while the patient was off the ward might be made with a different system and entered after the event. Particularly important if these records have to be updated.",
"min": 0,
"max": "*",
"base": {
"path": "MedicationStatement.identifier",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Identifier"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "v2",
"map": "CX / EI (occasionally, more often EI maps to a resource id or a URL)"
},
{
"identity": "rim",
"map": "II - see see identifier pattern at http://wiki.hl7.org/index.php?title=Common_Design_Patterns#Identifier_Pattern for relevant discussion. The Identifier class is a little looser than the v3 type II because it allows URIs as well as registered OIDs or GUIDs. Also maps to Role[classCode=IDENT]"
},
{
"identity": "servd",
"map": "Identifier"
},
{
"identity": "workflow",
"map": "…identifer"
},
{
"identity": "rim",
"map": ".id"
},
{
"identity": "w5",
"map": "id"
}
]
},
{
"id": "MedicationStatement.basedOn",
"path": "MedicationStatement.basedOn",
"short": "Fulfils plan, proposal or order",
"definition": "A plan, proposal or order that is fulfilled in whole or in part by this event.",
"comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
"requirements": "Allows tracing of authorization for the event and tracking whether proposals/recommendations were acted upon.",
"min": 0,
"max": "*",
"base": {
"path": "MedicationStatement.basedOn",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationRequest"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/CarePlan"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/ProcedureRequest"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/ReferralRequest"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "workflow",
"map": "…basedOn"
},
{
"identity": "rim",
"map": ".outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]"
}
]
},
{
"id": "MedicationStatement.partOf",
"path": "MedicationStatement.partOf",
"short": "Part of referenced event",
"definition": "A larger event of which this particular event is a component or step.",
"comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
"requirements": "This should not be used when indicating which resource a MedicationStatement has been derived from. If that is the use case, then MedicationStatement.derivedFrom should be used.",
"min": 0,
"max": "*",
"base": {
"path": "MedicationStatement.partOf",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Procedure"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Observation"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "workflow",
"map": "…part of"
},
{
"identity": "rim",
"map": ".outboundRelationship[typeCode=COMP]/target[classCode=SPLY or SBADM or PROC or OBS,moodCode=EVN]"
}
]
},
{
"id": "MedicationStatement.context",
"path": "MedicationStatement.context",
"short": "Encounter / Episode associated with MedicationStatement",
"definition": "The encounter or episode of care that establishes the context for this MedicationStatement.",
"comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.context",
"min": 0,
"max": "1"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Encounter"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "workflow",
"map": "…context"
},
{
"identity": "rim",
"map": ".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code=\"type of encounter or episode\"]"
}
]
},
{
"id": "MedicationStatement.status",
"path": "MedicationStatement.status",
"short": "active | completed | entered-in-error | intended | stopped | on-hold",
"definition": "A code representing the patient or other source's judgment about the state of the medication used that this statement is about. Generally this will be active or completed.",
"comment": "MedicationStatement is a statement at a point in time. The status is only representative at the point when it was asserted. The value set for MedicationStatement.status contains codes that assert the status of the use of the medication by the patient (for example, stopped or on hold) as well as codes that assert the status of the medication statement itself (for example, entered in error).\n\nThis element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.",
"min": 1,
"max": "1",
"base": {
"path": "MedicationStatement.status",
"min": 1,
"max": "1"
},
"type": [
{
"code": "code"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isModifier": true,
"isSummary": true,
"binding": {
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
"valueString": "MedicationStatementStatus"
}
],
"strength": "required",
"description": "A coded concept indicating the current status of a MedicationStatement.",
"reference": "http://hl7.org/fhir/ValueSet/medication-statement-status"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "workflow",
"map": "…status"
},
{
"identity": "rim",
"map": ".statusCode"
},
{
"identity": "w5",
"map": "status"
}
]
},
{
"id": "MedicationStatement.category",
"path": "MedicationStatement.category",
"short": "Type of medication usage",
"definition": "Indicates where type of medication statement and where the medication is expected to be consumed or administered.",
"comment": "Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.",
"min": 0,
"max": "1",
"base": {
"path": "MedicationStatement.category",
"min": 0,
"max": "1"
},
"type": [
{
"code": "CodeableConcept"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"binding": {
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
"valueString": "MedicationStatementCategory"
}
],
"strength": "preferred",
"description": "A coded concept identifying where the medication included in the medicationstatement is expected to be consumed or administered",
"reference": "http://hl7.org/fhir/ValueSet/medication-statement-category"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "v2",
"map": "CE/CNE/CWE"
},
{
"identity": "rim",
"map": "CD"
},
{
"identity": "orim",
"map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
},
{
"identity": "rim",
"map": ".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=\"type of medication usage\"].value"
},
{
"identity": "w5",
"map": "class"
}
]
},
{
"id": "MedicationStatement.medication[x]:medicationCodeableConcept",
"path": "MedicationStatement.medicationCodeableConcept",
"sliceName": "medicationCodeableConcept",
"short": "What medication was taken",
"definition": "Identifies the medication being administered. This is either a link to a resource representing the details of the medication or a simple attribute carrying a code that identifies the medication from a known list of medications.",
"comment": "If only a code is specified, then it needs to be a code for a specific product. If more information is required, then the use of the medication resource is recommended.  For example if you require form or lot number, then you must reference the Medication resource. .",
"min": 1,
"max": "1",
"base": {
"path": "MedicationStatement.medication[x]",
"min": 1,
"max": "1"
},
"type": [
{
"code": "CodeableConcept"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"binding": {
"strength": "required",
"description": "A coded concept identifying the substance or product being taken.",
"reference": "http://roche.com/fhir/rdc/ValueSet/medication-codes"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "v2",
"map": "CE/CNE/CWE"
},
{
"identity": "rim",
"map": "CD"
},
{
"identity": "orim",
"map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
},
{
"identity": "workflow",
"map": "…code"
},
{
"identity": "rim",
"map": ".participation[typeCode=CSM].role[classCode=ADMM or MANU]"
},
{
"identity": "w5",
"map": "what"
}
]
},
{
"id": "MedicationStatement.effective[x]",
"path": "MedicationStatement.effective[x]",
"short": "The date/time or interval when the medication was taken",
"definition": "The interval of time during which it is being asserted that the patient was taking the medication (or was not taking, when the wasNotGiven element is true).",
"comment": "This attribute reflects the period over which the patient consumed the medication and is expected to be populated on the majority of Medication Statements. If the medication is still being taken at the time the statement is recorded, the \"end\" date will be omitted.",
"min": 0,
"max": "1",
"base": {
"path": "MedicationStatement.effective[x]",
"min": 0,
"max": "1"
},
"type": [
{
"code": "dateTime"
},
{
"code": "Period"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "workflow",
"map": "…occurrence[x]"
},
{
"identity": "rim",
"map": ".effectiveTime"
},
{
"identity": "w5",
"map": "when.done"
}
]
},
{
"id": "MedicationStatement.dateAsserted",
"path": "MedicationStatement.dateAsserted",
"short": "When the statement was asserted?",
"definition": "The date when the medication statement was asserted by the information source.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.dateAsserted",
"min": 0,
"max": "1"
},
"type": [
{
"code": "dateTime"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": ".participation[typeCode=AUT].time"
},
{
"identity": "w5",
"map": "when.recorded"
}
]
},
{
"id": "MedicationStatement.informationSource",
"path": "MedicationStatement.informationSource",
"short": "Person or organization that provided the information about the taking of this medication",
"definition": "The person or organization that provided the information about the taking of this medication. Note: Use derivedFrom when a MedicationStatement is derived from other resources, e.g Claim or MedicationRequest.",
"comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.informationSource",
"min": 0,
"max": "1"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Organization"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "rim",
"map": ".participation[typeCode=INF].role[classCode=PAT, or codes for Practioner or Related Person (if PAT is the informer, then syntax for self-reported =true)"
},
{
"identity": "w5",
"map": "who.source"
}
]
},
{
"id": "MedicationStatement.subject",
"path": "MedicationStatement.subject",
"short": "Who is/was taking the medication",
"definition": "The person, animal or group who is/was taking the medication.",
"comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolveable (allowing for access control, temporary unavailability, etc). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
"min": 1,
"max": "1",
"base": {
"path": "MedicationStatement.subject",
"min": 1,
"max": "1"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Group"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"isSummary": true,
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "workflow",
"map": "…subject"
},
{
"identity": "v2",
"map": "PID-3-Patient ID List"
},
{
"identity": "rim",
"map": ".participation[typeCode=SBJ].role[classCode=PAT]"
},
{
"identity": "w5",
"map": "who"
}
]
},
{
"id": "MedicationStatement.derivedFrom",
"path": "MedicationStatement.derivedFrom",
"short": "Additional supporting information",
"definition": "Allows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.",
"comment": "Likely references would be to MedicationRequest, MedicationDispense, Claim, Observation or QuestionnaireAnswers. The most common use cases for deriving a MedicationStatement comes from creating a MedicationStatement from a MedicationRequest or from a lab observation or a claim. it should be noted that the amount of information that is available varies from the type resource that you derive the MedicationStatement from.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.derivedFrom",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Resource"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "rim",
"map": ".outboundRelationship[typeCode=SPRT]/target[classCode=ACT,moodCode=EVN]"
}
]
},
{
"id": "MedicationStatement.taken",
"path": "MedicationStatement.taken",
"short": "y | n | unk | na",
"definition": "Indicator of the certainty of whether the medication was taken by the patient.",
"comment": "This element is labeled as a modifier because it indicates that the medication was not taken.",
"min": 1,
"max": "1",
"base": {
"path": "MedicationStatement.taken",
"min": 1,
"max": "1"
},
"type": [
{
"code": "code"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"isModifier": true,
"isSummary": true,
"binding": {
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
"valueString": "MedicationStatementTaken"
}
],
"strength": "required",
"description": "A coded concept identifying level of certainty if patient has taken or has not taken the medication",
"reference": "http://hl7.org/fhir/ValueSet/medication-statement-taken"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "workflow",
"map": "…notDone"
},
{
"identity": "rim",
"map": ".actionNegationInd"
}
]
},
{
"id": "MedicationStatement.reasonNotTaken",
"path": "MedicationStatement.reasonNotTaken",
"short": "True if asserting medication was not given",
"definition": "A code indicating why the medication was not taken.",
"comment": "Not all terminology uses fit this general pattern. In some cases, models should not use CodeableConcept and use Coding directly and provide their own structure for managing text, codings, translations and the relationship between elements and pre- and post-coordination.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.reasonNotTaken",
"min": 0,
"max": "*"
},
"type": [
{
"code": "CodeableConcept"
}
],
"ele-1",
"mst-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"binding": {
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
"valueString": "MedicationStatementNotTakenReason"
}
],
"strength": "example",
"description": "A coded concept indicating the reason why the medication was not taken",
"reference": "http://hl7.org/fhir/ValueSet/reason-medication-not-taken-codes"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "v2",
"map": "CE/CNE/CWE"
},
{
"identity": "rim",
"map": "CD"
},
{
"identity": "orim",
"map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
},
{
"identity": "rim",
"map": ".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=\"reason not taken\"].value"
}
]
},
{
"id": "MedicationStatement.reasonCode",
"path": "MedicationStatement.reasonCode",
"short": "Reason for why the medication is being/was taken",
"definition": "A reason for why the medication is being/was taken.",
"comment": "This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonForUseReference.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.reasonCode",
"min": 0,
"max": "*"
},
"type": [
{
"code": "CodeableConcept"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"binding": {
{
"url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
"valueString": "MedicationReason"
}
],
"strength": "example",
"description": "A coded concept identifying why the medication is being taken.",
"reference": "http://hl7.org/fhir/ValueSet/condition-code"
}
},
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "v2",
"map": "CE/CNE/CWE"
},
{
"identity": "rim",
"map": "CD"
},
{
"identity": "orim",
"map": "fhir:CodeableConcept rdfs:subClassOf dt:CD"
},
{
"identity": "workflow",
"map": "…reasoneCodeableConcept"
},
{
"identity": "rim",
"map": ".reasonCode"
},
{
"identity": "w5",
"map": "why"
}
]
},
{
"id": "MedicationStatement.reasonReference",
"path": "MedicationStatement.reasonReference",
"short": "Condition or observation that supports why the medication is being/was taken",
"definition": "Condition or observation that supports why the medication is being/was taken.",
"comment": "This is a reference to a condition that is the reason why the medication is being/was taken. If only a code exists, use reasonForUseCode.",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.reasonReference",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Condition"
},
{
"code": "Reference",
"targetProfile": "http://hl7.org/fhir/StructureDefinition/Observation"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
},
{
"key": "ref-1",
"severity": "error",
"human": "SHALL have a contained resource if a local reference is provided",
"expression": "reference.startsWith('#').not() or (reference.substring(1).trace('url') in %resource.contained.id.trace('ids'))",
"xpath": "not(starts-with(f:reference/@value, '#')) or exists(ancestor::*[self::f:entry or self::f:parameter]/f:resource/f:*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, '#')])"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
},
{
"identity": "workflow",
"map": "…reasonReference"
},
{
"identity": "rim",
"map": ".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=\"reason for use\"].value"
},
{
"identity": "w5",
"map": "why"
}
]
},
{
"id": "MedicationStatement.note",
"path": "MedicationStatement.note",
"short": "Further information about the statement",
"definition": "Provides extra information about the medication statement that is not conveyed by the other attributes.",
"comment": "For systems that do not have structured annotations, they can simply communicate a single annotation with no author or time. This element may need to be included in narrative because of the potential for modifying information. *Annotations SHOULD NOT* be used to communicate \"modifying\" information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible).",
"min": 0,
"max": "0",
"base": {
"path": "MedicationStatement.note",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Annotation"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "v2",
"map": "N/A"
},
{
"identity": "rim",
"map": "Act"
},
{
"identity": "workflow",
"map": "…note"
},
{
"identity": "rim",
"map": ".inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code=\"annotation\"].value"
}
]
},
{
"id": "MedicationStatement.dosage",
"path": "MedicationStatement.dosage",
"short": "Details of how medication is/was taken or should be taken",
"definition": "Indicates how the medication is/was or should be taken by the patient.",
"comment": "The dates included in the dosage on a Medication Statement reflect the dates for a given dose. For example, \"from November 1, 2016 to November 3, 2016, take one tablet daily and from November 4, 2016 to November 7, 2016, take two tablets daily.\" It is expected that this specificity may only be populated where the patient brings in their labeled container or where the Medication Statement is derived from a MedicationRequest.",
"min": 0,
"max": "*",
"base": {
"path": "MedicationStatement.dosage",
"min": 0,
"max": "*"
},
"type": [
{
"code": "Dosage"
}
],
"ele-1"
],
{
"key": "ele-1",
"severity": "error",
"human": "All FHIR elements must have a @value or children",
"expression": "hasValue() | (children().count() > id.count())",
"xpath": "@value|f:*|h:div"
}
],
"mapping": [
{
"identity": "rim",
"map": "n/a"
},
{
"identity": "rim",
"map": ".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=INT]"
},
{
"identity": "rim",
"map": "refer dosageInstruction mapping"
}
]
}
]
},
"element": [
{
"id": "MedicationStatement.extension",
"path": "MedicationStatement.extension",
"slicing": {
{
"type": "value",
"path": "url"
}
],
"rules": "open"
}
},
{
"id": "MedicationStatement.extension:parentDeviceMetric",
"path": "MedicationStatement.extension",
"sliceName": "parentDeviceMetric",
"short": "Optional Extension Element",
"definition": "Optional Extension Element - found in all resources.",
"min": 0,
"max": "1",
"type": [
{
"code": "Extension",
"profile": "http://roche.com/fhir/rdc/StructureDefinition/parent-device-metric"
}
]
},
{
"id": "MedicationStatement.context",
"path": "MedicationStatement.context",
"max": "0"
},
{
"id": "MedicationStatement.medication[x]:medicationCodeableConcept",
"path": "MedicationStatement.medicationCodeableConcept",
"sliceName": "medicationCodeableConcept",
"type": [
{
"code": "CodeableConcept"
}
],
"binding": {
"strength": "required",
"reference": "http://roche.com/fhir/rdc/ValueSet/medication-codes"
}
}
},
{
"id": "MedicationStatement.dateAsserted",
"path": "MedicationStatement.dateAsserted",
"max": "0"
},
{
"id": "MedicationStatement.informationSource",
"path": "MedicationStatement.informationSource",
"max": "0"
},
{
"id": "MedicationStatement.derivedFrom",
"path": "MedicationStatement.derivedFrom",
"max": "0"
},
{
"id": "MedicationStatement.reasonNotTaken",
"path": "MedicationStatement.reasonNotTaken",
"max": "0"
},
{
"id": "MedicationStatement.reasonCode",
"path": "MedicationStatement.reasonCode",
"max": "0"
},
{
"id": "MedicationStatement.reasonReference",
"path": "MedicationStatement.reasonReference",
"max": "0"
},
{
"id": "MedicationStatement.note",
"path": "MedicationStatement.note",
"max": "0"
}
]
}
}

Example 1 - Basal and Bolus TDD

{
	"resourceType": "MedicationStatement",
	"id": "c15bb02e-ce87-43b7-a220-8658fbc3162c",
	"meta": {
		"profile": [
			"http://roche.com/fhir/rdc/StructureDefinition/medication-statement"
		]
	},
	"status": "active",
	"medicationCodeableConcept": {
		"coding": [
			{
				"system": "http://roche.com/fhir/rdc/cs",
				"code": "TDD-Bolus-and-Basal",
				"display": "Basal and Bolus TDD"
			}
		]
	},
	"subject": {
		"reference": "Patient/d4f6069e-250a-46b4-a808-c5cf0f5ed3be"
	},
	"effectiveDateTime": "2005-06-24T23:59:00+00:00",
	"taken": "y",
	"dosage": [
		{
			"doseQuantity": {
				"value": "43.06",
				"unit": "[iU]",
				"system": "http://unitsofmeasure.org",
				"code": "[iU]"
			}
		}
	],
	"extension": [
		{
			"url": "http://roche.com/fhir/rdc/StructureDefinition/parent-device-metric",
			"valueReference": {
				"reference": "DeviceMetric/46d24edb-7afa-45c3-a12c-1b7a51d5f519"
			}
		}
	]
}

Example 2- Bolus TDD

 {
	"resourceType": "MedicationStatement",
	"id": "bcfe4c3b-9737-4710-baa6-3b2fc6efa001",
	"meta": {
		"profile": [
			"http://roche.com/fhir/rdc/StructureDefinition/medication-statement"
		]
	},
	"status": "active",
	"medicationCodeableConcept": {
		"coding": [
			{
				"system": "http://roche.com/fhir/rdc/cs",
				"code": "TDD-Bolus-Only",
				"display": "Bolus TDD"
			}
		]
	},
	"subject": {
		"reference": "Patient/d4f6069e-250a-46b4-a808-c5cf0f5ed3be"
	},
	"effectiveDateTime": "2005-06-24T23:59:00+00:00",
	"taken": "y",
	"dosage": [
		{
			"doseQuantity": {
				"value": "20.30",
				"unit": "[iU]",
				"system": "http://unitsofmeasure.org",
				"code": "[iU]"
			}
		}
	],
	"extension": [
		{
			"url": "http://roche.com/fhir/rdc/StructureDefinition/parent-device-metric",
			"valueReference": {
				"reference": "DeviceMetric/46d24edb-7afa-45c3-a12c-1b7a51d5f519"
			}
		}
	]
}