This wiki has undergone a migration to Confluence found Here

Difference between revisions of "Core Properties of V3 Models"

From HL7Wiki
Jump to navigation Jump to search
Line 157: Line 157:
 
| Add
 
| Add
 
| Y  
 
| Y  
 +
|
 
| Y
 
| Y
 
|-
 
|-
 
| Remove
 
| Remove
 
| Y  
 
| Y  
 +
|
 
| Y
 
| Y
 
|-
 
|-
Line 169: Line 171:
 
| Add or Replace
 
| Add or Replace
 
| Y  
 
| Y  
 +
|
 
| Y
 
| Y
 
|-
 
|-
 
| No change
 
| No change
 
| Y  
 
| Y  
 +
|
 
| Y
 
| Y
 
|-
 
|-
 
| Unknown
 
| Unknown
 
| Y  
 
| Y  
 +
|
 
| Y
 
| Y
 
|}
 
|}

Revision as of 02:05, 16 January 2008

Core Properties of V3 Models

Preface

Notes to Readers

This is the first release of this document. It is intended to provide important background information for implementors trying to implement V3 Static Models, whether they are found in Messages, Documents, or Service Payloads.

Acknowledgements

Authors:

  • George W Beeler
  • Grahame Grieve

Introduction and Scope

  • a description of the Document at a minimum sufficient for a person unfamiliar with the work to understand the document’s business, scope and relationship with HL7.
  • the need for a Specification.

V3 Static Models: Overview

All V3 Static Models are comprised of #RIM classes linked by associations. The classes have attributes which are assigned #datatypes. Some attributes are associated with controlled #vocabularies which provide clearly defined semantic meaning to the static models.

RIM

The RIM defines all the classes that are used in static models. The classes are standard classes in the UML sense, and have associations and attributes as defined in the RIM models.

Datatypes

The datatypes define the types that may be used for the attributes of the RIM classes. The semantics of the types are defined in the abstract datatypes, while the [[ITS datatypes] define an XML implementation of the datatypes

Vocabulary

comments about constraints

Refinement, Constraint, and Localization

Templates

Comments about classes, associations, attributes, datatypes and controlled vocabularies

Key Concepts

Null Flavor

Background and History

In version 2, the initial set of messages supported a means of communication known as ‘snapshot’ mode. Essentially, whenever data was revised, the sender sent a message containing all the data they knew about an item. All of the data was sent regardless of whether only one item had changed or whether all the data had changed. If the receiver wished to know what specific information had changed they were required to perform a comparison between the data sent in a previous message and the current message.

As the version 2 specification evolved, several segments added fields called ‘Action code’ or something similar that permitted an indication of whether the data in the segment were being added, modified, deleted, or were unchanged. This action code was frequently accompanied by additional fields which identified the user responsible for the change, the time at which the change occurred and the reason for the change. The use of ‘action code’ and its associated attributes allowed more fine-grained control of the data exchange, and eliminated the need for comparisons and for sending all of the data all the time.

When version 3 was conceived, the idea of ‘action codes’ was reflected in the concept of ‘UpdateMode’, which was proposed to be a generic concept present on all data elements. As included in MDF 99, it provided the same functionality as ‘Action Code’ as well as new features specific to controlling items within a list and the use of data as a key or verification in determining the match for a modification.

As v3 moved from practice to theory in 2000-2001, questions arose about exactly how it was intended to be used, appropriate default values, its use in CMETs, how to manage the verification and ‘key’ features and other concerns. To allow work on v3 development to proceed, the Modeling and Methodology Technical Committee decided that the use of UpdateMode would be excluded from artifacts until such time as it was found to be necessary and was sufficiently understood. While UpdateMode was always available for use in RoseTree, it was not supported as part of the R-MIM Designer or Schema Generator.

In 2003, RCRIM sought and received special permission to allow UpdateMode to be used for one of the associations in their model. Modifications were made to the Schema Generator tool, but the R-MIM designer was left unchanged.

There have recently been several use-cases identified that necessitate the broader application of UpdateMode. The issue was discussed on the Control Query (now Infrastructure and Messaging) list beginning around January 2004 and was also discussed at the January and May 2004 WG meetings. Norman Daoust moderated and documented the discussions. This discussion surfaced and attempted to resolve the numerous issues related to the use of UpdateMode.

Final decisions on most of the outstanding issues were made at the September 2004 WG meeting in Atlanta. This document describes the resulting guidelines for UpdateMode use, including issue resolutions from previous discussions.

Rationale

The principle purpose of UpdateMode is to allow a sending system to identify to a receiving system:

  • the changes that have occurred in an object controlled by the sending system; or
  • the changes that the sender desires to be made in an object controlled by the receiving system

Identifying such changes provides several benefits:

  1. The receiver does not need to compare data to determine what changes the sender has made
  2. Where the receiver gathers data from multiple sources, it does not need to store ‘images’ of data received from a particular sender to ensure that it can adequately compare to the previously sent data when determining changes
  3. Query responses are able to document accountability information in terms of what changes were performed.

The broader question of accountability history is principally incorporated in registry-type systems where there is a strong need for the receiver to establish the authority on which a particular piece of data is being changed. Understanding who made the change, when the change was made and why the change was made can all be important in helping the receiver make the determination whether they wish to adopt the change.

UpdateMode Methodology

The Update Mode values are:

Code Name Description
A Add The item was (or is to be) added, having not been present immediately before.
D Delete The item was (or is to be) removed (sometimes referred to as deleted)
R Replace The item existed previously and has (or is to be) revised.
AR Add or Replace The item was (or is to be) either added or replaced. (This option is included to support one specific case, discussed below. Its general use is discouraged, the preferred methodology is to use the combination of the individual Add and Replace values.)
N No Change There was (or is to be) no change to the item. This is primarily used when this element has not changed, but other attributes in the instance have changed.
U Unknown It’s not specified whether the item was (or is to be) added, revised, or not changed.

The meaning of UpdateMode depends on the circumstances in which it is used:

  1. When used in a message driven by a state-transition notification or a state-transition fulfillment request trigger event (where the focal class is an object owned by the sending system), UpdateMode represents the change that occurred on the sending system as a result of the state change associated with the trigger event. The recipient is not bound to make the same changes as those done on the sending system.
  2. When used in a message driven by a state-transition request trigger event (where the focal class is an object owned by the receiving system), UpdateMode represents the change that is desired by the sending system as a result of that trigger event. If the recipient accepts the request, they must make the requested changes.
  3. When used in a query response message, the UpdateMode represents the most recent change that has occurred to the sender’s object within back to a specified time. The committee may allow the time from which changes are reported to be specified by a query parameter or fixed by the query definition. If not otherwise specified, the start time is the first time the system became aware of the object.
  4. When an Replace or Add or Replace update mode is used on a set the receiver may have no way of knowing what the original set of data being replaced was. It is up to the receiver to determine whether they want to replace their existing set of data, add to their set of data, etc. If the sender wishes to be explicit, they should send discrete add and remove repetitions.

As per general methodology rules, data elements are always considered to apply only in the context of their association with the focal class. Thus deleting a name from a patient associated with an encounter should only be interpreted as a removal of the name for the purposes of the encounter. It is not an instruction to update the patient record within the system’s patient registry. (To update the patient registry, a message with a focal class of patient must be used.)

Message Designer Guidance

This section is intended for people designing message, typically HL7 domain committees.

When designing a model, a committee may allow UpdateMode to be used on attributes and associations identified by the committee1 To enable UpdateMode, the committee must select the set of permitted Update Modes.

In addition to identifying the allowed set of values, the committee may also choose to identify a ‘default’ UpdateMode for the attribute or association. This is the UpdateMode that will be assumed by the receiver if none is specified in the instance.

Update mode of “Replace” is not permitted on Entity.id, Role.id, Participation.id and Act.id attribute. If an identifier was captured erroneously, the incorrect submission should be nullified and the record resubmitted with the correct identifier. If a new identifier has been issued, replacing the old identifier, this should be handled as a supersedes or replaces relationship between the class with the old identifier and the class with the new identifier.

If no UpdateMode set is enabled for an attribute or association, it is the same as if the UpdateMode were set to ‘Unknown’. The effective behavior is that of ‘Snapshot’. I.e. the current element value is specified with no indication of whether it was changed or not.

When the upper cardinality of an attribute or an association using UpdateMode is greater than 1, the Update Modes are categorized into ‘set’ Update Modes and ‘item’ Update Modes. ‘Item’ Update Modes may be applied to any item within the collection. ‘Set’ Update Modes only apply to the set as a whole.

The following table specifies the allowable Update Modes in message specifications for each of these three cases.

Update Mode Value Upper cardinality of 1 ’Set’ Update Modes ‘Item’ Update Modes
Add Y Y
Remove Y Y
Replace Y Y
Add or Replace Y Y
No change Y Y
Unknown Y Y

When the UpdateMode of ‘Remove’ is specified for an attribute, the ‘key’ of the attribute that was deleted or is to be deleted is the value of the attribute . 2 When it is specified for an association, the association must point to an element with a populated id attribute, (or in circumstances where the association is to an ‘arrow’ class, the target of the arrow must have a populated id attribute. The id (potentially combined with the typeCode of the ‘arrow’ class) determines the identity of the item to be deleted. If a committee finds a use-case for using update modes for an association without an identifier attribute, they should contact the Modeling and Methodology Technical Committee.

The allowed UpdateMode set available for RIM attributes is empty by default. This means that committees must specifically enable UpdateMode by declaring an allowed set of Update Modes within their design for each attribute or association in their DIM where they want them to be used. Once an UpdateMode set has been defined in the DIM, any derived models (CIM, serialized static models or serialized message models). I.e. Update Modes may be removed from the allowed set, but never added.

If a committee defines update modes for a particular attribute or association, implementers must support the allowed update mode set to be conformant. (Failure to support the complete set defined by the committee may result in interoperability problems.) Implementers should be able to document what update modes they support in their conformance profile, but failure to support those identified by the committee that defined the artifact is considered non-conformant.

The committee does not need to define a default update mode, and may define a default at any derived model. Once a default is defined, it may not be removed or changed in any subsequently derived models. I.e. if a default is defined in an R-MIM, it may not be changed or removed in serialized static models or Message Types derived from that R-MIM. Because of this restriction, committees are discouraged from defining a default UpdateMode at the DIM level.

UpdateMode Usage Guidelines

  1. UpdateMode is not a concept that should appear in all, or even in most models developed by committees. It should be treated as an ‘advanced modeling concept’, and only employed in models where the facilitator is certain that the concept is needed to adequately reflect the needs identified by their committee. Furthermore it should only be enabled on those attributes or associations where there is an identified need.
     When a facilitator has identified a perceived requirement for UpdateMode in their model, they are encouraged to bring the requirement to the Modeling and Methodology Technical Committee for review.
  1. UpdateMode will primarily be used for trigger events where the state transition is “revise” and for query responses; however, it may be appropriate in other circumstances. Committees are encouraged to discuss additional patterns for usage so that they may be reflected in this document.
  2. UpdateMode should not be enabled in Transmission or ControlAct wrappers.
  3. There is no way to Remove a single element from a BAG where there are multiple matching elements because there is no means to indicate which occurrence within the bag is to be removed.
  4. Id attributes should never be sent with an UpdateMode of Replace. If such a use-case arises, it will addressed as a future methodology change.

Cardinality & Optionality

Conformance

Testing Considerations

Vocabulary Conformance

  • domains
  • coding strength

Type Representation

    • typing (typeId & flavorId & templates)

Update control

Referencing Acts

Update Mode

  • doco
    • use cases
    • data types
    • classes

introduction to how RIM & datatypes fit together