us-quality-core-medicationrequest
type: StructureDefinition
node role: treeRoot
id:
  v: us-quality-core-medicationrequest
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: StructureDefinition us-quality-core-medicationrequest Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> MedicationRequest 0..* USCoreMedicationRequestProfile(6.1.0) Ordering of medication for patient or group Constraints: dom-7 #xD; status 1..1 code (USCDI+ Quality) (USCDI) active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown #xD; intent 1..1 code (USCDI+ Quality) (USCDI) proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option #xD; doNotPerform 0..1 boolean True if medication was not requested Fixed Value: false #xD; reported[x] 0..1 Reference(US Quality Core Practitioner | US Quality Core PractitionerRole | US Quality Core Patient | US Quality Core RelatedPerson) (USCDI) Reported rather than primary record #xD; medication[x] 1..1 CodeableConcept, Reference(US Core Medication Profile(7.0.0)) (USCDI+ Quality) (USCDI) Medication to be taken #xD; subject 1..1 Reference(US Quality Core Patient) (USCDI) Who or group medication request is for #xD; encounter 0..1 Reference(US Quality Core Encounter) (USCDI) Encounter created as part of encounter/admission/stay #xD; authoredOn 0..1 dateTime (USCDI+ Quality) (USCDI) When request was initially authored #xD; requester 0..1 Reference(US Quality Core Practitioner | US Quality Core PractitionerRole | US Quality Core Patient) (USCDI) Who/What requested the Request #xD; reasonCode 0..* CodeableConcept (USCDI+ Quality) (USCDI) Reason or indication for ordering or not ordering the medication #xD; reasonReference 0..* Reference(US Quality Core Condition Encounter Diagnosis | US Quality Core Condition Problems Health Concerns | US Quality Core Simple Observation) (USCDI+ Quality) (USCDI) US Quality Core Condition or Observation that supports the prescription #xD; dosageInstruction 0..* Dosage (USCDI+ Quality) (USCDI) How medication should be taken #xD; text 0..1 string (USCDI+ …
url:
  v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-medicationrequest
  l: us-quality-core-medicationrequest
version:
  v: 0.5.0
name:
  v: USQualityCoreMedicationRequest
title:
  v: US Quality Core MedicationRequest
status:
  v: active
experimental:
  v: false
date:
  v: 2026-06-05
publisher:
  v: Office of the National Coordinator for Health Information Technology (ONC)
contact:
  name:
    v: Office of the National Coordinator for Health Information Technology (ONC)
  telecom:
    system:
      v: url
    value:
      v: https://www.healthit.gov/feedback
description:
  v: Profile of MedicationRequest for decision support/quality metrics. Defines the core set of elements and extensions for quality rule and measure authors.
jurisdiction:
  coding:
    system:
      v: urn:iso:std:iso:3166
      l: 3166
    code:
      v: US
    display:
      v: United States of America
  text:
    v: USA
fhir version:
  v: 4.0.1
mapping:
  identity:
    v: workflow
  uri:
    v: http://hl7.org/fhir/workflow
    l: workflow
  name:
    v: Workflow Pattern
mapping:
  identity:
    v: script10.6
  uri:
    v: http://ncpdp.org/SCRIPT10_6
    l: SCRIPT10 6
  name:
    v: Mapping to NCPDP SCRIPT 10.6
mapping:
  identity:
    v: rim
  uri:
    v: http://hl7.org/v3
    l: v3
  name:
    v: RIM Mapping
mapping:
  identity:
    v: w5
  uri:
    v: http://hl7.org/fhir/fivews
    l: fivews
  name:
    v: FiveWs Pattern Mapping
mapping:
  identity:
    v: v2
  uri:
    v: http://hl7.org/v2
    l: v2
  name:
    v: HL7 v2 Mapping
kind:
  v: resource
abstract:
  v: false
type:
  v: MedicationRequest
  l: MedicationRequest
base definition:
  v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest|6.1.0
  l: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
derivation:
  v: constraint
snapshot:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
      l: snapshot-base-version
    value: String
      v: 6.1.0
  element:
    id:
      v: MedicationRequest
    path:
      v: MedicationRequest
    short:
      v: Ordering of medication for patient or group
    definition:
      v: \-
    comment:
      v: \-
    alias:
      v: Prescription
    alias:
      v: Order
    min:
      v: 0
    max:
      v: *
    base:
      path:
        v: MedicationRequest
      min:
        v: 0
      max:
        v: *
    constraint:
      key:
        v: dom-2
      severity:
        v: error
      human:
        v: If the resource is contained in another resource, it SHALL NOT contain nested Resources
      expression:
        v: contained.contained.empty()
      xpath:
        v: not(parent::f:contained and f:contained)
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-3
      severity:
        v: error
      human:
        v: If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource
      expression:
        v: contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()
      xpath:
        v: not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-4
      severity:
        v: error
      human:
        v: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated
      expression:
        v: contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()
      xpath:
        v: not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-5
      severity:
        v: error
      human:
        v: If a resource is contained in another resource, it SHALL NOT have a security label
      expression:
        v: contained.meta.security.empty()
      xpath:
        v: not(exists(f:contained/*/f:meta/f:security))
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      extension:
        value: Boolean
      extension:
        value: Markdown
      key:
        v: dom-6
      severity:
        v: warning
      human:
        v: A resource should have narrative for robust management
      expression:
        v: text.`div`.exists()

Boolean
v: true

Markdown
v: When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time.

v: exists(f:text/h:div)

key:
  v: us-core-21
severity:
  v: error
human:
  v: requester SHALL be present if intent is "order"
expression:
  v: (intent='order' or intent='original-order' or intent='reflex-order'or intent='filler-order' or intent='instance-order') implies requester.exists()
source:
  v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
  l: us-core-medicationrequest

key:
  v: dom-7
severity:
  v: error
human:
  v: if doNotPerform is present, it SHALL be false
expression:
  v: doNotPerform.empty() or doNotPerform=false

v: false

v: false

v: false

identity:
  v: rim
map:
  v: Entity. Role, or Act

identity:
  v: workflow
map:
  v: Request

identity:
  v: script10.6
map:
  v: Message/Body/NewRx

identity:
  v: rim
map:
  v: CombinedMedicationRequest

identity:
  v: argonaut-dq-dstu2
map:
  v: MedicationOrder

id:
  v: MedicationRequest.id
path:
  v: MedicationRequest.id
short:
  v: Logical id of this artifact
definition:
  v: The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.
comment:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: id
      l: id
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: true

id:
  v: MedicationRequest.meta
path:
  v: MedicationRequest.meta
short:
  v: Metadata about the resource
definition:
  v: The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.meta
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Meta
    l: Meta
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true

id:
  v: MedicationRequest.implicitRules
path:
  v: MedicationRequest.implicitRules
short:
  v: A set of rules under which this content was created
definition:
  v: A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.
comment:
  v: 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. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.implicitRules
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: uri
    l: uri
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: true
is modifier reason:
  v: This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation
is summary:
  v: true

id:
  v: MedicationRequest.language
path:
  v: MedicationRequest.language
short:
  v: Language of the resource content
definition:
  v: The base language in which the resource is written.
comment:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Resource.language
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet
      l: elementdefinition-maxValueSet
    value: Canonical
      v: http://hl7.org/fhir/ValueSet/all-languages
      l: all-languages
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: Language
  strength:
    v: preferred
  description:
    v: A human language.
  value set:
    v: http://hl7.org/fhir/ValueSet/languages
    l: languages

id:
  v: MedicationRequest.text
path:
  v: MedicationRequest.text
short:
  v: Text summary of the resource, for human interpretation
definition:
  v: A human-readable narrative that contains a summary of the resource and can 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:
  v: 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 information is added later.
alias:
  v: narrative
alias:
  v: html
alias:
  v: xhtml
alias:
  v: display
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DomainResource.text
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Narrative
    l: Narrative
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: Act.text?

id:
  v: MedicationRequest.contained
path:
  v: MedicationRequest.contained
short:
  v: Contained, inline Resources
definition:
  v: 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:
  v: 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. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.
alias:
  v: inline resources
alias:
  v: anonymous resources
alias:
  v: contained resources
min:
  v: 0
max:
  v: *
base:
  path:
    v: DomainResource.contained
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Resource
    l: Resource
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.extension
path:
  v: MedicationRequest.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the resource. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: DomainResource.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.modifierExtension
path:
  v: MedicationRequest.modifierExtension
short:
  v: Extensions that cannot be ignored
definition:
  v: 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 and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. 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. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: 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.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: DomainResource.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.identifier
path:
  v: MedicationRequest.identifier
short:
  v: External ids for this request
definition:
  v: Identifiers associated with this medication request that are defined by business processes and/or used to refer to it when a direct URL reference to the resource itself is not appropriate. They are business identifiers assigned to this resource by the performer or other systems and remain constant as the resource is updated and propagates from server to server.
comment:
  v: This is a business identifier, not a resource identifier.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.identifier
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Identifier
    l: Identifier
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.identifier
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Header/PrescriberOrderNumber
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.identifier
mapping:
  identity:
    v: v2
  map:
    v: ORC-2-Placer Order Number / ORC-3-Filler Order Number
mapping:
  identity:
    v: rim
  map:
    v: .id

id:
  v: MedicationRequest.status
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.status
short:
  v: (USCDI+ Quality) (USCDI) active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
definition:
  v: A code specifying the current state of the order. Generally, this will be active or completed state.
comment:
  v: This element is labeled as a modifier because the status contains codes that mark the resource as not currently valid.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MedicationRequest.status
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: true
is modifier reason:
  v: This element is labeled as a modifier because it is a status element that contains status entered-in-error which means that the resource should not be treated as valid
is summary:
  v: true
binding:
  strength:
    v: required
  description:
    v: A code specifying the state of the prescribing event. Describes the lifecycle of the prescription.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-status
    l: medicationrequest-status
mapping:
  identity:
    v: workflow
  map:
    v: Request.status
mapping:
  identity:
    v: script10.6
  map:
    v: no mapping
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.status
mapping:
  identity:
    v: rim
  map:
    v: .statusCode
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.status

id:
  v: MedicationRequest.statusReason
path:
  v: MedicationRequest.statusReason
short:
  v: Reason for current status
definition:
  v: Captures the reason for the current state of the MedicationRequest.
comment:
  v: This is generally only used for "exception" statuses such as "suspended" or "cancelled". The reason why the MedicationRequest was created at all is captured in reasonCode, not here.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.statusReason
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestStatusReason
  strength:
    v: example
  description:
    v: Identifies the reasons for a given status.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-status-reason
    l: medicationrequest-status-reason
mapping:
  identity:
    v: workflow
  map:
    v: Request.statusReason
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=SUBJ].source[classCode=CACT, moodCode=EVN].reasonCOde

id:
  v: MedicationRequest.intent
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.intent
short:
  v: (USCDI+ Quality) (USCDI) proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option
definition:
  v: Whether the request is a proposal, plan, or an original order.
comment:
  v: It is expected that the type of requester will be restricted for different stages of a MedicationRequest. For example, Proposals can be created by a patient, relatedPerson, Practitioner or Device. Plans can be created by Practitioners, Patients, RelatedPersons and Devices. Original orders can be created by a Practitioner only. An instance-order is an instantiation of a request or order and may be used to populate Medication Administration Record. This element is labeled as a modifier because the intent alters when and how the resource is actually applicable.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MedicationRequest.intent
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: code
    l: code
condition:
  v: us-core-21
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: true
is modifier reason:
  v: This element changes the interpretation of all descriptive attributes. For example "the time the request is recommended to occur" vs. "the time the request is authorized to occur" or "who is recommended to perform the request" vs. "who is authorized to perform the request
is summary:
  v: true
binding:
  strength:
    v: required
  description:
    v: The kind of medication order.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-intent
    l: medicationrequest-intent
mapping:
  identity:
    v: workflow
  map:
    v: Request.intent
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.class
mapping:
  identity:
    v: rim
  map:
    v: .moodCode (nuances beyond PRP/PLAN/RQO would need to be elsewhere)
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.status

id:
  v: MedicationRequest.category
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
path:
  v: MedicationRequest.category
slicing:
  discriminator:
    type:
      v: pattern
    path:
      v: $this
  rules:
    v: open
short:
  v: (USCDI) Type of medication usage
definition:
  v: Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).
comment:
  v: The category can be used to include where the medication is expected to be consumed or other types of requests.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.category
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestCategory
  strength:
    v: example
  description:
    v: A coded concept identifying the category of medication request. For example, where the medication is to be consumed or administered, or the type of medication treatment.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-category
    l: medicationrequest-category
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Directions or Message/Body/NewRx/MedicationPrescribed/StructuredSIG
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.class
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code="type of medication usage"].value

id:
  v: MedicationRequest.category:us-core
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
path:
  v: MedicationRequest.category
slice name:
  v: us-core
short:
  v: (USCDI) Type of medication usage
definition:
  v: Indicates the type of medication request (for example, where the medication is expected to be consumed or administered (i.e. inpatient or outpatient)).
comment:
  v: The category can be used to include where the medication is expected to be consumed or other types of requests.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.category
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
binding:
  strength:
    v: required
  description:
    v: The type of medication order. Note that other codes are permitted, see [Required Bindings When Slicing by Value Sets](http://hl7.org/fhir/us/core/general-requirements.html#required-bindings-when-slicing-by-valuesets)
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-category
    l: medicationrequest-category
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Directions or Message/Body/NewRx/MedicationPrescribed/StructuredSIG
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.class
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=COMP].source[classCode=OBS, moodCode=EVN, code="type of medication usage"].value

id:
  v: MedicationRequest.priority
path:
  v: MedicationRequest.priority
short:
  v: routine | urgent | asap | stat
definition:
  v: Indicates how quickly the Medication Request should be addressed with respect to other requests.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.priority
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestPriority
  strength:
    v: required
  description:
    v: Identifies the level of importance to be assigned to actioning the request.
  value set:
    v: http://hl7.org/fhir/ValueSet/request-priority|4.0.1
    l: http://hl7.org/fhir/ValueSet/request-priority
mapping:
  identity:
    v: workflow
  map:
    v: Request.priority
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.grade
mapping:
  identity:
    v: rim
  map:
    v: .priorityCode

id:
  v: MedicationRequest.doNotPerform
path:
  v: MedicationRequest.doNotPerform
short:
  v: True if medication was not requested
definition:
  v: If true indicates that the provider is asking for the medication request not to occur.
comment:
  v: If do not perform is not specified, the request is a positive request e.g. "do perform".
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.doNotPerform
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: boolean
    l: boolean
fixed: Boolean
  v: false
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: true
is modifier reason:
  v: This element is labeled as a modifier because this element negates the request to occur (ie, this is a request for the medication not to be ordered or prescribed, etc)
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: SubstanceAdministration.actionNegationInd

id:
  v: MedicationRequest.reported[x]
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
path:
  v: MedicationRequest.reported[x]
short:
  v: (USCDI) Reported rather than primary record
definition:
  v: Indicates if this record was captured as a secondary 'reported' record rather than as an original primary source-of-truth record. It may also indicate the source of the report.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.reported[x]
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support
      l: elementdefinition-type-must-support
    value: Boolean
      v: true
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitioner
    l: us-quality-core-practitioner
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitionerrole
    l: us-quality-core-practitionerrole
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-patient
    l: us-quality-core-patient
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-relatedperson
    l: us-quality-core-relatedperson
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=INF].role
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.status

id:
  v: MedicationRequest.medication[x]
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.medication[x]
short:
  v: (USCDI+ Quality) (USCDI) Medication to be taken
definition:
  v: Identifies the medication being requested. This is a link to a resource that represents the medication which may be the details of the medication or simply an attribute carrying a code that identifies the medication from a known list of medications.
comment:
  v: 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 or if the medication is compounded or extemporaneously prepared, then you must reference the Medication resource.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MedicationRequest.medication[x]
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication
    l: us-core-medication
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
binding:
  strength:
    v: extensible
  value set:
    v: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.4
    l: http://cts.nlm.nih.gov/fhir/ValueSet/2.16.840.1.113762.1.4.1010.4
mapping:
  identity:
    v: workflow
  map:
    v: Request.code
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed Medication.code.coding.code = Message/Body/NewRx/MedicationPrescribed/DrugCoded/ProductCode Medication.code.coding.system = Message/Body/NewRx/MedicationPrescribed/DrugCoded/ProductCodeQualifier Medication.code.coding.display = Message/Body/NewRx/MedicationPrescribed/DrugDescription
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.what[x]
mapping:
  identity:
    v: v2
  map:
    v: RXE-2-Give Code / RXO-1-Requested Give Code / RXC-2-Component Code
mapping:
  identity:
    v: rim
  map:
    v: consumable.administrableMedication
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.medication[x]

id:
  v: MedicationRequest.subject
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
path:
  v: MedicationRequest.subject
short:
  v: (USCDI) Who or group medication request is for
definition:
  v: A link to a resource representing the person or set of individuals to whom the medication will be given.
comment:
  v: The subject on a medication request is mandatory. For the secondary use case where the actual subject is not provided, there still must be an anonymized subject specified.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MedicationRequest.subject
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-patient
    l: us-quality-core-patient
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Request.subject
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/Patient (need detail to link to specific patient … Patient.Identification in SCRIPT)
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject[x]
mapping:
  identity:
    v: v2
  map:
    v: PID-3-Patient ID List
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=AUT].role
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.patient

id:
  v: MedicationRequest.encounter
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
path:
  v: MedicationRequest.encounter
short:
  v: (USCDI) Encounter created as part of encounter/admission/stay
definition:
  v: The Encounter during which this [x] was created or to which the creation of this record is tightly associated.
comment:
  v: This will typically be the encounter the event occurred within, but some activities may be initiated prior to or after the official completion of an encounter but still be tied to the context of the encounter." If there is a need to link to episodes of care they will be handled with an extension.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.encounter
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-encounter
    l: us-quality-core-encounter
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.context
mapping:
  identity:
    v: script10.6
  map:
    v: no mapping
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.context
mapping:
  identity:
    v: v2
  map:
    v: PV1-19-Visit Number
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code="type of encounter or episode"]
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: NA

id:
  v: MedicationRequest.supportingInformation
path:
  v: MedicationRequest.supportingInformation
short:
  v: Information to support ordering of the medication
definition:
  v: Include additional information (for example, patient height and weight) that supports the ordering of the medication.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.supportingInformation
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Resource
    l: Resource
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.supportingInfo
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.context
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=PERT].target[A_SupportingClinicalStatement CMET minimal with many different choices of classCodes(ORG, ENC, PROC, SPLY, SBADM, OBS) and each of the act class codes draws from one or more of the following moodCodes (EVN, DEF, INT PRMS, RQO, PRP, APT, ARQ, GOL)]

id:
  v: MedicationRequest.authoredOn
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.authoredOn
short:
  v: (USCDI+ Quality) (USCDI) When request was initially authored
definition:
  v: The date (and perhaps time) when the prescription was initially written or authored on.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.authoredOn
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: dateTime
    l: dateTime
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Request.authoredOn
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/WrittenDate
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.recorded
mapping:
  identity:
    v: v2
  map:
    v: RXE-32-Original Order Date/Time / ORC-9-Date/Time of Transaction
mapping:
  identity:
    v: rim
  map:
    v: author.time
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.dateWritten

id:
  v: MedicationRequest.requester
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
path:
  v: MedicationRequest.requester
short:
  v: (USCDI) Who/What requested the Request
definition:
  v: The individual, organization, or device that initiated the request and has responsibility for its activation.
comment:
  v: Should include USQualityCoreDevice but the base profile does excludes device references.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.requester
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitioner
    l: us-quality-core-practitioner
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitionerrole
    l: us-quality-core-practitionerrole
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-patient
    l: us-quality-core-patient
condition:
  v: us-core-21
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Request.requester
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.author
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=AUT].role
mapping:
  identity:
    v: argonaut-dq-dstu2
  map:
    v: MedicationOrder.prescriber

id:
  v: MedicationRequest.performer
path:
  v: MedicationRequest.performer
short:
  v: Intended performer of administration
definition:
  v: The specified desired performer of the medication treatment (e.g. the performer of the medication administration).
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.performer
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    l: PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization
    l: Organization
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device
    l: Device
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
    l: RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/CareTeam
    l: CareTeam
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.performer
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.actor
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=PRF].role[scoper.determinerCode=INSTANCE]

id:
  v: MedicationRequest.performerType
path:
  v: MedicationRequest.performerType
short:
  v: Desired kind of performer of the medication administration
definition:
  v: Indicates the type of performer of the administration of the medication.
comment:
  v: If specified without indicating a performer, this indicates that the performer must be of the specified type. If specified with a performer then it indicates the requirements of the performer if the designated performer is not available.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.performerType
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestPerformerType
  strength:
    v: example
  description:
    v: Identifies the type of individual that is desired to administer the medication.
  value set:
    v: http://hl7.org/fhir/ValueSet/performer-role
    l: performer-role
mapping:
  identity:
    v: workflow
  map:
    v: Request.performerType
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=PRF].role[scoper.determinerCode=KIND].code

id:
  v: MedicationRequest.recorder
path:
  v: MedicationRequest.recorder
short:
  v: Person who entered the request
definition:
  v: The person who entered the order on behalf of another individual for example in the case of a verbal or a telephone order.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.recorder
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    l: PractitionerRole
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.who
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=TRANS].role[classCode=ASSIGNED].code (HealthcareProviderType)

id:
  v: MedicationRequest.reasonCode
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.reasonCode
short:
  v: (USCDI+ Quality) (USCDI) Reason or indication for ordering or not ordering the medication
definition:
  v: The reason or the indication for ordering or not ordering the medication.
comment:
  v: This could be a diagnosis code. If a full condition record exists or additional detail is needed, use reasonReference.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.reasonCode
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  strength:
    v: extensible
  value set:
    v: http://hl7.org/fhir/us/core/ValueSet/us-core-condition-code
    l: us-core-condition-code
mapping:
  identity:
    v: workflow
  map:
    v: Request.reasonCode
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Diagnosis/Primary/Value
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.why[x]
mapping:
  identity:
    v: v2
  map:
    v: ORC-16-Order Control Code Reason /RXE-27-Give Indication/RXO-20-Indication / RXD-21-Indication / RXG-22-Indication / RXA-19-Indication
mapping:
  identity:
    v: rim
  map:
    v: reason.observation.reasonCode

id:
  v: MedicationRequest.reasonReference
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.reasonReference
short:
  v: (USCDI+ Quality) (USCDI) US Quality Core Condition or Observation that supports the prescription
definition:
  v: Condition or observation that supports why the medication was ordered.
comment:
  v: This is a reference to a condition or observation that is the reason for the medication order. If only a code exists, use reasonCode.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.reasonReference
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-condition-encounter-diagnosis
    l: us-quality-core-condition-encounter-diagnosis
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns
    l: us-quality-core-condition-problems-health-concerns
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-simple-observation
    l: us-quality-core-simple-observation
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.reasonReference
mapping:
  identity:
    v: script10.6
  map:
    v: no mapping
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.why[x]
mapping:
  identity:
    v: rim
  map:
    v: reason.observation[code=ASSERTION].value

id:
  v: MedicationRequest.instantiatesCanonical
path:
  v: MedicationRequest.instantiatesCanonical
short:
  v: Instantiates FHIR protocol or definition
definition:
  v: The URL pointing to a protocol, guideline, orderset, or other definition that is adhered to in whole or in part by this MedicationRequest.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.instantiatesCanonical
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: canonical
    l: canonical
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Request.instantiates
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=DEFN].target

id:
  v: MedicationRequest.instantiatesUri
path:
  v: MedicationRequest.instantiatesUri
short:
  v: Instantiates external protocol or definition
definition:
  v: The URL pointing to an externally maintained protocol, guideline, orderset or other definition that is adhered to in whole or in part by this MedicationRequest.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.instantiatesUri
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: uri
    l: uri
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=DEFN].target

id:
  v: MedicationRequest.basedOn
path:
  v: MedicationRequest.basedOn
short:
  v: What request fulfills
definition:
  v: A plan or request that is fulfilled in whole or in part by this medication request.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.basedOn
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/CarePlan
    l: CarePlan
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/MedicationRequest
    l: MedicationRequest
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/ServiceRequest
    l: ServiceRequest
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation
    l: ImmunizationRecommendation
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Request.basedOn
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=FLFS].target[classCode=SBADM or PROC or PCPR or OBS, moodCode=RQO orPLAN or PRP]

id:
  v: MedicationRequest.groupIdentifier
path:
  v: MedicationRequest.groupIdentifier
short:
  v: Composite request this is part of
definition:
  v: A shared identifier common to all requests that were authorized more or less simultaneously by a single author, representing the identifier of the requisition or prescription.
requirements:
  v: Requests are linked either by a "basedOn" relationship (i.e. one request is fulfilling another) or by having a common requisition. Requests that are part of the same requisition are generally treated independently from the perspective of changing their state or maintaining them after initial creation.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.groupIdentifier
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Identifier
    l: Identifier
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Request.groupIdentifier
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship(typeCode=COMP].target[classCode=SBADM, moodCode=INT].id

id:
  v: MedicationRequest.courseOfTherapyType
path:
  v: MedicationRequest.courseOfTherapyType
short:
  v: Overall pattern of medication administration
definition:
  v: The description of the overall patte3rn of the administration of the medication to the patient.
comment:
  v: This attribute should not be confused with the protocol of the medication.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.courseOfTherapyType
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestCourseOfTherapy
  strength:
    v: example
  description:
    v: Identifies the overall pattern of medication administratio.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-course-of-therapy
    l: medicationrequest-course-of-therapy
mapping:
  identity:
    v: rim
  map:
    v: Act.code where classCode = LIST and moodCode = EVN

id:
  v: MedicationRequest.insurance
path:
  v: MedicationRequest.insurance
short:
  v: Associated insurance coverage
definition:
  v: Insurance plans, coverage extensions, pre-authorizations and/or pre-determinations that may be required for delivering the requested service.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.insurance
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Coverage
    l: Coverage
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/ClaimResponse
    l: ClaimResponse
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.insurance
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=COVBY].target

id:
  v: MedicationRequest.note
path:
  v: MedicationRequest.note
short:
  v: Information about the prescription
definition:
  v: Extra information about the prescription that could not be conveyed by the other attributes.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.note
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Annotation
    l: Annotation
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.note
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Note
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=SUBJ]/source[classCode=OBS,moodCode=EVN,code="annotation"].value

id:
  v: MedicationRequest.dosageInstruction
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction
short:
  v: (USCDI+ Quality) (USCDI) How medication should be taken
definition:
  v: Indicates how the medication is to be used by the patient.
comment:
  v: There are examples where a medication request may include the option of an oral dose or an Intravenous or Intramuscular dose. For example, "Ondansetron 8mg orally or IV twice a day as needed for nausea" or "Compazine® (prochlorperazine) 5-10mg PO or 25mg PR bid prn nausea or vomiting". In these cases, two medication requests would be created that could be grouped together. The decision on which dose and route of administration to use is based on the patient's condition at the time the dose is needed.
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.dosageInstruction
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Dosage
    l: Dosage
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.occurrence[x]
mapping:
  identity:
    v: rim
  map:
    v: see dosageInstruction mapping

id:
  v: MedicationRequest.dosageInstruction.id
path:
  v: MedicationRequest.dosageInstruction.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.extension
path:
  v: MedicationRequest.dosageInstruction.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.modifierExtension
path:
  v: MedicationRequest.dosageInstruction.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. 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 can 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. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: 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.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.dosageInstruction.sequence
path:
  v: MedicationRequest.dosageInstruction.sequence
short:
  v: The order of the dosage instructions
definition:
  v: Indicates the order in which the dosage instructions should be applied or interpreted.
requirements:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.sequence
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: integer
    l: integer
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: TQ1-1
mapping:
  identity:
    v: rim
  map:
    v: .text

id:
  v: MedicationRequest.dosageInstruction.text
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.text
short:
  v: (USCDI+ Quality) (USCDI) Free text dosage instructions e.g. SIG
definition:
  v: Free text dosage instructions e.g. SIG.
requirements:
  v: 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. Additional information about administration or preparation of the medication should be included as text.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.text
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
    l: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: RXO-6; RXE-21
mapping:
  identity:
    v: rim
  map:
    v: .text

id:
  v: MedicationRequest.dosageInstruction.additionalInstruction
path:
  v: MedicationRequest.dosageInstruction.additionalInstruction
short:
  v: Supplemental instruction or warnings to the patient - e.g. "with meals", "may cause drowsiness"
definition:
  v: Supplemental instructions to the patient on how to take the medication (e.g. "with meals" or"take half to one hour before food") or warnings for the patient about the medication (e.g. "may cause drowsiness" or "avoid exposure of skin to direct sunlight or sunlamps").
comment:
  v: Information about administration or preparation of the medication (e.g. "infuse as rapidly as possibly via intraperitoneal port" or "immediately following drug x") should be populated in dosage.text.
requirements:
  v: Additional instruction is intended to be coded, but where no code exists, the element could include text. For example, "Swallow with plenty of water" which might or might not be coded.
min:
  v: 0
max:
  v: *
base:
  path:
    v: Dosage.additionalInstruction
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: AdditionalInstruction
  strength:
    v: example
  description:
    v: A coded concept identifying additional instructions such as "take with water" or "avoid operating heavy machinery".
  value set:
    v: http://hl7.org/fhir/ValueSet/additional-instruction-codes
    l: additional-instruction-codes
mapping:
  identity:
    v: v2
  map:
    v: RXO-7
mapping:
  identity:
    v: rim
  map:
    v: .text

id:
  v: MedicationRequest.dosageInstruction.patientInstruction
path:
  v: MedicationRequest.dosageInstruction.patientInstruction
short:
  v: Patient or consumer oriented instructions
definition:
  v: Instructions in terms that are understood by the patient or consumer.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.patientInstruction
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: string
    l: string
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: RXO-7
mapping:
  identity:
    v: rim
  map:
    v: .text

id:
  v: MedicationRequest.dosageInstruction.timing
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing
short:
  v: (USCDI+ Quality) (USCDI) When medication should be administered
definition:
  v: When medication should be administered.
comment:
  v: This attribute might 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:
  v: The timing schedule for giving the medication to the patient. This 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.timing
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Timing
    l: Timing
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: .effectiveTime

id:
  v: MedicationRequest.dosageInstruction.timing.id
path:
  v: MedicationRequest.dosageInstruction.timing.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.timing.extension
path:
  v: MedicationRequest.dosageInstruction.timing.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.timing.modifierExtension
path:
  v: MedicationRequest.dosageInstruction.timing.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. 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 can 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. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: 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.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.dosageInstruction.timing.event
path:
  v: MedicationRequest.dosageInstruction.timing.event
short:
  v: When the event occurs
definition:
  v: Identifies specific times when the event occurs.
requirements:
  v: In a Medication Administration Record, for instance, you need to take a general specification, and turn it into a precise specification.
min:
  v: 0
max:
  v: *
base:
  path:
    v: Timing.event
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: dateTime
    l: dateTime
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: QLIST<TS>

id:
  v: MedicationRequest.dosageInstruction.timing.repeat
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat
short:
  v: (USCDI+ Quality) When the event is to occur
definition:
  v: A set of rules that describe when the event is scheduled.
requirements:
  v: Many timing schedules are determined by regular repetitions.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Element
    l: Element
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: tim-1
  severity:
    v: error
  human:
    v: if there's a duration, there needs to be duration units
  expression:
    v: duration.empty() or durationUnit.exists()
  xpath:
    v: not(exists(f:duration)) or exists(f:durationUnit)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-2
  severity:
    v: error
  human:
    v: if there's a period, there needs to be period units
  expression:
    v: period.empty() or periodUnit.exists()
  xpath:
    v: not(exists(f:period)) or exists(f:periodUnit)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-4
  severity:
    v: error
  human:
    v: duration SHALL be a non-negative value
  expression:
    v: duration.exists() implies duration >= 0
  xpath:
    v: f:duration/@value >= 0 or not(f:duration/@value)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-5
  severity:
    v: error
  human:
    v: period SHALL be a non-negative value
  expression:
    v: period.exists() implies period >= 0
  xpath:
    v: f:period/@value >= 0 or not(f:period/@value)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-6
  severity:
    v: error
  human:
    v: If there's a periodMax, there must be a period
  expression:
    v: periodMax.empty() or period.exists()
  xpath:
    v: not(exists(f:periodMax)) or exists(f:period)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-7
  severity:
    v: error
  human:
    v: If there's a durationMax, there must be a duration
  expression:
    v: durationMax.empty() or duration.exists()
  xpath:
    v: not(exists(f:durationMax)) or exists(f:duration)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-8
  severity:
    v: error
  human:
    v: If there's a countMax, there must be a count
  expression:
    v: countMax.empty() or count.exists()
  xpath:
    v: not(exists(f:countMax)) or exists(f:count)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-9
  severity:
    v: error
  human:
    v: If there's an offset, there must be a when (and not C, CM, CD, CV)
  expression:
    v: offset.empty() or (when.exists() and ((when in ('C' | 'CM' | 'CD' | 'CV')).not()))
  xpath:
    v: not(exists(f:offset)) or exists(f:when)
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
constraint:
  key:
    v: tim-10
  severity:
    v: error
  human:
    v: If there's a timeOfDay, there cannot be a when, or vice versa
  expression:
    v: timeOfDay.empty() or when.empty()
  xpath:
    v: not(exists(f:timeOfDay)) or not(exists(f:when))
  source:
    v: http://hl7.org/fhir/us/core/StructureDefinition/us-core-medicationrequest
    l: us-core-medicationrequest
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: Implies PIVL or EIVL

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.id
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.extension
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.bounds[x]
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.bounds[x]
short:
  v: (USCDI+ Quality) Length/Range of lengths, or (Start and/or end) limits
definition:
  v: Either a duration for the length of the timing schedule, a range of possible length, or outer bounds for start and/or end limits of the timing schedule.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.bounds[x]
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Duration
    l: Duration
type:
  code:
    v: Range
    l: Range
type:
  code:
    v: Period
    l: Period
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: IVL(TS) used in a QSI

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.count
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.count
short:
  v: Number of times to repeat
definition:
  v: A total count of the desired number of repetitions across the duration of the entire timing specification. If countMax is present, this element indicates the lower bound of the allowed range of count values.
comment:
  v: If you have both bounds and count, then this should be understood as within the bounds period, until count times happens.
requirements:
  v: Repetitions may be limited by end time or total occurrences.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.count
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: positiveInt
    l: positiveInt
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.count

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.countMax
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.countMax
short:
  v: Maximum number of times to repeat
definition:
  v: If present, indicates that the count is a range - so to perform the action between [count] and [countMax] times.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.countMax
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: positiveInt
    l: positiveInt
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.count

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.duration
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.duration
short:
  v: How long when it happens
definition:
  v: How long this thing happens for when it happens. If durationMax is present, this element indicates the lower bound of the allowed range of the duration.
comment:
  v: For some events the duration is part of the definition of the event (e.g. IV infusions, where the duration is implicit in the specified quantity and rate). For others, it's part of the timing specification (e.g. exercise).
requirements:
  v: Some activities are not instantaneous and need to be maintained for a period of time.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.duration
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: decimal
    l: decimal
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.durationMax
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.durationMax
short:
  v: How long when it happens (Max)
definition:
  v: If present, indicates that the duration is a range - so to perform the action between [duration] and [durationMax] time length.
comment:
  v: For some events the duration is part of the definition of the event (e.g. IV infusions, where the duration is implicit in the specified quantity and rate). For others, it's part of the timing specification (e.g. exercise).
requirements:
  v: Some activities are not instantaneous and need to be maintained for a period of time.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.durationMax
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: decimal
    l: decimal
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.durationUnit
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.durationUnit
short:
  v: s | min | h | d | wk | mo | a - unit of time (UCUM)
definition:
  v: The units of time for the duration, in UCUM units.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.durationUnit
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: UnitsOfTime
  strength:
    v: required
  description:
    v: A unit of time (units from UCUM).
  value set:
    v: http://hl7.org/fhir/ValueSet/units-of-time|4.0.1
    l: http://hl7.org/fhir/ValueSet/units-of-time
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase.unit

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequency
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequency
short:
  v: (USCDI+ Quality) Event occurs frequency times per period
definition:
  v: The number of times to repeat the action within the specified period. If frequencyMax is present, this element indicates the lower bound of the allowed range of the frequency.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.frequency
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: positiveInt
    l: positiveInt
meaning when missing:
  v: If no frequency is stated, the assumption is that the event occurs once per period, but systems SHOULD always be specific about this
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequencyMax
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequencyMax
short:
  v: (USCDI+ Quality) Event occurs frequencyMax times per period
definition:
  v: If present, indicates that the frequency is a range - so to repeat between [frequency] and [frequencyMax] times within the period or period range.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.frequencyMax
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: positiveInt
    l: positiveInt
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.period
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.period
short:
  v: (USCDI+ Quality) Event occurs frequency times per period
definition:
  v: Indicates the duration of time over which repetitions are to occur; e.g. to express "3 times per day", 3 would be the frequency and "1 day" would be the period. If periodMax is present, this element indicates the lower bound of the allowed range of the period length.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.period
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: decimal
    l: decimal
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodMax
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodMax
short:
  v: (USCDI+ Quality) Upper limit of period (3-4 hours)
definition:
  v: If present, indicates that the period is a range from [period] to [periodMax], allowing expressing concepts such as "do this once every 3-5 days.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.periodMax
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: decimal
    l: decimal
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodUnit
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodUnit
short:
  v: (USCDI+ Quality) s | min | h | d | wk | mo | a - unit of time (UCUM)
definition:
  v: The units of time for the period in UCUM units.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.periodUnit
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: UnitsOfTime
  strength:
    v: required
  description:
    v: A unit of time (units from UCUM).
  value set:
    v: http://hl7.org/fhir/ValueSet/units-of-time|4.0.1
    l: http://hl7.org/fhir/ValueSet/units-of-time
mapping:
  identity:
    v: rim
  map:
    v: PIVL.phase.unit

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.dayOfWeek
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.dayOfWeek
short:
  v: mon | tue | wed | thu | fri | sat | sun
definition:
  v: If one or more days of week is provided, then the action happens only on the specified day(s).
comment:
  v: If no days are specified, the action is assumed to happen every day as otherwise specified. The elements frequency and period cannot be used as well as dayOfWeek.
min:
  v: 0
max:
  v: *
base:
  path:
    v: Timing.repeat.dayOfWeek
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: DayOfWeek
  strength:
    v: required
  value set:
    v: http://hl7.org/fhir/ValueSet/days-of-week|4.0.1
    l: http://hl7.org/fhir/ValueSet/days-of-week
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.timeOfDay
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.timeOfDay
short:
  v: Time of day for action
definition:
  v: Specified time of day for action to take place.
comment:
  v: When time of day is specified, it is inferred that the action happens every day (as filtered by dayofWeek) on the specified times. The elements when, frequency and period cannot be used as well as timeOfDay.
min:
  v: 0
max:
  v: *
base:
  path:
    v: Timing.repeat.timeOfDay
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: time
    l: time
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.when
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.when
short:
  v: Code for time period of occurrence
definition:
  v: An approximate time period during the day, potentially linked to an event of daily living that indicates when the action should occur.
comment:
  v: When more than one event is listed, the event is tied to the union of the specified events.
requirements:
  v: Timings are frequently determined by occurrences such as waking, eating and sleep.
min:
  v: 0
max:
  v: *
base:
  path:
    v: Timing.repeat.when
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: code
    l: code
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: EventTiming
  strength:
    v: required
  description:
    v: Real world event relating to the schedule.
  value set:
    v: http://hl7.org/fhir/ValueSet/event-timing|4.0.1
    l: http://hl7.org/fhir/ValueSet/event-timing
mapping:
  identity:
    v: rim
  map:
    v: EIVL.event

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.offset
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.offset
short:
  v: Minutes from event (before or after)
definition:
  v: The number of minutes from the event. If the event code does not indicate whether the minutes is before or after the event, then the offset is assumed to be after the event.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.repeat.offset
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: unsignedInt
    l: unsignedInt
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: EIVL.offset

id:
  v: MedicationRequest.dosageInstruction.timing.code
path:
  v: MedicationRequest.dosageInstruction.timing.code
short:
  v: BID | TID | QID | AM | PM | QD | QOD | +
definition:
  v: A code for the timing schedule (or just text in code.text). Some codes such as BID are ubiquitous, but many institutions define their own additional codes. If a code is provided, the code is understood to be a complete statement of whatever is specified in the structured timing data, and either the code or the data may be used to interpret the Timing, with the exception that .repeat.bounds still applies over the code (and is not contained in the code).
comment:
  v: BID etc. are defined as 'at institutionally specified times'. For example, an institution may choose that BID is "always at 7am and 6pm". If it is inappropriate for this choice to be made, the code BID should not be used. Instead, a distinct organization-specific code should be used in place of the HL7-defined BID code and/or a structured representation should be used (in this case, specifying the two event times).
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Timing.code
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: TimingAbbreviation
  strength:
    v: preferred
  description:
    v: Code for a known / defined timing pattern.
  value set:
    v: http://hl7.org/fhir/ValueSet/timing-abbreviation|4.0.1
    l: http://hl7.org/fhir/ValueSet/timing-abbreviation
mapping:
  identity:
    v: rim
  map:
    v: QSC.code

id:
  v: MedicationRequest.dosageInstruction.asNeeded[x]
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.asNeeded[x]
short:
  v: (USCDI+ Quality) Take "as needed" (for x)
definition:
  v: 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:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.asNeeded[x]
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: boolean
    l: boolean
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationAsNeededReason
  strength:
    v: example
  description:
    v: 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.
  value set:
    v: http://hl7.org/fhir/ValueSet/medication-as-needed-reason
    l: medication-as-needed-reason
mapping:
  identity:
    v: v2
  map:
    v: TQ1-9
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=PRCN].target[classCode=OBS, moodCode=EVN, code="as needed"].value=boolean or codable concept

id:
  v: MedicationRequest.dosageInstruction.site
path:
  v: MedicationRequest.dosageInstruction.site
short:
  v: Body site to administer to
definition:
  v: Body site to administer to.
comment:
  v: If the use case requires attributes from the BodySite resource (e.g. to identify and track separately) then use the standard extension [bodySite](http://hl7.org/fhir/R4/extension-bodysite.html). May be a summary code, or a reference to a very precise definition of the location, or both.
requirements:
  v: A coded specification of the anatomic site where the medication first enters the body.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.site
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationAdministrationSite
  strength:
    v: example
  description:
    v: A coded concept describing the site location the medicine enters into or onto the body.
  value set:
    v: http://hl7.org/fhir/ValueSet/approach-site-codes
    l: approach-site-codes
mapping:
  identity:
    v: v2
  map:
    v: RXR-2
mapping:
  identity:
    v: rim
  map:
    v: .approachSiteCode

id:
  v: MedicationRequest.dosageInstruction.route
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.route
short:
  v: (USCDI+ Quality) How drug should enter body
definition:
  v: How drug should enter body.
requirements:
  v: A code specifying the route or physiological path of administration of a therapeutic agent into or onto a patient's body.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.route
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: RouteOfAdministration
  strength:
    v: example
  description:
    v: A coded concept describing the route or physiological path of administration of a therapeutic agent into or onto the body of a subject.
  value set:
    v: http://hl7.org/fhir/ValueSet/route-codes
    l: route-codes
mapping:
  identity:
    v: v2
  map:
    v: RXR-1
mapping:
  identity:
    v: rim
  map:
    v: .routeCode

id:
  v: MedicationRequest.dosageInstruction.method
path:
  v: MedicationRequest.dosageInstruction.method
short:
  v: Technique for administering medication
definition:
  v: Technique for administering medication.
comment:
  v: Terminologies used often pre-coordinate this term with the route and or form of administration.
requirements:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.method
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationAdministrationMethod
  strength:
    v: example
  description:
    v: A coded concept describing the technique by which the medicine is administered.
  value set:
    v: http://hl7.org/fhir/ValueSet/administration-method-codes
    l: administration-method-codes
mapping:
  identity:
    v: v2
  map:
    v: RXR-4
mapping:
  identity:
    v: rim
  map:
    v: .doseQuantity

id:
  v: MedicationRequest.dosageInstruction.doseAndRate
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.doseAndRate
short:
  v: (USCDI+ Quality) (USCDI) Amount of medication administered
definition:
  v: The amount of medication administered.
min:
  v: 0
max:
  v: *
base:
  path:
    v: Dosage.doseAndRate
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Element
    l: Element
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: TQ1-2

id:
  v: MedicationRequest.dosageInstruction.doseAndRate.id
path:
  v: MedicationRequest.dosageInstruction.doseAndRate.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.doseAndRate.extension
path:
  v: MedicationRequest.dosageInstruction.doseAndRate.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dosageInstruction.doseAndRate.type
path:
  v: MedicationRequest.dosageInstruction.doseAndRate.type
short:
  v: The kind of dose or rate specified
definition:
  v: The kind of dose or rate specified, for example, ordered or calculated.
requirements:
  v: If the type is not populated, assume to be "ordered".
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.doseAndRate.type
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: DoseAndRateType
  strength:
    v: example
  description:
    v: The kind of dose or rate specified.
  value set:
    v: http://hl7.org/fhir/ValueSet/dose-rate-type
    l: dose-rate-type
mapping:
  identity:
    v: v2
  map:
    v: RXO-21; RXE-23

id:
  v: MedicationRequest.dosageInstruction.doseAndRate.dose[x]
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.doseAndRate.dose[x]
short:
  v: (USCDI+ Quality) (USCDI) Amount of medication per dose
definition:
  v: Amount of medication per dose.
comment:
  v: 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:
  v: The amount of therapeutic or other substance given at one administration event.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.doseAndRate.dose[x]
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-type-must-support
      l: elementdefinition-type-must-support
    value: Boolean
      v: true
  code:
    v: Quantity
    l: Quantity
type:
  code:
    v: Range
    l: Range
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: true
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet
      l: elementdefinition-maxValueSet
    value: Canonical
      v: http://hl7.org/fhir/ValueSet/ucum-units
      l: ucum-units
  strength:
    v: preferred
  value set:
    v: http://hl7.org/fhir/ValueSet/ucum-common
    l: ucum-common
mapping:
  identity:
    v: v2
  map:
    v: RXO-2, RXE-3
mapping:
  identity:
    v: rim
  map:
    v: .doseQuantity

id:
  v: MedicationRequest.dosageInstruction.doseAndRate.rate[x]
path:
  v: MedicationRequest.dosageInstruction.doseAndRate.rate[x]
short:
  v: Amount of medication per unit of time
definition:
  v: Amount of medication per unit of time.
comment:
  v: 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. It is possible to specify a rate over time (for example, 100 ml/hour) using either the rateRatio and rateQuantity. The rateQuantity approach requires systems to have the capability to parse UCUM grammer where ml/hour is included rather than a specific ratio where the time is specified as the denominator. Where a rate such as 500ml over 2 hours is specified, the use of rateRatio may be more semantically correct than specifying using a rateQuantity of 250 mg/hour.
requirements:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.doseAndRate.rate[x]
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Ratio
    l: Ratio
type:
  code:
    v: Range
    l: Range
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: RXE22, RXE23, RXE-24
mapping:
  identity:
    v: rim
  map:
    v: .rateQuantity

id:
  v: MedicationRequest.dosageInstruction.maxDosePerPeriod
path:
  v: MedicationRequest.dosageInstruction.maxDosePerPeriod
short:
  v: Upper limit on medication per unit of time
definition:
  v: Upper limit on medication per unit of time.
comment:
  v: 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:
  v: 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:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.maxDosePerPeriod
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Ratio
    l: Ratio
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: v2
  map:
    v: RXO-23, RXE-19
mapping:
  identity:
    v: rim
  map:
    v: .maxDoseQuantity

id:
  v: MedicationRequest.dosageInstruction.maxDosePerAdministration
path:
  v: MedicationRequest.dosageInstruction.maxDosePerAdministration
short:
  v: Upper limit on medication per administration
definition:
  v: Upper limit on medication per administration.
comment:
  v: 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:
  v: The maximum total quantity of a therapeutic substance that may be administered to a subject per administration.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.maxDosePerAdministration
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: not supported

id:
  v: MedicationRequest.dosageInstruction.maxDosePerLifetime
path:
  v: MedicationRequest.dosageInstruction.maxDosePerLifetime
short:
  v: Upper limit on medication per lifetime of the patient
definition:
  v: Upper limit on medication per lifetime of the patient.
requirements:
  v: The maximum total quantity of a therapeutic substance that may be administered per lifetime of the subject.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Dosage.maxDosePerLifetime
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: not supported

id:
  v: MedicationRequest.dispenseRequest
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest
short:
  v: (USCDI+ Quality) (USCDI) Medication supply authorization
definition:
  v: Indicates the specific details for the dispense or medication supply part of a medication request (also known as a Medication Prescription or Medication Order). Note that this information is not always sent with the order. There may be in some settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: BackboneElement
    l: BackboneElement
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/ExpirationDate
mapping:
  identity:
    v: rim
  map:
    v: component.supplyEvent

id:
  v: MedicationRequest.dispenseRequest.id
path:
  v: MedicationRequest.dispenseRequest.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dispenseRequest.extension
path:
  v: MedicationRequest.dispenseRequest.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dispenseRequest.modifierExtension
path:
  v: MedicationRequest.dispenseRequest.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. 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 can 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. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: 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.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.dispenseRequest.initialFill
path:
  v: MedicationRequest.dispenseRequest.initialFill
short:
  v: First fill details
definition:
  v: Indicates the quantity or duration for the first dispense of the medication.
comment:
  v: If populating this element, either the quantity or the duration must be included.
min:
  v: 0
max:
  v: 0
base:
  path:
    v: MedicationRequest.dispenseRequest.initialFill
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: BackboneElement
    l: BackboneElement
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: SubstanceAdministration -> ActRelationship[sequenceNumber = '1'] -> Supply

id:
  v: MedicationRequest.dispenseRequest.initialFill.id
path:
  v: MedicationRequest.dispenseRequest.initialFill.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dispenseRequest.initialFill.extension
path:
  v: MedicationRequest.dispenseRequest.initialFill.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.dispenseRequest.initialFill.modifierExtension
path:
  v: MedicationRequest.dispenseRequest.initialFill.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. 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 can 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. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: 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.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.dispenseRequest.initialFill.quantity
path:
  v: MedicationRequest.dispenseRequest.initialFill.quantity
short:
  v: First fill quantity
definition:
  v: The amount or quantity to provide as part of the first dispense.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.initialFill.quantity
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: Supply.quantity[moodCode=RQO]

id:
  v: MedicationRequest.dispenseRequest.initialFill.duration
path:
  v: MedicationRequest.dispenseRequest.initialFill.duration
short:
  v: First fill duration
definition:
  v: The length of time that the first dispense is expected to last.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.initialFill.duration
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Duration
    l: Duration
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: Supply.effectivetime[moodCode=RQO]

id:
  v: MedicationRequest.dispenseRequest.dispenseInterval
path:
  v: MedicationRequest.dispenseRequest.dispenseInterval
short:
  v: Minimum period of time between dispenses
definition:
  v: The minimum period of time that must occur between dispenses of the medication.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.dispenseInterval
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Duration
    l: Duration
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: Supply.effectivetime[moodCode=RQO]

id:
  v: MedicationRequest.dispenseRequest.validityPeriod
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.validityPeriod
short:
  v: (USCDI+ Quality) Time period supply is authorized for
definition:
  v: This indicates the validity period of a prescription (stale dating the Prescription).
comment:
  v: It reflects the prescribers' perspective for the validity of the prescription. Dispenses must not be made against the prescription outside of this period. The lower-bound of the Dispensing Window signifies the earliest date that the prescription can be filled for the first time. If an upper-bound is not specified then the Prescription is open-ended or will default to a stale-date based on regulations.
requirements:
  v: Indicates when the Prescription becomes valid, and when it ceases to be a dispensable Prescription.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.validityPeriod
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Period
    l: Period
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Refills
mapping:
  identity:
    v: rim
  map:
    v: effectiveTime

id:
  v: MedicationRequest.dispenseRequest.numberOfRepeatsAllowed
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.numberOfRepeatsAllowed
short:
  v: (USCDI+ Quality) (USCDI) Number of refills authorized
definition:
  v: An integer indicating the number of times, in addition to the original dispense, (aka refills or repeats) that the patient can receive the prescribed medication. Usage Notes: This integer does not include the original order dispense. This means that if an order indicates dispense 30 tablets plus "3 repeats", then the order can be dispensed a total of 4 times and the patient can receive a total of 120 tablets. A prescriber may explicitly say that zero refills are permitted after the initial dispense.
comment:
  v: If displaying "number of authorized fills", add 1 to this number.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.numberOfRepeatsAllowed
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: unsignedInt
    l: unsignedInt
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Quantity
mapping:
  identity:
    v: v2
  map:
    v: RXE-12-Number of Refills
mapping:
  identity:
    v: rim
  map:
    v: repeatNumber

id:
  v: MedicationRequest.dispenseRequest.quantity
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.quantity
short:
  v: (USCDI+ Quality) (USCDI) Amount of medication to supply per dispense
definition:
  v: The amount that is to be dispensed for one fill.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.quantity
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: true
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/DaysSupply
mapping:
  identity:
    v: v2
  map:
    v: RXD-4-Actual Dispense Amount / RXD-5.1-Actual Dispense Units.code / RXD-5.3-Actual Dispense Units.name of coding system
mapping:
  identity:
    v: rim
  map:
    v: quantity

id:
  v: MedicationRequest.dispenseRequest.expectedSupplyDuration
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.expectedSupplyDuration
short:
  v: (USCDI+ Quality) Number of days supply per dispense
definition:
  v: Identifies the period time over which the supplied product is expected to be used, or the length of time the dispense is expected to last.
comment:
  v: In some situations, this attribute may be used instead of quantity to identify the amount supplied by how long it is expected to last, rather than the physical quantity issued, e.g. 90 days supply of medication (based on an ordered dosage). When possible, it is always better to specify quantity, as this tends to be more precise. expectedSupplyDuration will always be an estimate that can be influenced by external factors.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.expectedSupplyDuration
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Duration
    l: Duration
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: script10.6
  map:
    v: Message/Body/NewRx/MedicationPrescribed/Substitutions
mapping:
  identity:
    v: rim
  map:
    v: expectedUseTime

id:
  v: MedicationRequest.dispenseRequest.performer
path:
  v: MedicationRequest.dispenseRequest.performer
short:
  v: Intended dispenser
definition:
  v: Indicates the intended dispensing Organization specified by the prescriber.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.dispenseRequest.performer
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization
    l: Organization
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.who
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=COMP].target[classCode=SPLY, moodCode=RQO] .participation[typeCode=PRF].role[scoper.determinerCode=INSTANCE]

id:
  v: MedicationRequest.substitution
path:
  v: MedicationRequest.substitution
short:
  v: Any restrictions on medication substitution
definition:
  v: Indicates whether or not substitution can or should be part of the dispense. In some cases, substitution must happen, in other cases substitution must not happen. This block explains the prescriber's intent. If nothing is specified substitution may be done.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.substitution
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: BackboneElement
    l: BackboneElement
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: script10.6
  map:
    v: specific values within Message/Body/NewRx/MedicationPrescribed/Substitutions
mapping:
  identity:
    v: rim
  map:
    v: subjectOf.substitutionPersmission

id:
  v: MedicationRequest.substitution.id
path:
  v: MedicationRequest.substitution.id
representation:
  v: xmlAttr
short:
  v: Unique id for inter-element referencing
definition:
  v: Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: Element.id
  min:
    v: 0
  max:
    v: 1
type:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type
      l: structuredefinition-fhir-type
    value: Url
      v: string
      l: string
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.substitution.extension
path:
  v: MedicationRequest.substitution.extension
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. 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 can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.
comment:
  v: 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:
  v: extensions
alias:
  v: user content
min:
  v: 0
max:
  v: *
base:
  path:
    v: Element.extension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: MedicationRequest.substitution.modifierExtension
path:
  v: MedicationRequest.substitution.modifierExtension
short:
  v: Extensions that cannot be ignored even if unrecognized
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. 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 can 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. Modifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).
comment:
  v: 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.
requirements:
  v: Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored. This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](http://hl7.org/fhir/R4/extensibility.html#modifierExtension).
alias:
  v: extensions
alias:
  v: user content
alias:
  v: modifiers
min:
  v: 0
max:
  v: *
base:
  path:
    v: BackboneElement.modifierExtension
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Extension
    l: Extension
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
constraint:
  key:
    v: ext-1
  severity:
    v: error
  human:
    v: Must have either extensions or value[x], not both
  expression:
    v: extension.exists() != value.exists()
  xpath:
    v: exists(f:extension)!=exists(f:*[starts-with(local-name(.), "value")])
  source:
    v: http://hl7.org/fhir/StructureDefinition/Extension
    l: Extension
is modifier:
  v: true
is modifier reason:
  v: Modifier extensions are expected to modify the meaning or interpretation of the element that contains them
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: MedicationRequest.substitution.allowed[x]
path:
  v: MedicationRequest.substitution.allowed[x]
short:
  v: Whether substitution is allowed or not
definition:
  v: True if the prescriber allows a different drug to be dispensed from what was prescribed.
comment:
  v: This element is labeled as a modifier because whether substitution is allow or not, it cannot be ignored.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: MedicationRequest.substitution.allowed[x]
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: boolean
    l: boolean
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestSubstitution
  strength:
    v: example
  description:
    v: Identifies the type of substitution allowed.
  value set:
    v: http://terminology.hl7.org/ValueSet/v3-ActSubstanceAdminSubstitutionCode
    l: v3-ActSubstanceAdminSubstitutionCode
mapping:
  identity:
    v: script10.6
  map:
    v: specific values within Message/Body/NewRx/MedicationPrescribed/Substitutions
mapping:
  identity:
    v: v2
  map:
    v: RXO-9-Allow Substitutions / RXE-9-Substitution Status
mapping:
  identity:
    v: rim
  map:
    v: code

id:
  v: MedicationRequest.substitution.reason
path:
  v: MedicationRequest.substitution.reason
short:
  v: Why should (not) substitution be made
definition:
  v: Indicates the reason for the substitution, or why substitution must or must not be performed.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.substitution.reason
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationIntendedSubstitutionReason
  strength:
    v: example
  description:
    v: A coded concept describing the reason that a different medication should (or should not) be substituted from what was prescribed.
  value set:
    v: http://terminology.hl7.org/ValueSet/v3-SubstanceAdminSubstitutionReason
    l: v3-SubstanceAdminSubstitutionReason
mapping:
  identity:
    v: script10.6
  map:
    v: not mapped
mapping:
  identity:
    v: v2
  map:
    v: RXE-9 Substition status
mapping:
  identity:
    v: rim
  map:
    v: reasonCode

id:
  v: MedicationRequest.priorPrescription
path:
  v: MedicationRequest.priorPrescription
short:
  v: An order/prescription that is being replaced
definition:
  v: A link to a resource representing an earlier order related order or prescription.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: MedicationRequest.priorPrescription
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/MedicationRequest
    l: MedicationRequest
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.replaces
mapping:
  identity:
    v: script10.6
  map:
    v: not mapped
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=?RPLC or ?SUCC]/target[classCode=SBADM,moodCode=RQO]

id:
  v: MedicationRequest.detectedIssue
path:
  v: MedicationRequest.detectedIssue
short:
  v: Clinical Issue with action
definition:
  v: Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a patient; e.g. Drug-drug interaction, duplicate therapy, dosage alert etc.
comment:
  v: This element can include a detected issue that has been identified either by a decision support system or by a clinician and may include information on the steps that were taken to address the issue.
alias:
  v: Contraindication
alias:
  v: Drug Utilization Review (DUR)
alias:
  v: Alert
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.detectedIssue
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/DetectedIssue
    l: DetectedIssue
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=SUBJ]/source[classCode=ALRT,moodCode=EVN].value

id:
  v: MedicationRequest.eventHistory
path:
  v: MedicationRequest.eventHistory
short:
  v: A list of events of interest in the lifecycle
definition:
  v: Links to Provenance records for past versions of this resource or fulfilling request or event resources that identify key state transitions or updates that are likely to be relevant to a user looking at the current version of the resource.
comment:
  v: This might not include provenances for all versions of the request – only those deemed “relevant” or important. This SHALL NOT include the provenance associated with this current version of the resource. (If that provenance is deemed to be a “relevant” change, it will need to be added as part of a later update. Until then, it can be queried directly as the provenance that points to this version using _revinclude All Provenances should have some historical version of this Request as their subject.).
min:
  v: 0
max:
  v: *
base:
  path:
    v: MedicationRequest.eventHistory
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Provenance
    l: Provenance
constraint:
  key:
    v: ele-1
  severity:
    v: error
  human:
    v: All FHIR elements must have a @value or children
  expression:
    v: hasValue() or (children().count() > id.count())
  xpath:
    v: @value|f:*|h:div
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: workflow
  map:
    v: Request.relevantHistory
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship(typeCode=SUBJ].source[classCode=CACT, moodCode=EVN]

element:
  id:
    v: MedicationRequest
  path:
    v: MedicationRequest
  short:
    v: Ordering of medication for patient or group
  constraint:
    key:
      v: dom-7
    severity:
      v: error
    human:
      v: if doNotPerform is present, it SHALL be false
    expression:
      v: doNotPerform.empty() or doNotPerform=false
element:
  id:
    v: MedicationRequest.status
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  extension:
    url:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
      l: uscdiplusquality
    value: Boolean
      v: true
  path:
    v: MedicationRequest.status
  short:
    v: (USCDI+ Quality) (USCDI) active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown
element:
  id:
    v: MedicationRequest.intent
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  extension:
    url:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
      l: uscdiplusquality
    value: Boolean
      v: true
  path:
    v: MedicationRequest.intent
  short:
    v: (USCDI+ Quality) (USCDI) proposal | plan | order | original-order | reflex-order | filler-order | instance-order | option
element:
  id:
    v: MedicationRequest.doNotPerform
  path:
    v: MedicationRequest.doNotPerform
  short:
    v: True if medication was not requested
  min:
    v: 0
  max:
    v: 1
  type:
    code:
      v: boolean
      l: boolean
  fixed: Boolean
    v: false
element:
  id:
    v: MedicationRequest.reported[x]
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  path:
    v: MedicationRequest.reported[x]
  short:
    v: (USCDI) Reported rather than primary record
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitioner
      l: us-quality-core-practitioner
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitionerrole
      l: us-quality-core-practitionerrole
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-patient
      l: us-quality-core-patient
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-relatedperson
      l: us-quality-core-relatedperson
element:
  id:
    v: MedicationRequest.medication[x]
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  extension:
    url:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
      l: uscdiplusquality
    value: Boolean
      v: true
  path:
    v: MedicationRequest.medication[x]
  short:
    v: (USCDI+ Quality) (USCDI) Medication to be taken
element:
  id:
    v: MedicationRequest.subject
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  path:
    v: MedicationRequest.subject
  short:
    v: (USCDI) Who or group medication request is for
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-patient
      l: us-quality-core-patient
element:
  id:
    v: MedicationRequest.encounter
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  path:
    v: MedicationRequest.encounter
  short:
    v: (USCDI) Encounter created as part of encounter/admission/stay
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-encounter
      l: us-quality-core-encounter
element:
  id:
    v: MedicationRequest.authoredOn
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  extension:
    url:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
      l: uscdiplusquality
    value: Boolean
      v: true
  path:
    v: MedicationRequest.authoredOn
  short:
    v: (USCDI+ Quality) (USCDI) When request was initially authored
  min:
    v: 0
  max:
    v: 1
element:
  id:
    v: MedicationRequest.requester
  extension:
    url:
      v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
      l: uscdi-requirement
    value: Boolean
      v: true
  path:
    v: MedicationRequest.requester
  short:
    v: (USCDI) Who/What requested the Request
  comment:
    v: Should include USQualityCoreDevice but the base profile does excludes device references.
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-practitioner
      l: us-quality-core-practitioner

id:
  v: MedicationRequest.reasonCode
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.reasonCode
short:
  v: (USCDI+ Quality) (USCDI) Reason or indication for ordering or not ordering the medication

id:
  v: MedicationRequest.reasonReference
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.reasonReference
short:
  v: (USCDI+ Quality) (USCDI) US Quality Core Condition or Observation that supports the prescription
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-condition-encounter-diagnosis
    l: us-quality-core-condition-encounter-diagnosis
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-condition-problems-health-concerns
    l: us-quality-core-condition-problems-health-concerns
  target profile:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/us-quality-core-simple-observation
    l: us-quality-core-simple-observation

id:
  v: MedicationRequest.dosageInstruction
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction
short:
  v: (USCDI+ Quality) (USCDI) How medication should be taken

id:
  v: MedicationRequest.dosageInstruction.text
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.text
short:
  v: (USCDI+ Quality) (USCDI) Free text dosage instructions e.g. SIG

id:
  v: MedicationRequest.dosageInstruction.timing
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing
short:
  v: (USCDI+ Quality) (USCDI) When medication should be administered

id:
  v: MedicationRequest.dosageInstruction.timing.repeat
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat
short:
  v: (USCDI+ Quality) When the event is to occur

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.bounds[x]
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.bounds[x]
short:
  v: (USCDI+ Quality) Length/Range of lengths, or (Start and/or end) limits

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequency
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequency
short:
  v: (USCDI+ Quality) Event occurs frequency times per period

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequencyMax
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.frequencyMax
short:
  v: (USCDI+ Quality) Event occurs frequencyMax times per period

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.period
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.period
short:
  v: (USCDI+ Quality) Event occurs frequency times per period

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodMax
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodMax
short:
  v: (USCDI+ Quality) Upper limit of period (3-4 hours)

id:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodUnit
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.timing.repeat.periodUnit
short:
  v: (USCDI+ Quality) s | min | h | d | wk | mo | a - unit of time (UCUM)

id:
  v: MedicationRequest.dosageInstruction.asNeeded[x]
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.asNeeded[x]
short:
  v: (USCDI+ Quality) Take "as needed" (for x)

id:
  v: MedicationRequest.dosageInstruction.route
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.route
short:
  v: (USCDI+ Quality) How drug should enter body

id:
  v: MedicationRequest.dosageInstruction.doseAndRate
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.doseAndRate
short:
  v: (USCDI+ Quality) (USCDI) Amount of medication administered

id:
  v: MedicationRequest.dosageInstruction.doseAndRate.dose[x]
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dosageInstruction.doseAndRate.dose[x]
short:
  v: (USCDI+ Quality) (USCDI) Amount of medication per dose

id:
  v: MedicationRequest.dispenseRequest
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest
short:
  v: (USCDI+ Quality) (USCDI) Medication supply authorization

id:
  v: MedicationRequest.dispenseRequest.initialFill
path:
  v: MedicationRequest.dispenseRequest.initialFill
min:
  v: 0
max:
  v: 0

id:
  v: MedicationRequest.dispenseRequest.dispenseInterval
path:
  v: MedicationRequest.dispenseRequest.dispenseInterval
short:
  v: Minimum period of time between dispenses

id:
  v: MedicationRequest.dispenseRequest.validityPeriod
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.validityPeriod
short:
  v: (USCDI+ Quality) Time period supply is authorized for

id:
  v: MedicationRequest.dispenseRequest.numberOfRepeatsAllowed
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.numberOfRepeatsAllowed
short:
  v: (USCDI+ Quality) (USCDI) Number of refills authorized

id:
  v: MedicationRequest.dispenseRequest.quantity
extension:
  url:
    v: http://hl7.org/fhir/us/core/StructureDefinition/uscdi-requirement
    l: uscdi-requirement
  value: Boolean
    v: true
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.quantity
short:
  v: (USCDI+ Quality) (USCDI) Amount of medication to supply per dispense

id:
  v: MedicationRequest.dispenseRequest.expectedSupplyDuration
extension:
  url:
    v: http://fhir.org/guides/onc/us-quality-core/StructureDefinition/uscdiplusquality
    l: uscdiplusquality
  value: Boolean
    v: true
path:
  v: MedicationRequest.dispenseRequest.expectedSupplyDuration
short:
  v: (USCDI+ Quality) Number of days supply per dispense