6.1.2.5 Usage of Code Extension

DICOM supports Code Extension techniques if the Attribute Specific Character Set (0008,0005) is multi-valued. The method employed for Code Extension in DICOM is as described in ISO/IEC 2022:1994. The following assumptions shall be made and the following restrictions shall apply:

6.1.2.5.1 Assumed Initial States

⎯ Code element G0 and code element G1 (in 8-bit mode only) are always invoked in the GL and GR areas of the code table respectively. Designated character sets for these code elements are immediately in use. Code elements G2 and G3 are not used.

⎯ The primary set of Control Characters shall always be designated as the C0 code element and this shall be invoked in the CL area of the code table. The C1 code element shall not be used.

6.1.2.5.2 Restrictions for Code Extension

⎯ As code elements G0 and G1 always have shift status, Locking Shifts (SI, SO) are not required and shall not be used.

⎯ As code elements G2 and G3 are not used, Single Shifts (SS2 and SS3) cannot be used.

⎯ Only the ESC sequences specified in PS 3.3 shall be used to activate Code Elements.

6.1.2.5.3 Requirements

The character set specified by value 1 of the Attribute Specific Character Set (0008,0005), or the default character repertoire if value 1 is missing, shall be active at the beginning of each textual Data Element value, and at the beginning of each line (i.e., after a CR and/or LF) or page (i.e., after an FF).

If within a textual value a character set other than the one specified in value 1 of the Attribute Specific Character Set (0008,0005), or the default character repertoire if value 1 is missing, has been invoked, the character set specified in the value 1, or the default character repertoire if value 1 is missing, shall be active in the following instances:

⎯ before the end of line (i.e., before the CR and/or LF)

⎯ before the end of a page (i.e. before the FF)

⎯ before the end of a Data Element value (e.g. before the 05/12 character code which separates multiple textual Data Element Values — 05/12 corresponds to “\” (BACKSLASH) in the case of default repertoire IR-6 or “(” (YEN SIGN) in the case of IR-14 ).

If within a textual value a character set other than the one specified in value 1 of the Attribute Specific Character Set (0008,0005), or the default character repertoire if value 1 is missing, is used, the Escape Sequence of this character set must be inserted explicitly in the following instances:

⎯ before the first use of the character set in the line

⎯ before the first use of the character set in the page

⎯ before the first use of the character set in the Data Element value

⎯ before the first use of the character set in the name component and name component group in Data Element with a VR of PN

Note: These requirements allow an application to skip lines, values, or components in a textual data element and start the new line with a defined character set without the need to track the character set changes in the text skipped. A similar restriction appears in the RFCs describing the use of multi-byte character sets over the Internet. An Escape Sequence switching to the value 1 or default Specific Character Set is not needed within a line, value, or component if no Code Extensions are present. Nor is a switch needed to the value 1 or default Specific Character Set if this character set has only the G0 Code Element defined, and the G0 Code Element is still active.

6.1.2.5.4 Levels of Implementation and Initial Designation

a) Attribute Specific Character Set (0008,0005) not present:

7-bit code

Implementation level: ISO 2022 Level 1 - Elementary 7-bit code (code-level identifier 1)

Initial designation: ISO-IR 6 (ASCII) as G0.

Code Extension shall not be used.

b) Attribute Specific Character Set (0008,0005) single value other than “ISO_IR 192” or “GB18030”:

8-bit code

Implementation level: ISO 2022 Level 1 - Elementary 8-bit code (code-level identifier 11)

Initial designation: One of the ISO 8859-defined character sets, or the 8-bit code table of JIS X 0201 specified by value 1 of the Attribute Specific Character Set (0008,0005), as G0 and G1.

Code Extension shall not be used.

c) Attribute Specific Character Set (0008,0005) multi-valued:

8-bit code

Implementation level: ISO 2022 Level 4 - Redesignation of Graphic Character Sets within a Code (code-level identifier 14)

Initial designation: One of the ISO 8859-defined character sets, or the 8-bit code table of JIS X 0201 specified by value 1 of the Attribute Specific Character Set (0008,0005), as G0 and G1. If value 1 of the Attribute Specific Character Set (0008,0005) is empty, ISO-IR 6 (ASCII) is assumed as G0, and G1 is undefined.

All character sets specified in the various values of Attribute Specific Character Set (0008,0005), including value 1, may participate in Code Extension.

d) Attribute Specific Character Set (0008,0005) single value “ISO_IR 192” or “GB18030”:

variable length code

Implementation level: not specified (not compatible with ISO 2022)

Initial designation: as specified by value 1 of the Attribute Specific Character Set (0008,0005)

Code Extension shall not be used.