Hi Duarte, see below. From: dferre...@fe.up.pt To: ref_impl_java@lists.openehr.org Subject: RE: Working with templates Date: Thu, 4 Jun 2015 10:15:27 +0100
Hi Pablo, I’ll try to explain my worlflow:I have a OET let’s say I have http://www.openehr.org/ckm/#showTemplate_1013.26.13_OET and I want to parse it using the java-libs.If I use the OETParser class to parse this xml and then use the Flattener class to do the flatten of the OET I should get an OPT as a result, right? Not sure about that, you should look at the code. What I really wanted to do is reach a workable OPT representation in Java. Use the Ocean Template Designer, load the OET and export the OPT. My knowledge repo might help you. I have created some templates (OET) and exported the correspondent Operational Templates (OPT). There I also have flat XSDs to validate OPTs and Versions (contains Compositions). I found the class “org.openehr.schemas.v1.TemplateDocument” which we can use in the following code:TemplateDocument templateDoc = TemplateDocument.Factory.parse(optString, options);And get a TemplateDocument which is a generated class from the XSD and the XML. Check the tests of that class, because I don't know if that parses an OET or an OPT. Looking at the structure of the class I found that many classes have the same name as the ones from the classes that represent C_COMPLEX_OBJECT, C_SINGLE_ATTRIBUTE, etc… from the package org.openehr.am. The template model is an extension of the archetype model, so many constraint classes like those you mention are shared between models. This is for the current version of openEHR, in the next version we'll have archetypes and templates using the same model and both will have ADL representation. I think I need is a “how to” on how we are supposed to work with the java libs. The best is to run the tests, executing the debugger to see what's happening. Also try to parse some templates from the CKM or from my knowledge repo on GitHub and do debugging. In a couple of hours you will know how it works and what it generates. What I used a lot was XStream to see the generated object structure in XML: http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.springsource.com.thoughtworks.xstream&version=1.4.1 Hope that helps! Thanks,Duarte Ferreira From: Ref_impl_java [mailto:ref_impl_java-boun...@lists.openehr.org] On Behalf Of pablo pazos Sent: 28 May 2015 08:41 To: Java Ref Impl Subject: RE: Working with templates Hi Duarte, can you share the OPTs and the diff? Thanks! -- Kind regards, Eng. Pablo Pazos Gutiérrez http://cabolabs.comFrom: dferre...@fe.up.pt To: ref_impl_java@lists.openehr.org Subject: Working with templates Date: Wed, 20 May 2015 15:32:50 +0100Hi, I’ve been working with the java-libs trying to parse templates.I used the parser and the flattener but when I serialize it to XML and compare it to the flattened (OPT) version from CKM, they are different.I’ve read the documentation from http://www.openehr.org/releases/trunk/architecture/am/tom.pdf and I think I’m missing a compression step.Is this compression step already implemented on the Java libs or is there a way to get an OPT structure? Thanks,Duarte Ferreira _______________________________________________ Ref_impl_java mailing list Ref_impl_java@lists.openehr.org http://lists.openehr.org/mailman/listinfo/ref_impl_java_lists.openehr.org _______________________________________________ Ref_impl_java mailing list Ref_impl_java@lists.openehr.org http://lists.openehr.org/mailman/listinfo/ref_impl_java_lists.openehr.org
_______________________________________________ Ref_impl_java mailing list Ref_impl_java@lists.openehr.org http://lists.openehr.org/mailman/listinfo/ref_impl_java_lists.openehr.org