DeviceDispense
type: StructureDefinition
node role: treeRoot
id:
  v: DeviceDispense
meta:
  last updated:
    v: 2021-01-02T08:58:31.578+11:00
language:
  v: en
text:
  status:
    v: extensions
  div:
    v: Generated Narrative: StructureDefinition DeviceDispense Last updated: 2021-01-02 08:58:31+1100 Name Flags Card. Type Description & Constraints<img src="[binary]" alt="doco" style="background-color: inherit"/> DeviceDispense 0..* DomainResource A record of dispensation of a device Elements defined in Ancestors:id, meta, implicitRules, language, <a href="http://hl7.org/fhir/R5/domainresource.html" title="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.">text, contained, <a href="http://hl7.org/fhir/R5/domainresource.html" title="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 managable, 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.">extension, <a href="http://hl7.org/fhir/R5/domainresource.html" title="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 managable, 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…
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-category
    l: structuredefinition-category
  value: String
    v: Clinical.Device
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status
    l: structuredefinition-standards-status
  value: Code
    v: normative
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm
    l: structuredefinition-fmm
  value: Integer
    v: 1
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category
    l: structuredefinition-security-category
  value: Code
    v: business
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/structuredefinition-wg
    l: structuredefinition-wg
  value: Code
    v: oo
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/entered-in-error-status
    l: entered-in-error-status
  value: Code
    v: .status = entered-in-error
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/additional-resource
    l: additional-resource
  value: Boolean
    v: true
url:
  v: http://hl7.org/fhir/StructureDefinition/DeviceDispense
  l: DeviceDispense
identifier:
  system:
    v: urn:ietf:rfc:3986
    l: 3986
  value:
    v: urn:oid:2.16.840.1.113883.4.642.5.1257
version:
  v: 0.1.0
name:
  v: DeviceDispense
status:
  v: draft
date:
  v: 2021-01-02T08:58:31+11:00
publisher:
  v: HL7 International / Orders and Observations
contact:
  name:
    v: HL7 Orders and Observations Workgroup
  telecom:
    system:
      v: url
    value:
      v: http://www.hl7.org/Special/committees/orders
  telecom:
    system:
      v: email
description:
  v: Indicates that a device is to be or has been dispensed for a named person/patient. This includes a description of the product (supply) provided and the instructions for using the device.
jurisdiction:
  coding:
    system:
      v: http://unstats.un.org/unsd/methods/m49/m49.htm
      l: m49.htm
    code:
      v: 001
fhir version:
  v: 6.0.0-ballot3
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
mapping:
  identity:
    v: workflow
  uri:
    v: http://hl7.org/fhir/workflow
    l: workflow
  name:
    v: Workflow Pattern
mapping:
  identity:
    v: rim
  uri:
    v: http://hl7.org/v3
    l: v3
  name:
    v: RIM Mapping
kind:
  v: resource
abstract:
  v: false
type:
  v: DeviceDispense
  l: DeviceDispense
base definition:
  v: http://hl7.org/fhir/StructureDefinition/DomainResource
  l: DomainResource
derivation:
  v: specialization
snapshot:
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/snapshot-base-version
      l: snapshot-base-version
    value: String
      v: 6.0.0-ballot3
  element:
    id:
      v: DeviceDispense
    extension:
      url:
        v: http://hl7.org/fhir/build/StructureDefinition/svg
        l: http://hl7.org/fhir/build/StructureDefinition/svg
      value: Code
        v: -170,0
    path:
      v: DeviceDispense
    short:
      v: A record of dispensation of a device
    definition:
      v: A record of dispensation of a device - i.e., assigning a device to a patient, or to a professional for their use.
    min:
      v: 0
    max:
      v: *
    base:
      path:
        v: DomainResource
      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()
      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.trace('id') in %resource.descendants().select(reference | as(uri))) or descendants().where(reference='#' | as(uri)='#').exists()).not()).trace('unmatched', id).empty()
      source:
        v: http://hl7.org/fhir/StructureDefinition/DomainResource
        l: DomainResource
    constraint:
      key:
        v: dom-4
      severity:
        v: error

v: If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated

v: contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()

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()
source:
  v: http://hl7.org/fhir/StructureDefinition/DomainResource
  l: DomainResource

extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice
    l: elementdefinition-bestpractice
  value: Boolean
    v: true
extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation
    l: elementdefinition-bestpractice-explanation
  value: 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.
key:
  v: dom-6
severity:
  v: warning
human:
  v: A resource should have narrative for robust management
expression:
  v: text.`div`.exists()
source:
  v: http://hl7.org/fhir/StructureDefinition/DomainResource
  l: DomainResource

v: false

v: false

v: false

identity:
  v: workflow
map:
  v: Event

identity:
  v: w5
map:
  v: administrative.device

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

id:
  v: DeviceDispense.id
path:
  v: DeviceDispense.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: Within the context of the FHIR RESTful interactions, the resource has an id except for cases like the create and conditional update. Otherwise, the use of the resouce id depends on the given use case.
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
must support:
  v: false
is modifier:
  v: false
is summary:
  v: true

id:
  v: DeviceDispense.meta
path:
  v: DeviceDispense.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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: false
is modifier:
  v: false
is summary:
  v: true

id:
  v: DeviceDispense.implicitRules
path:
  v: DeviceDispense.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 its 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: false
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 its meaning or interpretation
is summary:
  v: true

id:
  v: DeviceDispense.language
path:
  v: DeviceDispense.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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: false
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: Language
  strength:
    v: required
  description:
    v: IETF language tag for a human language
  value set:
    v: http://hl7.org/fhir/ValueSet/all-languages|6.0.0-ballot3
    l: http://hl7.org/fhir/ValueSet/all-languages
  additional:
    purpose:
      v: starter
    value set:
      v: http://hl7.org/fhir/ValueSet/languages|6.0.0-ballot3
      l: http://hl7.org/fhir/ValueSet/languages

id:
  v: DeviceDispense.text
path:
  v: DeviceDispense.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 a 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
condition:
  v: dom-6
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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: false
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: Act.text?

id:
  v: DeviceDispense.contained
path:
  v: DeviceDispense.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, nor can they have their own independent transaction scope. This is allowed to be a Parameters resource if and only if it is referenced by a resource that provides context/meaning.
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. Contained resources may be a resource type defined in the FHIR specification, or an [additional resource](http://build.fhir.org/resource.html#additional).
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
condition:
  v: dom-2
condition:
  v: dom-4
condition:
  v: dom-3
condition:
  v: dom-5
must support:
  v: false
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: DeviceDispense.extension
path:
  v: DeviceDispense.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and managable, 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: false
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: DeviceDispense.modifierExtension
path:
  v: DeviceDispense.modifierExtension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
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 managable, 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://build.fhir.org/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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
must support:
  v: false
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: true
mapping:
  identity:
    v: rim
  map:
    v: N/A

id:
  v: DeviceDispense.identifier
path:
  v: DeviceDispense.identifier
short:
  v: Business identifier for this dispensation
definition:
  v: Business identifier for this dispensation.
comment:
  v: This is a business identifier, not a resource identifier.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.identifier
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Identifier
    l: Identifier
is summary:
  v: true
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.identifier
mapping:
  identity:
    v: workflow
  map:
    v: Event.identifier

id:
  v: DeviceDispense.basedOn
path:
  v: DeviceDispense.basedOn
short:
  v: The order or request that this dispense is fulfilling
definition:
  v: The order or request that this dispense is fulfilling.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.basedOn
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/CarePlan
    l: CarePlan
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/DeviceRequest
    l: DeviceRequest
mapping:
  identity:
    v: workflow
  map:
    v: Event.basedOn

id:
  v: DeviceDispense.partOf
path:
  v: DeviceDispense.partOf
short:
  v: The bigger event that this dispense is a part of
definition:
  v: The bigger event that this dispense is a part of.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.partOf
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Procedure
    l: Procedure
mapping:
  identity:
    v: workflow
  map:
    v: Event.partOf
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=COMP]/target[classCode=PROC,moodCode=EVN]

id:
  v: DeviceDispense.status
path:
  v: DeviceDispense.status
short:
  v: preparation | in-progress | cancelled | on-hold | completed | entered-in-error | stopped | declined | unknown
definition:
  v: A code specifying the state of the set of dispense events.
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: DeviceDispense.status
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: code
    l: code
is modifier:
  v: true
is modifier reason:
  v: This element is labelled 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: DeviceDispenseStatus
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/binding-definition
      l: binding-definition
    value: String
      v: A coded concept specifying the state of the dispense event.
  extension:
    url:
      v: http://hl7.org/fhir/build/StructureDefinition/v3-map
      l: v3-map
    value: String
      v: ActStatus
  strength:
    v: required
  description:
    v: Describes the lifecycle of the dispense.
  value set:
    v: http://hl7.org/fhir/ValueSet/devicedispense-status
    l: devicedispense-status
mapping:
  identity:
    v: workflow
  map:
    v: Event.status
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.status
mapping:
  identity:
    v: rim
  map:
    v: .statusCode

id:
  v: DeviceDispense.statusReason
path:
  v: DeviceDispense.statusReason
short:
  v: Why a dispense was or was not performed
definition:
  v: Indicates the reason why a dispense was or was not performed.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.statusReason
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableReference
    l: CodeableReference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/DetectedIssue
    l: DetectedIssue
binding:
  extension:
    url:
      v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
      l: elementdefinition-bindingName
    value: String
      v: DeviceDispenseStatusReason
  extension:
    url:
      v: http://hl7.org/fhir/tools/StructureDefinition/binding-definition
      l: binding-definition
    value: String
      v: A code describing why a dispense was or was not performed.
  strength:
    v: example
  value set:
    v: http://hl7.org/fhir/ValueSet/devicedispense-status-reason
    l: devicedispense-status-reason
mapping:
  identity:
    v: workflow
  map:
    v: Event.statusReason
mapping:
  identity:
    v: rim
  map:
    v: .outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code="not done reason"].value

id:
  v: DeviceDispense.category
path:
  v: DeviceDispense.category
short:
  v: Type of device dispense
definition:
  v: Indicates the type of device dispense.
comment:
  v: The category can be used to include where the device is expected to be consumed or other types of dispenses. Invariants can be used to bind to different value sets when profiling to bind.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.category
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
mapping:
  identity:
    v: workflow
  map:
    v: Event.category

id:
  v: DeviceDispense.device
path:
  v: DeviceDispense.device
short:
  v: What device was supplied
definition:
  v: Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: DeviceDispense.device
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: CodeableReference
    l: CodeableReference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device
    l: Device
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/DeviceDefinition
    l: DeviceDefinition
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Event.code
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.what[x]
mapping:
  identity:
    v: workflow
  map:
    v: Event.product

id:
  v: DeviceDispense.subject
path:
  v: DeviceDispense.subject
short:
  v: Who the dispense is for
definition:
  v: A link to a resource representing the person to whom the device is intended.
comment:
  v: Group is only allowed in the circumstance where the group represents a family or a household, and should not represent groups of Practitioners where other more specific resources can be used instead.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: DeviceDispense.subject
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group
    l: Group
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Event.subject
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject
mapping:
  identity:
    v: v2
  map:
    v: PID-3-Patient ID List
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=SBJ].role[classCode=PAT]

id:
  v: DeviceDispense.receiver
path:
  v: DeviceDispense.receiver
short:
  v: Who collected the device or where the medication was delivered
definition:
  v: Identifies the person who picked up the device or the person or location where the device was delivered. This may be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location.
comment:
  v: Group is only allowed in the circumstance where the group represents a family or a household, and should not represent groups of Practitioners where other more specific resources can be used instead.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.receiver
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
    l: RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Location
    l: Location
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    l: PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group
    l: Group
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=RCV].role

id:
  v: DeviceDispense.encounter
path:
  v: DeviceDispense.encounter
short:
  v: Encounter associated with event
definition:
  v: The encounter that establishes the context for this event.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.encounter
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Encounter
    l: Encounter
mapping:
  identity:
    v: workflow
  map:
    v: Event.encounter
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code="type of encounter or episode"]

id:
  v: DeviceDispense.supportingInformation
path:
  v: DeviceDispense.supportingInformation
short:
  v: Information that supports the dispensing of the device
definition:
  v: Additional information that supports the device being dispensed.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.supportingInformation
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Resource
    l: Resource
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.context

id:
  v: DeviceDispense.performer
path:
  v: DeviceDispense.performer
short:
  v: Who performed event
definition:
  v: Indicates who or what performed the event.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.performer
  min:
    v: 0
  max:
    v: *
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 or both
  expression:
    v: hasValue() or (children().count() > id.count())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
mapping:
  identity:
    v: workflow
  map:
    v: Event.performer
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=PRF]

id:
  v: DeviceDispense.performer.id
path:
  v: DeviceDispense.performer.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: id
      l: id
  code:
    v: http://hl7.org/fhirpath/System.String
    l: System.String
condition:
  v: ele-1
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: DeviceDispense.performer.extension
path:
  v: DeviceDispense.performer.extension
slicing:
  discriminator:
    type:
      v: value
    path:
      v: url
  description:
    v: Extensions are always sliced by (at least) url
  rules:
    v: open
short:
  v: Additional content defined by implementations
definition:
  v: May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and managable, 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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
is modifier:
  v: false
is summary:
  v: false
mapping:
  identity:
    v: rim
  map:
    v: n/a

id:
  v: DeviceDispense.performer.modifierExtension
path:
  v: DeviceDispense.performer.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 managable, 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://build.fhir.org/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())
  source:
    v: http://hl7.org/fhir/StructureDefinition/Element
    l: Element
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: DeviceDispense.performer.function
path:
  v: DeviceDispense.performer.function
short:
  v: Who performed the dispense and what they did
definition:
  v: Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker.
requirements:
  v: Allows disambiguation of the types of involvement of different performers.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.performer.function
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
mapping:
  identity:
    v: rim
  map:
    v: participation[typeCode=PRF].functionCode

id:
  v: DeviceDispense.performer.actor
path:
  v: DeviceDispense.performer.actor
short:
  v: Individual who was performing
definition:
  v: The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device.
comment:
  v: Group is only allowed in the circumstance where the group represents a family or a household, and should not represent groups of Practitioners where other more specific resources can be used instead.
min:
  v: 1
max:
  v: 1
base:
  path:
    v: DeviceDispense.performer.actor
  min:
    v: 1
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    l: PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization
    l: Organization
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device
    l: Device
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
    l: RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/CareTeam
    l: CareTeam
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group
    l: Group
mapping:
  identity:
    v: workflow
  map:
    v: Event.performer.actor
mapping:
  identity:
    v: rim
  map:
    v: .role

id:
  v: DeviceDispense.location
path:
  v: DeviceDispense.location
short:
  v: Where the dispense occurred
definition:
  v: The principal physical location where the dispense was performed.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.location
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Location
    l: Location
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=LOC].role
mapping:
  identity:
    v: workflow
  map:
    v: Event.location

id:
  v: DeviceDispense.type
path:
  v: DeviceDispense.type
short:
  v: Trial fill, partial fill, emergency fill, etc
definition:
  v: Indicates the type of dispensing event that is performed.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.type
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept

id:
  v: DeviceDispense.quantity
path:
  v: DeviceDispense.quantity
short:
  v: Amount dispensed
definition:
  v: The number of devices that have been dispensed.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.quantity
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
mapping:
  identity:
    v: rim
  map:
    v: .quantity

id:
  v: DeviceDispense.preparedDate
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/committee-notes
    l: committee-notes
  value: String
    v: This is time of dispense (preparation). The time of supply to the patient is a separate attribute.
path:
  v: DeviceDispense.preparedDate
short:
  v: When product was packaged and reviewed
definition:
  v: The time when the dispensed product was packaged and reviewed.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.preparedDate
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: dateTime
    l: dateTime
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: .effectiveTime[xmi:type=IVL_TS].low

id:
  v: DeviceDispense.whenHandedOver
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/committee-notes
    l: committee-notes
  value: String
    v: The time of handing over to the patient (pickup/handover in community or supply in inpatient).
path:
  v: DeviceDispense.whenHandedOver
short:
  v: When product was given out
definition:
  v: The time the dispensed product was made available to the patient or their representative.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.whenHandedOver
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: dateTime
    l: dateTime
mapping:
  identity:
    v: workflow
  map:
    v: Event.occurrence[x]
mapping:
  identity:
    v: rim
  map:
    v: .effectiveTime[xmi:type=IVL_TS].high

id:
  v: DeviceDispense.destination
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/committee-notes
    l: committee-notes
  value: String
    v: for inpatient setting this is core, but this might not be core for community setting. Also core for internet pharmacy. Core for radioactive materials Will service delivery location be defined by another group?
path:
  v: DeviceDispense.destination
short:
  v: Where the device was sent or should be sent
definition:
  v: Identification of the facility/location where the device was /should be shipped to, as part of the dispense process.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.destination
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Location
    l: Location
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=DST].role

id:
  v: DeviceDispense.note
path:
  v: DeviceDispense.note
short:
  v: Information about the dispense
definition:
  v: Extra information about the dispense that could not be conveyed in the other attributes.
min:
  v: 0
max:
  v: *
base:
  path:
    v: DeviceDispense.note
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Annotation
    l: Annotation
mapping:
  identity:
    v: workflow
  map:
    v: Event.note
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=SUBJ]/source[classCode=ACT,moodCode=EVN]

id:
  v: DeviceDispense.usageInstruction
path:
  v: DeviceDispense.usageInstruction
short:
  v: Full representation of the usage instructions
definition:
  v: The full representation of the instructions.
comment:
  v: The content of the renderedDosageInstructions must not be different than the dose represented in the dosageInstruction content.
min:
  v: 0
max:
  v: 1
base:
  path:
    v: DeviceDispense.usageInstruction
  min:
    v: 0
  max:
    v: 1
type:
  code:
    v: markdown
    l: markdown

id:
  v: DeviceDispense.relevantHistory
path:
  v: DeviceDispense.relevantHistory
short:
  v: A list of relevant lifecycle events
definition:
  v: A summary of the events of interest that have occurred, such as when the dispense was verified.
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: DeviceDispense.relevantHistory
  min:
    v: 0
  max:
    v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Provenance
    l: Provenance
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship(typeCode=SUBJ].source[classCode=CACT, moodCode=EVN]
mapping:
  identity:
    v: workflow
  map:
    v: Event.relevantHistory

element:
  id:
    v: DeviceDispense
  extension:
    url:
      v: http://hl7.org/fhir/build/StructureDefinition/svg
      l: http://hl7.org/fhir/build/StructureDefinition/svg
    value: Code
      v: -170,0
  path:
    v: DeviceDispense
  short:
    v: A record of dispensation of a device
  definition:
    v: A record of dispensation of a device - i.e., assigning a device to a patient, or to a professional for their use.
  min:
    v: 0
  max:
    v: *
  mapping:
    identity:
      v: workflow
    map:
      v: Event
  mapping:
    identity:
      v: w5
    map:
      v: administrative.device
element:
  id:
    v: DeviceDispense.identifier
  path:
    v: DeviceDispense.identifier
  short:
    v: Business identifier for this dispensation
  definition:
    v: Business identifier for this dispensation.
  comment:
    v: This is a business identifier, not a resource identifier.
  min:
    v: 0
  max:
    v: *
  type:
    code:
      v: Identifier
      l: Identifier
  is summary:
    v: true
  mapping:
    identity:
      v: w5
    map:
      v: FiveWs.identifier
  mapping:
    identity:
      v: workflow
    map:
      v: Event.identifier
element:
  id:
    v: DeviceDispense.basedOn
  path:
    v: DeviceDispense.basedOn
  short:
    v: The order or request that this dispense is fulfilling
  definition:
    v: The order or request that this dispense is fulfilling.
  min:
    v: 0
  max:
    v: *
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: http://hl7.org/fhir/StructureDefinition/CarePlan
      l: CarePlan
    target profile:
      v: http://hl7.org/fhir/StructureDefinition/DeviceRequest
      l: DeviceRequest
  mapping:
    identity:
      v: workflow
    map:
      v: Event.basedOn
element:
  id:
    v: DeviceDispense.partOf
  path:
    v: DeviceDispense.partOf
  short:
    v: The bigger event that this dispense is a part of
  definition:
    v: The bigger event that this dispense is a part of.
  min:
    v: 0
  max:
    v: *
  type:
    code:
      v: Reference
      l: Reference
    target profile:
      v: http://hl7.org/fhir/StructureDefinition/Procedure
      l: Procedure
  mapping:
    identity:
      v: workflow
    map:
      v: Event.partOf
  mapping:
    identity:
      v: rim
    map:
      v: .outboundRelationship[typeCode=COMP]/target[classCode=PROC,moodCode=EVN]
element:
  id:
    v: DeviceDispense.status
  path:
    v: DeviceDispense.status
  short:
    v: preparation | in-progress | cancelled | on-hold | completed | entered-in-error | stopped | declined | unknown
  definition:
    v: A code specifying the state of the set of dispense events.
  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
  type:
    code:
      v: code
      l: code
  is modifier:
    v: true
  is modifier reason:
    v: This element is labelled 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: DeviceDispenseStatus
    extension:
      url:
        v: http://hl7.org/fhir/tools/StructureDefinition/binding-definition
        l: binding-definition
      value: String
        v: A coded concept specifying the state of the dispense event.
    extension:
      url:
        v: http://hl7.org/fhir/build/StructureDefinition/v3-map
        l: v3-map
      value: String
        v: ActStatus
    strength:
      v: required
    description:
      v: Describes the lifecycle of the dispense.
    value set:
      v: http://hl7.org/fhir/ValueSet/devicedispense-status
      l: devicedispense-status
  mapping:
    identity:
      v: workflow
    map:
      v: Event.status
  mapping:
    identity:
      v: w5
    map:
      v: FiveWs.status
  mapping:
    identity:
      v: rim
    map:
      v: .statusCode
element:
  id:
    v: DeviceDispense.statusReason
  path:
    v: DeviceDispense.statusReason
  short:
    v: Why a dispense was or was not performed
  definition:
    v: Indicates the reason why a dispense was or was not performed.
  min:
    v: 0
  max:
    v: 1
  type:
    code:
      v: CodeableReference
      l: CodeableReference
    target profile:
      v: http://hl7.org/fhir/StructureDefinition/DetectedIssue
      l: DetectedIssue

extension:
  url:
    v: http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName
    l: elementdefinition-bindingName
  value: String
    v: DeviceDispenseStatusReason
extension:
  url:
    v: http://hl7.org/fhir/tools/StructureDefinition/binding-definition
    l: binding-definition
  value: String
    v: A code describing why a dispense was or was not performed.
strength:
  v: example
value set:
  v: http://hl7.org/fhir/ValueSet/devicedispense-status-reason
  l: devicedispense-status-reason

identity:
  v: workflow
map:
  v: Event.statusReason

identity:
  v: rim
map:
  v: .outboundRelationship[typeCode=RSON]/target[classCode=OBS,moodCode=EVN, code="not done reason"].value

id:
  v: DeviceDispense.category
path:
  v: DeviceDispense.category
short:
  v: Type of device dispense
definition:
  v: Indicates the type of device dispense.
comment:
  v: The category can be used to include where the device is expected to be consumed or other types of dispenses. Invariants can be used to bind to different value sets when profiling to bind.
min:
  v: 0
max:
  v: *
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
mapping:
  identity:
    v: workflow
  map:
    v: Event.category

id:
  v: DeviceDispense.device
path:
  v: DeviceDispense.device
short:
  v: What device was supplied
definition:
  v: Identifies the device being dispensed. This is either a link to a resource representing the details of the device or a simple attribute carrying a code that identifies the device from a known list of devices.
min:
  v: 1
max:
  v: 1
type:
  code:
    v: CodeableReference
    l: CodeableReference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device
    l: Device
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/DeviceDefinition
    l: DeviceDefinition
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Event.code
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.what[x]
mapping:
  identity:
    v: workflow
  map:
    v: Event.product

id:
  v: DeviceDispense.subject
path:
  v: DeviceDispense.subject
short:
  v: Who the dispense is for
definition:
  v: A link to a resource representing the person to whom the device is intended.
comment:
  v: Group is only allowed in the circumstance where the group represents a family or a household, and should not represent groups of Practitioners where other more specific resources can be used instead.
min:
  v: 1
max:
  v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group
    l: Group
is summary:
  v: true
mapping:
  identity:
    v: workflow
  map:
    v: Event.subject
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.subject
mapping:
  identity:
    v: v2
  map:
    v: PID-3-Patient ID List
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=SBJ].role[classCode=PAT]

id:
  v: DeviceDispense.receiver
path:
  v: DeviceDispense.receiver
short:
  v: Who collected the device or where the medication was delivered
definition:
  v: Identifies the person who picked up the device or the person or location where the device was delivered. This may be a patient or their caregiver, but some cases exist where it can be a healthcare professional or a location.
comment:
  v: Group is only allowed in the circumstance where the group represents a family or a household, and should not represent groups of Practitioners where other more specific resources can be used instead.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
    l: RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Location
    l: Location
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    l: PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group
    l: Group
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=RCV].role

id:
  v: DeviceDispense.encounter
path:
  v: DeviceDispense.encounter
short:
  v: Encounter associated with event
definition:
  v: The encounter that establishes the context for this event.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Encounter
    l: Encounter
mapping:
  identity:
    v: workflow
  map:
    v: Event.encounter
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=COMP].source[classCode=ENC, moodCode=EVN, code="type of encounter or episode"]

id:
  v: DeviceDispense.supportingInformation
path:
  v: DeviceDispense.supportingInformation
short:
  v: Information that supports the dispensing of the device
definition:
  v: Additional information that supports the device being dispensed.
min:
  v: 0
max:
  v: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Resource
    l: Resource
mapping:
  identity:
    v: w5
  map:
    v: FiveWs.context

id:
  v: DeviceDispense.performer
path:
  v: DeviceDispense.performer
short:
  v: Who performed event
definition:
  v: Indicates who or what performed the event.
min:
  v: 0
max:
  v: *
type:
  code:
    v: BackboneElement
    l: BackboneElement
mapping:
  identity:
    v: workflow
  map:
    v: Event.performer
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=PRF]

id:
  v: DeviceDispense.performer.function
path:
  v: DeviceDispense.performer.function
short:
  v: Who performed the dispense and what they did
definition:
  v: Distinguishes the type of performer in the dispense. For example, date enterer, packager, final checker.
requirements:
  v: Allows disambiguation of the types of involvement of different performers.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept
mapping:
  identity:
    v: rim
  map:
    v: participation[typeCode=PRF].functionCode

id:
  v: DeviceDispense.performer.actor
path:
  v: DeviceDispense.performer.actor
short:
  v: Individual who was performing
definition:
  v: The device, practitioner, etc. who performed the action. It should be assumed that the actor is the dispenser of the device.
comment:
  v: Group is only allowed in the circumstance where the group represents a family or a household, and should not represent groups of Practitioners where other more specific resources can be used instead.
min:
  v: 1
max:
  v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Practitioner
    l: Practitioner
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/PractitionerRole
    l: PractitionerRole
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Organization
    l: Organization
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Patient
    l: Patient
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Device
    l: Device
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/RelatedPerson
    l: RelatedPerson
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/CareTeam
    l: CareTeam
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Group
    l: Group
mapping:
  identity:
    v: workflow
  map:
    v: Event.performer.actor
mapping:
  identity:
    v: rim
  map:
    v: .role

id:
  v: DeviceDispense.location
path:
  v: DeviceDispense.location
short:
  v: Where the dispense occurred
definition:
  v: The principal physical location where the dispense was performed.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Location
    l: Location
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=LOC].role
mapping:
  identity:
    v: workflow
  map:
    v: Event.location

id:
  v: DeviceDispense.type
path:
  v: DeviceDispense.type
short:
  v: Trial fill, partial fill, emergency fill, etc
definition:
  v: Indicates the type of dispensing event that is performed.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: CodeableConcept
    l: CodeableConcept

id:
  v: DeviceDispense.quantity
path:
  v: DeviceDispense.quantity
short:
  v: Amount dispensed
definition:
  v: The number of devices that have been dispensed.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: Quantity
    l: Quantity
  profile:
    v: http://hl7.org/fhir/StructureDefinition/SimpleQuantity
    l: SimpleQuantity
mapping:
  identity:
    v: rim
  map:
    v: .quantity

id:
  v: DeviceDispense.preparedDate
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/committee-notes
    l: committee-notes
  value: String
    v: This is time of dispense (preparation). The time of supply to the patient is a separate attribute.
path:
  v: DeviceDispense.preparedDate
short:
  v: When product was packaged and reviewed
definition:
  v: The time when the dispensed product was packaged and reviewed.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: dateTime
    l: dateTime
is summary:
  v: true
mapping:
  identity:
    v: rim
  map:
    v: .effectiveTime[xmi:type=IVL_TS].low

id:
  v: DeviceDispense.whenHandedOver
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/committee-notes
    l: committee-notes
  value: String
    v: The time of handing over to the patient (pickup/handover in community or supply in inpatient).
path:
  v: DeviceDispense.whenHandedOver
short:
  v: When product was given out
definition:
  v: The time the dispensed product was made available to the patient or their representative.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: dateTime
    l: dateTime
mapping:
  identity:
    v: workflow
  map:
    v: Event.occurrence[x]
mapping:
  identity:
    v: rim
  map:
    v: .effectiveTime[xmi:type=IVL_TS].high

id:
  v: DeviceDispense.destination
extension:
  url:
    v: http://hl7.org/fhir/build/StructureDefinition/committee-notes
    l: committee-notes
  value: String
    v: for inpatient setting this is core, but this might not be core for community setting. Also core for internet pharmacy. Core for radioactive materials Will service delivery location be defined by another group?
path:
  v: DeviceDispense.destination
short:
  v: Where the device was sent or should be sent
definition:
  v: Identification of the facility/location where the device was /should be shipped to, as part of the dispense process.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Location
    l: Location
mapping:
  identity:
    v: rim
  map:
    v: .participation[typeCode=DST].role

id:
  v: DeviceDispense.note
path:
  v: DeviceDispense.note
short:
  v: Information about the dispense
definition:
  v: Extra information about the dispense that could not be conveyed in the other attributes.
min:
  v: 0
max:
  v: *
type:
  code:
    v: Annotation
    l: Annotation
mapping:
  identity:
    v: workflow
  map:
    v: Event.note
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship[typeCode=SUBJ]/source[classCode=ACT,moodCode=EVN]

id:
  v: DeviceDispense.usageInstruction
path:
  v: DeviceDispense.usageInstruction
short:
  v: Full representation of the usage instructions
definition:
  v: The full representation of the instructions.
comment:
  v: The content of the renderedDosageInstructions must not be different than the dose represented in the dosageInstruction content.
min:
  v: 0
max:
  v: 1
type:
  code:
    v: markdown
    l: markdown

id:
  v: DeviceDispense.relevantHistory
path:
  v: DeviceDispense.relevantHistory
short:
  v: A list of relevant lifecycle events
definition:
  v: A summary of the events of interest that have occurred, such as when the dispense was verified.
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: *
type:
  code:
    v: Reference
    l: Reference
  target profile:
    v: http://hl7.org/fhir/StructureDefinition/Provenance
    l: Provenance
mapping:
  identity:
    v: rim
  map:
    v: .inboundRelationship(typeCode=SUBJ].source[classCode=CACT, moodCode=EVN]
mapping:
  identity:
    v: workflow
  map:
    v: Event.relevantHistory