--- type: "resource-definitions" title: "MessageDefinition Definitions" resource: "MessageDefinition" --- # MessageDefinition Definitions ## MessageDefinition A resource that defines a type of message that can be exchanged between systems **Definition:** Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted. **Comments:** This would be a MIF-level artifact. **Cardinality:** 0..* **Constraints:** cnl-0 | warning | Name should be usable as an identifier for the module by machine processing applications such as code generation | name.exists() implies name.matches('^[A-Z]([A-Za-z0-9_]){1,254}$') **Mappings:** workflow=Definition; v2=N/A; rim=N/A; w5=infrastructure.exchange ## MessageDefinition.url The cannonical URL for a given MessageDefinition **Definition:** The business identifier that is used to reference the MessageDefinition and *is* expected to be consistent from server to server. **Comments:** Can be a urn:uuid: or a urn:oid: but real http: addresses are preferred. Multiple instances may share the same URL if they have a distinct version. The determination of when to create a new version of a resource (same url, new version) vs. defining a new artifact is up to the author. Considerations for making this decision are found in [Technical and Business Versions](resource.html#versions). In some cases, the resource can no longer be found at the stated url, but the url itself cannot change. Implementations can use the [meta.source](resource.html#meta) element to indicate where the current master source of the resource can be found. **Requirements:** Allows the message definition to be referenced by a single globally unique identifier. **Cardinality:** 0..1 **Type:** [uri](/uri) **Summary:** true **Constraints:** cnl-1 | warning | URL should not contain | or # - these characters make processing canonical references problematic | exists() implies matches('^[^|# ]+$') **Mappings:** workflow=Definition.url; w5=FiveWs.identifier ## MessageDefinition.identifier Business Identifier for a given MessageDefinition **Definition:** A formal identifier that is used to identify this message definition when it is represented in other formats, or referenced in a specification, model, design or an instance. **Requirements:** Allows externally provided and/or usable business identifiers to be easily associated with the module. **Cardinality:** 0..* **Type:** [Identifier](/Identifier) **Summary:** true **Mappings:** workflow=Definition.identifier; w5=FiveWs.identifier; objimpl=no-gen-base ## MessageDefinition.version Business version of the message definition **Definition:** The identifier that is used to identify this version of the message definition when it is referenced in a specification, model, design or instance. This is an arbitrary value managed by the message definition author and is not expected to be globally unique. For example, it might be a timestamp (e.g. yyyymmdd) if a managed version is not available. There is also no expectation that versions can be placed in a lexicographical sequence. **Comments:** There may be different message definition instances that have the same identifier but different versions. The version can be appended to the url in a reference to allow a reference to a particular business version of the message definition with the format [url]|[version]. The version SHOULD NOT contain a '#' - see [Business Version](resource.html#bv-format). **Cardinality:** 0..1 **Type:** [string](/string) **Summary:** true **Mappings:** workflow=Definition.version; w5=FiveWs.version ## MessageDefinition.versionAlgorithm[x] How to compare versions **Definition:** Indicates the mechanism used to compare versions to determine which is more current. **Comments:** If set as a string, this is a FHIRPath expression that has two additional context variables passed in - %version1 and %version2 and will return a negative number if version1 is newer, a positive number if version2 and a 0 if the version ordering can't be successfully be determined. **Cardinality:** 0..1 **Type:** [string](/string), [Coding](/Coding) **Binding:** extensible:[version-algorithm](/valueset-version-algorithm) **Summary:** true ## MessageDefinition.name Name for this message definition (computer friendly) **Definition:** A natural language name identifying the message definition. This name should be usable as an identifier for the module by machine processing applications such as code generation. **Comments:** The name is not expected to be globally unique. The name should be a simple alphanumeric type name to ensure that it is machine-processing friendly. **Requirements:** Support human navigation and code generation. **Conditions:** cnl-0 **Cardinality:** 0..1 **Type:** [string](/string) **Summary:** true **Mappings:** workflow=Definition.name ## MessageDefinition.title Name for this message definition (human friendly) **Definition:** A short, descriptive, user-friendly title for the message definition. **Comments:** This name does not need to be machine-processing friendly and may contain punctuation, white-space, etc. **Cardinality:** 0..1 **Type:** [string](/string) **Summary:** true **Mappings:** workflow=Definition.title ## MessageDefinition.replaces Takes the place of **Definition:** A MessageDefinition that is superseded by this definition. **Cardinality:** 0..* **Type:** [canonical](/canonical) **Summary:** true ## MessageDefinition.status draft | active | retired | unknown **Definition:** The status of this message definition. Enables tracking the life-cycle of the content. **Comments:** Allows filtering of message definitions that are appropriate for use versus not. See guidance around (not) making local changes to elements [here](canonicalresource.html#localization). **Cardinality:** 1..1 **Type:** [code](/code) **Binding:** required:[publication-status](/valueset-publication-status) **Summary:** true **Is Modifier:** true (Reason: This is labeled as "Is Modifier" because applications should not use a retired {{title}} without due consideration) **Mappings:** workflow=Definition.status; w5=FiveWs.status ## MessageDefinition.experimental For testing only - never for real usage **Definition:** A Boolean value to indicate that this message definition is authored for testing purposes (or education/evaluation/marketing) and no version of this resource will ever be intended for genuine usage. **Comments:** Allows filtering of message definitions that are appropriate for use versus not. Experimental resources might include example instances in implementation guides, instances created solely for testing purposes, etc. If experimental is 'true' for any version of a resource, it should be true for all versions of the resource. (If experimental changes, then it is being misused or a resource that was never intended for real-world use has unexpectedly changed its purpose.). Experimental resources are not expected to be stable and may well have breaking changes without a corresponding change to the 'version' element. **Requirements:** Enables experimental content to be developed following the same lifecycle that would be used for a production-level message definition. **Meaning if Missing:** If absent, this resource is treated as though it is not experimental. **Cardinality:** 0..1 **Type:** [boolean](/boolean) **Summary:** true **Mappings:** workflow=Definition.experimental; w5=FiveWs.class ## MessageDefinition.date Date last changed **Definition:** The date (and optionally time) when the message definition was last significantly changed. The date must change when the business version changes and it must change if the status code changes. In addition, it should change when the substantive content of the message definition changes. **Comments:** The date is often not tracked until the resource is published, but may be present on draft content. Note that this is not the same as the resource last-modified-date, since the resource may be a secondary representation of the message definition. Additional specific dates may be added as extensions or be found by consulting Provenances associated with past versions of the resource. See guidance around (not) making local changes to elements [here](canonicalresource.html#localization). **Aliases:** Revision Date **Cardinality:** 1..1 **Type:** [dateTime](/dateTime) **Summary:** true **Mappings:** workflow=Definition.date; w5=FiveWs.recorded ## MessageDefinition.publisher Name of the publisher/steward (organization or individual) **Definition:** The name of the organization or individual responsible for the release and ongoing maintenance of the message definition. **Comments:** Usually an organization but may be an individual. The publisher (or steward) of the message definition is the organization or individual primarily responsible for the maintenance and upkeep of the message definition. This is not necessarily the same individual or organization that developed and initially authored the content. The publisher is the primary point of contact for questions or issues with the message definition. This item SHOULD be populated unless the information is available from context. **Requirements:** Helps establish the "authority/credibility" of the message definition. May also allow for contact. **Cardinality:** 0..1 **Type:** [string](/string) **Summary:** true **Mappings:** workflow=Definition.publisher; w5=FiveWs.witness ## MessageDefinition.contact Contact details for the publisher **Definition:** Contact details to assist a user in finding and communicating with the publisher. **Comments:** May be a web site, an email address, a telephone number, etc. See guidance around (not) making local changes to elements [here](canonicalresource.html#localization). **Cardinality:** 0..* **Type:** [ContactDetail](/ContactDetail) **Summary:** true **Mappings:** workflow=Definition.contact ## MessageDefinition.description Natural language description of the message definition **Definition:** A free text natural language description of the message definition from a consumer's perspective. **Comments:** This description can be used to capture details such as comments about misuse, instructions for clinical use and interpretation, literature references, examples from the paper world, etc. It is not a rendering of the message definition as conveyed in the 'text' field of the resource itself. This item SHOULD be populated unless the information is available from context (e.g. the language of the message definition is presumed to be the predominant language in the place the message definition was created). **Cardinality:** 0..1 **Type:** [markdown](/markdown) **Summary:** true **Mappings:** workflow=Definition.description ## MessageDefinition.useContext The context that the content is intended to support **Definition:** The content was developed with a focus and intent of supporting the contexts that are listed. These contexts may be general categories (gender, age, ...) or may be references to specific programs (insurance plans, studies, ...) and may be used to assist with indexing and searching for appropriate message definition instances. **Comments:** When multiple useContexts are specified, there is no expectation that all or any of the contexts apply. **Requirements:** Assist in searching for appropriate content. **Cardinality:** 0..* **Type:** [UsageContext](/UsageContext) **Summary:** true **Mappings:** workflow=Definition.useContext ## MessageDefinition.jurisdiction Jurisdiction of the authority that maintains the message definition (if applicable) **Definition:** A legal or geographic region in which the authority that maintains the resource is operating. In general, the jurisdiction is also found in the useContext. The useContext may reference additional jurisdictions because the defining jurisdiction does not necessarily limit the jurisdictions of use. **Comments:** It may be possible for the message definition to be used in jurisdictions other than those for which it was originally designed or intended. DEPRECATION NOTE: For consistency, implementations are encouraged to migrate to using the new 'jurisdiction' code in the useContext element. (I.e. useContext.code indicating http://terminology.hl7.org/CodeSystem/usage-context-type#jurisdiction and useContext.valueCodeableConcept indicating the jurisdiction.) **Cardinality:** 0..* **Type:** [CodeableConcept](/CodeableConcept) **Binding:** extensible:[jurisdiction](/valueset-jurisdiction) **Summary:** true **Mappings:** workflow=Definition.jurisdiction ## MessageDefinition.purpose Why this message definition is defined **Definition:** Explanation of why this message definition is needed and why it has been designed as it has. **Comments:** This element does not describe the usage of the message definition. Instead, it provides traceability of ''why'' the resource is either needed or ''why'' it is defined as it is. This may be used to point to source materials or specifications that drove the structure of this message definition. **Cardinality:** 0..1 **Type:** [markdown](/markdown) **Summary:** true **Mappings:** workflow=Definition.purpose; w5=FiveWs.why[x]; objimpl=no-gen-base ## MessageDefinition.copyright Notice about intellectual property ownership, can include restrictions on use **Definition:** A copyright statement relating to the message definition and/or its contents. Copyright statements are notices of intellectual property ownership and can include restrictions on the use and publishing of the message definition. **Requirements:** Consumers must be able to determine any legal restrictions on the use of the message definition and/or its content. **Aliases:** License, Restrictions **Cardinality:** 0..1 **Type:** [markdown](/markdown) **Mappings:** workflow=Definition.copyright; objimpl=no-gen-base ## MessageDefinition.copyrightLabel Copyright holder and year(s) **Definition:** A short string (<50 characters), suitable for inclusion in a page footer that identifies the copyright holder, effective period, and optionally whether rights are restricted. (e.g. 'All rights reserved', 'Some rights reserved'). **Comments:** The copyright symbol and the '(c)' textual representation SHOULD NOT be included in this string. It will be added by software when rendering the notation. Full details about licensing, restrictions, warrantees, etc. goes in the more general 'copyright' element. **Requirements:** Defines the content expected to be rendered in all representations of the artifact. **Cardinality:** 0..1 **Type:** [string](/string) ## MessageDefinition.base Definition this one is based on **Definition:** The MessageDefinition that is the basis for the contents of this resource. **Cardinality:** 0..1 **Type:** [canonical](/canonical) **Summary:** true ## MessageDefinition.parent Protocol/workflow this is part of **Definition:** Identifies a protocol or workflow that this MessageDefinition represents a step in. **Comments:** It should be possible to use MessageDefinition to describe a message to be used by certain steps in a particular protocol as part of a PlanDefinition or ActivityDefinition. **Cardinality:** 0..* **Type:** [canonical](/canonical) **Summary:** true ## MessageDefinition.event[x] Event code or link to the EventDefinition **Definition:** Event code or link to the EventDefinition. **Cardinality:** 1..1 **Type:** [Coding](/Coding), [uri](/uri) **Binding:** example:[message-events](/valueset-message-events) **Summary:** true ## MessageDefinition.category consequence | currency | notification **Definition:** The impact of the content of the message. **Cardinality:** 0..1 **Type:** [code](/code) **Binding:** required:[message-significance-category](/valueset-message-significance-category) **Summary:** true ## MessageDefinition.focus Resource(s) that are the subject of the event **Definition:** Identifies the resource (or resources) that are being addressed by the event. For example, the Encounter for an admit message or two Account records for a merge. **Cardinality:** 0..* **Type:** [BackboneElement](/BackboneElement) **Summary:** true **Constraints:** md-1 | error | Max must be postive int or * | max='*' or (max.toInteger() > 0) ## MessageDefinition.focus.code Type of resource **Definition:** The kind of resource that must be the focus for this message. **Comments:** Multiple focuses addressing different resources may occasionally occur. E.g. to link or unlink a resource from a particular account or encounter, etc. **Cardinality:** 1..1 **Type:** [code](/code) **Binding:** required:[resource-types](/valueset-resource-types) **Summary:** true ## MessageDefinition.focus.profile Profile that must be adhered to by focus **Definition:** A profile that reflects constraints for the focal resource (and potentially for related resources). **Comments:** This should be present for most message definitions. However, if the message focus is only a single resource and there is no need to include referenced resources or otherwise enforce the presence of particular elements, it can be omitted. **Requirements:** This profile allows setting boundaries for what content must appear within the message bundle vs. outside based on the declared aggregation constraints on referenced resources on this and related profiles. **Cardinality:** 0..1 **Type:** [canonical](/canonical) ## MessageDefinition.focus.min Minimum number of focuses of this type **Definition:** Identifies the minimum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. **Cardinality:** 1..1 **Type:** [unsignedInt](/unsignedInt) **Summary:** true ## MessageDefinition.focus.max Maximum number of focuses of this type **Definition:** Identifies the maximum number of resources of this type that must be pointed to by a message in order for it to be valid against this MessageDefinition. **Conditions:** md-1 **Cardinality:** 0..1 **Type:** [string](/string) ## MessageDefinition.responseRequired always | on-error | never | on-success **Definition:** Declare at a message definition level whether a response is required or only upon error or success, or never. **Comments:** This enables the capability currently available through MSH-16 (Application Level acknowledgement) in HL7 Version 2 to declare at a message instance level whether a response is required or only upon error or success, or never. **Cardinality:** 0..1 **Type:** [code](/code) **Binding:** required:[messageheader-response-request](/valueset-messageheader-response-request) **Mappings:** v2=MSH-16 ## MessageDefinition.allowedResponse Responses to this message **Definition:** Indicates what types of messages may be sent as an application-level response to this message. **Comments:** This indicates an application level response to "close" a transaction implicit in a particular request message. To define a complete workflow scenario, look to the [[PlanDefinition]] resource which allows the definition of complex orchestrations, conditionality, etc. **Cardinality:** 0..* **Type:** [BackboneElement](/BackboneElement) ## MessageDefinition.allowedResponse.message Reference to allowed message definition response **Definition:** A reference to the message definition that must be adhered to by this supported response. **Cardinality:** 1..1 **Type:** [canonical](/canonical) ## MessageDefinition.allowedResponse.situation When should this response be used **Definition:** Provides a description of the circumstances in which this response should be used (as opposed to one of the alternative responses). **Cardinality:** 0..1 **Type:** [markdown](/markdown)