The Demo site for our new HL7 Version 2+ (plus) Standard
visit the hl7 website

Draft Website - For Review Purposes Only

CWE - coded with exceptions

As of v2.7 a third tuple, formerly known as triplet, has been added to the CWE data type. Additionally, 3 new components were added to each tuple such that each tuple now has a total of 7 components. The Original Text component applies to the CWE as a whole.

HL7 Component Table - CWE - coded with exceptions
Seq# Description Implement Flags Cardinality Length C.LEN Vocabulary Data Type
CWE
1 Identifier = [0..1]  20 ST
2 Text # [0..1] 199 ST
3

Name of Coding System MAY
True:
False:
C
[1..1]
[0..1]
[1..12]     0396 ID
4 Alternate Identifier = [0..1]  20 ST
5 Alternate Text # [0..1] 199 ST
6

Name of Alternate Coding System MAY
True:
False:
C
[1..1]
[0..1]
[1..12]     0396 ID
7

Coding System Version ID MAY
True:
False:
C =
[1..1]
[0..1]
 10 ST
8 Alternate Coding System Version ID = [0..1]  10 ST
9 Original Text # [0..1] 199 ST
10 Second Alternate Identifier = [0..1]  20 ST
11 Second Alternate Text # [0..1] 199 ST
12

Name of Second Alternate Coding System MAY
True:
False:
C
[1..1]
[0..1]
[1..12]     0396 ID
13 Second Alternate Coding System Version ID = [0..1]  10 ST
14

Coding System OID MAY
True:
False:
C =
[1..1]
[0..1]
199 ST
15 Value Set OID = [0..1] 199 ST
16

Value Set Version ID MAY
True:
False:
C =
[1..1]
[0..1]
  8 DTM
17

Alternate Coding System OID MAY
True:
False:
C =
[1..1]
[0..1]
199 ST
18 Alternate Value Set OID = [0..1] 199 ST
19

Alternate Value Set Version ID MAY
True:
False:
C =
[1..1]
[0..1]
  8 DTM
20

Second Alternate Coding System OID MAY
True:
False:
C =
[1..1]
[0..1]
199 ST
21 Second Alternate Value Set OID = [0..1] 199 ST
22 Second Alternate Value Set Version ID MAY
True:
False:
C =
[1..1]
[0..1]
  8 DTM

Components: <Identifier (ST)> & <Text (ST)> & <Name of Coding System (ID)> & <Alternate Identifier (ST)> & <Alternate Text (ST)> & <Name of Alternate Coding System (ID)> & <Coding System Version ID (ST)> & <Alternate Coding System Version ID (ST)> & <Original Text (ST)> & <Second Alternate Identifier (ST)> & <Second Alternate Text (ST)> & <Name of Second Alternate Coding System (ID)> & <Second Alternate Coding System Version ID (ST)> & <Coding System OID (ST)> & <Value Set OID (ST)> & <Value Set Version ID (DTM)> & <Alternate Coding System OID (ST)> & <Alternate Value Set OID (ST)> & <Alternate Value Set Version ID (DTM)> & <Second Alternate Coding System OID (ST)> & <Second Alternate Value Set OID (ST)> & <Second Alternate Value Set Version ID (DTM)>

Note: The Vocabulary TC is the steward of the CWE data type.


Definition: Specifies a coded element and its associated detail. The CWE data type is used when 1) more than one table may be applicable or 2) the specified HL7 or externally defined table may be extended with local values or 3) when text is in place, the code may be omitted.

The presence of two sets of equivalent codes in this data type is semantically different from a repetition of a CWE-type field. With repetition, several distinct codes (with distinct meanings) may be transmitted.

Usage Notes: The CWE data type should be used for coded fields with one or more of the following characteristics:

  • The identifier code (CWE.1) component is optional

  • The set of allowable values from which the identifier code is drawn may be extended on a site-specific basis

  • An exception identifier code may be encountered; that is, a code that is not defined in the value set (either model or site-extended).

This is in contrast to the CNE data type, which requires a code from a non-extendable value set be sent in the identifier code component (CNE.1) in all cases (except, of course, if the entire field is empty and defined as optional at the segment level).

The rules for populating CWE components are governed by the status of the identifier code:

Identifier Code Status

Identifier Code (CWE.1)

Descriptive Text (CWE.2)

Coding System (CWE.3)

Contained in model value set

Populated

May be populated

Must be populated with model coding system, or (not recommended) site-specific coding system that is a superset containing model values.

Contained in site-specific extensions to model value set

Populated

May be populated

Site-specific coding system.

Contained in neither model nor extended value sets

Not populated

May be populated with the identifier code, free-text description, or a concatenation of the two. Should be human interpretable.

Must not be populated.

Not supplied; but descriptive text is supplied.

Not populated

May be populated with descriptive text.

Must not be populated.


As an example, consider “currency” codes where:

  • The model values are defined by the ISO 4217 value set,

  • The value set is extended on site to include the code HL7 – “HL7 Drink Ticket”, and

  • The data entry screen on the sending system does not enforce any edits for the currency code.

And so the value set used on site is:

Identifier Code Status

Identifier Code

Descriptive Text

Model values from ISO 4217 external table

AED

United Arab Emirates, Dirhams

AFA

Afghanistan, Afghanis

ALL

Albania, Leke

ZAR

South Africa, Rand

ZMK

Zambia, Kwacha

ZWD

Zimbabwe, Zimbabwe Dollars

Site-specific extension

HL7

HL7 Events, Drink Ticket


Collectively, this value set must be referred to with a local coding system ID, because “HL7” does not exist in ISO 4217. According to the rules, the site assigns the coding system ID “99CUR” to the value set.

Based on the code and descriptive text entered by the user on the sending system, the CWE would be populated as follows:

Entered by user

Sent in CWE

Code

Descriptive Text

Identifier Code (CWE.1)

Descriptive Text (CWE.2)

Coding System (CWE.3)

GBP

Great Britain, Pound

GBP

Great Britain, Pound

ISO4217

GBP

Great Britain, Pound

99CUR (This option is NOT recommended)

HL7

HL7 Drink Ticket

HL7

HL7 Drink Ticket

99CUR

XXX

<Bogus entry>

Must not be populated

XXX

Must not be populated.

Must not be populated

Bogus entry

Must not be populated.

Must not be populated

XXX: Bogus entry

Must not be populated.

Must not be populated

anything – or nothing.

Must not be populated.

Dollar

Must not be populated

Dollar

Must not be populated.

Valued from HL7 Table 0353 (e.g., “U” for unkown)

Dollar

HL70353


Notes:

  1. Where multiple valid options for sending the entered data exist, each alternative is depicted as a separate row.

  2. CWE.2 - Descriptive Text is never required, and there are no hard and fast rules on what text may be sent in this component. Of course, common sense suggests that if valued, the text should complement the identifier code of CWE.1.

It follows that where CWE.1 cannot be valued because the entered code does not exist in the value set, the entered code may be sent in CWE.2; with or without additional descriptive text. However, this is not required by HL7.

  1. The example with GBP shows two options for the code set: ISO4217 or 99CUR. While it is now technically possible to send 99CUR on the basis that this code may exist on its own in the extended local code set, HL7 urges that where a code is a member of the standard code set, that code set should be named in CWE.3. HL7 intends to mandate this in a future release.

  2. While there are no formal rules regarding the valuation of CWE.2 - Descriptive Text, it is expected that any value contained therein be meaningful to a human reader.

CWE-1: Identifier (ST)

Definition: The first component contains the sequence of characters (the code) that uniquely identifies the item being referenced by the CWE.2. Different coding schemes will have different elements here.

In the context of “Data Missing”, described above in the Usage Note, refer to HL7 Table 0353 – CWE Statuses for valid values.

HL7 Table 0353 - CWE statuses

Code

Description

Comment

U

Unknown

UASK

Asked but Unknown

NAV

Not available

NA

Not applicable

NASK

Not asked


Refer to section 2.5.5.5 in Chapter 2, Control, for some discussion on the length of this component.

CWE-2: Text (ST)

Definition: The second component contains the descriptive or textual name of the identifier, e.g., "myocardial infarction" or "X-ray impression".

CWE-3: Name of Coding System (ID)

Definition: The third component contains the code for the name of the coding system from which the value in CWE.1 is obtained. Each coding system is assigned a unique identifier. As of v2.7 this component is required when CWE.1 is populated and CWE.14 is not populated. Both CWE.3 and CWE.14 may be populated. Receivers should not identify a code based on its position within the tuples (Identifier, Alternate Identifier, or Second Alternate Identifier) or position within a repeating field. Instead, the receiver should always examine the codingSystem as specified in CWE.3 and/or CWE.14, the "Coding System" component or the "Coding System OID" for the tuple.

Refer to HL7 Table 0396 – Coding System in Chapter 2C, section "Coding System Table" for valid values.

Refer to section 2.A.8.3, "Name of Coding System (ID)" for a discussion of coding system conventions.

CWE-4: Alternate Identifier (ST)

Definition: A sequence of characters that uniquely identifies an alternate code. Analogous to CWE.1- Identifier.

Usage Notes: The Alternate Identifier is used to represent the local or user seen code as described. If present, it obeys the same rules of use and interpretation as described for component 1. If both are present, the identifiers in component 4 and component 1 should have exactly the same meaning, i.e., they should be exact synonyms.

CWE-5: Alternate Text (ST)

Definition: The descriptive or textual name of the alternate identifier. Analogous to CWE.2 - Text. See usage note in section introduction.

CWE-6: Name of Alternate Coding System (ID)

Definition: Identifies the coding scheme being used in the alternate identifier component. Analogous to CWE.3 - Name of Coding System. See usage note in section introduction.

As of v2.7 this component is required when CWE.4 is populated and CWE.17 is not populated. Both CWE.6 and CWE.17 may be populated. Receivers should not identify a code based on its position within the tuples (Identifier, Alternate Identifier, or Second Alternate Identifier) or position within a repeating field. Instead, the receiver should always examine the coding System as specified in CWE.6 and/or CWE.17, the "Coding System" component or the "Coding System OID", for the tuple.

CWE-7: Coding System Version ID (ST)

Definition: This component carries the version for the coding system identified by components 1-3. If CWE.3 is populated with a value other than HL7nnnn or is of table type user-defined, version ID must be valued with an actual version ID. If CWE.3 is populated with a value of HL7nnnn and nnnn is of table type HL7, version ID may have an actual value or it may be absent. If version ID is absent, it will be interpreted to have the same value as the HL7 version number in the message header.

CWE-8: Alternate Coding System Version ID (ST)

Definition: This component carries the version for the coding system identified by components 4-6. Analogous To CWE.7 - Coding System Version ID.

CWE-9: Original Text (ST)

Definition: The text as seen and/or selected by the user who entered the data. Original text can be used in a structured user interface to capture what the user saw as a representation of the code on the data input screen, or in a situation where the user dictates or directly enters text, it is the text entered or uttered by the user. In a situation where the code is assigned sometime after the text was entered, original text is the text or phrase used as the basis for assigning the code.

CWE-10: Second Alternate Identifier (ST)

Definition: A sequence of characters that uniquely identifies a second alternate code. Analogous to CWE.1- Identifier.

CWE-11: Second Alternate Text (ST)

Definition: The descriptive or textual name of the alternate identifier. Analogous to CWE.2 - Text. See usage note in section introduction.

CWE-12: Name of Second Alternate Coding System (ID)

Definition: Identifies the coding scheme being used in the alternate identifier component. Analogous to CWE.3 Name of Coding System. See usage note in section introduction.

As of v2.7 this component is required when CWE.10 is populated and CWE.20 is not populated. Both CWE.6 and CWE.17 may be populated. Receivers should not identify a code based on its position within the tuples (Identifier, Alternate Identifier, or Second Alternate Identifier) or position within a repeating field. Instead, the receiver should always examine the coding System as specified in CWE.12 and/or CWE.20, the "Coding System" component or the "Coding System OID", for the tuple.

CWE-13: Second Alternate Coding System Version ID (ST)

Definition: This component carries the version for the coding system identified by components 10-12. Analogous to CWE.7 - Coding System Version ID.

CWE-14: Coding System OID (ST)

Definition: This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.3. The value for this component for an HL7 or User Defined table SHALL be the value published for the code system OID for the table in Chapter 2C Code Tables. For externally defined code systems the OID registered in the HL7 OID registry SHALL be used.

This component is required when CWE.1 is populated and CWE.3 is not populated. Both CWE.3 and CWE.14 may be populated.

Note: If a code is provided, the meaning of the code must come from the definition of the code in the code system. The meaning of the code SHALL NOT depend on the value set. Applications SHALL NOT be required to interpret the code in light of the valueSet, and they SHALL NOT reject an instance because of the presence or absence of any or a particular value set/ value set version ID.


CWE-15: Value Set OID (ST)

Definition: This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.1 is obtained. The value for this component is identified for each of the HL7 Tables that have values published in Chapter 2C Code Tables. For externally defined value sets, the OID registered in the HL7 OID registry and/or published in an HL7 balloted Implementation Guide SHALL be used.

A value set may or need not be present irrespective of other fields.

Note: If a code is provided, the meaning of the code must come from the definition of the code in the code system. The meaning of the code SHALL NOT depend on the value set. Applications SHALL NOT be required to interpret the code in light of the valueSet, and they SHALL NOT reject an instance because of the presence or absence of any or a particular value set/ value set version ID.


CWE-16: Value Set Version ID (DTM)

Definition: This component carries the version for the value set identified by CWE.15. The version is a date. The date is the date/time that the value set being used was published.

Value set version ID is required if CWE.15 is populated.

CWE-17: Alternate Coding System OID (ST)

Definition: This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.6. Analogous to CWE.14 Coding System OID.

The value for this component for an HL7 or User Defined table SHALL be the value published for the code system OID for the table in Chapter 2C Code Tables. For externally defined code systems the OID registered in the HL7 OID registry SHALL be used.

This component is required when CWE.4 is populated and CWE.6 is not populated. Both CWE.6 and CWE.17 may be populated.

CWE-18: Alternate Value Set OID (ST)

Definition: This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.4 is obtained. The value for this component is identified for each of the HL7 Tables that have values published in Chapter 2C Code Tables. For externally defined value sets, the OID registered in the HL7 OID registry and/or published in an HL7 balloted Implementation Guide SHALL be used. A value set may or need not be present irrespective of other fields.

CWE-19: Alternate Value Set Version ID (DTM)

Definition: This component carries the version for the value set identified by CWE.18. The version is a date. The date is the date/time that the value set being used was published.

Value set version ID is required if CWE.18 is populated.

CWE-20: Second Alternate Coding System OID (ST)

Definition: This component contains the ISO Object Identifier (OID) for the coding system or value set named in CWE.12. Analogous to CWE.14 - Coding System OID.

The value for this component for an HL7 or User Defined table SHALL be the value published for the code system OID for the table in Chapter 2C Code Tables. For externally defined code systems the OID registered in the HL7 OID registry SHALL be used.

This component is required when CWE.10 is populated and CWE.12 is not populated. Both CWE.12 and CWE.20 may be populated.

CWE-21: Second Alternate Value Set OID (ST)

Definition: This component contains the ISO Object Identifier (OID) to allow identification of the value set from which the value in CWE.10 is obtained. The value for this component is identified for each of the HL7 Tables that have values published in Chapter 2C Code Tables. For externally defined value sets, the OID registered in the HL7 OID registry and/or published in an HL7 balloted Implementation Guide SHALL be used.

A value set may or need not be present irrespective of other fields

Note: If a code is provided, the meaning of the code must come from the definition of the code in the code system. The meaning of the code SHALL NOT depend on the value set. Applications SHALL NOT be required to interpret the code in light of the valueSet, and they SHALL NOT reject an instance because of the presence or absence of any or a particular value set/ value set version ID.


CWE-22: Second Alternate Value Set Version ID (DTM)

Definition: This component carries the version for the value set identified by CWE.21. The version is a date. The date is the date/time that the value set being used was published.

Value set version ID is required if CWE.21 is populated.