HivAltPepBackbonePrescription
type: StructureDefinition
node role: treeRoot
id:
  v: HivAltPepBackbonePrescription
meta:
  profile:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-shareablestructuredefinition
    l: crmi-shareablestructuredefinition
  profile:
    v: http://hl7.org/fhir/uv/crmi/StructureDefinition/crmi-publishablestructuredefinition
    l: crmi-publishablestructuredefinition
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: StructureDefinition HivAltPepBackbonePrescription Profiles: CRMI Shareable StructureDefinition, CRMI Publishable StructureDefinition Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> MedicationRequest 0..* MedicationRequest Ordering of medication for patient or group #xD; medication[x] 1..1 CodeableConcept Medication to be taken Binding: Alternative PEP backbone regimen ValueSet (required) #xD; <img src="[binary]" alt="doco" style="background-color: inherit"/> Documentation for this format
url:
  v: http://smart.who.int/hiv/StructureDefinition/HivAltPepBackbonePrescription
  l: HivAltPepBackbonePrescription
version:
  v: 0.4.4
name:
  v: HivAltPepBackbonePrescription
title:
  v: Alternative PEP Backbone Prescription
status:
  v: draft
experimental:
  v: true
date:
  v: 2025-12-08T16:41:10+00:00
publisher:
  v: WHO
contact:
  name:
    v: WHO
  telecom:
    system:
      v: url
    value:
      v: http://who.int
description:
  v: A profile for MedicationRequest representing an alternative PEP backbone prescription.
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/StructureDefinition/MedicationRequest
  l: MedicationRequest
derivation:
  v: constraint
snapshot:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
      l: snapshot-base-version
    value: String
      v: 4.0.1
  element:
    id:
      v: MedicationRequest
    path:
      v: MedicationRequest
    short:
      v: Ordering of medication for patient or group
    definition:
      v: An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.
    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()
      xpath:
        v: exists(f:text/h:div)
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource

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: 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

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|4.0.1
    l: http://hl7.org/fhir/ValueSet/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
path:
  v: MedicationRequest.status
short:
  v: 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
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:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestStatus
  strength:
    v: required
  description:
    v: A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-status|4.0.1
    l: http://hl7.org/fhir/ValueSet/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

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|4.0.1
    l: http://hl7.org/fhir/ValueSet/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
path:
  v: MedicationRequest.intent
short:
  v: 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
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 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:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestIntent
  strength:
    v: required
  description:
    v: The kind of medication order.
  value set:
    v: http://hl7.org/fhir/ValueSet/medicationrequest-intent|4.0.1
    l: http://hl7.org/fhir/ValueSet/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)

id:
  v: MedicationRequest.category
path:
  v: MedicationRequest.category
short:
  v: 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
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|4.0.1
    l: http://hl7.org/fhir/ValueSet/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 request is prohibiting action
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
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]
path:
  v: MedicationRequest.reported[x]
short:
  v: 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:
  code:
    v: boolean
    l: boolean
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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: true
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=INF].role

id:
  v: MedicationRequest.medication[x]
path:
  v: MedicationRequest.medication[x]
short:
  v: 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
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:
  strength:
    v: required
  value set:
    v: http://smart.who.int/hiv/ValueSet/HIV.C.DE95
    l: HIV.C.DE95
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

id:
  v: MedicationRequest.subject
path:
  v: MedicationRequest.subject
short:
  v: 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://hl7.org/fhir/StructureDefinition/Patient|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Group
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.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

id:
  v: MedicationRequest.encounter
path:
  v: MedicationRequest.encounter
short:
  v: 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://hl7.org/fhir/StructureDefinition/Encounter|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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
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"]

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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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
path:
  v: MedicationRequest.authoredOn
short:
  v: 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
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

id:
  v: MedicationRequest.requester
path:
  v: MedicationRequest.requester
short:
  v: Who/What requested the Request
definition:
  v: The individual, organization, or device that initiated the request and has responsibility for its activation.
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://hl7.org/fhir/StructureDefinition/Practitioner|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Organization
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Device
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.requester
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.author
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=AUT].role

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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Organization
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Device
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/CareTeam|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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|4.0.1
    l: http://hl7.org/fhir/ValueSet/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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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
path:
  v: MedicationRequest.reasonCode
short:
  v: 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:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: MedicationRequestReason
  strength:
    v: example
  description:
    v: A coded concept indicating why the medication was ordered.
  value set:
    v: http://hl7.org/fhir/ValueSet/condition-code|4.0.1
    l: http://hl7.org/fhir/ValueSet/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
path:
  v: MedicationRequest.reasonReference
short:
  v: Condition or observation that supports why the prescription is being written
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://hl7.org/fhir/StructureDefinition/Condition|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Condition
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Observation|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/CarePlan
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/MedicationRequest|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/MedicationRequest
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/ServiceRequest|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/ServiceRequest
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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|4.0.1
    l: http://hl7.org/fhir/ValueSet/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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/Coverage
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/ClaimResponse|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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
path:
  v: MedicationRequest.dosageInstruction
short:
  v: How the 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
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.dispenseRequest
path:
  v: MedicationRequest.dispenseRequest
short:
  v: 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
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: 1
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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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
path:
  v: MedicationRequest.dispenseRequest.validityPeriod
short:
  v: 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
path:
  v: MedicationRequest.dispenseRequest.numberOfRepeatsAllowed
short:
  v: 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
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
path:
  v: MedicationRequest.dispenseRequest.quantity
short:
  v: 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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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: 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
path:
  v: MedicationRequest.dispenseRequest.expectedSupplyDuration
short:
  v: 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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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|4.0.1
    l: http://hl7.org/fhir/StructureDefinition/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
element:
  id:
    v: MedicationRequest.medication[x]
  path:
    v: MedicationRequest.medication[x]
  type:
    code:
      v: CodeableConcept
      l: CodeableConcept
  binding:
    strength:
      v: required
    value set:
      v: http://smart.who.int/hiv/ValueSet/HIV.C.DE95
      l: HIV.C.DE95