Difference between revisions of "HL7 V3 Datatypes Implementation Notes"

From IHE Wiki
Jump to navigation Jump to search
Line 21: Line 21:
 
The following question was asked on the 2009 NA Connectathon mailing list:
 
The following question was asked on the 2009 NA Connectathon mailing list:
  
  according to the basic schema datatypes-base.xsd, an element of type EN may have sub-elements like given, family, prefix and so on.
+
  according to the basic schema datatypes-base.xsd, an element of type EN may have sub-elements  
<p>
+
like given, family, prefix and so on.
 
  now,
 
  now,
 
  - "given" is of type "en.given"
 
  - "given" is of type "en.given"
Line 31: Line 31:
 
  - "BIN" extends "ANY"
 
  - "BIN" extends "ANY"
 
  - "ANY" doesn't restrict or extend anything
 
  - "ANY" doesn't restrict or extend anything
<p>
 
 
  question: which XMLSchema simple type has to be used for "given"?
 
  question: which XMLSchema simple type has to be used for "given"?
  

Revision as of 12:40, 26 November 2008

Introduction

This page provides some discussion about the HL7 V3 data types, and their XML representation. It is not constrained to a particular IHE profile, but it is hopefully useful to implementers of any CDA Release 2 based content profile, or any integration profile using HL7 V3 messages.

Background

The HL7 V3 data types are defined as an abstract specification, part of the HL7 V3 standard. The current version is Release 1, with Release 2 being in the final stages of development. This discussion is strictly about Release 1 of the HL7 V3 data types.

The abstract data types specification defines the properties of the data types. The XML Implementable Technology Specification (XML ITS) defines how the data types are represented in XML. HL7 publishes XML schemas for the V3 data types, which express most of the properties defined in the abstract specification, however certain rules are impossible to define using the XML schema language. This is one of the reasons that the schemas published by HL7 are informative artifacts, and are not sufficient to implement the full semantics of the V3 data types.

The schemas provided by HL7 are part of the V3 normative editions. The ones part of the 2008 Normative Edition are at ftp://ftp.ihe.net/TF_Implementation_Material/ITI/schema/HL7V3/NE2008/coreschemas/

Implementation notes

The HL7 V3 Data Types specification is one of the more stable and robust parts of the HL7 V3 standard. For anyone tasked with implementing and supporting HL7 V3 messaging, or CDA Release 2 document creation or processing, it will be quite useful to have a single common reusable implementation of the HL7 V3 data types.

The abstract implementation describes the relationships among the various data types, and the XML ITS tries to follow these relationships as close as possible. The HL7 V3 data types have rich semantics, and this results in a quite complicated schema, and also in a complex object-oriented implementation. Note that HL7 has an additional [UML ITS for the HL7 V3 data types], which may be useful for certain development environments, and the HL7 RIM Based Application Architecture (RIMBAA) workgroup has a [Java-based implementation for V3 data types] as part of its Java API for the V3 RIM.

While all major development platforms have tools to automatically generate code based on XML schema, most are not sophisticated enough to properly handle the recursive definitions and generic type extensions used by the HL7 V3 data types. To illustrate this point the following sections will go through the definition of a particular data type to see how its properties are defined.

The Starting Point

The following question was asked on the 2009 NA Connectathon mailing list:

according to the basic schema datatypes-base.xsd, an element of type EN may have sub-elements 
like given, family, prefix and so on.
now,
- "given" is of type "en.given"
- "en.given" restricts "ENXP"
- "ENXP" extends "ST"
- "ST" restricts "ED"
- "ED" extends "BIN"
- "BIN" extends "ANY"
- "ANY" doesn't restrict or extend anything
question: which XMLSchema simple type has to be used for "given"?

In order to answer the question, let's follow the steps of the definition of an element of type en.given