#### PDS Mini Services
Domain Message Specification

### Data Types Specification

#### Introduction

This document gives guidance on the current data types in use in HSCIC interoperability specifications at the time of publication. It is not a complete HL7 data type definition (HL7 Ballot 2006 is the source if this is required) but more of a guide for implementers on how to utilise the data types in HL7 message instances. The overview of a data type therefore may not contain all elements or attributes as specified in the HL7 ballot.

Artefacts contained within this guidance fall into three types:

- HL7 V3 data types - Within this guidance, a [D] after the name indicates a data type. Note: one data type may be constrained by another data type.
- NHS England data type flavors (flavours) - Within this guidance, an [F] after the name indicates a data type flavor.
- NHS England data type extensions - Within this guidance, an [E] after the name indicates a data type extension

Descriptions for each of these artefacts are contained in the relevant following sections.

#### Attributes and Elements

The terms attribute and element can be a bit confusing as they can have different meanings whether the reference is to the HL7 V3 model or the XML instance. Therefore, within this guidance the following terms are used.

- HL7 V3 model attribute - this is an attribute as shown on a HL7 V3 model for example a patient class has a HL7 V3 "id" attribute to carry the NHS number.
- XML element - This is an actual XML element which may have attributes and/ or sub elements
- XML attribute - this is an actual XML attribute of an XML element.

To illustrate the reasons for this clarification see the example below:

A patient class in a HL7 V3 model has a HL7 V3 model attribute called "id", this equates to an XML element called "id" within the "on the wire" message instance and the XML element has XML "id" attributes called "root" and "extension".

#### Domain Specification Data Types

This document gives guidance at a data type level. There is an XML representation of each data type, and the schemas for these are in the file called datatypes.xsd. For some attributes, (for example address part type of element “addr”), as permitted by HL7 V3 regulations, UK-specific attribute values have been used rather than the standard HL7 V3 set.

The data types listed below are derived from the full HL7 V3 data types as these were defined in 2006 ballot - Normative version. There are some NHS England specific extensions contained in this guidance. For the full HL7 V3 2006 - Normative version documentation on data types, readers should consult the HL7 V3 Ballot pack. A data type is identified by [D] after the name.

#### HL7 and W3C Data Types

All HL7 data types were originally derived from the data types defined in the W3C schema recommendation. However, the HL7 data types were defined as those best suited to meet the requirements of healthcare messaging and this accounts for some of the differences between them and the native W3C XML Schema data types.

Some simple data types such as Boolean are restrictions on the W3C version, with the values "true and "false" being allowed, but not 0 and 1, which have proved a source of confusion in messaging implementations. Others are more loosely defined, such as TS (Time Stamp) which is implemented as a union of many of the W3C date/time data types.

Where a data type component is intended to be used externally its name is in capitals (e.g. TS), and where is intended only for use in as a part of another data type, the name is in lower case (e.g. center, low and high which is used by IVL_TS).

#### Data Type flavors

HL7 Version 3 provides a rich set of possible variants on a set of relatively complex data types. For the purposes of an individual specification, there may be a need to constrain a data type further. A data type that has been further constrained is a data type flavor (flavor). The flavors specified here are for a NHS England domain, or domains. Each of the permitted flavors is, specified in full, assigned a name and described in the section for the data type it constrains. A data type flavor is identified by [F] after the name. There are two types of flavors:

- A flavor that is defined in the datatypeflavors.xsd and therefore is enforced to some extent. This type of flavor will have a specific identifier (for example ON.NHS.OrganizationNameType1) as well as a name. Note: A message that uses a particular named data type flavor may not be always be bound to the flavor in the schema. This is more often in older messages where technical constraints with tooling mean it was not possible to bind the message schema to the data type flavor schema.
- A flavor that is defined in text within the tabular view or some associated guidance and will not have an identifier only a name.

#### Data Type Extensions

As stated above HL7 Version 3 provides a rich set of possible variants on a set of relatively complex data types. However, there is on rare occasions a need to extend data types for a very specific NHS use case.

This guidance describes the extensions made to the HL7 data types and gives rational for the need for the extension. The majority of these extensions were utilised in the early days of the National Programme when HL7 standard was still in its infancy. There was a desire at the time to get the extensions included into the HL7 standard. For multiple reasons some of the extensions have not made it into the HL7 standard. Therefore, these remain as NHS England specific extensions to the HL7 standard and are identified by [E] after the name.

#### Null flavors

Within the HL7 V3 standard, all classes and attributes support null flavor (nullFlavor). The “nullFlavor” attribute is a property of every data type through extension. The ”nullFlavor” attribute is valued and communicated as part of a message when information is missing. The ”nullFlavor” can provide the reason why the information is missing. For example:

An unconscious patient arrives at the hospital and during registration; there is an issue, as most Patient Administration systems need at least one address. If the patient address is unknown then the patient address field on the system records the value unknown. In a subsequent message, the address element "addr" can be set to a ”nullFlavor” of “UNK” and sent to other down stream systems or repositories.

Notes:

- A "nullFlavor” attribute is normally only usable if the HL7 V3 model attribute is not mandated. The individual data type descriptions may state a ”nullFlavor” is allowable. However, when a “nullFlavor” is utilised in a message instance then the schema and tabular view for the actual HL7 model attribute may expose other constraints of the actual usage of ”nullFlavor” with the data type.
- A "nullFlavor” is allowable instead of a value but not as well as a value
- The "nullFlavor” attribute never appears on the HL7 V3 model.

#### Guidance for Implementers

This data type guidance describes each data type, data type flavor and data type extension in use across the HSCIC Interoperability Domain Message Specifications. Implementers should be aware that the tabular view documentation along with the domain conformance schemas should be utilised when creating instances of messages for information on which XML elements or XML attributes are usable for a given message. When there is a conflict between the two definitions then the tabular view takes precedence

If there is no guidance provided for an XML element or XML attribute in the tabular view then there is no requirements for that XML element or XML attribute to be populated in an “on the wire” instance.

#### XML Examples

In the instance examples provided the xsi:type attribute is shown in the value elements of observation for completeness, the tabular views for the domain must be consulted as to whether the xsi:type should be included. When the tabular view does not give guidance of use of xsi:type then the recommendation is to include the xsi:type if the schema supports use of the xsi:type attribute.

###### Example 1:

    <value xsi:type="REAL" value="2.3"/>

###### Example 2: The examples also may have the end tags shown in one of two ways, this is to make it clearer when the XML element contains data or just XML attributes.

    <value xsi:type="REAL" value="2.3"/>

###### Example 3: or

    <value xsi:type="REAL" value="2.3"> </value>

#### Generic Collections

These are data values that comprise generic collections of data values of a single data type. Four concern us here: SET, BAG, LIST and IVL. These are documented later in this specifcation.

#### Address (AD) [D]

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | Must contain either the data only or child XML elements
addr/country | 0..1 | The country in which the property is located.
addr/state | 0..1 | The state or province in which the property is located.
addr/county | 0..1 | The county in which the property is located.
addr/city | 0..1 | The city in which the property is located.
addr/postalCode | 0..1 | The post code of the property.
addr/precinct | 0..1 | The precinct in which the property is located.
addr/streetAddressLine | 0..* | A street address line may represent any part of the address.
addr/houseNumber | 0..1 | The number of the property being represented.
addr/direction | 0..1 | Direction (e.g., N, S, W, E)
addr/streetName | 0..1 | The street name of the property being represented.
addr/additionalLocator | 0..1 | An additional locator used to assist in indicating the address.
addr/unitID | 0..1 | The number or name of a specific unit contained within a building or complex, as assigned by that building or complex.
addr/addresskey | 0..1 | This is a NHS England extension and is a unique identifier for the address, used where the recipient does not need to receive the full address (for example because the receiving application has access to an address file keyed by the unique identifier). The key currently used is the Postal Address File (PAF) key, which is generated by the Royal Mail.
addr/desc | 0..1 | This may contain a description of the address; this may be used for things like directions for the address.
addr/useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for an address: A point in time when the contact address details are valid A start and end time Just including hours and minutes to indicate opening hours of an office for a work address Using dates for indicating a contact address is only for a certain period of time A start time only to indicate when the contact address is valid from An end time only to indicate that the contact address is only valid until a certain date
addr/useablePeriod/low/@value | 0..1 | The start of the usable period
addr/useablePeriod/high/@value | 0..1 | The end of the usable period
addr/@use | 0..1 | A suitable code from the PostalAddressUse vocabulary may be used to describe the type of address.
addr/@nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary
streetAddressLine/@partType | 0..1 | A structured address is a list of address parts. Each part corresponds to a component of the address. The parts have their own XML element names and these are synonymous with a part element with a code to specify the partType.

PostAddress Use Values

##### Code Usage:

Code | Name | Definition
--- | --- | ---
PHYS | physical visit address | Used primarily to visit an address.
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 address | 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 other contacts are available.
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)
SYL | Syllabic | Syllabic transcription of name (e.g., Japanese kana, Korean hangul)
IDE | Ideographic | Ideographic representation of name (e.g., Japanese kanji, Chinese characters)

##### Flavours:

##### Unstructured Address [F]

An unstructured address is effectively a simple string.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | This element must contain the data only. No child elements are allowed.

###### Example 1: To indicate a simple address.

    <addr>106 Goodwin Street Leeds LS1 4HY</addr>

##### Unstructured Address with optional postal code, use and valid time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | This element must contain the data and only the stated elements are allowed.
addr/postalCode | 0..1 | The postcode of the property.
addr/useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for an address: A point in time when the contact address details are valid. A start and end time (Just including hours and minutes to indicate opening hours of an office for a work address. Using dates for indicating a contact address is only for a certain period of time.) A start time only to indicate when the contact address is valid from. An end time only to indicate that the contact address is only valid until a certain date.
addr/useablePeriod/low/@value | 0..1 | The start of the usable period.
addr/useablePeriod/high/@value | 0..1 | The end of the usable period.
addr/@use | 0..1 | A suitable code from the PostalAddressUse vocabulary may be used to describe the type of address.

###### Example 1: To indicate an unstructured home address.

    <addr use="H">106 Goodwin Street Leeds LS1 4HY</addr>

###### Example 2: To indicate an unstructured address with usable period.

    <addr>106 Goodwin Street
     <useablePeriod>
      <low value="20000706"/>
      <high value="20110806"/>
     </useablePeriod>
    </addr>

###### Example 3: To indicate an unstructured address with postcode.

    <addr use="H">106 Goodwin Street Leeds
     <postalCode>LS1 4HY</postalCode>
    </addr>

###### Example 4: To indicate an unstructured address home with postcode and usable period

    <addr>106 Goodwin Street Leeds LS1 4HY
     <useablePeriod>
      <low value="20000706"/>
      <high value="20110806"/>
     </useablePeriod>
    </addr>

##### Address streetAddressLine (PDS Style) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | Must not contain data only child elements.
addr/streetAddressLine | 1..5 | A street address line may represent any part of the address. The first XML element streetAddressLine or the second XML element streetAddressLine and the fourth XML element streetAddressLine are mandatory to be populated.
addr/postalCode | 0..1 | UK format Postcode.
addr/addresskey | 0..1 | A unique identifier keyed to Royal Mail Postal Address File (PAF) Directory.
addr/useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for an address: A point in time when the contact address details are valid. A start and end time (Just including hours and minutes to indicate opening hours of an office for a work address. Using dates for indicating a contact address is only for a certain period of time.) A start time only to indicate when the contact address is valid from. An end time only to indicate that the contact address is only valid until a certain date.
addr/useablePeriod/low/@value | 0..1 | The start of the usable period.
addr/useablePeriod/high/@value | 0..1 | The end of the usable period.
addr/@use | 0..1 | A suitable use code from the PostalAddressUse vocabulary may be used. HL7 standard address use types supported by NPfIT: "H" - Home address "HP" - Primary home "TMP" -Temporary address “PST” - Correspondence address “WP” - Work address

###### Example 1: To indicate a home address with unstructured street address lines.

    <addr use="H">
     <streetAddressLine>Pynes Hill</streetAddressLine>
     <streetAddressLine>Rydon Lane</streetAddressLine>
     <streetAddressLine>Exeter</streetAddressLine>
     <streetAddressLine>Devon</streetAddressLine>
     <postalCode>EX2 5SE</postalCode>
     <addressKey>12345678</addressKey>
    </addr>

###### Example 2: To indicate a temporary address with unstructured address lines and validity dates.

    <addr use="TMP">
     <streetAddressLine>AQUEOUS II</streetAddressLine>
     <streetAddressLine>ASTON CROSS</streetAddressLine>
     <streetAddressLine>ROCKY LANE</streetAddressLine>
     <streetAddressLine>ASTON</streetAddressLine>
     <streetAddressLine>BIRMINGHAM</streetAddressLine>
     <postalCode>B6 5RQ</postalCode>
     <addressKey>23456789</addressKey>
      <useablePeriod>
        <low value="20040716"/>
        <high value="20040831"/>
      </useablePeriod>
    </addr>

##### Address fully structured [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | Must not contain data only child elements.
addr/country | 0..1 | The country in which the property is located.
addr/county | 0..1 | The county in which the property is located.
addr/city | 0..1 | The city in which the property is located.
addr/postalCode | 0..1 | The post code of the property.
addr/precinct | 0..1 | A subsection (district) of a city in which the property is located.
addr/houseNumber | 0..4 | The number (or name) of the property being represented. Note there can be more than one see examples below.
addr/streetName | 0..4 | The street name of the property being represented. Note there can be more than one see examples below.
addr/additionalLocator | 0..1 | An additional locator used to assist in indicating the address.
addr/streetAddressLine | 0.4 | Up to four instances of this element are allowable for address parts, which do not have a specific XML element. See the examples below for more information.
addr/addresskey | 0..1 | This is a NHS England extension and is a unique identifier for the address, used where the recipient does not need to receive the full address (for example because the receiving application has access to an address file keyed by the unique identifier). The key currently used is the Postal Address File (PAF) key, which is generated by the Royal Mail.
addr/useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for an address: A point in time when the contact address details are valid. A start and end time (Just including hours and minutes to indicate opening hours of an office for a work address. Using dates for indicating a contact address is only for a certain period of time.) A start time only to indicate when the contact address is valid from. An end time only to indicate that the contact address is only valid until a certain date.
addr/useablePeriod/low/@value | 0..1 | The start of the usable period.
addr/useablePeriod/high/@value | 0..1 | The end of the usable period.
@use | 0..1 | A suitable use code from the PostalAddressUse vocabulary may be used to describe the type of address.

###### Example 1: To indicate a home address with structured address lines.

    <addr use="H">
     <houseNumber>Rose Cottage</houseNumber>
     <streetName>Pynes Hill</streetName>
     <streetName>Rydon Lane</streetName>
     <city>Exeter</city>
     <county>Devon</county>
     <postalCode>EX2 5SE</postalCode>
     <addressKey>12345678</addressKey>
    </addr>

###### Example 2: To indicate a work place address with structured address lines.

    <addr use="WP">
     <houseNumber>Hexagon House</houseNumber>
     <streetName>Pynes Hill</streetName>
     <streetName>Rydon Lane</streetName>
     <precinct>Whipton</precinct>
     <city>Exeter</city>
     <county>Devon</county>
     <country>England</country>
     <postalCode>EX2 5SE</postalCode>
     <addressKey>12345678</addressKey>
    </addr>

###### Example 3: To indicate an unknown address using nullFlavor

    <addr nullFlavor="UNK"/>

###### Example 4: To indicate some unknown work place address lines using nullFlavor

    <addr use="WP">
     <houseNumber nullFlavor="UNK"/>
     <streetName nullFlavor="UNK"/>
     <precinct>Whipton</precinct>
     <city>Exeter</city>
     <county>Devon</county>
     <country>England</country>
     <postalCode>EX2 5SE</postalCode>
     <addressKey>12345678</addressKey>
    </addr>

##### PDS Mini Services Address with mandatory postal code (AD.NHS.AddressType1) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | This element must contain the data and only the stated elements are allowed.
addr/postalCode | 1..1 | The postcode of the property.

###### Example 1: To indicate an PDS Mini Services address with postcode only

    <addr>
    <postalCode>EX2 5SE</postalCode>
    </addr>

##### PDS Mini Services Address with optional postal code and 5 address lines (AD.NHS.AddressType2) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
addr | 1..1 | This element must contain the data and only the stated elements are allowed.
addr/streetAddressLine | 5..5 | A street address line may represent any part of the address. All 5 streetAddressLine XML elements are mandatory to be populated.
addr/postalCode | 0..1 | The postcode of the property.
addr/@use | 0..1 | A suitable code from the PostalAddressUse vocabulary may be used to describe the type of address.

###### Example 1: To indicate an unstructured address with mandatory 5 address lines with optional postal code and use.

    <addr use="H">
     <streetAddressLine>AQUEOUS II</streetAddressLine>
     <streetAddressLine>ASTON CROSS</streetAddressLine>
     <streetAddressLine>ROCKY LANE</streetAddressLine>
     <streetAddressLine>ASTON</streetAddressLine>
     <streetAddressLine>BIRMINGHAM</streetAddressLine>
     <postalCode>B6 5RQ</postalCode>
    </addr>

##### Use of nullFlavor with addr Data Type and flavors

###### Example 1: To indicate an unknown address.

    <addr nullFlavor="UNK"/>

###### Example 2: To indicate some unknown work place address lines.

    <addr use="WP">
     <houseNumber nullFlavor="UNK"/>
     <streetName nullFlavor="UNK"/>
     <precinct>Whipton</precinct>
     <city>Exeter</city>
     <county>Devon</county>
     <country>England</country>
     <postalCode>EX2 5SE</postalCode>
     <addressKey>12345678</addressKey>
    </addr>

#### Any (ANY) [D]

A HL7 V3 model attribute which utilises the abstract data type ANY may be any one of the other data types listed below, such as BL, ST, CV, PQ, TS, etc. Normally it will be resolved to one of the more specific data types within an “on the wire" instance of a message.

#### Bag (BAG) [D]

This is an unordered collection of data values. A data value may occur more than once. Where the collection of the integers (17, 2, 13, 2, 99, and 17) would be a BAG.

#### Boolean (BL) [D]

BL stands for the values of two-valued logic. A BL value can be true, false or NULL (set to a nullFlavor). A HL7 V3 model attribute which uses the data type BL has an XML element containing one XML attribute "value", which shall contain true or false.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
@value | 0..1 | Shall contain true or false, these are case sensitive.
@nullFlavor | 0..1 | Allowable, values used must come from the nullFlavor vocabulary.

###### Example 1: To indicate a context conduction indicator with value "true"

    <contextConductionInd value="true"/>

###### Example 2: To indicate a seperatable indicator with value "false"

    <seperatableInd value="false"/>

###### Example 3: To indicate a seperatable indicator where the value is unknown

    <seperatableInd nullFlavor="UNK"/>

#### BooleanNonNull (BN) [D]

BN constrains the Boolean type so that the value may not be NULL. This type was created for use within the data type’s guidance where it is not appropriate for a null value to be used. A HL7 V3 model attribute which uses the data type BN has an XML element containing one XML attribute “value”, which shall contain true or false.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | Shall contain true or false, these are case sensitive.

###### Example 1: When sending the Boolean value to indicate a context conduction indicator with value "true"

    <contextConductionInd value="true"/>

###### Example 2: When sending the Boolean value to indicate a seperatable indicator with value "false"

    <seperatableInd value="false"/>

#### Character String (ST) [D]

The character string data type is used for text data. Used for names, symbols, and formal expressions. The ST data type is used when the appearance of text does not bear meaning, which is true for formalized text and all kinds of names. A HL7 V3 model attribute, which uses the data type ST, has an XML element containing the text. The XML element will take its name from the HL7 V3 model attribute name.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 0..1 | The actual root element name is dependant on which HL7 model attribute used.
value/@nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary

##### Flavours:

##### Character String (ST.NHS.StringType5) Representation in Messages

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
XML element shall contain data | 1..1 |

###### Example 1: When sending the text to indicate a text value (in a HL7 V3 entity class name attribute):

    <name>Mary Jones</name>

###### Example 2: When sending the text to indicate some plain text (in a HL7 V3 observation class text attribute)

    <text>Some plain text</text>

###### Example 3: When sending the text to indicate a text value (in a HL7 V3 observation class value attribute)

    <value xsi:type="ST">Some plain text</value>

###### Example 4: When the HL7 V3 model attribute is not mandated therefore a null flavor is allowable and the information is not available on the sending system. To indicate that the text value is unknown (in a HL7 V3 entity class name attribute):

    <name nullFlavor="UNK"/>

###### Example 5: To indicate that the text value is unknown (in a HL7 V3 observation class text attribute):

    <text nullFlavor="UNK"/>

###### Example 6: To indicate that the text value is unknown (in a HL7 V3 observation class value attribute)

    <value nullFlavor="UNK"/>

#### Character String with Code (SC) [D]

The character string with code data type consists of a character string that optionally may have a code attached. The text must always be present if a code is present. The code is often a local code. A HL7 V3 model attribute, which uses the data type SC, has an XML element containing the text. The XML element will have XML attributes to carry the coding information. The XML element will use the HL7 V3 model attribute name.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 0..1 | The actual root element name is dependant on which HL7 model attribute used.
value/@code | 0..1 | This attribute contains the code.
value/@codeSystem | 0..1 | This attribute contains the coding system (vocabulary) which the coded value came from.
value/@displayName | 0..1 | This attribute contains the human readable text associated with the coded value.
value/@codeSystemName | 0..1 | The common name of the coding system.
value/@codeSystemVersion | 0..1 | The version of the coding system used.
value/@nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary.

##### Flavours:

##### Character String with Code Representation in Messages

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
XML element shall contain data | 1..1 | No XML attributes are allowed.

###### Example 1: When implementing text only [F]. To indicate the software name of "NHAIS" without the optional coded information:

    <softwareName>NHAIS</softwareName>

###### Example 2: When implementing text and coded information [F]. To indicate the software name of "NHAIS" with the coded information including a code meaning "NHAIS":

    <softwareName code="1" codeSystem="2.16.840.1.113883.2.1.3.2.9999" displayName="NHAIS">NHAIS</softwareName>

###### Example 3: When the HL7 V3 model attribute is not mandated therefore a null flavor is allowable and the information is not available on the sending system. To indicate that the software name is unknown:

    <softwareName nullFlavor="UNK"/>

#### Coded Simple Value (CS) [D]

CS is used to convey information on the form of a code only. This is only used where there is a short controlled list of possible values, and typically these will be HL7 V3 defined structural codes where the coding system can reliably be inferred by context..

#### Coded Value (CV) [D]

CV is used where there is no requirement from sending translations or qualifiers, otherwise it has the same structure as the CD data type. It must either have the NULL attribute, or all three of code , displayName and codeSystem .

#### Coded with Equivalents (CE) [D]

CE is used where the approved coding scheme is not the original scheme in which the data was encoded. However, it is not applicable where qualifiers are required. The original code is mapped to a translated code in the approved scheme. The mapping may translate a specific original code to a more general code in the approved scheme but must not add specificity not present in the original code.

#### Concept Descriptor (CD) [D]

An HL7 V3 model attribute of type CD may either have a NULL attribute or all three of: code , displayName and codeSystem .

The code attribute holds the code value, and displayName is the rubric associated with that code. This is the text as provided by the maintainer of the code list, and must not be changed in any way by the sending system. Where there is any difference in the text, this variation should be sent in the optional originalText attribute . The codeSystem attribute must be supplied for all non-NULL instances of this data type, and is the OID for the coding system from which the code has been drawn. See the HL7 V3 specification for full details of the OID structure.

Two optional child elements allow code qualifiers (" qualifier " element) and alternate coding system representation of the same information (" translation " element).

Note that where a translation is used the original code used is expressed in the outer element. The translation element is used to send the required encoding. For example, the translation should be used to send a SNOMED CT concept identifier if clinical information was originally collected using some other coding system.

Note that this domain specification pre-adopts a committee proposal for extension of the qualifier structure to allow grouping of qualifiers. This proposal has been pre-adopted to support accurate representation of SNOMED CT "role grouping".

Representation within messages:

##### Flavours:

##### Coded Plain (CV.NPfIT.Codedplain) [F]

This flavor is used where the original encoding uses the approved coding scheme for a message attribute.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@displayName | 1..1 | The text or rubric associated with the code.
code/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived.

###### Example 1: To indicate a request response for a "value" attribute of an observation class

    <value xsi:type="CV" code="11" codeSystem="2.16.840.1.113883.2.1.3.2.4.17.42" displayName="NHS Number confirmed"/>

##### Coded with Original Text (CV.NPfIT.CodedOriginaltext) [F]

This flavor is used where the original encoding uses the approved coding scheme for a message attribute but where there is some text entered or selected by the user that is not identical to the display text or rubric associated with the code.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@displayName | 1..1 | The text or rubric associated with the code.
code/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived.
code/@originalText | 1..1 | The full text associated with this code as selected, typed or seen by the author of this statement. This may contain additional information that has not been completely coded. However, this should be avoided wherever possible. Generally, it should just be an alternative narrative expression of the coded information..

###### Example 1: To indicate a code with the original text upon which the code was based for a code attribute of an observation class:

    <code code="195967001" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="asthma">
     <originalText>currently suffering from asthma</originalText>
    </code>

##### Coded Qualified [F]

The flavor is used where the approved coding scheme is also the original scheme in which the data was encoded and qualifiers from that scheme are also used to refine the meaning of the code.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@displayName | 1..1 | The text or rubric associated with the code.
code/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived.
code/@originalText | 0..1 | The full text associated with this code as selected, typed or seen by the author of this statement. This may contain additional information that has not been completely coded. However, this should be avoided wherever possible. Generally, it should just be an alternative narrative expression of the coded information. Within a CDA document, this is a reference to the text carried in a text section.
code/qualifier | 1..1 | Qualifiers are included only where these were used as qualifiers in the original encoding. Note that the code system is not separately specified. It must be drawn from the same approved scheme as the primary code. Combinations of a single base coding scheme with different sets of qualifiers may be registered as distinct code systems if necessary to provide flexibility for local coding.
code/qualifier/name | 1..1 | Names the attribute qualifies the code (e.g. for "severity", "laterality")
code/qualifier/value | 1..1 | Specifies the qualifying value of the named attribute (e.g. for "mild" or "left").
code/qualifier/value/qualifier | 1..1 | Qualifiers are included only where these were used as qualifiers in the original encoding. Note that the code system is not separately specified. It must be drawn from the same approved scheme as the primary code. Combinations of a single base coding scheme with different sets of qualifiers may be registered as distinct code systems if necessary to provide flexibility for local coding.
code/qualifier/name/@code | 1..1 | Code representing the name for this qualifying attribute.
code/qualifier/name/@displayName | 1..1 | The display text or rubric associated with the name of this attribute.
code/qualifier/value/qualifier/name | 1..1 | Names the attribute qualifies the code (e.g. for "severity", "laterality")
code/qualifier/value/qualifier/value | 1..1 | Specifies the qualifying value of the named attribute (e.g. for "mild" or "left").
code/qualifier/value/qualifier/name/@code | 1..1 | Code representing the name for this qualifying attribute.
code/qualifier/value/qualifier/name/@displayName | 1..1 | The display text or rubric associated with the name of this attribute.

###### Example 1: To indicate a planned procedure of administration of a therapeutic substance by inhalation for a "code" attribute of an CDA observation class

    <code code="405613005" displayName="Planned procedure" codeSystem="2.16.840.1.113883.2.1.3.4.15">
     <originalText>
      <reference value="#a3"/>
     </originalText>
      <qualifier>
       <name code="36589002" displayName="Associated procedure"/>
       <value code="2254260907" displayName="Administration of therapeutic substance">
         <qualifier>
          <value code="112239003" displayName="by inhalation"/>
         </qualifier>
        </value>
      </qualifier>
    </code>

##### Coded Translated [F]

The flavor is used where the approved coding scheme is not the original scheme in which the data was encoded and no qualifiers are used.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@displayName | 1..1 | The text or rubric associated with the code.
code/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived.
code/@originalText | 0..1 | The full text associated with this code as selected, typed or seen by the author of this statement. This may contain additional information that has not been completely coded. However, this should be avoided wherever possible. Generally, it should just be an alternative narrative expression of the coded information. Within a CDA document, this is a reference to the text carried in a text section.
code/translation | 1..1 | Map to Approved coding (e.g. SNOMED CT concept identifier) if other coding scheme is used in the primary code component (above).
code/translation/@code | 1..1 | The code for this approved translation. Note that the code may require qualifiers (also from the approved scheme) to translate the primary code.
code/translation/@displayname | 1..1 | The display text or rubric associated with the approved translation code.
code/translation/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived

###### Example 1: To indicate a code (Read 4 byte) with the original text on which the code was based together with a translation to another coding scheme (SNOMED CT). Note the original code is the outer element and the required translation is the inner element.

    <code code=".H43." codeSystem="2.16.840.1.113883.6.28" displayName="asthma">
     <originalText>currently suffering from asthma""</originalText>
      <translation code="195967001" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="asthma"/>
    </code>

##### Coded Only (CV.NPfIT.Codeonly) [F]

This flavor is used in most instances of the CS data type. Since this data type is only used for structural attributes and other attributes with fixed code list other components are not required.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.

###### Example 1: To indicate administrative gender of "Female"

    <administrativeGenderCode code="2"/>

##### Coded with Display Name (CV.NPfIT.CodedDisplayname) [F]

This alternative flavor may be required for use for some attributes, where there is a requirement for rendering displayable text without recourse to a lookup table within the style sheet.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@displayName | 1..1 | The text or rubric associated with the code.

##### Coded with Code System (CV.NPfIT.CodedCodeSystem) [F]

This alternative flavor may be required where there is a specified recognised coding system that can be looked up.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived.

###### Example 1: To indicate a confidentiality code of "Sensitive"

    <confidentialityCode code="S" codeSystem="2.16.840.1.113883.2.1.3.2.4.16.1"/>

##### PDS Mini Services Code with Code System (CV.NHS.CodedValueType1) [F]

This alternative flavor may be required where there is a specified recognised coding system that can be looked up.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
code | 1..1 | The actual root element name is dependant on which HL7 model attribute used.
code/@code | 1..1 | The primary code value originally used to encode a statement.
code/@codeSystem | 1..1 | An OID identifying the coding system from which the code is derived.

###### Example 1: To indicate a confidentiality code of "Sensitive"

    <confidentialityCode code="S" codeSystem="2.16.840.1.113883.2.1.3.2.4.16.1"/>

#### Encapsulated Data (ED) [D]

The Encapsulated Data data type is utilised when the data 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.) Where the data is included in the element, it is sent as the element content. The XML element will use the HL7 V3 model attribute name. See examples below.

Alternatively, it can be sent as a URL using the optional "reference" child. If this reference element is used, then there should not be any other content in the ED-typed element (i.e. data must either be sent inline, or by reference, but both should not be done at the same time). The reference element is of type TEL, with attributes for the URL, the use type, and an optional validTime child element to specify when the linked data is useable.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 0..1 | The actual root element name is dependant on which HL7 model attribute is used.
value/@representation | 0..1 | Specifies the representation of the data (text or binary) that is the content of the data element.
value/@mediaType | 0..1 | Identifies the type of the encapsulated data and identifies a method to interpret or render the data.
value/@language | 0..1 | For character-based information, the language property specifies the human language of the text.
value/@compression | 0..1 | Indicates whether the raw byte data is compressed, and what compression algorithm is used.
value/@reference | 0..1 | A telecommunication address (TEL), such as a URL for HTTP or FTP, which will resolve to precisely the same binary data that would have been provided as inline data.
value/@integrityCheck | 0..1 | 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.
value/@integrityCheckAlgorithm | 0..1 | Specifies the algorithm used to compute the integrityCheck value.
value/@thumbnail | 0..1 | 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.
value/@nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary

##### Flavours:

##### ED.NHS.Data.Representation.MediaType.Mandated [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | The actual root element name is dependant on which HL7 model attribute is used.
value/@representation | 1..1 | Specifies the representation of the binary data that is the content of the binary data element. The allowed values are Binary encoding = "TXT" or "B64" (Base 64)
value/@mediaType | 1..1 | Identifies the type of the encapsulated data and identifies a method to interpret or render the data.

###### Example 1: To indicate an encapsulated image.

    <value xsi:type="ED" representation="B64" mediaType="image/jpeg">
    /9j/4AAQSkZJRgABAQEASABwAAD/2wBDAAoHBwgHBgoICAgLCgoLDhgQDg0NDh0VFhEYIx8lJCIfIiEmKzcvJik0KSEiMEExNDk7Pj4+JS5ESUM8SDc9Pjv/2wBDAQoLCw4NDhwQOOK1K2gcldp2sf/Z
    </value>

###### Example 2: To indicate a pdf document sent as a non xml body in a CDA document

    <text mediaType="application/pdf" representation="B64">
            JVBERi0xLjUN .......
    </text>

##### StrucDoc.Text [F]

This flavor is a CDA specific constraint on the ED data type, which is utilised in text sections of CDA documents.

The Section.text field in a CDA document section is used to store narrative to be rendered, and is therefore referred to as the CDA Narrative Block. There is a schema which enforces the structure of the CDA Narrative block. The content model of the CDA Narrative Block schema is specially hand crafted to meet the requirements for rendering CDA text sections. The schema is registered as a MIME type (text/x-hl7-text+xml), which is the fixed media type for Section.text. The CDA narrative block specification is included in the associated specification tab where it is required for implementation of this DMS

#### Event-Related Periodic Interval (EIVL) [D]

Specifies a periodic interval of 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.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 0..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime@operator | 0..1 | 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.
effectiveTime/offset | 0..1 | 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.
effectiveTime/offset/low@value | 0..1 | The start of the offset
effectiveTime/offset/high@value | 0..1 | The end of the offset
effectiveTime/offset/center@value | 0..1 | The date or time of the offset - assuming it is not known to be specifically the start or end. It should not be assumed as the literal mid point. May be expressed as any flavor of Point in Time.
effectiveTime/offset/width@value | 0..1 | The difference between high and low boundary. The purpose of distinguishing width is to handle all cases of incomplete information symmetrically.
effectiveTime/event@code | 0..1 | A code for a common (periodical) activity of daily living based on which the event related periodic interval is specified.
value/@nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary

TimingEvent values

##### Code Usage:

Code | Name | Definition
--- | --- | ---
AC | AC | before meal (from lat. ante cibus)
ACD | ACD | before lunch (from lat. ante cibus diurnus)
ACM | ACM | before breakfast (from lat. ante cibus matutinus)
ACV | ACV | before dinner (from lat. ante cibus vespertinus)
HS | HS | the hour of sleep
IC | IC | between meals (from lat. inter cibus)
ICD | ICD | between lunch and dinner
ICM | ICM | between breakfast and lunch
ICV | ICV | between dinner and the hour of sleep
PC | PC | after meal (from lat. post cibus)
PCD | PCD | after lunch (from lat. post cibus diurnus)
PCM | PCM | after breakfast (from lat. post cibus matutinus)
PCV | PCV | after dinner (from lat. post cibus vespertinus)

###### Example 1: To indicate "in the morning"

    <effectiveTime xsi:type="EIVL" operator="A">
    	<event code="ACM"/>
    </effectiveTime>

#### Instance Identifier (II) [D]

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..

"Real world" identifiers such as a GMCP number or a patient NHS Number should be sent in the extension attribute, with the root being used to identify the assigning authority that is responsible for ensuring the uniqueness of the identifier in the extension.

An alternative mechanism is used for identifiers that are used to maintain instances of information as that information becomes distributed as a result of messaging. In this case there is no single authority that can be made responsible for maintaining the uniqueness, and so DCE UUIDs are normally used (Universally Unique IDs). These must be generated in a way that ensures uniqueness, and be expressed as dash separated hexadecimal numbers. The DCE UUID is sent in the root attribute.

##### Flavours:

##### Identifier Global (II.NPfIT.uuid.mandatory) [F]

The Identifier Global flavor is used for representing instances of information objects in the message. It consists of a single XML attribute containing a DCE UUID

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | DCE UUID

###### Example 1: To indicate a DCE UUID for an "id" class attribute

    <id root="BBBBE26A-A9D1-A411-F824-9F7A00A33757"/>

##### Identifier External [F]

The Identifier External flavor is used for externally specified identifiers for real world entities. It consists of two components one identifying the scheme of identifiers and the other containing the identifier itself.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | OID identifying the scheme of identifiers
id/@extension | 1..1 | Real-world-Identifier within the specified scheme.

###### Example 1: To indicate an identifier for an "id" class attribute (in this case a NHS number):

    <id root="2.16.840.1.113883.2.1.4.1" extension="9999999484"/>

##### Identifier External OID mandatory (II.NPfIT.oid.mandatory) [F]

The Identifier External flavor is used for externally specified identifiers for real world entities. It consists of two components one identifying the scheme of identifiers and the other containing the identifier itself. The identifying the scheme must be identified using an OID.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | This must be an OID identifying the scheme of identifiers
id/@extension | 0..1 | Real-world-Identifier within the specified scheme.

###### Example 1: To indicate an identifier for an "id" class attribute (in this case a NHS number):

    <id root="2.16.840.1.113883.2.1.4.1" extension="9999999484"/>

##### Identifier External ODS Organisation or Site (II.NPfIT.OrganizationSDS.Organisation.oid or II.NPfIT.OrganizationSDS.Site) [F]

Identifier External ODS Organisation or Organisation Site flavors are used for identifiers of organisations using either the ODS organisation code or ODS organisation site code. This is defined as two flavors in the data type flavors schema which are used together in the model, to allow either OID to be used.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | This must be an OID with either the value 2.16.840.1.113883.2.1.3.2.4.19.1 or 2.16.840.1.113883.2.1.3.2.4.19.2. The message may allow only one to be used.
id/@extension | 1..1 | The organisations ODS or the organisations site ODS code.

###### Example 1: To indicate an identifier for an "id" class attribute (in this case a ODS organisation code):

    <id extension="V145" root="2.16.840.1.113883.2.1.3.2.4.19.1"/>

##### Identifier External with Optional Assigning Authority (II.NPfIT.oid.mandatory.assignedAuthority) [F]

The Identifier External flavor is used for externally specified identifiers for real world entities. It consists of two mandatory components one identifying the scheme of identifiers and the other containing the identifier itself. There is a third optional component which is used to identify the body that assigned the identifier.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | OID identifying the scheme of identifiers
id/@extension | 1..1 | Real-world-Identifier within the specified scheme.
id/@assigningAuthorityName | 0..1 | The body which assigned the identifier.

###### Example 1: To indicate an identifier for an "id" class attribute (in this case a local patient identifier):

    <id root="2.16.840.1.113883.2.1.4.1" extension="9999999484" assigningAuthorityName="V145:V145:LONDON BOROUGH OF ISLINGTON"/>

##### Identifier External with Mandatory Root Enumerated OID and Optional Assigning Authority (II.NPfIT.oid.mandatoryAndEnumerated.assignedAuthority.optional) [F]

The Identifier External flavor is used for externally specified identifiers for real world entities. It consists of two mandatory components one identifying the scheme of identifiers and the other containing the identifier itself. There is a third optional component which is used to identify the body that assigned the identifier.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | OID identifying the scheme of identifiers. This is enumerated to allow only 2.16.840.1.113883.2.1.4.1 for a verified NHS number or 2.16.840.1.113883.2.1.3.2.4.18.24. for a local patient identifier. Although the majority of constraints for this flavor are schema enforced the tabular view for messages which use this flavor will give further guidance on the OID usage.
id/@extension | 1..1 | Real-world-Identifier within the specified scheme. This will be either a NHS number or a local patient identifier
id/@assigningAuthorityName | 0..1 | The body which assigned the identifier.Note this is mandatory to be present when the OID is 2.16.840.1.113883.2.1.3.2.4.18.24

###### Example 1: To indicate an identifier for an "id" class attribute (in this case a local patient identifier):

    <id root="2.16.840.1.113883.2.1.4.1" extension="9999999484" assigningAuthorityName="V145:V145:LONDON BOROUGH OF ISLINGTON"/>

##### Identifier External Extension Only (II.NHS.extension.mandatory) [F]

The Identifier External Extension Only flavor is used for externally specified identifiers for real world entities. It consists of two components one identifying the scheme of identifiers and the other containing the identifier itself. This flavor is used when both the sender and receiving system do not need the scheme identifier included in the payload. Only the extension is send "on the wire".

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@extension | 1..1 | Real-world-Identifier.

###### Example 1: To indicate an identifier for an "id" class attribute (in this case a NHS number):

    <id extension="9999999484"/>

##### Prescription Identifier External Extension Only (II.NHS.EPS1.oid.mandatory) [F]

This flavor is used for Electronic Prescription Service prescription identifiers only. It consists of two components one identifying the scheme of identifiers and the other containing the identifier itself. This flavor is used when both the sender and receiving system do not need the scheme identifier included in the payload. Only the extension is sent "on the wire".

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
value/@extension | 1..1 | Contains the 18 character Short Form Prescription Identifier.

###### Example 1: To indicate an identifier for a "value" class attribute (in this case a Short Form Prescription Identifier):

    <value extension="83C40E-A23856-00123C"/>

##### PDS Mini Services NHS Number Identifier with fixed OID mandatory (II.NHS.IdentifierType1) [F]

The Identifier External flavor is used for externally specified identifiers for real world entities. It consists of two components one identifying the scheme of identifiers and the other containing the identifier itself. The identifying the scheme must be identified using an OID.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | This must be an OID identifying the scheme of identifiers. This attribute is fixed to the OID "2.16.840.1.113883.2.1.4.1"
id/@extension | 0..1 | This attribute shall contain the NHS Number.

###### Example 1: To indicate an PDS Mini Services identifier for an "id" class attribute (in this case a NHS number):

    <id root="2.16.840.1.113883.2.1.4.1" extension="9999999484"/>

##### PDS Mini Services Identifier Global (II.NHS.IdentifierType2) [F]

The Identifier Global flavor is used for representing instances of information objects in the message. It consists of a single XML attribute containing a DCE UUID

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | DCE UUID

###### Example 1: To indicate a DCE UUID for an "id" class attribute

    <id root="BBBBE26A-A9D1-A411-F824-9F7A00A33757"/>

##### PDS Mini Services Identifier with fixed OID mandatory (II.NHS.IdentifierType3) [F]

The Identifier External flavor is used for externally specified identifiers for real world entities. It consists of two components one identifying the scheme of identifiers and the other containing the identifier itself. The identifying the scheme must be identified using an OID.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
id | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
id/@root | 1..1 | This must be an OID identifying the scheme of identifiers.
id/@extension | 0..1 | Real-world-Identifier within the specified scheme.

###### Example 1: To indicate an PDS Mini Services identifier for an "id" class attribute (in this case a NHS number):

    <id root="2.16.840.1.113883.2.1.4.1" extension="9999999484"/>

#### Integer Number (INT) [D]

Integer numbers (-1, 0, 1, 2, 100, 3398129, etc.) are precise (whole) numbers that are results of counting and enumerating. Integer numbers are discrete; the set of integers is infinite but countable. There are no arbitrary limits imposed on the range of integer numbers. There are two NULL flavors defined for the positive and negative infinity. A HL7 V3 model attribute, which uses the data type INT, has an XML element containing one XML attribute "value".

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
repeatNumber | 0..1 | The actual root element will depend on the HL7 V3 attribute used.
repeatNumber/@value | 0..1 | Whole numbers only.
repeatnumber/@nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary.

##### Flavours:

##### Integer Number Representation in Messages

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
repeatNumber | 0..1 | The actual root element will depend on the HL7 V3 attribute used.
repeatNumber/@value | 1..1 | Shall contain the number

###### Example 1: When sending the integer to indicate a repeat number of "1" .

    <repeatNumber value="1"/>

###### Example 2: When the HL7 V3 model attribute is not mandated therefore a null flavor is allowable and the information is not available on the sending system. To indicate a sequence number where the value is unknown:

    <sequenceNumber nullFlavor="UNK"/>

#### Interval (IVL) [D]

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

#### Interval of Physical Quantities (IVL <PQ>) [D]

A range of physical quantity can either be expressed using "low" and "high" child elements to define the bounds of the interval (if only one of these is sent, then the other is assumed to be unbounded), or by sending the "center" element to express a single quantity instead of a range.

##### Flavours:

##### Quantity Range [F]

This flavor is used to express a bounded range of possible quantity values.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML element will take the name of HL7 V3 model attribute. The XML element shall only contain the child elements.
value/low | 1..1 |
value/high | 1..1 |
value/low/@value | 1..1 | The minimum value as an integer or decimal (real) number.
value/low/@unit | 1..1 | The UCUM unit code.
value/high/@value | 1..1 | The maximum value as an integer or decimal (real) number.
value/high/@unit | 1..1 | The UCUM unit code.

###### Example 1: To indicate a quantity range for a "value" attribute of an observation class

    <value xsi:type="IVL_PQ">
     <low value="3.6" unit="mmol/l"/>
     <high value="5.3" unit="mmol/l"/>
    </value>

##### Quantity Greater than [F]

This flavor is used to express a range of possible quantity values with a known minimum but no known maximum

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML element will take the name of HL7 V3 model attribute. The XML element shall only contain the child elements.
value/low | 1..1 |
value/low/@value | 1..1 | The minimum value as an integer or decimal (real) number.
value/low/@unit | 1..1 | The UCUM unit code.

###### Example 1: To indicate a quantity range greater than a specific value for a "value" attribute of an observation class

    <value>
     <low value="3.6" unit="mmol/l"/>
    </value>

##### Quantity Less than [F]

This flavor is used to express a range of possible quantity values with a known maximum but no known minimum.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML element will take the name of HL7 V3 model attribute. The XML element shall only contain the child elements.
value/high | 1..1 |
value/high/@value | 1..1 | The maximum value as an integer or decimal (real) number.
value/high/@unit | 1..1 | The UCUM unit code.

###### Example 1: To indicate a quantity range less than a specific value for a "value" attribute of an observation class

    <value>
     <high value="5.3" unit="mmol/l"/>
    </value>

#### Interval of Points in Time (IVL<TS>) [D]

A time interval can either be expressed using "low" and "high" child elements to define the bounds of the interval. If only one of these is sent, then the other is assumed to be unbounded. Alternatively, by sending the "center" element to express a single point in time. Finally the "width" element can be used to express a duration which is not fixed to a particular point in time. The "width" would be used to state that a symptom lasted for 30 minutes, without having to state the exact time that this occurred. Note that if both "center" and "width" are present, then neither "low" nor "high" may be included.

##### Flavours:

##### Date or Time Point [F]

This flavor should be used where the IVL<TS> data type is specified but only one date/time is known and it is not clear that this represents either the start or end of the event. Note the date/time need not be precise. Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/center | 1..1 |
effectiveTime/center/@value | 1..1 | The date or time of the event - assuming it is not known to be specifically the start or end. It should not be assumed as the literal mid point. May be expressed as any flavor of Point in Time.

###### Example 1: To indicate an effective time of 12:05 on 25/06/2004

    <effectiveTime>
     <center value="200406251205"/>
    </effectiveTime>

##### Date or Time Interval Complete [F]

This flavor should be used for any period of time with a known start and a known end. Note these start and end times need not be precise.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/low | 1..1 |
effectiveTime/high | 1..1 |
effectiveTime/low/@value | 1..1 | The date or time when an event started. May be expressed as any flavor of Point in Time.
effectiveTime/high/@value | 1..1 | The date or time when an event ended. May be expressed as any flavor of Point in Time.

###### Example 1: To indicate an effective time between of 12:05 and 12:20 on 25/06/2004

    <effectiveTime>
     <low value="200406251205"/>
     <high value="200406251220"/>
    </effectiveTime>

##### Date or Time Interval After [F]

This flavor should be used for any period of time with a known start but an unknown (or indefinite) end point. Note the start time need not be precise

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/low | 1..1 |
effectiveTime/low/@value | 1..1 | The date or time when an event started. May be expressed as any flavor of Point in Time.

###### Example 1: To indicate an effective time after 12:05 on 25/06/2004

    <effectiveTime>
     <low value="200406251205"/>
    </effectiveTime>

##### Date or Time Interval Before [F]

This flavor should be used for any period of time with a known end point but an unknown starting time. Note these end time need not be precise.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/high | 1..1 |
effectiveTime/high/@value | 1..1 | The date or time when an event ended. May be expressed as any flavor of Point in Time.

###### Example 1: To indicate an effective time before 25/06/2004

    <effectiveTime>
     <high value="20040625"/>
    </effectiveTime>

#### List (LIST) [D]

This is an ordered collection of distinct data values. Where the collection of the integers (2, 13, 17, and 99) would be a LIST.

#### Organization Name (ON) [D]

An organisational name is always unstructured, and is sent as string content of the element

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 0..1 | Element contains the name of the organisation as an unstructured string.
name/validTime | 0..1 | A validTime IVL <TS> child element can be used to define the timeframe within which this name is valid, e.g. when the current name was assigned or the period during which a previous name was valid.
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.
name/@use | 0..1 | A suitable use code from the OrganizationNameType vocabulary may be used.

##### Flavours:

##### Organisation Name (ON.NHS.OrganizationNameType1) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Element

###### Example 1: To indicate an organization name without any valid time.

    <name>Good Health Hospital</name>

##### Organisation Name with Valid Time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Element contains the name of the organisation as an unstructured string.
name/validTime | 1..1 | A validTime IVL <TS> child element can be used to define the timeframe within which this name is valid, e.g. when the current name was assigned or the period during which a previous name was valid.
name/low/@value | 1..1 | This contains the start of the validity period.
name/high/@value | 1..1 | This contains the end of the validity period.

###### Example 1: To indicate an organization name with a validity date interval

    <name>Good Health Hospital
     <validTime>
      <low value="19990401"/>
      <high value="20040331"/>
    </validTime>
    </name>

##### Use of nullFlavor with ON Data Type and flavors

###### Example 1: To indicate an unknown organisation name.

    <name nullFlavor="UNK"/>

#### Periodic Interval of Time (PIVL) [D]

An interval of time that recurs periodically. PIVL has two elements, phase and period. .

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 0..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime@alignment | 0..1 | 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 PIVL recurs independently from the calendar. An aligned PIVL is synchronized with the calendar.
effectiveTime@institutionSpecified | 0..1 | 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").
effectiveTime@operator | 0..1 | 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.
effectiveTime/period | 0..1 | A time duration specifying as a reciprocal measure of the frequency at which the PIVL repeats.
effectiveTime/period/low@value | 0..1 | The start of the duration
effectiveTime/period/high@value | 0..1 | The end of the duration
effectiveTime/period/center@value | 0..1 | The date or time of the event - assuming it is not known to be specifically the start or end. It should not be assumed as the literal mid point. May be expressed as any flavor of Point in Time.
effectiveTime/period/width@value | 0..1 | The difference between high and low boundary. The purpose of distinguishing width is to handle all cases of incomplete information symmetrically.
effectiveTime/phase | 0..1 | A prototype of the repeating interval, specifying the duration of each occurrence and anchors the PIVL sequence at a certain point in time.
effectiveTime/phase@value | 0..1 | The magnitude of the quantity measured in terms of the unit.
effectiveTime/phase@unit | 0..1 | The unit of measure specified in the Unified Code for Units of Measure (UCUM).
effectiveTime@nullFlavor | 0..1 | Allowable, values used must come from the nullFlavor vocabulary.

Operator Values

##### Code Usage:

Code | Name | Definition
--- | --- | ---
A | intersect | Form the intersection with the value.
E | exclude | Form the set-difference with this value, i.e., exclude this element or set from the resulting set.
H | convex hull | Form the convex hull with the value. The convex hull is defined over ordered domains and is the smallest contiguous superset (interval) that of all the operand sets.
I | include | Form the union with this value, i.e., include this element or set in the resulting set.
P | periodic hull | Form the periodic hull with the value. The periodic hull is defined over ordered domains and is the periodic set that contains all contiguous supersets of pairs of intervals generated by the operand periodic intervals.

###### Example 1: To indicate twice a day

    <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
    	<period value="12" unit="h"/>
    </effectiveTime>

###### Example 2: To indicate every twelve hours

    <effectiveTime xsi:type="PIVL_TS" institutionSpecified="false" operator="A">
    	<period value="12" unit="h"/>
    </effectiveTime>

###### Example 3: to indicate three times a day, at times determined by the person administering the medication.

    <effectiveTime xsi:type="PIVL_TS" institutionSpecified="true" operator="A">
    	<period value="8" unit="h"/>
    </effectiveTime>

###### Example 4: To indicate every day at eight in the morning for ten minutes.

    <effectiveTime xsi:type="PIVL_TS" operator="A">
    	<phase>
    		<low value="198701010800" inclusive="true"/>
    		<width value="10" unit="min"/>
    	</phase>
    	<period value="1" unit="d"/>
    </effectiveTime>

###### Example 5: To indicate every four to six hours

    <effectiveTime xsi:type="PIVL_PPD_TS" institutionSpecified="false" operator="A">
    	<period value="5" unit="h"/>
    	<standardDeviation value="1" unit="h"/>
    </effectiveTime>

###### Example 6: To indicate the 15th of the month

    <effectiveTime xsi:type="PIVL_TS" alignment="DM">
    	<phase>
    		<center value="20050915"/>
    	</phase>
    	<period value="1" unit="mo"/>
    </effectiveTime>

###### Example 7: To indicate a effective time where the value is unknown

    <effectiveTime nullFlavor="UNK"/>

#### Person Name (PN) [D]

Person Name is used to express either an unstructured name as string content of the name XML element, or a structured name as a set of family, given, prefix and suffix child XML elements. If any of the child XML elements are used, then there shall be no string content in the parent name XML element (i.e. the name must be structured or unstructured). In a structured name, there may be only one family element for the family name, and one prefix element for the title. The text values of the family, given, prefix and suffix XML elements are only allowable as element content. If the name is available in both structured and unstructured forms, the structured form shall be preferred. For both structured and unstructured names, the use of the name is allowable as a single optional XML attribute of the name XML element.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 0..1 | Element
name/delimiter | 0..1 | A delimiter has no me aning and is included purely as a separation in a name component.
name/family | 0..1 | This is a child element of name, which carries the person's surname
name/given | 0..* | This is a child element of name (this has been restricted to 99 for practical purposes), which carries the person forenames
name/prefix | 0..1 | This is a child element of name, which carries prefixes of the person for example Dr, Mrs, Sir etc.
name/validTime | 0..1 | A validTime IVL <TS> child element can be used to specify the time during which the name is or was used for the person. This accommodates the fact that people change names.The valid time indicates the period for which the name is valid for the use (if described).
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.
name@nullFlavor | 0..1 | Allowable, values used must come from the "nullFlavor" vocabulary
name@use | 0..1 | A suitable code from the EntityNameUse list of codes may be used.
name@partType | 0..1 | A suitable code from the EntityNamePartType list of codes may be used

The name XML element has a "use" XML attribute, which utilise a set of codes that can be used for advising a system, or user, which name in a set of names to select for a given purpose. The full list of codes are shown below but implementers should refer to the relevant tabular view for further guidance as these values may be further constrained for particular messages.

##### Code Usage:

Code | Name | Definition
--- | --- | ---
L | Legal | Known 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)
SYL | Syllabic | Syllabic transcription of name (e.g., Japanese kana, Korean hangul)
IDE | Ideographic | Ideographic representation of name (e.g., Japanese kanji, Chinese characters)
PREVIOUS-BIRTH | PREVIOUS-BIRTH | NHS UK extension for PDS
PREVIOUS-MAIDEN | PREVIOUS-MAIDEN | NHS UK extension for PDS
PREVIOUS-BACHELOR | PREVIOUS-BACHELOR | NHS UK extension for PDS
PREVIOUS | PREVIOUS | NHS UK extension for PDS
PREFERRED | PREFERRED | NHS UK extension for PDS

##### Flavours:

##### Person Name Unstructured [F]

Representation within messages:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Element

###### Example 1: To indicate a simple unstructured person name

    <name>John Smith</name>

###### Example 2: To indicate a simple unstructured person name with middle name.

    <name>Paula Charlotte Adamson</name>

###### Example 3: To indicate a simple prefixed unstructured person.

    <name>Dr. Alan Smith</name>

###### Example 4: To indicate a simple prefixed and suffixed name unstructured person.

    <name>Sir Terry Jones KBE</name>

##### Person Name Unstructured with Use [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Element
name/@use | 1..1 |

###### Example 1: To indicate an unstructured legal person name

    <name use="L">John Smith</name>

##### Person Name Unstructured with Valid Time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Element
name/validTime | 1..1 | Child element
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.

###### Example 1: To indicate an unstructured person name with a validity date interval

    <name>John Smith
     <validTime>
      <low value="19990401"/>
      <high value="20040331"/>
     </validTime>
    </name>

##### Person Name Unstructured with Use and Valid Time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Element
name/validTime | 1..1 | Child element
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.
name/@use | 1..1 |

###### Example 1: To indicate an unstructured alias person name with a validity date interval

    <name use="A">John Smith
     <validTime>
      <low value="19990401"/>
      <high value="20040331"/>
     </validTime>
    </name>

##### Person Name Structured [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 0..1 | This is a child element of name, which carries the person's surname.
name/given | 0..99 | This is a child element of name (this has been restricted to 99 for practical purposes), which carries the person forenames.
name/prefix | 0..1 | This is a child element of name, which carries prefixes of the person for example Dr, Mrs, Sir etc.
name/suffix | 0..1 | This is a child element of name which carries suffixes of the person for example OBE, MP, BSc etc.

###### Example 1: To indicate a structured person name with prefix (title) two given names (forenames), family name (surname) and suffix

    <name>
     <prefix>Mr</prefix>
     <given>John</given>
     <given>Paul</given>
     <family>Smith</family>
     <suffix>BSc</suffix>
    </name>

##### Person Name Structured with Use [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 0..1 | Child element of name
name/given | 0..99 | Child element of name (restricted to 99 for practical purposes)
name/prefix | 0..1 | Child element of name
name/suffix | 0..1 | Child element of name
name/@use | 1..1 |

###### Example 1: To indicate a structured legal person name with prefix (title), two given names (forenames), family name (surname) and suffix

    <name use="L">
     <prefix>Mr</prefix>
     <given>John</given>
     <given>Paul</given>
     <family>Smith</family>
     <suffix>Snr</suffix>
    </name>

##### Person Name Structured with Valid Time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 0..1 | This is a child element of name, which carries the person's surname.
name/given | 0..99 | This is a child element of name (this has been restricted to 99 for practical purposes), which carries the person forenames.
name/prefix | 0..1 | This is a child element of name, which carries prefixes of the person for example Dr, Mrs, Sir etc.
name/suffix | 0..1 | This is a child element of name which carries suffixes of the person for example OBE, MP, BSc etc.
name/validTime | 1..1 | A validTime IVL <TS> > child element can be used to define the timeframe within which this name is valid, e.g. when the current name was assigned or the period during which a previous name was valid.
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.
name/@use | 1..1 |

###### Example 1: To indicate a structured person name with prefix (title), two given names (forenames), family name (surname) and suffix with a validity time.

    <name>
     <prefix>Mr</prefix>
     <given>John</given>
     <given>Paul</given>
     <family>Smith</family>
     <suffix>Snr</suffix>
     <validTime>
      <low value="19990401"/>
      <high value="20040331"/>
    </validTime>
    </name>

##### Person Name Structured with Use and Valid Time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 0..1 | This is a child element of name, which carries the person's surname.
name/given | 0..99 | This is a child element of name (this has been restricted to 99 for practical purposes), which carries the person forenames.
name/prefix | 0..1 | This is a child element of name, which carries prefixes of the person for example Dr, Mrs, Sir etc.
name/suffix | 0..1 | This is a child element of name which carries suffixes of the person for example OBE, MP, BSc etc …
name/validTime | 1..1 | A validTime IVL <TS> child element can be used to define the timeframe within which this name is valid, e.g. when the current name was assigned or the period during which a previous name was valid.
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.
@use | 1..1 |

##### Person Name Structured with Optional Use and Optional Valid Time [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 0..1 | This is a child element of name, which carries the person's surname.
name/given | 0..99 | This is a child element of name (this has been restricted to 99 for practical purposes), which carries the person forenames.
name/prefix | 0..1 | This is a child element of name, which carries prefixes of the person for example Dr, Mrs, Sir etc.
name/suffix | 0..1 | This is a child element of name which carries suffixes of the person for example OBE, MP, BSc etc.
name/validTime | 0..1 | A validTime IVL <TS> child element can be used to define the timeframe within which this name is valid, e.g. when the current name was assigned or the period during which a previous name was valid.
name/validTime/low/@value | 0..1 | The start of the validity period.
name/validTime/high/@value | 0..1 | The end of the validity period.
@use | 1..1 |

###### Example 1: To indicate a structured alias person name with prefix (title), two given names (forenames), family name (surname) and suffix, with a validity date interval

    <name use="A">
     <prefix>Mr</prefix>
     <given>John</given>
     <given>Paul</given>
     <family>Smith</family>
     <suffix>Snr</suffix>
     <validTime>
      <low value="19990401"/>
      <high value="20040331"/>
     </validTime>
    </name>

###### Example 2: To indicate a structured legal person name with prefix (title), two given names (forenames), family name (surname) and suffix, with a validity date interval.

    <name use="L">
     <prefix>Mr</prefix>
     <given>John</given>
     <given>Paul</given>
     <family>Smith</family>
     <suffix>Snr</suffix>
     <validTime>
      <low value="19990401"/>
      <high value="20040331"/>
     </validTime>
    </name>

##### PDS Mini Services Person Name with Optional Use, Given and Family (PN.NHS.PersonNameType1) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/@use | 0..1 |
name/family | 0..1 | This is a child element of name, which carries the person's surname.
name/given | 0..1 | This is a child element of name (this has been restricted to 1 for PDS Mini Services), which carries the person forenames.

###### Example 1: To indicate a person name with one given name (forenames) and family name (surname) with use as usual name .

    <name use="L">
     <given>Paul</given>
     <family>Smith</family>
    </name>

##### PDS Mini Services Person Name with Optional Use, Prefix, 2 Given and Family (PN.NHS.PersonNameType2) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/@use | 0..1 |
name/prefix | 0..1 | This is a child element of name, which carries prefixes of the person for example Dr, Mrs, Sir etc.
name/family | 0..1 | This is a child element of name, which carries the person's surname.
name/given | 0..2 | This is a child element of name (this has been restricted to 2 for PDS Mini Services), which carries the person forenames.

###### Example 1: To indicate a person name with prefix, two given name (forenames) and family name (surname) with use as usual name .

    <name use="L">
     <prefix>Mr</prefix>
     <given>Paul</given>
     <given>John</given>
     <family>Smith</family>
    </name>

##### PDS Mini Services Person Name with Given and Mandatory Family (PN.NHS.PersonNameType3) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 1..1 | This is a child element of name, which carries the person's surname is mandatory.
name/given | 0..1 | This is a child element of name (this has been restricted to 1 for PDS Mini Services), which carries the person forenames.

###### Example 1: To indicate a person name with one given name (forenames) and family name (surname).

    <name>
     <given>Paul</given>
     <family>Smith</family>
    </name>

##### Person Name with Mandatory Given and Family (PN.NHS.PersonNameType6) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must not contain data only the allowed child elements.
name/family | 1..1 | This is a child element of name, which carries the person's surname.
name/given | 1..99 | This is a child element of name (this has been restricted to 99 for practical purposes), which carries the person forenames.

###### Example 1: To indicate a person name with two given names (forenames) and family name (surname).

    <name>
     <given>John</given>
     <given>Paul</given>
     <family>Smith</family>
    </name>

##### Use of nullFlavor with PN Data Type and flavors [F]

###### Example 1: To indicate an unknown unstructured person name.

    <name nullFlavor="UNK"/>

###### Example 2: To indicate an unknown prefix within a structured person name.

    <name>
     <prefix nullFlavor="UNK"/>
     <family>Blair</family>
     <given>Albert</given>
    </name>

#### Physical Quantity (PQ) [D]

Physical quantities are expressed using the two attributes "value" and "unit". Where the measurement was originally taken in a different unit, then this can be sent in addition using the "value", "code", "codeSystem" and "displayName" attributes of the "translation" child element.

##### Flavours:

##### Quantity in Standard Units [F]

This flavor of the physical quantity data type should always be used where the quantity is measured in a set of units encoded using the UCUM representation approved by HL7 V3. If any other units are used, one of the extended expressions must be used to represent the unit used within a translation element.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML element will take the name of HL7 V3 model attribute.
value/@value | 1..1 | The value as an integer or decimal (real) number in the approved units.
value/@unit | 1..1 | The UCUM representation of the unit.

###### Example 1: To indicate a percentage for the "value" attribute of an observation class

    <value value="92.55" unit="%"/>

##### Quantity in Alternative Units [F]

This flavor of the physical quantity data type should be used where the quantity is converted into the approved UCUM representation from an original recording in an alternative set of recognised units. This flavor is used for representing medication dose form quantities recorded using the dm+d coded units of measure.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
quantity | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
quantity/@value | 1..1 | The value as an integer or decimal (real) number in the approved units.
quantity/@unit | 1..1 | The UCUM representation of the approved unit. If the quantity is a count or the approved unit is not known the UCUM non-unit value of "1" for unity should be used.
quantity/translation | 1..1 | Map to alternative coded units.
quantity/translation/@value | 1..1 | The value in the alternative units.
quantity/translation/@code | 1..1 | The code for this approved
quantity/translation/@codeSystem | 1..1 | The OID of the approved/required coding system for this attribute.
quantity/translation/@displayName | 0..1 | The text representation of the units as given in the codeSystem.

###### Example 1: To indicate a measured quantity in alternative units of 30 grams

    <quantity value="30" unit="g">
     <translation value="30" code="258682000" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="gram"/>
    </quantity>

###### Example 2: To indicate a counted quantity in alternative units of 100 tablets

    <quantity value="100" unit="1">
     <translation value="100" code="3319411000001109" codeSystem="2.16.840.1.113883.2.1.3.2.4.15" displayName="tablet"/>
    </quantity>

##### Quantity in Arbitrary Units [F]

This flavor of the physical quantity data type should be used only where the quantity is expressed in arbitrary units for which there is no recognised unit of measure. An example of this might be a medication supply order in which the quantity is expressed as a number of packs of a specific size; for example an order for "6 packets each containing 21 tablets of A and 7 tablets of B".

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
quantity | 1..1 | This XML root element will take the name of HL7 V3 model attribute.
quantity/@value | 1..1 | The numeric value (this should be the same as originalValue and should ignored).
quantity/@unit | 1..1 | 1 (to indicate the UCUM non-unit value of "1" for unity)
quantity/translation | 1..1 | Map to arbitrary units.
quantity/translation/@value | 1..1 | The value in the alternative units.
quantity/translation/originalText | 1..1 | The text representation of the arbitrary units.

###### Example 1: To indicate a counted quantity in arbitrary units:

    <value value="6" unit="1">
     <translation value="6">
     <originalText>packets each containing 21 tablets of A and 7 tablets of B</originalText>
     </translation>
    </value>

#### Point in Time (TS) [D]

The time stamp is sent in the "value" attribute of this data type. Time stamp information is sent in a format that is simplest for the XML schema to validate, as follows: YYYYMMDDHHMMSS[+|-ZZzz], where YYYY is the year, MM the month, DD the day, HH the hour, MM the minutes, SS.the seconds and +|-ZZzz is the time zone offset in hours and minutes. Sections from the right of this representation may be left off to send an imprecise date, thus "2000" would be a valid value for TS, indicating sometime in the year 2000. A timestamp precise down to the hour would be "2000040103". A timestamp precise down to the second would look like "20000401031520".

##### Flavours:

##### Date and Time [F]

The time can be truncated from the right, q.v. belowThe time can be to any nth point of a second and is not constrained by the schema. The table below shows an example illustration to 2dp.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | yyyymmddhhmmss.nn or yyyymmddhhmmss or yyyymmddhhmm or yyyymmddhh

###### Example 1: To indicate an effective time of 12:05 on 25/06/2004

    <effectiveTime value="200406251205"/>

###### Example 2: To indicate an effective time of 12:05.055 on 25/06/2004

    <effectiveTime value="200406251205.055"/>

##### Date Year, Month, Day, Hour and Minute (TS.NHS.DateType1) [F]

Use where date is mandated to contain year, month, day, hour and minute.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | yyyymmddhhmm

###### Example 1: To indicate a time 9am on 7th November 2012

    <effectiveTime value="201211070900"/>

##### Date Year, Month, Day, Hour, Minute and +1 and -1 Hour Time Zone Offset (TS.NHS.DateType2) [F]

This data type supports the representation of time stamp in the format yyyymmddhhmmss[+|-ZZzz]. This data type will only accept +1 and -1 'hour' timezone offset.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | yyyymmddhhmmss[+|-ZZzz]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
time | 1..1 | This XML element will take the name of HL7 V3 model attribute.
time/value | 1..1 | yyyymmddhhmmss[+|-ZZzz]

###### Example 1: To indicate the +1 'hour' timezone offset.

    <time value="20040920103000+0100"/>

##### Date Only [F]

Use where time is not relevant, e.g. 5th June 2002 - "20020605"

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | yyyymmdd

###### Example 1: To indicate an effective time of 25/06/2004

    <effectiveTime value="20040625"/>

##### Date Month [F]

Use where date is approximate - i.e. sometime in June 2002 "200206"

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | yyyymm

###### Example 1: To indicate a birth time in June 2004

    <birthTime value="200406"/>

##### Date Year [F]

Use where date is approximate and only known to year.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | yyyy

###### Example 1: To indicate a birth time in 2004

    <birthTime value="2004"/>

##### PDS Mini Services with format YYYYMMDD (TS.NHS.TimestampType1) [F]

Use where time is not relevant, e.g. 5th June 2002 - "20020605"

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | only YYYYMMDD formatted date allowed

###### Example 1: To indicate an effective time of 25/06/2004

    <effectiveTime value="20040625"/>

##### PDS Mini Services with format YYYYMMDD or YYYY (TS.NHS.TimestampType2) [F]

Use where time is not relevant, e.g. 5th June 2002 - "20020605" or only year is relevant.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | only YYYYMMDD or YYYY formatted date allowed

###### Example 1: To indicate an effective time of 2004

    <effectiveTime value="2004"/>

##### PDS Mini Services with format YYYYMMDD or YYYYMM (TS.NHS.TimestampType3) [F]

Use where time is not relevant, e.g. 5th June 2002 - "20020605" or month year parts of date are relevant.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | only YYYYMMDD or YYYYMM formatted date allowed

###### Example 1: To indicate an effective time of June 2004

    <effectiveTime value="200406"/>

##### PDS Mini Services with format YYYYMMDD or YYYYMM or YYYY (TS.NHS.TimestampType4) [F]

Use where time is not relevant, e.g. 5th June 2002 - "20020605" or month year or just year is used for date.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
effectiveTime | 1..1 | This XML element will take the name of HL7 V3 model attribute.
effectiveTime/value | 1..1 | only YYYYMMDD or YYYYMM or YYYY formatted date allowed

###### Example 1: To indicate an effective time of 25/06/2004

    <effectiveTime value="20040625"/>

#### Quantity (QTY) [D]

An element of the abstract type QTY may be any one of the data types INT (integer), REAL (real), MO (money), TS (time stamp), PQ (physical quantity) and RTO (ratio of quantities) - for all except MO see above or below. It shall be resolved to one of these more specific data types when an instance of a message using it is generated. It is also used in defining certain other data types, such as IVL (interval). This represents the global HL7 V3 standard, and is not an domain specific flavor.

#### Ratio of Integers (RTO<INT>) [D]

A ratio of integers is expressed using two child elements "numerator" and "denominator", both of type INT.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML element will take the name of HL7 V3 model attribute.
value/numerator | 1..1 |
value/numerator/@value | 1..1 | The value as an integer
value/denominator | 1..1 |
value/denominator/@value | 1..1 | The value as an integer

###### Example 1: To indicate a ratio of 1:128 for a "value" attribute of an observation class

    <value>
     <numerator value="1"/>
     <denominator value="128"/>
    </value>

#### Ratio of Physical Quantities (RTO<PQ>) [D]

A ratio of physical quantities is expressed using two child elements "numerator" and "denominator", both should be sent and are of type PQ. They must both be expressed using the same units.

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | This XML element will take the name of HL7 V3 model attribute.
value/numerator/@value | 1..1 |
value/denominator/@value | 1..1 | The value as an integer or decimal (real) number.
/value/numerator/@unit | 1..1 | The UCUM unit code.
/value/denominator | 1..1 |
/value/denominator/@value | 1..1 | The value as an integer or decimal (real) number.
/value/denominator/@unit | 1..1 | The UCUM unit code.

###### Example 1: To indicate a ratio of 1:128 for a "value" attribute of an observation class

    <value>
     <numerator value="1" unit="1"/>
     <denominator value="128" unit="1"/>
    </value>

#### Real (REAL) [D]

Real numbers are 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 represents the precision. A HL7 V3 model attribute, which uses the data type REAL, has an XML element containing one XML attribute “value”.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 0..1 | Shall contain fractional numbers, including integers.
nullFlavor | 0..1 | Allowable, values used must come from the ”nullFlavor” vocabulary

##### Flavours:

##### Real Representation in Messages

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
value | 1..1 | Shall contain the real number.

###### Example 1: When sending the real number to indicate a value of "2.3":

    <value xsi:type="REAL" value="2.3"/>

###### Example 2: When the HL7 V3 model attribute is not mandated therefore a null flavor is allowable and the information is not available on the sending system. To indicate that the value is unknown:

    <value nullFlavor="UNK"/>

#### Set (SET) [D]

This is a collection of distinct data values in no particular order. Where the collection of the integers (17, 13, 99, and 2) would be a SET.

#### Set of addresses (SET<AD>) [D]

A set of addresses

###### Example 1: To indicate a home address and a work place address

    <addr use="H">
    	<streetAddressLine>Cosy Cottage</streetAddressLine>
    	<streetAddressLine>Station Road</streetAddressLine>
    	<streetAddressLine>Pontefract</streetAddressLine>
    	<streetAddressLine>Leeds</streetAddressLine>
    	<postalCode>WF5 2TY</postalCode>
    </addr><addr use="WP">
    	<streetAddressLine>1 High Street</streetAddressLine>
    	<streetAddressLine>Pontefract</streetAddressLine>
    	<streetAddressLine>Leeds</streetAddressLine>
    	<postalCode>WF9 2MK</postalCode>
    </addr>

#### Set of telecoms (SET<TEL>) [D]

A set of telecoms

###### Example 1: To indicate a home and place of work telephone number

    <telecom value="tel:01979641600" use="H"/><telecom value="tel:01097443322" use="WP"/>

#### Telecommunication Address (TEL) [D]

Telephone numbers pager and email addresses and references to external data by the ED data type are all expressed using the URL syntax as described in the HL7 V3 documentation. Note that specification of the type of the address (e.g. fax or email) is built into the URL itself.

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
telecom | 1..1 | Should contain the telecom data carried in the allowed XML attributes and/or child XML elements.
@value | 0..1 | The telecom data
telecom/useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for a telecom: A point in time when the contact telecom details are valid A start and end time (Just including hours and minutes to indicate opening hours of an office for a work telecom. Using dates only for indicating a contact telecom is only for a certain period of time.). A start time only to indicate when the contact telecom is valid from. An end time only to indicate that the contact telecom is only valid until a certain date.
addr/useablePeriod/low/@value | 0..1 | The start of the usable period.
addr/useablePeriod/high/@value | 0..1 | The end of the usable period.
telecom/@use | 0..1 | A suitable use code from the TelecommunicationAddressUse vocabulary may be used to describe the type of telecom .
telecom/@nullFlavor | 0..1 |

The codes for the XML attribute use are:

##### Code Usage:

Code | Name | Definition
--- | --- | ---
H | home address | 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 other contacts are available.
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 call-back 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.

##### Flavours:

##### Telecommunication address [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
telecom | 1..1 | Should contain the telecom data carried in the allowed XML attributes and/or child XML elements.
useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for a telecom: A point in time when the contact telecom details are valid A start and end time (Just including hours and minutes to indicate opening hours of an office for a work address. Using dates for indicating a contact address is only for a certain period of time). A start time only to indicate when the contact telecom is valid from. An end time only to indicate that the contact telecom is only valid until a certain date
@value | 1..1 | The telecom data.
@use | 0..1 | A suitable use code from the TelecommunicationAddressUse vocabulary may be used.

###### Example 1: To indicate a simple telephone number:

    <telecom value="tel:01392251289"/>

###### Example 2: To indicate a home telephone number:

    <telecom use="HP" value="tel:01392251289"/>

###### Example 3: To indicate a work fax number:

    <telecom use="WP" value="fax:01392251689"/>

###### Example 4: To indicate a mobile telephone number with from date

    <telecom use="MC" value="tel:07700012345">
     <useablePeriod>
      <low value="20040401"/>
     </useablePeriod>
    </telecom>

###### Example 5: To indicate an e-mail address

    <telecom value="mailto:joe.bloggs@myisp.co.uk"/>

##### Telecommunication Address with Use and Useable Period (TEL.NPFIT.use.required) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
telecom | 1..1 | Must contain the telecom data and optionally the allowed child element useablePeriod.
useablePeriod | 0..1 | This can be used to indicate some of the following types of valid times for a telecom: A point in time when the contact telecom details are valid A start and end time (Just including hours and minutes to indicate opening hours of an office for a work telecom. Using dates for indicating a contact telecom is only for a certain period of time). A start time only to indicate when the contact telecom is valid from. An end time only to indicate that the contact telecom is only valid until a certain date
@value | 1..1 | The telecom data.
@use | 1..1 | A suitable use code from the PostalAddressUse vocabulary may be used.

###### Example 1: To indicate a mobile telephone number:

    <telecom use="MC" value="tel:07700012345"/>

###### Example 2: Use of nullFlavor with telecom Data Type and flavors. To indicate a unknown telecom

    <telecom nullFlavor="UNK"/>

##### Telephone Number with Use (TEL.NHS.value.mandatory) [F]

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
telecom | 1..1 | Must contain a telephone number.
@value | 1..1 | The telephone number prefixed by tel:
@use | 1..1 | A suitable use code from the PostalAddressUse vocabulary must be used.

###### Example 1: To indicate a mobile telephone number:

    <telecom use="MC" value="tel:07700012345"/>

#### Trivial Name (TN) [D]

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

Trivial names are typically used for places and things, such as Lake Windermere or Leeds Bradford Airport:

Data type overview:

##### XML Usage:

XML element/attribute | Cardinality | Notes
--- | --- | ---
name | 1..1 | Must contain the data only, no child elements are allowed.

###### Example 1: To indicate a place name

    <name>Lake Windermere</name>

###### Example 2:

    <name>Leeds Bradford Airport</name>