# parsing templates **Category:** [Technical (archive)](https://discourse.openehr.org/c/technical-archive/156) **Created:** 2007-10-22 14:25 UTC **Views:** 4 **Replies:** 4 **URL:** https://discourse.openehr.org/t/parsing-templates/14673 --- ## Post #1 by @Greg_Caulton 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 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 --- ## Post #2 by @system > 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 --- ## Post #3 by @Heath_Frankel3 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- > nhs/xml/openehr/ehr/composition/Emergency\-Headache\-v2draft\.oet?op=file&sc=1 --- ## Post #4 by @thomas.beale 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 --- ## Post #5 by @Greg_Caulton 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 --- **Canonical:** https://discourse.openehr.org/t/parsing-templates/14673 **Original content:** https://discourse.openehr.org/t/parsing-templates/14673