openEHR XML-schemas - Release 1.0.2


This page provides access to the W3C XML schemas for the openEHR Reference Model (RM) and Archetype Model (AM).

Changes from previous release (1.0.1)

  1. UID_BASED_ID is changed to abstract
  2. DV_AMOUNT class, a default value is added to accuracy element. The default value will be used when the accuracy is empty. However, when accuracy is not provided, then there will no default value for accuracy. Based on the spec, the DV_AMOUNT.accuracy is optional.
  1. make AUTHORED_RESOURCE abstract
  2. make RESOURCE_DESCRIPTION.details element mandatory, i.e. change minOccurs="0" to minOccurs="1"
No other schemas are changed in this release.

Stable Schemas

For the RM, separate schemas have been created, as follows:
For the AM, two schemas are provided:

Schemas in Development

Two further schemas are in the draft stage, and are under active development:

Transformation Rules

The following mapping rules were used in order to create the schema from the reference model.

Basic type mappings

The basic types utilise the internal XML simpleTypes in accordance with the assumed types section in the Support IM.  Some changes have been made to the reference model to accommodate these standards.

Reference model type

XML Schema complexType

DV_DATE_TIME value is of type Iso8601DateTime, a restriction of xs:string, matching regular expression
DV_DATE value is of type Iso8601Date, a restriction of xs:string, matching regular expression
DV_TIME value is of type Iso8601Time, a restriction of xs:string, matching regular expression
DV_DURATION value is of type DV_Iso8601Duration, a restriction of xs:string, matching regular expression

Generic types

The openEHR reference model makes use of generic types - including DV_INTERVAL<T> (Data types IM) and VERSION<T> (Common IM) for example. As generic types are now available in C# and Java this is warranted for implementation specifications. Generic types are not available in XML Schema, so specific types prefixed with 'XS_' have been created to provide the same constraints.

Reference model type

XML Schema complexType

Interval<Integer> IntervalOfInteger (BaseTypes.xsd)
Interval<Real> IntervalOfReal (BaseTypes.xsd)
Interval<Date> IntervalOfDate (BaseTypes.xsd)
Interval<Time> IntervalOfTime (BaseTypes.xsd)
Interval<DateTime> IntervalOfDateTime (BaseTypes.xsd)
Interval<Duration> IntervalOfDuration (BaseTypes.xsd)
DV_INTERVAL<DV_ORDERED> only one type is used, namely DV_INTERVAL, with lower and upper of type DV_ORDERED. Software implementations
of the relevant generic types (DV_INTERVAL<DV_DATE> etc) are expected to implement further typing sensibly.
VERSION<T> only one type is used, namely VERSION. The subtype ORIGINAL_VERSION has its data attribute of type LOCATABLE

Multiple Inheritance

There are a couple of places where multiple inheritance occurs in the openEHR reference model. In all cases, only one inheritance branch corresponds to subtyping in the substitutability (i.e. 'is-a') sense; the other branches are always 'facility'  or 'mix-in' inheritance. In the RM, classes inheriting in this way include rm.data_types.quantity.DV_INTERVAL and the rm.data_types.quantity.date_time classes. The latter inherit only interface, which has no visibility in XML-schema. For the former, the inheritance of Interval<T> by DV_INTERVAL<T> is done in the schema simply by direct inclusion, since the other branch of inheritance (of DATA_VALUE) is the one which must be visible to schema processing.

Non-included classes and attributes

The following RM classes are not included in the schema, as they are not needed in the data view: UID, UUID, INTERNET_ID, ISO_OID, and VERSION_TREE_ID. 
UID and its subtypes are not needed because OBJECT_ID has a value attribute of type string and its subtypes have a function that return a UID.

Added attributes

None in the current release.

Conditional Rules

In instance data, LOCATABLE.archetype_details (of type ARCHETYPED) is only included when template_id exists, since the archetype_id attribute from ARCHETYPED is included by default as the value of LOCATABLE.archetype_node_id on archetype root-point LOCATABLE instances (top of a SECTION structure, OBSERVATION structure etc).

XML Attributes and Elements

XML attributes are not used with the exception of the LOCATABLE.archetype_node_id RM attribute, which is, from the point of view of RM classes, true meta-data. Making it an attribute allows archetype paths to be easily mapped to Xpaths.


This work was carried out for the openEHR Foundation  by Ocean Informatics. Many thanks to Dr Chunlan Ma, Heath Frankel and Lisa Thurston for maintaining the openEHR schemas. Thanks to the many people in the community including Mattias Forss and Andrew Patterson, who have provided feedback and improved them
$LastChangedDate: 2006-02-15 05:57:48 +0930 (Wed, 15 Feb 2006) $   $LastChangedRevision$