Data Types - Implementation Technology Specification for XML

Editor Gunther Schadow
Regenstrief Institute for Health Care
Editor Paul Vincent Biron
Kaiser Permanente
Editor Doug Pratt
Siemens Medical Solutions, Health Services Co.

1

Preface

This document specifies the HL7 Version 3 Data Types in the context of their XML Implementation Technology Specification (ITS). Although ITS dependent, this document can stand on it's own for the purpose of this ballot.

This document is based on the Data Types Abstract Specification, which is defines the data types on an abstract layer independent from representation. Because data types are very close to implementation technology (many even believe data types are nothing else then "formats" for data fields), the truly ITS independent specification was felt to be too abstract to serve as a commonly understood, primary reference ' for data types. Therefore it was decided at this point in tome to make the data type ITS the primary normative specification.

Vocabulary tables within this specification list the current contents of vocabulary domains for ease of reference by the reader. However, at any given time the normative source for these domains is the vocabulary tables in the RIM database. For some large domains, only a sample of possible values is shown. The complete domains can be referenced in the vocabulary tables by looking up the domain name associated with the table in the RIM vocabulary tables.

2

Acknowledgements

This standard is the result of several years of intense work through e-mail, telephone conferences and meeting discussions. Gunther Schadow (Regenstrief Institute for Health Care) chaired this task force, and is the main author of this document. Major contributions are from Mark Tucker (Regenstrief Institute), Paul V. Biron (Kaiser Permanente), Lloyd McKenzie (IBM), George Beeler, Douglas Pratt (Siemens), and Stan Huff (Intermountain Health Care), as well as Mike Henderson (Kaiser Permanente, now Eastern Informatics), Anthony Julian (Mayo), Joann Larson (Kaiser Permanente), Mark Shafarman (Oacis Healthcare Systems, now Oracle), Wes Rishel (Gartner Group), and Robin Zimmerman (Kaiser Permanente). Acknowledgements for their critical review and infusion of ideas go to Bob Dolin (Kaiser Permanente), Clem McDonald (Regenstrief Institute), Kai Heitmann (HL7 Germany), Rob Seliger (Sentillion), and Harold Solbrig (Mayo Clinic). Vital support came from the members of the task force, Laticia Fitzpatrick (Kaiser Permanente), Matt Huges, Randy Marbach (Kaiser Permanente), Larry Reis (Wizdom Systems), Carlos Sanroman (Kaiser Permanente), Greg Thomas (Kaiser Permanente). Thanks James Case (University of California, Davis), Norman Daoust (Partners HealthCare Systems), Irma Jongeneel (HL7 The Netherlands), Michio Kimura (HL7 Japan), John Molina (SMS), Richard Ohlmann (McKessonHBOC), David Rowed (HL7 Australia), and Klaus Veil (Macquarie Health Corp., HL7 Australia), for sharing their expertise in critical questions. This work was made possible by the Regenstrief Institute for Health Care.


Table of contents

1 Introduction
    1.1 Organization of this Specification
2 Basic Data Types
    2.1 Data Value (ANY)
        2.1.1 Null Flavor : cs
    2.2 Boolean (BL)
    2.3 Binary Data (BIN)
        2.3.1 Data as XML Text Content : xsl:string
        2.3.2 Encoding : cs
    2.4 Encapsulated Data (ED) extends BIN
        2.4.1 Media Type : cs
        2.4.2 Charset
        2.4.3 Language : cs
        2.4.4 Compression : cs
        2.4.5 Reference : TEL
        2.4.6 Integrity Check : bin
        2.4.7 Integrity Check Algorithm : cs
        2.4.8 Thumbnail : ED
        2.4.9 Examples
    2.5 Character String (ST) restricts ED
        2.5.1 Encoding : cs (excluded)
        2.5.2 Media Type : cs (excluded)
        2.5.3 Language : cs (excluded)
        2.5.4 Compression : cs (excluded)
        2.5.5 Reference : TEL (excluded)
        2.5.6 Integrity Check : bin (excluded)
        2.5.7 Integrity Check Algorithm : cs (excluded)
        2.5.8 Thumbnail : ED (excluded)
    2.6 Coded Simple Value (CS) restricts CV
        2.6.1 Code : st (inherited from CD)
        2.6.2 Code System : uid (excluded)
        2.6.3 Code System Name : st (excluded)
        2.6.4 Code System Version : st (excluded)
        2.6.5 Display Name : st (inherited from CD)
        2.6.6 Original Text : ED (excluded)
    2.7 Coded Value (CV)
        2.7.1 Code : st (inherited from CD)
        2.7.2 Code System : uid (inherited from CD)
        2.7.3 Code System Name : st (inherited from CD)
        2.7.4 Code System Version : st (inherited from CD)
        2.7.5 Display Name : st (inherited from CD)
        2.7.6 Original Text : ED (inherited from CD)
        2.7.7 Translation : CD (excluded)
    2.8 Coded with Equivalents (CE)
        2.8.1 Code : st (inherited from CD)
        2.8.2 Code System : uid (inherited from CD)
        2.8.3 Code System Name : st (inherited from CD)
        2.8.4 Code System Version : st (inherited from CD)
        2.8.5 Display Name : st (inherited from CD)
        2.8.6 Qualifier : LIST<CR> (excluded)
        2.8.7 Original Text : ED (inherited from CD)
        2.8.8 Translation : CD (inherited from CD)
    2.9 Concept Descriptor (CD)
        2.9.1 Code : st
        2.9.2 Code System : uid
        2.9.3 Code System Name : st
        2.9.4 Code System Version : st
        2.9.5 Display Name : st
        2.9.6 Original Text : ED
        2.9.7 Translation : CD
        2.9.8 Qualifier : LIST<CR>
    2.10 Concept Role (CR)
        2.10.1 Name : CV
        2.10.2 Value : CD
        2.10.3 Inversion Indicator : bl
    2.11 Unique Identifier String (UID)
        2.11.1 ISO Object Identifier (OID) Scheme
        2.11.2 DCE Universal Unique Identifier (UUID) Scheme
        2.11.3 HL7 Reserved Identifier Scheme
    2.12 Instance Identifier (II)
        2.12.1 Root : uid
        2.12.2 Extension : st
        2.12.3 Assigning Authority Name : st
        2.12.4 Displayable : bl
        2.12.5 Valid Time : IVL<TS>
    2.13 Universal Resource Locator (URL)
        2.13.1 Telephone and FAX Numbers
    2.14 Telecommunication Address (TEL) extends URL
        2.14.1 Valid Time : GTS
        2.14.2 Use : set<cs>
    2.15 Address Part (ADXP)
        2.15.1 Address Part Type : cs
    2.16 Postal Address (AD)
        2.16.1 Data as XML Mixed Content : LIST<ADXP>
        2.16.2 Use : set<cs>
        2.16.3 Valid Time : GTS
        2.16.4 Examples
    2.17 Entity Name Part (ENXP)
        2.17.1 Name Part Type : cs
        2.17.2 Qualifier : cs
    2.18 Entity Name (EN)
        2.18.1 Data as XML Mixed Content : LIST<ENXP>
        2.18.2 Use : set<cs>
        2.18.3 Valid Time : IVL<TS>
        2.18.4 Examples
    2.19 Person Name Part (PNXP) restricts ENXP
        2.19.1 Name Part Type : cs (inherited from ENXP)
        2.19.2 Qualifier : cs (inherited from ENXP)
    2.20 Person Name (PN) restricts EN
    2.21 Organization Name Part (ONXP) restricts ENXP
        2.21.1 Name Part Type : cs (inherited from ENXP)
        2.21.2 Qualifier : cs (inherited from ENXP)
    2.22 Organization Name (ON) restricts EN
        2.22.1 Examples
    2.23 Trivial Name (TN) restricts EN
    2.24 Quantity (QTY)
    2.25 Integer Number (INT)
    2.26 Real Number (REAL)
    2.27 Physical Quantity (PQ)
        2.27.1 Value : REAL
        2.27.2 Unit of Measure : cs
        2.27.3 Translation : PQR
    2.28 Physical Quantity Representation (PQR)
        2.28.1 Value : real
    2.29 Monetary Amount (MO)
        2.29.1 Value : REAL
        2.29.2 Currency : cs
    2.30 Ratio (RTO)
        2.30.1 Numerator : N
        2.30.2 Denominator : D
        2.30.3 Examples
    2.31 Point in Time (TS)
3 Generic Data Types
    3.1 Generic Schema Definition Language
    3.2 Sequence (LIST)
    3.3 Bag (BAG)
    3.4 Bag Item (BXIT)
        3.4.1 Quantity : int
    3.5 Set (SET)
    3.6 Set Component (SXCM)
        3.6.1 Operator : cs
    3.7 Interval (IVL) extends
        3.7.1 Low Boundary : T
        3.7.2 High Boundary : T
        3.7.3 Low Closed : BL
        3.7.4 High Closed : BL
        3.7.5 Center : T
        3.7.6 Width : T.diff
    3.8 History Item (HXIT)
        3.8.1 Valid Time : IVL<TS>
    3.9 History (HIST)
    3.10 Uncertain Value - Narrative (UVN)
        3.10.1 Confidence : CE
    3.11 Non-Parametric Probability Distribution (NPPD)
    3.12 Uncertain Value - Probabilistic (UVP)
        3.12.1 Probability : real
    3.13 Parametric Probability Distribution (PPD)
        3.13.1 Standard Deviation : T.diff
        3.13.2 Probability Distribution Type : cs
4 Timing Specification
    4.1 Periodic Interval of Time (PIVL) extends
        4.1.1 Phase : IVL<T>
        4.1.2 Period : T.diff
        4.1.3 Alignment to the Calendar : cs
        4.1.4 Institution Specified Timing : bl
        4.1.5 Examples
    4.2 Event-Related Interval of Time (EIVL) extends
        4.2.1 Event : CE
        4.2.2 Offset : IVL_T.diff
    4.3 Parenthetic Set Expression (SXPR) extends
        4.3.1 Sub-Expression : SXPR
    4.4 General Timing Specification (GTS)
        4.4.1 Examples

1

Introduction

What is a Data Type? Data types are the basic building blocks used to construct messages, computerized patient record documents, business objects and their transactions. Data types define the meaning of any given field's value. Without knowing a field's data type, it is impossible to interpret the field's value.

Representation of Data Values. On an abstract layer, independent from representation, a data types define properties of values. When values are represented, some of their properties are directly represented as atomic literal forms or as data structures. At that point we call those properties "components". On the representation layer we can also distinguish simple data types, represented as atomic literal forms, from complex ones, represented as structures with components. For the implementor, it is important to realize that data types have more properties than shown as components, and that it only depends on the implementation technology and ITS specification what data types are simple or complex and which of their propertics are represented as "components" and which are inferred from those components.

This specification defines standard representations for data values in XML only. Other ITS, and programming environments may choose different representations and data structures, all of which must be consistent with the Data Types Abstract Specification.

NOTE: At the time this ballot is released, the Data Types Abstract Specification is still undergoing revisions. An earlier draft of the Data Types Abstract Specification is included in this ballot package, but it is at times inconsistent with the present specification. The editors apologize for this unfortunate inconsistency. Once a consistent draft of the Data Types Abstract Specification is finalized, we will link the new draft to the ballot material.

1.1

Organization of this Specification

This specification is divided in two major parts:

  1. Basic data types.


  2. Generic data type (templates).


The fully specified data types are organized approximately in the same order in which they appear in the Data Types Abstract Specification, devided in roughly three categories: (1) boolean, binary, text and multimedia, (2) codes and identifiers, and (3) quantitative data types.

Generic types are about collections (sets, lists, etc.) and common data type extensions to deal with uncertainty, time-dependency and other qualifications of data values. Finally, the framework of specifying complex timing patterns (e.g., for scheduling periodic activities) is mostly specified in terms of generic data types.

The following table lists all data types specified in the XML ITS.

Table 1: Overview of HL7 version 3 data types
Name Symbol Description
Data Value ANY Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.
Boolean BL The Boolean type stands for the values of two-valued logic. A Boolean value can be either or , or, as any other value may be NULL.
Binary Data BIN Binary data is a raw block of bits. Binary data is a protected type that should not be declared outside the data type specification.
Encapsulated Data ED Data that is primarily intended for human interpretation or for further machine processing outside the scope of HL7. This includes unformatted or formatted written language, multimedia data, or structured information in as defined by a different standard (e.g., XML-signatures.) Instead of the data itself, an may contain only a reference (see .) Note that the data type is a specialization of the data type when the media type is text/plain.
Character String ST The character string data type stands for text data, primarily intended for machine processing (e.g., sorting, querying, indexing, etc.) Used for names, symbols, and formal expressions.
Coded Simple Value CS Coded data in its simplest form, consists of a code and display name. The code system and code system version is fixed by the context in which the CS value occurs. CS is used for coded attributes that have a single HL7-defined value set.
Coded Value CV Coded data, consists of a code, display name, code system, and original text. Used when a single code value must be sent.
Coded with Equivalents CE Coded data, consists of a coded value (CV) and, optionally, coded value(s) from other coding systems that identify the same concept. Used when alternative codes may exist.
Concept Descriptor CD A concept descriptor represents any kind of concept usually by giving a code defined in a code system. A concept descriptor can contain the original text or phrase that served as the basis of the coding and one or more translations into different coding systems. A concept descriptor can also contain qualifiers to describe, e.g., the concept of a "left foot" as a postcoordinated term built from the primary code "FOOT" and the qualifier "LEFT". In exceptional cases, the concept descriptor need not contain a code but only the original text describing that concept.
Concept Role CR A concept qualifier code with optionally named role. Both qualifier role and value codes must be defined by the coding system. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg".
Unique Identifier String UID A unique identifier string is a character string which identifies an object in a globally unique and timeless manner. The allowable formats and values and procedures of this data type are strictly controlled by HL7. At this time, user-assigned identifiers may be certain character representations of ISO Object Identifiers (OID) and DCE Universally Unique Identifiers (UUID). HL7 also reserves the right to assign other forms of UIDs, such as mnemonic identifiers for code systems.
Instance Identifier II An identifier that uniquely identifies a thing or object. Examples are object identifier for HL7 RIM objects, medical record number, order id, service catalog item id, Vehicle Identification Number (VIN), etc. Instance identifiers are defined based on ISO object identifiers.
Universal Resource Locator URL A telecommunications address specified according to Internet standard RFC 1738 []. The URL specifies the protocol and the contact point defined by that protocol for the resource. Notable uses of the telecommunication address data type are for telephone and telefax numbers, e-mail addresses, Hypertext references, FTP references, etc.
Telecommunication Address TEL A telephone number (voice or fax), e-mail address, or other locator for a resource (information or service) mediated by telecommunication equipment. The address is specified as a Universal Resource Locator (URL) qualified by time specification and use codes that help deciding which address to use for a given time and purpose.
Address Part ADXP A character string that may have a type-tag signifying its role in the address. Typical parts that exist in about every address are street, house number, or post box, postal code, city, country but other roles may be defined regionally, nationally, or on an enterprise level (e.g. in military addresses). Addresses are usually broken up into lines, which are indicated by special line-breaking delimiter elements (e.g., DEL).
Postal Address AD Mailing and home or office addresses. A sequence of address parts, such as street or post office Box, city, postal code, country, etc.
Entity Name Part ENXP A character string token representing a part of a name. May have a type code signifying the role of the part in the whole entity name, and a qualifyer code for more detail about the name part type. Typical name parts for person names are given names, and family names, titles, etc.
Entity Name EN A name for a person, organization, place or thing. A sequence of name parts, such as first name or family name, prefix, suffix, etc. Examples for entity name values are "Jim Bob Walton, Jr.", "Health Level Seven, Inc.", "Lake Tahoe", etc. An entity name may be as simple as a character string or may consist of several entity name parts, such as, "Jim", "Bob", "Walton", and "Jr.", "Health Level Seven" and "Inc.", "Lake" and "Tahoe".
Person Name Part PNXP A restriction of entity name part that only allows those entity name parts qualifiers applicable to person names. Since the structure of entity name is mostly determined by the requirements of person name, the restriction is very minor.
Person Name PN A name for a person. A sequence of name parts, such as first name or family name, prefix, suffix, etc.
Organization Name Part ONXP A restriction of entity name part that only allows those entity name parts qualifiers applicable to organization names.
Organization Name ON A name for an organization. A sequence of name parts.
Trivial Name TN A restriction of entity name that is effectively a simple string used for a simple name for things and places.
Quantity QTY The quantity data type is an abstract generalization for all data types (1) whose value set has an order relation (less-or-equal) and (2) where difference is defined in all of the data type's totally ordered value subsets. The quantity type abstraction is needed in defining certain other types, such as the interval and the probability distribution.
Integer Number INT Integer numbers (-1,0,1,2, 100, 3398129, etc.) are precise numbers that are results of counting and enumerating. Integer numbers are discrete, the set of integers is infinite but countable. No arbitrary limit is imposed on the range of integer numbers. Two NULL flavors are defined for the positive and negative infinity.
Real Number REAL Fractional numbers. Typically used whenever quantities are measured, estimated, or computed from other real numbers. The typical representation is decimal, where the number of significant decimal digits is known as the precision. Real numbers are needed beyond integers whenever quantities of the real world are measured, estimated, or computed from other real numbers. The term "Real number" in this specification is used to mean that fractional values are covered without necessarily implying the full set of the mathematical real numbers.
Physical Quantity PQ A dimensioned quantity expressing the result of a measurement act.
Physical Quantity Representation PQR A representation of a physical quantity in a unit from any code system. Used to show alternative representation for a physical quantity.
Monetary Amount MO A monetary amount is a quantity expressing the amount of money in some currency. Currencies are the units in which monetary amounts are denominated in different economic regions. While the monetary amount is a single kind of quantity (money) the exchange rates between the different units are variable. This is the principle difference between physical quantity and monetary amounts, and the reason why currency units are not physical units.
Ratio RTO A quantity constructed as the quotient of a numerator quantity divided by a denominator quantity. Common factors in the numerator and denominator are not automatically cancelled out. The data type supports titers (e.g., "1:128") and other quantities produced by laboratories that truly represent ratios. Ratios are not simply "structured numerics", particularly blood pressure measurements (e.g. "120/60") are not ratios. In many cases the should be used instead of the .
Point in Time TS A a quantity specifying a point on the axis of natural time. A point in time is most often represented as a calendar expression.
Sequence LIST A value that contains other discrete values in a defined sequence.
Bag BAG An unordered collection of values, where each value can be contained more than once in the bag.
Bag Item BXIT A generic data type extension that represents a collection of a certain number of identical items in a bag.
Set SET A value that contains other distinct values in no particular order.
Set Component SXCM An ITS-defined generic type extension for the base data type of a set, representing a component of a general set over a discrete or continuous value domain. It's use is mainly for continuous value domains. Discrete (enumerable) set components are the individual elements of the base data type.
Interval IVL A set of consecutive values of an ordered base data type.
History Item HXIT A generic data type extension that tags a time range to any data value of any data type. The time range is the time in which the information represented by the value is (was) valid.
History HIST A set of data values that conform to the history item (HXIT) type, (i.e., that have a valid-time property). The history information is not limited to the past; expected future values can also appear.
Uncertain Value - Narrative UVN A generic data type extension to specify one uncertain value tagged with a coded confidence qualifier.
Non-Parametric Probability Distribution NPPD A set of uncertain values with probabilities (also known as histogram.)
Uncertain Value - Probabilistic UVP A generic data type extension used to specify a probability expressing the information producer's belief that the given value holds.
Parametric Probability Distribution PPD A generic data type extension specifying uncertainty of quantitative data using a distribution function and its parameters. Aside from the specific parameters of the distribution, a mean (expected value) and standard deviation is always given to help maintain a minimum layer of interoperability if receiving applications cannot deal with a certain probability distribution.
Periodic Interval of Time PIVL An interval of time that recurs periodically. Periodic intervals have two properties, phase and period. The phase specifies the "interval prototype" that is repeated every period.
Event-Related Interval of Time EIVL Specifies a periodic interval pf time where the recurrence is based on activities of daily living or other important events that are time-related but not fully determined by time.
Parenthetic Set Expression SXPR A set-component that is itself made up of set-components that are evaluated as one value.
General Timing Specification GTS A set of points in time, specifying the timing of events and actions and the cyclical validity-patterns that may exist for certain kinds of information, such as phone numbers (evening, daytime), addresses (so called "snowbirds," residing in the south during winter and north during summer) and office hours.

In XML, several of the data types listed above are specified in two forms:

  1. The common XML element form, usually encountered for high-level HL7 content derived from the Reference Information Model (RIM). Their XML schema data type names are the common all-caps abbreviations shown in the table above.


  2. A more compact special XML attribute form, only used in special cases such as when representing certain components of other data types. Their XML schema data type names are the abbreviations in lower case.


2

Basic Data Types

2.1

Data Value (ANY)

Definition:      Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.

XML Representation

In the XML schema we use an abstract complex data type ANY. All other complex XML schema data types are extensions of this base data type.

Schema Fragment 1:
<xsd:complexType name="ANY" abstract="true" mixed="true">
    <xsd:attribute name='nullFlavor' type='cs_NullFlavor' ... />
</xsd:complexType>
NOTE: The above schema defines the ANY data type as mixed content which is not actually appropriate. This is only a workaround some of the errors of certain XML schema validators. It is an error for just ANY value to carry text nodes if not explicitly allowed in the schema of the specific data type.

2.1.1

Null Flavor : cs

Definition:      An exceptional value expressing missing information and possibly the reason why the information is missing.

Every data element has either a proper value or it is considered NULL. If (and only if) it is NULL, a "null flavor" provides more detail as to in what way or why no proper value is supplied.

Table 2: Domain NullFlavor:
code name definition
NI NoInformation No information whatsoever can be inferred from this exceptional value. This is the most general exceptional value. It is also the default exceptional value.
  NA not applicable No proper value is applicable in this context (e.g., last menstrual period for a male.)
  UNK unknown A proper value is applicable, but not known.
    NASK not asked This information has not been sought (e.g., patient was not asked)
    ASKU asked but unknown Information was sought but not found (e.g., patient was asked but didn't know)
      NAV temporarily unavailable Information is not available at this time but it is expected that it will be available later.
  OTH other The actual value is not an element in the value domain of a variable. (e.g., concept not provided by required code system.)
    PINF positive infinity Positive infinity of numbers.
    NINF negative infinity Negative infinity of numbers.
NP not present Value is not present in a message. This is only defined in messages, never in application data! All values not present in the message must be replaced by the applicable default, or no-information (NI) as the default of all defaults.
XML Representation
Schema Fragment 2:
<xsd:attribute name="nullFlavor" type="cs_NullFlavor" use="optional"/>

The NULL flavors are defined in XML as an enumeration.

Schema Fragment 3:
<xsd:simpleType name="cs_NullFlavor">
    <xsd:restriction base="cs">
      <xsd:enumeration value="NI"/>
      <xsd:enumeration value="NA"/>
      <xsd:enumeration value="UNK"/>
      <xsd:enumeration value="NASK"/>
      <xsd:enumeration value="ASKU"/>
      <xsd:enumeration value="NAV"/>
      <xsd:enumeration value="OTH"/>
      <xsd:enumeration value="PINF"/>
      <xsd:enumeration value="NINF"/>
    </xsd:restriction>
</xsd:simpleType>

2.2

Boolean (BL)

Definition:      The Boolean type stands for the values of two-valued logic. A Boolean value can be either true or false, or, as any other value may be NULL.

All Boolean values obey the common operators negation, conjunction, and disjunction. With the NULL value these common Boolean operations are extended as shown in the following tables.

Table 3: Truth tables for Boolean logic with NULL values
NOT   AND true false NULL OR true false NULL
true false true true false NULL true true true true
false true false false false false false true false NULL
NULL NULL NULL NULL false NULL NULL true NULL NULL
XML Representation

The XML representation of a Boolean can be either as a simple XML schema type (suitable for use in an XML attribute) or as a complex XML schema type preferred for use as an XML element. The simple type is used only in the HL7 data type schema (including defining the complex type.) The simple type cannot distinguish the different flavors of null.

Schema Fragment 4:
<xsd:simpleType name="bl">
    <xsd:restriction base="xsd:boolean">
      <xsd:pattern value="true|false"/>
    </xsd:restriction>
</xsd:simpleType>

By convention, simple types have a schema name that uses the lower case form of the HL7 data type short name.

Normally the Boolean is used as a complex XML schema type that has all the common data type components, such as the null flavor available. The simple Boolean value itself appears as the XML-attribute value.

Schema Fragment 5:
<xsd:complexType name="BL">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:attribute name="value" use="optional" type="bl"/>
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

By convention, complex XML types have a schema name that uses the upper case form of the HL7 data type short name.

Although the use of the XML-attribute value is optional, the constraint (expressed as an XPath predicate), specifies that there must be either an XML-attribute value or the ANY.nullFlavor attribute, but not both.

Schema Fragment 6:
<hl7:pr assert="(@nullFlavor or @value) and not(@nullFlavor and @value)"/>

2.3

Binary Data (BIN)

Definition:      Binary data is a raw block of bits. Binary data is a protected type that should not be declared outside the data type specification.

XML Representation

The XML representation of binary data exists in two forms, a simple type and a complex type. The simple type is used for certain data type components represented as XML attributes carrying arbitrary binary values. Simple binary data is always base 64 encoded

Schema Fragment 7:
<xsd:simpleType name="bin">
    <xsd:restriction base="xsd:base64Binary"/>
</xsd:simpleType>

The complex type serves as the basis of the encapsulated data type, used for both written text and multimedia (binary data.) When an element is defined to be of type BIN that property is represented as character data (e.g., #PCDATA) in the content model of the data type in question.

Schema Fragment 8:
<xsd:complexType name="BIN" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:attribute name='encoding' type='cs_BinaryDataEncoding' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.3.1

Data as XML Text Content : xsl:string

Definition:      The data itself represented in the XML instance encoding according to the binary data encoding element (text or base64 form.) Character strings and derived types use only the text encoding, which is the same encoding as the overall XML instance.

2.3.2

Encoding : cs

Definition:      Specifies the encoding of the binary data that is the content of the binary data complex XML schema data type.

The Data Types Abstract Specification does not recognize an encoding property for the BIN data type. The XML-attribute encoding is a component that only specifies the representation of the data in the XML rendition. The encoding is not a meaningful property of the data, only its encoding This means, application need not retain the encoding of the data.

XML Representation
Schema Fragment 9:
<xsd:attribute name="encoding" use="optional" type="cs_BinaryDataEncoding" default="TXT"/>

Binary content can either appear as TEXT (in the encoding of the overall message) or as base 64 data

Schema Fragment 10:
<xsd:simpleType name="cs_BinaryDataEncoding">
    <xsd:restriction base="xsd:NMTOKEN">
      <xsd:enumeration value="B64"/>
      <xsd:enumeration value="TXT"/>
    </xsd:restriction>
</xsd:simpleType>

"TXT" indicates that the character data of the ED is to be interpreted directly as characters; "B64" indicates that the BIN data has been base64 encoded and must be decoded in order to recover the original data.

2.4

Encapsulated Data (ED) extends BIN

Definition:      Data that is primarily intended for human interpretation or for further machine processing outside the scope of HL7. This includes unformatted or formatted written language, multimedia data, or structured information in as defined by a different standard (e.g., XML-signatures.) Instead of the data itself, an ED may contain only a reference (see TEL.) Note that the ST data type is a specialization of the ED data type when the ED media type is text/plain.

Encapsulated data can be present in two forms, inline or by reference. Inline data is communicated or moved as part of the encapsulated data value, whereas by-reference data may reside at a different (remote) location. The data is the same whether it is located inline or remote.

XML Representation

The XML schema for ED is a complex type that is an extension of BIN. Inline binary data is conveyed as character content.

Schema Fragment 11:
<xsd:complexType name="ED" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="BIN">
        <xsd:sequence>
          <xsd:element name='reference' type='TEL' ... />
          <xsd:element name='thumbnail' ... />
        </xsd:sequence>
        <xsd:attribute name='mediaType' type='cs' ... />
        <xsd:attribute ref='xml:lang' ... />
        <xsd:attribute name='compression' type='cs_CompressionAlgorithm' ... />
        <xsd:attribute name='integrityCheck' type='bin' ... />
        <xsd:attribute name='integrityCheckAlgorithm' type='cs_IntegrityCheckAlgorithm' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

ED (and its restricted form, ST) are encoded as character data, resulting in a mixed content model for ED. Because of this mixed content model, the text content could be split into several text nodes. Only XML encodings are valid that produce at most one text node.

EDITORIAL NOTE: Perhaps this is not correct, we may want to allow any content here (open content) so that another XML document (most likely XHTML or HL7 CDA) could be enclosed here effortlessly.

Schema Fragment 12:
<hl7:pr assert="count(text())<=1"/>

2.4.1

Media Type : cs

Definition:      Identifies the encoding of the encapsulated data and identifies a method to interpret or render the data.

The IANA defined domain of media types is established by the Internet standard RFC 2046 [http://www.isi.edu/in-notes/rfc2046.txt].

To promote interoperability, this specification prefers certain media types to others. This is to define a greatest common denominator on which interoperability is not only possible, but that is powerful enough to support even advanced multimedia communication needs.

Table Table 5 below assigns a status to certain MIME media types, where the status means one of the following:

required Every HL7 application must support at least the required media types if it supports a given kind of media. One required media-type for each kind of media exists. Some media types are required for a specific purpose, which is then indicated as "required for ..."

recommended Other media types are recommended for a particular purpose. For any given purpose there should be only very few additionally recommended media types and the rationale, conditions and assumptions of such recommendations must be made very clear.

indifferent This status means, HL7 does neither forbid nor endorse the use of this media type. All media types not mentioned here by default belong into the indifferent category. Since there is one required and several recommended media types for most practically relevant use cases, media types of this status should be used very conservatively.

deprecated Deprecated media types should not be used, because these media types are flawed, because there are better alternatives, or because of certain risks. Such risks could be security risks, for example, the risk that such a media type could spread computer viruses. Not every flawed media type is marked as deprecated, though. A media type that is not mentioned, and thus considered other by default, may well be flawed.

Table 5: Domain MediaType:
code name status definition
text/plain   Plain Text   required   For any plain text. This is the default and is equivalent to a character string (ST) data type.  
text/x-hl7-ft   HL7 Text   recommended   For compatibility, this represents the HL7 v2.x FT data type. Its use is recommended only for backward compatibility with HL7 v2.x systems.  
text/html   HTML Text   recommended   For marked-up text according to the Hypertext Mark-up Language. HTML markup is sufficient for typographically marking-up most written-text documents. HTML is platform independent and widely deployed.  
application/pdf   PDF   recommended   The Portable Document Format is recommended for written text that is completely laid out and read-only. PDF is a platform independent, widely deployed, and open specification with freely available creation and rendering tools.  
text/xml   XML Text   indifferent   For structured character based data. There is a risk that general SGML/XML is too powerful to allow a sharing of general SGML/XML documents between different applications.  
text/rtf   RTF Text   indifferent   The Rich Text Format is widely used to share word-processor documents. However, RTF does have compatibility problems, as it is quite dependent on the word processor. May be useful if word processor edit-able text should be shared.  
application/msword   MSWORD   deprecated   This format is very prone to compatibility problems. If sharing of edit-able text is required, text/plain, text/html or text/rtf should be used instead.  
audio/basic   Basic Audio   required   This is a format for single channel audio, encoded using 8bit ISDN mu-law [PCM] at a sample rate of 8000 Hz. This format is standardized by: CCITT, Fascicle III.4 oRecommendation G.711. Pulse Code Modulation (PCM) of Voice Frequencies. Geneva, 1972.  
audio/mpeg   MPEG audio layer 3   required   MPEG-1 Audio layer-3 is an audio compression algorithm and file format defined in ISO 11172-3 and ISO 13818-3. MP3 has an adjustable sampling frequency for highly compressed telephone to CD quality audio.  
audio/k32adpcm   K32ADPCM Audio   indifferent   ADPCM allows compressing audio data. It is defined in the Internet specification RFC 2421 [ftp://ftp.isi.edu/in-notes/rfc2421.txt]. Its implementation base is unclear.  
image/png   PNG Image   required   Portable Network Graphics (PNG) [http://www.cdrom.com/pub/png] is a widely supported lossless image compression standard with open source code available.  
image/gif   GIF Image   indifferent   GIF is a popular format that is universally well supported. However GIF is patent encumbered and should therefore be used with caution.  
image/jpeg   JPEG Image   required   This format is required for high compression of high color photographs. It is a "lossy" compression, but the difference to lossless compression is almost unnoticeable to the human vision.  
image/g3fax   G3Fax Image   recommended   This is recommended only for fax applications.  
image/tiff   TIFF Image   indifferent   Although TIFF (Tag Image File Format) is an international standard it has many interoperability problems in practice. Too many different versions that are not handled by all software alike.  
video/mpeg   MPEG Video   required   MPEG is an international standard, widely deployed, highly efficient for high color video; open source code exists; highly interoperable.  
video/x-avi   X-AVI Video   deprecated   The AVI file format is just a wrapper for many different codecs; it is a source of many interoperability problems.  
model/vrml   VRML Model   recommended   This is an openly standardized format for 3D models that can be useful for virtual reality applications such as anatomy or biochemical research (visualization of the steric structure of macromolecules)  

The set of required media types is very small so that no undue requirements are forced on HL7 applications, especially legacy systems. In general, no HL7 application is forced to support any given kind of media other than written text. For example, many systems just do not want to receive audio data, because those systems can only show written text to their users. It is a matter of application conformance statements to say: "I will not handle audio". Only if a system claims to handle audio media, it must support the required media type for audio.

XML Representation

In XML mediaType is represented with the XML-attribute mediaType. The default value for the XML-attribute mediaType is "text/plain".

Schema Fragment 13:
<xsd:attribute name="mediaType" type="cs" use="optional" default="text/plain"/>

2.4.2

Charset

The ED charset semantic property is is not explicitly represented in the XML ITS. Rather, the value of charset is to be infered from the value of the XML-attribute encoding in the XML-Declaration of the XML entity containing the instance. If the XML-Declaration or the XML-attribute encoding is not present in the instance, then defaults to UTF-8.

2.4.3

Language : cs

Definition:      For character based information the language property specifies the human language of the text.

The HL7 table for human languages is based on RFC 1766, Tags for the Identification of Languages [http://www.isi.edu/in-notes/rfc1766.txt]. It is a set of pre-coordinated pairs of one 2-letter ISO 639 language code and one 2-letter ISO 3166 country code (e.g., en-us [English, United States]).

Language tags do not modify the meaning of the characters found in the text; they are only an advice on if and how to present or communicate the text. For this reason, any system or site that does not deal with multilingual text or names in the real world can safely ignore the language property.

XML Representation

In XML a special language setting can be conveyed with the common XML-attribute xml:lang, which has no specific default value.

Schema Fragment 14:
<xsd:attribute ref="xml:lang" use="optional"/>

The XML-attribute xml:lang is defined in as being designed for exactly the same purpose as the language property, and hence, it has been adopted for use in the XML ITS.

2.4.4

Compression : cs

Definition:      Indicates whether the raw byte data is compressed, and what compression algorithm was used.

Table 6: Domain CompressionAlgorithm:
code name definition
DF deflate The deflate compressed data format as specified in RFC 1951 [ftp://ftp.isi.edu/in-notes/rfc1951.txt].
GZ gzip A compressed data format that is compatible with the widely used GZIP utility as specified in RFC 1952 [ftp://ftp.isi.edu/in-notes/rfc1952.txt] (uses the deflate algorithm.)
ZL zlib A compressed data format that also uses the deflate algorithm. Specified as RFC 1950 [ftp://ftp.isi.edu/in-notes/rfc1950.txt]
Z compress Original UNIX compress algorithm and file format using the LZC algorithm (a variant of LZW). Patent encumbered and less efficient than deflate.
XML Representation

This component is represented as the XML-attribute compression. There is no compression by default.

Schema Fragment 15:
<xsd:attribute name="compression" type="cs_CompressionAlgorithm" use="optional"/>
Schema Fragment 16:
<xsd:simpleType name="cs_CompressionAlgorithm">
    <xsd:restriction base="cs">
      <xsd:enumeration value="DF"/>
      <xsd:enumeration value="GZ"/>
      <xsd:enumeration value="ZL"/>
      <xsd:enumeration value="Z"/>
    </xsd:restriction>
</xsd:simpleType>

2.4.5

Reference : TEL

Definition:      A telecommunication address (TEL), such as a URL for HTTP or FTP, which will resolve to precisely the same binary data that could as well have been provided as inline data.

The semantic value of an encapsulated data value is the same, regardless whether the data is present inline data or just by-reference. However, an encapsulated data value without inline data behaves differently, since any attempt to examine the data requires the data to be downloaded from the reference.

An encapsulated data value may have both inline data and a reference. The reference must point to the same data as provided inline.

XML Representation

The reference component in XML is the XML-element reference.

Schema Fragment 17:
<xsd:element name="reference" type="TEL" minOccurs="0" maxOccurs="1"/>

Receivers must ignore all occurances of the XML-element reference after the first occurance following the first text node.

2.4.6

Integrity Check : bin

Definition:      The integrity check is a short binary value representing a cryptographically strong checksum that is calculated over the binary data. The purpose of this property, when communicated with a reference is for anyone to validate later whether the reference still resolved to the same data that the reference resolved to when the encapsulated data value with reference was created.

The integrity check is calculated according to the integrity check algorithm. By default, the Secure Hash Algorithm-1 (SHA-1) shall be used. The integrity check is binary encoded according to the rules of the integrity check algorithm.

The integrity check is calculated over the raw binary data that is contained in the data component, or that is accessible through the reference. No transformations are made before the integrity check is calculated. If the data is compressed, the Integrity Check is calculated over the compressed data.

XML Representation

In XML, the integrity check component is represented with the XML-attribute integrityCheck, which has no specific default value.

Schema Fragment 18:
<xsd:attribute name="integrityCheck" type="bin" use="optional"/>

When generating instances, applications must base-64 encode the integrity check prior to populating the XML-attribute integrityCheck. When receiving instances, applications must base-64 decode the value of the XML-attribute integrityCheck to obtain the integrity check value.

2.4.7

Integrity Check Algorithm : cs

Definition:      Specifies the algorithm used to compute the integrityCheck value.

Table 7: Integrity Check Algorithm (domain = IntegrityCheckAlgorithm)
Name Code Description
Secure Hash Algorithm - 1 SHA-1 This algorithm is defined in FIPS PUB 180-1: Secure Hash Standard. As of April 17, 1995.
XML Representation

The integrity check algorithm is represented in XML with the XML-attribute integrityCheckAlgorithm, whose value is (currently) fixed to be "SHA-1" and cannot be changed in an instance.

Schema Fragment 19:
<xsd:attribute name="integrityCheckAlgorithm" type="cs_IntegrityCheckAlgorithm" use="optional" fixed="SHA-1"/>
Schema Fragment 20:
<xsd:simpleType name="cs_IntegrityCheckAlgorithm">
    <xsd:restriction base="cs">
      <xsd:enumeration value="SHA-1"/>
    </xsd:restriction>
</xsd:simpleType>

2.4.8

Thumbnail : ED

Definition:      A thumbnail is an abbreviated rendition of the full data. A thumbnail requires significantly fewer resources than the full data, while still maintaining some distinctive similarity with the full data. A thumbnail is typically used with by-reference encapsulated data. It allows a user to select data more efficiently before actually downloading through the reference.

For example, a large image may be represented by a small image; a high quality audio sequence by a shorter low-quality audio; a movie may be represented by a shorter clip (or just an image); text may be summarized to an abstract.

A thumbnail may not itself contain a thumbnail.

XML Representation

Thumbnail in XML is represented with the child XML-element thumbnail which is a restriction on ED itself.

Schema Fragment 21:
<xsd:element name="thumbnail" minOccurs="0" maxOccurs="1">
    <xsd:complexType>
      <xsd:complexContent>
        <xsd:restriction base="ED">
          <xsd:sequence>
            <xsd:element name="reference" type="TEL" minOccurs="0" maxOccurs="1"/>
            <xsd:element name="thumbnail" type="ED" minOccurs="0" maxOccurs="0"/>
          </xsd:sequence>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>

Receivers must ignore all occurences of the XML-element thumbnail after the first occurance following the first text node.

Text content is only allowed in non-NULL values.

Schema Fragment 22:
<hl7:pr assert="(@nullFlavor or text()) and not(@nullFlavor and text())"/>

The media type attribute is only allowed for non-NULL values.

Schema Fragment 23:
<hl7:pr assert="(@nullFlavor or @type) and not(@nullFlavor and @type)"/>
Schema Fragment 24:
<hl7:pr assert="(@nullFlavor or @integrityCheck) and not(@nullFlavor and @integrityCheck)"/>
Schema Fragment 25:
<hl7:pr assert="(@integrityCheckAlgorithm and @integrityCheck) or not(@integrityCheckAlgorithm or @integrityCheck)"/>
Schema Fragment 26:
<hl7:pr assert="(@nullFlavor or @reference) and not(@nullFlavor and @reference)"/>
Schema Fragment 27:
<hl7:pr assert="(@nullFlavor or @thumbnail) and not(@nullFlavor and @thumbnail)"/>
Schema Fragment 28:
<hl7:pr assert="(@nullFlavor or @type) and not(@nullFlavor and @type)"/>

2.4.9

Examples

The first example is a simple case of a character string.

Example 1:
<someED>cellulitis of the left foot</someED> 

A more complex example contains a reference to an image, stored at particular URL and available for the next month. An integrity check is provided for the image, as well as in inline thumbnail.

Example 2:
<someED mediaType="image/png" encoding="B64" integrityCheck="aA5mb7c8TXtu392KMsaSa2MKkAwL5LKAo2d99azAs3MdUdw"><reference value="http://radiology.iumc.edu/xrays/128s8d9ej229se32s.png" validTime="200007200845-0820845"/><thumbnail mediaType="image/jpeg" encoding="B64">
      MNYD83jmMdomSJUEdmde9j44zmMir6edjzMMIjdMDSsWdIJdksIJR3373jeu83
      6edjzMMIjdMDSsWdIJdksIJR3373jeu83MNYD83jmMdomSJUEdmde9j44zmMir
      ...
      omSJUEdmde9j44zmMiromSJUEdmde9j44zmMirdMDSsWdIJdksIJR3373jeu83
      4zmMir6edjzMMIjdMDSsWdIJdksIJR3373jeu83==
   </thumbnail></someED> 

Lastly, we show a Microsoft Word document that has been compressed using the GZip compression algorithm.

Example 3:
<someED mediaType="application/msword" encoding="B64" COMPN="GZ">
   omSJUEdmde9j44zmMiromSJUEdmde9j44zmMirdMDSsWdIJdksIJR3373jeu83
   6edjzMMIjdMDSsWdIJdksIJR3373jeu83MNYD83jmMdomSJUEdmde9j44zmMir
   ...
   MNYD83jmMdomSJUEdmde9j44zmMir6edjzMMIjdMDSsWdIJdksIJR3373jeu83
   4zmMir6edjzMMIjdMDSsWdIJdksIJR3373jeu83==
</someED> 

2.5

Character String (ST) restricts ED

Definition:      The character string data type stands for text data, primarily intended for machine processing (e.g., sorting, querying, indexing, etc.) Used for names, symbols, and formal expressions.

A character string must at least have one character or else it is NULL. The length of a string is the number of characters, not the number of encoded bytes. Byte encoding is an ITS issue and is not relevant on the application layer.

The character string (ST) data type interprets the encapsulated data as character data (as opposed to bits), depending on the charset property. In other words, the string S1 "Rose" is equal to the string S2 "Rose" even if S1 is ASCII-encoded (hex '526f7365') and S2 is EBCDIC-encoded (hex 'd996a285').

XML Representation

The HL7 character string data type in XML is essentially just that: the simple schema data type string.

Schema Fragment 29:
<xsd:simpleType name="st">
    <xsd:restriction base="xsd:string"/>
</xsd:simpleType>

However, because as any HL7 data value can be NULL, when the string is used by HL7 elements other than data type components, the string data is packaged as the text content of a complex XML schema type.

Schema Fragment 30:
<xsd:complexType name="ST" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ANY"/>
    </xsd:complexContent>
</xsd:complexType>

In the normative schema, the complex XML schema type for ST is formally a restriction of the ED data type which corresponds with the conceptualization set forth by the Data Types Abstract Specification. However, essentially we arrive at the ST schema type by disabling or fixing all ED components. The media type is fixed to text/plain, and the data encoding (inherited from BIN) is fixed to TXT. This effectively leaves very simple schema type that only allows one text node or the NULL value shown above. The effect of this form of specializing the ST from the ED is that HL7 instances can always replace a simple ST value instead of an element of ED data type.

Schema Fragment 31:
<xsd:complexType name="ST" mixed="true">
    <xsd:complexContent>
      <xsd:restriction base="ED">
        <xsd:sequence>
          <xsd:element name='reference' type='TEL' EXCLUDED />
          <xsd:element name='thumbnail' type='ED' EXCLUDED />
        </xsd:sequence>
        <xsd:attribute name='encoding' type='cs_BinaryDataEncoding' EXCLUDED />
        <xsd:attribute name='mediaType' type='cs' EXCLUDED />
        <xsd:attribute ref='xml:lang' EXCLUDED />
        <xsd:attribute name='compression' type='cs_CompressionAlgorithm' EXCLUDED />
        <xsd:attribute name='integrityCheck' type='bin' EXCLUDED />
        <xsd:attribute name='integrityCheckAlgorithm' type='cs_IntegrityCheckAlgorithm' EXCLUDED />
      </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

Text content is only allowed in non-NULL values.

Schema Fragment 32:
<hl7:pr assert="(@nullFlavor or text()) and not(@nullFlavor and text())"/>

2.5.1

Encoding : cs (excluded)

Definition:      Specifies the encoding of the binary data that is the content of the binary data complex XML schema data type.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 33:
<xsd:attribute name="encoding" type="cs_BinaryDataEncoding" fixed="TXT" use="prohibited"/>

2.5.2

Media Type : cs (excluded)

Definition:      Identifies the encoding of the encapsulated data and identifies a method to interpret or render the data.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 34:
<xsd:attribute name="mediaType" type="cs" fixed="text/plain" use="prohibited"/>

2.5.3

Language : cs (excluded)

Definition:      For character based information the language property specifies the human language of the text.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 35:
<xsd:attribute ref="xml:lang" use="prohibited"/>

2.5.4

Compression : cs (excluded)

Definition:      Indicates whether the raw byte data is compressed, and what compression algorithm was used.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 36:
<xsd:attribute name="compression" type="cs_CompressionAlgorithm" use="prohibited"/>

2.5.5

Reference : TEL (excluded)

Definition:      A telecommunication address (TEL), such as a URL for HTTP or FTP, which will resolve to precisely the same binary data that could as well have been provided as inline data.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 37:
<xsd:element name="reference" type="TEL" minOccurs="0" maxOccurs="0"/>

2.5.6

Integrity Check : bin (excluded)

Definition:      The integrity check is a short binary value representing a cryptographically strong checksum that is calculated over the binary data. The purpose of this property, when communicated with a reference is for anyone to validate later whether the reference still resolved to the same data that the reference resolved to when the encapsulated data value with reference was created.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 38:
<xsd:attribute name="integrityCheck" type="bin" use="prohibited"/>

2.5.7

Integrity Check Algorithm : cs (excluded)

Definition:      Specifies the algorithm used to compute the integrityCheck value.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 39:
<xsd:attribute name="integrityCheckAlgorithm" type="cs_IntegrityCheckAlgorithm" use="prohibited" fixed="SHA-1"/>

2.5.8

Thumbnail : ED (excluded)

Definition:      A thumbnail is an abbreviated rendition of the full data. A thumbnail requires significantly fewer resources than the full data, while still maintaining some distinctive similarity with the full data. A thumbnail is typically used with by-reference encapsulated data. It allows a user to select data more efficiently before actually downloading through the reference.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 40:
<xsd:element name="thumbnail" type="ED" minOccurs="0" maxOccurs="0"/>

2.6

Coded Simple Value (CS) restricts CV

Definition:      Coded data in its simplest form, consists of a code and display name. The code system and code system version is fixed by the context in which the CS value occurs. CS is used for coded attributes that have a single HL7-defined value set.

Table 8: Components of Coded Simple Value
Name Type Description
code st The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
displayName st A name or title for the code, under which the sending system shows the code value to its users.
XML Representation

The XML schema for CS exists in two forms, as a simple schema type and as a complex schema type. The simple schema type only contains the code component and no display name. This simple form is used mostly as HL7 data type components so they can appear as XML attributes.

Schema Fragment 41:
<xsd:simpleType name="cs">
    <xsd:restriction base="xsd:token">
      <xsd:pattern value="[^\s]*"/>
    </xsd:restriction>
</xsd:simpleType>

For the simple form, the CS code value is a restriction of the XML schema data type "token" that may not contain any white space character anywhere. This means, it may not contain leading or trailing white space, tabs or line feed characters.

The normal use of the CS data type in HL7 elements is as a complex XML schema type, such that the common NULL properties (null flavor) can be communicated.

Schema Fragment 42:
<xsd:complexType name="CS">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:attribute name='code' type='cs' ... />
        <xsd:attribute name='displayName' type='st' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

According to both the Data Types Abstract Specification and the XML schema, the CS data type is formally defined as a restriction of the more complex coded data type CV (discussed below), using the following constraints.

Schema Fragment 43:
<xsd:complexType name="CS">
    <xsd:complexContent>
      <xsd:restriction base="CV">
        <xsd:sequence>
          <xsd:element name='originalText' EXCLUDED />
        </xsd:sequence>
        <xsd:attribute name='code' type='cs' ... />
        <xsd:attribute name='codeSystem' type='uid' EXCLUDED />
        <xsd:attribute name='codeSystemName' type='st' EXCLUDED />
        <xsd:attribute name='codeSystemVersion' type='st' EXCLUDED />
        <xsd:attribute name='displayName' type='st' ... />
      </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

This apparently more complicated definition by restriction is done to allow substituting a simple CV data value in a more complex CD or CE data element. The substitution of a CS for a CD, CE, or CV requires that the HL7 element specification defines at least a default coding system.

2.6.1

Code : st (inherited from CD)

Definition:      The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.

Schema Fragment 44:
<xsd:attribute name="code" type="cs" use="optional"/>

2.6.2

Code System : uid (excluded)

Definition:      Specifies the code system that defines the code.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 45:
<xsd:attribute name="codeSystem" type="uid" use="prohibited"/>

The fact that a sending system is prohibited from specifying a code system for an CS data value should not be misconstrued as if such codes would not have any code system. Rather, the code system in CS values is fixed by the context. That context is defined by the HL7 element being declared of the CS data type.

2.6.3

Code System Name : st (excluded)

Definition:      A common name of the coding system.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 46:
<xsd:attribute name="codeSystemName" type="st" use="prohibited"/>

2.6.4

Code System Version : st (excluded)

Definition:      If applicable, a version descriptor defined specifically for the given code system

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 47:
<xsd:attribute name="codeSystemVersion" type="st" use="prohibited"/>

2.6.5

Display Name : st (inherited from CD)

Definition:      A name or title for the code, under which the sending system shows the code value to its users.

Schema Fragment 48:
<xsd:attribute name="displayName" type="st" use="optional"/>

2.6.6

Original Text : ED (excluded)

Definition:      The text or phrase used as the basis for the coding.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 49:
<xsd:element name="originalText" minOccurs="0" maxOccurs="0"/>

2.7

Coded Value (CV)

Definition:      Coded data, consists of a code, display name, code system, and original text. Used when a single code value must be sent.

Table 9: Components of Coded Value
Name Type Description
code st The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
codeSystem uid Specifies the code system that defines the code.
codeSystemName st A common name of the coding system.
codeSystemVersion st If applicable, a version descriptor defined specifically for the given code system
displayName st A name or title for the code, under which the sending system shows the code value to its users.
originalText ED The text or phrase used as the basis for the coding.
XML Representation

The XML schema for CV is effectively the following complex schema type.

Schema Fragment 50:
<xsd:complexType name="CV">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:sequence>
          <xsd:element name="originalText" type="ST" minOccurs="0" maxOccurs="1"/>
        </xsd:sequence>
        <xsd:attribute name="code" type="cs" use="optional"/>
        <xsd:attribute name="codeSystem" type="uid" use="optional"/>
        <xsd:attribute name="codeSystemName" type="st" use="optional"/>
        <xsd:attribute name="codeSystemVersion" type="st" use="optional"/>
        <xsd:attribute name="displayName" type="st" use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

According to both the Data Types Abstract Specification and the XML schema, the CV data type is formally defined as a restriction of the more complex coded data type CE (discussed below), using the following constraints.

Schema Fragment 51:
<xsd:complexType name="CV">
    <xsd:complexContent>
      <xsd:restriction base="CE">
        <xsd:sequence>
          <xsd:element name='originalText' type='ED' ... />
          <xsd:element name='translation' type='CD' ... />
        </xsd:sequence>
        <xsd:attribute name='code' type='cs' ... />
        <xsd:attribute name='codeSystem' type='uid' ... />
        <xsd:attribute name='codeSystemName' type='st' ... />
        <xsd:attribute name='codeSystemVersion' type='st' ... />
        <xsd:attribute name='displayName' type='st' ... />
      </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

This apparently more complicated definition by restriction is done to allow substituting a simple CV data value in a more complex CD or CE data element.

2.7.1

Code : st (inherited from CD)

Definition:      The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.

Schema Fragment 52:
<xsd:attribute name="code" type="cs" use="optional"/>

2.7.2

Code System : uid (inherited from CD)

Definition:      Specifies the code system that defines the code.

Schema Fragment 53:
<xsd:attribute name="codeSystem" type="uid" use="optional"/>

2.7.3

Code System Name : st (inherited from CD)

Definition:      A common name of the coding system.

Schema Fragment 54:
<xsd:attribute name="codeSystemName" type="st" use="optional"/>

2.7.4

Code System Version : st (inherited from CD)

Definition:      If applicable, a version descriptor defined specifically for the given code system

Schema Fragment 55:
<xsd:attribute name="codeSystemVersion" type="st" use="optional"/>

2.7.5

Display Name : st (inherited from CD)

Definition:      A name or title for the code, under which the sending system shows the code value to its users.

Schema Fragment 56:
<xsd:attribute name="displayName" type="st" use="optional"/>

2.7.6

Original Text : ED (inherited from CD)

Definition:      The text or phrase used as the basis for the coding.

Schema Fragment 57:
<xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1"/>

2.7.7

Translation : CD (excluded)

Definition:      A set of other concept descriptors that translate this concept descriptor into other code systems.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 58:
<xsd:element name="translation" minOccurs="0" maxOccurs="0"/>

2.8

Coded with Equivalents (CE)

Definition:      Coded data, consists of a coded value (CV) and, optionally, coded value(s) from other coding systems that identify the same concept. Used when alternative codes may exist.

Table 10: Components of Coded with Equivalents
Name Type Description
code st The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
codeSystem uid Specifies the code system that defines the code.
codeSystemName st A common name of the coding system.
codeSystemVersion st If applicable, a version descriptor defined specifically for the given code system
displayName st A name or title for the code, under which the sending system shows the code value to its users.
originalText ED The text or phrase used as the basis for the coding.
translation CD A set of other concept descriptors that translate this concept descriptor into other code systems.
XML Representation

The XML schema for CE is effectively the following complex schema type.

Schema Fragment 59:
<xsd:complexType name="CE">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:sequence>
          <xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1"/>
          <xsd:element name="translation" type="CV" minOccurs="0" maxOccurs="unbounded"/>
        </xsd:sequence>
        <xsd:attribute name="code" type="cs" use="optional"/>
        <xsd:attribute name="codeSystem" type="uid" use="optional"/>
        <xsd:attribute name="codeSystemName" type="st" use="optional"/>
        <xsd:attribute name="codeSystemVersion" type="st" use="optional"/>
        <xsd:attribute name="displayName" type="st" use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

According to both the Data Types Abstract Specification and the XML schema, the CE data type is formally defined as a restriction of the more complex coded data type CD (discussed below), using the following constraints.

Schema Fragment 60:
<xsd:complexType name="CE">
    <xsd:complexContent>
      <xsd:restriction base="CD">
        <xsd:sequence>
          <xsd:element name='qualifier' EXCLUDED />
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

This apparently more complicated definition by restriction is done to allow substituting a simple CE data value in a more complex CD data element.

2.8.1

Code : st (inherited from CD)

Definition:      The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.

Schema Fragment 61:
<xsd:attribute name="code" type="cs" use="optional"/>

2.8.2

Code System : uid (inherited from CD)

Definition:      Specifies the code system that defines the code.

Schema Fragment 62:
<xsd:attribute name="codeSystem" type="uid" use="optional"/>

2.8.3

Code System Name : st (inherited from CD)

Definition:      A common name of the coding system.

Schema Fragment 63:
<xsd:attribute name="codeSystemName" type="st" use="optional"/>

2.8.4

Code System Version : st (inherited from CD)

Definition:      If applicable, a version descriptor defined specifically for the given code system

Schema Fragment 64:
<xsd:attribute name="codeSystemVersion" type="st" use="optional"/>

2.8.5

Display Name : st (inherited from CD)

Definition:      A name or title for the code, under which the sending system shows the code value to its users.

Schema Fragment 65:
<xsd:attribute name="displayName" type="st" use="optional"/>

2.8.6

Qualifier : LIST<CR> (excluded)

Definition:      Specifies additional codes that increase the specificity of the the primary code.

This component is inherited from a generalization data type but its use in this specialization is prohibited.

Schema Fragment 66:
<xsd:element name="qualifier" minOccurs="0" maxOccurs="0"/>

2.8.7

Original Text : ED (inherited from CD)

Definition:      The text or phrase used as the basis for the coding.

Schema Fragment 67:
<xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1"/>

2.8.8

Translation : CD (inherited from CD)

Definition:      A set of other concept descriptors that translate this concept descriptor into other code systems.

Schema Fragment 68:
<xsd:element name="translation" type="CD" minOccurs="0" maxOccurs="unbounded"/>

2.9

Concept Descriptor (CD)

Definition:      A concept descriptor represents any kind of concept usually by giving a code defined in a code system. A concept descriptor can contain the original text or phrase that served as the basis of the coding and one or more translations into different coding systems. A concept descriptor can also contain qualifiers to describe, e.g., the concept of a "left foot" as a postcoordinated term built from the primary code "FOOT" and the qualifier "LEFT". In exceptional cases, the concept descriptor need not contain a code but only the original text describing that concept.

Table 11: Components of Concept Descriptor
Name Type Description
code st The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
codeSystem uid Specifies the code system that defines the code.
codeSystemName st A common name of the coding system.
codeSystemVersion st If applicable, a version descriptor defined specifically for the given code system
displayName st A name or title for the code, under which the sending system shows the code value to its users.
originalText ED The text or phrase used as the basis for the coding.
translation CD A set of other concept descriptors that translate this concept descriptor into other code systems.
qualifier LIST<CR> Specifies additional codes that increase the specificity of the the primary code.
XML Representation

The normative XML schema for CD is defined as the following complex schema type.

Schema Fragment 69:
<xsd:complexType name="CD" mixed="false">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:sequence>
          <xsd:element name='qualifier' type='CR' ... />
          <xsd:element name='originalText' type='ED' ... />
          <xsd:element name='translation' type='CD' ... />
        </xsd:sequence>
        <xsd:attribute name='code' type='cs' ... />
        <xsd:attribute name='codeSystem' type='uid' ... />
        <xsd:attribute name='codeSystemName' type='st' ... />
        <xsd:attribute name='codeSystemVersion' type='st' ... />
        <xsd:attribute name='displayName' type='st' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.9.1

Code : st

Definition:      The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.

XML Representation
Schema Fragment 70:
<xsd:attribute name="code" type="cs" use="optional"/>

2.9.2

Code System : uid

Definition:      Specifies the code system that defines the code.

XML Representation
Schema Fragment 71:
<xsd:attribute name="codeSystem" type="uid" use="optional"/>

2.9.3

Code System Name : st

Definition:      A common name of the coding system.

XML Representation
Schema Fragment 72:
<xsd:attribute name="codeSystemName" type="st" use="optional"/>

2.9.4

Code System Version : st

Definition:      If applicable, a version descriptor defined specifically for the given code system

XML Representation
Schema Fragment 73:
<xsd:attribute name="codeSystemVersion" type="st" use="optional"/>

2.9.5

Display Name : st

Definition:      A name or title for the code, under which the sending system shows the code value to its users.

XML Representation
Schema Fragment 74:
<xsd:attribute name="displayName" type="st" use="optional"/>

2.9.6

Original Text : ED

Definition:      The text or phrase used as the basis for the coding.

XML Representation
Schema Fragment 75:
<xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1"/>

2.9.7

Translation : CD

Definition:      A set of other concept descriptors that translate this concept descriptor into other code systems.

XML Representation
Schema Fragment 76:
<xsd:element name="translation" type="CD" minOccurs="0" maxOccurs="unbounded"/>

2.9.8

Qualifier : LIST<CR>

Definition:      Specifies additional codes that increase the specificity of the the primary code.

XML Representation
Schema Fragment 77:
<xsd:element name="qualifier" type="CR" minOccurs="0" maxOccurs="unbounded"/>

2.10

Concept Role (CR)

Definition:      A concept qualifier code with optionally named role. Both qualifier role and value codes must be defined by the coding system. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg".

Table 12: Components of Concept Role
Name Type Description
name CV Specifies the manner in which the concept role value contributes to the meaning of a code phrase. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". In this example "has-laterality" is the CR.name.
value CD The concept that modifies the primary code of a code phrase through the role relation. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows adding the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". In this example "left" is the CR.value.
inverted bl Indicates if the sense of the role name is inverted. This can be used in cases where the underlying code system defines inversion but does not provide reciprocal pairs of role names. By default, inverted is false.

The use of qualifiers is strictly governed by the code system used. The CD data type does not permit using qualifiers with code systems that do not provide for qualifiers (e.g. pre-coordinated systems, such as LOINC, ICD-10 PCS.)

XML Representation
Schema Fragment 78:
<xsd:complexType name="CR">
    <xsd:complexContent>
      <xsd:extension base="CD">
        <xsd:sequence>
          <xsd:element name='name' type='CV' ... />
          <xsd:element name='value' type='CD' ... />
        </xsd:sequence>
        <xsd:attribute name='inverted' type='bl' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.10.1

Name : CV

Definition:      Specifies the manner in which the concept role value contributes to the meaning of a code phrase. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". In this example "has-laterality" is the CR.name.

If a coding system allows postcoordination but no role names the name attribute can be NULL.

XML Representation
Schema Fragment 79:
<xsd:element name="name" type="CV" minOccurs="0" maxOccurs="1"/>

2.10.2

Value : CD

Definition:      The concept that modifies the primary code of a code phrase through the role relation. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows adding the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". In this example "left" is the CR.value.

This component is of type concept descriptor and thus can be in turn have qualifiers. This allows qualifiers to nest. Qualifiers can only be used as far as the underlying code system defines them. It is not allowed to use any kind of qualifiers for code systems that do not explicitly allow and regulate such use of qualifiers.

XML Representation
Schema Fragment 80:
<xsd:element name="value" type="CD" minOccurs="0" maxOccurs="1"/>

A value component is required or else the code role is NULL.

Schema Fragment 81:
<hl7:pr assert="(value or @nullFlavor) and not(@nullFlavor and node())"/>

2.10.3

Inversion Indicator : bl

Definition:      Indicates if the sense of the role name is inverted. This can be used in cases where the underlying code system defines inversion but does not provide reciprocal pairs of role names. By default, inverted is false.

For example, a code system may define the role relation "causes" besides the concepts "Streptococcus pneumoniae" and "Pneumonia". If that code system allows its roles to be inverted, one can construct the post-coordinated concept "Pneumococcus pneumonia" through "Pneumonia - causes, inverted - Streptococcus pneumoniae."

Roles may only be inverted if the underlying coding systems allows such inversion. Notably, if a coding system defines roles in inverse pairs or intentionally does not define certain inversions, the appropriate role code (e.g. "caused-by") must be used rather than inversion. It must be known whether the inverted property is true or false, if it is NULL, the role cannot be interpreted.

XML Representation
Schema Fragment 82:
<xsd:attribute name="inverted" type="bl" use="optional" default="false"/>

2.11

Unique Identifier String (UID)

Definition:      A unique identifier string is a character string which identifies an object in a globally unique and timeless manner. The allowable formats and values and procedures of this data type are strictly controlled by HL7. At this time, user-assigned identifiers may be certain character representations of ISO Object Identifiers (OID) and DCE Universally Unique Identifiers (UUID). HL7 also reserves the right to assign other forms of UIDs, such as mnemonic identifiers for code systems.

The sole purpose of the UID is to be a globally and timelessly unique identifier. The form of the UID, whether it is an OID, an UUID or any other form is entirely irrelevant. As far as HL7 is concerned, the only thing one can do with an UID is denote to the object for which it stands. Comparison of UIDs is literal, i.e. if two UIDs are literally identical, they are assumed to denote to the same object. If two UIDs are not literally identical they may not denote to the same object (and in general are assumed to denote to different objects.)

No difference in semantics is recognized between the different allowed forms of the UID. The different forms are not distinguished by a component within or aside from the identifier string itself.

XML Representation

The XML representation of an UID is only as a simple XML schema type (suitable for use in an XML attribute.) The simple type is used only in the HL7 data type schema. As UID is a protected type, it can only be used as the component of other data types.

Schema Fragment 83:
<xsd:simpleType name="uid">
    <xsd:restriction base="xsd:string">
      <xsd:pattern .../> <xsd:pattern .../> <xsd:pattern .../>
    </xsd:restriction>
</xsd:simpleType>

Even though this specification recognizes no semantic difference between the different forms of the unique identifier we use several simple XML schema types to make the definition more readable.

2.11.1

ISO Object Identifier (OID) Scheme

A globally unique string representing an ISO Object Identifier (OID) in a form that consists only of numbers and dots (e.g., "2.16.840.1.113883.3.1"). According to ISO, OIDs are paths in a tree structure, with the left-most number representing the root and the right-most number representing a leaf.

Each branch under the root corresponds to an assigning authority. Each of these assigning authorities may, in turn, designate its own set of assigning authorities that work under its auspices, and so on down the line. Eventually, one of these authorities assigns a unique (to it as an assigning authority) number that corresponds to a leaf node on the tree. The leaf may represent an assigning authority (in which case the OID identifies the authority), or an instance of an object. An assigning authority owns a namespace, consisting of its sub-tree.

OIDs are the preferred scheme for unique identifiers. OIDs should always be used except if one of the inclusion criteria for other schemes apply.

XML Representation
Schema Fragment 84:
<xsd:pattern value="([1-9][0-9]*)(\.[1-9][0-9]*)*"/>

2.11.2

DCE Universal Unique Identifier (UUID) Scheme

A DCE Universal Unique Identifier is a globally unique string consisting of 5 groups of hexadecimal digits having 8, 4, 4, 4, and 12 places respectively. UUIDs are assigned using Ethernet MAC addresses, the point in time of creation and some random components. This mix is believed to generate sufficiently unique identifiers without any organizational policy for identifier assignment (in fact this piggy-backs on the organization of MAC address assignment.)

UUIDs are not the preferred identifier scheme for use as HL7 UIDs. UUIDs may be used when identifiers are issued to objects representing individuals (e.g., entity instance identifiers, act event identifiers, etc.) For objectd describing classes of things or events (e.g., catalog items), OIDs are the preferred identifier scheme.

XML Representation
Schema Fragment 85:
<xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}"/>

2.11.3

HL7 Reserved Identifier Scheme

HL7 reserved identifiers are strings consisting only of (US-ASCII) letters, digits and hyphens, where the first character must be a letter. HL7 may assign these reserved identifiers as mnemonic identifiers for major concepts of interest to HL7.

XML Representation
Schema Fragment 86:
<xsd:pattern value="[A-Za-z][A-Za-z0-9-]*"/>

2.12

Instance Identifier (II)

Definition:      An identifier that uniquely identifies a thing or object. Examples are object identifier for HL7 RIM objects, medical record number, order id, service catalog item id, Vehicle Identification Number (VIN), etc. Instance identifiers are defined based on ISO object identifiers.

Table 13: Components of Instance Identifier
Name Type Description
root uid A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.
extension st A character string as a unique identifier within the scope of the identifier root.
assigningAuthorityName st A human readable name or mnemonic for the assigning authority. This name may be provided solely for the convenience of unaided humans interpreting an II value. Note: no automated processing must depend on the assigning authority name to be present in any form.
displayable bl Specifies if the identifier's extension is intendended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).
validTime IVL<TS> If applicable, specifies during what time the identifier is valid. By default, the identifier is valid indefinitely. Any specific interval may be undefined on either side indicating unknown effective or expiry time.

Some identifier schemes define certain style options to their code values. For example, the U.S. Social Security Number (SSN) is normally written with dashes that group the digits into a pattern "123-12-1234". However, the dashes are not meaningful and a SSN can just as well be represented as "123121234" without the dashes.

In the case where identifier schemes provide for multiple representations, HL7 shall make a ruling about which is the preferred form. HL7 shall document that ruling where that respective external identifier scheme is recognized. HL7 shall decide upon the preferred form based on criteria of practicality and common use. In absence of clear criteria of practicality and common use, the safest, most extensible, and least stylized (the least decorated) form shall be given preference.

Leading zeroes in identifiers are deprecated. They frequently lead to confusion because some applications may or may not strip those zeroes. They are also sometimes used to indicate a certain maximum number of digits. This is in itself to be discouraged, because it the notion of a maximum identifier leads to overflow conditions which make identifiers non-unique and thus violate this specification.

XML Representation
Schema Fragment 87:
<xsd:complexType name="II">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:sequence>
          <xsd:element name='validTime' ... />
        </xsd:sequence>
        <xsd:attribute name='root' type='uid' ... />
        <xsd:attribute name='extension' type='st' ... />
        <xsd:attribute name='assigningAuthorityName' type='st' ... />
        <xsd:attribute name='display' type='bl' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.12.1

Root : uid

Definition:      A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.

XML Representation
Schema Fragment 88:
<xsd:attribute name="root" type="uid" use="optional"/>
A root component is required or else the II value is NULL.
Schema Fragment 89:
<hl7:pr assert="(@root or @nullFlavor) and not(@root and @nullFlavor)"/>

2.12.2

Extension : st

Definition:      A character string as a unique identifier within the scope of the identifier root.

XML Representation
Schema Fragment 90:
<xsd:attribute name="extension" type="st" use="optional"/>

2.12.3

Assigning Authority Name : st

Definition:      A human readable name or mnemonic for the assigning authority. This name may be provided solely for the convenience of unaided humans interpreting an II value. Note: no automated processing must depend on the assigning authority name to be present in any form.

XML Representation
Schema Fragment 91:
<xsd:attribute name="assigningAuthorityName" type="st" use="optional"/>

2.12.4

Displayable : bl

Definition:      Specifies if the identifier's extension is intendended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).

XML Representation
Schema Fragment 92:
<xsd:attribute name="display" type="bl" use="optional"/>

2.12.5

Valid Time : IVL<TS>

Definition:      If applicable, specifies during what time the identifier is valid. By default, the identifier is valid indefinitely. Any specific interval may be undefined on either side indicating unknown effective or expiry time.

NOTE: identifiers for information objects in computer systems should not have restricted valid times, but should be globally unique at all times. The identifier valid time is provided mainly for real-world identifiers, whose maintenance policy may include expiry (e.g., credit card numbers.)
XML Representation
Schema Fragment 93:
<xsd:element name="validTime" minOccurs="0" maxOccurs="1">
    <gsd:template as="type" name="IVL">
      <gsd:withParam name="T" type="TS"/>
    </gsd:template>
</xsd:element>

2.13

Universal Resource Locator (URL)

Definition:      A telecommunications address specified according to Internet standard RFC 1738 [http://www.isi.edu/in-notes/rfc1738.txt]. The URL specifies the protocol and the contact point defined by that protocol for the resource. Notable uses of the telecommunication address data type are for telephone and telefax numbers, e-mail addresses, Hypertext references, FTP references, etc.

URLs have a standard representation as a character string, formatted as "<scheme>:<address>" where the most common schemes are listed in Table 14. The address portion of the URL is a character string whose format is entirely defined by the URL scheme.

Table 14: Domain URLScheme:
code name definition
tel Telephone A voice telephone number [draft-antti-telephony-url-11.txt]. Required for HL7 use.
fax Fax A telephone number served by a fax device [draft-antti-telephony-url-11.txt]. Required for HL7 use.
mailto Mailto Electronic mail address [RFC 2368]. Required for HL7 use.
http HTTP Hypertext Transfer Protocol [RFC 2068]. Required for HL7 use.
ftp FTP The File Transfer Protocol (FTP) [RFC 1738]. Required for HL7 use.
file File Host-specific local file names [RCF 1738]. Note that the file scheme works only for local files. There is little use for exchanging local file names between systems, since the receiving system likely will not be able to access the file. Deprecated for
nfs NFS Network File System protocol [RFC 2224]. Some sites use NFS servers to share data files.
telnet Telnet Reference to interactive sessions [RFC 1738]. Some sites, (e.g., laboratories) have TTY based remote query sessions that can be accessed through telnet.
modem Modem A telephone number served by a modem device [draft-antti-telephony-url-11.txt].

2.13.1

Telephone and FAX Numbers

Telephone and FAX Numbers. There is no special data type for telephone numbers. Telephone numbers are telecommunication addresses and are specified as a URL. The voice telephone URLs begin with "tel:" and fax URLs begin with "fax:"

The telephone number URL is defined in the Internet RFC 2806 [http://www.isi.edu/in-notes/rfc2806.txt] URLs for Telephone Calls. For examples, "tel:+1(317)630-7960" is a phone number, and "fax:+49(30)8101-724" is a FAX number. The global absolute telephone numbers starting with the "+" and country code are preferred. Separator characters serve as decoration but have no meaning for the telephone number, thus "tel:+13176307960" and "fax:+49308101724" are the same telephone and FAX numbers as the previous respective examples.

XML Representation

The URL data type in XML is essentially represented as a simple XML schema data type xsd:anyURI.

Schema Fragment 94:
<xsd:simpleType name="url">
    <xsd:restriction base="xsd:anyURI"/>
</xsd:simpleType>

By convention, simple types have a schema name that uses the lower case form of the HL7 data type short name.

However, the only use of URL is allowed as its extension TEL that adds additional attributes. Therefore we define the URL as a complex schema type capsule, that has the simple URL type as it's XML attribute called "value".

Schema Fragment 95:
<xsd:complexType name="URL">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:attribute name="value" type="url" use="optional"/>
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

By convention, complex XML types have a schema name that uses the upper case form of the HL7 data type short name.

Although the use of the XML-attribute value is optional, the constraint (expressed as an XPath predicate), specifies that there must be either an XML-attribute value or the ANY.nullFlavor attribute, but not both.

Schema Fragment 96:
<hl7:pr assert="(@nullFlavor or @value) and not(@nullFlavor and @value)"/>

2.14

Telecommunication Address (TEL) extends URL

Definition:      A telephone number (voice or fax), e-mail address, or other locator for a resource (information or service) mediated by telecommunication equipment. The address is specified as a Universal Resource Locator (URL) qualified by time specification and use codes that help deciding which address to use for a given time and purpose.

Table 15: Components of Telecommunication Address
Name Type Description
validTime GTS Specifies the periods of time during which the telecommunication address can be used. For a telephone number, this can indicate the time of day in which the party can be reached on that telephone. For a web address, it may specify a time range in which the web content is promised to be available under the given address.
use set<cs> One or more codes advising a system or user which telecommunication address in a set of like addresses to select for a given telecommunication need.
XML Representation
Schema Fragment 97:
<xsd:complexType name="TEL">
    <xsd:complexContent>
      <xsd:extension base="URL">
        <xsd:sequence>
          <xsd:element name='validTime' ... />
        </xsd:sequence>
        <xsd:attribute name='use' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.14.1

Valid Time : GTS

Definition:      Specifies the periods of time during which the telecommunication address can be used. For a telephone number, this can indicate the time of day in which the party can be reached on that telephone. For a web address, it may specify a time range in which the web content is promised to be available under the given address.

XML Representation
Schema Fragment 98:
<xsd:element name="validTime" minOccurs="0" maxOccurs="unbounded">
    <gsd:template as="type" name="SXCM">
      <gsd:withParam name="T" type="TS"/>
    </gsd:template>
</xsd:element>

2.14.2

Use : set<cs>

Definition:      One or more codes advising a system or user which telecommunication address in a set of like addresses to select for a given telecommunication need.

The telecommunication address use codes are defined by the HL7 domain TelecommunicationAddressUse.

Table 16: Domain TelecommunicationAddressUse:
code name definition
H home A communication address at a home, attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no othe
HP primary home The primary home, to reach a person after business hours.
HV vacation home A vacation home, to reach a person while on vacation.
WP work place An office address. First choice for business related contacts during business hours.
AS answering service An automated answering machine used for less urgent cases and if the main purpose of contact is to leave a message or access an automated announcement.
EC emergency contact A contact specifically designated to be used for emergencies. This is the first choice in emergencies, independent of any other use codes.
PG pager A paging device suitable to solicit a callback or to leave a very short message.
MC mobile contact A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, suitable for urgent matters, not the first choice for routine business.

The telecommunication use code is not a complete classification for equipment types or locations. Its main purpose is to suggest or discourage the use of a particular telecommunication address. The use code should not be considered in isolation. The data element in which the telephone number appears (class and attribute) and the context to other data may express the precise nature and use of the telecommunication address more appropriately than a use code.

XML Representation
Schema Fragment 99:
<xsd:attribute name="use" use="optional">
    <gsd:template as="type" name="set">
      <gsd:withParam name="T" type="cs_TelecommunicationAddressUse"/>
    </gsd:template>
</xsd:attribute>

The use code domain in XML is represented as a specialization of the simple XML schema type 'cs'.

Schema Fragment 100:
<xsd:simpleType name="cs_TelecommunicationAddressUse">
    <xsd:restriction base="cs">
      <xsd:enumeration value="H"/>
      <xsd:enumeration value="HP"/>
      <xsd:enumeration value="HV"/>
      <xsd:enumeration value="WP"/>
      <xsd:enumeration value="AS"/>
      <xsd:enumeration value="EC"/>
      <xsd:enumeration value="PG"/>
      <xsd:enumeration value="MC"/>
    </xsd:restriction>
</xsd:simpleType>

2.15

Address Part (ADXP)

Definition:      A character string that may have a type-tag signifying its role in the address. Typical parts that exist in about every address are street, house number, or post box, postal code, city, country but other roles may be defined regionally, nationally, or on an enterprise level (e.g. in military addresses). Addresses are usually broken up into lines, which are indicated by special line-breaking delimiter elements (e.g., DEL).

Table 17: Components of Address Part
Name Type Description
data xsl:string The data itself represented in the XML instance encoding according to the binary data encoding element (text or base64 form.) Character strings and derived types use only the text encoding, which is the same encoding as the overall XML instance.
partType cs Specifies whether an address part names the street, city, country, postal code, post box, etc. If the type is NULL the address part is unclassified and would simply appear on an address label as is.
XML Representation

The address part in XML is, like the character string, a complex type with a character context model. The text content is the address part value and the type attribute is the address part type.

Schema Fragment 101:
<xsd:complexType name="ADXP" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ST">
        <xsd:attribute name='partType' type='cs_AddressPartType' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.15.1

Address Part Type : cs

Definition:      Specifies whether an address part names the street, city, country, postal code, post box, etc. If the type is NULL the address part is unclassified and would simply appear on an address label as is.

Address part types are as defined in Table 18

Table 18: Domain AddressPartType:
code name definition
DEL delimiter Delimiters are printed without framing white space. If no value component is provided, the delimiter appears as a line break.
CNT country Country
STA state or province A sub-unit of a country with limited sovereignty in a federally organized country.
CPA County or Parish A sub-unit of a state or province. (49 of the United States of America use the term "county;" Louisiana uses the term "parish").
CTY city City
ZIP postal code A postal code designating a region defined by the postal service.
STR street name Street name or number.
HNR house number The number of a house or lot alongside the street. Also known as "primary street number", but does not number the street but the house.
SAL Street Address Line A street address line is often used instead of separately distinguishing street name and house number. The street address line can repeat to represent "street address line 1" and "street address line 2".
DIR direction direction (e.g., N, S, W, E)
ADL additional locator This can be a unit designator, such as apartment number, suite number, or floor. There may be several unit designators in an address (e.g., "3rd floor, Appt. 342".) This can also be a designator pointing away from the location, rather than specifying a s
POB post box A numbered box located in a post station.
CEN census tract A sub-unit of country delineated for demographic purposes.

Addresses are conceptualized as text with added mark-up. The mark-up may break the address into lines and may describe in detail the role of each address part if it is known. Address parts occur in the address in the order in which they would be printed on a mailing label. The model is similar to HTML or XML markup of text.

XML Representation
Schema Fragment 102:
<xsd:attribute name="partType" type="cs_AddressPartType"/>

The address part type is represented in XML as a specialization of the simple XML schema type 'cs'.

Schema Fragment 103:
<xsd:simpleType name="cs_AddressPartType">
    <xsd:restriction base="cs">
      <xsd:enumeration value="DEL"/>
      <xsd:enumeration value="CNT"/>
      <xsd:enumeration value="STA"/>
      <xsd:enumeration value="CPA"/>
      <xsd:enumeration value="CTY"/>
      <xsd:enumeration value="ZIP"/>
      <xsd:enumeration value="STR"/>
      <xsd:enumeration value="HNR"/>
      <xsd:enumeration value="SAL"/>
      <xsd:enumeration value="DIR"/>
      <xsd:enumeration value="ADL"/>
      <xsd:enumeration value="POB"/>
      <xsd:enumeration value="CEN"/>
    </xsd:restriction>
</xsd:simpleType>

Because the model of addresses is similar to an XML markup, XML schema elements are defined to represent the address part types, such that address parts can be directly represented as XML markup. For example, a the elements country (CNT), state (STA), county (CPA), city (CTY), postalCode (ZIP), streetName (STR), houseNumber (HNR), streetAddressLine (SAL), direction (DIR), postBox (POB), etc. are defined.

Schema Fragment 104:
<xsd:element name="delimiter">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="DEL"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="country">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CNT"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="state">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="STA"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="county">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CPA"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="city">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CTY"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="postalCode">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="ZIP"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="streetAddressLine">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="SAL"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="streetName">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="STR"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="houseNumber">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="HNR"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="direction">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="DIR"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="additionalLocator">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="ADL"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="postBox">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="POB"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="censusTract">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ADXP">
          <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CEN"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>

2.16

Postal Address (AD)

Definition:      Mailing and home or office addresses. A sequence of address parts, such as street or post office Box, city, postal code, country, etc.

The AD is primarily used to communicate data that will allow printing mail labels, that will allow a person to physically visit that address. The postal address data type is not supposed to be a container for additional information that might be useful for finding geographic locations (e.g., GPS coordinates) or for performing epidemiological studies. Such additional information is captured by other, more appropriate HL7 elements.

Structurally, the postal address data type is a sequence of address part values with an added "use" code and a valid time range for information about if and when the address can be used for a given purpose.

Applications are not required to preserve the ordering of the address parts.

Table 19: Components of Postal Address
Name Type Description
text LIST<ADXP> The data content of the address value is a sequence of address part elements (which, in XML, can be plain text nodes.)
use set<cs> A set of codes advising a system or user which address in a set of like addresses to select for a given purpose.
validTime GTS A General Timing Specification (GTS) specifying the periods of time during which the address can be used. This is used to specify different addresses for different times of the year or to refer to historical addresses.
XML Representation

The data content of the address value is a sequence of address part elements (which, in XML, can be plain text nodes.)

Schema Fragment 105:
<xsd:complexType name="AD" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:sequence>
          <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name='delimiter' ... />
            <xsd:element name='country' ... />
            <xsd:element name='state' ... />
            <xsd:element name='county' ... />
            <xsd:element name='city' ... />
            <xsd:element name='postalCode' ... />
            <xsd:element name='streetAddressLine' ... />
            <xsd:element name='streetName' ... />
            <xsd:element name='houseNumber' ... />
            <xsd:element name='direction' ... />
            <xsd:element name='additionalLocator' ... />
            <xsd:element name='postBox' ... />
            <xsd:element name='censusTract' ... />
          </xsd:choice>
          <xsd:element name='validTime' ... />
        </xsd:sequence>
        <xsd:attribute name='use' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.16.1

Data as XML Mixed Content : LIST<ADXP>

Definition:      The data content of the address value is a sequence of address part elements (which, in XML, can be plain text nodes.)

2.16.2

Use : set<cs>

Definition:      A set of codes advising a system or user which address in a set of like addresses to select for a given purpose.

The postal address use codes are defined by the HL7 domain PostalAddressUse.

Table 20: Domain PostalAddressUse:
code name definition
PHYS visit address A physical address, used primarily to visit the addressee.
PST postal address Used to send mail.
TMP temporary address A temporary address, may be good for visit or mailing. Note that an address history can provide more detailed information.
BAD bad address A flag indicating that the address is bad, in fact, useless.
H home A communication address at a home, attempted contacts for business purposes might intrude privacy and chances are one will contact family or other household members instead of the person one wishes to call. Typically used with urgent cases, or if no othe
HP primary home The primary home, to reach a person after business hours.
HV vacation home A vacation home, to reach a person while on vacation.
WP work place An office address. First choice for business related contacts during business hours.
ABC Alphabetic Alphabetic transcription of name (Japanese: romaji)Alphabetic transcription of name (Japanese: romaji)Alphabetic transcription of name (Japanese: romaji)
SYL Syllabic Syllabic transcription of name (e.g., Japanese kana, Korean hangul)Syllabic transcription of name (e.g., Japanese kana, Korean hangul)Syllabic transcription of name (e.g., Japanese kana, Korean hangul)
IDE Ideographic Ideographic representation of name (e.g., Japanese kanji, Chinese characters)Ideographic representation of name (e.g., Japanese kanji, Chinese characters)Ideographic representation of name (e.g., Japanese kanji, Chinese characters)

The postal address use code is not a complete classification for locations or activities that take place at these locations. Its main purpose is to suggest or discourage the use of a particular address. The use code should not be considered in isolation. The data element in which the address appears (class and attribute) and the context to other data may express the precise nature and use of the address more appropriately than a use code.

XML Representation
Schema Fragment 106:
<xsd:attribute name="use" use="optional">
    <gsd:template as="type" name="set">
      <gsd:withParam name="T" type="cs_PostalAddressUse"/>
    </gsd:template>
</xsd:attribute>

The use code domain in XML is represented as a specialization of the simple XML schema type 'cs'.

Schema Fragment 107:
<xsd:simpleType name="cs_PostalAddressUse">
    <xsd:restriction base="cs">
      <xsd:enumeration value="PHYS"/>
      <xsd:enumeration value="PST"/>
      <xsd:enumeration value="INV"/>
      <xsd:enumeration value="TMP"/>
      <xsd:enumeration value="BAD"/>
      <xsd:enumeration value="H"/>
      <xsd:enumeration value="HP"/>
      <xsd:enumeration value="HV"/>
      <xsd:enumeration value="WP"/>
      <xsd:enumeration value="ABC"/>
      <xsd:enumeration value="SYL"/>
      <xsd:enumeration value="IDE"/>
    </xsd:restriction>
</xsd:simpleType>

2.16.3

Valid Time : GTS

Definition:      A General Timing Specification (GTS) specifying the periods of time during which the address can be used. This is used to specify different addresses for different times of the year or to refer to historical addresses.

XML Representation
Schema Fragment 108:
<xsd:element name="validTime" minOccurs="0" maxOccurs="1">
    <gsd:template as="type" name="SXCM">
      <gsd:withParam name="T" type="TS"/>
    </gsd:template>
</xsd:element>

2.16.4

Examples

The following are examples of addresses in an XML encoded form, where the XML tag is the address part role and the data content is the address part value.

The address:

1050 W Wishard Blvd,
RG 5th floor,
Indianapolis, IN 46240

Can be encoded in any of the following forms:

The first form would result from a system that only stores addresses as free text or in a list of fields line1, line2, etc.:

Example 4:
<addr use="WP">
  1050 W Wishard Blvd,
  RG 5th floor,
  Indianapolis, IN 46240
</addr>
 

The second form is more specific about the role of the address parts than the first one:

Example 5:
<addr use="WP">
  <streetAddressLine>1050 W Wishard Blvd</streetAddressLine>,
  <streetAddressLine>RG 5th floor</streetAddressLine>,
  <city>Indianapolis</city>, <state>IN</state> <postalCode>46240</postalCode>
</addr>
 

This form is the typical form seen in the U.S., where street address is sometimes separated, and city, state and ZIP code are always separated.

The third is even more specific:

Example 6:
<addr use="WP">
  <houseNumber>1050</houseNumber> <direction>W</direction> <streetName>Wishard Blvd</streetName>,
  <additionalLocator>RG 5th floor</additionalLocator>,
  <city>Indianapolis</city>, <state>IN</state> <postalCode>46240</postalCode>
</addr>
 

The latter form above is not used in the USA. However, it is useful in Germany, where many systems keep house number as a distinct field. For example, the German address:

Windsteiner Weg 54a,
D-14165 Berlin

would most likely be encoded as follows:

Example 7:
<addr use="HP">
  <streetName>Windsteiner Weg</streetName> <houseNumber>45a</houseNumber>,
  <country>D</country>-<postalCode>14165</postalCode> <CTY>Berlin</CTY>
</addr>
 

2.17

Entity Name Part (ENXP)

Definition:      A character string token representing a part of a name. May have a type code signifying the role of the part in the whole entity name, and a qualifyer code for more detail about the name part type. Typical name parts for person names are given names, and family names, titles, etc.

Table 21: Components of Entity Name Part
Name Type Description
data xsl:string The data itself represented in the XML instance encoding according to the binary data encoding element (text or base64 form.) Character strings and derived types use only the text encoding, which is the same encoding as the overall XML instance.
partType cs Indicates whether the name part is a given name, family name, prefix, suffix, etc.
qualifier cs The qualifier is a set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type. For example, a given name may be flagged as a nickname, a family name may be a pseudonym or a name of public records
XML Representation

The entity name part in XML is, like the character string, a complex type with a character context model. The text content is the address part value and the type attribute is the address part type.

Schema Fragment 109:
<xsd:complexType name="ENXP" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ST">
        <xsd:attribute name='partType' type='cs_EntityNamePartType' ... />
        <xsd:attribute name='qualifier' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.17.1

Name Part Type : cs

Definition:      Indicates whether the name part is a given name, family name, prefix, suffix, etc.

Entity name part types are as defined in Table 22

Table 22: Domain EntityNamePartType:
code name definition
FAM family Family name, this is the name that links to the genealogy. In some cultures (e.g. Eritrea) the family name of a son is the first name of his father.
GIV given Given name (don't call it "first name" since this given names do not always come first)
PFX prefix A prefix has a strong association to the immediately following name part. A prefix has no implicit trailing white space (it has implicit leading white space though). Note that prefixes can be inverted.A prefix has a strong association to the immediately following name part. A prefix has no implicit trailing white space (it has implicit leading white space though). Note that prefixes can be inverted.
SFX suffix A suffix has a strong association to the immediately preceding name part. A prefix has no implicit leading white space (it has implicit trailing white space though). Suffices can not be inverted.A suffix has a strong association to the immediately preceding name part. A prefix has no implicit leading white space (it has implicit trailing white space though). Suffices can not be inverted.
DEL delimiter A delimiter has no meaning other than being literally printed in this name representation. A delimiter has no implicit leading and trailing white space.A delimiter has no meaning other than being literally printed in this name representation. A delimiter has no implicit leading and trailing white space.

Not every name part must have a type code, if the type code is unknown, not applicable, or simply undefined this is expressed by a null value (type.isNull). For example, a name may be "Rogan Sulma" and it may not be clear which one is a first name or which is a last name, or whether Rogan may be a title.

Entity names are conceptualized as text with added mark-up. The mark-up may break the address into lines and may describe in detail the role of each name part if it is known. Name parts occur in the order in which they would be printed on a mailing label. The model is similar to HTML or XML markup of text.

Applications are not required to preserve the ordering of the name parts.

XML Representation
Schema Fragment 110:
<xsd:attribute name="partType" type="cs_EntityNamePartType"/>

The entity name part type code is represented in XML as a specialization of the simple XML schema type 'cs'.

Schema Fragment 111:
<xsd:simpleType name="cs_EntityNamePartType">
    <xsd:restriction base="cs">
      <xsd:enumeration value="FAM"/>
      <xsd:enumeration value="GIV"/>
      <xsd:enumeration value="PFX"/>
      <xsd:enumeration value="SFX"/>
      <xsd:enumeration value="DEL"/>
    </xsd:restriction>
</xsd:simpleType>

Because the model of names is similar to an XML markup, XML schema elements are defined to represent the name part types, such that name parts can be directly represented as XML markup. For example, family (FAM), given (GIV), prefix (PFX), and suffix (SFX) elements are defined.

Schema Fragment 112:
<xsd:element name="delimiter">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ENXP">
          <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="DEL"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="family">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ENXP">
          <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="FAM"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="given">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ENXP">
          <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="GIV"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="prefix">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ENXP">
          <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="PFX"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="suffix">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ENXP">
          <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="SFX"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>

2.17.2

Qualifier : cs

Definition:      The qualifier is a set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type. For example, a given name may be flagged as a nickname, a family name may be a pseudonym or a name of public records

Entity name part qualifiers are as defined in Table 22

Table 23: Domain EntityNamePartQualifier:
code name definition
BR birth A name that a person had shortly after being born. Usually for family names but may be used to mark given names at birth that may have changed later.
SP spouse The name assumed from the partner in a marital relationship (hence the "M"). Usually the spouse's family name. Note that no inference about gender can be made from the existence of spouse names.
VV voorvoegsel A Dutch "voorvoegsel" is something like "van" or "de" that might have indicated nobility in the past but no longer so. Similar prefixes exist in other languages such es Spanish, French or Portugese.
AC academic Indicates that a prefix like "Dr." or a suffix like "M.D." or "Ph.D." is an academic title.
PR professional Primarily in the British Imperial culture people tend to have an abbreviation of their professional organization as part of their credential suffices.
NB nobility In Europe and Asia, there are still people with nobility titles (aristocrats.) German "von" is generally a nobility title, not a mere voorvoegsel. Others are "Earl of" or "His Majesty King of..." etc. Rarely used nowadays, but some systems do keep trac
LS Legal status For organizations a suffix indicating the legal status, e.g., "Inc.", "Co.", "AG", "GmbH", "B.V." "S.A.", "Ltd." etc.
CL callme A callme name is (usually a given name) that is preferred when a person is directly addressed.
IN initial Indicates that a name part is just an initial. Initials do not imply a trailing period since this would not work with non-Latin scripts. Initials may consist of more than one letter, e.g., "Ph." could stand for "Philippe" or "Th." for "Thomas".
XML Representation
Schema Fragment 113:
<xsd:attribute name="qualifier" use="optional">
    <gsd:template as="type" name="set">
      <gsd:withParam name="T" type="cs_EntityNamePartQualifier"/>
    </gsd:template>
</xsd:attribute>

This is represented in XML as a specialization of the simple XML schema type 'cs'.

Schema Fragment 114:
<xsd:simpleType name="cs_EntityNamePartQualifier">
    <xsd:restriction base="cs">
      <xsd:enumeration value="BR"/>
      <xsd:enumeration value="SP"/>
      <xsd:enumeration value="VV"/>
      <xsd:enumeration value="AC"/>
      <xsd:enumeration value="PR"/>
      <xsd:enumeration value="NB"/>
      <xsd:enumeration value="LS"/>
      <xsd:enumeration value="CL"/>
      <xsd:enumeration value="IN"/>
    </xsd:restriction>
</xsd:simpleType>

2.18

Entity Name (EN)

Definition:      A name for a person, organization, place or thing. A sequence of name parts, such as first name or family name, prefix, suffix, etc. Examples for entity name values are "Jim Bob Walton, Jr.", "Health Level Seven, Inc.", "Lake Tahoe", etc. An entity name may be as simple as a character string or may consist of several entity name parts, such as, "Jim", "Bob", "Walton", and "Jr.", "Health Level Seven" and "Inc.", "Lake" and "Tahoe".

Structurally, the entity name data type is a sequence of entity name part values with an added "use" code and a valid time range for information about if and when the name can be used for a given purpose.

Table 24: Components of Entity Name
Name Type Description
text LIST<ENXP> The data content of the entity name value is a sequence of entity name part elements (which, in XML, can be plain text nodes.)
use set<cs> A set of codes advising a system or user which name in a set of like addresses to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.
validTime IVL<TS> An interval of time specifying the time during which the name is or was used for the entity. This accomodates the fact that people change names for people, places and things.
XML Representation
Schema Fragment 115:
<xsd:complexType name="EN" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ANY">
        <xsd:sequence>
          <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name='delimiter' ... />
            <xsd:element name='family' ... />
            <xsd:element name='given' ... />
            <xsd:element name='prefix' ... />
            <xsd:element name='suffix' ... />
          </xsd:choice>
          <xsd:element name='validTime' ... />
        </xsd:sequence>
        <xsd:attribute name='use' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.18.1

Data as XML Mixed Content : LIST<ENXP>

Definition:      The data content of the entity name value is a sequence of entity name part elements (which, in XML, can be plain text nodes.)

2.18.2

Use : set<cs>

Definition:      A set of codes advising a system or user which name in a set of like addresses to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.

The entity names use codes are defined by the HL7 domain EntityNameUse.

Table 25: Domain EntityNameUse:
code name definition
L Legal known as/conventional/the one you useknown as/conventional/the one you use
A Artist/Stage Includes writer's pseudonym, stage name, etc
I Indigenous/Tribal e.g. Chief Red Cloud
R Religious e.g. Sister Mary Francis, Brother John
ABC Alphabetic Alphabetic transcription of name (Japanese: romaji)Alphabetic transcription of name (Japanese: romaji)Alphabetic transcription of name (Japanese: romaji)
SYL Syllabic Syllabic transcription of name (e.g., Japanese kana, Korean hangul)Syllabic transcription of name (e.g., Japanese kana, Korean hangul)Syllabic transcription of name (e.g., Japanese kana, Korean hangul)
IDE Ideographic Ideographic representation of name (e.g., Japanese kanji, Chinese characters)Ideographic representation of name (e.g., Japanese kanji, Chinese characters)Ideographic representation of name (e.g., Japanese kanji, Chinese characters)
XML Representation
Schema Fragment 116:
<xsd:attribute name="use" use="optional">
    <gsd:template as="type" name="set">
      <gsd:withParam name="T" type="cs_EntityNameUse"/>
    </gsd:template>
</xsd:attribute>

The use code domain in XML is represented as a specialization of the simple XML schema type 'cs'.

Schema Fragment 117:
<xsd:simpleType name="cs_EntityNameUse">
    <xsd:restriction base="cs">
      <xsd:enumeration value="L"/>
      <xsd:enumeration value="A"/>
      <xsd:enumeration value="I"/>
      <xsd:enumeration value="R"/>
      <xsd:enumeration value="ABC"/>
      <xsd:enumeration value="SYL"/>
      <xsd:enumeration value="IDE"/>
    </xsd:restriction>
</xsd:simpleType>

2.18.3

Valid Time : IVL<TS>

Definition:      An interval of time specifying the time during which the name is or was used for the entity. This accomodates the fact that people change names for people, places and things.

XML Representation
Schema Fragment 118:
<xsd:element name="validTime" minOccurs="0" maxOccurs="1">
    <gsd:template as="type" name="IVL">
      <gsd:withParam name="T" type="TS"/>
    </gsd:template>
</xsd:element>

2.18.4

Examples

The following shows examples of entity names in an XML encoded form, where the XML tag is the entity name part type and the data content is the entity name part value. The use of XML in these examples does not preempt any XML implementation technology specification; it is solely for the purpose of this example.

A very simple encoding of "John W. Doe" would be:

Example 8:
<name>
  <given>John</given> <given>W.</given> <family>Doe</family>
</name>
 

None of the special qualifiers need to be mentioned if they are unknown or irrelevant. The next example shows extensive use of multiple given names, prefixes, suffixes, for academic degrees, nobility titles, vorvoegsels ("van"), and professional designations.

Example 9:
<name>
  <prefix qualifier="AC">Dr. phil. </prefix>
  <given>Regina</given>
  <given>Johanna</given>
  <given>Maria</given>
  <prefix qualifier="NB">Gräfin </prefix>
  <prefix qualifier="VV">von </prefix>
  <family qualifier="BR">Hochheim</family>-<family qualifier="SP">Weilenfels</family>
  <suffix qualifier="PR">NCFSA</suffix>
</name>
 

The next example is an organization name, "Health Level Seven, Inc." in simple string form:

Example 10:
  <name>Health Level Seven, Inc.</name>
 

and as a fully parsed name

Example 11:
<name>Health Level Seven, <suffix qualifier="LS">Inc.</suffix></name>
 

The following example shows a Japanese name in the three forms: ideographic (Kanji), syllabic (Hiragana), and alphabetic (Romaji).

Example 12:
  <name use="IDE"><family>木村</family> <given>道男</given></name>
  <name use="SYL"><family>きもら</family> <given>みちお</given></name>
  <name use="ABC"><family>KIMURA</family> <given>MICHIO</given></name>
 

2.19

Person Name Part (PNXP) restricts ENXP

Definition:      A restriction of entity name part that only allows those entity name parts qualifiers applicable to person names. Since the structure of entity name is mostly determined by the requirements of person name, the restriction is very minor.

XML Representation
Schema Fragment 119:
<xsd:complexType name="PNXP" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ST">
        <xsd:attribute name='partType' type='cs_PersonNamePartType' ... />
        <xsd:attribute name='qualifier' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.19.1

Name Part Type : cs (inherited from ENXP)

Definition:      Indicates whether the name part is a given name, family name, prefix, suffix, etc.

Schema Fragment 120:
<xsd:attribute name="partType" type="cs_PersonNamePartType"/>

The domain of person name part type is a restriction of the entity name part type domain (although it is currently identical.)

Schema Fragment 121:
<xsd:simpleType name="cs_PersonNamePartType">
    <xsd:restriction base="cs_EntityNamePartType">
      <xsd:enumeration value="FAM"/>
      <xsd:enumeration value="GIV"/>
      <xsd:enumeration value="PFX"/>
      <xsd:enumeration value="SFX"/>
      <xsd:enumeration value="DEL"/>
    </xsd:restriction>
</xsd:simpleType>

2.19.2

Qualifier : cs (inherited from ENXP)

Definition:      The qualifier is a set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type. For example, a given name may be flagged as a nickname, a family name may be a pseudonym or a name of public records

The domain of person name part qualifiers comprises all concepts of the entity name qualifier domain but the legal status.

XML Representation
Schema Fragment 122:
<xsd:attribute name="qualifier" use="optional">
    <gsd:template as="type" name="set">
      <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
    </gsd:template>
</xsd:attribute>
Schema Fragment 123:
<xsd:simpleType name="cs_PersonNamePartQualifier">
    <xsd:restriction base="cs_EntityNamePartQualifier">
      <xsd:enumeration value="BR"/>
      <xsd:enumeration value="SP"/>
      <xsd:enumeration value="VV"/>
      <xsd:enumeration value="AC"/>
      <xsd:enumeration value="PR"/>
      <xsd:enumeration value="NB"/>
      <xsd:enumeration value="CL"/>
      <xsd:enumeration value="IN"/>
    </xsd:restriction>
</xsd:simpleType>
Schema Fragment 124:
<xsd:element name="delimiter">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="PNXP">
          <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="DEL"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="family">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="PNXP">
          <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="FAM"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="given">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="PNXP">
          <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="GIV"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="prefix">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="PNXP">
          <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="PFX"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="suffix">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="PNXP">
          <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="SFX"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>

2.20

Person Name (PN) restricts EN

Definition:      A name for a person. A sequence of name parts, such as first name or family name, prefix, suffix, etc.

Table 27: Components of Person Name
Name Type Description
text LIST<ENXP> The data content of the entity name value is a sequence of entity name part elements (which, in XML, can be plain text nodes.)
use set<cs> A set of codes advising a system or user which name in a set of like addresses to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.
validTime IVL<TS> An interval of time specifying the time during which the name is or was used for the entity. This accomodates the fact that people change names for people, places and things.
XML Representation
Schema Fragment 125:
<xsd:complexType name="PN" mixed="true">
    <xsd:complexContent>
      <xsd:restriction base="EN">
        <xsd:sequence>
          <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name='delimiter' ... />
            <xsd:element name='family' ... />
            <xsd:element name='given' ... />
            <xsd:element name='prefix' ... />
            <xsd:element name='suffix' ... />
          </xsd:choice>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

2.21

Organization Name Part (ONXP) restricts ENXP

Definition:      A restriction of entity name part that only allows those entity name parts qualifiers applicable to organization names.

XML Representation
Schema Fragment 126:
<xsd:complexType name="ONXP" mixed="true">
    <xsd:complexContent>
      <xsd:extension base="ST">
        <xsd:attribute name='partType' type='cs_OrganizationNamePartType' ... />
        <xsd:attribute name='qualifier' ... />
      </xsd:extension>
    </xsd:complexContent>
</xsd:complexType>

2.21.1

Name Part Type : cs (inherited from ENXP)

Definition:      Indicates whether the name part is a given name, family name, prefix, suffix, etc.

Schema Fragment 127:
<xsd:attribute name="partType" type="cs_OrganizationNamePartType"/>

The domain of organization name part type is a restriction of the entity name part type domain.

Schema Fragment 128:
<xsd:simpleType name="cs_OrganizationNamePartType">
    <xsd:restriction base="cs_EntityNamePartType">
      <xsd:enumeration value="PFX"/>
      <xsd:enumeration value="SFX"/>
      <xsd:enumeration value="DEL"/>
    </xsd:restriction>
</xsd:simpleType>

2.21.2

Qualifier : cs (inherited from ENXP)

Definition:      The qualifier is a set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type. For example, a given name may be flagged as a nickname, a family name may be a pseudonym or a name of public records

The domain of organization name part qualifiers comprises all concepts of the entity name qualifier domain but the legal status.

XML Representation
Schema Fragment 129:
<xsd:attribute name="qualifier" use="optional">
    <gsd:template as="type" name="set">
      <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
    </gsd:template>
</xsd:attribute>
Schema Fragment 130:
<xsd:simpleType name="cs_OrganizationNamePartQualifier">
    <xsd:restriction base="cs_EntityNamePartQualifier">
      <xsd:enumeration value="LS"/>
      <xsd:enumeration value="CL"/>
    </xsd:restriction>
</xsd:simpleType>
Schema Fragment 131:
<xsd:element name="delimiter">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ONXP">
          <xsd:attribute name="partType" type="cs_OrganizationNamePartType" fixed="DEL"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="prefix">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ONXP">
          <xsd:attribute name="partType" type="cs_OrganizationNamePartType" fixed="PFX"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>
<xsd:element name="suffix">
    <xsd:complexType mixed="true">
      <xsd:complexContent>
        <xsd:restriction base="ONXP">
          <xsd:attribute name="partType" type="cs_OrganizationNamePartType" fixed="SFX"/>
          <xsd:attribute name="qualifier">
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
</xsd:element>

2.22

Organization Name (ON) restricts EN

Definition:      A name for an organization. A sequence of name parts.

XML Representation
Schema Fragment 132:
<xsd:complexType name="ON" mixed="true">
    <xsd:complexContent>
      <xsd:restriction base="EN">
        <xsd:sequence>
          <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element name='delimiter' ... />
            <xsd:element name='prefix' ... />
            <xsd:element name='suffix' ... />
          </xsd:choice>
        </xsd:sequence>
      </xsd:restriction>
    </xsd:complexContent>
</xsd:complexType>

2.22.1

Examples

The following is the organization name, "Health Level Seven, Inc." in a simple string form:

Example 13:
<name>Health Level Seven, Inc.</name>;
 

And with the legal status "Inc." as a distinguished name part:

Example 14:
<name>Health Level Seven, <suffix qualifier="L">Inc.</suffix></name> 

2.23

Trivial Name (TN) restricts EN

Definition:      A restriction of entity name that is effectively a simple string used for a simple name for things and places.

Table 30: Components of Trivial Name
Name Type Description
text LIST<ENXP> The data content of the entity name value is a sequence of entity name part elements (which, in XML, can be plain text nodes.)
use set<cs> A set of codes advising a system or user which name in a set of like addresses to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.
validTime IVL<TS> An interval of time specifying the time during which the name is or was used for the entity. This accomodates the fact that people change names for people, places and things.
XML Representation
Schema Fragment 133:
<xsd:complexType name="TN" mixed="true">
    <xsd:complexContent>
      <xsd:restriction base="EN">
        <xsd:sequence>
          </xsd:sequence>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>

    2.24

    Quantity (QTY)

    Definition:      The quantity data type is an abstract generalization for all data types (1) whose value set has an order relation (less-or-equal) and (2) where difference is defined in all of the data type's totally ordered value subsets. The quantity type abstraction is needed in defining certain other types, such as the interval and the probability distribution.

    The Data Types Abstract Specification defines a diff property of a data type (not data value) that is the data type of the difference value between two data values of the quantity type. By default the diff property equals the same data type, but it may be overridden by a specialization of QTY. For instance, the difference between two TS values has the data type PQ (in the dimension of elapsed time.)

    XML Representation
    Schema Fragment 134:
    <xsd:complexType name="QTY" abstract="true">
      <xsd:annotation>
        <xsd:appinfo>
          <diff>
            QTY
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY"/>
      </xsd:complexContent>
    </xsd:complexType>

    The diff property described above is carried in the QTY type's annotation. All specializations of QTY will have such a diff element in their xsd:annotation, which is required by the IVL generic data type to define its width element.

    2.25

    Integer Number (INT)

    Definition:      Integer numbers (-1,0,1,2, 100, 3398129, etc.) are precise numbers that are results of counting and enumerating. Integer numbers are discrete, the set of integers is infinite but countable. No arbitrary limit is imposed on the range of integer numbers. Two NULL flavors are defined for the positive and negative infinity.

    XML Representation

    The XML representation of an integer can be either as a simple XML schema type (suitable for use in an XML attribute) or as a complex XML schema type preferred for use as an XML element. The simple type is used only in the HL7 data type schema (including defining the complex type.) The simple type cannot distinguish the different flavors of null.

    Schema Fragment 135:
    <xsd:simpleType name="int">
      <xsd:restriction base="xsd:integer"/>
    </xsd:simpleType>

    By convention, simple types have a schema name that uses the lower case form of the HL7 data type short name.

    Normally the integer is used as a complex XML schema type that has all the common data type components, such as the null flavor available. The simple integer value itself appears as the XML-attribute value.

    Schema Fragment 136:
    <xsd:complexType name="INT">
      <xsd:annotation>
        <xsd:appinfo>
          <diff>
            INT
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="QTY">
          <xsd:attribute name="value" use="optional" type="int"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>

    By convention, complex XML types have a schema name that uses the upper case form of the HL7 data type short name.

    Although the use of the XML-attribute value is optional, the constraint (expressed as an XPath predicate), specifies that there must be either an XML-attribute value or the ANY.nullFlavor, but not both.

    Schema Fragment 137:
    <hl7:pr assert="(@value or @nullFlavor) and not(@value and @nullFlavor)"/>

    2.26

    Real Number (REAL)

    Definition:      Fractional numbers. Typically used whenever quantities are measured, estimated, or computed from other real numbers. The typical representation is decimal, where the number of significant decimal digits is known as the precision. Real numbers are needed beyond integers whenever quantities of the real world are measured, estimated, or computed from other real numbers. The term "Real number" in this specification is used to mean that fractional values are covered without necessarily implying the full set of the mathematical real numbers.

    XML Representation

    The XML representation of an real number can be either as a simple XML schema type (suitable for use in an XML attribute) or as a complex XML schema type preferred for use as an XML element. The simple type is used only in the HL7 data type schema (including defining the complex type.) The simple type cannot distinguish the different flavors of null.

    Schema Fragment 138:
    <xsd:simpleType name="real">
      <xsd:union>
        <xsd:simpleType>
          <xsd:restriction base="xsd:decimal"/>
        </xsd:simpleType>
        <xsd:simpleType>
          <xsd:restriction base="xsd:double"/>
        </xsd:simpleType>
      </xsd:union>
    </xsd:simpleType>

    By convention, simple types have a schema name that uses the lower case form of the HL7 data type short name.

    Normally the real is used as a complex XML schema type that has all the common data type components, such as the null flavor available. The simple real value itself appears as the XML-attribute value.

    Schema Fragment 139:
    <xsd:complexType name="REAL">
      <xsd:annotation>
        <xsd:appinfo>
          <diff>
            REAL
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="QTY">
          <xsd:attribute name="value" use="optional" type="real"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>

    By convention, complex XML types have a schema name that uses the upper case form of the HL7 data type short name.

    Although the use of the XML-attribute value is optional, the constraint (expressed as an XPath predicate), specifies that there must be either a XML-attribute value or the ANY.nullFlavor, but not both.

    Schema Fragment 140:
    <hl7:pr assert="(@nullFlavor or @value) and not(@nullFlavor and @value)"/>

    2.27

    Physical Quantity (PQ)

    Definition:      A dimensioned quantity expressing the result of a measurement act.

    Table 31: Components of Physical Quantity
    Name Type Description
    value REAL The magnitude of the quantity measured in terms of the unit.
    unit cs The unit of measure specified in the Unified Code for Units of Measure (UCUM) [].
    translation PQR An alternative representation of the same physical quantity expressed in a different unit, of a different unit code system and possibly with a different value.
    XML Representation
    Schema Fragment 141:
    <xsd:complexType name="PQ">
      <xsd:annotation>
        <xsd:appinfo>
          <diff>
            PQ
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="QTY">
          <xsd:sequence>
            <xsd:element name='translation' type='PQR' ... />
          </xsd:sequence>
          <xsd:attribute name='value' type='real' ... />
          <xsd:attribute name='unit' type='cs' ... />
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    Schema Fragment 142:
    <hl7:pr assert="@nullFlavor or (@value and @unit)"/>
    Schema Fragment 143:
    <hl7:pr assert="not(@nullFlavor and (@value or @unit))"/>

    2.27.1

    Value : REAL

    Definition:      The magnitude of the quantity measured in terms of the unit.

    XML Representation
    Schema Fragment 144:
    <xsd:attribute name="value" type="real" use="optional"/>

    2.27.2

    Unit of Measure : cs

    Definition:      The unit of measure specified in the Unified Code for Units of Measure (UCUM) [http://aurora.rg.iupui.edu/UCUM].

    More detail on the Unified Code for Units of Measure, and example tables of units commonly seen in practice with HL7 are provided in Appendix B of this specification.

    The default unit of measure is 1 (the "unity").

    XML Representation
    Schema Fragment 145:
    <xsd:attribute name="unit" type="cs" use="optional" default="1"/>

    2.27.3

    Translation : PQR

    Definition:      An alternative representation of the same physical quantity expressed in a different unit, of a different unit code system and possibly with a different value.

    XML Representation
    Schema Fragment 146:
    <xsd:element name="translation" type="PQR" minOccurs="0" maxOccurs="unbounded"/>

    2.28

    Physical Quantity Representation (PQR)

    Definition:      A representation of a physical quantity in a unit from any code system. Used to show alternative representation for a physical quantity.

    Table 32: Components of Physical Quantity Representation
    Name Type Description
    value real The magnitude of the measurement value in terms of the unit specified in the code.
    code st The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
    codeSystem uid Specifies the code system that defines the code.
    codeSystemName st A common name of the coding system.
    codeSystemVersion st If applicable, a version descriptor defined specifically for the given code system
    displayName st A name or title for the code, under which the sending system shows the code value to its users.
    originalText ED The text or phrase used as the basis for the coding.

    This is an extension of the coded value data type.

    XML Representation
    Schema Fragment 147:
    <xsd:complexType name="PQR">
      <xsd:complexContent>
        <xsd:extension base="CV">
          <xsd:attribute name='value' type='real' ... />
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>

    2.28.1

    Value : real

    Definition:      The magnitude of the measurement value in terms of the unit specified in the code.

    XML Representation
    Schema Fragment 148:
    <xsd:attribute name="value" type="real" use="optional"/>

    2.29

    Monetary Amount (MO)

    Definition:      A monetary amount is a quantity expressing the amount of money in some currency. Currencies are the units in which monetary amounts are denominated in different economic regions. While the monetary amount is a single kind of quantity (money) the exchange rates between the different units are variable. This is the principle difference between physical quantity and monetary amounts, and the reason why currency units are not physical units.

    Table 33: Components of Monetary Amount
    Name Type Description
    value REAL The magnitude of the monetary amount in terms of the currency unit.
    currency cs The currency unit as defined in ISO 4217.
    XML Representation
    Schema Fragment 149:
    <xsd:complexType name="MO">
      <xsd:annotation>
        <xsd:appinfo>
          <diff>
            MO
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="QTY">
          <xsd:attribute name='value' type='real' ... />
          <xsd:attribute name='currency' type='cs_Currency' ... />
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    Schema Fragment 150:
    <hl7:pr assert="@nullFlavor or (@value and @currency)"/>
    Schema Fragment 151:
    <hl7:pr assert="not(@nullFlavor and (@value or @currency))"/>

    2.29.1

    Value : REAL

    Definition:      The magnitude of the monetary amount in terms of the currency unit.

    XML Representation
    Schema Fragment 152:
    <xsd:attribute name="value" type="real" use="optional"/>

    2.29.2

    Currency : cs

    Definition:      The currency unit as defined in ISO 4217.

    Table 34: Selected ISO 4217 currency codes (domain = Currency)
    Country Currency Code
    Argentina Argentine Peso ARS
    Australia Australian Dollar AUD
    Brazil Brazilian Real BRL
    Canada Candian Dollar CAD
    Chile Unidades de Formento CLF
    China Yuan Renminbi CNY
    European Union Euro EUR
    Finland Markka FIM
    France French Franc FRF
    Germany Deutsche Mark DEM
    India Indian Rupee INR
    Israel Shekel ILS
    Japan Yen JPY
    Korea (South) Won KRW
    Mexico Mexican Nuevo Peso MXN
    Netherlands Netherlands Guilder NLG
    New Zealand New Zealand Dollar NZD
    Philippines Philippine Peso PHP
    Russian Federation Russian Ruble RUR
    South Africa Rand ZAR
    Spain Spanish Peseta ESP
    Switzerland Swiss Franc CHF
    Taiwan Taiwan Dollar TWD
    Thailand Baht THB
    Turkey Lira TRL
    United Kingdom Pound Sterling GBP
    United States US Dollar USD
    XML Representation
    Schema Fragment 153:
    <xsd:attribute name="currency" type="cs_Currency" use="optional"/>

    A subset of the ISO 4217 currency codes are defined as an XML enumeration schema type. The limitations of this selection is arbitrary and not normative. All ISO 4217 currencies are permitted values.

    Schema Fragment 154:
    <xsd:simpleType name="cs_Currency">
      <xsd:restriction base="cs">
        <xsd:enumeration value="ARS"/>
        <xsd:enumeration value="AUD"/>
        <xsd:enumeration value="ATS"/>
        <xsd:enumeration value="BEF"/>
        <xsd:enumeration value="BRL"/>
        <xsd:enumeration value="CAD"/>
        <xsd:enumeration value="CLF"/>
        <xsd:enumeration value="CNY"/>
        <xsd:enumeration value="CUP"/>
        <xsd:enumeration value="EUR"/>
        <xsd:enumeration value="XEU"/>
        <xsd:enumeration value="FIM"/>
        <xsd:enumeration value="FRF"/>
        <xsd:enumeration value="DEM"/>
        <xsd:enumeration value="INR"/>
        <xsd:enumeration value="ILS"/>
        <xsd:enumeration value="JPY"/>
        <xsd:enumeration value="KRW"/>
        <xsd:enumeration value="LUF"/>
        <xsd:enumeration value="MXN"/>
        <xsd:enumeration value="NLG"/>
        <xsd:enumeration value="NZD"/>
        <xsd:enumeration value="NOK"/>
        <xsd:enumeration value="PHP"/>
        <xsd:enumeration value="RUR"/>
        <xsd:enumeration value="SGD"/>
        <xsd:enumeration value="ZAR"/>
        <xsd:enumeration value="ESP"/>
        <xsd:enumeration value="SEK"/>
        <xsd:enumeration value="CHF"/>
        <xsd:enumeration value="THB"/>
        <xsd:enumeration value="TWD"/>
        <xsd:enumeration value="TRL"/>
        <xsd:enumeration value="GBP"/>
        <xsd:enumeration value="USD"/>
      </xsd:restriction>
    </xsd:simpleType>

    2.30

    Ratio (RTO)

    Definition:      A quantity constructed as the quotient of a numerator quantity divided by a denominator quantity. Common factors in the numerator and denominator are not automatically cancelled out. The RTO data type supports titers (e.g., "1:128") and other quantities produced by laboratories that truly represent ratios. Ratios are not simply "structured numerics", particularly blood pressure measurements (e.g. "120/60") are not ratios. In many cases the REAL should be used instead of the RTO.

    NOTE: This data type is not defined to generally represent rational numbers. It is used only if common factors in numerator and denominator are not supposed to cancel out. This is only rarely the case. For observation values, ratios occur almost exclusively with titers.

    The default value for both numerator and denominator is the integer number 1 (one.) The denominator may not be zero.

    NOTE: This data type is defined as a generic data type but discussed in the context of the other quantity-related data types. The reason for defining RTO as a generic data type is so that it can be constrained precisely as to what the numerator and denominator types should be. See Section (§ ) for more detail about generic data types and how they are defined in XML.
    XML Representation
    Schema Fragment 155:
    <gsd:template name="RTO">
      <gsd:param name="N" type="QTY"/>
      <gsd:param name="D" type="QTY"/>
      <xsd:complexType>
        <xsd:annotation>
          <xsd:appinfo>
            <diff>
              <gsd:template as="text()" name="RTO">
                <gsd:withParam name="N">
                  <gsd:attribute name="type" type="N"/>
                </gsd:withParam>
                <gsd:withParam name="D">
                  <gsd:attribute name="type" type="D"/>
                </gsd:withParam>
              </gsd:template>
            </diff>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="QTY">
            <xsd:sequence>
              <xsd:element name='numerator' ... />
              <xsd:element name='denominator' ... />
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    2.30.1

    Numerator : N

    Definition:      The quantity that is being devided in the ratio. The default is the integer number 1 (one.)

    XML Representation
    Schema Fragment 156:
    <xsd:element name="numerator">
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:restriction>
            <gsd:attribute name="base" type="N"/>
            <xsd:attribute name="value" default="1"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:element>

    2.30.2

    Denominator : D

    Definition:      The quantity that devides the numerator in the ratio. The default is the integer number 1 (one.) The denominator must not be zero.

    XML Representation
    Schema Fragment 157:
    <xsd:element name="denominator">
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:restriction>
            <gsd:attribute name="base" type="D"/>
            <xsd:attribute name="value" default="1"/>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:element>
    Numerator and denominator are required for a ratio or else it is a NULL value. (Note that both numerator and denominator have 1 (one) as their default .)
    Schema Fragment 158:
    <hl7:pr assert="(numerator and denominator) or @nullFlavor"/>

    XML instances must use the xsi:type schema type assertion mechanism to specify the particular restriction of QTY being used for numerator and denominator respectively.

    We also define a complete data type RTO instantiated to the most general, unconstrained form of ratio, RTO<QTY,QTY>

    Schema Fragment 159:
    <xsd:complexType name="RTO">
      <xsd:complexContent>
        <xsd:extension>
          <gsd:template as="base" name="RTO">
            <gsd:withParam name="N" type="QTY"/>
            <gsd:withParam name="D" type="QTY"/>
          </gsd:template>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>

    2.30.3

    Examples

    Example 15:
    <observation>
      ...
      <code code="22497-2" codeSystem="&LN;" displayName="RUBELLA VIRUS AB"/>
      ...
      <value><numerator value="1"/><denominator value="64"/></value>  
      ...
    </observation> 
    Example 16:
    <gasprice><numerator value="1.15" currency="USD"/><denominator value="1" unit="[gal_us]"/></gasprice> 
    Example 17:
    <ingredient>
      ...
      <qty><numerator xsi:type="PQ" value="25" unit="mg"/><denominator xsi:type="PQ" value="5" unit="mL"/></qty>
      ...
    </ingredient> 

    2.31

    Point in Time (TS)

    Definition:      A a quantity specifying a point on the axis of natural time. A point in time is most often represented as a calendar expression.

    XML Representation

    In XML points in time are represented using the ISO 8601 complient form traditionally in use with HL7. This is the form that has no decorating dashes, colons and no "T" between the date and time. In short, the syntax is "YYYYMMDDHHMMSS.UUUU[+|-ZZzz]" where digits can be left off from the right side to express less precision. Common forms are "YYYYMMDD" and "YYYYMMDDHHMM", but the ability to truncate on the right side is not limited to these two variants. See the Data Types Abstract Specification for detail.

    This is not the W3C Schema form for dateTime. The W3C Schema time data types do not lend themselves as well to representing the varying precision as well as the simpler ISO 8601 variant that is well established in HL7.

    The XML representation of a Point in Time can be either as a simple XML schema type (suitable for use in an XML attribute) or as a complex XML schema type preferred for use as an XML element. The simple type is used only in the HL7 data type schema (including defining the complex type.) The simple type cannot distinguish the different flavors of null.

    Schema Fragment 160:
    <xsd:simpleType name="ts">
      <xsd:restriction base="xsd:string">
        <xsd:pattern value="[0-9]{1,14}\(\.{1,4}\)?\([+-]{1,4}\)?"/>
      </xsd:restriction>
    </xsd:simpleType>

    By convention, simple types have a schema name that uses the lower case form of the HL7 data type short name.

    Normally the Point in Time is used as a complex XML schema type that has all the common data type components, such as the null flavor available. The simple Boolean value itself appears as the XML-attribute value.

    Schema Fragment 161:
    <xsd:complexType name="TS">
      <xsd:annotation>
        <xsd:appinfo>
          <diff>
            PQ
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="QTY">
          <xsd:attribute name="value" use="optional" type="ts"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>

    By convention, complex XML types have a schema name that uses the upper case form of the HL7 data type short name.

    3

    Generic Data Types

    The Data Types Abstract Specification defined generic types, also called "parameterized types" (UML), "generics" (ADA) or "templates" (C++). Generic types are incomplete types with parameters such that they define actual types (sometimes called "instantiated" types) when their parameters are specified. For example, a LIST<T> is a generic sequence of any values of a parameter type T. Given this generic type we can specify specific types such as LIST<CE> as sequences of codes or LIST<PQ> for a sequences of physical quantities.

    The Data Types Abstract Specification specifies two different kinds of generic types, "generic collections" and "generic type extensions". Generic collections specify sets, sequences or other groups of data values. Generic type extensions provide extensions to normal types that are of general use, such as a valid-time for a "history item" or a probability for an "uncertain value".

    In this XML specification, however, we will present these two kinds of types together. The reason is that enumerated collection types do not exist in the common use of XML. Instead it is common practice in XML to represent enumerated collections as a sequence of XML elements with the same name (repeated element). Therefore we define all such enumerated collection types as generic type extensions of their element type. For example, instead of having an XML element that stands for a whole BAG, we have generic type extension for bag-item (BXIT) so that the XML-element of type BAG is defined in the schema as a bag-item that can repeat.

    3.1

    Generic Schema Definition Language

    Because XML schema has no mechanism for defining generic types, this specification uses an extension of the XML Schema Definition (XSD), the "Generic Schema Definition" (GSD). The GSD contains all of XSD plus extension elements for defining and using generic schema types. A XSL transform is included as Appendix (§ ) that transforms GSD into XSD, expanding all references to generic types into normal schema types.

    We describe the generic schema definition language in an example. The following schema fragment shows a possible definition of the bag item (BXIT) generic data type extension using the Generic Schema Definition (GSD) language.

    Schema Fragment 162:
    <gsd:template name="BXIT">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:attribute name="qty" type="int" use="optional" default="1"/>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    The XML-element gsd:template with only an XML-attribute name indicates a generic data type being defined. The GSD template is, not unlike an XSLT template, a template for an XML output generating the real XML Schema data type as an instantiation of the GSD template.

    A generic type has at least one parameter defined by the XML-element gsd:param. A parameter has a name and may be constrained to any specialization of the type indicated by the XML-attribute type.

    After the parameter sequence follows an XSD type definition, however the XML-element xsd:complexType (or the XML-element xsd:simpleType) has no XML-attribute name. The name of generic type instantiations is generated using the name of the generic type and all the supplied actual parameter types in the order defined in the gsd:template's parameter sequence, all separated by underscores. Thus, BXIT<CD> becomes BXIT_CD in the XML schema.

    An XML-element gsd:attribute inserts an XML attribute into its containing element (similar to an XSLT XML-element xsl:attribute). The purpose is to insert actual parameters of the template instantiation as an attribute named by the XML-attribute name. In this case the XML-attribute base is added to the XML-element xsd:extension as this is a generic type extension, that extends its parameter type.

    When this generic type is instantiated with, for example, the CD type, the generic type instantiation BXIT<CD> generates the following schema fragment.

    Schema Fragment 163:
    <xsd:complexType name="BXIT_CD">
      <xsd:complexContent>
        <xsd:extension base="CD">
          <xsd:attribute name="qty" type="int" use="optional" default="1"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>

    A generic type is instantiated using the XML-element gsd:template with an XML-attribute as (e.g., within an XML-element xsd:element.) The local effect is that an attribute of the name given in the XML-attribute as will be generated in the element enclosing the XML-element gsd:template whose value is the name of the instantiated generic type. So, for example:

    Schema Fragment 164:
    <xsd:element name="findings" minOccurs="0" maxOccurs="unbounded">
      <gsd:template as="type" name="BXIT">
        <gsd:withParam name="T" type="CD"/>
      </gsd:template>
    </xsd:element>

    will generate the following XML Schema element definition

    Schema Fragment 165:
    <xsd:element name="findings" minOccurs="0" maxOccurs="unbounded" type="BXIT_CD"/>

    3.2

    Sequence (LIST)

    Definition:      A value that contains other discrete values in a defined sequence.

    XML Representation

    In XML, a LIST<T> is represented in two ways. Some sequences that are components of other data types and whose item type T has a literal form are represented as an XML attribute whose XML attribute type is "list of xsd:token".

    Schema Fragment 166:
    <gsd:template name="list">
      <gsd:param name="T" type="ANY"/>
      <xsd:simpleType>
        <xsd:list>
          <gsd:attribute name="itemType" type="T"/>
        </xsd:list>
      </xsd:simpleType>
    </gsd:template>

    If, however, the base data type T cannot be represented as an XML attribute of XML schema type xsd:token or if the LIST<T> is instantiated as the data type of a RIM class or attribute, LIST<T> is represented as a sequence of XML elements by the tag name of that attribute or component.

    3.3

    Bag (BAG)

    Definition:      An unordered collection of values, where each value can be contained more than once in the bag.

    XML Representation

    In XML, a BAG<T> is represented in two ways. Some bags that are components of other data types and whose item type T has a literal form are represented as an XML attribute whose XML attribute type is "list of xsd:token".

    Schema Fragment 167:
    <gsd:template name="bag">
      <gsd:param name="T" type="ANY"/>
      <xsd:simpleType>
        <xsd:list>
          <gsd:attribute name="itemType" type="T"/>
        </xsd:list>
      </xsd:simpleType>
    </gsd:template>

    If, however, the base data type T cannot be represented as an XML attribute of XML schema type xsd:token or if the BAG<T> is instantiated as the data type of a RIM class or attribute, BAG<T> is represented as a sequence of XML elements by the tag name of that attribute or component and of the ITS-defined type "bag item".

    3.4

    Bag Item (BXIT)

    Definition:      A generic data type extension that represents a collection of a certain number of identical items in a bag.

    Table 36: Components of Bag Item
    Name Type Description
    qty int The quantity in which the bag item occurs in its containing bag.

    A bag item allows a "compressed" representation of a bag, where the same bag items need not be represented repeatedly, but can be quantified by a number. This representation of a bag is useful if relatively few different items occur in relatively large numbers, as it is the case in statistical data collections.

    The bag item type, although it is fully consistent with the Data Types Abstract Specification, is only defined in the ITS, because it only specifies a certain form in which a bag of values can be represented more efficiently without adding any special semantics that was not already given in the definition of the bag data type.

    XML Representation
    Schema Fragment 168:
    <gsd:template name="BXIT">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:attribute name='qty' type='int' ... />
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.4.1

    Quantity : int

    Definition:      The quantity in which the bag item occurs in its containing bag.

    This atribute's default value is 1, i.e., the qty attribute need not be specified if items are not quantified but simply repeated.

    XML Representation
    Schema Fragment 169:
    <xsd:attribute name="qty" type="int" use="optional" default="1"/>

    3.5

    Set (SET)

    Definition:      A value that contains other distinct values in no particular order.

    Exceptional values (NULL-values) can not be elements of a set.

    The empty set is a set without any elements. The empty set is a proper set value, not an exceptional value (NULL-value).

    XML Representation

    In XML, a SET<T> is represented in two ways. Some sets that are components of other data types and whose item type T has a literal form are represented as an XML attribute whose XML attribute type is "list of xsd:token".

    Schema Fragment 170:
    <gsd:template name="set">
      <gsd:param name="T" type="ANY"/>
      <xsd:simpleType>
        <xsd:list>
          <gsd:attribute name="itemType" type="T"/>
        </xsd:list>
      </xsd:simpleType>
    </gsd:template>

    If, however, the base data type T cannot be represented as an XML attribute of XML schema type xsd:token or if the SET<T> is instantiated as the data type of a RIM class or attribute, SET<T> is represented as a sequence of XML elements by the tag name of that attribute or component.

    The XML ITS in its XML schema definition does not formally constrain elements of a set to be unique and non-NULL. Applications may raise an error if they encounter an instance with non-unique or NULL elements.

    3.6

    Set Component (SXCM)

    Definition:      An ITS-defined generic type extension for the base data type of a set, representing a component of a general set over a discrete or continuous value domain. It's use is mainly for continuous value domains. Discrete (enumerable) set components are the individual elements of the base data type.

    Table 37: Components of Set Component
    Name Type Description
    operator cs A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.
    XML Representation
    Schema Fragment 171:
    <gsd:template name="SXCM">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:attribute name='operator' type='cs_SetOperator' ... />
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.6.1

    Operator : cs

    Definition:      A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.

    Table 38: Set Operator (domain = SetOperator)
    Concept Symbol Definition
    include I Include the value in the value set (union).
    exclude E Exclude the value from the set (difference).
    intersect A Form the intersection with the value.
    hull H Form the convex hull with the value.
    periodic hull P Form the periodic hull with the value.
    XML Representation
    Schema Fragment 172:
    <xsd:attribute name="operator" type="cs_SetOperator" use="optional" default="I"/>

    The domain for set operator is defined in XML as an enumeration.

    Schema Fragment 173:
    <xsd:simpleType name="cs_SetOperator">
      <xsd:restriction base="cs">
        <xsd:enumeration value="I"/>
        <xsd:enumeration value="E"/>
        <xsd:enumeration value="A"/>
        <xsd:enumeration value="H"/>
        <xsd:enumeration value="PH"/>
      </xsd:restriction>
    </xsd:simpleType>

    3.7

    Interval (IVL) extends

    Definition:      A set of consecutive values of an ordered base data type.

    Some examples:

    Note that the interval boundaries must be of comparable types. It makes no sense to specify the interval between 2 meters and 4 seconds.

    Table 39: Components of Interval
    Name Type Description
    low T The low limit of the interval.
    high T The high limit of the interval.
    lowClosed BL Specifies whether the low limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
    highClosed BL Specifies whether the high limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
    center T The arithmetic mean of the interval (low plus high divided by 2). The purpose of distinguishing the center as a semantic property is for conversions of intervals from and to point values.
    width T.diff The difference between high and low boundary. The purpose of distinguishing a width property is to handle all cases of incomplete information symmetrically. In any interval representation only two of the three properties high, low, and width need to be stated and the third can be derived.

    In any interval representation only two of the four properties high, low, width and center need to be stated and the other two can be derived. Incomplete intervals exist, where only one property is values, particularly, when no boundary or center is known, the width may still be known. For example, one knows that an activity takes about 30 minutes, but one may not yet know when that activity is started.

    XML Representation

    Because XML schema has no generic type facility, and generic types are incomplete types, there is no normative schema fragment for Interval in general. However, the following fragment defines a template used to instantiate a specific Interval of type T.

    Schema Fragment 174:
    <gsd:template name="IVL">
      <gsd:param name="T" type="QTY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:template as="base" name="SXCM">
              <gsd:withParam name="T">
                <gsd:attribute name="type" type="T"/>
              </gsd:withParam>
            </gsd:template>
            <xsd:choice minOccurs="0">
              <xsd:sequence>
                <xsd:element name='low' ... />
                <xsd:element name='high' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='low' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='high' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='low' ... />
                <xsd:element name='width' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='width' ... />
                <xsd:element name='high' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='center' ... />
                <xsd:element name='width' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='center' ... />
              </xsd:sequence>
              <xsd:sequence>
                <xsd:element name='width' ... />
              </xsd:sequence>
            </xsd:choice>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.7.1

    Low Boundary : T

    Definition:      The low limit of the interval.

    XML Representation
    Schema Fragment 175:
    <xsd:element name="low" minOccurs="1" maxOccurs="1">
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:attribute name='inclusive' type='bl' ... />
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:element>

    3.7.2

    High Boundary : T

    Definition:      The high limit of the interval.

    XML Representation
    Schema Fragment 176:
    <xsd:element name="high" minOccurs="1" maxOccurs="1">
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:attribute name='inclusive' type='bl' ... />
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </xsd:element>

    3.7.3

    Low Closed : BL

    Definition:      Specifies whether the low limit is included in the interval (interval is closed) or excluded from the interval (interval is open).

    XML Representation
    Schema Fragment 177:
    <xsd:attribute name="inclusive" type="bl" use="optional" default="true"/>

    3.7.4

    High Closed : BL

    Definition:      Specifies whether the high limit is included in the interval (interval is closed) or excluded from the interval (interval is open).

    XML Representation
    Schema Fragment 178:
    <xsd:attribute name="inclusive" type="bl" use="optional" default="true"/>

    3.7.5

    Center : T

    Definition:      The arithmetic mean of the interval (low plus high divided by 2). The purpose of distinguishing the center as a semantic property is for conversions of intervals from and to point values.

    Note that a center doesn't always exist for every interval. Notably intervals that are infinite on one side do not have a center. Also intervals of discrete base types with an even number of elements do not have a center. If an interval is unknown on one (or both) boundaries, the center can still be asserted. In fact, the main use case for the center is to be asserted when no boundary is known.

    XML Representation
    Schema Fragment 179:
    <xsd:element name="center" minOccurs="1" maxOccurs="1">
      <gsd:attribute name="type" type="T"/>
    </xsd:element>

    3.7.6

    Width : T.diff

    Definition:      The difference between high and low boundary. The purpose of distinguishing a width property is to handle all cases of incomplete information symmetrically. In any interval representation only two of the three properties high, low, and width need to be stated and the third can be derived.

    When both boundaries are known, width can be derived as high minus low. When one boundary and the width is known, the other boundary is also known. When no boundary is known, the width may still be known. For example, one knows that an activity takes about 30 minutes, but one may not yet know when that activity is started.

    Note that the data type of the width is not always the same as for the boundaries. For ratio scale quantities (REAL, PQ, MO) it is the same. For difference scale quantities (e.g., TS) is is the data type of the difference (e.g., PQ in the dimension of time for TS). For discrete elements (INT) the width may be a REAL indicating the number of elements in the interval divided by 2.

    XML Representation
    Schema Fragment 180:
    <xsd:element name="width" minOccurs="1" maxOccurs="1">
      <gsd:attribute name="type" type="T" prop="diff"/>
    </xsd:element>

    3.8

    History Item (HXIT)

    Definition:      A generic data type extension that tags a time range to any data value of any data type. The time range is the time in which the information represented by the value is (was) valid.

    Table 40: Components of History Item
    Name Type Description
    validTime IVL<TS> The time interval during which the given information was, is, or is expected to be valid. The interval can be open or closed infinite or undefined on either side.

    For example, a value of type HXIT<CS> extended from a Coded Simple Value (CS) data type has all of the properties of the original CS value, plus a time range indicating when that code is or was valid.

    Data types that already have a valid time range property (i.e., II, AD, TEL) obviously do not need these extensions. Their valid time range property can be mapped to the valid time property of the HXIT, in fact, those data types are considered history items by themselves. For example, II is the same data type as HXIT<II>.

    XML Representation

    Because XML schema has no generic type facility, and generic types are incomplete types, there is no normative schema fragment for History Item in general. However, the following fragment defines a template used to instantiate a specific History Item of type T.

    Schema Fragment 181:
    <gsd:template name="HXIT">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:sequence>
              <xsd:element name='validTime' ... />
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.8.1

    Valid Time : IVL<TS>

    Definition:      The time interval during which the given information was, is, or is expected to be valid. The interval can be open or closed infinite or undefined on either side.

    XML Representation
    Schema Fragment 182:
    <xsd:element name="validTime" minOccurs="0" maxOccurs="1">
      <gsd:template name="IVL" as="type">
        <gsd:withParam name="T" type="TS"/>
      </gsd:template>
    </xsd:element>

    3.9

    History (HIST)

    Definition:      A set of data values that conform to the history item (HXIT) type, (i.e., that have a valid-time property). The history information is not limited to the past; expected future values can also appear.

    The history information is not limited to the past; expected future values can also appear.

    XML Representation

    HIST<T> is represented as a sequence of XML elements by the tag name of the attribute or component and the type of HXIT<T>. That element can be repeated to represent the different values that attribute or component assumed at different time intervals.

    3.10

    Uncertain Value - Narrative (UVN)

    Definition:      A generic data type extension to specify one uncertain value tagged with a coded confidence qualifier.

    XML Representation
    Schema Fragment 183:
    <gsd:template name="UVN">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extends>
            <gsd:attribute name="base" type="T"/>
            <xsd:sequence>
              <xsd:element name='confidence' type='CE' ... />
            </xsd:sequence>
          </xsd:extends>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.10.1

    Confidence : CE

    Definition:      A coded representation of the confidence as used in narrative utterances, such as "probably", "likely", "may be", "would be supported", "consistent with", "approximately", etc.

    No standard terminology of confidence qualifiers exists, and it is unclear whether it can ever possibly exist. For instance, is "probably" more or less confidant than "could be"? The use of the confidence qualifier is thus only suited to communicate information between humans.

    XML Representation
    Schema Fragment 184:
    <xsd:element name="confidence" type="CE" minOccurs="0" maxOccurs="1"/>

    3.11

    Non-Parametric Probability Distribution (NPPD)

    Definition:      A set of uncertain values with probabilities (also known as histogram.)

    The easiest way to visualize this is a bar chart as shown in

    Example of a Histogram

    Figure 1: Example of a Histogram

    This example illustrates the probability of selected major league baseball teams winning the World Series (prior to the season start). Each team is mutually exclusive, and were we to include all of the teams, the sum of the probabilities would equal 1 (i.e., it is certain that one of the teams will win).

    Semantically, a non-parametric probability distribution contains all possible values and assigns probabilities to each of them. Our example has left out quite a few teams. The rules for this data type tell us that the other teams would share the "leftover" probability equally. The 8 teams in the example have a collective probability of winning the World Series of 0.47. If there were a total of 24 teams in the league, then 16 are not shown. Each of these teams would be assigned a probability of (1.00 - 0.47) / 16 = 0.033125.

    XML Representation

    3.12

    Uncertain Value - Probabilistic (UVP)

    Definition:      A generic data type extension used to specify a probability expressing the information producer's belief that the given value holds.

    Table 41: Components of Uncertain Value - Probabilistic
    Name Type Description
    probability real The probability assigned to the value, a decimal number between 0 (very uncertain) and 1 (certain).

    Probabilities are subjective and (as any data value) must be interpreted in their individual context, for example, when new information is found the probability might change. Thus, for any message (document, or other information representation) the information - and particularly the probabilities - reflect what the information producer believed was appropriate for the purpose and at the time the message (document) was created.

    For example, at the beginning of the 2000 baseball season (May), the Las Vegas odds makers may have given the New York Yankees a probability of 1 in 10 (0.100) of winning the World Series. At the time of this writing, the Yankees and Mets have won their respective pennants, but the World Series has yet to begin. The probability of the Yankees winning the World Series is obviously significantly greater at this point in time, perhaps 6 in 10 (0.600). The context, and in particular the time of year, made all the difference in the world.

    Since probabilities are subjective measures of belief, they can be stated without being "correct" or "incorrect" per se, let alone "precise" or "imprecise". Notably, one does not have to conduct experiments to measure a frequency of some outcome in order to specify a probability. In fact, whenever statements about individual people or events are made, it is not possible to confirm such probabilities with "frequentists" experiments.

    Returning to our example, the Las Vegas odds makers can not insist on the Yankees and Mets playing 1000 trial games prior to the Series; even if they could, they would not have the fervor of the real Series and therefore not be accurate. Instead, the odds makers must derive the probability from past history, player statistics, injuries, etc.

    XML Representation
    Schema Fragment 185:
    <gsd:template name="UVP">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:sequence>
              <xsd:attribute name='probability' ... />
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.12.1

    Probability : real

    Definition:      The probability assigned to the value, a decimal number between 0 (very uncertain) and 1 (certain).

    XML Representation
    Schema Fragment 186:
    <xsd:attribute name="probability">
      <xsd:simpleType>
        <xsd:restriction base="real">
          <xsd:minInclusive value="0.0"/>
          <xsd:maxInclusive value="1.0"/>
        </xsd:restriction>
      </xsd:simpleType>
    </xsd:attribute>

    3.13

    Parametric Probability Distribution (PPD)

    Definition:      A generic data type extension specifying uncertainty of quantitative data using a distribution function and its parameters. Aside from the specific parameters of the distribution, a mean (expected value) and standard deviation is always given to help maintain a minimum layer of interoperability if receiving applications cannot deal with a certain probability distribution.

    For example, the most common college entrance exam in the United States is the SAT, which is comprised of two parts: verbal and math. Each part has a minimum score of 400 (no questions answered correctly) and a perfect score of 800. In 1998, according to the College Board, 1,172,779 college-bound seniors took the test. The mean score for the math portion of the test was 512, and the standard deviation 112. These parameter values (512, 112), tagged as the normal distribution parameters, paint a pretty good picture of test score distribution. In most cases, there is no need to specify all 1-million+ points of data when just 2 parameters will do!

    Parametric Probability Distribution

    Figure 2: Parametric Probability Distribution

    Note that the normal distribution is only one of several distributions defined for HL7.

    Table 42: Components of Parametric Probability Distribution
    Name Type Description
    standardDeviation T.diff The primary measure of variance/uncertainty of the value (the square root of the sum of the squares of the differences between all data points and the mean). The standard deviation is used to normalize the data for computing the distribution function. Applications that cannot deal with probability distributions can still get an idea about the confidence level by looking at the standard deviation.
    distributionType cs A code specifying the type of probability distribution. Possible values are as shown in the attached table. The NULL value (unknown) for the type code indicates that the probability distribution type is unknown. In that case, the standard deviation has the meaning of an informal guess.

    Since a PPD extends its parameter type T, a simple T value is the mean (expected value or first moment) of the probability distribution. Applications that cannot deal with distributions will take the simple T value neglecting the uncertainty. That simple value of type T is also used to standardize the data for computing the distribution.

    Probability distributions are defined over integer or real numbers and normalized to a certain reference point (typically zero) and reference unit (e.g., standard deviation = 1). When other quantities defined in this specification are used as base types, the mean and the standard deviation are used to scale the probability distribution. For example, if a PPD<PQ> for a length is given with mean 20 ft and a standard deviation of 2 in, the normalized distribution function f(x) that maps a real number x to a probability density would be translated to f′(x′) that maps a length x′ to a probability density as f′(x′) = f((x′ - μ ) / σ).

    Where applicable, the PPD specification conforms to as reflected by . The PPD specification does not describe how uncertainty is to be evaluated but only how it is expressed. The concept of "standard uncertainty" as set forth by the ISO GUM corresponds to the "standard deviation" property of the PPD.

    XML Representation

    Because XML schema has no generic type facility, and generic types are incomplete types, there is no normative schema fragment for probabilistic uncertain values in general. However, the following fragment defines a template used to instantiate a specific PPD<T>.

    Schema Fragment 187:
    <gsd:template name="PPD">
      <gsd:param name="T" type="QTY"/>
      <xsd:complexType>
        <xsd:annotation>
          <xsd:appinfo>
            <diff>
              <gsd:template as="text()" name="PPD">
                <gsd:withParam name="T">
                  <gsd:attribute name="type" type="T" prop="diff"/>
                </gsd:withParam>
              </gsd:template>
            </diff>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:attribute name="base" type="T"/>
            <xsd:sequence>
              <xsd:element name='standardDeviation' ... />
            </xsd:sequence>
            <xsd:attribute name='distributionType' type='cs_ProbabilityDistributionType' ... />
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    3.13.1

    Standard Deviation : T.diff

    Definition:      The primary measure of variance/uncertainty of the value (the square root of the sum of the squares of the differences between all data points and the mean). The standard deviation is used to normalize the data for computing the distribution function. Applications that cannot deal with probability distributions can still get an idea about the confidence level by looking at the standard deviation.

    XML Representation
    Schema Fragment 188:
    <xsd:element name="standardDeviation" minOccurs="0" maxOccurs="1">
      <gsd:attribute name="type" type="T" prop="diff"/>
    </xsd:element>

    3.13.2

    Probability Distribution Type : cs

    Definition:      A code specifying the type of probability distribution. Possible values are as shown in the attached table. The NULL value (unknown) for the type code indicates that the probability distribution type is unknown. In that case, the standard deviation has the meaning of an informal guess.

    Table 43 lists the defined probability distributions. Many distribution types are defined in terms of special parameters (e.g., the parameters α and β for the γ-distribution, number of degrees of freedom for the t-distribution, etc.) For all distribution types, however, the mean and standard deviation are defined. The PPD data type is specified with the parameters mean and standard distribution only. The definition column contains the relationship between the special parameters and the mean μ and standard deviation σ.

    Table 43: Domain ProbabilityDistributionType:
    code name definition
    (NULL) unknown Used to indicate that the mean is estimated without any closer consideration of its probability distribution. In this case, the meaning of the standard deviation is not crisply defined. However, interpretation should be along the lines of the normal distribution, e.g., the interval covered by the mean ±1 standard deviation should be at the level of about two thirds confidence.
    U uniform The uniform distribution assigns a constant probability over the entire interval of possible outcomes, while all outcomes outside this interval are assumed to have zero probability. The width of this interval is 2 σ √3. Thus, the uniform distribution assigns the probability densities f(x) = (2 σ √3)-1 to values μ - σ √3 ≥ x ≤ μ + σ √3 and f(x) = 0 otherwise.
    N normal (Gaussian) This is the well-known bell-shaped normal distribution. Because of the central limit theorem, the normal distribution is the distribution of choice for an unbounded random variable that is an outcome of a combination of many stochastic processes. Even for values bounded on a single side (i.e. greater than 0) the normal distribution may be accurate enough if the mean is "far away" from the bound of the scale measured in terms of standard deviations.
    LN log-normal The logarithmic normal distribution is used to transform skewed random variable X into a normally distributed random variable U = log X. The log-normal distribution can be specified with the properties mean μ and standard deviation σ. Note however that mean μ and standard deviation σ are the parameters of the raw value distribution, not the transformed parameters of the lognormal distribution that are conventionally referred to by the same letters. Those log-normal parameters μlog and σlog relate to the mean μ and standard deviation σ of the data value through σlog2 = log (σ22 + 1) and μlog = log μ - σlog2/2.
    G γ (gamma) The gamma-distribution used for data that is skewed and bounded to the right, i.e. where the maximum of the distribution curve is located near the origin. The γ-distribution has two parameters α and β. The relationship to mean μ and variance σ2 is μ = α β and σ2 = α β2.
    E exponential Used for data that describes extinction. The exponential distribution is a special form of γ-distribution where α = 1, hence, the relationship to mean μ and variance σ2 are μ = β and σ2 = β2.
    X2 χ Used to describe the sum of squares of random variables that occurs when a variance is estimated (rather than presumed) from the sample. The only parameter of the χ2-distribution is υ, so called the number of degrees of freedom (which is the number of independent parts in the sum). The χ2-distribution is a special type of γ-distribution with parameter α = υ /2 and β = 2. Hence, μ = υ and σ2 = 2 υ.
    T t (Student) Used to describe the quotient of a normal random variable and the square root of a χ2 random variable. The t-distribution has one parameter υ, the number of degrees of freedom. The relationship to mean μ and variance σ2 are: μ = 0 and σ2 = υ / (υ - 2)
    F F Used to describe the quotient of two χ2 random variables. The F-distribution has two parameters υ1 and υ2, which are the numbers of degrees of freedom of the numerator and denominator variable respectively. The relationship to mean μ and variance σ2 are: μ = υ2 / (υ2 - 2) and σ2 = (2 υ22 + υ1 - 2)) / (υ12 - 2)22 - 4)).
    B β (beta) The beta-distribution is used for data that is bounded on both sides and may or may not be skewed (e.g., occurs when probabilities are estimated.) Two parameters α and β are available to adjust the curve. The mean μ and variance σ2 relate as follows: μ = α / (α + β) and (σ2 = α β/((α + β)2 (α + β + 1)).

    The three distribution-types unknown (NULL), uniform and normal must be supported by every system that claims to support PPD. All other distribution types are optional. When a system interpreting a PPD representation encounters an unknown distribution type, it maps this type to the unknown (NULL) distribution-type.

    NOTE: an ITS does not need to represent any of the specialized parameters for the distribution types. As it turns out, all of these specialized parameters can be calculated from the mean and standard deviation.
    XML Representation
    Schema Fragment 189:
    <xsd:attribute name="distributionType" type="cs_ProbabilityDistributionType" use="optional"/>
    Schema Fragment 190:
    <xsd:simpleType name="cs_ProbabilityDistributionType">
      <xsd:restriction base="cs">
        <xsd:enumeration value="U"/>
        <xsd:enumeration value="N"/>
        <xsd:enumeration value="LN"/>
        <xsd:enumeration value="G"/>
        <xsd:enumeration value="E"/>
        <xsd:enumeration value="X2"/>
        <xsd:enumeration value="T"/>
        <xsd:enumeration value="F"/>
        <xsd:enumeration value="B"/>
      </xsd:restriction>
    </xsd:simpleType>

    4

    Timing Specification

    The timing specification suite of data types is used to specify the complex timing of events and actions such as those that occur in order management and scheduling systems. It also supports the cyclical validity patterns that may exist for certain kinds of information, such as phone numbers (evening, daytime), addresses (so called "snowbirds," residing in the south during winter and north during summer) and office hours.

    The timing specification data types include point in time (TS) and the interval of time (IVL<TS>) and add types that are specifically suited to repeated schedules. These additional types include periodic interval, event-related periodic interval, and finally the general timing specification types itself. All these timing types describe the time distribution of repeating states or events.

    4.1

    Periodic Interval of Time (PIVL) extends

    Definition:      An interval of time that recurs periodically. Periodic intervals have two properties, phase and period. The phase specifies the "interval prototype" that is repeated every period.

    Table 44: Components of Periodic Interval of Time
    Name Type Description
    phase IVL<T> A prototype of the repeating interval specifying the duration of each occurrence and anchors the periodic interval sequence at a certain point in time.
    period T.diff A time duration specifying as a reciprocal measure of the frequency at which the periodic interval repeats.
    alignment cs Specifies if and how the repetitions are aligned to the cycles of the underlying calendar (e.g., to distinguish every 30 days from "the 5th of every month".) A non-aligned periodic interval recurs independently from the calendar. An aligned periodic interval is synchronized with the calendar.
    institutionSpecified bl Indicates whether the exact timing is up to the party executing the schedule (e.g., to distinguish "every 8 hours" from "3 times a day".)

    For example, "every eight hours for two minutes" is a periodic interval where the interval's width equals two minutes and the period at which the interval recurs equals eight hours.

    The phase also marks the anchor point in time for the entire series of periodically recurring intervals. The recurrence of a periodic interval has no beginning or ending, but is infinite in both future and past.

    XML Representation
    Schema Fragment 191:
    <gsd:template name="PIVL">
      <gsd:param name="T" type="TS"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:template as="base" name="SXCM">
              <gsd:withParam name="T">
                <gsd:attribute name="type" type="T"/>
              </gsd:withParam>
            </gsd:template>
            <xsd:sequence>
              <xsd:element name='phase' ... />
              <xsd:element name='period' ... />
            </xsd:sequence>
            <xsd:attribute name='alignment' type='cs_CalendarCycle' ... />
            <xsd:attribute name='institutionSpecified' type='bl' ... />
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    4.1.1

    Phase : IVL<T>

    Definition:      A prototype of the repeating interval specifying the duration of each occurrence and anchors the periodic interval sequence at a certain point in time.

    The phase also marks the anchor point in time for the entire series of periodically recurring intervals. The recurrence of a periodic interval has no begin or end but is infinite in both future and past. A phase must be specified for every non-NULL periodic interval. The width of the phase must be less or equal the period.

    XML Representation
    Schema Fragment 192:
    <xsd:element name="phase" minOccurs="0" maxOccurs="1">
      <gsd:template as="type" name="IVL">
        <gsd:withParam name="T">
          <gsd:attribute name="type" type="T"/>
        </gsd:withParam>
      </gsd:template>
    </xsd:element>

    4.1.2

    Period : T.diff

    Definition:      A time duration specifying as a reciprocal measure of the frequency at which the periodic interval repeats.

    The period is a physical quantity in the dimension of time (TS.diff.) For an uncertain periodic interval the period is a probability distribution over elapsed time.

    XML Representation
    Schema Fragment 193:
    <xsd:element name="period" minOccurs="0" maxOccurs="1">
      <gsd:attribute name="type" type="T" prop="diff"/>
    </xsd:element>

    4.1.3

    Alignment to the Calendar : cs

    Definition:      Specifies if and how the repetitions are aligned to the cycles of the underlying calendar (e.g., to distinguish every 30 days from "the 5th of every month".) A non-aligned periodic interval recurs independently from the calendar. An aligned periodic interval is synchronized with the calendar.

    The calendar alignment specifies a calendar cycle to which the periodic interval is aligned. The even flow of time will then be partitioned by the calendar cycle. The partitioning is called the calendar "grid" generated by the aligned-to calendar cycle. The boundaries of each occurrence interval will then have equal distance from the earliest point in each partition. In other words, the distance from the next lower grid-line to the beginning of the interval is constant.

    Table 45: Domain CalendarCycle:
    name code 1 code 2 counter digits start condition
    year   Y   CY   1   4   0   MY12  
    month of the year   M   MY   2   2   1   MY01,03,05,07,08,10,12 → DM31
    MY04,06,09,11 → DM30
    MY02 Y/4 Y/100 → DM28
    MY02 Y/4 → DM29
    MY02 → DM28
     
    month (continuous)     CM       0   continuous MY  
    week (continuous)   W   CW       0   CD7  
    week of the year     WY     2   1   continuous DW7  
    day of the month   D   DM   3   2   1   HD24  
    day (continuous)     CD       0   CH24  
    day of the year     DY     3   1   HD24  
    day of the week (begins with Monday)   J   DW     1   1   HD24  
    hour of the day   H   HD   4   2   0   MH60  
    hour (continuous)     CH       0   CN60  
    minute of the hour   N   NH   5   2   0   UTC leap second → SN61 → SN60  
    minute (continuous)     CN       0   CS60  
    second of the minute   S   SN   6   2   0   CS1  
    second (continuous)     CS       0   basis  

    For example, with “every 5th of the month” the alignment calendar cycle would be month of the year (MY.) The even flow of time is partitioned in months of the year. The distance between the beginning of each month and the beginning of its occurrence interval is 4 days (4 days because day of month (DM) starts counting with 1.) Thus, as months differ in their number of days, the distances between the recurring intervals will vary slightly, so that the interval occurs always on the 5th.

    XML Representation
    Schema Fragment 194:
    <xsd:attribute name="alignment" type="cs_CalendarCycle" use="optional"/>
    Schema Fragment 195:
    <xsd:simpleType name="cs_CalendarCycle">
      <xsd:restriction base="cs">
        <xsd:enumeration value="CY"/>
        <xsd:enumeration value="MY"/>
        <xsd:enumeration value="CM"/>
        <xsd:enumeration value="CW"/>
        <xsd:enumeration value="WY"/>
        <xsd:enumeration value="DM"/>
        <xsd:enumeration value="CD"/>
        <xsd:enumeration value="DY"/>
        <xsd:enumeration value="DW"/>
        <xsd:enumeration value="HD"/>
        <xsd:enumeration value="CH"/>
        <xsd:enumeration value="NH"/>
        <xsd:enumeration value="CN"/>
        <xsd:enumeration value="SN"/>
        <xsd:enumeration value="CS"/>
      </xsd:restriction>
    </xsd:simpleType>

    4.1.4

    Institution Specified Timing : bl

    Definition:      Indicates whether the exact timing is up to the party executing the schedule (e.g., to distinguish "every 8 hours" from "3 times a day".)

    For example, with a schedule "three times a day" the average time between repetitions is 8 hours, however, with institution specified time indicator true, the timing could follow some rule made by the executing person or organization ("institution"), that, e.g., three times a day schedules are executed at 7 am, noon, and 7 pm.

    XML Representation
    Schema Fragment 196:
    <xsd:attribute name="institutionSpecified" type="bl" use="optional" default="false"/>

    4.1.5

    Examples

    Three times a day, i.e., every 8 hours at institution specified times.

    Example 18:
    <effective_time xsi:type="PIVL_TS" institutionSpecified="true"><period value="8" unit="h"/></effective_time> 

    Three times a day, i.e., every 8 hours at institution specified times.

    Example 19:
    <effective_time xsi:type="PIVL_TS" institutionSpecified="true"><period value="8" unit="h"/></effective_time> 

    Twice a day for ten minutes.

    Example 20:
    <effective_time xsi:type="PIVL_TS"><phase><width value="10" unit="min"/></phase><period value="12" unit="h"/></effective_time> 

    September, the entire month, every year (note that in the year 1987 in the generic form is irrelevant since the periodic interval recurs every year past and future.)

    Example 21:
    <effective_time xsi:type="PIVL_TS" alignment="MY"><phase><low value="1987-09" inclusive="true"/><high value="1987-10" inclusive="false"/></phase><period value="1" unit="a"/></effective_time> 

    Every other Saturday.

    Example 22:
    <effective_time xsi:type="PIVL_TS" alignment="DW"><phase><low value="2000-12-02" inclusive="true"/><high value="2000-12-03" inclusive="false"/></phase><period value="2" unit="wk"/></effective_time> 

    4.2

    Event-Related Interval of Time (EIVL) extends

    Definition:      Specifies a periodic interval pf time where the recurrence is based on activities of daily living or other important events that are time-related but not fully determined by time.

    For example, "one hour after breakfast" specifies the beginning of the interval at one hour after breakfast is finished. Breakfast is assumed to occur before lunch but is not determined to occur at any specific time.

    XML Representation
    Schema Fragment 197:
    <gsd:template name="EIVL">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:template as="base" name="SXCM">
              <gsd:withParam name="T">
                <gsd:attribute name="type" type="T"/>
              </gsd:withParam>
            </gsd:template>
            <xsd:sequence>
              <xsd:element name='event' type='CE' ... />
              <xsd:element name='event' ... />
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    4.2.1

    Event : CE

    A code for a common (periodical) activity of daily living based on which the event related periodic interval is specified.

    Such events qualify for being adopted in the domain of this attribute for which all of the following is true:

    Table 46: Domain TimingEvent:
    code name definition
    AC before meal (from lat. ante cibus)
    ACD before lunch (from lat. ante cibus diurnus)
    ACM before breakfast (from lat. ante cibus matutinus)
    ACV before dinner (from lat. ante cibus vespertinus)
    HS the hour of sleep (e.g., H18-22)
    IC between meals (from lat. inter cibus)
    ICD between lunch and dinner
    ICM between breakfast and lunch
    ICV between dinner and the hour of sleep
    PC after meal (from lat. post cibus)
    PCD after lunch (from lat. post cibus diurnus)
    PCM after breakfast (from lat. post cibus matutinus)
    PCV after dinner (from lat. post cibus vespertinus)
    XML Representation
    Schema Fragment 198:
    <xsd:element name="event" type="CE" minOccurs="0" maxOccurs="1"/>
    Schema Fragment 199:
    <xsd:simpleType name="cs_TimingEvent">
      <xsd:restriction base="cs">
        <xsd:enumeration value="CY"/>
        <xsd:enumeration value="MY"/>
        <xsd:enumeration value="CM"/>
        <xsd:enumeration value="CW"/>
        <xsd:enumeration value="WY"/>
        <xsd:enumeration value="DM"/>
        <xsd:enumeration value="CD"/>
        <xsd:enumeration value="DY"/>
        <xsd:enumeration value="DW"/>
        <xsd:enumeration value="HD"/>
        <xsd:enumeration value="CH"/>
        <xsd:enumeration value="NH"/>
        <xsd:enumeration value="CN"/>
        <xsd:enumeration value="SN"/>
        <xsd:enumeration value="CS"/>
      </xsd:restriction>
    </xsd:simpleType>

    4.2.2

    Offset : IVL_T.diff

    Definition:      An interval of elapsed time (duration, not absolute point in time) that marks the offsets for the beginning, width and end of the event-related periodic interval measured from the time each such event actually occurred.

    For example: if the specification is "one hour before breakfast for 10 minutes" the offset's low boundary is (1 h and the offset's width is 10 min (consequently the offset's high boundary is (50 min.)

    XML Representation
    Schema Fragment 200:
    <xsd:element name="event" minOccurs="0" maxOccurs="1">
      <gsd:template as="type" name="IVL">
        <gsd:withParam name="T">
          <gsd:attribute name="type" type="T" prop="diff"/>
        </gsd:withParam>
      </gsd:template>
    </xsd:element>

    4.3

    Parenthetic Set Expression (SXPR) extends

    Definition:      A set-component that is itself made up of set-components that are evaluated as one value.

    XML Representation
    Schema Fragment 201:
    <gsd:template name="SXPR">
      <gsd:param name="T" type="ANY"/>
      <xsd:complexType>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:template as="base" name="SXCM">
              <gsd:withParam name="T">
                <gsd:attribute name="type" type="T"/>
              </gsd:withParam>
            </gsd:template>
            <xsd:sequence>
              <xsd:element name='comp' ... />
            </xsd:sequence>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
    </gsd:template>

    4.3.1

    Sub-Expression : SXPR

    Definition:      A component of a parenthetic set expression.

    XML Representation
    Schema Fragment 202:
    <xsd:element name="comp" minOccurs="2" maxOccurs="unbounded">
      <gsd:template as="type" name="SXCM">
        <gsd:withParam name="T">
          <gsd:attribute name="type" type="T"/>
        </gsd:withParam>
      </gsd:template>
    </xsd:element>

    4.4

    General Timing Specification (GTS)

    Definition:      A set of points in time, specifying the timing of events and actions and the cyclical validity-patterns that may exist for certain kinds of information, such as phone numbers (evening, daytime), addresses (so called "snowbirds," residing in the south during winter and north during summer) and office hours.

    NOTE: A GTS is nothing else than a SET<TS>.
    XML Representation

    A GTS is represented in XML as a sequence of XML elements of type SXCM<TS> or its specializations, including IVL<TS>, PIVL<TS>, EIVL<TS>.

    4.4.1

    Examples

    An example for a quite complex Generic Type Specification is: every other Tuesday in the season from Memorial Day to Labor Day in the years 2002 and 2003.

    Example 23:
     
    <effective_time xsi:type="SXCM_TS">
      
      <comp xsi:type="SXCM_TS">
        <comp xsi:type="PIVL_TS">
          <phase>
            <low value="1987-05-25"/>
            <high value="1987-06-01" inclusive="false"/>
          </phase>
          <period value="1" unit="a"/>
        </comp>
        <comp xsi:type="PIVL_TS" operator="A">
          <phase>
            <low value="1987-01-05"/>
            <high value="1987-01-06" inclusive="false"/>
          </phase>
          <period value="1" unit="wk"/>
        </comp>
      </comp>
      
      <comp xsi:type="SXCM_TS" operator="PH">
        <comp xsi:type="PIVL_TS">
          <phase>
            <low value="1987-09-01"/>
            <high value="1987-09-08" inclusive="false"/>
          </phase>
          <period value="1" unit="a"/>
        </comp>
        <comp xsi:type="PIVL_TS" operator="A">
          <phase>
            <low value="1987-01-05"/>
            <high value="1987-01-06" inclusive="false"/>
          </phase>
          <period value="1" unit="wk"/>
        </comp>
      </comp>
    </effective_time>
    <effective_time xsi:type="PIVL_TS" alignment="DW" operator="A">
      
      <phase>
        <low value="2000-12-02" inclusive="true"/>
        <high value="2000-12-03" inclusive="false"/>
      </phase>
      <period value="2" unit="wk"/>
    </effective_time>
    <effective_time xsi:type="IVL_TS" operator="A">
      
      <low value="2002-01-01" inclusive="true"/>
      <high value="2004-01-01" inclusive="false"/>
    </effective_time>
     

    A

    Complete Schema

    Schema 203:
    <xsd:complexType name="ANY" abstract="true" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          Defines the basic properties of every data value. This is an abstract type, meaning that no value can be just a data value without belonging to any concrete type. Every concrete type is a specialization of this general abstract DataValue type.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:attribute name="nullFlavor" type="cs_NullFlavor" use="optional">
        <xsd:annotation>
          <xsd:documentation>
            An exceptional value expressing missing information and possibly the reason why the information is missing.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
      </xsd:attribute>
    </xsd:complexType>
    <xsd:simpleType name="cs_NullFlavor">
      <xsd:restriction base="cs">
        <xsd:enumeration value="NI"/>
        <xsd:enumeration value="NA"/>
        <xsd:enumeration value="UNK"/>
        <xsd:enumeration value="NASK"/>
        <xsd:enumeration value="ASKU"/>
        <xsd:enumeration value="NAV"/>
        <xsd:enumeration value="OTH"/>
        <xsd:enumeration value="PINF"/>
        <xsd:enumeration value="NINF"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="bl">
      <xsd:annotation>
        <xsd:documentation>
          The Boolean type stands for the values of two-valued logic. A Boolean value can be either or , or, as any other value may be NULL.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:boolean">
        <xsd:pattern value="true|false"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="BL">
      <xsd:annotation>
        <xsd:documentation>
          The Boolean type stands for the values of two-valued logic. A Boolean value can be either or , or, as any other value may be NULL.
        </xsd:documentation>
        <xsd:appinfo>
          <hl7:pr assert="(@nullFlavor or @value) and not(@nullFlavor and @value)"/>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:attribute name="value" use="optional" type="bl"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="bin">
      <xsd:annotation>
        <xsd:documentation>
          Binary data is a raw block of bits. Binary data is a protected type that should not be declared outside the data type specification.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:base64Binary"/>
    </xsd:simpleType>
    <xsd:simpleType name="cs_BinaryDataEncoding">
      <xsd:restriction base="xsd:NMTOKEN">
        <xsd:enumeration value="B64"/>
        <xsd:enumeration value="TXT"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="BIN" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          Binary data is a raw block of bits. Binary data is a protected type that should not be declared outside the data type specification.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:attribute name="encoding" use="optional" type="cs_BinaryDataEncoding" default="TXT">
            <xsd:annotation>
              <xsd:documentation>
                Specifies the encoding of the binary data that is the content of the binary data complex XML schema data type.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_CompressionAlgorithm">
      <xsd:restriction base="cs">
        <xsd:enumeration value="DF"/>
        <xsd:enumeration value="GZ"/>
        <xsd:enumeration value="ZL"/>
        <xsd:enumeration value="Z"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="cs_IntegrityCheckAlgorithm">
      <xsd:restriction base="cs">
        <xsd:enumeration value="SHA-1"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="ED" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          Data that is primarily intended for human interpretation or for further machine processing outside the scope of HL7. This includes unformatted or formatted written language, multimedia data, or structured information in as defined by a different standard (e.g., XML-signatures.) Instead of the data itself, an may contain only a reference (see .) Note that the data type is a specialization of the data type when the media type is text/plain.
        </xsd:documentation>
        <xsd:appinfo>
          <hl7:pr assert="count(text())<=1"/>
          <hl7:pr assert="(@nullFlavor or text()) and not(@nullFlavor and text())"/>
          <hl7:pr assert="(@nullFlavor or @type) and not(@nullFlavor and @type)"/>
          <hl7:pr assert="(@nullFlavor or @integrityCheck) and not(@nullFlavor and @integrityCheck)"/>
          <hl7:pr assert="(@integrityCheckAlgorithm and @integrityCheck) or not(@integrityCheckAlgorithm or @integrityCheck)"/>
          <hl7:pr assert="(@nullFlavor or @reference) and not(@nullFlavor and @reference)"/>
          <hl7:pr assert="(@nullFlavor or @thumbnail) and not(@nullFlavor and @thumbnail)"/>
          <hl7:pr assert="(@nullFlavor or @type) and not(@nullFlavor and @type)"/>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="BIN">
          <xsd:sequence>
            <xsd:element name="reference" type="TEL" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  A telecommunication address (TEL), such as a URL for HTTP or FTP, which will resolve to precisely the same binary data that could as well have been provided as inline data.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="thumbnail" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  A thumbnail is an abbreviated rendition of the full data. A thumbnail requires significantly fewer resources than the full data, while still maintaining some distinctive similarity with the full data. A thumbnail is typically used with by-reference encapsulated data. It allows a user to select data more efficiently before actually downloading through the reference.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
              <xsd:complexType>
                <xsd:complexContent>
                  <xsd:restriction base="ED">
                    <xsd:sequence>
                      <xsd:element name="reference" type="TEL" minOccurs="0" maxOccurs="1"/>
                      <xsd:element name="thumbnail" type="ED" minOccurs="0" maxOccurs="0"/>
                    </xsd:sequence>
                  </xsd:restriction>
                </xsd:complexContent>
              </xsd:complexType>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="mediaType" type="cs" use="optional" default="text/plain">
            <xsd:annotation>
              <xsd:documentation>
                Identifies the encoding of the encapsulated data and identifies a method to interpret or render the data.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute ref="xml:lang" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                For character based information the language property specifies the human language of the text.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="compression" type="cs_CompressionAlgorithm" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                Indicates whether the raw byte data is compressed, and what compression algorithm was used.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="integrityCheck" type="bin" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                The integrity check is a short binary value representing a cryptographically strong checksum that is calculated over the binary data. The purpose of this property, when communicated with a reference is for anyone to validate later whether the reference still resolved to the same data that the reference resolved to when the encapsulated data value with reference was created.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="integrityCheckAlgorithm" type="cs_IntegrityCheckAlgorithm" use="optional" fixed="SHA-1">
            <xsd:annotation>
              <xsd:documentation>
                Specifies the algorithm used to compute the integrityCheck value.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="st">
      <xsd:annotation>
        <xsd:documentation>
          The character string data type stands for text data, primarily intended for machine processing (e.g., sorting, querying, indexing, etc.) Used for names, symbols, and formal expressions.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:string"/>
    </xsd:simpleType>
    <xsd:complexType name="ST" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          The character string data type stands for text data, primarily intended for machine processing (e.g., sorting, querying, indexing, etc.) Used for names, symbols, and formal expressions.
        </xsd:documentation>
        <xsd:appinfo>
          <hl7:pr assert="(@nullFlavor or text()) and not(@nullFlavor and text())"/>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="ED">
          <xsd:sequence>
            <xsd:element name="reference" type="TEL" minOccurs="0" maxOccurs="0"/>
            <xsd:element name="thumbnail" type="ED" minOccurs="0" maxOccurs="0"/>
          </xsd:sequence>
          <xsd:attribute name="encoding" type="cs_BinaryDataEncoding" fixed="TXT" use="prohibited"/>
          <xsd:attribute name="mediaType" type="cs" fixed="text/plain" use="prohibited"/>
          <xsd:attribute ref="xml:lang" use="prohibited"/>
          <xsd:attribute name="compression" type="cs_CompressionAlgorithm" use="prohibited"/>
          <xsd:attribute name="integrityCheck" type="bin" use="prohibited"/>
          <xsd:attribute name="integrityCheckAlgorithm" type="cs_IntegrityCheckAlgorithm" use="prohibited" fixed="SHA-1"/>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs">
      <xsd:annotation>
        <xsd:documentation>
          Coded data in its simplest form, consists of a code and display name. The code system and code system version is fixed by the context in which the CS value occurs. CS is used for coded attributes that have a single HL7-defined value set.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:token">
        <xsd:pattern value="[^\s]*"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="CD" mixed="false">
      <xsd:annotation>
        <xsd:documentation>
          A concept descriptor represents any kind of concept usually by giving a code defined in a code system. A concept descriptor can contain the original text or phrase that served as the basis of the coding and one or more translations into different coding systems. A concept descriptor can also contain qualifiers to describe, e.g., the concept of a "left foot" as a postcoordinated term built from the primary code "FOOT" and the qualifier "LEFT". In exceptional cases, the concept descriptor need not contain a code but only the original text describing that concept.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:sequence>
            <xsd:element name="qualifier" type="CR" minOccurs="0" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>
                  Specifies additional codes that increase the specificity of the the primary code.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  The text or phrase used as the basis for the coding.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="translation" type="CD" minOccurs="0" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>
                  A set of other concept descriptors that translate this concept descriptor into other code systems.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="code" type="cs" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystem" type="uid" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                Specifies the code system that defines the code.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystemName" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A common name of the coding system.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystemVersion" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                If applicable, a version descriptor defined specifically for the given code system
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="displayName" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A name or title for the code, under which the sending system shows the code value to its users.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="CE">
      <xsd:annotation>
        <xsd:documentation>
          Coded data, consists of a coded value (CV) and, optionally, coded value(s) from other coding systems that identify the same concept. Used when alternative codes may exist.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="CD">
          <xsd:sequence>
            <xsd:element name="qualifier" minOccurs="0" maxOccurs="0"/>
          </xsd:sequence>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="CV">
      <xsd:annotation>
        <xsd:documentation>
          Coded data, consists of a code, display name, code system, and original text. Used when a single code value must be sent.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="CE">
          <xsd:sequence>
            <xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  The text or phrase used as the basis for the coding.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="translation" type="CD" minOccurs="0" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>
                  A set of other concept descriptors that translate this concept descriptor into other code systems.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="code" type="cs" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystem" type="uid" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                Specifies the code system that defines the code.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystemName" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A common name of the coding system.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystemVersion" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                If applicable, a version descriptor defined specifically for the given code system
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="displayName" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A name or title for the code, under which the sending system shows the code value to its users.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="CS">
      <xsd:annotation>
        <xsd:documentation>
          Coded data in its simplest form, consists of a code and display name. The code system and code system version is fixed by the context in which the CS value occurs. CS is used for coded attributes that have a single HL7-defined value set.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="CV">
          <xsd:sequence>
            <xsd:element name="originalText" minOccurs="0" maxOccurs="0"/>
          </xsd:sequence>
          <xsd:attribute name="code" type="cs" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                The plain code symbol defined by the code system. For example, "784.0" is the code symbol of the ICD-9 code "784.0" for headache.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="codeSystem" type="uid" use="prohibited"/>
          <xsd:attribute name="codeSystemName" type="st" use="prohibited"/>
          <xsd:attribute name="codeSystemVersion" type="st" use="prohibited"/>
          <xsd:attribute name="displayName" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A name or title for the code, under which the sending system shows the code value to its users.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:element name="originalText" type="ED" minOccurs="0" maxOccurs="1"/>
    <xsd:element name="translation" minOccurs="0" maxOccurs="0"/>
    <xsd:complexType name="CR">
      <xsd:annotation>
        <xsd:documentation>
          A concept qualifier code with optionally named role. Both qualifier role and value codes must be defined by the coding system. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg".
        </xsd:documentation>
        <xsd:appinfo>
          <hl7:pr assert="(value or @nullFlavor) and not(@nullFlavor and node())"/>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="CD">
          <xsd:sequence>
            <xsd:element name="name" type="CV" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  Specifies the manner in which the concept role value contributes to the meaning of a code phrase. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows to add the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". In this example "has-laterality" is the CR.name.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
            <xsd:element name="value" type="CD" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  The concept that modifies the primary code of a code phrase through the role relation. For example, if SNOMED RT defines a concept "leg", a role relation "has-laterality", and another concept "left", the concept role relation allows adding the qualifier "has-laterality: left" to a primary code "leg" to construct the meaning "left leg". In this example "left" is the CR.value.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="inverted" type="bl" use="optional" default="false">
            <xsd:annotation>
              <xsd:documentation>
                Indicates if the sense of the role name is inverted. This can be used in cases where the underlying code system defines inversion but does not provide reciprocal pairs of role names. By default, inverted is false.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="uid">
      <xsd:annotation>
        <xsd:documentation/>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:string">
        <xsd:pattern value="([1-9][0-9]*)(\.[1-9][0-9]*)*"/>
        <xsd:pattern value="[0-9a-zA-Z]{8}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{4}-[0-9a-zA-Z]{12}"/>
        <xsd:pattern value="[A-Za-z][A-Za-z0-9-]*"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="ts">
      <xsd:annotation>
        <xsd:documentation>
          A a quantity specifying a point on the axis of natural time. A point in time is most often represented as a calendar expression.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:string">
        <xsd:pattern value="[0-9]{1,14}\(\.{1,4}\)?\([+-]{1,4}\)?"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="TS">
      <xsd:annotation>
        <xsd:documentation>
          A a quantity specifying a point on the axis of natural time. A point in time is most often represented as a calendar expression.
        </xsd:documentation>
        <xsd:appinfo>
          <diff>
            PQ
          </diff>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="QTY">
          <xsd:attribute name="value" use="optional" type="ts"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="II">
      <xsd:annotation>
        <xsd:documentation>
          An identifier that uniquely identifies a thing or object. Examples are object identifier for HL7 RIM objects, medical record number, order id, service catalog item id, Vehicle Identification Number (VIN), etc. Instance identifiers are defined based on ISO object identifiers.
        </xsd:documentation>
        <xsd:appinfo>
          <hl7:pr assert="(@root or @nullFlavor) and not(@root and @nullFlavor)">
            A root component is required or else the II value is NULL.
          </hl7:pr>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:sequence>
            <xsd:element name="validTime" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  If applicable, specifies during what time the identifier is valid. By default, the identifier is valid indefinitely. Any specific interval may be undefined on either side indicating unknown effective or expiry time.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
              <gsd:template as="type" name="IVL">
                <gsd:withParam name="T" type="TS"/>
              </gsd:template>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="root" type="uid" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A unique identifier that guarantees the global uniqueness of the instance identifier. The root alone may be the entire instance identifier.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="extension" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A character string as a unique identifier within the scope of the identifier root.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="assigningAuthorityName" type="st" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A human readable name or mnemonic for the assigning authority. This name may be provided solely for the convenience of unaided humans interpreting an II value. Note: no automated processing must depend on the assigning authority name to be present in any form.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="display" type="bl" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                Specifies if the identifier's extension is intendended for human display and data entry (displayable = true) as opposed to pure machine interoperation (displayable = false).
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="url">
      <xsd:annotation>
        <xsd:documentation>
          A telecommunications address specified according to Internet standard RFC 1738 []. The URL specifies the protocol and the contact point defined by that protocol for the resource. Notable uses of the telecommunication address data type are for telephone and telefax numbers, e-mail addresses, Hypertext references, FTP references, etc.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:restriction base="xsd:anyURI"/>
    </xsd:simpleType>
    <xsd:complexType name="URL">
      <xsd:annotation>
        <xsd:documentation>
          A telecommunications address specified according to Internet standard RFC 1738 []. The URL specifies the protocol and the contact point defined by that protocol for the resource. Notable uses of the telecommunication address data type are for telephone and telefax numbers, e-mail addresses, Hypertext references, FTP references, etc.
        </xsd:documentation>
        <xsd:appinfo>
          <hl7:pr assert="(@nullFlavor or @value) and not(@nullFlavor and @value)"/>
        </xsd:appinfo>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:attribute name="value" type="url" use="optional"/>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_TelecommunicationAddressUse">
      <xsd:restriction base="cs">
        <xsd:enumeration value="H"/>
        <xsd:enumeration value="HP"/>
        <xsd:enumeration value="HV"/>
        <xsd:enumeration value="WP"/>
        <xsd:enumeration value="AS"/>
        <xsd:enumeration value="EC"/>
        <xsd:enumeration value="PG"/>
        <xsd:enumeration value="MC"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="TEL">
      <xsd:annotation>
        <xsd:documentation>
          A telephone number (voice or fax), e-mail address, or other locator for a resource (information or service) mediated by telecommunication equipment. The address is specified as a Universal Resource Locator (URL) qualified by time specification and use codes that help deciding which address to use for a given time and purpose.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="URL">
          <xsd:sequence>
            <xsd:element name="validTime" minOccurs="0" maxOccurs="unbounded">
              <xsd:annotation>
                <xsd:documentation>
                  Specifies the periods of time during which the telecommunication address can be used. For a telephone number, this can indicate the time of day in which the party can be reached on that telephone. For a web address, it may specify a time range in which the web content is promised to be available under the given address.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
              <gsd:template as="type" name="SXCM">
                <gsd:withParam name="T" type="TS"/>
              </gsd:template>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="use" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                One or more codes advising a system or user which telecommunication address in a set of like addresses to select for a given telecommunication need.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_TelecommunicationAddressUse"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_AddressPartType">
      <xsd:restriction base="cs">
        <xsd:enumeration value="DEL"/>
        <xsd:enumeration value="CNT"/>
        <xsd:enumeration value="STA"/>
        <xsd:enumeration value="CPA"/>
        <xsd:enumeration value="CTY"/>
        <xsd:enumeration value="ZIP"/>
        <xsd:enumeration value="STR"/>
        <xsd:enumeration value="HNR"/>
        <xsd:enumeration value="SAL"/>
        <xsd:enumeration value="DIR"/>
        <xsd:enumeration value="ADL"/>
        <xsd:enumeration value="POB"/>
        <xsd:enumeration value="CEN"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="ADXP" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A character string that may have a type-tag signifying its role in the address. Typical parts that exist in about every address are street, house number, or post box, postal code, city, country but other roles may be defined regionally, nationally, or on an enterprise level (e.g. in military addresses). Addresses are usually broken up into lines, which are indicated by special line-breaking delimiter elements (e.g., DEL).
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ST">
          <xsd:attribute name="partType" type="cs_AddressPartType">
            <xsd:annotation>
              <xsd:documentation>
                Specifies whether an address part names the street, city, country, postal code, post box, etc. If the type is NULL the address part is unclassified and would simply appear on an address label as is.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_PostalAddressUse">
      <xsd:restriction base="cs">
        <xsd:enumeration value="PHYS"/>
        <xsd:enumeration value="PST"/>
        <xsd:enumeration value="INV"/>
        <xsd:enumeration value="TMP"/>
        <xsd:enumeration value="BAD"/>
        <xsd:enumeration value="H"/>
        <xsd:enumeration value="HP"/>
        <xsd:enumeration value="HV"/>
        <xsd:enumeration value="WP"/>
        <xsd:enumeration value="ABC"/>
        <xsd:enumeration value="SYL"/>
        <xsd:enumeration value="IDE"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="AD" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          Mailing and home or office addresses. A sequence of address parts, such as street or post office Box, city, postal code, country, etc.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded">
              <xsd:element name="delimiter">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="DEL"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="country">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CNT"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="state">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="STA"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="county">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CPA"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="city">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CTY"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="postalCode">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="ZIP"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="streetAddressLine">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="SAL"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="streetName">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="STR"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="houseNumber">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="HNR"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="direction">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="DIR"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="additionalLocator">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="ADL"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="postBox">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="POB"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="censusTract">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ADXP">
                      <xsd:attribute name="partType" type="cs_AddressPartType" fixed="CEN"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
            </xsd:choice>
            <xsd:element name="validTime" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  A General Timing Specification (GTS) specifying the periods of time during which the address can be used. This is used to specify different addresses for different times of the year or to refer to historical addresses.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
              <gsd:template as="type" name="SXCM">
                <gsd:withParam name="T" type="TS"/>
              </gsd:template>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="use" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A set of codes advising a system or user which address in a set of like addresses to select for a given purpose.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PostalAddressUse"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_EntityNamePartQualifier">
      <xsd:restriction base="cs">
        <xsd:enumeration value="BR"/>
        <xsd:enumeration value="SP"/>
        <xsd:enumeration value="VV"/>
        <xsd:enumeration value="AC"/>
        <xsd:enumeration value="PR"/>
        <xsd:enumeration value="NB"/>
        <xsd:enumeration value="LS"/>
        <xsd:enumeration value="CL"/>
        <xsd:enumeration value="IN"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="ENXP" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A character string token representing a part of a name. May have a type code signifying the role of the part in the whole entity name, and a qualifyer code for more detail about the name part type. Typical name parts for person names are given names, and family names, titles, etc.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ST">
          <xsd:attribute name="partType" type="cs_EntityNamePartType">
            <xsd:annotation>
              <xsd:documentation>
                Indicates whether the name part is a given name, family name, prefix, suffix, etc.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="qualifier" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                The qualifier is a set of codes each of which specifies a certain subcategory of the name part in addition to the main name part type. For example, a given name may be flagged as a nickname, a family name may be a pseudonym or a name of public records
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_EntityNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_EntityNamePartType">
      <xsd:restriction base="cs">
        <xsd:enumeration value="FAM"/>
        <xsd:enumeration value="GIV"/>
        <xsd:enumeration value="PFX"/>
        <xsd:enumeration value="SFX"/>
        <xsd:enumeration value="DEL"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:simpleType name="cs_EntityNameUse">
      <xsd:restriction base="cs">
        <xsd:enumeration value="L"/>
        <xsd:enumeration value="A"/>
        <xsd:enumeration value="I"/>
        <xsd:enumeration value="R"/>
        <xsd:enumeration value="ABC"/>
        <xsd:enumeration value="SYL"/>
        <xsd:enumeration value="IDE"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="EN" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A name for a person, organization, place or thing. A sequence of name parts, such as first name or family name, prefix, suffix, etc. Examples for entity name values are "Jim Bob Walton, Jr.", "Health Level Seven, Inc.", "Lake Tahoe", etc. An entity name may be as simple as a character string or may consist of several entity name parts, such as, "Jim", "Bob", "Walton", and "Jr.", "Health Level Seven" and "Inc.", "Lake" and "Tahoe".
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ANY">
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded">
              <xsd:element name="delimiter">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ENXP">
                      <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="DEL"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="family">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ENXP">
                      <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="FAM"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="given">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ENXP">
                      <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="GIV"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="prefix">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ENXP">
                      <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="PFX"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="suffix">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ENXP">
                      <xsd:attribute name="partType" type="cs_EntityNamePartType" fixed="SFX"/>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
            </xsd:choice>
            <xsd:element name="validTime" minOccurs="0" maxOccurs="1">
              <xsd:annotation>
                <xsd:documentation>
                  An interval of time specifying the time during which the name is or was used for the entity. This accomodates the fact that people change names for people, places and things.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
              <gsd:template as="type" name="IVL">
                <gsd:withParam name="T" type="TS"/>
              </gsd:template>
            </xsd:element>
          </xsd:sequence>
          <xsd:attribute name="use" use="optional">
            <xsd:annotation>
              <xsd:documentation>
                A set of codes advising a system or user which name in a set of like addresses to select for a given purpose. A name without specific use code might be a default name useful for any purpose, but a name with a specific use code would be preferred for that respective purpose.
              </xsd:documentation>
              <xsd:appinfo/>
            </xsd:annotation>
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_EntityNameUse"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_PersonNamePartQualifier">
      <xsd:restriction base="cs_EntityNamePartQualifier">
        <xsd:enumeration value="BR"/>
        <xsd:enumeration value="SP"/>
        <xsd:enumeration value="VV"/>
        <xsd:enumeration value="AC"/>
        <xsd:enumeration value="PR"/>
        <xsd:enumeration value="NB"/>
        <xsd:enumeration value="CL"/>
        <xsd:enumeration value="IN"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="PNXP" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A restriction of entity name part that only allows those entity name parts qualifiers applicable to person names. Since the structure of entity name is mostly determined by the requirements of person name, the restriction is very minor.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ST">
          <xsd:attribute name="partType" type="cs_PersonNamePartType">
            <xsd:annotation>
              <xsd:documentation/>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="qualifier" use="optional">
            <xsd:annotation>
              <xsd:documentation/>
              <xsd:appinfo/>
            </xsd:annotation>
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_PersonNamePartType">
      <xsd:restriction base="cs_EntityNamePartType">
        <xsd:enumeration value="FAM"/>
        <xsd:enumeration value="GIV"/>
        <xsd:enumeration value="PFX"/>
        <xsd:enumeration value="SFX"/>
        <xsd:enumeration value="DEL"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="PN" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A name for a person. A sequence of name parts, such as first name or family name, prefix, suffix, etc.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="EN">
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded">
              <xsd:element name="delimiter">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="PNXP">
                      <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="DEL"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="family">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="PNXP">
                      <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="FAM"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="given">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="PNXP">
                      <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="GIV"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="prefix">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="PNXP">
                      <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="PFX"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="suffix">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="PNXP">
                      <xsd:attribute name="partType" type="cs_PersonNamePartType" fixed="SFX"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_PersonNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_OrganizationNamePartQualifier">
      <xsd:restriction base="cs_EntityNamePartQualifier">
        <xsd:enumeration value="LS"/>
        <xsd:enumeration value="CL"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="ONXP" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A restriction of entity name part that only allows those entity name parts qualifiers applicable to organization names.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:extension base="ST">
          <xsd:attribute name="partType" type="cs_OrganizationNamePartType">
            <xsd:annotation>
              <xsd:documentation/>
              <xsd:appinfo/>
            </xsd:annotation>
          </xsd:attribute>
          <xsd:attribute name="qualifier" use="optional">
            <xsd:annotation>
              <xsd:documentation/>
              <xsd:appinfo/>
            </xsd:annotation>
            <gsd:template as="type" name="set">
              <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
            </gsd:template>
          </xsd:attribute>
        </xsd:extension>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:simpleType name="cs_OrganizationNamePartType">
      <xsd:restriction base="cs_EntityNamePartType">
        <xsd:enumeration value="PFX"/>
        <xsd:enumeration value="SFX"/>
        <xsd:enumeration value="DEL"/>
      </xsd:restriction>
    </xsd:simpleType>
    <xsd:complexType name="ON" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A name for an organization. A sequence of name parts.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="EN">
          <xsd:sequence>
            <xsd:choice minOccurs="0" maxOccurs="unbounded">
              <xsd:element name="delimiter">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ONXP">
                      <xsd:attribute name="partType" type="cs_OrganizationNamePartType" fixed="DEL"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="prefix">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ONXP">
                      <xsd:attribute name="partType" type="cs_OrganizationNamePartType" fixed="PFX"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
              <xsd:element name="suffix">
                <xsd:complexType mixed="true">
                  <xsd:complexContent>
                    <xsd:restriction base="ONXP">
                      <xsd:attribute name="partType" type="cs_OrganizationNamePartType" fixed="SFX"/>
                      <xsd:attribute name="qualifier">
                        <gsd:template as="type" name="set">
                          <gsd:withParam name="T" type="cs_OrganizationNamePartQualifier"/>
                        </gsd:template>
                      </xsd:attribute>
                    </xsd:restriction>
                  </xsd:complexContent>
                </xsd:complexType>
              </xsd:element>
            </xsd:choice>
          </xsd:sequence>
        </xsd:restriction>
      </xsd:complexContent>
    </xsd:complexType>
    <xsd:complexType name="TN" mixed="true">
      <xsd:annotation>
        <xsd:documentation>
          A restriction of entity name that is effectively a simple string used for a simple name for things and places.
        </xsd:documentation>
        <xsd:appinfo/>
      </xsd:annotation>
      <xsd:complexContent>
        <xsd:restriction base="EN">
          <xsd:sequence>
            </xsd:sequence>
          </xsd:restriction>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:complexType name="QTY" abstract="true">
        <xsd:annotation>
          <xsd:documentation>
            The quantity data type is an abstract generalization for all data types (1) whose value set has an order relation (less-or-equal) and (2) where difference is defined in all of the data type's totally ordered value subsets. The quantity type abstraction is needed in defining certain other types, such as the interval and the probability distribution.
          </xsd:documentation>
          <xsd:appinfo>
            <diff>
              QTY
            </diff>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="ANY"/>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:simpleType name="int">
        <xsd:annotation>
          <xsd:documentation>
            Integer numbers (-1,0,1,2, 100, 3398129, etc.) are precise numbers that are results of counting and enumerating. Integer numbers are discrete, the set of integers is infinite but countable. No arbitrary limit is imposed on the range of integer numbers. Two NULL flavors are defined for the positive and negative infinity.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <xsd:restriction base="xsd:integer"/>
      </xsd:simpleType>
      <xsd:complexType name="INT">
        <xsd:annotation>
          <xsd:documentation>
            Integer numbers (-1,0,1,2, 100, 3398129, etc.) are precise numbers that are results of counting and enumerating. Integer numbers are discrete, the set of integers is infinite but countable. No arbitrary limit is imposed on the range of integer numbers. Two NULL flavors are defined for the positive and negative infinity.
          </xsd:documentation>
          <xsd:appinfo>
            <diff>
              INT
            </diff>
            <hl7:pr assert="(@value or @nullFlavor) and not(@value and @nullFlavor)"/>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="QTY">
            <xsd:attribute name="value" use="optional" type="int"/>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:simpleType name="real">
        <xsd:annotation>
          <xsd:documentation>
            Fractional numbers. Typically used whenever quantities are measured, estimated, or computed from other real numbers. The typical representation is decimal, where the number of significant decimal digits is known as the precision. Real numbers are needed beyond integers whenever quantities of the real world are measured, estimated, or computed from other real numbers. The term "Real number" in this specification is used to mean that fractional values are covered without necessarily implying the full set of the mathematical real numbers.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <xsd:union>
          <xsd:simpleType>
            <xsd:restriction base="xsd:decimal"/>
          </xsd:simpleType>
          <xsd:simpleType>
            <xsd:restriction base="xsd:double"/>
          </xsd:simpleType>
        </xsd:union>
      </xsd:simpleType>
      <xsd:complexType name="REAL">
        <xsd:annotation>
          <xsd:documentation>
            Fractional numbers. Typically used whenever quantities are measured, estimated, or computed from other real numbers. The typical representation is decimal, where the number of significant decimal digits is known as the precision. Real numbers are needed beyond integers whenever quantities of the real world are measured, estimated, or computed from other real numbers. The term "Real number" in this specification is used to mean that fractional values are covered without necessarily implying the full set of the mathematical real numbers.
          </xsd:documentation>
          <xsd:appinfo>
            <diff>
              REAL
            </diff>
            <hl7:pr assert="(@nullFlavor or @value) and not(@nullFlavor and @value)"/>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="QTY">
            <xsd:attribute name="value" use="optional" type="real"/>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:complexType name="PQR">
        <xsd:annotation>
          <xsd:documentation>
            A representation of a physical quantity in a unit from any code system. Used to show alternative representation for a physical quantity.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="CV">
            <xsd:attribute name="value" type="real" use="optional">
              <xsd:annotation>
                <xsd:documentation>
                  The magnitude of the measurement value in terms of the unit specified in the code.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:attribute>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:complexType name="PQ">
        <xsd:annotation>
          <xsd:documentation>
            A dimensioned quantity expressing the result of a measurement act.
          </xsd:documentation>
          <xsd:appinfo>
            <diff>
              PQ
            </diff>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="QTY">
            <xsd:sequence>
              <xsd:element name="translation" type="PQR" minOccurs="0" maxOccurs="unbounded">
                <xsd:annotation>
                  <xsd:documentation>
                    An alternative representation of the same physical quantity expressed in a different unit, of a different unit code system and possibly with a different value.
                  </xsd:documentation>
                  <xsd:appinfo/>
                </xsd:annotation>
              </xsd:element>
            </xsd:sequence>
            <xsd:attribute name="value" type="real" use="optional">
              <xsd:annotation>
                <xsd:documentation>
                  The magnitude of the quantity measured in terms of the unit.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:attribute>
            <xsd:attribute name="unit" type="cs" use="optional" default="1">
              <xsd:annotation>
                <xsd:documentation>
                  The unit of measure specified in the Unified Code for Units of Measure (UCUM) [].
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:attribute>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:complexType name="MO">
        <xsd:annotation>
          <xsd:documentation>
            A monetary amount is a quantity expressing the amount of money in some currency. Currencies are the units in which monetary amounts are denominated in different economic regions. While the monetary amount is a single kind of quantity (money) the exchange rates between the different units are variable. This is the principle difference between physical quantity and monetary amounts, and the reason why currency units are not physical units.
          </xsd:documentation>
          <xsd:appinfo>
            <diff>
              MO
            </diff>
            <hl7:pr assert="not(@nullFlavor and (@value or @currency))"/>
          </xsd:appinfo>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension base="QTY">
            <xsd:attribute name="value" type="real" use="optional">
              <xsd:annotation>
                <xsd:documentation>
                  The magnitude of the monetary amount in terms of the currency unit.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:attribute>
            <xsd:attribute name="currency" type="cs_Currency" use="optional">
              <xsd:annotation>
                <xsd:documentation>
                  The currency unit as defined in ISO 4217.
                </xsd:documentation>
                <xsd:appinfo/>
              </xsd:annotation>
            </xsd:attribute>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
      <xsd:simpleType name="cs_Currency">
        <xsd:restriction base="cs">
          <xsd:enumeration value="ARS"/>
          <xsd:enumeration value="AUD"/>
          <xsd:enumeration value="ATS"/>
          <xsd:enumeration value="BEF"/>
          <xsd:enumeration value="BRL"/>
          <xsd:enumeration value="CAD"/>
          <xsd:enumeration value="CLF"/>
          <xsd:enumeration value="CNY"/>
          <xsd:enumeration value="CUP"/>
          <xsd:enumeration value="EUR"/>
          <xsd:enumeration value="XEU"/>
          <xsd:enumeration value="FIM"/>
          <xsd:enumeration value="FRF"/>
          <xsd:enumeration value="DEM"/>
          <xsd:enumeration value="INR"/>
          <xsd:enumeration value="ILS"/>
          <xsd:enumeration value="JPY"/>
          <xsd:enumeration value="KRW"/>
          <xsd:enumeration value="LUF"/>
          <xsd:enumeration value="MXN"/>
          <xsd:enumeration value="NLG"/>
          <xsd:enumeration value="NZD"/>
          <xsd:enumeration value="NOK"/>
          <xsd:enumeration value="PHP"/>
          <xsd:enumeration value="RUR"/>
          <xsd:enumeration value="SGD"/>
          <xsd:enumeration value="ZAR"/>
          <xsd:enumeration value="ESP"/>
          <xsd:enumeration value="SEK"/>
          <xsd:enumeration value="CHF"/>
          <xsd:enumeration value="THB"/>
          <xsd:enumeration value="TWD"/>
          <xsd:enumeration value="TRL"/>
          <xsd:enumeration value="GBP"/>
          <xsd:enumeration value="USD"/>
        </xsd:restriction>
      </xsd:simpleType>
      <gsd:template name="RTO">
        <xsd:annotation>
          <xsd:documentation>
            A quantity constructed as the quotient of a numerator quantity divided by a denominator quantity. Common factors in the numerator and denominator are not automatically cancelled out. The data type supports titers (e.g., "1:128") and other quantities produced by laboratories that truly represent ratios. Ratios are not simply "structured numerics", particularly blood pressure measurements (e.g. "120/60") are not ratios. In many cases the should be used instead of the .
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="N" type="QTY"/>
        <gsd:param name="D" type="QTY"/>
        <xsd:complexType>
          <xsd:annotation>
            <xsd:appinfo>
              <diff>
                <gsd:template as="text()" name="RTO">
                  <gsd:withParam name="N">
                    <gsd:attribute name="type" type="N"/>
                  </gsd:withParam>
                  <gsd:withParam name="D">
                    <gsd:attribute name="type" type="D"/>
                  </gsd:withParam>
                </gsd:template>
              </diff>
            </xsd:appinfo>
          </xsd:annotation>
          <xsd:complexContent>
            <xsd:extension base="QTY">
              <xsd:sequence>
                <xsd:element name="numerator">
                  <xsd:annotation>
                    <xsd:documentation>
                      The quantity that is being devided in the ratio. The default is the integer number 1 (one.)
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <xsd:complexType>
                    <xsd:complexContent>
                      <xsd:restriction>
                        <gsd:attribute name="base" type="N"/>
                        <xsd:attribute name="value" default="1"/>
                      </xsd:restriction>
                    </xsd:complexContent>
                  </xsd:complexType>
                </xsd:element>
                <xsd:element name="denominator">
                  <xsd:annotation>
                    <xsd:documentation>
                      The quantity that devides the numerator in the ratio. The default is the integer number 1 (one.) The denominator must not be zero.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <xsd:complexType>
                    <xsd:complexContent>
                      <xsd:restriction>
                        <gsd:attribute name="base" type="D"/>
                        <xsd:attribute name="value" default="1"/>
                      </xsd:restriction>
                    </xsd:complexContent>
                  </xsd:complexType>
                </xsd:element>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <xsd:complexType name="RTO">
        <xsd:annotation>
          <xsd:documentation>
            A quantity constructed as the quotient of a numerator quantity divided by a denominator quantity. Common factors in the numerator and denominator are not automatically cancelled out. The data type supports titers (e.g., "1:128") and other quantities produced by laboratories that truly represent ratios. Ratios are not simply "structured numerics", particularly blood pressure measurements (e.g. "120/60") are not ratios. In many cases the should be used instead of the .
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <xsd:complexContent>
          <xsd:extension>
            <gsd:template as="base" name="RTO">
              <gsd:withParam name="N" type="QTY"/>
              <gsd:withParam name="D" type="QTY"/>
            </gsd:template>
          </xsd:extension>
        </xsd:complexContent>
      </xsd:complexType>
      <gsd:template name="list">
        <xsd:annotation>
          <xsd:documentation>
            A value that contains other discrete values in a defined sequence.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:simpleType>
          <xsd:list>
            <gsd:attribute name="itemType" type="T"/>
          </xsd:list>
        </xsd:simpleType>
      </gsd:template>
      <gsd:template name="bag">
        <xsd:annotation>
          <xsd:documentation>
            An unordered collection of values, where each value can be contained more than once in the bag.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:simpleType>
          <xsd:list>
            <gsd:attribute name="itemType" type="T"/>
          </xsd:list>
        </xsd:simpleType>
      </gsd:template>
      <gsd:template name="BXIT">
        <xsd:annotation>
          <xsd:documentation>
            A generic data type extension that represents a collection of a certain number of identical items in a bag.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:attribute name="base" type="T"/>
              <xsd:attribute name="qty" type="int" use="optional" default="1">
                <xsd:annotation>
                  <xsd:documentation>
                    The quantity in which the bag item occurs in its containing bag.
                  </xsd:documentation>
                  <xsd:appinfo/>
                </xsd:annotation>
              </xsd:attribute>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="set">
        <xsd:annotation>
          <xsd:documentation>
            A value that contains other distinct values in no particular order.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:simpleType>
          <xsd:list>
            <gsd:attribute name="itemType" type="T"/>
          </xsd:list>
        </xsd:simpleType>
      </gsd:template>
      <xsd:simpleType name="cs_SetOperator">
        <xsd:restriction base="cs">
          <xsd:enumeration value="I"/>
          <xsd:enumeration value="E"/>
          <xsd:enumeration value="A"/>
          <xsd:enumeration value="H"/>
          <xsd:enumeration value="PH"/>
        </xsd:restriction>
      </xsd:simpleType>
      <gsd:template name="SXCM">
        <xsd:annotation>
          <xsd:documentation>
            An ITS-defined generic type extension for the base data type of a set, representing a component of a general set over a discrete or continuous value domain. It's use is mainly for continuous value domains. Discrete (enumerable) set components are the individual elements of the base data type.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:attribute name="base" type="T"/>
              <xsd:attribute name="operator" type="cs_SetOperator" use="optional" default="I">
                <xsd:annotation>
                  <xsd:documentation>
                    A code specifying whether the set component is included (union) or excluded (set-difference) from the set, or other set operations with the current set component and the set as constructed from the representation stream up to the current point.
                  </xsd:documentation>
                  <xsd:appinfo/>
                </xsd:annotation>
              </xsd:attribute>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="IVL">
        <xsd:annotation>
          <xsd:documentation>
            A set of consecutive values of an ordered base data type.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="QTY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:template as="base" name="SXCM">
                <gsd:withParam name="T">
                  <gsd:attribute name="type" type="T"/>
                </gsd:withParam>
              </gsd:template>
              <xsd:choice minOccurs="0">
                <xsd:sequence>
                  <xsd:element name="low" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The low limit of the interval.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <xsd:complexType>
                      <xsd:complexContent>
                        <xsd:extension>
                          <gsd:attribute name="base" type="T"/>
                          <xsd:attribute name="inclusive" type="bl" use="optional" default="true">
                            <xsd:annotation>
                              <xsd:documentation>
                                Specifies whether the low limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
                              </xsd:documentation>
                              <xsd:appinfo/>
                            </xsd:annotation>
                          </xsd:attribute>
                        </xsd:extension>
                      </xsd:complexContent>
                    </xsd:complexType>
                  </xsd:element>
                  <xsd:element name="high" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The high limit of the interval.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <xsd:complexType>
                      <xsd:complexContent>
                        <xsd:extension>
                          <gsd:attribute name="base" type="T"/>
                          <xsd:attribute name="inclusive" type="bl" use="optional" default="true">
                            <xsd:annotation>
                              <xsd:documentation>
                                Specifies whether the high limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
                              </xsd:documentation>
                              <xsd:appinfo/>
                            </xsd:annotation>
                          </xsd:attribute>
                        </xsd:extension>
                      </xsd:complexContent>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="low" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The low limit of the interval.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <xsd:complexType>
                      <xsd:complexContent>
                        <xsd:extension>
                          <gsd:attribute name="base" type="T"/>
                          <xsd:attribute name="inclusive" type="bl" use="optional" default="true">
                            <xsd:annotation>
                              <xsd:documentation>
                                Specifies whether the low limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
                              </xsd:documentation>
                              <xsd:appinfo/>
                            </xsd:annotation>
                          </xsd:attribute>
                        </xsd:extension>
                      </xsd:complexContent>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="high" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The high limit of the interval.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <xsd:complexType>
                      <xsd:complexContent>
                        <xsd:extension>
                          <gsd:attribute name="base" type="T"/>
                          <xsd:attribute name="inclusive" type="bl" use="optional" default="true">
                            <xsd:annotation>
                              <xsd:documentation>
                                Specifies whether the high limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
                              </xsd:documentation>
                              <xsd:appinfo/>
                            </xsd:annotation>
                          </xsd:attribute>
                        </xsd:extension>
                      </xsd:complexContent>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="low" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The low limit of the interval.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <xsd:complexType>
                      <xsd:complexContent>
                        <xsd:extension>
                          <gsd:attribute name="base" type="T"/>
                          <xsd:attribute name="inclusive" type="bl" use="optional" default="true">
                            <xsd:annotation>
                              <xsd:documentation>
                                Specifies whether the low limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
                              </xsd:documentation>
                              <xsd:appinfo/>
                            </xsd:annotation>
                          </xsd:attribute>
                        </xsd:extension>
                      </xsd:complexContent>
                    </xsd:complexType>
                  </xsd:element>
                  <xsd:element name="width" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The difference between high and low boundary. The purpose of distinguishing a width property is to handle all cases of incomplete information symmetrically. In any interval representation only two of the three properties high, low, and width need to be stated and the third can be derived.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <gsd:attribute name="type" type="T" prop="diff"/>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="width" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The difference between high and low boundary. The purpose of distinguishing a width property is to handle all cases of incomplete information symmetrically. In any interval representation only two of the three properties high, low, and width need to be stated and the third can be derived.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <gsd:attribute name="type" type="T" prop="diff"/>
                  </xsd:element>
                  <xsd:element name="high" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The high limit of the interval.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <xsd:complexType>
                      <xsd:complexContent>
                        <xsd:extension>
                          <gsd:attribute name="base" type="T"/>
                          <xsd:attribute name="inclusive" type="bl" use="optional" default="true">
                            <xsd:annotation>
                              <xsd:documentation>
                                Specifies whether the high limit is included in the interval (interval is closed) or excluded from the interval (interval is open).
                              </xsd:documentation>
                              <xsd:appinfo/>
                            </xsd:annotation>
                          </xsd:attribute>
                        </xsd:extension>
                      </xsd:complexContent>
                    </xsd:complexType>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="center" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The arithmetic mean of the interval (low plus high divided by 2). The purpose of distinguishing the center as a semantic property is for conversions of intervals from and to point values.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <gsd:attribute name="type" type="T"/>
                  </xsd:element>
                  <xsd:element name="width" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The difference between high and low boundary. The purpose of distinguishing a width property is to handle all cases of incomplete information symmetrically. In any interval representation only two of the three properties high, low, and width need to be stated and the third can be derived.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <gsd:attribute name="type" type="T" prop="diff"/>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="center" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The arithmetic mean of the interval (low plus high divided by 2). The purpose of distinguishing the center as a semantic property is for conversions of intervals from and to point values.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <gsd:attribute name="type" type="T"/>
                  </xsd:element>
                </xsd:sequence>
                <xsd:sequence>
                  <xsd:element name="width" minOccurs="1" maxOccurs="1">
                    <xsd:annotation>
                      <xsd:documentation>
                        The difference between high and low boundary. The purpose of distinguishing a width property is to handle all cases of incomplete information symmetrically. In any interval representation only two of the three properties high, low, and width need to be stated and the third can be derived.
                      </xsd:documentation>
                      <xsd:appinfo/>
                    </xsd:annotation>
                    <gsd:attribute name="type" type="T" prop="diff"/>
                  </xsd:element>
                </xsd:sequence>
              </xsd:choice>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="HXIT">
        <xsd:annotation>
          <xsd:documentation>
            A generic data type extension that tags a time range to any data value of any data type. The time range is the time in which the information represented by the value is (was) valid.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:attribute name="base" type="T"/>
              <xsd:sequence>
                <xsd:element name="validTime" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation>
                      The time interval during which the given information was, is, or is expected to be valid. The interval can be open or closed infinite or undefined on either side.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <gsd:template name="IVL" as="type">
                    <gsd:withParam name="T" type="TS"/>
                  </gsd:template>
                </xsd:element>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="UVN">
        <xsd:annotation>
          <xsd:documentation>
            A generic data type extension to specify one uncertain value tagged with a coded confidence qualifier.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extends>
              <gsd:attribute name="base" type="T"/>
              <xsd:sequence>
                <xsd:element name="confidence" type="CE" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation>
                      A coded representation of the confidence as used in narrative utterances, such as "probably", "likely", "may be", "would be supported", "consistent with", "approximately", etc.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                </xsd:element>
              </xsd:sequence>
            </xsd:extends>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="UVP">
        <xsd:annotation>
          <xsd:documentation>
            A generic data type extension used to specify a probability expressing the information producer's belief that the given value holds.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:attribute name="base" type="T"/>
              <xsd:sequence>
                <xsd:attribute name="probability">
                  <xsd:annotation>
                    <xsd:documentation>
                      The probability assigned to the value, a decimal number between 0 (very uncertain) and 1 (certain).
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <xsd:simpleType>
                    <xsd:restriction base="real">
                      <xsd:minInclusive value="0.0"/>
                      <xsd:maxInclusive value="1.0"/>
                    </xsd:restriction>
                  </xsd:simpleType>
                </xsd:attribute>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="PPD">
        <xsd:annotation>
          <xsd:documentation>
            A generic data type extension specifying uncertainty of quantitative data using a distribution function and its parameters. Aside from the specific parameters of the distribution, a mean (expected value) and standard deviation is always given to help maintain a minimum layer of interoperability if receiving applications cannot deal with a certain probability distribution.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="QTY"/>
        <xsd:complexType>
          <xsd:annotation>
            <xsd:appinfo>
              <diff>
                <gsd:template as="text()" name="PPD">
                  <gsd:withParam name="T">
                    <gsd:attribute name="type" type="T" prop="diff"/>
                  </gsd:withParam>
                </gsd:template>
              </diff>
            </xsd:appinfo>
          </xsd:annotation>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:attribute name="base" type="T"/>
              <xsd:sequence>
                <xsd:element name="standardDeviation" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation>
                      The primary measure of variance/uncertainty of the value (the square root of the sum of the squares of the differences between all data points and the mean). The standard deviation is used to normalize the data for computing the distribution function. Applications that cannot deal with probability distributions can still get an idea about the confidence level by looking at the standard deviation.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <gsd:attribute name="type" type="T" prop="diff"/>
                </xsd:element>
              </xsd:sequence>
              <xsd:attribute name="distributionType" type="cs_ProbabilityDistributionType" use="optional">
                <xsd:annotation>
                  <xsd:documentation>
                    A code specifying the type of probability distribution. Possible values are as shown in the attached table. The NULL value (unknown) for the type code indicates that the probability distribution type is unknown. In that case, the standard deviation has the meaning of an informal guess.
                  </xsd:documentation>
                  <xsd:appinfo/>
                </xsd:annotation>
              </xsd:attribute>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <xsd:simpleType name="cs_ProbabilityDistributionType">
        <xsd:restriction base="cs">
          <xsd:enumeration value="U"/>
          <xsd:enumeration value="N"/>
          <xsd:enumeration value="LN"/>
          <xsd:enumeration value="G"/>
          <xsd:enumeration value="E"/>
          <xsd:enumeration value="X2"/>
          <xsd:enumeration value="T"/>
          <xsd:enumeration value="F"/>
          <xsd:enumeration value="B"/>
        </xsd:restriction>
      </xsd:simpleType>
      <xsd:simpleType name="cs_CalendarCycle">
        <xsd:restriction base="cs">
          <xsd:enumeration value="CY"/>
          <xsd:enumeration value="MY"/>
          <xsd:enumeration value="CM"/>
          <xsd:enumeration value="CW"/>
          <xsd:enumeration value="WY"/>
          <xsd:enumeration value="DM"/>
          <xsd:enumeration value="CD"/>
          <xsd:enumeration value="DY"/>
          <xsd:enumeration value="DW"/>
          <xsd:enumeration value="HD"/>
          <xsd:enumeration value="CH"/>
          <xsd:enumeration value="NH"/>
          <xsd:enumeration value="CN"/>
          <xsd:enumeration value="SN"/>
          <xsd:enumeration value="CS"/>
        </xsd:restriction>
      </xsd:simpleType>
      <gsd:template name="PIVL">
        <xsd:annotation>
          <xsd:documentation>
            An interval of time that recurs periodically. Periodic intervals have two properties, phase and period. The phase specifies the "interval prototype" that is repeated every period.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="TS"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:template as="base" name="SXCM">
                <gsd:withParam name="T">
                  <gsd:attribute name="type" type="T"/>
                </gsd:withParam>
              </gsd:template>
              <xsd:sequence>
                <xsd:element name="phase" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation>
                      A prototype of the repeating interval specifying the duration of each occurrence and anchors the periodic interval sequence at a certain point in time.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <gsd:template as="type" name="IVL">
                    <gsd:withParam name="T">
                      <gsd:attribute name="type" type="T"/>
                    </gsd:withParam>
                  </gsd:template>
                </xsd:element>
                <xsd:element name="period" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation>
                      A time duration specifying as a reciprocal measure of the frequency at which the periodic interval repeats.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <gsd:attribute name="type" type="T" prop="diff"/>
                </xsd:element>
              </xsd:sequence>
              <xsd:attribute name="alignment" type="cs_CalendarCycle" use="optional">
                <xsd:annotation>
                  <xsd:documentation>
                    Specifies if and how the repetitions are aligned to the cycles of the underlying calendar (e.g., to distinguish every 30 days from "the 5th of every month".) A non-aligned periodic interval recurs independently from the calendar. An aligned periodic interval is synchronized with the calendar.
                  </xsd:documentation>
                  <xsd:appinfo/>
                </xsd:annotation>
              </xsd:attribute>
              <xsd:attribute name="institutionSpecified" type="bl" use="optional" default="false">
                <xsd:annotation>
                  <xsd:documentation>
                    Indicates whether the exact timing is up to the party executing the schedule (e.g., to distinguish "every 8 hours" from "3 times a day".)
                  </xsd:documentation>
                  <xsd:appinfo/>
                </xsd:annotation>
              </xsd:attribute>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <xsd:simpleType name="cs_TimingEvent">
        <xsd:restriction base="cs">
          <xsd:enumeration value="CY"/>
          <xsd:enumeration value="MY"/>
          <xsd:enumeration value="CM"/>
          <xsd:enumeration value="CW"/>
          <xsd:enumeration value="WY"/>
          <xsd:enumeration value="DM"/>
          <xsd:enumeration value="CD"/>
          <xsd:enumeration value="DY"/>
          <xsd:enumeration value="DW"/>
          <xsd:enumeration value="HD"/>
          <xsd:enumeration value="CH"/>
          <xsd:enumeration value="NH"/>
          <xsd:enumeration value="CN"/>
          <xsd:enumeration value="SN"/>
          <xsd:enumeration value="CS"/>
        </xsd:restriction>
      </xsd:simpleType>
      <gsd:template name="EIVL">
        <xsd:annotation>
          <xsd:documentation>
            Specifies a periodic interval pf time where the recurrence is based on activities of daily living or other important events that are time-related but not fully determined by time.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:template as="base" name="SXCM">
                <gsd:withParam name="T">
                  <gsd:attribute name="type" type="T"/>
                </gsd:withParam>
              </gsd:template>
              <xsd:sequence>
                <xsd:element name="event" type="CE" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation/>
                    <xsd:appinfo/>
                  </xsd:annotation>
                </xsd:element>
                <xsd:element name="event" minOccurs="0" maxOccurs="1">
                  <xsd:annotation>
                    <xsd:documentation>
                      An interval of elapsed time (duration, not absolute point in time) that marks the offsets for the beginning, width and end of the event-related periodic interval measured from the time each such event actually occurred.
                    </xsd:documentation>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <gsd:template as="type" name="IVL">
                    <gsd:withParam name="T">
                      <gsd:attribute name="type" type="T" prop="diff"/>
                    </gsd:withParam>
                  </gsd:template>
                </xsd:element>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <gsd:template name="SXPR">
        <xsd:annotation>
          <xsd:documentation>
            A set-component that is itself made up of set-components that are evaluated as one value.
          </xsd:documentation>
          <xsd:appinfo/>
        </xsd:annotation>
        <gsd:param name="T" type="ANY"/>
        <xsd:complexType>
          <xsd:complexContent>
            <xsd:extension>
              <gsd:template as="base" name="SXCM">
                <gsd:withParam name="T">
                  <gsd:attribute name="type" type="T"/>
                </gsd:withParam>
              </gsd:template>
              <xsd:sequence>
                <xsd:element name="comp" minOccurs="2" maxOccurs="unbounded">
                  <xsd:annotation>
                    <xsd:documentation/>
                    <xsd:appinfo/>
                  </xsd:annotation>
                  <gsd:template as="type" name="SXCM">
                    <gsd:withParam name="T">
                      <gsd:attribute name="type" type="T"/>
                    </gsd:withParam>
                  </gsd:template>
                </xsd:element>
              </xsd:sequence>
            </xsd:extension>
          </xsd:complexContent>
        </xsd:complexType>
      </gsd:template>
      <xsd:element name="test">
        <xsd:complexType>
          <xsd:sequence>
            <xsd:element name="value" type="ANY" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="code" type="CD" minOccurs="0" maxOccurs="unbounded"/>
            <xsd:element name="pivl" minOccurs="0">
              <gsd:template as="type" name="PIVL">
                <gsd:withParam name="T" type="TS"/>
              </gsd:template>
            </xsd:element>
            <xsd:element name="ivl-ppd" minOccurs="0">
              <gsd:template as="type" name="PIVL">
                <gsd:withParam name="T">
                  <gsd:template as="type" name="PPD">
                    <gsd:withParam name="T" type="TS"/>
                  </gsd:template>
                </gsd:withParam>
              </gsd:template>
            </xsd:element>
            <xsd:element name="hxit" minOccurs="0">
              <gsd:template as="type" name="HXIT">
                <gsd:withParam name="T" type="PQ"/>
              </gsd:template>
            </xsd:element>
            <xsd:element name="codeitem" minOccurs="0" maxOccurs="unbounded">
              <gsd:template as="type" name="SXCM">
                <gsd:withParam name="T" type="CD"/>
              </gsd:template>
            </xsd:element>
            <xsd:element name="bxitem" minOccurs="0" maxOccurs="unbounded">
              <gsd:template as="type" name="BXIT">
                <gsd:withParam name="T" type="CD"/>
              </gsd:template>
            </xsd:element>
            <xsd:element name="timing" minOccurs="0" maxOccurs="unbounded">
              <gsd:template as="type" name="SXCM">
                <gsd:withParam name="T" type="TS"/>
              </gsd:template>
            </xsd:element>
            <xsd:element name="price" minOccurs="0">
              <gsd:template as="type" name="RTO">
                <gsd:withParam name="N" type="MO"/>
                <gsd:withParam name="D" type="PQ"/>
              </gsd:template>
            </xsd:element>
          </xsd:sequence>
        </xsd:complexType>
      </xsd:element>

      B

      Generic Schema Definition Transform

      Schema Fragment 204:
      <xsl:transform extension-element-prefixes="exsl" exclude-result-prefixes="xsd xsl exsl gsd" version="1.0">
        <xsl:strip-space elements="*"/>
        <xsl:output method="xml" indent="yes" encoding="UTF-8"/>
        <xsl:variable name="root" select="/"/>
        <xsl:template match="/|@*|node()">
          <xsl:param name="stack" select="/.."/>
          <xsl:copy>
            <xsl:apply-templates select="@*|node()">
              <xsl:with-param name="stack" select="$stack"/>
            </xsl:apply-templates>
          </xsl:copy>
        </xsl:template>
        <xsl:template match="xsd:schema">
          <xsl:param name="stack" select="/.."/>
          <xsl:comment>
            This schema is generated from a Generic Schema Definition (GSD) by gsd2xsl. Better not edit this file.
          </xsl:comment>
          <xsl:copy>
            <xsl:copy-of select="@*"/>
            <xsl:variable name="phase1rtf">
              <xsl:apply-templates mode="phase1">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
            </xsl:variable>
            <xsl:variable name="phase1" select="exsl:node-set($phase1rtf)"/>
            <xsl:apply-templates select="$phase1" mode="phase2">
              <xsl:with-param name="stack" select="$stack"/>
            </xsl:apply-templates>
          </xsl:copy>
        </xsl:template>
        <xsl:template match="/" mode="phase2">
          <xsl:param name="stack" select="/.."/>
          <xsl:copy>
            <xsl:apply-templates select="@*|node()" mode="phase2">
              <xsl:with-param name="stack" select="$stack"/>
            </xsl:apply-templates>
            <xsl:text>
              </xsl:text>
              <xsl:comment>
                Instantiated templates
              </xsl:comment>
              <xsl:call-template name="uniq">
                <xsl:with-param name="todo" select="//gsd:instantiation[node()]"/>
              </xsl:call-template>
            </xsl:copy>
          </xsl:template>
          <xsl:template match="@*|node()" mode="phase2">
            <xsl:param name="stack" select="/.."/>
            <xsl:copy>
              <xsl:apply-templates select="@*|node()" mode="phase2">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
          <xsl:template match="gsd:template" mode="phase2"/>
          <xsl:template match="gsd:instantiation" mode="phase2"/>
          <xsl:template name="uniq">
            <xsl:param name="todo" select="/.."/>
            <xsl:param name="done" select="/.."/>
            <xsl:variable name="car" select="$todo[position()=1]"/>
            <xsl:variable name="cdr" select="$todo[position()>1]"/>
            <xsl:if test="not($done[@name=$car/@name])">
              <xsl:apply-templates select="$car/*" mode="delninst"/>
            </xsl:if>
            <xsl:if test="$cdr">
              <xsl:call-template name="uniq">
                <xsl:with-param name="todo" select="$cdr"/>
                <xsl:with-param name="done" select="$car|$done"/>
              </xsl:call-template>
            </xsl:if>
          </xsl:template>
          <xsl:template match="/|@*|node()" mode="delninst">
            <xsl:copy>
              <xsl:apply-templates select="@*|node()" mode="delninst"/>
            </xsl:copy>
          </xsl:template>
          <xsl:template match="gsd:instantiation" mode="delninst"/>
          <xsl:template match="/|@*|node()" mode="phase1">
            <xsl:param name="stack" select="/.."/>
            <xsl:copy>
              <xsl:apply-templates select="@*|node()" mode="phase1">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
          <xsl:template match="*[child::gsd:template/@as]" priority="1" mode="phase1">
            <xsl:param name="stack" select="/.."/>
            <xsl:variable name="instRTF">
              <xsl:call-template name="use-template">
                <xsl:with-param name="stack" select="$stack"/>
                <xsl:with-param name="use" select="./gsd:template"/>
              </xsl:call-template>
            </xsl:variable>
            <xsl:variable name="inst" select="exsl:node-set($instRTF)/*"/>
            <xsl:copy-of select="$inst"/>
            <xsl:copy>
              <xsl:apply-templates mode="phase1" select="@*">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
              <xsl:attribute name="{./gsd:template/@as}">
                <xsl:value-of select="$inst/@spacename"/>
              </xsl:attribute>
              <xsl:apply-templates mode="phase1" select="node()[not(self::gsd:template)]">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
          <xsl:template match="*[child::gsd:template/@as='text()']" priority="1.5" mode="phase1">
            <xsl:param name="stack" select="/.."/>
            <xsl:variable name="instRTF">
              <xsl:call-template name="use-template">
                <xsl:with-param name="stack" select="$stack"/>
                <xsl:with-param name="use" select="./gsd:template"/>
              </xsl:call-template>
            </xsl:variable>
            <xsl:variable name="inst" select="exsl:node-set($instRTF)/*"/>
            <xsl:copy-of select="$inst"/>
            <xsl:copy>
              <xsl:apply-templates mode="phase1" select="@*">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
              <xsl:value-of select="$inst/@spacename"/>
              <xsl:apply-templates mode="phase1" select="node()[not(self::gsd:template)]">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
          <xsl:template name="use-template">
            <xsl:param name="stack" select="/.."/>
            <xsl:param name="use" select="/.."/>
            <xsl:variable name="fullName" select="$use/@name"/>
            <xsl:variable name="space" select="substring-before($fullName,':')"/>
            <xsl:variable name="name">
              <xsl:choose>
                <xsl:when test="$space">
                  <xsl:value-of select="substring-after($fullName,concat($space,':'))"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$fullName"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:variable name="definition" select="$root//gsd:template[@name=$name and not(@as)]"/>
            <xsl:if test="not($definition)">
              <xsl:message terminate="yes">
                <gsd:error>
                  Template definition could not be found. <gsd:template fullname="{$fullName}" name="{$name}"/>
                  <gsd:stack>
                    <xsl:copy-of select="$stack"/>
                  </gsd:stack>
                  <gsd:current>
                    <xsl:copy-of select="."/>
                  </gsd:current>
                </gsd:error>
              </xsl:message>
            </xsl:if>
            <xsl:variable name="istackRTF">
              <gsd:frame>
                <xsl:copy-of select="$use/@*"/>
                <xsl:apply-templates select="$use/gsd:withParam" mode="phase1">
                  <xsl:with-param name="stack" select="$stack"/>
                </xsl:apply-templates>
                <xsl:copy-of select="$stack"/>
              </gsd:frame>
            </xsl:variable>
            <xsl:variable name="istack" select="exsl:node-set($istackRTF)"/>
            <xsl:variable name="mangledName">
              <xsl:apply-templates select="$definition" mode="makename">
                <xsl:with-param name="stack" select="$istack"/>
                <xsl:with-param name="space" select="$space"/>
              </xsl:apply-templates>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="$stack//gsd:frame[@instantiating=$mangledName]">
                <gsd:instantiation name="{$mangledName}" spacename="{concat($space,':',$mangledName)}"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:variable name="stackRTF">
                  <gsd:frame instantiating="{$mangledName}">
                    <xsl:copy-of select="$istack/gsd:frame/@*"/>
                    <xsl:copy-of select="$istack/gsd:frame/node()"/>
                  </gsd:frame>
                </xsl:variable>
                <gsd:instantiation name="{$mangledName}">
                  <xsl:choose>
                    <xsl:when test="$space">
                      <xsl:attribute name="spacename">
                        <xsl:value-of select="concat($space,':',$mangledName)"/>
                      </xsl:attribute>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:attribute name="spacename">
                        <xsl:value-of select="$mangledName"/>
                      </xsl:attribute>
                    </xsl:otherwise>
                  </xsl:choose>
                  <xsl:apply-templates mode="instantiate" select="$definition">
                    <xsl:with-param name="stack" select="exsl:node-set($stackRTF)"/>
                    <xsl:with-param name="mangledName" select="$mangledName"/>
                  </xsl:apply-templates>
                  <xsl:copy-of select="$istack//gsd:instantiation"/>
                </gsd:instantiation>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:template>
          <xsl:template match="gsd:template[not(@as)]" mode="instantiate">
            <xsl:param name="stack" select="/.."/>
            <xsl:param name="mangledName" select="/.."/>
            <xsl:for-each select="*[not(self::gsd:param or self::xsd:annotation)]">
              <xsl:copy>
                <xsl:apply-templates select="@*" mode="phase1">
                  <xsl:with-param name="stack" select="$stack"/>
                </xsl:apply-templates>
                <xsl:attribute name="name">
                  <xsl:value-of select="$mangledName"/>
                </xsl:attribute>
                <xsl:apply-templates select="node()" mode="phase1">
                  <xsl:with-param name="stack" select="$stack"/>
                </xsl:apply-templates>
              </xsl:copy>
            </xsl:for-each>
          </xsl:template>
          <xsl:template match="gsd:template" mode="phase1"/>
          <xsl:template match="*[child::gsd:attribute]" mode="phase1">
            <xsl:param name="stack" select="/.."/>
            <xsl:copy>
              <xsl:apply-templates mode="phase1" select="@*">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
              <xsl:attribute name="{./gsd:attribute/@name}">
                <xsl:call-template name="get-type-or-property">
                  <xsl:with-param name="stack" select="$stack"/>
                  <xsl:with-param name="param" select="./gsd:attribute/@type"/>
                  <xsl:with-param name="prop" select="./gsd:attribute/@prop"/>
                </xsl:call-template>
              </xsl:attribute>
              <xsl:apply-templates mode="phase1" select="node()[not(self::gsd:attribute)]">
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:apply-templates>
            </xsl:copy>
          </xsl:template>
          <xsl:template match="gsd:value-of" mode="phase1">
            <xsl:param name="stack" select="/.."/>
            <xsl:call-template name="get-type-or-property">
              <xsl:with-param name="stack" select="$stack"/>
              <xsl:with-param name="param" select="@type"/>
              <xsl:with-param name="prop" select="@prop"/>
            </xsl:call-template>
          </xsl:template>
          <xsl:template name="get-type-or-property">
            <xsl:param name="stack" select="/.."/>
            <xsl:param name="param" select="/.."/>
            <xsl:param name="prop" select="/.."/>
            <xsl:if test="not($stack//gsd:withParam[@name=$param])">
              <xsl:message terminate="yes">
                <gsd:error>
                  Template parameter name not found on stack. <xsd:param name="{$param}"/>
                  <gsd:stack>
                    <xsl:copy-of select="$stack"/>
                  </gsd:stack>
                  <gsd:current>
                    <xsl:copy-of select="."/>
                  </gsd:current>
                </gsd:error>
              </xsl:message>
            </xsl:if>
            <xsl:variable name="type" select="$stack//gsd:withParam[@name=$param][1]/@type"/>
            <xsl:if test="not($type)">
              <xsl:message terminate="yes">
                <gsd:error>
                  Type is empty? <xsd:param name="{$param}"/>
                  <gsd:stack>
                    <xsl:copy-of select="$stack"/>
                  </gsd:stack>
                  <gsd:current>
                    <xsl:copy-of select="."/>
                  </gsd:current>
                </gsd:error>
              </xsl:message>
            </xsl:if>
            <xsl:variable name="space" select="substring-before($type,':')"/>
            <xsl:variable name="name">
              <xsl:choose>
                <xsl:when test="$space">
                  <xsl:value-of select="substring-after($type,concat($space,':'))"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:value-of select="$type"/>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="$prop">
                <xsl:variable name="ptype" select="$root//*[(self::xsd:complexType or self::xsd:simpleType) and @name=$name]/ xsd:annotation/xsd:appinfo/*[name(.)=$prop]"/>
                <xsl:variable name="pitype" select="$stack//*[self::gsd:instantiation and (child::xsd:complexType or child::xsd:simpleType) and @name=$name]/* /xsd:annotation/xsd:appinfo/*[name(.)=$prop]"/>
                <xsl:choose>
                  <xsl:when test="$ptype">
                    <xsl:value-of select="$ptype"/>
                  </xsl:when>
                  <xsl:when test="$pitype">
                    <xsl:value-of select="$pitype"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:message terminate="yes">
                      <gsd:error>
                        Type property not found or empty. <xsd:param name="{$param}"/>
                        <xsd:name name="{$name}"/>
                        <xsd:prop name="{$prop}"/>
                        <xsd:ptype name="{$ptype}"/>
                        <xsd:pitype name="{$pitype}"/>
                        <gsd:stack>
                          <xsl:copy-of select="$stack"/>
                        </gsd:stack>
                        <gsd:current>
                          <xsl:copy-of select="."/>
                        </gsd:current>
                      </gsd:error>
                    </xsl:message>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$type"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:template>
          <xsl:param name="LBRAC" select="'_'"/>
          <xsl:param name="RBRAC" select="''"/>
          <xsl:param name="DELIM" select="'_'"/>
          <xsl:template match="gsd:template" mode="makename">
            <xsl:param name="stack" select="/.."/>
            <xsl:param name="space" select="/.."/>
            <xsl:value-of select="@name"/>
            <xsl:value-of select="$LBRAC"/>
            <xsl:for-each select="./gsd:param[position()=1]">
              <xsl:call-template name="strip-check-namespace">
                <xsl:with-param name="param" select="@name"/>
                <xsl:with-param name="space" select="$space"/>
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:call-template>
            </xsl:for-each>
            <xsl:for-each select="./gsd:param[position()>1]">
              <xsl:value-of select="$DELIM"/>
              <xsl:call-template name="strip-check-namespace">
                <xsl:with-param name="param" select="@name"/>
                <xsl:with-param name="space" select="$space"/>
                <xsl:with-param name="stack" select="$stack"/>
              </xsl:call-template>
            </xsl:for-each>
            <xsl:value-of select="$RBRAC"/>
          </xsl:template>
          <xsl:template name="strip-check-namespace">
            <xsl:param name="space" select="/.."/>
            <xsl:param name="stack" select="/.."/>
            <xsl:param name="param" select="/.."/>
            <xsl:param name="ident" select="$stack//gsd:withParam[@name=$param][1]/@type"/>
            <xsl:if test="not($stack//gsd:withParam[@name=$param][1])">
              <xsl:message terminate="yes">
                <gsd:error>
                  Template parameter name not found on stack. <xsd:param name="{$param}"/>
                  <gsd:stack>
                    <xsl:copy-of select="$stack"/>
                  </gsd:stack>
                  <gsd:current>
                    <xsl:copy-of select="."/>
                  </gsd:current>
                </gsd:error>
              </xsl:message>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="$space and starts-with($ident,concat($space,':'))">
                <xsl:value-of select="substring-after($ident,':')"/>
              </xsl:when>
              <xsl:when test="not($space) and not(contains($ident,':'))">
                <xsl:value-of select="$ident"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:message terminate="yes">
                  <gsd:error>
                    All parameters of a generic type parameters must currently be of one and the same namespace, sorry. <xsd:namespace ident="{$ident}" expected="{$space}" found="{substring-before($ident,':')}"/>
                    <gsd:stack>
                      <xsl:copy-of select="$stack"/>
                    </gsd:stack>
                    <gsd:current>
                      <xsl:copy-of select="."/>
                    </gsd:current>
                  </gsd:error>
                </xsl:message>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:template>
        </xsl:transform>

        C

        A Test Element

        This element is defined only in order to test the schema out

        Schema Fragment 205:
        <xsd:element name="test">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="value" type="ANY" minOccurs="0" maxOccurs="unbounded"/>
              <xsd:element name="code" type="CD" minOccurs="0" maxOccurs="unbounded"/>
              <xsd:element name="pivl" minOccurs="0">
                <gsd:template as="type" name="PIVL">
                  <gsd:withParam name="T" type="TS"/>
                </gsd:template>
              </xsd:element>
              <xsd:element name="ivl-ppd" minOccurs="0">
                <gsd:template as="type" name="PIVL">
                  <gsd:withParam name="T">
                    <gsd:template as="type" name="PPD">
                      <gsd:withParam name="T" type="TS"/>
                    </gsd:template>
                  </gsd:withParam>
                </gsd:template>
              </xsd:element>
              <xsd:element name="hxit" minOccurs="0">
                <gsd:template as="type" name="HXIT">
                  <gsd:withParam name="T" type="PQ"/>
                </gsd:template>
              </xsd:element>
              <xsd:element name="codeitem" minOccurs="0" maxOccurs="unbounded">
                <gsd:template as="type" name="SXCM">
                  <gsd:withParam name="T" type="CD"/>
                </gsd:template>
              </xsd:element>
              <xsd:element name="bxitem" minOccurs="0" maxOccurs="unbounded">
                <gsd:template as="type" name="BXIT">
                  <gsd:withParam name="T" type="CD"/>
                </gsd:template>
              </xsd:element>
              <xsd:element name="timing" minOccurs="0" maxOccurs="unbounded">
                <gsd:template as="type" name="SXCM">
                  <gsd:withParam name="T" type="TS"/>
                </gsd:template>
              </xsd:element>
              <xsd:element name="price" minOccurs="0">
                <gsd:template as="type" name="RTO">
                  <gsd:withParam name="N" type="MO"/>
                  <gsd:withParam name="D" type="PQ"/>
                </gsd:template>
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>