# parsing templates

**URL:** https://discourse.openehr.org/t/parsing-templates/14673
**Category:** Technical (archive)
**Created:** [22 October 2007 14:25 UTC](https://discourse.openehr.org/t/parsing-templates/14673 "2007-10-22T14:25:54Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Greg\_Caulton](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@Greg\_Caulton](https://discourse.openehr.org/u/Greg_Caulton)
#### Post date: [22 October 2007 14:25 UTC](https://discourse.openehr.org/t/parsing-templates/14673/1 "2007-10-22T14:25:54Z")

</div>

Hi,

More basic questions...

The Archetype-Editor is great for defining archetypes for technical  
users. I am looking to leverage templates and archetype content but  
provide a simple to use front end.

The user would go through iterations of searching and selecting  
content, adding it to what would be their own template - or at least  
something I can persist without losing the archetype hierarchy.

Looking at the oet template files e.g.

[http://my.openehr.org/wsvn/knowledge/templates/dev-uk-nhs/xml/openehr/ehr/composition/Emergency-Headache-v2draft.oet?op=file&sc=1](http://my.openehr.org/wsvn/knowledge/templates/dev-uk-nhs/xml/openehr/ehr/composition/Emergency-Headache-v2draft.oet?op=file&sc=1)

The xsd is a general one, not related to templates. The archetypes do  
not have an xsd either - so I cannot use JAXB to generate java classes  
from the definition.

Does this mean that technically only the ADL is the true  
specification, the XML is just for viewing purposes? Would I have to  
dig into the Java implementation to figure out how to parse the ADL  
into a set of objects that I can then display on screen or print?

Is there a simple Java API I can use to get at the OET templates?

thanks!

Greg

---

<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: [22 October 2007 15:24 UTC](https://discourse.openehr.org/t/parsing-templates/14673/2 "2007-10-22T15:24:15Z")

</div>

> Hi,
> 
> More basic questions…
> 
> The Archetype-Editor is great for defining archetypes for technical  
> users. I am looking to leverage templates and archetype content but  
> provide a simple to use front end.
> 
> The user would go through iterations of searching and selecting  
> content, adding it to what would be their own template - or at least  
> something I can persist without losing the archetype hierarchy.
> 
> Looking at the oet template files e.g.
> 
> [http://my.openehr.org/wsvn/knowledge/templates/dev-uk-nhs/xml/openehr/ehr/composition/Emergency-Headache-v2draft.oet?op=file&sc=1](http://my.openehr.org/wsvn/knowledge/templates/dev-uk-nhs/xml/openehr/ehr/composition/Emergency-Headache-v2draft.oet?op=file&sc=1)
> 
> The xsd is a general one, not related to templates. The archetypes do  
> not have an xsd either - so I cannot use JAXB to generate java classes  
> from the definition.

Hi Greg,

Yes, there are XML Schema (xsd) files for RM and AOM  
[http://svn.openehr.org/specification/TAGS/Release-1.0.1/publishing/its/XML-schema/index.html](http://svn.openehr.org/specification/TAGS/Release-1.0.1/publishing/its/XML-schema/index.html)

You might find the following Java project interesting. It was created for a software demonstration session at Medinfo openEHR workshop. The Java source code for XML binding were generated from WSDL by Axis. I guess it’s close to what you want to achieve with xsd files.  
[http://svn.openehr.org/ref\_impl\_java/BRANCHES/sandbox/ehr-bank/](http://svn.openehr.org/ref_impl_java/BRANCHES/sandbox/ehr-bank/)

> Does this mean that technically only the ADL is the true  
> specification, the XML is just for viewing purposes? Would I have to  
> dig into the Java implementation to figure out how to parse the ADL  
> into a set of objects that I can then display on screen or print?
> 
> Is there a simple Java API I can use to get at the OET templates?

Not yet, but the Java project will provide a template parser when early draft specification is available.

Cheers,  
Rong

---

<div class="post-metadata">

### Author: ![Heath\_Frankel3](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/h/e19b73/32.png) [@Heath\_Frankel3](https://discourse.openehr.org/u/Heath_Frankel3)
#### Post date: [22 October 2007 23:53 UTC](https://discourse.openehr.org/t/parsing-templates/14673/3 "2007-10-22T23:53:38Z")

</div>

Greg,  
The XML representation of Archetypes are just as normaitive as ADL, the XML  
(just like ADL using a different syntax) is a serialisation of the Archetype  
Object Model representation of an Archetype.

The OET files are a proprietary template definition used by the Ocean  
Template Designer product. This Template Designer also has a Form Designer  
that can take a template definition and automatically build a form. This  
form can be output as a Form Definition with control constraints expressed  
using the Archetype Object Model constraint object. This form definition  
can be used within the Ocean EhrView web components to render this form  
using ASP.NET.

As mentioned in a separate email, we can also generate an XML representation  
of a template represented using Archetype Object Model constraint objects,  
called an operational template. This is based on the draft template  
specification but has need some augmentation to provide enough information  
for producing other artefacts.

One of these artefacts is what we call a Template Data Schema. It is an XSD  
based on the Template and Archetype definitions. The schema doesn't convey  
all the constraints expressed in the template and archetypes but does give  
someone that is not an expert in openEHR to use the template for the  
purposes you indicated. We have a single XSLT transform to take an XML  
Document valid against the Template Data Schema and produce an XML document  
valid against the openEHR RM XML Schema.

Regards

Heath

Heath Frankel  
Product Development Manager  
Ocean Informatics

Ground Floor, 64 Hindmarsh Square  
Adelaide, SA, 5000  
Australia

ph: +61 (0)8 8223 3075  
mb: +61 (0)412 030 741  
email: heath.frankel@oceaninformatics.com

Regards

Heath

> From: openehr-technical-bounces@openehr.org [mailto:openehr-technical-  
> bounces@openehr.org] On Behalf Of Greg Caulton  
> Sent: Monday, 22 October 2007 11:56 PM  
> To: openEHR-technical@openehr.org  
> Subject: parsing templates
> 
> Hi,
> 
> More basic questions...
> 
> The Archetype-Editor is great for defining archetypes for technical  
> users. I am looking to leverage templates and archetype content but  
> provide a simple to use front end.
> 
> The user would go through iterations of searching and selecting  
> content, adding it to what would be their own template - or at least  
> something I can persist without losing the archetype hierarchy.
> 
> Looking at the oet template files e.g.
> 
> [http://my.openehr.org/wsvn/knowledge/templates/dev-uk-](http://my.openehr.org/wsvn/knowledge/templates/dev-uk-)

nhs/xml/openehr/ehr/composition/Emergency-Headache-v2draft.oet?op=file&sc=1

---

<div class="post-metadata">

### Author: ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)
#### Post date: [23 October 2007 14:54 UTC](https://discourse.openehr.org/t/parsing-templates/14673/4 "2007-10-23T14:54:28Z")

</div>

Heath Frankel wrote:

> Greg,  
> The XML representation of Archetypes are just as normaitive as ADL, the XML  
> (just like ADL using a different syntax) is a serialisation of the Archetype  
> Object Model representation of an Archetype.
> 
> The OET files are a proprietary template definition used by the Ocean  
> Template Designer product. This Template Designer also has a Form Designer  
> that can take a template definition and automatically build a form. This  
> form can be output as a Form Definition with control constraints expressed  
> using the Archetype Object Model constraint object. This form definition  
> can be used within the Ocean EhrView web components to render this form  
> using ASP.NET.

\*we should be clear that the schema of templates is only 'proprietary'  
temporarily. It has been under development and use by Ocean and various  
users, including the UK NHS. Efforts are underway to finalise a draft  
specification of the template specification format for openEHR. As  
anyone will see from an .oet file, the model is relatively simple and is  
not in any way secret. It has just been a case of using something to see  
how well it works before proclaiming it a specification (or standard...).

The draft specification should be available within a few weeks.

- thomas beale

---

<div class="post-metadata">

### Author: ![Greg\_Caulton](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/g/f14d63/32.png) [@Greg\_Caulton](https://discourse.openehr.org/u/Greg_Caulton)
#### Post date: [23 October 2007 16:22 UTC](https://discourse.openehr.org/t/parsing-templates/14673/5 "2007-10-23T16:22:18Z")

</div>

The OET files do look easy to use - did your tool create the csv files as well?

I would love to be able to take the NHS templates and auto generate  
data entry forms for my system - I have a rich client so I would parse  
the XML and translate to my internal format. Importing and exporting  
forms into OpenEHR templates as a compatability feature.

Another advantage is users could have an alternative template designer  
that would be possibly more specialized than I have time to create.

thanks

Greg

Boston, MA  
[http://www.patientos.org](http://www.patientos.org)
