GP Connect Data Model | FHIR STU3 Representation

This version is in draft and is currently being migrated from the GP Connect Access Record: Structured specification

Profile: CareConnect-GPC-MedicationStatement-1

idΣ0..1id
id0..1string
extensionI0..*Extension
versionIdΣ0..1id
lastUpdatedΣ0..1instant
profileΣ1..*uri
securityΣ0..*CodingBinding
tagΣ0..*Coding
implicitRulesΣ ?!0..1uri
language0..1codeBinding
textI0..1Narrative
contained0..*Resource
lastIssueDateS I0..1Extension(dateTime)
changeSummaryI0..1Extension(Complex)
prescribingAgencyI1..1Extension(CodeableConcept)
id0..1string
extensionI0..*Extension
url1..1uriFixed Value
valueDateTime0..1dateTime
modifierExtension?! I0..*Extension
id0..1string
extensionI0..*Extension
useΣ ?!0..1codeBinding
typeΣ0..1CodeableConceptBinding
systemΣ1..1uri
valueΣ1..1string
periodΣ I0..1Period
assignerΣ I0..1Reference(Organization)
basedOnΣ I0..1Reference(CarePlan | ProcedureRequest | ReferralRequest | CareConnect-GPC-MedicationRequest-1)
partOfΣ I0..*Reference(MedicationAdministration | MedicationDispense | CareConnect-Procedure-1 | CareConnect-Observation-1 | CareConnect GPC MedicationStatement1)
contextS Σ I0..1Reference(EpisodeOfCare | CareConnect-Encounter-1)
statusΣ ?!1..1codeBinding
categoryΣ0..1CodeableConceptBinding
medicationCodeableConceptCodeableConcept
medicationReferenceReference(CareConnect-GPC-Medication-1)
effectiveDateTimedateTime
effectivePeriodPeriod
dateAssertedΣ1..1dateTime
informationSourceI0..1Reference(RelatedPerson | CareConnect-GPC-Organization-1 | CareConnect-GPC-Patient-1 | CareConnect-GPC-Practitioner-1)
subjectΣ I1..1Reference(Group | CareConnect-GPC-Patient-1)
derivedFromI0..*Reference(Resource)
takenΣ ?!1..1codeBinding
reasonNotTakenI0..*CodeableConcept
reasonCode0..*CodeableConcept
reasonReferenceI0..*Reference(CareConnect-Observation-1 | CareConnect-Condition-1)
id0..1string
extensionI0..*Extension
authorStringstring
authorReferenceReference(RelatedPerson | CareConnect-GPC-Patient-1 | CareConnect-GPC-Practitioner-1)
timeΣ0..1dateTime
text1..1string
id0..1string
extensionI0..*Extension
sequenceΣ0..1integer
textΣ1..1string
additionalInstructionΣ0..*CodeableConcept
patientInstructionS Σ0..1string
timingΣ0..1Timing
asNeededBooleanboolean
asNeededCodeableConceptCodeableConcept
siteΣ0..1CodeableConcept
id0..1string
extensionI0..*Extension
id0..1string
snomedCTDescriptionIDI0..1Extension(Complex)
systemΣ1..1uriFixed Value
versionΣ0..0string
codeΣ1..1code
displayΣ1..1string
userSelectedΣ0..1boolean
textΣ0..1string
methodΣ0..1CodeableConcept
doseRangeRange
doseQuantitySimpleQuantity
maxDosePerPeriodΣ I0..1Ratio
maxDosePerAdministrationΣ I0..1SimpleQuantity
maxDosePerLifetimeΣ I0..1SimpleQuantity
rateRatioRatio
rateRangeRange
rateQuantitySimpleQuantity
MedicationStatement
DefinitionA 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.

Invariants
  • 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
DefinitionThe 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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.meta
DefinitionThe 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
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.meta.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.meta.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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.meta.versionId
DefinitionThe version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.
Cardinality0...1
Typeid
SummaryTrue
Comments

The server assigns this value, and ignores what the client specifies, except in the case that the server is imposing version integrity on updates/deletes.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.meta.lastUpdated
DefinitionWhen the resource last changed - e.g. when the version changed.
Cardinality0...1
Typeinstant
SummaryTrue
Comments

This value is always populated except when the resource is first being created. The server / resource manager sets this value; what a client provides is irrelevant.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.meta.profile
DefinitionA list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url]().
Cardinality1...*
Typeuri
SummaryTrue
Comments

It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time. The list of profile URLs is a set.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.meta.security
DefinitionSecurity labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.
Cardinality0...*
TypeCoding
Binding
Security Labels from the Healthcare Privacy and Security Classification System.
All Security Labels (extensible)
SummaryTrue
Comments

The security labels can be updated without changing the stated version of the resource The list of security labels is a set. Uniqueness is based the system/code, and version and display are ignored.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE subset one of the sets of component 1-3 or 4-6
  • rim: CV
  • orim: fhir:Coding rdfs:subClassOf dt:CDCoding
MedicationStatement.meta.tag
DefinitionTags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.
Cardinality0...*
TypeCoding
Binding
Codes that represent various types of tags, commonly workflow-related; e.g. "Needs review by Dr. Jones"
Common Tags (example)
SummaryTrue
Comments

The tags can be updated without changing the stated version of the resource. The list of tags is a set. Uniqueness is based the system/code, and version and display are ignored.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE subset one of the sets of component 1-3 or 4-6
  • rim: CV
  • orim: fhir:Coding rdfs:subClassOf dt:CDCoding
MedicationStatement.implicitRules
DefinitionA 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.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.language
DefinitionThe base language in which the resource is written.
Cardinality0...1
Typecode
Binding
A human language.
Common Languages (extensible)
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).

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.text
DefinitionA 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.

Invariants
  • 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
DefinitionThese 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
DefinitionMay 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.
Cardinality1...*
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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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:lastIssueDate
DefinitionThe date a prescription was last issued.
Cardinality0...1
TypeExtension(dateTime)
Must SupportTrue
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.

Invariants
  • 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:changeSummary
DefinitionOptional Extension Element - found in all resources.
Cardinality0...1
TypeExtension(Complex)
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.

Invariants
  • 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:prescribingAgency
DefinitionThe type of organisation/setting responsible for authorising and issuing the medication.
Cardinality1...1
TypeExtension(CodeableConcept)
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.

Invariants
  • 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:dosageLastChanged
DefinitionOnly populate where the dosage instructions have been changed during the lifetime of the Medication/Medical Device plan. Set to the date when the dosage instructions were last changed.
Cardinality0...1
TypeExtension(dateTime)
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.

Invariants
  • 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:dosageLastChanged.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.extension:dosageLastChanged.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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:dosageLastChanged.url
DefinitionSource of the definition for the extension code - a logical name or a URL.
Cardinality1...1
Typeuri
Comments

The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Fixed Value

https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1

Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.extension:dosageLastChanged.value[x]:valueDateTime
DefinitionThe date when the dosage instructions were last changed.
Cardinality0...1
TypedateTime
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: N/A
MedicationStatement.modifierExtension
DefinitionMay 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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
DefinitionExternal 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.
Cardinality1...*
TypeIdentifier
SummaryTrue
Invariants
  • 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.identifier.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.identifier.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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.use
DefinitionThe purpose of this identifier.
Cardinality0...1
Typecode
Binding
Identifies the purpose for this identifier, if known .
IdentifierUse (required)
ModifierTrue
SummaryTrue
Requirements

Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.

Comments

This is labeled as "Is Modifier" because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: N/A
  • rim: Role.code or implied by context
MedicationStatement.identifier.type
DefinitionA coded type for the identifier that can be used to determine which identifier to use for a specific purpose.
Cardinality0...1
TypeCodeableConcept
Binding
A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.
Identifier Type Codes (extensible)
SummaryTrue
Requirements

Allows users to make use of identifiers when the identifier system is not known.

Comments

This element deals only with general categories of identifiers. It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage.

Where the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.

Invariants
  • 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
  • v2: CX.5
  • rim: Role.code or implied by context
MedicationStatement.identifier.system
DefinitionEstablishes the namespace for the value - that is, a URL that describes a set values that are unique.
Cardinality1...1
Typeuri
SummaryTrue
Requirements

There are many sets of identifiers. To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.

Comments

see http://en.wikipedia.org/wiki/Uniform_resource_identifier

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Examples
General

http://www.acme.com/identifiers/patient


Mappings
  • rim: n/a
  • v2: CX.4 / EI-2-4
  • rim: II.root or Role.id.root
  • servd: ./IdentifierType
MedicationStatement.identifier.value
DefinitionThe portion of the identifier typically relevant to the user and which is unique within the context of the system.
Cardinality1...1
Typestring
SummaryTrue
Comments

If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986. The value's primary purpose is computational mapping. As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.) A value formatted for human display can be conveyed using the Rendered Value extension.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Examples
General

123456


Mappings
  • rim: n/a
  • v2: CX.1 / EI.1
  • rim: II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)
  • servd: ./Value
MedicationStatement.identifier.period
DefinitionTime period during which identifier is/was valid for use.
Cardinality0...1
TypePeriod
SummaryTrue
Comments

This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. "the patient was an inpatient of the hospital for this time range") or one value from the range applies (e.g. "give to the patient between these two times"). If duration is required, specify the type as Interval|Duration.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • per-1: If present, start SHALL have a lower value than end
    start.empty() or end.empty() or (start <= end)
Mappings
  • rim: n/a
  • v2: DR
  • rim: IVL<TS>[lowClosed="true" and highClosed="true"] or URG<TS>[lowClosed="true" and highClosed="true"]
  • v2: CX.7 + CX.8
  • rim: Role.effectiveTime or implied by context
  • servd: ./StartDate and ./EndDate
MedicationStatement.identifier.assigner
DefinitionOrganization that issued/manages the identifier.
Cardinality0...1
TypeReference(Organization)
SummaryTrue
Comments

The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.

Invariants
  • 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)
  • v2: CX.4 / (CX.4,CX.9,CX.10)
  • rim: II.assigningAuthorityName but note that this is an improper use by the definition of the field. Also Role.scoper
  • servd: ./IdentifierIssuingAuthority
MedicationStatement.basedOn
DefinitionA plan, proposal or order that is fulfilled in whole or in part by this event.
Cardinality0...1
TypeReference(CarePlan | ProcedureRequest | ReferralRequest | CareConnect-GPC-MedicationRequest-1)
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.

Invariants
  • 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
DefinitionA larger event of which this particular event is a component or step.
Cardinality0...*
TypeReference(MedicationAdministration | MedicationDispense | CareConnect-Procedure-1 | CareConnect-Observation-1 | CareConnect GPC MedicationStatement1)
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.

Invariants
  • 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
DefinitionThe encounter or episode of care that establishes the context for this MedicationStatement.
Cardinality0...1
TypeReference(EpisodeOfCare | CareConnect-Encounter-1)
Must SupportTrue
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.

Invariants
  • 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
DefinitionA 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.

Invariants
  • 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
DefinitionIndicates 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.

Invariants
  • 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]
DefinitionIdentifies 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
TypeReference(CareConnect-GPC-Medication-1), CodeableConcept
Binding
A coded concept identifying the substance or product being taken.
SNOMED CT Medication Codes (example)
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. .

Invariants
  • 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]
DefinitionThe 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
Must SupportTrue
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.

Invariants
  • 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
DefinitionThe date when the medication statement was asserted by the information source.
Cardinality1...1
TypedateTime
SummaryTrue
Invariants
  • 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
DefinitionThe 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...1
TypeReference(RelatedPerson | CareConnect-GPC-Organization-1 | CareConnect-GPC-Patient-1 | CareConnect-GPC-Practitioner-1)
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.

Invariants
  • 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
DefinitionThe person, animal or group who is/was taking the medication.
Cardinality1...1
TypeReference(Group | CareConnect-GPC-Patient-1)
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.

Invariants
  • 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
DefinitionAllows linking the MedicationStatement to the underlying MedicationRequest, or to other information that supports or is used to derive the MedicationStatement.
Cardinality0...*
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.

Invariants
  • 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
DefinitionIndicator 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.

Invariants
  • 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
DefinitionA code indicating why the medication was not taken.
Cardinality0...*
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.

Invariants
  • 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
DefinitionA reason for why the medication is being/was taken.
Cardinality0...*
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.

Invariants
  • 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
DefinitionCondition or observation that supports why the medication is being/was taken.
Cardinality0...*
TypeReference(CareConnect-Observation-1 | CareConnect-Condition-1)
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.

Invariants
  • 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
DefinitionProvides extra information about the medication statement that is not conveyed by the other attributes.
Cardinality0...*
TypeAnnotation
Must SupportTrue
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).

Invariants
  • 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.note.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.note.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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.note.author[x]
DefinitionThe individual responsible for making the annotation.
Cardinality0...1
TypeReference(RelatedPerson | CareConnect-GPC-Patient-1 | CareConnect-GPC-Practitioner-1), string
SummaryTrue
Invariants
  • 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.participant[typeCode=AUT].role
MedicationStatement.note.time
DefinitionIndicates when this particular annotation was made.
Cardinality0...1
TypedateTime
SummaryTrue
Invariants
  • 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.effectiveTime
MedicationStatement.note.text
DefinitionThe text of the annotation.
Cardinality1...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • 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.text
MedicationStatement.dosage
DefinitionIndicates how the medication is/was or should be taken by the patient.
Cardinality1...*
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.

Invariants
  • 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
MedicationStatement.dosage.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.dosage.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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.dosage.sequence
DefinitionIndicates the order in which the dosage instructions should be applied or interpreted.
Cardinality0...1
Typeinteger
SummaryTrue
Requirements

If the sequence number of multiple Dosages is the same, then it is implied that the instructions are to be treated as concurrent. If the sequence number is different, then the Dosages are intended to be sequential.

Comments

32 bit number; for values larger than this, use decimal

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .text
MedicationStatement.dosage.text
DefinitionFree text dosage instructions e.g. SIG.
Cardinality1...1
Typestring
SummaryTrue
Requirements

Free text dosage instructions can be used for cases where the instructions are too complex to code. The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated. If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.

Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .text
MedicationStatement.dosage.additionalInstruction
DefinitionSupplemental instruction - e.g. "with meals".
Cardinality0...*
TypeCodeableConcept
Binding
A coded concept identifying additional instructions such as "take with water" or "avoid operating heavy machinery".
SNOMED CT Additional Dosage Instructions (example)
SummaryTrue
Requirements

Additional instruction such as "Swallow with plenty of water" which may or may not be coded.

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.

Invariants
  • 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: .text
MedicationStatement.dosage.patientInstruction
DefinitionInstructions in terms that are understood by the patient or consumer.
Cardinality0...1
Typestring
Must SupportTrue
SummaryTrue
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .text
MedicationStatement.dosage.timing
DefinitionWhen medication should be administered.
Cardinality0...1
TypeTiming
SummaryTrue
Requirements

The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: "Every 8 hours"; "Three times a day"; "1/2 an hour before breakfast for 10 days from 23-Dec 2011:"; "15 Oct 2013, 17 Oct 2013 and 1 Nov 2013". Sometimes, a rate can imply duration when expressed as total volume / duration (e.g. 500mL/2 hours implies a duration of 2 hours). However, when rate doesn't imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period.

Comments

This attribute may not always be populated while the Dosage.text is expected to be populated. If both are populated, then the Dosage.text should reflect the content of the Dosage.timing.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: N/A
  • rim: QSET<TS> (GTS)
  • rim: .effectiveTime
MedicationStatement.dosage.asNeeded[x]
DefinitionIndicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).
Cardinality0...1
Typeboolean, CodeableConcept
Binding
A coded concept identifying the precondition that should be met or evaluated prior to consuming or administering a medication dose. For example "pain", "30 minutes prior to sexual intercourse", "on flare-up" etc.
SNOMED CT Medication As Needed Reason Codes (example)
SummaryTrue
Comments

Can express "as needed" without a reason by setting the Boolean = True. In this case the CodeableConcept is not populated. Or you can express "as needed" with a reason by including the CodeableConcept. In this case the Boolean is assumed to be True. If you set the Boolean to False, then the dose is given according to the schedule and is not "prn" or "as needed".

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .outboundRelationship[typeCode=PRCN].target[classCode=OBS, moodCode=EVN, code="as needed"].value=boolean or codable concept
MedicationStatement.dosage.site
DefinitionBody site to administer to.
Cardinality0...1
TypeCodeableConcept
Binding
A coded concept describing the site location the medicine enters into or onto the body.
SNOMED CT Anatomical Structure for Administration Site Codes (example)
SummaryTrue
Requirements

A coded specification of the anatomic site where the medication first enters the body.

Comments

If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension body-site-instance. May be a summary code, or a reference to a very precise definition of the location, or both.

Invariants
  • 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: .approachSiteCode
MedicationStatement.dosage.route
DefinitionHow drug should enter body.
Cardinality0...1
TypeCodeableConcept
Binding
A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.
SNOMED CT Route Codes (example)
SummaryTrue
Requirements

A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.

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.

Invariants
  • 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: .routeCode
MedicationStatement.dosage.route.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.dosage.route.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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.dosage.route.coding
DefinitionA reference to a code defined by a terminology system.
Cardinality0...*
TypeCoding
SummaryTrue
Requirements

Allows for translations and alternate encodings within a code system. Also supports communication of the same instance to systems requiring different encodings.

Comments

Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.

SlicingUnordered, Open, by system(Value)
Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE subset one of the sets of component 1-3 or 4-6
  • rim: CV
  • orim: fhir:Coding rdfs:subClassOf dt:CDCoding
  • v2: C*E.1-8, C*E.10-22
  • rim: union(., ./translation)
  • orim: fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding
MedicationStatement.dosage.route.coding:snomedCT
DefinitionA reference to a code defined by a terminology system.
Cardinality0...1
TypeCoding
Binding
A code from the SNOMED Clinical Terminology UK coding system that describes the e-Prescribing route of administration.
Care Connect Medication Dosage Route (example)
SummaryTrue
Requirements

Allows for translations and alternate encodings within a code system. Also supports communication of the same instance to systems requiring different encodings.

Comments

Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information. Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: CE/CNE/CWE subset one of the sets of component 1-3 or 4-6
  • rim: CV
  • orim: fhir:Coding rdfs:subClassOf dt:CDCoding
  • v2: C*E.1-8, C*E.10-22
  • rim: union(., ./translation)
  • orim: fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding
MedicationStatement.dosage.route.coding:snomedCT.id
Definitionunique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
Cardinality0...1
Typestring
Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
MedicationStatement.dosage.route.coding:snomedCT.extension
DefinitionMay be used to represent additional information that is not part of the basic definition of the element. 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.

SlicingUnordered, Open, by url(Value)
Invariants
  • 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.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID
DefinitionThe SNOMED CT Description ID for the display.
Cardinality0...1
TypeExtension(Complex)
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.

Invariants
  • 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.dosage.route.coding:snomedCT.system
DefinitionThe identification of the code system that defines the meaning of the symbol in the code.
Cardinality1...1
Typeuri
SummaryTrue
Requirements

Need to be unambiguous about the source of the definition of the symbol.

Comments

The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...). OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Fixed Value

http://snomed.info/sct

Mappings
  • rim: n/a
  • v2: C*E.3
  • rim: ./codeSystem
  • orim: fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem
MedicationStatement.dosage.route.coding:snomedCT.version
DefinitionThe version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.
Cardinality0...0
Typestring
SummaryTrue
Comments

Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: C*E.7
  • rim: ./codeSystemVersion
  • orim: fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion
MedicationStatement.dosage.route.coding:snomedCT.code
DefinitionA symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).
Cardinality1...1
Typecode
SummaryTrue
Requirements

Need to refer to a particular code in the system.

Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: C*E.1
  • rim: ./code
  • orim: fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code
MedicationStatement.dosage.route.coding:snomedCT.display
DefinitionA representation of the meaning of the code in the system, following the rules of the system.
Cardinality1...1
Typestring
SummaryTrue
Requirements

Need to be able to carry a human-readable meaning of the code for readers that do not know the system.

Comments

Note that FHIR strings may not exceed 1MB in size

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: C*E.2 - but note this is not well followed
  • rim: CV.displayName
  • orim: fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName
MedicationStatement.dosage.route.coding:snomedCT.userSelected
DefinitionIndicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).
Cardinality0...1
Typeboolean
SummaryTrue
Requirements

This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.

Comments

Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: Sometimes implied by being first
  • rim: CD.codingRationale
  • orim: fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map; fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [ fhir:source "true"; fhir:target dt:CDCoding.codingRationale\#O ]
MedicationStatement.dosage.route.text
DefinitionA human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.
Cardinality0...1
Typestring
SummaryTrue
Requirements

The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.

Comments

Very often the text is the same as a displayName of one of the codings.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • v2: C*E.9. But note many systems use C*E.2 for this
  • rim: ./originalText[mediaType/code="text/plain"]/data
  • orim: fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText
MedicationStatement.dosage.method
DefinitionTechnique for administering medication.
Cardinality0...1
TypeCodeableConcept
Binding
A coded concept describing the technique by which the medicine is administered.
SNOMED CT Administration Method Codes (example)
SummaryTrue
Requirements

A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections. For examples, Slow Push; Deep IV.

Comments

Terminologies used often pre-coordinate this term with the route and or form of administration.

Invariants
  • 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: .doseQuantity
MedicationStatement.dosage.dose[x]
DefinitionAmount of medication per dose.
Cardinality0...1
TypeRange, SimpleQuantity
SummaryTrue
Requirements

The amount of therapeutic or other substance given at one administration event.

Comments

Note that this specifies the quantity of the specified medication, not the quantity for each active ingredient(s). Each ingredient amount can be communicated in the Medication resource. For example, if one wants to communicate that a tablet was 375 mg, where the dose was one tablet, you can use the Medication resource to document that the tablet was comprised of 375 mg of drug XYZ. Alternatively if the dose was 375 mg, then you may only need to use the Medication resource to indicate this was a tablet. If the example were an IV such as dopamine and you wanted to communicate that 400mg of dopamine was mixed in 500 ml of some IV solution, then this would all be communicated in the Medication resource. If the administration is not intended to be instantaneous (rate is present or timing has a duration), this can be specified to convey the total amount to be administered over the period of time as indicated by the schedule e.g. 500 ml in dose, with timing used to convey that this should be done over 4 hours.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .doseQuantity
MedicationStatement.dosage.maxDosePerPeriod
DefinitionUpper limit on medication per unit of time.
Cardinality0...1
TypeRatio
SummaryTrue
Requirements

The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time. For example, 1000mg in 24 hours.

Comments

This is intended for use as an adjunct to the dosage when there is an upper cap. For example "2 tablets every 4 hours to a maximum of 8/day".

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • rat-1: Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present
    (numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())
Mappings
  • rim: n/a
  • v2: N/A
  • rim: RTO
  • rim: .maxDoseQuantity
MedicationStatement.dosage.maxDosePerAdministration
DefinitionUpper limit on medication per administration.
Cardinality0...1
TypeSimpleQuantity
SummaryTrue
Requirements

The maximum total quantity of a therapeutic substance that may be administered to a subject per administration.

Comments

This is intended for use as an adjunct to the dosage when there is an upper cap. For example, a body surface area related dose with a maximum amount, such as 1.5 mg/m2 (maximum 2 mg) IV over 5 – 10 minutes would have doseQuantity of 1.5 mg/m2 and maxDosePerAdministration of 2 mg.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • qty-3: If a code for the unit is present, the system SHALL also be present
    code.empty() or system.exists()
  • sqty-1: The comparator is not used on a SimpleQuantity
    comparator.empty()
Mappings
  • rim: n/a
  • v2: SN (see also Range) or CQ
  • rim: PQ, IVL<PQ>, MO, CO, depending on the values
  • rim: not supported
MedicationStatement.dosage.maxDosePerLifetime
DefinitionUpper limit on medication per lifetime of the patient.
Cardinality0...1
TypeSimpleQuantity
SummaryTrue
Requirements

The maximum total quantity of a therapeutic substance that may be administered per lifetime of the subject.

Comments

The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
  • qty-3: If a code for the unit is present, the system SHALL also be present
    code.empty() or system.exists()
  • sqty-1: The comparator is not used on a SimpleQuantity
    comparator.empty()
Mappings
  • rim: n/a
  • v2: SN (see also Range) or CQ
  • rim: PQ, IVL<PQ>, MO, CO, depending on the values
  • rim: not supported
MedicationStatement.dosage.rate[x]
DefinitionAmount of medication per unit of time.
Cardinality0...1
TypeRatio, Range, SimpleQuantity
SummaryTrue
Requirements

Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr. May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours. Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours. Sometimes, a rate can imply duration when expressed as total volume / duration (e.g. 500mL/2 hours implies a duration of 2 hours). However, when rate doesn't imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period.

Comments

It is possible to supply both a rate and a doseQuantity to provide full details about how the medication is to be administered and supplied. If the rate is intended to change over time, depending on local rules/regulations, each change should be captured as a new version of the MedicationRequest with an updated rate, or captured with a new MedicationRequest with the new rate.

Invariants
  • ele-1: All FHIR elements must have a @value or children
    hasValue() | (children().count() > id.count())
Mappings
  • rim: n/a
  • rim: .rateQuantity
<StructureDefinition xmlns="http://hl7.org/fhir">
    <meta>
        <lastUpdated value="2023-10-04T09:06:08.8942682+00:00" />
    </meta>
    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-wg">
        <valueCode value="phx" />
    </extension>
    <url value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1" />
    <version value="1.9.0" />
    <name value="CareConnect-GPC-MedicationStatement-1" />
    <title value="CareConnect GPC MedicationStatement1" />
    <status value="active" />
    <date value="2023-10-04" />
    <publisher value="HL7 UK" />
    <description value="This MedicationStatement Resource is a record of a medication that is being consumed by a patient." />
    <purpose value="CURATED BY INTEROPen see: http://www.interopen.org/careconnect-curation-methodology/ on the 12th September 2019." />
    <copyright value="Copyright &#169; 2020 HL7 UK\n\nLicensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nHL7&#174; FHIR&#174; standard Copyright &#169; 2011+ HL7\n\nThe HL7&#174; FHIR&#174; standard is used under the FHIR license. You may obtain a copy of the FHIR license at\n\nhttps://www.hl7.org/fhir/license.html" />
    <fhirVersion value="3.0.1" />
    <kind value="resource" />
    <abstract value="false" />
    <type value="MedicationStatement" />
    <baseDefinition value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
    <derivation value="constraint" />
    <snapshot>
        <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&#39;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&#39;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="*" />
            <base>
                <path value="Resource" />
                <min value="0" />
                <max value="*" />
            </base>
            <constraint>
                <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)" />
                <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
            </constraint>
            <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)" />
                <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
            </constraint>
            <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))" />
                <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
            </constraint>
            <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((&#39;#&#39;+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(&#39;#&#39;, $id))]))" />
                <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
            </constraint>
            <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 = &#39;n&#39;)" />
                <xpath value="not(exists(f:reasonNotTaken)) or f:taken/@value=&#39;n&#39;" />
                <source value="http://hl7.org/fhir/StructureDefinition/MedicationStatement" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="Entity. Role, or Act" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="..Event" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="SubstanceAdministration" />
            </mapping>
            <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" />
            <base>
                <path value="Resource.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="id" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <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" />
            <base>
                <path value="Resource.meta" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Meta" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.id">
            <path value="MedicationStatement.meta.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.extension">
            <path value="MedicationStatement.meta.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.versionId">
            <path value="MedicationStatement.meta.versionId" />
            <short value="Version specific identifier" />
            <definition value="The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted." />
            <comment value="The server assigns this value, and ignores what the client specifies, except in the case that the server is imposing version integrity on updates/deletes." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Meta.versionId" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="id" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.lastUpdated">
            <path value="MedicationStatement.meta.lastUpdated" />
            <short value="When the resource version last changed" />
            <definition value="When the resource last changed - e.g. when the version changed." />
            <comment value="This value is always populated except when the resource is first being created. The server / resource manager sets this value; what a client provides is irrelevant." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Meta.lastUpdated" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="instant" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.profile">
            <path value="MedicationStatement.meta.profile" />
            <short value="Profiles this resource claims to conform to" />
            <definition value="A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url]()." />
            <comment value="It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set." />
            <min value="1" />
            <max value="*" />
            <base>
                <path value="Meta.profile" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.security">
            <path value="MedicationStatement.meta.security" />
            <short value="Security Labels applied to this resource" />
            <definition value="Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure." />
            <comment value="The security labels can be updated without changing the stated version of the resource  The list of security labels is a set. Uniqueness is based the system/code, and version and display are ignored." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="Meta.security" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Coding" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="SecurityLabels" />
                </extension>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
                    <valueBoolean value="true" />
                </extension>
                <strength value="extensible" />
                <description value="Security Labels from the Healthcare Privacy and Security Classification System." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/security-labels" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
            </mapping>
        </element>
        <element id="MedicationStatement.meta.tag">
            <path value="MedicationStatement.meta.tag" />
            <short value="Tags applied to this resource" />
            <definition value="Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource." />
            <comment value="The tags can be updated without changing the stated version of the resource.  The list of tags is a set. Uniqueness is based the system/code, and version and display are ignored." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="Meta.tag" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Coding" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="Tags" />
                </extension>
                <strength value="example" />
                <description value="Codes that represent various types of tags, commonly workflow-related; e.g. &quot;Needs review by Dr. Jones&quot;" />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/common-tags" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
            </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&#39;s meaning or interpretation." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Resource.implicitRules" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isModifier value="true" />
            <isSummary value="true" />
            <mapping>
                <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" />
            <base>
                <path value="Resource.language" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="code" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet">
                    <valueReference>
                        <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." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/languages" />
                </valueSetReference>
            </binding>
            <mapping>
                <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 &quot;clinically safe&quot; 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 &quot;text blob&quot; 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" />
            <base>
                <path value="DomainResource.text" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Narrative" />
            </type>
            <condition value="ele-1" />
            <condition value="dom-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
            <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="*" />
            <base>
                <path value="DomainResource.contained" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Resource" />
            </type>
            <mapping>
                <identity value="rim" />
                <map value="Entity. Role, or Act" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension">
            <path value="MedicationStatement.extension" />
            <slicing>
                <discriminator>
                    <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="1" />
            <max value="*" />
            <base>
                <path value="DomainResource.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate">
            <path value="MedicationStatement.extension" />
            <sliceName value="lastIssueDate" />
            <short value="The date a prescription was last issued" />
            <definition value="The date a prescription was last issued." />
            <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" />
            <base>
                <path value="DomainResource.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mustSupport value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.id">
            <path value="MedicationStatement.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.extension">
            <path value="MedicationStatement.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.url">
            <path value="MedicationStatement.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime">
            <path value="MedicationStatement.extension.valueDateTime" />
            <sliceName value="valueDateTime" />
            <short value="The date a prescription was last issued" />
            <definition value="The date a prescription was last issued." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="dateTime" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime.id">
            <path value="MedicationStatement.extension.valueDateTime.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime.extension">
            <path value="MedicationStatement.extension.valueDateTime.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime.value">
            <path value="MedicationStatement.extension.valueDateTime.value" />
            <representation value="xmlAttr" />
            <short value="Primitive value for dateTime" />
            <definition value="Primitive value for dateTime" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="dateTime.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-regex">
                    <valueString value="-?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?" />
                </extension>
                <code>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
                        <valueString value="string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
                        <valueString value="xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
                        <valueString value="xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime" />
                    </extension>
                </code>
            </type>
        </element>
        <element id="MedicationStatement.extension:changeSummary">
            <path value="MedicationStatement.extension" />
            <sliceName value="changeSummary" />
            <short value="Optional Extensions 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" />
            <base>
                <path value="DomainResource.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.id">
            <path value="MedicationStatement.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension">
            <path value="MedicationStatement.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status">
            <path value="MedicationStatement.extension.extension" />
            <sliceName value="status" />
            <short value="The change status of a medication" />
            <definition value="May be used to represent additional information that is not part of the basic definition of the element. 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="1" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.id">
            <path value="MedicationStatement.extension.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.extension">
            <path value="MedicationStatement.extension.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.url">
            <path value="MedicationStatement.extension.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="status" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode">
            <path value="MedicationStatement.extension.extension.valueCode" />
            <sliceName value="valueCode" />
            <short value="The change status of a medication." />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="code" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <binding>
                <strength value="required" />
                <description value="A ValueSet to identify the change status of a medication." />
                <valueSetReference>
                    <reference value="https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationChangeStatus-1" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode.id">
            <path value="MedicationStatement.extension.extension.valueCode.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode.extension">
            <path value="MedicationStatement.extension.extension.valueCode.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode.value">
            <path value="MedicationStatement.extension.extension.valueCode.value" />
            <representation value="xmlAttr" />
            <short value="Primitive value for code" />
            <definition value="Primitive value for code" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="string.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-regex">
                    <valueString value="[^\s]+([\s]?[^\s]+)*" />
                </extension>
                <code>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
                        <valueString value="string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
                        <valueString value="xsd:token" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
                        <valueString value="xsd:token" />
                    </extension>
                </code>
            </type>
            <maxLength value="1048576" />
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange">
            <path value="MedicationStatement.extension.extension" />
            <sliceName value="indicationForChange" />
            <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 element. 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="1" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.id">
            <path value="MedicationStatement.extension.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.extension">
            <path value="MedicationStatement.extension.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.url">
            <path value="MedicationStatement.extension.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="indicationForChange" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept">
            <path value="MedicationStatement.extension.extension.valueCodeableConcept" />
            <sliceName value="valueCodeableConcept" />
            <short value="Value of extension" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.id">
            <path value="MedicationStatement.extension.extension.valueCodeableConcept.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.extension">
            <path value="MedicationStatement.extension.extension.valueCodeableConcept.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.coding">
            <path value="MedicationStatement.extension.extension.valueCodeableConcept.coding" />
            <short value="Code defined by a terminology system" />
            <definition value="A reference to a code defined by a terminology system." />
            <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
            <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="CodeableConcept.coding" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Coding" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.1-8, C*E.10-22" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="union(., ./translation)" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.text">
            <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
                <valueBoolean value="true" />
            </extension>
            <path value="MedicationStatement.extension.extension.valueCodeableConcept.text" />
            <short value="Plain text representation of the concept" />
            <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
            <comment value="Very often the text is the same as a displayName of one of the codings." />
            <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="CodeableConcept.text" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.9. But note many systems use C*E.2 for this" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged">
            <path value="MedicationStatement.extension.extension" />
            <sliceName value="dateChanged" />
            <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 element. 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="1" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.id">
            <path value="MedicationStatement.extension.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.extension">
            <path value="MedicationStatement.extension.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.url">
            <path value="MedicationStatement.extension.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="dateChanged" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime">
            <path value="MedicationStatement.extension.extension.valueDateTime" />
            <sliceName value="valueDateTime" />
            <short value="Value of extension" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="dateTime" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime.id">
            <path value="MedicationStatement.extension.extension.valueDateTime.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime.extension">
            <path value="MedicationStatement.extension.extension.valueDateTime.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime.value">
            <path value="MedicationStatement.extension.extension.valueDateTime.value" />
            <representation value="xmlAttr" />
            <short value="Primitive value for dateTime" />
            <definition value="Primitive value for dateTime" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="dateTime.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-regex">
                    <valueString value="-?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\.[0-9]+)?(Z|(\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?" />
                </extension>
                <code>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
                        <valueString value="string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
                        <valueString value="xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
                        <valueString value="xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime" />
                    </extension>
                </code>
            </type>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment">
            <path value="MedicationStatement.extension.extension" />
            <sliceName value="detailsOfAmendment" />
            <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 element. 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="1" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.id">
            <path value="MedicationStatement.extension.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.extension">
            <path value="MedicationStatement.extension.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.url">
            <path value="MedicationStatement.extension.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="detailsOfAmendment" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString">
            <path value="MedicationStatement.extension.extension.valueString" />
            <sliceName value="valueString" />
            <short value="Value of extension" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString.id">
            <path value="MedicationStatement.extension.extension.valueString.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString.extension">
            <path value="MedicationStatement.extension.extension.valueString.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString.value">
            <path value="MedicationStatement.extension.extension.valueString.value" />
            <representation value="xmlAttr" />
            <short value="Primitive value for string" />
            <definition value="Primitive value for string" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="string.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
                        <valueString value="string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
                        <valueString value="xsd:string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
                        <valueString value="xsd:string" />
                    </extension>
                </code>
            </type>
            <maxLength value="1048576" />
        </element>
        <element id="MedicationStatement.extension:changeSummary.url">
            <path value="MedicationStatement.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:changeSummary.value[x]">
            <path value="MedicationStatement.extension.value[x]" />
            <short value="Value of extension" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="0" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="base64Binary" />
            </type>
            <type>
                <code value="boolean" />
            </type>
            <type>
                <code value="code" />
            </type>
            <type>
                <code value="date" />
            </type>
            <type>
                <code value="dateTime" />
            </type>
            <type>
                <code value="decimal" />
            </type>
            <type>
                <code value="id" />
            </type>
            <type>
                <code value="instant" />
            </type>
            <type>
                <code value="integer" />
            </type>
            <type>
                <code value="markdown" />
            </type>
            <type>
                <code value="oid" />
            </type>
            <type>
                <code value="positiveInt" />
            </type>
            <type>
                <code value="string" />
            </type>
            <type>
                <code value="time" />
            </type>
            <type>
                <code value="unsignedInt" />
            </type>
            <type>
                <code value="uri" />
            </type>
            <type>
                <code value="Address" />
            </type>
            <type>
                <code value="Age" />
            </type>
            <type>
                <code value="Annotation" />
            </type>
            <type>
                <code value="Attachment" />
            </type>
            <type>
                <code value="CodeableConcept" />
            </type>
            <type>
                <code value="Coding" />
            </type>
            <type>
                <code value="ContactPoint" />
            </type>
            <type>
                <code value="Count" />
            </type>
            <type>
                <code value="Distance" />
            </type>
            <type>
                <code value="Duration" />
            </type>
            <type>
                <code value="HumanName" />
            </type>
            <type>
                <code value="Identifier" />
            </type>
            <type>
                <code value="Money" />
            </type>
            <type>
                <code value="Period" />
            </type>
            <type>
                <code value="Quantity" />
            </type>
            <type>
                <code value="Range" />
            </type>
            <type>
                <code value="Ratio" />
            </type>
            <type>
                <code value="Reference" />
            </type>
            <type>
                <code value="SampledData" />
            </type>
            <type>
                <code value="Signature" />
            </type>
            <type>
                <code value="Timing" />
            </type>
            <type>
                <code value="Meta" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency">
            <path value="MedicationStatement.extension" />
            <sliceName value="prescribingAgency" />
            <short value="The type of organisation/setting responsible for authorising and issuing the medication" />
            <definition value="The type of organisation/setting responsible for authorising and issuing the medication." />
            <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="1" />
            <max value="1" />
            <base>
                <path value="DomainResource.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.id">
            <path value="MedicationStatement.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.extension">
            <path value="MedicationStatement.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.url">
            <path value="MedicationStatement.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept">
            <path value="MedicationStatement.extension.valueCodeableConcept" />
            <sliceName value="valueCodeableConcept" />
            <short value="The type of organisation/setting responsible for authorising and issuing medication outside of a GP system" />
            <definition value="The type of organisation/setting responsible for authorising and issuing medication outside of a GP system." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </constraint>
            <binding>
                <strength value="required" />
                <valueSetReference>
                    <reference value="https://fhir.nhs.uk/STU3/ValueSet/CareConnect-PrescribingAgency-1" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.id">
            <path value="MedicationStatement.extension.valueCodeableConcept.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.extension">
            <path value="MedicationStatement.extension.valueCodeableConcept.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.coding">
            <path value="MedicationStatement.extension.valueCodeableConcept.coding" />
            <short value="Code defined by a terminology system" />
            <definition value="A reference to a code defined by a terminology system." />
            <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
            <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="CodeableConcept.coding" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Coding" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.1-8, C*E.10-22" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="union(., ./translation)" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.text">
            <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
                <valueBoolean value="true" />
            </extension>
            <path value="MedicationStatement.extension.valueCodeableConcept.text" />
            <short value="Plain text representation of the concept" />
            <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
            <comment value="Very often the text is the same as a displayName of one of the codings." />
            <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="CodeableConcept.text" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.9. But note many systems use C*E.2 for this" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged">
            <path value="MedicationStatement.extension" />
            <sliceName value="dosageLastChanged" />
            <short value="The date when the dosage instructions were last changed" />
            <definition value="Only populate where the dosage instructions have been changed during the lifetime of the Medication/Medical Device plan.\nSet to the date when the dosage instructions were last changed." />
            <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" />
            <base>
                <path value="DomainResource.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
                <profile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged.id">
            <path value="MedicationStatement.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged.extension">
            <path value="MedicationStatement.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged.url">
            <path value="MedicationStatement.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged.value[x]">
            <path value="MedicationStatement.extension.value[x]" />
            <short value="Value of extension" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="base64Binary" />
            </type>
            <type>
                <code value="boolean" />
            </type>
            <type>
                <code value="code" />
            </type>
            <type>
                <code value="date" />
            </type>
            <type>
                <code value="dateTime" />
            </type>
            <type>
                <code value="decimal" />
            </type>
            <type>
                <code value="id" />
            </type>
            <type>
                <code value="instant" />
            </type>
            <type>
                <code value="integer" />
            </type>
            <type>
                <code value="markdown" />
            </type>
            <type>
                <code value="oid" />
            </type>
            <type>
                <code value="positiveInt" />
            </type>
            <type>
                <code value="string" />
            </type>
            <type>
                <code value="time" />
            </type>
            <type>
                <code value="unsignedInt" />
            </type>
            <type>
                <code value="uri" />
            </type>
            <type>
                <code value="Address" />
            </type>
            <type>
                <code value="Age" />
            </type>
            <type>
                <code value="Annotation" />
            </type>
            <type>
                <code value="Attachment" />
            </type>
            <type>
                <code value="CodeableConcept" />
            </type>
            <type>
                <code value="Coding" />
            </type>
            <type>
                <code value="ContactPoint" />
            </type>
            <type>
                <code value="Count" />
            </type>
            <type>
                <code value="Distance" />
            </type>
            <type>
                <code value="Duration" />
            </type>
            <type>
                <code value="HumanName" />
            </type>
            <type>
                <code value="Identifier" />
            </type>
            <type>
                <code value="Money" />
            </type>
            <type>
                <code value="Period" />
            </type>
            <type>
                <code value="Quantity" />
            </type>
            <type>
                <code value="Range" />
            </type>
            <type>
                <code value="Ratio" />
            </type>
            <type>
                <code value="Reference" />
            </type>
            <type>
                <code value="SampledData" />
            </type>
            <type>
                <code value="Signature" />
            </type>
            <type>
                <code value="Timing" />
            </type>
            <type>
                <code value="Meta" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.modifierExtension">
            <path value="MedicationStatement.modifierExtension" />
            <slicing>
                <discriminator>
                    <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="*" />
            <base>
                <path value="DomainResource.modifierExtension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <isModifier value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <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="1" />
            <max value="*" />
            <base>
                <path value="MedicationStatement.identifier" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Identifier" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CX / EI (occasionally, more often EI maps to a resource id or a URL)" />
            </mapping>
            <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>
            <mapping>
                <identity value="servd" />
                <map value="Identifier" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…identifer" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".id" />
            </mapping>
            <mapping>
                <identity value="w5" />
                <map value="id" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.id">
            <path value="MedicationStatement.identifier.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.extension">
            <path value="MedicationStatement.identifier.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.use">
            <path value="MedicationStatement.identifier.use" />
            <short value="usual | official | temp | secondary (If known)" />
            <definition value="The purpose of this identifier." />
            <comment value="This is labeled as &quot;Is Modifier&quot; because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary." />
            <requirements value="Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Identifier.use" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="code" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isModifier value="true" />
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="IdentifierUse" />
                </extension>
                <strength value="required" />
                <description value="Identifies the purpose for this identifier, if known ." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/identifier-use" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Role.code or implied by context" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.type">
            <path value="MedicationStatement.identifier.type" />
            <short value="Description of identifier" />
            <definition value="A coded type for the identifier that can be used to determine which identifier to use for a specific purpose." />
            <comment value="This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. \n\nWhere the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type." />
            <requirements value="Allows users to make use of identifiers when the identifier system is not known." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Identifier.type" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="IdentifierType" />
                </extension>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding">
                    <valueBoolean value="true" />
                </extension>
                <strength value="extensible" />
                <description value="A coded type for an identifier that can be used to determine which identifier to use for a specific purpose." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/identifier-type" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CX.5" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Role.code or implied by context" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.system">
            <path value="MedicationStatement.identifier.system" />
            <short value="The namespace for the identifier value" />
            <definition value="Establishes the namespace for the value - that is, a URL that describes a set values that are unique." />
            <comment value="see http://en.wikipedia.org/wiki/Uniform_resource_identifier" />
            <requirements value="There are many sets  of identifiers.  To perform matching of two identifiers, we need to know what set we&#39;re dealing with. The system identifies a particular set of unique identifiers." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Identifier.system" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <example>
                <label value="General" />
                <valueUri value="http://www.acme.com/identifiers/patient" />
            </example>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CX.4 / EI-2-4" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="II.root or Role.id.root" />
            </mapping>
            <mapping>
                <identity value="servd" />
                <map value="./IdentifierType" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.value">
            <path value="MedicationStatement.identifier.value" />
            <short value="The value that is unique" />
            <definition value="The portion of the identifier typically relevant to the user and which is unique within the context of the system." />
            <comment value="If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value&#39;s primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html)." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Identifier.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <example>
                <label value="General" />
                <valueString value="123456" />
            </example>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CX.1 / EI.1" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)" />
            </mapping>
            <mapping>
                <identity value="servd" />
                <map value="./Value" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.period">
            <path value="MedicationStatement.identifier.period" />
            <short value="Time period when id is/was valid for use" />
            <definition value="Time period during which identifier is/was valid for use." />
            <comment value="This is not a duration - that&#39;s a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. &quot;the patient was an inpatient of the hospital for this time range&quot;) or one value from the range applies (e.g. &quot;give to the patient between these two times&quot;). If duration is required, specify the type as Interval|Duration." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Identifier.period" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Period" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Period" />
            </constraint>
            <constraint>
                <key value="per-1" />
                <severity value="error" />
                <human value="If present, start SHALL have a lower value than end" />
                <expression value="start.empty() or end.empty() or (start &lt;= end)" />
                <xpath value="not(exists(f:start)) or not(exists(f:end)) or (f:start/@value &lt;= f:end/@value)" />
                <source value="http://hl7.org/fhir/StructureDefinition/Period" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="DR" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="IVL&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;] or URG&lt;TS&gt;[lowClosed=&quot;true&quot; and highClosed=&quot;true&quot;]" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CX.7 + CX.8" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Role.effectiveTime or implied by context" />
            </mapping>
            <mapping>
                <identity value="servd" />
                <map value="./StartDate and ./EndDate" />
            </mapping>
        </element>
        <element id="MedicationStatement.identifier.assigner">
            <path value="MedicationStatement.identifier.assigner" />
            <short value="Organization that issued id (may be just text)" />
            <definition value="Organization that issued/manages the identifier." />
            <comment value="The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Identifier.assigner" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Organization" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CX.4 / (CX.4,CX.9,CX.10)" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper" />
            </mapping>
            <mapping>
                <identity value="servd" />
                <map value="./IdentifierIssuingAuthority" />
            </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="1" />
            <base>
                <path value="MedicationStatement.basedOn" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/CarePlan" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ProcedureRequest" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationRequest-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…basedOn" />
            </mapping>
            <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="*" />
            <base>
                <path value="MedicationStatement.partOf" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationDispense" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Procedure-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…part of" />
            </mapping>
            <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="1" />
            <base>
                <path value="MedicationStatement.context" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <mustSupport value="true" />
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…context" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code=&quot;type of encounter or episode&quot;]" />
            </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&#39;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" />
            <base>
                <path value="MedicationStatement.status" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="code" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isModifier value="true" />
            <isSummary value="true" />
            <binding>
                <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." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/medication-statement-status" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…status" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".statusCode" />
            </mapping>
            <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" />
            <base>
                <path value="MedicationStatement.category" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <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" />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/medication-statement-category" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code=&quot;type of medication usage&quot;].value" />
            </mapping>
            <mapping>
                <identity value="w5" />
                <map value="class" />
            </mapping>
        </element>
        <element id="MedicationStatement.medication[x]">
            <path value="MedicationStatement.medication[x]" />
            <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.&#160; For example if&#160;you require&#160;form or&#160;lot number, then you must&#160;reference the Medication resource.&#160;." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="MedicationStatement.medication[x]" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Medication-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="MedicationCode" />
                </extension>
                <strength value="example" />
                <description value="A coded concept identifying the substance or product being taken." />
                <valueSetUri value="http://hl7.org/fhir/ValueSet/medication-codes" />
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…code" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".participation[typeCode=CSM].role[classCode=ADMM or MANU]" />
            </mapping>
            <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 &quot;end&quot; date will be omitted." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="MedicationStatement.effective[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="dateTime" />
            </type>
            <type>
                <code value="Period" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mustSupport value="true" />
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…occurrence[x]" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".effectiveTime" />
            </mapping>
            <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="1" />
            <max value="1" />
            <base>
                <path value="MedicationStatement.dateAsserted" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="dateTime" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".participation[typeCode=AUT].time" />
            </mapping>
            <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="1" />
            <base>
                <path value="MedicationStatement.informationSource" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <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>
            <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" />
            <base>
                <path value="MedicationStatement.subject" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…subject" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="PID-3-Patient ID List" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".participation[typeCode=SBJ].role[classCode=PAT]" />
            </mapping>
            <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="*" />
            <base>
                <path value="MedicationStatement.derivedFrom" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Resource" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <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" />
            <base>
                <path value="MedicationStatement.taken" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="code" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isModifier value="true" />
            <isSummary value="true" />
            <binding>
                <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" />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/medication-statement-taken" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…notDone" />
            </mapping>
            <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="*" />
            <base>
                <path value="MedicationStatement.reasonNotTaken" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <condition value="mst-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <binding>
                <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" />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/reason-medication-not-taken-codes" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=&quot;reason not taken&quot;].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="*" />
            <base>
                <path value="MedicationStatement.reasonCode" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <binding>
                <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." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/condition-code" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…reasoneCodeableConcept" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".reasonCode" />
            </mapping>
            <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="*" />
            <base>
                <path value="MedicationStatement.reasonReference" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Condition-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <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(&#39;#&#39;).not() or (reference.substring(1).trace(&#39;url&#39;) in %resource.contained.id.trace(&#39;ids&#39;))" />
                <xpath value="not(starts-with(f:reference/@value, &#39;#&#39;)) 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, &#39;#&#39;)]|/*/f:contained/f:*[f:id/@value=substring-after(current()/f:reference/@value, &#39;#&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Reference" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="The target of a resource reference is a RIM entry point (Act, Role, or Entity)" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…reasonReference" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code=&quot;reason for use&quot;].value" />
            </mapping>
            <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 &quot;modifying&quot; information that could be computable. (This is a SHOULD because enforcing user behavior is nearly impossible)." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="MedicationStatement.note" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Annotation" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mustSupport value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Act" />
            </mapping>
            <mapping>
                <identity value="workflow" />
                <map value="…note" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code=&quot;annotation&quot;].value" />
            </mapping>
        </element>
        <element id="MedicationStatement.note.id">
            <path value="MedicationStatement.note.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.note.extension">
            <path value="MedicationStatement.note.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.note.author[x]">
            <path value="MedicationStatement.note.author[x]" />
            <short value="Individual responsible for the annotation" />
            <definition value="The individual responsible for making the annotation." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Annotation.author[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
            </type>
            <type>
                <code value="string" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Act.participant[typeCode=AUT].role" />
            </mapping>
        </element>
        <element id="MedicationStatement.note.time">
            <path value="MedicationStatement.note.time" />
            <short value="When the annotation was made" />
            <definition value="Indicates when this particular annotation was made." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Annotation.time" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="dateTime" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Act.effectiveTime" />
            </mapping>
        </element>
        <element id="MedicationStatement.note.text">
            <path value="MedicationStatement.note.text" />
            <short value="The annotation  - text content" />
            <definition value="The text of the annotation." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Annotation.text" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="Act.text" />
            </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, &quot;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.&quot;  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="1" />
            <max value="*" />
            <base>
                <path value="MedicationStatement.dosage" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Dosage" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".outboundRelationship[typeCode=COMP].target[classCode=SBADM, moodCode=INT]" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="refer dosageInstruction mapping" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.id">
            <path value="MedicationStatement.dosage.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.extension">
            <path value="MedicationStatement.dosage.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.sequence">
            <path value="MedicationStatement.dosage.sequence" />
            <short value="The order of the dosage instructions" />
            <definition value="Indicates the order in which the dosage instructions should be applied or interpreted." />
            <comment value="32 bit number; for values larger than this, use decimal" />
            <requirements value="If the sequence number of multiple Dosages is the same, then it is implied that the instructions are to be treated as concurrent.  If the sequence number is different, then the Dosages are intended to be sequential." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.sequence" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="integer" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".text" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.text">
            <path value="MedicationStatement.dosage.text" />
            <short value="Free text dosage instructions e.g. SIG" />
            <definition value="Free text dosage instructions e.g. SIG." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <requirements value="Free text dosage instructions can be used for cases where the instructions are too complex to code.  The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated.  If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Dosage.text" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".text" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.additionalInstruction">
            <path value="MedicationStatement.dosage.additionalInstruction" />
            <short value="Supplemental instruction - e.g. &quot;with meals&quot;" />
            <definition value="Supplemental instruction - e.g. &quot;with meals&quot;." />
            <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." />
            <requirements value="Additional instruction such as &quot;Swallow with plenty of water&quot; which may or may not be coded." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="Dosage.additionalInstruction" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="AdditionalInstruction" />
                </extension>
                <strength value="example" />
                <description value="A coded concept identifying additional instructions such as &quot;take with water&quot; or &quot;avoid operating heavy machinery&quot;." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/additional-instruction-codes" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".text" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.patientInstruction">
            <path value="MedicationStatement.dosage.patientInstruction" />
            <short value="Patient or consumer oriented instructions" />
            <definition value="Instructions in terms that are understood by the patient or consumer." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.patientInstruction" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mustSupport value="true" />
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".text" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.timing">
            <path value="MedicationStatement.dosage.timing" />
            <short value="When medication should be administered" />
            <definition value="When medication should be administered." />
            <comment value="This attribute may not always be populated while the Dosage.text is expected to be populated.  If both are populated, then the Dosage.text should reflect the content of the Dosage.timing." />
            <requirements value="The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: &quot;Every 8 hours&quot;; &quot;Three times a day&quot;; &quot;1/2 an hour before breakfast for 10 days from 23-Dec 2011:&quot;; &quot;15 Oct 2013, 17 Oct 2013 and 1 Nov 2013&quot;.  Sometimes, a rate can imply duration when expressed as total volume / duration (e.g.  500mL/2 hours implies a duration of 2 hours).  However, when rate doesn&#39;t imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.timing" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Timing" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="QSET&lt;TS&gt; (GTS)" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".effectiveTime" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.asNeeded[x]">
            <path value="MedicationStatement.dosage.asNeeded[x]" />
            <short value="Take &quot;as needed&quot; (for x)" />
            <definition value="Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept)." />
            <comment value="Can express &quot;as needed&quot; without a reason by setting the Boolean = True.  In this case the CodeableConcept is not populated.  Or you can express &quot;as needed&quot; with a reason by including the CodeableConcept.  In this case the Boolean is assumed to be True.  If you set the Boolean to False, then the dose is given according to the schedule and is not &quot;prn&quot; or &quot;as needed&quot;." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.asNeeded[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="boolean" />
            </type>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="MedicationAsNeededReason" />
                </extension>
                <strength value="example" />
                <description value="A coded concept identifying the precondition that should be met or evaluated prior to consuming or administering a medication dose.  For example &quot;pain&quot;, &quot;30 minutes prior to sexual intercourse&quot;, &quot;on flare-up&quot; etc." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/medication-as-needed-reason" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".outboundRelationship[typeCode=PRCN].target[classCode=OBS, moodCode=EVN, code=&quot;as needed&quot;].value=boolean or codable concept" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.site">
            <path value="MedicationStatement.dosage.site" />
            <short value="Body site to administer to" />
            <definition value="Body site to administer to." />
            <comment value="If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [body-site-instance](extension-body-site-instance.html).  May be a summary code, or a reference to a very precise definition of the location, or both." />
            <requirements value="A coded specification of the anatomic site where the medication first enters the body." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.site" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="MedicationAdministrationSite" />
                </extension>
                <strength value="example" />
                <description value="A coded concept describing the site location the medicine enters into or onto the body." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/approach-site-codes" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".approachSiteCode" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route">
            <path value="MedicationStatement.dosage.route" />
            <short value="How drug should enter body" />
            <definition value="How drug should enter body." />
            <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." />
            <requirements value="A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient&#39;s body." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.route" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="RouteOfAdministration" />
                </extension>
                <strength value="example" />
                <description value="A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/route-codes" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".routeCode" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.id">
            <path value="MedicationStatement.dosage.route.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.extension">
            <path value="MedicationStatement.dosage.route.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding">
            <path value="MedicationStatement.dosage.route.coding" />
            <slicing>
                <discriminator>
                    <type value="value" />
                    <path value="system" />
                </discriminator>
                <ordered value="false" />
                <rules value="open" />
            </slicing>
            <short value="Code defined by a terminology system" />
            <definition value="A reference to a code defined by a terminology system." />
            <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
            <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
            <min value="0" />
            <max value="*" />
            <base>
                <path value="CodeableConcept.coding" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Coding" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.1-8, C*E.10-22" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="union(., ./translation)" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT">
            <path value="MedicationStatement.dosage.route.coding" />
            <sliceName value="snomedCT" />
            <short value="Code defined by a terminology system" />
            <definition value="A reference to a code defined by a terminology system." />
            <comment value="Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true." />
            <requirements value="Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="CodeableConcept.coding" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Coding" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <strength value="example" />
                <description value="A code from the SNOMED Clinical Terminology UK coding system that describes the e-Prescribing route of administration." />
                <valueSetReference>
                    <reference value="https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationDosageRoute-1" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE subset one of the sets of component 1-3 or 4-6" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding rdfs:subClassOf dt:CDCoding" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.1-8, C*E.10-22" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="union(., ./translation)" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.id">
            <path value="MedicationStatement.dosage.route.coding.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension">
            <path value="MedicationStatement.dosage.route.coding.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID">
            <path value="MedicationStatement.dosage.route.coding.extension" />
            <sliceName value="snomedCTDescriptionID" />
            <short value="The SNOMED CT Description ID for the display" />
            <definition value="The SNOMED CT Description ID for the display." />
            <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" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.id">
            <path value="MedicationStatement.dosage.route.coding.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension">
            <path value="MedicationStatement.dosage.route.coding.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="1" />
            <max value="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId">
            <path value="MedicationStatement.dosage.route.coding.extension.extension" />
            <sliceName value="descriptionId" />
            <short value="The SNOMED CT Description ID" />
            <definition value="May be used to represent additional information that is not part of the basic definition of the element. 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="1" />
            <max value="1" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.id">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.extension">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.url">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="descriptionId" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueId" />
            <sliceName value="valueId" />
            <short value="The SNOMED CT Description ID" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="id" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId.id">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueId.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId.extension">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueId.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId.value">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueId.value" />
            <representation value="xmlAttr" />
            <short value="Primitive value for id" />
            <definition value="Primitive value for id" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="string.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-regex">
                    <valueString value="[A-Za-z0-9\-\.]{1,64}" />
                </extension>
                <code>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
                        <valueString value="string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
                        <valueString value="xsd:string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
                        <valueString value="xsd:string" />
                    </extension>
                </code>
            </type>
            <maxLength value="1048576" />
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay">
            <path value="MedicationStatement.dosage.route.coding.extension.extension" />
            <sliceName value="descriptionDisplay" />
            <short value="The SNOMED CT display for the description ID" />
            <definition value="May be used to represent additional information that is not part of the basic definition of the element. 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="1" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.id">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.extension">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.url">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="descriptionDisplay" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueString" />
            <sliceName value="valueString" />
            <short value="The SNOMED CT display for the description ID" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString.id">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueString.id" />
            <representation value="xmlAttr" />
            <short value="xml:id (or equivalent in JSON)" />
            <definition value="unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Element.id" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString.extension">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueString.extension" />
            <slicing>
                <discriminator>
                    <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 element. 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="*" />
            <base>
                <path value="Element.extension" />
                <min value="0" />
                <max value="*" />
            </base>
            <type>
                <code value="Extension" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <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(.), &#39;value&#39;)])" />
                <source value="http://hl7.org/fhir/StructureDefinition/Extension" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString.value">
            <path value="MedicationStatement.dosage.route.coding.extension.extension.valueString.value" />
            <representation value="xmlAttr" />
            <short value="Primitive value for string" />
            <definition value="Primitive value for string" />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="string.value" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type">
                        <valueString value="string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type">
                        <valueString value="xsd:string" />
                    </extension>
                    <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type">
                        <valueString value="xsd:string" />
                    </extension>
                </code>
            </type>
            <maxLength value="1048576" />
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.url">
            <path value="MedicationStatement.dosage.route.coding.extension.url" />
            <representation value="xmlAttr" />
            <short value="identifies the meaning of the extension" />
            <definition value="Source of the definition for the extension code - a logical name or a URL." />
            <comment value="The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Extension.url" />
                <min value="1" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.value[x]">
            <path value="MedicationStatement.dosage.route.coding.extension.value[x]" />
            <short value="Value of extension" />
            <definition value="Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list)." />
            <min value="0" />
            <max value="0" />
            <base>
                <path value="Extension.value[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="base64Binary" />
            </type>
            <type>
                <code value="boolean" />
            </type>
            <type>
                <code value="code" />
            </type>
            <type>
                <code value="date" />
            </type>
            <type>
                <code value="dateTime" />
            </type>
            <type>
                <code value="decimal" />
            </type>
            <type>
                <code value="id" />
            </type>
            <type>
                <code value="instant" />
            </type>
            <type>
                <code value="integer" />
            </type>
            <type>
                <code value="markdown" />
            </type>
            <type>
                <code value="oid" />
            </type>
            <type>
                <code value="positiveInt" />
            </type>
            <type>
                <code value="string" />
            </type>
            <type>
                <code value="time" />
            </type>
            <type>
                <code value="unsignedInt" />
            </type>
            <type>
                <code value="uri" />
            </type>
            <type>
                <code value="Address" />
            </type>
            <type>
                <code value="Age" />
            </type>
            <type>
                <code value="Annotation" />
            </type>
            <type>
                <code value="Attachment" />
            </type>
            <type>
                <code value="CodeableConcept" />
            </type>
            <type>
                <code value="Coding" />
            </type>
            <type>
                <code value="ContactPoint" />
            </type>
            <type>
                <code value="Count" />
            </type>
            <type>
                <code value="Distance" />
            </type>
            <type>
                <code value="Duration" />
            </type>
            <type>
                <code value="HumanName" />
            </type>
            <type>
                <code value="Identifier" />
            </type>
            <type>
                <code value="Money" />
            </type>
            <type>
                <code value="Period" />
            </type>
            <type>
                <code value="Quantity" />
            </type>
            <type>
                <code value="Range" />
            </type>
            <type>
                <code value="Ratio" />
            </type>
            <type>
                <code value="Reference" />
            </type>
            <type>
                <code value="SampledData" />
            </type>
            <type>
                <code value="Signature" />
            </type>
            <type>
                <code value="Timing" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </constraint>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="N/A" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.system">
            <path value="MedicationStatement.dosage.route.coding.system" />
            <short value="Identity of the terminology system" />
            <definition value="The identification of the code system that defines the meaning of the symbol in the code." />
            <comment value="The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7&#39;s list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously." />
            <requirements value="Need to be unambiguous about the source of the definition of the symbol." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Coding.system" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="uri" />
            </type>
            <fixedUri value="http://snomed.info/sct" />
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.3" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="./codeSystem" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.version">
            <path value="MedicationStatement.dosage.route.coding.version" />
            <short value="Version of the system - if relevant" />
            <definition value="The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged." />
            <comment value="Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date." />
            <min value="0" />
            <max value="0" />
            <base>
                <path value="Coding.version" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.7" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="./codeSystemVersion" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.code">
            <path value="MedicationStatement.dosage.route.coding.code" />
            <short value="Symbol in syntax defined by the system" />
            <definition value="A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination)." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <requirements value="Need to refer to a particular code in the system." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Coding.code" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="code" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.1" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="./code" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.display">
            <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
                <valueBoolean value="true" />
            </extension>
            <path value="MedicationStatement.dosage.route.coding.display" />
            <short value="Representation defined by the system" />
            <definition value="A representation of the meaning of the code in the system, following the rules of the system." />
            <comment value="Note that FHIR strings may not exceed 1MB in size" />
            <requirements value="Need to be able to carry a human-readable meaning of the code for readers that do not know  the system." />
            <min value="1" />
            <max value="1" />
            <base>
                <path value="Coding.display" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.2 - but note this is not well followed" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CV.displayName" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.userSelected">
            <path value="MedicationStatement.dosage.route.coding.userSelected" />
            <short value="If this coding was chosen directly by the user" />
            <definition value="Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays)." />
            <comment value="Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly &#39;directly chosen&#39; implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely." />
            <requirements value="This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Coding.userSelected" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="boolean" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="Sometimes implied by being first" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD.codingRationale" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\#true a [     fhir:source &quot;true&quot;;     fhir:target dt:CDCoding.codingRationale\#O   ]" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.route.text">
            <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable">
                <valueBoolean value="true" />
            </extension>
            <path value="MedicationStatement.dosage.route.text" />
            <short value="Plain text representation of the concept" />
            <definition value="A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user." />
            <comment value="Very often the text is the same as a displayName of one of the codings." />
            <requirements value="The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="CodeableConcept.text" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="string" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="C*E.9. But note many systems use C*E.2 for this" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="./originalText[mediaType/code=&quot;text/plain&quot;]/data" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.method">
            <path value="MedicationStatement.dosage.method" />
            <short value="Technique for administering medication" />
            <definition value="Technique for administering medication." />
            <comment value="Terminologies used often pre-coordinate this term with the route and or form of administration." />
            <requirements value="A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections.  For examples, Slow Push; Deep IV." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.method" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="CodeableConcept" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <binding>
                <extension url="http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName">
                    <valueString value="MedicationAdministrationMethod" />
                </extension>
                <strength value="example" />
                <description value="A coded concept describing the technique by which the medicine is administered." />
                <valueSetReference>
                    <reference value="http://hl7.org/fhir/ValueSet/administration-method-codes" />
                </valueSetReference>
            </binding>
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="CE/CNE/CWE" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="CD" />
            </mapping>
            <mapping>
                <identity value="orim" />
                <map value="fhir:CodeableConcept rdfs:subClassOf dt:CD" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".doseQuantity" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.dose[x]">
            <path value="MedicationStatement.dosage.dose[x]" />
            <short value="Amount of medication per dose" />
            <definition value="Amount of medication per dose." />
            <comment value="Note that this specifies the quantity of the specified medication, not the quantity for each active ingredient(s). Each ingredient amount can be communicated in the Medication resource. For example, if one wants to communicate that a tablet was 375 mg, where the dose was one tablet, you can use the Medication resource to document that the tablet was comprised of 375 mg of drug XYZ. Alternatively if the dose was 375 mg, then you may only need to use the Medication resource to indicate this was a tablet. If the example were an IV such as dopamine and you wanted to communicate that 400mg of dopamine was mixed in 500 ml of some IV solution, then this would all be communicated in the Medication resource. If the administration is not intended to be instantaneous (rate is present or timing has a duration), this can be specified to convey the total amount to be administered over the period of time as indicated by the schedule e.g. 500 ml in dose, with timing used to convey that this should be done over 4 hours." />
            <requirements value="The amount of therapeutic or other substance given at one administration event." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.dose[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Range" />
            </type>
            <type>
                <code value="Quantity" />
                <profile value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".doseQuantity" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.maxDosePerPeriod">
            <path value="MedicationStatement.dosage.maxDosePerPeriod" />
            <short value="Upper limit on medication per unit of time" />
            <definition value="Upper limit on medication per unit of time." />
            <comment value="This is intended for use as an adjunct to the dosage when there is an upper cap.  For example &quot;2 tablets every 4 hours to a maximum of 8/day&quot;." />
            <requirements value="The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time.  For example, 1000mg in 24 hours." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.maxDosePerPeriod" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Ratio" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Ratio" />
            </constraint>
            <constraint>
                <key value="rat-1" />
                <severity value="error" />
                <human value="Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present" />
                <expression value="(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())" />
                <xpath value="(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) &gt; 0) or (count(f:extension) &gt; 0))" />
                <source value="http://hl7.org/fhir/StructureDefinition/Ratio" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="N/A" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="RTO" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".maxDoseQuantity" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.maxDosePerAdministration">
            <path value="MedicationStatement.dosage.maxDosePerAdministration" />
            <short value="Upper limit on medication per administration" />
            <definition value="Upper limit on medication per administration." />
            <comment value="This is intended for use as an adjunct to the dosage when there is an upper cap.  For example, a body surface area related dose with a maximum amount, such as 1.5 mg/m2 (maximum 2 mg) IV over 5 – 10 minutes would have doseQuantity of 1.5 mg/m2 and maxDosePerAdministration of 2 mg." />
            <requirements value="The maximum total quantity of a therapeutic substance that may be administered to a subject per administration." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.maxDosePerAdministration" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Quantity" />
                <profile value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Quantity" />
            </constraint>
            <constraint>
                <key value="qty-3" />
                <severity value="error" />
                <human value="If a code for the unit is present, the system SHALL also be present" />
                <expression value="code.empty() or system.exists()" />
                <xpath value="not(exists(f:code)) or exists(f:system)" />
                <source value="http://hl7.org/fhir/StructureDefinition/Quantity" />
            </constraint>
            <constraint>
                <key value="sqty-1" />
                <severity value="error" />
                <human value="The comparator is not used on a SimpleQuantity" />
                <expression value="comparator.empty()" />
                <xpath value="not(exists(f:comparator))" />
                <source value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
            </constraint>
            <isModifier value="false" />
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="SN (see also Range) or CQ" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="PQ, IVL&lt;PQ&gt;, MO, CO, depending on the values" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="not supported" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.maxDosePerLifetime">
            <path value="MedicationStatement.dosage.maxDosePerLifetime" />
            <short value="Upper limit on medication per lifetime of the patient" />
            <definition value="Upper limit on medication per lifetime of the patient." />
            <comment value="The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator." />
            <requirements value="The maximum total quantity of a therapeutic substance that may be administered per lifetime of the subject." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.maxDosePerLifetime" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Quantity" />
                <profile value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
                <source value="http://hl7.org/fhir/StructureDefinition/Quantity" />
            </constraint>
            <constraint>
                <key value="qty-3" />
                <severity value="error" />
                <human value="If a code for the unit is present, the system SHALL also be present" />
                <expression value="code.empty() or system.exists()" />
                <xpath value="not(exists(f:code)) or exists(f:system)" />
                <source value="http://hl7.org/fhir/StructureDefinition/Quantity" />
            </constraint>
            <constraint>
                <key value="sqty-1" />
                <severity value="error" />
                <human value="The comparator is not used on a SimpleQuantity" />
                <expression value="comparator.empty()" />
                <xpath value="not(exists(f:comparator))" />
                <source value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
            </constraint>
            <isModifier value="false" />
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="v2" />
                <map value="SN (see also Range) or CQ" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="PQ, IVL&lt;PQ&gt;, MO, CO, depending on the values" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value="not supported" />
            </mapping>
        </element>
        <element id="MedicationStatement.dosage.rate[x]">
            <path value="MedicationStatement.dosage.rate[x]" />
            <short value="Amount of medication per unit of time" />
            <definition value="Amount of medication per unit of time." />
            <comment value="It is possible to supply both a rate and a doseQuantity to provide full details about how the medication is to be administered and supplied. If the rate is intended to change over time, depending on local rules/regulations, each change should be captured as a new version of the MedicationRequest with an updated rate, or captured with a new MedicationRequest with the new rate." />
            <requirements value="Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.   Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.  Sometimes, a rate can imply duration when expressed as total volume / duration (e.g.  500mL/2 hours implies a duration of 2 hours).  However, when rate doesn&#39;t imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period." />
            <min value="0" />
            <max value="1" />
            <base>
                <path value="Dosage.rate[x]" />
                <min value="0" />
                <max value="1" />
            </base>
            <type>
                <code value="Ratio" />
            </type>
            <type>
                <code value="Range" />
            </type>
            <type>
                <code value="Quantity" />
                <profile value="http://hl7.org/fhir/StructureDefinition/SimpleQuantity" />
            </type>
            <condition value="ele-1" />
            <constraint>
                <key value="ele-1" />
                <severity value="error" />
                <human value="All FHIR elements must have a @value or children" />
                <expression value="hasValue() | (children().count() &gt; id.count())" />
                <xpath value="@value|f:*|h:div" />
            </constraint>
            <isSummary value="true" />
            <mapping>
                <identity value="rim" />
                <map value="n/a" />
            </mapping>
            <mapping>
                <identity value="rim" />
                <map value=".rateQuantity" />
            </mapping>
        </element>
    </snapshot>
    <differential>
        <element id="MedicationStatement.meta">
            <path value="MedicationStatement.meta" />
        </element>
        <element id="MedicationStatement.meta.profile">
            <path value="MedicationStatement.meta.profile" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.extension">
            <path value="MedicationStatement.extension" />
            <slicing>
                <discriminator>
                    <type value="value" />
                    <path value="url" />
                </discriminator>
                <rules value="open" />
            </slicing>
            <min value="1" />
        </element>
        <element id="MedicationStatement.extension:lastIssueDate">
            <path value="MedicationStatement.extension" />
            <sliceName value="lastIssueDate" />
            <min value="0" />
            <max value="1" />
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
            </type>
            <mustSupport value="true" />
        </element>
        <element id="MedicationStatement.extension:changeSummary">
            <path value="MedicationStatement.extension" />
            <sliceName value="changeSummary" />
            <short value="Optional Extensions Element" />
            <definition value="Optional Extension Element - found in all resources." />
            <min value="0" />
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
            </type>
        </element>
        <element id="MedicationStatement.extension:prescribingAgency">
            <path value="MedicationStatement.extension" />
            <sliceName value="prescribingAgency" />
            <short value="The type of organisation/setting responsible for authorising and issuing the medication" />
            <definition value="The type of organisation/setting responsible for authorising and issuing the medication." />
            <min value="1" />
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
            </type>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged">
            <path value="MedicationStatement.extension" />
            <sliceName value="dosageLastChanged" />
            <short value="The date when the dosage instructions were last changed" />
            <definition value="Only populate where the dosage instructions have been changed during the lifetime of the Medication/Medical Device plan.\nSet to the date when the dosage instructions were last changed." />
            <min value="0" />
            <max value="1" />
            <type>
                <code value="Extension" />
                <profile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1" />
            </type>
        </element>
        <element id="MedicationStatement.extension:dosageLastChanged.url">
            <path value="MedicationStatement.extension.url" />
            <fixedUri value="https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1" />
        </element>
        <element id="MedicationStatement.identifier">
            <path value="MedicationStatement.identifier" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.identifier.system">
            <path value="MedicationStatement.identifier.system" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.identifier.value">
            <path value="MedicationStatement.identifier.value" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.basedOn">
            <path value="MedicationStatement.basedOn" />
            <max value="1" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/CarePlan" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ProcedureRequest" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/ReferralRequest" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationRequest-1" />
            </type>
        </element>
        <element id="MedicationStatement.partOf">
            <path value="MedicationStatement.partOf" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationAdministration" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/MedicationDispense" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Procedure-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1" />
            </type>
        </element>
        <element id="MedicationStatement.context">
            <path value="MedicationStatement.context" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/EpisodeOfCare" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1" />
            </type>
            <mustSupport value="true" />
        </element>
        <element id="MedicationStatement.medication[x]">
            <path value="MedicationStatement.medication[x]" />
            <type>
                <code value="CodeableConcept" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Medication-1" />
            </type>
            <binding>
                <strength value="example" />
                <valueSetUri value="http://hl7.org/fhir/ValueSet/medication-codes" />
            </binding>
        </element>
        <element id="MedicationStatement.effective[x]">
            <path value="MedicationStatement.effective[x]" />
            <mustSupport value="true" />
        </element>
        <element id="MedicationStatement.dateAsserted">
            <path value="MedicationStatement.dateAsserted" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.informationSource">
            <path value="MedicationStatement.informationSource" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
            </type>
        </element>
        <element id="MedicationStatement.subject">
            <path value="MedicationStatement.subject" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/Group" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
            </type>
        </element>
        <element id="MedicationStatement.reasonReference">
            <path value="MedicationStatement.reasonReference" />
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Condition-1" />
            </type>
        </element>
        <element id="MedicationStatement.note">
            <path value="MedicationStatement.note" />
            <mustSupport value="true" />
        </element>
        <element id="MedicationStatement.note.author[x]">
            <path value="MedicationStatement.note.author[x]" />
            <type>
                <code value="Reference" />
                <targetProfile value="http://hl7.org/fhir/StructureDefinition/RelatedPerson" />
            </type>
            <type>
                <code value="string" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1" />
            </type>
            <type>
                <code value="Reference" />
                <targetProfile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1" />
            </type>
        </element>
        <element id="MedicationStatement.dosage">
            <path value="MedicationStatement.dosage" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.dosage.text">
            <path value="MedicationStatement.dosage.text" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.dosage.patientInstruction">
            <path value="MedicationStatement.dosage.patientInstruction" />
            <mustSupport value="true" />
        </element>
        <element id="MedicationStatement.dosage.route.coding">
            <path value="MedicationStatement.dosage.route.coding" />
            <slicing>
                <discriminator>
                    <type value="value" />
                    <path value="system" />
                </discriminator>
                <ordered value="false" />
                <rules value="open" />
            </slicing>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT">
            <path value="MedicationStatement.dosage.route.coding" />
            <sliceName value="snomedCT" />
            <max value="1" />
            <binding>
                <strength value="example" />
                <description value="A code from the SNOMED Clinical Terminology UK coding system that describes the e-Prescribing route of administration." />
                <valueSetReference>
                    <reference value="https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationDosageRoute-1" />
                </valueSetReference>
            </binding>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension">
            <path value="MedicationStatement.dosage.route.coding.extension" />
            <slicing>
                <discriminator>
                    <type value="value" />
                    <path value="url" />
                </discriminator>
                <rules value="open" />
            </slicing>
            <min value="0" />
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID">
            <path value="MedicationStatement.dosage.route.coding.extension" />
            <sliceName value="snomedCTDescriptionID" />
            <min value="0" />
            <type>
                <code value="Extension" />
                <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid" />
            </type>
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.system">
            <path value="MedicationStatement.dosage.route.coding.system" />
            <min value="1" />
            <fixedUri value="http://snomed.info/sct" />
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.version">
            <path value="MedicationStatement.dosage.route.coding.version" />
            <max value="0" />
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.code">
            <path value="MedicationStatement.dosage.route.coding.code" />
            <min value="1" />
        </element>
        <element id="MedicationStatement.dosage.route.coding:snomedCT.display">
            <path value="MedicationStatement.dosage.route.coding.display" />
            <min value="1" />
        </element>
    </differential>
</StructureDefinition>
{
    "resourceType": "StructureDefinition",
    "meta": {
        "lastUpdated": "2023-10-04T09:06:08.8942682+00:00"
    },
    "extension":  [
        {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-wg",
            "valueCode": "phx"
        }
    ],
    "url": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1",
    "version": "1.9.0",
    "name": "CareConnect-GPC-MedicationStatement-1",
    "title": "CareConnect GPC MedicationStatement1",
    "status": "active",
    "date": "2023-10-04",
    "publisher": "HL7 UK",
    "description": "This MedicationStatement Resource is a record of a medication that is being consumed by a patient.",
    "purpose": "CURATED BY INTEROPen see: http://www.interopen.org/careconnect-curation-methodology/ on the 12th September 2019.",
    "copyright": "Copyright © 2020 HL7 UK\n\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in compliance with the License. You may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.\n\nHL7® FHIR® standard Copyright © 2011+ HL7\n\nThe HL7® FHIR® standard is used under the FHIR license. You may obtain a copy of the FHIR license at\n\nhttps://www.hl7.org/fhir/license.html",
    "fhirVersion": "3.0.1",
    "kind": "resource",
    "abstract": false,
    "type": "MedicationStatement",
    "baseDefinition": "http://hl7.org/fhir/StructureDefinition/MedicationStatement",
    "derivation": "constraint",
    "snapshot": {
        "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": "*"
                },
                "constraint":  [
                    {
                        "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)",
                        "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
                    },
                    {
                        "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)",
                        "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
                    },
                    {
                        "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))",
                        "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
                    },
                    {
                        "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))]))",
                        "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
                    },
                    {
                        "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'",
                        "source": "http://hl7.org/fhir/StructureDefinition/MedicationStatement"
                    }
                ],
                "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.meta.id",
                "path": "MedicationStatement.meta.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.meta.extension",
                "path": "MedicationStatement.meta.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.meta.versionId",
                "path": "MedicationStatement.meta.versionId",
                "short": "Version specific identifier",
                "definition": "The version specific identifier, as it appears in the version portion of the URL. This values changes when the resource is created, updated, or deleted.",
                "comment": "The server assigns this value, and ignores what the client specifies, except in the case that the server is imposing version integrity on updates/deletes.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Meta.versionId",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "id"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.lastUpdated",
                "path": "MedicationStatement.meta.lastUpdated",
                "short": "When the resource version last changed",
                "definition": "When the resource last changed - e.g. when the version changed.",
                "comment": "This value is always populated except when the resource is first being created. The server / resource manager sets this value; what a client provides is irrelevant.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Meta.lastUpdated",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "instant"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.profile",
                "path": "MedicationStatement.meta.profile",
                "short": "Profiles this resource claims to conform to",
                "definition": "A list of profiles (references to [StructureDefinition](structuredefinition.html#) resources) that this resource claims to conform to. The URL is a reference to [StructureDefinition.url]().",
                "comment": "It is up to the server and/or other infrastructure of policy to determine whether/how these claims are verified and/or updated over time.  The list of profile URLs is a set.",
                "min": 1,
                "max": "*",
                "base": {
                    "path": "Meta.profile",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.security",
                "path": "MedicationStatement.meta.security",
                "short": "Security Labels applied to this resource",
                "definition": "Security labels applied to this resource. These tags connect specific resources to the overall security policy and infrastructure.",
                "comment": "The security labels can be updated without changing the stated version of the resource  The list of security labels is a set. Uniqueness is based the system/code, and version and display are ignored.",
                "min": 0,
                "max": "*",
                "base": {
                    "path": "Meta.security",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Coding"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "SecurityLabels"
                        },
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
                            "valueBoolean": true
                        }
                    ],
                    "strength": "extensible",
                    "description": "Security Labels from the Healthcare Privacy and Security Classification System.",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/security-labels"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
                    },
                    {
                        "identity": "rim",
                        "map": "CV"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
                    }
                ]
            },
            {
                "id": "MedicationStatement.meta.tag",
                "path": "MedicationStatement.meta.tag",
                "short": "Tags applied to this resource",
                "definition": "Tags applied to this resource. Tags are intended to be used to identify and relate resources to process and workflow, and applications are not required to consider the tags when interpreting the meaning of a resource.",
                "comment": "The tags can be updated without changing the stated version of the resource.  The list of tags is a set. Uniqueness is based the system/code, and version and display are ignored.",
                "min": 0,
                "max": "*",
                "base": {
                    "path": "Meta.tag",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Coding"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "Tags"
                        }
                    ],
                    "strength": "example",
                    "description": "Codes that represent various types of tags, commonly workflow-related; e.g. \"Needs review by Dr. Jones\"",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/common-tags"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
                    },
                    {
                        "identity": "rim",
                        "map": "CV"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
                    }
                ]
            },
            {
                "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
                            "valueReference": {
                                "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.",
                    "valueSetReference": {
                        "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"
                    }
                ],
                "condition":  [
                    "ele-1",
                    "dom-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "discriminator":  [
                        {
                            "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": 1,
                "max": "*",
                "base": {
                    "path": "DomainResource.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate",
                "path": "MedicationStatement.extension",
                "sliceName": "lastIssueDate",
                "short": "The date a prescription was last issued",
                "definition": "The date a prescription was last issued.",
                "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": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mustSupport": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.id",
                "path": "MedicationStatement.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.extension",
                "path": "MedicationStatement.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.url",
                "path": "MedicationStatement.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime",
                "path": "MedicationStatement.extension.valueDateTime",
                "sliceName": "valueDateTime",
                "short": "The date a prescription was last issued",
                "definition": "The date a prescription was last issued.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime.id",
                "path": "MedicationStatement.extension.valueDateTime.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime.extension",
                "path": "MedicationStatement.extension.valueDateTime.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate.value[x]:valueDateTime.value",
                "path": "MedicationStatement.extension.valueDateTime.value",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "Primitive value for dateTime",
                "definition": "Primitive value for dateTime",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "dateTime.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "extension":  [
                            {
                                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-regex",
                                "valueString": "-?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
                            }
                        ],
                        "_code": {
                            "extension":  [
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type",
                                    "valueString": "string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type",
                                    "valueString": "xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type",
                                    "valueString": "xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime"
                                }
                            ]
                        }
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary",
                "path": "MedicationStatement.extension",
                "sliceName": "changeSummary",
                "short": "Optional Extensions 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": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.id",
                "path": "MedicationStatement.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension",
                "path": "MedicationStatement.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status",
                "path": "MedicationStatement.extension.extension",
                "sliceName": "status",
                "short": "The change status of a medication",
                "definition": "May be used to represent additional information that is not part of the basic definition of the element. 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": "1",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.id",
                "path": "MedicationStatement.extension.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.extension",
                "path": "MedicationStatement.extension.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.url",
                "path": "MedicationStatement.extension.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "status",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode",
                "path": "MedicationStatement.extension.extension.valueCode",
                "sliceName": "valueCode",
                "short": "The change status of a medication.",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "code"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "binding": {
                    "strength": "required",
                    "description": "A ValueSet to identify the change status of a medication.",
                    "valueSetReference": {
                        "reference": "https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationChangeStatus-1"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode.id",
                "path": "MedicationStatement.extension.extension.valueCode.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode.extension",
                "path": "MedicationStatement.extension.extension.valueCode.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:status.value[x]:valueCode.value",
                "path": "MedicationStatement.extension.extension.valueCode.value",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "Primitive value for code",
                "definition": "Primitive value for code",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "string.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "extension":  [
                            {
                                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-regex",
                                "valueString": "[^\\s]+([\\s]?[^\\s]+)*"
                            }
                        ],
                        "_code": {
                            "extension":  [
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type",
                                    "valueString": "string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type",
                                    "valueString": "xsd:token"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type",
                                    "valueString": "xsd:token"
                                }
                            ]
                        }
                    }
                ],
                "maxLength": 1048576
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange",
                "path": "MedicationStatement.extension.extension",
                "sliceName": "indicationForChange",
                "short": "Additional Content defined by implementations",
                "definition": "May be used to represent additional information that is not part of the basic definition of the element. 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": "1",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.id",
                "path": "MedicationStatement.extension.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.extension",
                "path": "MedicationStatement.extension.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.url",
                "path": "MedicationStatement.extension.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "indicationForChange",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept",
                "path": "MedicationStatement.extension.extension.valueCodeableConcept",
                "sliceName": "valueCodeableConcept",
                "short": "Value of extension",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.id",
                "path": "MedicationStatement.extension.extension.valueCodeableConcept.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.extension",
                "path": "MedicationStatement.extension.extension.valueCodeableConcept.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.coding",
                "path": "MedicationStatement.extension.extension.valueCodeableConcept.coding",
                "short": "Code defined by a terminology system",
                "definition": "A reference to a code defined by a terminology system.",
                "comment": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.",
                "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
                "min": 0,
                "max": "*",
                "base": {
                    "path": "CodeableConcept.coding",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Coding"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
                    },
                    {
                        "identity": "rim",
                        "map": "CV"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
                    },
                    {
                        "identity": "v2",
                        "map": "C*E.1-8, C*E.10-22"
                    },
                    {
                        "identity": "rim",
                        "map": "union(., ./translation)"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:indicationForChange.value[x]:valueCodeableConcept.text",
                "extension":  [
                    {
                        "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
                        "valueBoolean": true
                    }
                ],
                "path": "MedicationStatement.extension.extension.valueCodeableConcept.text",
                "short": "Plain text representation of the concept",
                "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
                "comment": "Very often the text is the same as a displayName of one of the codings.",
                "requirements": "The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "CodeableConcept.text",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "C*E.9. But note many systems use C*E.2 for this"
                    },
                    {
                        "identity": "rim",
                        "map": "./originalText[mediaType/code=\"text/plain\"]/data"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged",
                "path": "MedicationStatement.extension.extension",
                "sliceName": "dateChanged",
                "short": "Additional Content defined by implementations",
                "definition": "May be used to represent additional information that is not part of the basic definition of the element. 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": "1",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.id",
                "path": "MedicationStatement.extension.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.extension",
                "path": "MedicationStatement.extension.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.url",
                "path": "MedicationStatement.extension.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "dateChanged",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime",
                "path": "MedicationStatement.extension.extension.valueDateTime",
                "sliceName": "valueDateTime",
                "short": "Value of extension",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime.id",
                "path": "MedicationStatement.extension.extension.valueDateTime.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime.extension",
                "path": "MedicationStatement.extension.extension.valueDateTime.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:dateChanged.value[x]:valueDateTime.value",
                "path": "MedicationStatement.extension.extension.valueDateTime.value",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "Primitive value for dateTime",
                "definition": "Primitive value for dateTime",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "dateTime.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "extension":  [
                            {
                                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-regex",
                                "valueString": "-?([0-9]([0-9]([0-9][1-9]|[1-9]0)|[1-9]00)|[1-9]000)(-(0[1-9]|1[0-2])(-(0[1-9]|[1-2][0-9]|3[0-1])(T([01][0-9]|2[0-3]):[0-5][0-9]:([0-5][0-9]|60)(\\.[0-9]+)?(Z|(\\+|-)((0[0-9]|1[0-3]):[0-5][0-9]|14:00)))?)?)?"
                            }
                        ],
                        "_code": {
                            "extension":  [
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type",
                                    "valueString": "string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type",
                                    "valueString": "xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type",
                                    "valueString": "xsd:gYear OR xsd:gYearMonth OR xsd:date OR xsd:dateTime"
                                }
                            ]
                        }
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment",
                "path": "MedicationStatement.extension.extension",
                "sliceName": "detailsOfAmendment",
                "short": "Additional Content defined by implementations",
                "definition": "May be used to represent additional information that is not part of the basic definition of the element. 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": "1",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.id",
                "path": "MedicationStatement.extension.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.extension",
                "path": "MedicationStatement.extension.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.url",
                "path": "MedicationStatement.extension.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "detailsOfAmendment",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString",
                "path": "MedicationStatement.extension.extension.valueString",
                "sliceName": "valueString",
                "short": "Value of extension",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString.id",
                "path": "MedicationStatement.extension.extension.valueString.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString.extension",
                "path": "MedicationStatement.extension.extension.valueString.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.extension:detailsOfAmendment.value[x]:valueString.value",
                "path": "MedicationStatement.extension.extension.valueString.value",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "Primitive value for string",
                "definition": "Primitive value for string",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "string.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "_code": {
                            "extension":  [
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type",
                                    "valueString": "string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type",
                                    "valueString": "xsd:string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type",
                                    "valueString": "xsd:string"
                                }
                            ]
                        }
                    }
                ],
                "maxLength": 1048576
            },
            {
                "id": "MedicationStatement.extension:changeSummary.url",
                "path": "MedicationStatement.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:changeSummary.value[x]",
                "path": "MedicationStatement.extension.value[x]",
                "short": "Value of extension",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "0",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "base64Binary"
                    },
                    {
                        "code": "boolean"
                    },
                    {
                        "code": "code"
                    },
                    {
                        "code": "date"
                    },
                    {
                        "code": "dateTime"
                    },
                    {
                        "code": "decimal"
                    },
                    {
                        "code": "id"
                    },
                    {
                        "code": "instant"
                    },
                    {
                        "code": "integer"
                    },
                    {
                        "code": "markdown"
                    },
                    {
                        "code": "oid"
                    },
                    {
                        "code": "positiveInt"
                    },
                    {
                        "code": "string"
                    },
                    {
                        "code": "time"
                    },
                    {
                        "code": "unsignedInt"
                    },
                    {
                        "code": "uri"
                    },
                    {
                        "code": "Address"
                    },
                    {
                        "code": "Age"
                    },
                    {
                        "code": "Annotation"
                    },
                    {
                        "code": "Attachment"
                    },
                    {
                        "code": "CodeableConcept"
                    },
                    {
                        "code": "Coding"
                    },
                    {
                        "code": "ContactPoint"
                    },
                    {
                        "code": "Count"
                    },
                    {
                        "code": "Distance"
                    },
                    {
                        "code": "Duration"
                    },
                    {
                        "code": "HumanName"
                    },
                    {
                        "code": "Identifier"
                    },
                    {
                        "code": "Money"
                    },
                    {
                        "code": "Period"
                    },
                    {
                        "code": "Quantity"
                    },
                    {
                        "code": "Range"
                    },
                    {
                        "code": "Ratio"
                    },
                    {
                        "code": "Reference"
                    },
                    {
                        "code": "SampledData"
                    },
                    {
                        "code": "Signature"
                    },
                    {
                        "code": "Timing"
                    },
                    {
                        "code": "Meta"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency",
                "path": "MedicationStatement.extension",
                "sliceName": "prescribingAgency",
                "short": "The type of organisation/setting responsible for authorising and issuing the medication",
                "definition": "The type of organisation/setting responsible for authorising and issuing the medication.",
                "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": 1,
                "max": "1",
                "base": {
                    "path": "DomainResource.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.id",
                "path": "MedicationStatement.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.extension",
                "path": "MedicationStatement.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.url",
                "path": "MedicationStatement.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept",
                "path": "MedicationStatement.extension.valueCodeableConcept",
                "sliceName": "valueCodeableConcept",
                "short": "The type of organisation/setting responsible for authorising and issuing medication outside of a GP system",
                "definition": "The type of organisation/setting responsible for authorising and issuing medication outside of a GP system.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "binding": {
                    "strength": "required",
                    "valueSetReference": {
                        "reference": "https://fhir.nhs.uk/STU3/ValueSet/CareConnect-PrescribingAgency-1"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.id",
                "path": "MedicationStatement.extension.valueCodeableConcept.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.extension",
                "path": "MedicationStatement.extension.valueCodeableConcept.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.coding",
                "path": "MedicationStatement.extension.valueCodeableConcept.coding",
                "short": "Code defined by a terminology system",
                "definition": "A reference to a code defined by a terminology system.",
                "comment": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.",
                "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
                "min": 0,
                "max": "*",
                "base": {
                    "path": "CodeableConcept.coding",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Coding"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
                    },
                    {
                        "identity": "rim",
                        "map": "CV"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
                    },
                    {
                        "identity": "v2",
                        "map": "C*E.1-8, C*E.10-22"
                    },
                    {
                        "identity": "rim",
                        "map": "union(., ./translation)"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency.value[x]:valueCodeableConcept.text",
                "extension":  [
                    {
                        "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
                        "valueBoolean": true
                    }
                ],
                "path": "MedicationStatement.extension.valueCodeableConcept.text",
                "short": "Plain text representation of the concept",
                "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
                "comment": "Very often the text is the same as a displayName of one of the codings.",
                "requirements": "The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "CodeableConcept.text",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ],
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "C*E.9. But note many systems use C*E.2 for this"
                    },
                    {
                        "identity": "rim",
                        "map": "./originalText[mediaType/code=\"text/plain\"]/data"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged",
                "path": "MedicationStatement.extension",
                "sliceName": "dosageLastChanged",
                "short": "The date when the dosage instructions were last changed",
                "definition": "Only populate where the dosage instructions have been changed during the lifetime of the Medication/Medical Device plan.\nSet to the date when the dosage instructions were last changed.",
                "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": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged.id",
                "path": "MedicationStatement.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged.extension",
                "path": "MedicationStatement.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged.url",
                "path": "MedicationStatement.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged.value[x]",
                "path": "MedicationStatement.extension.value[x]",
                "short": "Value of extension",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "base64Binary"
                    },
                    {
                        "code": "boolean"
                    },
                    {
                        "code": "code"
                    },
                    {
                        "code": "date"
                    },
                    {
                        "code": "dateTime"
                    },
                    {
                        "code": "decimal"
                    },
                    {
                        "code": "id"
                    },
                    {
                        "code": "instant"
                    },
                    {
                        "code": "integer"
                    },
                    {
                        "code": "markdown"
                    },
                    {
                        "code": "oid"
                    },
                    {
                        "code": "positiveInt"
                    },
                    {
                        "code": "string"
                    },
                    {
                        "code": "time"
                    },
                    {
                        "code": "unsignedInt"
                    },
                    {
                        "code": "uri"
                    },
                    {
                        "code": "Address"
                    },
                    {
                        "code": "Age"
                    },
                    {
                        "code": "Annotation"
                    },
                    {
                        "code": "Attachment"
                    },
                    {
                        "code": "CodeableConcept"
                    },
                    {
                        "code": "Coding"
                    },
                    {
                        "code": "ContactPoint"
                    },
                    {
                        "code": "Count"
                    },
                    {
                        "code": "Distance"
                    },
                    {
                        "code": "Duration"
                    },
                    {
                        "code": "HumanName"
                    },
                    {
                        "code": "Identifier"
                    },
                    {
                        "code": "Money"
                    },
                    {
                        "code": "Period"
                    },
                    {
                        "code": "Quantity"
                    },
                    {
                        "code": "Range"
                    },
                    {
                        "code": "Ratio"
                    },
                    {
                        "code": "Reference"
                    },
                    {
                        "code": "SampledData"
                    },
                    {
                        "code": "Signature"
                    },
                    {
                        "code": "Timing"
                    },
                    {
                        "code": "Meta"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.modifierExtension",
                "path": "MedicationStatement.modifierExtension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "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": 1,
                "max": "*",
                "base": {
                    "path": "MedicationStatement.identifier",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Identifier"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.identifier.id",
                "path": "MedicationStatement.identifier.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.extension",
                "path": "MedicationStatement.identifier.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.use",
                "path": "MedicationStatement.identifier.use",
                "short": "usual | official | temp | secondary (If known)",
                "definition": "The purpose of this identifier.",
                "comment": "This is labeled as \"Is Modifier\" because applications should not mistake a temporary id for a permanent one. Applications can assume that an identifier is permanent unless it explicitly says that it is temporary.",
                "requirements": "Allows the appropriate identifier for a particular context of use to be selected from among a set of identifiers.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Identifier.use",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "code"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "IdentifierUse"
                        }
                    ],
                    "strength": "required",
                    "description": "Identifies the purpose for this identifier, if known .",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/identifier-use"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "N/A"
                    },
                    {
                        "identity": "rim",
                        "map": "Role.code or implied by context"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.type",
                "path": "MedicationStatement.identifier.type",
                "short": "Description of identifier",
                "definition": "A coded type for the identifier that can be used to determine which identifier to use for a specific purpose.",
                "comment": "This element deals only with general categories of identifiers.  It SHOULD not be used for codes that correspond 1..1 with the Identifier.system. Some identifiers may fall into multiple categories due to common usage. \n\nWhere the system is known, a type is unnecessary because the type is always part of the system definition. However systems often need to handle identifiers where the system is not known. There is not a 1:1 relationship between type and system, since many different systems have the same type.",
                "requirements": "Allows users to make use of identifiers when the identifier system is not known.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Identifier.type",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "IdentifierType"
                        },
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
                            "valueBoolean": true
                        }
                    ],
                    "strength": "extensible",
                    "description": "A coded type for an identifier that can be used to determine which identifier to use for a specific purpose.",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/identifier-type"
                    }
                },
                "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": "v2",
                        "map": "CX.5"
                    },
                    {
                        "identity": "rim",
                        "map": "Role.code or implied by context"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.system",
                "path": "MedicationStatement.identifier.system",
                "short": "The namespace for the identifier value",
                "definition": "Establishes the namespace for the value - that is, a URL that describes a set values that are unique.",
                "comment": "see http://en.wikipedia.org/wiki/Uniform_resource_identifier",
                "requirements": "There are many sets  of identifiers.  To perform matching of two identifiers, we need to know what set we're dealing with. The system identifies a particular set of unique identifiers.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Identifier.system",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "example":  [
                    {
                        "label": "General",
                        "valueUri": "http://www.acme.com/identifiers/patient"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.4 / EI-2-4"
                    },
                    {
                        "identity": "rim",
                        "map": "II.root or Role.id.root"
                    },
                    {
                        "identity": "servd",
                        "map": "./IdentifierType"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.value",
                "path": "MedicationStatement.identifier.value",
                "short": "The value that is unique",
                "definition": "The portion of the identifier typically relevant to the user and which is unique within the context of the system.",
                "comment": "If the value is a full URI, then the system SHALL be urn:ietf:rfc:3986.  The value's primary purpose is computational mapping.  As a result, it may be normalized for comparison purposes (e.g. removing non-significant whitespace, dashes, etc.)  A value formatted for human display can be conveyed using the [Rendered Value extension](extension-rendered-value.html).",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Identifier.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "example":  [
                    {
                        "label": "General",
                        "valueString": "123456"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.1 / EI.1"
                    },
                    {
                        "identity": "rim",
                        "map": "II.extension or II.root if system indicates OID or GUID (Or Role.id.extension or root)"
                    },
                    {
                        "identity": "servd",
                        "map": "./Value"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.period",
                "path": "MedicationStatement.identifier.period",
                "short": "Time period when id is/was valid for use",
                "definition": "Time period during which identifier is/was valid for use.",
                "comment": "This is not a duration - that's a measure of time (a separate type), but a duration that occurs at a fixed value of time. A Period specifies a range of time; the context of use will specify whether the entire range applies (e.g. \"the patient was an inpatient of the hospital for this time range\") or one value from the range applies (e.g. \"give to the patient between these two times\"). If duration is required, specify the type as Interval|Duration.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Identifier.period",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Period"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Period"
                    },
                    {
                        "key": "per-1",
                        "severity": "error",
                        "human": "If present, start SHALL have a lower value than end",
                        "expression": "start.empty() or end.empty() or (start <= end)",
                        "xpath": "not(exists(f:start)) or not(exists(f:end)) or (f:start/@value <= f:end/@value)",
                        "source": "http://hl7.org/fhir/StructureDefinition/Period"
                    }
                ],
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "DR"
                    },
                    {
                        "identity": "rim",
                        "map": "IVL<TS>[lowClosed=\"true\" and highClosed=\"true\"] or URG<TS>[lowClosed=\"true\" and highClosed=\"true\"]"
                    },
                    {
                        "identity": "v2",
                        "map": "CX.7 + CX.8"
                    },
                    {
                        "identity": "rim",
                        "map": "Role.effectiveTime or implied by context"
                    },
                    {
                        "identity": "servd",
                        "map": "./StartDate and ./EndDate"
                    }
                ]
            },
            {
                "id": "MedicationStatement.identifier.assigner",
                "path": "MedicationStatement.identifier.assigner",
                "short": "Organization that issued id (may be just text)",
                "definition": "Organization that issued/manages the identifier.",
                "comment": "The Identifier.assigner may omit the .reference element and only contain a .display element reflecting the name or other textual information about the assigning organization.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Identifier.assigner",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/Organization"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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": "v2",
                        "map": "CX.4 / (CX.4,CX.9,CX.10)"
                    },
                    {
                        "identity": "rim",
                        "map": "II.assigningAuthorityName but note that this is an improper use by the definition of the field.  Also Role.scoper"
                    },
                    {
                        "identity": "servd",
                        "map": "./IdentifierIssuingAuthority"
                    }
                ]
            },
            {
                "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": "1",
                "base": {
                    "path": "MedicationStatement.basedOn",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "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"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationRequest-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Procedure-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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": "1",
                "base": {
                    "path": "MedicationStatement.context",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "mustSupport": true,
                "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "MedicationStatementStatus"
                        }
                    ],
                    "strength": "required",
                    "description": "A coded concept indicating the current status of a MedicationStatement.",
                    "valueSetReference": {
                        "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "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",
                    "valueSetReference": {
                        "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]",
                "path": "MedicationStatement.medication[x]",
                "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"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Medication-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "MedicationCode"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept identifying the substance or product being taken.",
                    "valueSetUri": "http://hl7.org/fhir/ValueSet/medication-codes"
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ],
                "mustSupport": true,
                "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": 1,
                "max": "1",
                "base": {
                    "path": "MedicationStatement.dateAsserted",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "1",
                "base": {
                    "path": "MedicationStatement.informationSource",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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/Group"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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": "*",
                "base": {
                    "path": "MedicationStatement.derivedFrom",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/Resource"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "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",
                    "valueSetReference": {
                        "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": "*",
                "base": {
                    "path": "MedicationStatement.reasonNotTaken",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1",
                    "mst-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "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",
                    "valueSetReference": {
                        "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": "*",
                "base": {
                    "path": "MedicationStatement.reasonCode",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "MedicationReason"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept identifying why the medication is being taken.",
                    "valueSetReference": {
                        "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": "*",
                "base": {
                    "path": "MedicationStatement.reasonReference",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Condition-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    },
                    {
                        "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, '#')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Reference"
                    }
                ],
                "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": "*",
                "base": {
                    "path": "MedicationStatement.note",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Annotation"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ],
                "mustSupport": true,
                "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.note.id",
                "path": "MedicationStatement.note.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.note.extension",
                "path": "MedicationStatement.note.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.note.author[x]",
                "path": "MedicationStatement.note.author[x]",
                "short": "Individual responsible for the annotation",
                "definition": "The individual responsible for making the annotation.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Annotation.author[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
                    },
                    {
                        "code": "string"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "N/A"
                    },
                    {
                        "identity": "rim",
                        "map": "Act.participant[typeCode=AUT].role"
                    }
                ]
            },
            {
                "id": "MedicationStatement.note.time",
                "path": "MedicationStatement.note.time",
                "short": "When the annotation was made",
                "definition": "Indicates when this particular annotation was made.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Annotation.time",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "dateTime"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "N/A"
                    },
                    {
                        "identity": "rim",
                        "map": "Act.effectiveTime"
                    }
                ]
            },
            {
                "id": "MedicationStatement.note.text",
                "path": "MedicationStatement.note.text",
                "short": "The annotation  - text content",
                "definition": "The text of the annotation.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Annotation.text",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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.text"
                    }
                ]
            },
            {
                "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": 1,
                "max": "*",
                "base": {
                    "path": "MedicationStatement.dosage",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Dosage"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.id",
                "path": "MedicationStatement.dosage.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.extension",
                "path": "MedicationStatement.dosage.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.sequence",
                "path": "MedicationStatement.dosage.sequence",
                "short": "The order of the dosage instructions",
                "definition": "Indicates the order in which the dosage instructions should be applied or interpreted.",
                "comment": "32 bit number; for values larger than this, use decimal",
                "requirements": "If the sequence number of multiple Dosages is the same, then it is implied that the instructions are to be treated as concurrent.  If the sequence number is different, then the Dosages are intended to be sequential.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.sequence",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "integer"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": ".text"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.text",
                "path": "MedicationStatement.dosage.text",
                "short": "Free text dosage instructions e.g. SIG",
                "definition": "Free text dosage instructions e.g. SIG.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "requirements": "Free text dosage instructions can be used for cases where the instructions are too complex to code.  The content of this attribute does not include the name or description of the medication. When coded instructions are present, the free text instructions may still be present for display to humans taking or administering the medication. It is expected that the text instructions will always be populated.  If the dosage.timing attribute is also populated, then the dosage.text should reflect the same information as the timing.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Dosage.text",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": ".text"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.additionalInstruction",
                "path": "MedicationStatement.dosage.additionalInstruction",
                "short": "Supplemental instruction - e.g. \"with meals\"",
                "definition": "Supplemental instruction - e.g. \"with meals\".",
                "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.",
                "requirements": "Additional instruction such as \"Swallow with plenty of water\" which may or may not be coded.",
                "min": 0,
                "max": "*",
                "base": {
                    "path": "Dosage.additionalInstruction",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "AdditionalInstruction"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept identifying additional instructions such as \"take with water\" or \"avoid operating heavy machinery\".",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/additional-instruction-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": ".text"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.patientInstruction",
                "path": "MedicationStatement.dosage.patientInstruction",
                "short": "Patient or consumer oriented instructions",
                "definition": "Instructions in terms that are understood by the patient or consumer.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.patientInstruction",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ],
                "mustSupport": true,
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": ".text"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.timing",
                "path": "MedicationStatement.dosage.timing",
                "short": "When medication should be administered",
                "definition": "When medication should be administered.",
                "comment": "This attribute may not always be populated while the Dosage.text is expected to be populated.  If both are populated, then the Dosage.text should reflect the content of the Dosage.timing.",
                "requirements": "The timing schedule for giving the medication to the patient. The Schedule data type allows many different expressions. For example: \"Every 8 hours\"; \"Three times a day\"; \"1/2 an hour before breakfast for 10 days from 23-Dec 2011:\"; \"15 Oct 2013, 17 Oct 2013 and 1 Nov 2013\".  Sometimes, a rate can imply duration when expressed as total volume / duration (e.g.  500mL/2 hours implies a duration of 2 hours).  However, when rate doesn't imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.timing",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Timing"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "N/A"
                    },
                    {
                        "identity": "rim",
                        "map": "QSET<TS> (GTS)"
                    },
                    {
                        "identity": "rim",
                        "map": ".effectiveTime"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.asNeeded[x]",
                "path": "MedicationStatement.dosage.asNeeded[x]",
                "short": "Take \"as needed\" (for x)",
                "definition": "Indicates whether the Medication is only taken when needed within a specific dosing schedule (Boolean option), or it indicates the precondition for taking the Medication (CodeableConcept).",
                "comment": "Can express \"as needed\" without a reason by setting the Boolean = True.  In this case the CodeableConcept is not populated.  Or you can express \"as needed\" with a reason by including the CodeableConcept.  In this case the Boolean is assumed to be True.  If you set the Boolean to False, then the dose is given according to the schedule and is not \"prn\" or \"as needed\".",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.asNeeded[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "boolean"
                    },
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "MedicationAsNeededReason"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept identifying the precondition that should be met or evaluated prior to consuming or administering a medication dose.  For example \"pain\", \"30 minutes prior to sexual intercourse\", \"on flare-up\" etc.",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/medication-as-needed-reason"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": ".outboundRelationship[typeCode=PRCN].target[classCode=OBS, moodCode=EVN, code=\"as needed\"].value=boolean or codable concept"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.site",
                "path": "MedicationStatement.dosage.site",
                "short": "Body site to administer to",
                "definition": "Body site to administer to.",
                "comment": "If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [body-site-instance](extension-body-site-instance.html).  May be a summary code, or a reference to a very precise definition of the location, or both.",
                "requirements": "A coded specification of the anatomic site where the medication first enters the body.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.site",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "MedicationAdministrationSite"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept describing the site location the medicine enters into or onto the body.",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/approach-site-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": ".approachSiteCode"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route",
                "path": "MedicationStatement.dosage.route",
                "short": "How drug should enter body",
                "definition": "How drug should enter body.",
                "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.",
                "requirements": "A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.route",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "RouteOfAdministration"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/route-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": ".routeCode"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.id",
                "path": "MedicationStatement.dosage.route.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.extension",
                "path": "MedicationStatement.dosage.route.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding",
                "path": "MedicationStatement.dosage.route.coding",
                "slicing": {
                    "discriminator":  [
                        {
                            "type": "value",
                            "path": "system"
                        }
                    ],
                    "ordered": false,
                    "rules": "open"
                },
                "short": "Code defined by a terminology system",
                "definition": "A reference to a code defined by a terminology system.",
                "comment": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.",
                "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
                "min": 0,
                "max": "*",
                "base": {
                    "path": "CodeableConcept.coding",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Coding"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
                    },
                    {
                        "identity": "rim",
                        "map": "CV"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
                    },
                    {
                        "identity": "v2",
                        "map": "C*E.1-8, C*E.10-22"
                    },
                    {
                        "identity": "rim",
                        "map": "union(., ./translation)"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT",
                "path": "MedicationStatement.dosage.route.coding",
                "sliceName": "snomedCT",
                "short": "Code defined by a terminology system",
                "definition": "A reference to a code defined by a terminology system.",
                "comment": "Codes may be defined very casually in enumerations, or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.  Ordering of codings is undefined and SHALL NOT be used to infer meaning. Generally, at most only one of the coding values will be labeled as UserSelected = true.",
                "requirements": "Allows for translations and alternate encodings within a code system.  Also supports communication of the same instance to systems requiring different encodings.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "CodeableConcept.coding",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Coding"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "example",
                    "description": "A code from the SNOMED Clinical Terminology UK coding system that describes the e-Prescribing route of administration.",
                    "valueSetReference": {
                        "reference": "https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationDosageRoute-1"
                    }
                },
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
                    },
                    {
                        "identity": "rim",
                        "map": "CV"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
                    },
                    {
                        "identity": "v2",
                        "map": "C*E.1-8, C*E.10-22"
                    },
                    {
                        "identity": "rim",
                        "map": "union(., ./translation)"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.coding rdfs:subPropertyOf dt:CD.coding"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.id",
                "path": "MedicationStatement.dosage.route.coding.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension",
                "path": "MedicationStatement.dosage.route.coding.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID",
                "path": "MedicationStatement.dosage.route.coding.extension",
                "sliceName": "snomedCTDescriptionID",
                "short": "The SNOMED CT Description ID for the display",
                "definition": "The SNOMED CT Description ID for the display.",
                "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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.id",
                "path": "MedicationStatement.dosage.route.coding.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension",
                "path": "MedicationStatement.dosage.route.coding.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": 1,
                "max": "*",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId",
                "path": "MedicationStatement.dosage.route.coding.extension.extension",
                "sliceName": "descriptionId",
                "short": "The SNOMED CT Description ID",
                "definition": "May be used to represent additional information that is not part of the basic definition of the element. 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": 1,
                "max": "1",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.id",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.extension",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.url",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "descriptionId",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueId",
                "sliceName": "valueId",
                "short": "The SNOMED CT Description ID",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "id"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId.id",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueId.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId.extension",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueId.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionId.value[x]:valueId.value",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueId.value",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "Primitive value for id",
                "definition": "Primitive value for id",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "string.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "extension":  [
                            {
                                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-regex",
                                "valueString": "[A-Za-z0-9\\-\\.]{1,64}"
                            }
                        ],
                        "_code": {
                            "extension":  [
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type",
                                    "valueString": "string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type",
                                    "valueString": "xsd:string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type",
                                    "valueString": "xsd:string"
                                }
                            ]
                        }
                    }
                ],
                "maxLength": 1048576
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay",
                "path": "MedicationStatement.dosage.route.coding.extension.extension",
                "sliceName": "descriptionDisplay",
                "short": "The SNOMED CT display for the description ID",
                "definition": "May be used to represent additional information that is not part of the basic definition of the element. 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": "1",
                "base": {
                    "path": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.id",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.extension",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.url",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "descriptionDisplay",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueString",
                "sliceName": "valueString",
                "short": "The SNOMED CT display for the description ID",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString.id",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueString.id",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "xml:id (or equivalent in JSON)",
                "definition": "unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Element.id",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString.extension",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueString.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "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 element. 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": "Element.extension",
                    "min": 0,
                    "max": "*"
                },
                "type":  [
                    {
                        "code": "Extension"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    },
                    {
                        "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')])",
                        "source": "http://hl7.org/fhir/StructureDefinition/Extension"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.extension:descriptionDisplay.value[x]:valueString.value",
                "path": "MedicationStatement.dosage.route.coding.extension.extension.valueString.value",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "Primitive value for string",
                "definition": "Primitive value for string",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "string.value",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "_code": {
                            "extension":  [
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-json-type",
                                    "valueString": "string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-xml-type",
                                    "valueString": "xsd:string"
                                },
                                {
                                    "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-rdf-type",
                                    "valueString": "xsd:string"
                                }
                            ]
                        }
                    }
                ],
                "maxLength": 1048576
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.url",
                "path": "MedicationStatement.dosage.route.coding.extension.url",
                "representation":  [
                    "xmlAttr"
                ],
                "short": "identifies the meaning of the extension",
                "definition": "Source of the definition for the extension code - a logical name or a URL.",
                "comment": "The definition may point directly to a computable or human-readable definition of the extensibility codes, or it may be a logical URI as declared in some other specification. The definition SHALL be a URI for the Structure Definition defining the extension.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Extension.url",
                    "min": 1,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID.value[x]",
                "path": "MedicationStatement.dosage.route.coding.extension.value[x]",
                "short": "Value of extension",
                "definition": "Value of extension - may be a resource or one of a constrained set of the data types (see Extensibility in the spec for list).",
                "min": 0,
                "max": "0",
                "base": {
                    "path": "Extension.value[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "base64Binary"
                    },
                    {
                        "code": "boolean"
                    },
                    {
                        "code": "code"
                    },
                    {
                        "code": "date"
                    },
                    {
                        "code": "dateTime"
                    },
                    {
                        "code": "decimal"
                    },
                    {
                        "code": "id"
                    },
                    {
                        "code": "instant"
                    },
                    {
                        "code": "integer"
                    },
                    {
                        "code": "markdown"
                    },
                    {
                        "code": "oid"
                    },
                    {
                        "code": "positiveInt"
                    },
                    {
                        "code": "string"
                    },
                    {
                        "code": "time"
                    },
                    {
                        "code": "unsignedInt"
                    },
                    {
                        "code": "uri"
                    },
                    {
                        "code": "Address"
                    },
                    {
                        "code": "Age"
                    },
                    {
                        "code": "Annotation"
                    },
                    {
                        "code": "Attachment"
                    },
                    {
                        "code": "CodeableConcept"
                    },
                    {
                        "code": "Coding"
                    },
                    {
                        "code": "ContactPoint"
                    },
                    {
                        "code": "Count"
                    },
                    {
                        "code": "Distance"
                    },
                    {
                        "code": "Duration"
                    },
                    {
                        "code": "HumanName"
                    },
                    {
                        "code": "Identifier"
                    },
                    {
                        "code": "Money"
                    },
                    {
                        "code": "Period"
                    },
                    {
                        "code": "Quantity"
                    },
                    {
                        "code": "Range"
                    },
                    {
                        "code": "Ratio"
                    },
                    {
                        "code": "Reference"
                    },
                    {
                        "code": "SampledData"
                    },
                    {
                        "code": "Signature"
                    },
                    {
                        "code": "Timing"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ],
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "rim",
                        "map": "N/A"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.system",
                "path": "MedicationStatement.dosage.route.coding.system",
                "short": "Identity of the terminology system",
                "definition": "The identification of the code system that defines the meaning of the symbol in the code.",
                "comment": "The URI may be an OID (urn:oid:...) or a UUID (urn:uuid:...).  OIDs and UUIDs SHALL be references to the HL7 OID registry. Otherwise, the URI should come from HL7's list of FHIR defined special URIs or it should de-reference to some definition that establish the system clearly and unambiguously.",
                "requirements": "Need to be unambiguous about the source of the definition of the symbol.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Coding.system",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "uri"
                    }
                ],
                "fixedUri": "http://snomed.info/sct",
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "C*E.3"
                    },
                    {
                        "identity": "rim",
                        "map": "./codeSystem"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding.system rdfs:subPropertyOf dt:CDCoding.codeSystem"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.version",
                "path": "MedicationStatement.dosage.route.coding.version",
                "short": "Version of the system - if relevant",
                "definition": "The version of the code system which was used when choosing this code. Note that a well-maintained code system does not need the version reported, because the meaning of codes is consistent across versions. However this cannot consistently be assured. and when the meaning is not guaranteed to be consistent, the version SHOULD be exchanged.",
                "comment": "Where the terminology does not clearly define what string should be used to identify code system versions, the recommendation is to use the date (expressed in FHIR date format) on which that version was officially published as the version date.",
                "min": 0,
                "max": "0",
                "base": {
                    "path": "Coding.version",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "C*E.7"
                    },
                    {
                        "identity": "rim",
                        "map": "./codeSystemVersion"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding.version rdfs:subPropertyOf dt:CDCoding.codeSystemVersion"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.code",
                "path": "MedicationStatement.dosage.route.coding.code",
                "short": "Symbol in syntax defined by the system",
                "definition": "A symbol in syntax defined by the system. The symbol may be a predefined code or an expression in a syntax defined by the coding system (e.g. post-coordination).",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "requirements": "Need to refer to a particular code in the system.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Coding.code",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "code"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "C*E.1"
                    },
                    {
                        "identity": "rim",
                        "map": "./code"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding.code rdfs:subPropertyOf dt:CDCoding.code"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.display",
                "extension":  [
                    {
                        "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
                        "valueBoolean": true
                    }
                ],
                "path": "MedicationStatement.dosage.route.coding.display",
                "short": "Representation defined by the system",
                "definition": "A representation of the meaning of the code in the system, following the rules of the system.",
                "comment": "Note that FHIR strings may not exceed 1MB in size",
                "requirements": "Need to be able to carry a human-readable meaning of the code for readers that do not know  the system.",
                "min": 1,
                "max": "1",
                "base": {
                    "path": "Coding.display",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "C*E.2 - but note this is not well followed"
                    },
                    {
                        "identity": "rim",
                        "map": "CV.displayName"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding.display rdfs:subPropertyOf dt:CDCoding.displayName"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.userSelected",
                "path": "MedicationStatement.dosage.route.coding.userSelected",
                "short": "If this coding was chosen directly by the user",
                "definition": "Indicates that this coding was chosen by a user directly - i.e. off a pick list of available items (codes or displays).",
                "comment": "Amongst a set of alternatives, a directly chosen code is the most appropriate starting point for new translations. There is some ambiguity about what exactly 'directly chosen' implies, and trading partner agreement may be needed to clarify the use of this element and its consequences more completely.",
                "requirements": "This has been identified as a clinical safety criterium - that this exact system/code pair was chosen explicitly, rather than inferred by the system based on some rules or language processing.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Coding.userSelected",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "boolean"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "Sometimes implied by being first"
                    },
                    {
                        "identity": "rim",
                        "map": "CD.codingRationale"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:Coding.userSelected fhir:mapsTo dt:CDCoding.codingRationale. fhir:Coding.userSelected fhir:hasMap fhir:Coding.userSelected.map. fhir:Coding.userSelected.map a fhir:Map;   fhir:target dt:CDCoding.codingRationale. fhir:Coding.userSelected\\#true a [     fhir:source \"true\";     fhir:target dt:CDCoding.codingRationale\\#O   ]"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.text",
                "extension":  [
                    {
                        "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
                        "valueBoolean": true
                    }
                ],
                "path": "MedicationStatement.dosage.route.text",
                "short": "Plain text representation of the concept",
                "definition": "A human language representation of the concept as seen/selected/uttered by the user who entered the data and/or which represents the intended meaning of the user.",
                "comment": "Very often the text is the same as a displayName of one of the codings.",
                "requirements": "The codes from the terminologies do not always capture the correct meaning with all the nuances of the human using them, or sometimes there is no appropriate code at all. In these cases, the text is used to capture the full meaning of the source.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "CodeableConcept.text",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "string"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": "C*E.9. But note many systems use C*E.2 for this"
                    },
                    {
                        "identity": "rim",
                        "map": "./originalText[mediaType/code=\"text/plain\"]/data"
                    },
                    {
                        "identity": "orim",
                        "map": "fhir:CodeableConcept.text rdfs:subPropertyOf dt:CD.originalText"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.method",
                "path": "MedicationStatement.dosage.method",
                "short": "Technique for administering medication",
                "definition": "Technique for administering medication.",
                "comment": "Terminologies used often pre-coordinate this term with the route and or form of administration.",
                "requirements": "A coded value indicating the method by which the medication is introduced into or onto the body. Most commonly used for injections.  For examples, Slow Push; Deep IV.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.method",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "CodeableConcept"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": {
                    "extension":  [
                        {
                            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
                            "valueString": "MedicationAdministrationMethod"
                        }
                    ],
                    "strength": "example",
                    "description": "A coded concept describing the technique by which the medicine is administered.",
                    "valueSetReference": {
                        "reference": "http://hl7.org/fhir/ValueSet/administration-method-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": ".doseQuantity"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.dose[x]",
                "path": "MedicationStatement.dosage.dose[x]",
                "short": "Amount of medication per dose",
                "definition": "Amount of medication per dose.",
                "comment": "Note that this specifies the quantity of the specified medication, not the quantity for each active ingredient(s). Each ingredient amount can be communicated in the Medication resource. For example, if one wants to communicate that a tablet was 375 mg, where the dose was one tablet, you can use the Medication resource to document that the tablet was comprised of 375 mg of drug XYZ. Alternatively if the dose was 375 mg, then you may only need to use the Medication resource to indicate this was a tablet. If the example were an IV such as dopamine and you wanted to communicate that 400mg of dopamine was mixed in 500 ml of some IV solution, then this would all be communicated in the Medication resource. If the administration is not intended to be instantaneous (rate is present or timing has a duration), this can be specified to convey the total amount to be administered over the period of time as indicated by the schedule e.g. 500 ml in dose, with timing used to convey that this should be done over 4 hours.",
                "requirements": "The amount of therapeutic or other substance given at one administration event.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.dose[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Range"
                    },
                    {
                        "code": "Quantity",
                        "profile": "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": ".doseQuantity"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.maxDosePerPeriod",
                "path": "MedicationStatement.dosage.maxDosePerPeriod",
                "short": "Upper limit on medication per unit of time",
                "definition": "Upper limit on medication per unit of time.",
                "comment": "This is intended for use as an adjunct to the dosage when there is an upper cap.  For example \"2 tablets every 4 hours to a maximum of 8/day\".",
                "requirements": "The maximum total quantity of a therapeutic substance that may be administered to a subject over the period of time.  For example, 1000mg in 24 hours.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.maxDosePerPeriod",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Ratio"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Ratio"
                    },
                    {
                        "key": "rat-1",
                        "severity": "error",
                        "human": "Numerator and denominator SHALL both be present, or both are absent. If both are absent, there SHALL be some extension present",
                        "expression": "(numerator.empty() xor denominator.exists()) and (numerator.exists() or extension.exists())",
                        "xpath": "(count(f:numerator) = count(f:denominator)) and ((count(f:numerator) > 0) or (count(f:extension) > 0))",
                        "source": "http://hl7.org/fhir/StructureDefinition/Ratio"
                    }
                ],
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "N/A"
                    },
                    {
                        "identity": "rim",
                        "map": "RTO"
                    },
                    {
                        "identity": "rim",
                        "map": ".maxDoseQuantity"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.maxDosePerAdministration",
                "path": "MedicationStatement.dosage.maxDosePerAdministration",
                "short": "Upper limit on medication per administration",
                "definition": "Upper limit on medication per administration.",
                "comment": "This is intended for use as an adjunct to the dosage when there is an upper cap.  For example, a body surface area related dose with a maximum amount, such as 1.5 mg/m2 (maximum 2 mg) IV over 5 – 10 minutes would have doseQuantity of 1.5 mg/m2 and maxDosePerAdministration of 2 mg.",
                "requirements": "The maximum total quantity of a therapeutic substance that may be administered to a subject per administration.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.maxDosePerAdministration",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Quantity",
                        "profile": "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
                    },
                    {
                        "key": "qty-3",
                        "severity": "error",
                        "human": "If a code for the unit is present, the system SHALL also be present",
                        "expression": "code.empty() or system.exists()",
                        "xpath": "not(exists(f:code)) or exists(f:system)",
                        "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
                    },
                    {
                        "key": "sqty-1",
                        "severity": "error",
                        "human": "The comparator is not used on a SimpleQuantity",
                        "expression": "comparator.empty()",
                        "xpath": "not(exists(f:comparator))",
                        "source": "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
                    }
                ],
                "isModifier": false,
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "SN (see also Range) or CQ"
                    },
                    {
                        "identity": "rim",
                        "map": "PQ, IVL<PQ>, MO, CO, depending on the values"
                    },
                    {
                        "identity": "rim",
                        "map": "not supported"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.maxDosePerLifetime",
                "path": "MedicationStatement.dosage.maxDosePerLifetime",
                "short": "Upper limit on medication per lifetime of the patient",
                "definition": "Upper limit on medication per lifetime of the patient.",
                "comment": "The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator.",
                "requirements": "The maximum total quantity of a therapeutic substance that may be administered per lifetime of the subject.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.maxDosePerLifetime",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Quantity",
                        "profile": "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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",
                        "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
                    },
                    {
                        "key": "qty-3",
                        "severity": "error",
                        "human": "If a code for the unit is present, the system SHALL also be present",
                        "expression": "code.empty() or system.exists()",
                        "xpath": "not(exists(f:code)) or exists(f:system)",
                        "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
                    },
                    {
                        "key": "sqty-1",
                        "severity": "error",
                        "human": "The comparator is not used on a SimpleQuantity",
                        "expression": "comparator.empty()",
                        "xpath": "not(exists(f:comparator))",
                        "source": "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
                    }
                ],
                "isModifier": false,
                "isSummary": true,
                "mapping":  [
                    {
                        "identity": "rim",
                        "map": "n/a"
                    },
                    {
                        "identity": "v2",
                        "map": "SN (see also Range) or CQ"
                    },
                    {
                        "identity": "rim",
                        "map": "PQ, IVL<PQ>, MO, CO, depending on the values"
                    },
                    {
                        "identity": "rim",
                        "map": "not supported"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.rate[x]",
                "path": "MedicationStatement.dosage.rate[x]",
                "short": "Amount of medication per unit of time",
                "definition": "Amount of medication per unit of time.",
                "comment": "It is possible to supply both a rate and a doseQuantity to provide full details about how the medication is to be administered and supplied. If the rate is intended to change over time, depending on local rules/regulations, each change should be captured as a new version of the MedicationRequest with an updated rate, or captured with a new MedicationRequest with the new rate.",
                "requirements": "Identifies the speed with which the medication was or will be introduced into the patient. Typically the rate for an infusion e.g. 100 ml per 1 hour or 100 ml/hr.  May also be expressed as a rate per unit of time e.g. 500 ml per 2 hours.   Other examples: 200 mcg/min or 200 mcg/1 minute; 1 liter/8 hours.  Sometimes, a rate can imply duration when expressed as total volume / duration (e.g.  500mL/2 hours implies a duration of 2 hours).  However, when rate doesn't imply duration (e.g. 250mL/hour), then the timing.repeat.duration is needed to convey the infuse over time period.",
                "min": 0,
                "max": "1",
                "base": {
                    "path": "Dosage.rate[x]",
                    "min": 0,
                    "max": "1"
                },
                "type":  [
                    {
                        "code": "Ratio"
                    },
                    {
                        "code": "Range"
                    },
                    {
                        "code": "Quantity",
                        "profile": "http://hl7.org/fhir/StructureDefinition/SimpleQuantity"
                    }
                ],
                "condition":  [
                    "ele-1"
                ],
                "constraint":  [
                    {
                        "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": ".rateQuantity"
                    }
                ]
            }
        ]
    },
    "differential": {
        "element":  [
            {
                "id": "MedicationStatement.meta",
                "path": "MedicationStatement.meta"
            },
            {
                "id": "MedicationStatement.meta.profile",
                "path": "MedicationStatement.meta.profile",
                "min": 1
            },
            {
                "id": "MedicationStatement.extension",
                "path": "MedicationStatement.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "type": "value",
                            "path": "url"
                        }
                    ],
                    "rules": "open"
                },
                "min": 1
            },
            {
                "id": "MedicationStatement.extension:lastIssueDate",
                "path": "MedicationStatement.extension",
                "sliceName": "lastIssueDate",
                "min": 0,
                "max": "1",
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1"
                    }
                ],
                "mustSupport": true
            },
            {
                "id": "MedicationStatement.extension:changeSummary",
                "path": "MedicationStatement.extension",
                "sliceName": "changeSummary",
                "short": "Optional Extensions Element",
                "definition": "Optional Extension Element - found in all resources.",
                "min": 0,
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:prescribingAgency",
                "path": "MedicationStatement.extension",
                "sliceName": "prescribingAgency",
                "short": "The type of organisation/setting responsible for authorising and issuing the medication",
                "definition": "The type of organisation/setting responsible for authorising and issuing the medication.",
                "min": 1,
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged",
                "path": "MedicationStatement.extension",
                "sliceName": "dosageLastChanged",
                "short": "The date when the dosage instructions were last changed",
                "definition": "Only populate where the dosage instructions have been changed during the lifetime of the Medication/Medical Device plan.\nSet to the date when the dosage instructions were last changed.",
                "min": 0,
                "max": "1",
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.extension:dosageLastChanged.url",
                "path": "MedicationStatement.extension.url",
                "fixedUri": "https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1"
            },
            {
                "id": "MedicationStatement.identifier",
                "path": "MedicationStatement.identifier",
                "min": 1
            },
            {
                "id": "MedicationStatement.identifier.system",
                "path": "MedicationStatement.identifier.system",
                "min": 1
            },
            {
                "id": "MedicationStatement.identifier.value",
                "path": "MedicationStatement.identifier.value",
                "min": 1
            },
            {
                "id": "MedicationStatement.basedOn",
                "path": "MedicationStatement.basedOn",
                "max": "1",
                "type":  [
                    {
                        "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"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationRequest-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.partOf",
                "path": "MedicationStatement.partOf",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationAdministration"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/MedicationDispense"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Procedure-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.context",
                "path": "MedicationStatement.context",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/EpisodeOfCare"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Encounter-1"
                    }
                ],
                "mustSupport": true
            },
            {
                "id": "MedicationStatement.medication[x]",
                "path": "MedicationStatement.medication[x]",
                "type":  [
                    {
                        "code": "CodeableConcept"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Medication-1"
                    }
                ],
                "binding": {
                    "strength": "example",
                    "valueSetUri": "http://hl7.org/fhir/ValueSet/medication-codes"
                }
            },
            {
                "id": "MedicationStatement.effective[x]",
                "path": "MedicationStatement.effective[x]",
                "mustSupport": true
            },
            {
                "id": "MedicationStatement.dateAsserted",
                "path": "MedicationStatement.dateAsserted",
                "min": 1
            },
            {
                "id": "MedicationStatement.informationSource",
                "path": "MedicationStatement.informationSource",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Organization-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.subject",
                "path": "MedicationStatement.subject",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/Group"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.reasonReference",
                "path": "MedicationStatement.reasonReference",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Observation-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.hl7.org.uk/STU3/StructureDefinition/CareConnect-Condition-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.note",
                "path": "MedicationStatement.note",
                "mustSupport": true
            },
            {
                "id": "MedicationStatement.note.author[x]",
                "path": "MedicationStatement.note.author[x]",
                "type":  [
                    {
                        "code": "Reference",
                        "targetProfile": "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
                    },
                    {
                        "code": "string"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Patient-1"
                    },
                    {
                        "code": "Reference",
                        "targetProfile": "https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-Practitioner-1"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage",
                "path": "MedicationStatement.dosage",
                "min": 1
            },
            {
                "id": "MedicationStatement.dosage.text",
                "path": "MedicationStatement.dosage.text",
                "min": 1
            },
            {
                "id": "MedicationStatement.dosage.patientInstruction",
                "path": "MedicationStatement.dosage.patientInstruction",
                "mustSupport": true
            },
            {
                "id": "MedicationStatement.dosage.route.coding",
                "path": "MedicationStatement.dosage.route.coding",
                "slicing": {
                    "discriminator":  [
                        {
                            "type": "value",
                            "path": "system"
                        }
                    ],
                    "ordered": false,
                    "rules": "open"
                }
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT",
                "path": "MedicationStatement.dosage.route.coding",
                "sliceName": "snomedCT",
                "max": "1",
                "binding": {
                    "strength": "example",
                    "description": "A code from the SNOMED Clinical Terminology UK coding system that describes the e-Prescribing route of administration.",
                    "valueSetReference": {
                        "reference": "https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationDosageRoute-1"
                    }
                }
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension",
                "path": "MedicationStatement.dosage.route.coding.extension",
                "slicing": {
                    "discriminator":  [
                        {
                            "type": "value",
                            "path": "url"
                        }
                    ],
                    "rules": "open"
                },
                "min": 0
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.extension:snomedCTDescriptionID",
                "path": "MedicationStatement.dosage.route.coding.extension",
                "sliceName": "snomedCTDescriptionID",
                "min": 0,
                "type":  [
                    {
                        "code": "Extension",
                        "profile": "https://fhir.nhs.uk/STU3/StructureDefinition/Extension-coding-sctdescid"
                    }
                ]
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.system",
                "path": "MedicationStatement.dosage.route.coding.system",
                "min": 1,
                "fixedUri": "http://snomed.info/sct"
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.version",
                "path": "MedicationStatement.dosage.route.coding.version",
                "max": "0"
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.code",
                "path": "MedicationStatement.dosage.route.coding.code",
                "min": 1
            },
            {
                "id": "MedicationStatement.dosage.route.coding:snomedCT.display",
                "path": "MedicationStatement.dosage.route.coding.display",
                "min": 1
            }
        ]
    }
}


Background

What is a MedicationStatement?

A MedicationStatement (despite the potentially confusing name) is not a statement in the traditional sense of a list of items (such as bank statement), and in FHIR R5 it is going to be renamed to MedicationUsage.

The definition of a MedicationStatement from hl7.org is as follows:

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.

A MedicationStatement resource will contain a single line-item of medication, and may contain information from the original MedicationRequest, MedicationDispense or MedicationAdministration if the system populating the resource knows about them.

It is possible; however, to create the resource without this information.

Example

In the diagram below there are three active medications, one completed medication, and a stopped medication.

Note that all of medications are derived from a MedicationStatement - each with varying data-sources.

medication-statement-illustration


Potential data-sources for the MedicationStatement resource

  • Pharmacy System - MedicationRequest
  • Dispensing System - MedicationDispense
  • Patient self-declared - MedicationAdministration
  • ICS Shared Record - MedicationStatement

Data model element usage

Element Use CareConnect (STU3) UK Core (R4)
id
meta.versionId
meta.lastUpdated
meta.profile
meta.security
meta.tag
extension(lastIssueDate)
extension(changeSummary)
extension(prescribingAgency)
extension(dosageLastChanged)
identifier
basedOn
partOf
context
status
category
medicationReference
effective[x]
dateAsserted
informationSource
subject
derivedFrom
taken
reasonNotTaken
reasonCode
reasonReference
note
dosage

id

Usage

Optional

Guidance

The id is the logical identifier for the CareConnect-GPC-Observation-1 profile.

Example
<id value="bfa6215a-e433-4729-9e41-510730df6423" />


meta.versionId

Usage

Optional

Guidance

The population of the meta.versionId element could be useful if sending an adendum of something previously sent to help the consumer (receiver) in understanding there is a "newer" version.

Example
<meta>
    <versionId value="1" />
</meta>


meta.lastUpdated

Usage

Optional

Guidance

The meta.lastUpdated element could be useful alongside the meta.versionIdelement could be useful if sending an adendum of something previously sent to help the consumer (receiver) in understanding there is a "newer" version.

Example
<meta>
    <lastUpdated value="2022-10-28T08:06:00+00:00" />
</meta>


meta.profile

Usage

Mandatory

Guidance

The meta.profile contains a fixed value of the URL for the CareConnect-GPC-MedicationStatement-1 profile.

Example
<meta>
    <profile value="https://fhir.nhs.uk/STU3/StructureDefinition/CareConnect-GPC-MedicationStatement-1" />
</meta>


meta.security

Usage

Optional

Guidance

The security label(s) applicable to the resource.

See Resources not to be disclosed to a patient for more details on how to populate the element.

Example
<meta>
    <security>
        <system value="http://hl7.org/fhir/v3/ActCode"/>
        <code value="NOPAT"/>
        <display value="no disclosure to patient, family or caregivers without attending provider's authorization"/>
    </security>
</meta>


meta.tag

Usage

Optional

Guidance

A use-case for the meta.tag element within GP Connect has not been defined.

Example
<meta>
    <tag>
        <coding>
            <system value="http://hl7.org/fhir/common-tags" />
            <code value="actionable" />
            <display value="Actionable" />
        </coding>
    </tag>
</meta>


extension(lastIssueDate)

Usage

Required

Guidance

The date when the latest prescription under this plan was issued (signed).

Note: The issue information may not be recorded in the GP system if the medication or medical device is a repeat dispense, or has been prescribed elsewhere.
Example
<extension>
    <url value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationStatementLastIssueDate-1" />
    <valueDateTime value="2022-07-07T14:07:48+00:00Z" />
</extension>


extension(changeSummary)

Usage

Optional

Guidance

The extension.changeSummary does not need to be populated.

Example
<extension>
    <url value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-MedicationChangeSummary-1" />
    <extension>
        <id value="4095fcc9-c0ae-4f05-b5db-1fb648fe7bda" />
        <url value="https://fhir.nhs.uk/STU3/ValueSet/CareConnect-MedicationChangeStatus-1" />
        <valueCode value="Amended" />        
    </extension>
    <extension>
        <id value="4095fcc9-c0ae-4f05-b5db-1fb648fe7bda" />
        <url value="indicationForChange" />
        <valueCodeableConcept>
            <coding>
                <system value="http://snomed.info/sct" />
                <code value="294091000119104" />
                <display value="Headache caused by drug (finding)" />
            </coding>
        </valueCodeableConcept>  
    </extension>
    <extension>
        <id value="4095fcc9-c0ae-4f05-b5db-1fb648fe7bda" />
        <url value="dateChanged" />
        <valueDateTime value="2022-02-23T14:07:48+00:00" />
    </extension>
    <extension>
        <id value="4095fcc9-c0ae-4f05-b5db-1fb648fe7bda" />
        <url value="detailsOfAmendment" />
        <valueString value="Amended as patient reported side-effects of headaches" />
    </extension>
</extension>


extension(prescribingAgency)

Usage

Mandatory

Guidance

This details the care setting in which the medication or medical device was prescribed taken from the CareConnect Prescribing Agency ValueSet.

Currently this field will only support two coded entries, indicating whether the medication / medical device was prescribed by the GP practice or by another organisation. If the providing organisation has more details about the type of prescribing organisation (for example, that it was a dental practice or hospital), this MUST be included in the CodeableConcept.text field.

In the future, the coded valueset will be built on to be more specific about where a medication / medical device was prescribed. For instance, if the patient was prescribed a medication by a hospital or bought a medication over the counter then this would be coded as well as in the text.

For repeat and repeat dispensed medications / medical devices, the value identifies the care setting where the medication plan (rather than any specific issue in the plan) was authorised.

Example
<extension>
    <url value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
    <valueCodeableConcept>
        <system value="https://fhir.nhs.uk/STU3/StructureDefinition/Extension-CareConnect-GPC-PrescribingAgency-1" />
        <coding value="prescribed-at-gp-practice">
        <text value="Prescribed at GP practice" />
    </valueCodeableConcept>
</extension>


extension(dosageLastChanged)

Usage

Optional

Guidance

The extension.dosageLastChanged does not need to be populated.

Example
<extension>
    <url value="https://fhir.hl7.org.uk/STU3/StructureDefinition/Extension-CareConnect-MedicationDosageLastChanged-1" />
    <valueDateTime value="2022-10-28T10:57:00+00:00Z" />
</extension>


identifier

Usage

Mandatory

Guidance

The identifier element MUST be populated with a globally unique and persistent identifier (that is, it doesn’t change between requests and therefore stored with the source data). This MUST be scoped by a provider specific namespace for the identifier.

Where consuming systems are integrating data from this resource to their local system, they MUST also persist this identifier at the same time.

Example
<identifier>
    <system value="https://tools.ietf.org/html/rfc4122" />
    <value value="653c0790-a509-4eed-99f3-f42f3683cf2e" />
</identifier>


basedOn

Usage

Required

Guidance

This element should normally be used to link to a MedicationRequest which authorised the medication.

This element could also potentially reference all medication requests relating to the medication or relevant instances of CarePlan or ServiceRequest.

This should not be confused with MedicationStatement.derivedFrom which should only be used to reference information that can’t be referenced here.

Note: For GP Connect, each `MedicationStatement` MUST be based on a MedicationRequest with intent set to plan.
Example
<basedOn>
    <reference value="medication-request-5485984" />
</basedOn>


partOf

Usage

Optional

Guidance

This should not be used as the use-case and purpose is ambiguous.

Example
<partOf>
    <reference value="medication-administration-07637tys" />
</partOf>


context

Usage

Required

Guidance

A reference (if known) to either a CareConnect:

Example
<context>
    <reference value="encounter-0012345" />
</context>


status

Usage

Mandatory

Guidance
Important: This is the next most important element of a MedicationStatement after the Medication.

It provides the consumer with information to determine if the medication is relevant for their use case.

For example: whether the medication deemed 'current' (or active).

Status FHIR Definition Recommendation
active The medication is still being taken. It is believed the medication is active in the patients system.
completed The medication is no longer being taken. A course of medication has been completed and the medication is not active in the patients system.
entered-in-error The statement was recorded incorrectly. Indicates the MedicationStatement is INVALID. It is not expected that a MedicationStatement with this status to be included in exchanges.
intended The medication may be taken at some time in the future. It is intended that the medication will be given to the patient. When this is used effective[x] MUST indicate when it is intended that the medication to be taken.
stopped Actions implied by the statement have been permanently halted, before all of them occurred. Medication has been stopped before the completion of the prescribed course and there is no plan to restart it. When used the reason MUST be indicated in statusReason.
on-hold Actions implied by the statement have been temporarily halted, but are expected to continue later. May also be called "suspended". Medication has been temporarily stopped.
When used the reason MUST be indicated in statusReason.
Where it is known when it is indented to restart it this may be indicated in statusReason.
unknown Not implemented within STU3 The patient may have had some encounter with this medication, but the current status is unknown. It is not expected that this status be avoided.
not-taken Not implemented within STU3 The patient has not taken the medication as prescribed.

Statuses expanded

Important: Determining the value of this element when constructing the resource.

The status will need to be calculated if the basedOn or partOf elements within the profile are defined.

A MedicationStatement represents a snapshot in time of a patient medication - and if the status has not been provided, then the following business rule may apply to compute the state.

Status How it can be determined
active
  • A completed MedicationRequest (if known) where the current date is between the dispenseRequest.validityPeriod element. The MedicationStatement.effectivePeriod element should reflect this information.
  • Where the current date is between the MedicationStatement.effectivePeriod
completed
  • Where the current date is after the MedicationStatement.effectivePeriod
  • A completed MedicationRequest (if known) where the dispenseRequest element is either not defined, or the current date is greater than the dispenseRequest.validityPeriod.
Example
<status value="active" />


category

Usage

Required

Guidance

A value taken from the UKCoreMedicationStatementCategory valueset

Example
<category>
    <system value="http://hl7.org/fhir/medication-statement-category" />
    <code value ="inpatient" />
    <display value="Inpatient" />
</category>


medicationReference

Usage

Mandatory

Guidance
Important: Determining the value of this element when constructing the resource.
When the MedicationRequest and MedicationDispense are known

If the basedOn (medication request) and partOf (medication dispense) elements are known, and defined within the MedicationStatement, then care should be taken as to how the medication[x] element is populated.

If substitution is allowed within the MedicationRequest resource then the medicine dispensed may differ to the request. In this case, this element must reflect the dispensed medication in the MedicationDispense resource.

Also note that the dosageInstruction may differ from what was originally requested.

Even if substution is not allowed, it may be prudent to check that medication requested is equal to what was dispensed.


When the MedicataionRequest or MedicationDispsnese are not known

The medication component should be constructed by the information provided from the source.

Example
<medicationReference>
    <identifier>
        <system value="https://simplifier.net/gpconnect2" />
        <value value="example--gpc-data-model--medication-request" />
    </identifier>
</medicationReference>


effective[x]

Usage (Conditional)

Required

Guidance

The period the medication or medical device is authorised under this medication/medical device plan. For items that are repeats and repeat dispensed this refers to the entire cycle of prescriptions made under the authorisation. For acutes, this refers to the period of the prescription issue.

This element is especially required when the status is intended.

Either:

  • effectiveDateTime a date time at which the medication started or should start
  • effectivePeriod the period over which the patient has taken or should take the medication

The use of effectivePeriod is to be preferred, and should start when the medication started in any preceding episode of care.

The date / time format allows various degrees of date resolution; year, year/month and exact date so an approximate date can be used when the exact date is not known.

This could be either backdated or future dated.

Note: Where the end date is unknown it may be omitted.
Examples
<effectiveDateTime value="2022-09-23T09:04:00Z" />

<effectivePeriod>
    <start value="2022-09-23T09:04:00Z" />
    <end value="2022-09-30T23:59:59Z" />
</effectivePeriod>


dateAsserted

Usage

Mandatory

Guidance

When this medication statement was created by the clinician.

This is the date/time when the prescription was authorised by the clinician. Usually this is when the prescription is added to the record but it may be backdated.

Example
<dateAsserted value="2022-09-23T09:11:00Z" />


informationSource

Usage

Required

Guidance

Referencing an `Organization resource is likely to be more useful than a person, as a Practitioner resource, as people’s work patterns and employers may be variable while the care setting organisation will be constantly available.

When referencing an organisation - the following must be provided:

  • Oraganization.contact.name
  • Organization.contact.telecom
  • Organisation.identifier.odsOrganizationCode or Organization.identifier.odsSiteCode

Where the organisation is an Acute Trust, an ODS Site Code may be more useful than the parent Trust-wide ODS organisation code.

Example
<informationSource>
    <reference value="oraganization-1234" />
</informationSource>


subject

Usage

Mandatory

Guidance

A refernce to the patient that the medication statement relates to.

Profile: CareConnect-GPC-Patient-1

Example
<subject>
    <reference value="patient-7890" />
</subject>


derivedFrom

Usage

Optional

Guidance

A use-case for populating the derivedFrom element within GP Connect has not been defined, as it is expected that the the basedOn element will suffice.

Warning: Population of both derivedFrom and baseOn elements should be avoided as potentially confusing.
Example
<derivedFrom>
    <reference value="resource-any-11ks8f" />
</derivedFrom>


taken

Usage

Mandatory

Guidance
Warning: This element has been removed in the FHIR R4 standard.

A mandatory element that needs to be supplied due to the cardinality if using STU3 / CareConnect.

It is expected that, in most cases, the administration of medication cannot be confirmed and will be the following code: unk (Unknown) from the MedicationStatementTaken ValueSet.

Note: If the administration of medication is known, then it SHOULD be provided.
Example
<taken value="unk" />


reasonNotTaken

Usage

Optional

Guidance
Warning: This element has been removed in the FHIR R4 standard.

It's expected that in most cases that this value WILL NOT be populated. This is due to the information not necessarily being known in the GP system.

This element would typically be populated if the value in the taken element is n (Negative assertion that patient has not taken medication).

Example
<reasonNotTaken>
    <system value="http://snomed.info/sct" />
    <value value="182864000" />
    <display value="Drug not taken - side-effects" />
</reasonNotTaken>


reasonCode

Usage

Optional

Guidance
Note: This information may be available by linking to a problem record.

The indication(s) for the medicine as a CodableConcept More detail could be provided by the use or ReasonReference from the SNOMED-CT hierarchy as a descendant of the concept 404684003 | Clinical finding (finding) |.

Example
<reasonCode>
    <coding>
        <system value="http://snomed.info/sct" />
        <code value="1685005" />
        <display value="Rat bite fever" />
    </coding>
</reasonCode>


reasonReference

Usage

Optional

Guidance
Note: This information may be available by linking to a problem record.
Example
<reasonReference>
    <reference value="condition-85624" />
</reasonReference>


note

Usage

Required

Guidance

All notes that are associated with this medication / medical device record.

Note: All patient notes and prescriber notes at authorisation(plan) and issue(order) level MUST be included in this field. They MUST be concatenated and indicate the level the notes come from (for example, First Issue) and be prefixed with either "Patient Notes:" or "Prescriber Notes:" as appropriate.
Example
<note>
    <author>
        <reference value="practitioner-00134" />
    </author>
    <time value="2022-10-19T10:12:00Z" />
    <text>
        First Issue | Prescriber notes: Lorem ipsum dolor sit amet, consectetur adipiscing... | Patient notes: Ut enim ad minim veniam, quis nostrud exercitation...
    </text>
</note>


dosage

Usage

Mandatory

Guidance

Complete dosage instructions as text.

Where the dosage instructions have been changed during the lifetime of the Medication/Medical Device plan append the following warning text to end of the dosage instructions:

WARNING – Dosage has changed during the effective period. The latest change was made on DD-Mmm-YYYY - where DD-Mmm-YYYY is the date the dosage was last changed.

In exceptional cases where for legacy data there is no dosage recorded in the system then this MUST be populated with the text: No information available.

The patientInstruction elemement MAY provide additional instructions to the patient, this is, RHS of the prescription label.

Important: The information standards notice (ISN): DAPB4013: Medicine and Allergy/Intolerance Data Transfer stipulates that structured dosage instructions should be sent.

GP Connect providers may uplift to the Information Standards Notice outlined above at different times so please account for both textual and structured representations.
Example

Legacy (free text):

<dosage>
    <text value="10 milligram - two times a day - oral - Swallow your capsules whole with a glass of water. DO NOT break, crush or chew them" />
    <patientInstruction value="Swallow your capsules whole with a glass of water. DO NOT break, crush or chew them" />
</dosage>

Structured dose syntax:

<dosageInstruction>
    <text value="10 milligram - two times a day - oral - Swallow your capsules whole with a glass of water. DO NOT break, crush or chew them" />
    <patientInstruction value="Swallow your capsules whole with a glass of water. DO NOT break, crush or chew them" />
    <timing>
        <repeat>
            <frequency value="1" />
            <period value="2" />
            <periodUnit value="d" />
            <when value="C" />
        </repeat>
    </timing>
    <route>
        <coding>
            <system value="https://snomed.info/sct" />
            <code value="26643006" />
        </coding>
        <text value="oral" />
    </route>
    <doseQuantity>
        <value value="10" />
        <unit value="milligram" />
        <system value="https://unitsofmeasure.org" />
        <code value="mg" />
    </doseQuantity>
</dosageInstruction>

back to top