Hello Marcio

Perhaps the quickest route to do this would be to use the java reference 
implementation (http://www.openehr.org/projects/java.html) and more 
specifically the classes ADLParser and Archetype. Essentially, you 
create a new ADLParser object passing as  a parameter a standard file 
object pointing to your ADL file and then from the parser you can obtain 
an Archetype object using the parse() member function.

//For a (minimal) example
File fd;
ADLParser theParser;
Archetype MyArchetype;

fd = new File("openEHR-EHR-OBSERVATION.blood_pressure.v1.adl");
theParser = new ADLParser(fd);
MyArchetype = theParser.parse();
//--------------------------------------------------------------
// It omits some exception handling but this is the main idea

You can now traverse the archetype structure implied by your .adl file 
using the functions of Archetype such as getAdlVersion(), 
getConceptName(), getChildren() and others.


You could also use the Clinical Knowledge Manager 
(http://openehr.org/knowledge/) to browse archetypes of interest and 
download them in XML (rather than ADL). From there you could possibly 
process the XML to recover anything you want (concepts, terms, labels etc).

The code from the opereffa project 
(http://opereffa.chime.ucl.ac.uk/introduction.jsf) might also be helpful 
for you, depending on what exactly you are trying to do (Web app in 
Java, deployed over Tomcat).

That one is very detailed in that it includes all the necessary (and 
extensive) work that is required to handle Archetype(able) information 
through the current reference implementation and the Data Access Objects 
"mechanism". If my memory is not failing me, it also includes an actual 
user interface generator so that forms accepting data are constructed 
through the archetypes.

I hope this helps.

All the best
Athanasios Anastasiou

On 26/01/2012 17:43, M?rcio Costa wrote:
> Hello guys,
>
> i'm trying to build a app using arquetypes and i need to read the ADL to
> build my interface.
>
> where i can get some examples how reading ADL 1.5? Is there some API to
> do that?
>
> thanks in advance,
>
> *M?rcio Costa*
> B.Sc. in Computer Science @ Cin/UFPE
> M.Sc. Candidate in Computer Science @ CIn/UFPE
> MSN: mdckoury at gmail.com <mailto:mdckoury at gmail.com>
>

Reply via email to