Hi Pablo,
Thanks for the quick answer. I understand that code and test module are the official documentations of the java-libs but I think this increases the entering difficulty level. There is no how to or workflow on how to do stuff with the library. Most of the test functions on the test module are Unit testing and dont show how the different modules interact with each other. A simple workflow would be to load the Oet and the adl from the archetypes, create an OPT structure and output a XML file of that structure. How can I do this using this library? Is it Possible? Whats missing? I dont think that is a logic answer to tell me to use the Ocean Template Designer converter to convert from a OET to a OPT. The answer I was looking was: Yes the java libs can do the conversion look at this code or No, the java-libs doesnt do it and you are free to implement it and ask for a pull request on github. Dont get me wrong I just think that the philosophy of I had a tough time writing it why should I make it easier with documentation or the new guy has to pay the due like I did is not a good way to build an open source community. Regarding the class TemplateDocument you have two classes with similar names: ---openEHR.v1.template.TemplateDocument which parses a OET structure and is a derivation of the archetype class in openEHR.am; ---org.openehr.schemas.v1.TemplateDocument which parses OPT structures and that has the same class names as the previous one but are on different packages and you cannot use the functions you would use on archetypes and OET in this object. Although they are basically the same thing their classes are different. Maybe I just had my expectations too high Best, Duarte Ferreira From: Ref_impl_java [mailto:ref_impl_java-boun...@lists.openehr.org] On Behalf Of pablo pazos Sent: 04 June 2015 19:50 To: Java Ref Impl Subject: RE: Working with templates Hi Duarte, see below. _____ From: dferre...@fe.up.pt <mailto:dferre...@fe.up.pt> To: ref_impl_java@lists.openehr.org <mailto:ref_impl_java@lists.openehr.org> Subject: RE: Working with templates Date: Thu, 4 Jun 2015 10:15:27 +0100 Hi Pablo, Ill try to explain my worlflow: I have a OET lets 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.sp ringsource.com.thoughtworks.xstream <http://ebr.springsource.com/repository/app/bundle/version/detail?name=com.s pringsource.com.thoughtworks.xstream&version=1.4.1> &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.com <http://cabolabs.com/es/home> _____ From: dferre...@fe.up.pt <mailto:dferre...@fe.up.pt> To: ref_impl_java@lists.openehr.org <mailto:ref_impl_java@lists.openehr.org> Subject: Working with templates Date: Wed, 20 May 2015 15:32:50 +0100 Hi, Ive 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. Ive read the documentation from http://www.openehr.org/releases/trunk/architecture/am/tom.pdf and I think Im 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 <mailto: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 <mailto: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