This wiki has undergone a migration to Confluence found Here

XML Schema Documentation

From HL7Wiki
Revision as of 18:45, 15 September 2005 by GrahameGrieve (talk | contribs)
Jump to navigation Jump to search

Scope

There was a plan to write a schema requirements document, but no solid requirements for the requirements document emerged. We now plan to add schema implementation issues as appendixes in the XML data types and, if necessary, the XML structures document.

This document is a place to record requirements and draft the content that fills the requirement. The document is divided into 2 parts, issues to address, and then the actual content in response.

If you have issues you would like the document to discuss, please record them in the first section by editing the document.

Issues to Address

Todo: add generic template description in section B.2

Draft Content (XML Data Types)

The schema representations are provided for convenience, as the XML schema is a compact and specific way to describe the XML representation. However the schema is not in itself a normative part of this specification. While HL7 publishes schema for the HL7 data types, other schemas could be proposed that describes the same XML representation, and these schemas are no less valid, though they may differ in their usefulness for a given task. It is the XML representation of the data type that is normative.

This schema defines a complex type for each data type described in this specification as having an Element form (e.g., ED and CD), the name of the complex type is the value of the "Symbol" column for the type as given in Table 1.

This schema also defines a simple type for each data type described in this specification as having an Attribute form (e.g., ST and CS), the name of the simple type is the lower-case version of the "Symbol" column for the type as given in Table 1.

For some data types, one or more Schematron [1] patterns are defined as xs:appinfo annotations in either the complex type or simple type defintion. These patterns define additional validation rules that go above-and-beyond what can be expressed in XML Schema. The most common rule checks the condition that an instance of a type can have either an nullFlavor or some combination of other s but not both. Please refer to the Schematron specification [2] for further information.

This schema does not completely represent all constraints for every data type as specified in the Data Types Abstract Specification. For example, the distinction between SET, BAG and LIST (unique/unordered, non-unique/unordered and non-unique/ordered) are not enforced by this schema. The Schematron rules described in above can be used to check some, but not all, of these additional contraints. This has the implication that an instance which validates against the schema may still not be a valid HL7 instance.

The schema is contained in two separate schema documents, one for the base types and a smaller one for instantiations of generic types. Note: at present, definitions for generic types that are used as the type of data type components are defined in the schema document for the base types.

Draft Content (XML Data Types)

(none)