# OpenEHR .oet XML schema

**URL:** https://discourse.openehr.org/t/openehr-oet-xml-schema/15351
**Category:** Technical (archive)
**Created:** [14 April 2015 07:44 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351 "2015-04-14T07:44:40Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![Dmitry\_Baranov1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/d/0ea827/32.png) [@Dmitry\_Baranov1](https://discourse.openehr.org/u/Dmitry_Baranov1)
#### Post date: [14 April 2015 07:44 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/1 "2015-04-14T07:44:40Z")

</div>

I’m exploring samples from the OpenEHR CKM app ([http://openehr.org/ckm/](http://openehr.org/ckm/)) and see that XML schema namespace for the OET templates is “openEHR/v1/Template”. Where that XML Schema is hosted?

As far as I understood, the “openEHR/v1/Template” namespace references an XML template schema definition for version 1.0.1 which is not available for download ([http://www.openehr.org/releases/1.0.1/its/XML-schema/](http://www.openehr.org/releases/1.0.1/its/XML-schema/))

Tried to use OET XML Schema taken from 1.0.2 distr ([http://www.openehr.org/releases/1.0.2/its/XML-schema/](http://www.openehr.org/releases/1.0.2/its/XML-schema/)) but sample template OET files taken from CKM do not pass v1.0.2 XML schema validation.

So the question is: which OpenEHR template XML schema is actual and up-to-date?

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [14 April 2015 10:05 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/2 "2015-04-14T10:05:11Z")

</div>

Hi Dmitri,

.oet is an internal Ocean format used by the Template Designer.

As far as I know this is the current version …

[https://github.com/openEHR/java-libs/blob/master/oet-parser/src/main/xsd/CompositionTemplate.xsd](https://github.com/openEHR/java-libs/blob/master/oet-parser/src/main/xsd/CompositionTemplate.xsd)

The key template schema which you should probably be investigating is the Operational Template .opt (which is generated by the Template Designer).

[https://github.com/openEHR/java-libs/blob/master/oet-parser/src/main/xsd/Template.xsd](https://github.com/openEHR/java-libs/blob/master/oet-parser/src/main/xsd/Template.xsd)

It depends on what are you trying to do. Can you tell us more about your project?

Ian  
Dr Ian McNicoll  
mobile +44 (0)775 209 7859  
office +44 (0)1536 414994  
skype: ianmcnicoll  
email: [ian@freshehr.com](mailto:ian@freshehr.com)  
twitter: @ianmcnicoll

Co-Chair, openEHR Foundation Management Board  
Director, freshEHR Clinical Informatics  
Director, HANDIHealth CIC  
Hon. Senior Research Associate, CHIME, UCL

---

<div class="post-metadata">

### Author: ![Dmitry\_Baranov2](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@Dmitry\_Baranov2](https://discourse.openehr.org/u/Dmitry_Baranov2)
#### Post date: [14 April 2015 11:32 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/3 "2015-04-14T11:32:16Z")

</div>

Hi Ian,  
I'm trying to implement a EHR module that uses Oracle XML DB as a storage for clinical records in form of clinical document. A template defines the structure of such document (consultation note, evaluation note, operation note and so on), and EHR module produces a document that match particular template. So I just need an XML-schema-based template definition format but can't decide which one is more suitable.  
Got your links, thank you.

---

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [14 April 2015 11:57 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/4 "2015-04-14T11:57:39Z")

</div>

The correct artefact to use for this purpose is the operational template originally developed by Ocean.

If you look at the Marand ehrscape API [dev.ehrscape.com](http://dev.ehrscape.com) you will see how it used

The Ocean, code24, Privantis, Infinnity , ADOC. Cabolabs and Nousco backends all use this format.

Ian

---

<div class="post-metadata">

### Author: ![Seref](https://discourse.openehr.org/user_avatar/discourse.openehr.org/seref/32/13_2.png) [@Seref](https://discourse.openehr.org/u/Seref)
#### Post date: [14 April 2015 12:08 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/5 "2015-04-14T12:08:17Z")

</div>

Hi Ian,  
I’m not sure if you’re prescribing the right medicine here 🙂 My understanding is Dmitry is looking for a schema to use as the basis of persistence. Opt(operational template)s define models, not actual data instances that conform to models.

Assuming that this is the case, the canonical schemas published along the specifications is more likely to be the answer. Dmitry, have you asked yourself the following question: what will happen when new templates are introduced? Will you create a set of tables for each new template? If you are to drive persistence implementation through a schema, you’d better invest into one that does not change as models change. The canonical schema satisfies this property.

Regards  
Seref

---

<div class="post-metadata">

### Author: ![Dmitry\_Baranov2](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@Dmitry\_Baranov2](https://discourse.openehr.org/u/Dmitry_Baranov2)
#### Post date: [14 April 2015 13:33 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/6 "2015-04-14T13:33:35Z")

</div>

Hi Seref, persistence is clear for me, and I was looking for an appropriate model XML-schema, of course.

> Seref Arikan  
> Hi Ian, I'm not sure if you're prescribing the right medicine here 🙂 My understanding is Dmitry is looking for a schema to use as the basis of persistence.

Regards, Dmitry

---

<div class="post-metadata">

### Author: ![Seref](https://discourse.openehr.org/user_avatar/discourse.openehr.org/seref/32/13_2.png) [@Seref](https://discourse.openehr.org/u/Seref)
#### Post date: [14 April 2015 14:42 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/7 "2015-04-14T14:42:05Z")

</div>

In that case, kudos and apologies to Ian. His suggestion is spot on.

---

<div class="post-metadata">

### Author: ![Dmitry\_Baranov2](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/d/8baadc/32.png) [@Dmitry\_Baranov2](https://discourse.openehr.org/u/Dmitry_Baranov2)
#### Post date: [14 April 2015 15:15 UTC](https://discourse.openehr.org/t/openehr-oet-xml-schema/15351/8 "2015-04-14T15:15:57Z")

</div>

Ian, one more little question to you: can one consider .OPT templates from the OpenEHR CKM web application as thoroughly verified reference samples or rather not?  
I still get a lot of validation errors trying to validate them with the latest version of Template.xsd from github (testing on eReferral template in opt format using Visual Studio 2013). It seems to me that XML formally is correct and almost conforms to the XML schema but there is something wrong with element ordering.
