Doubt parsing ADL file

Hi,

I’m using the java-libs to parse some adl files from the Clinical Knowledge Manager(CKM).

I’m getting some crashes due to stackoverflow when trying to do Archetype.toString().

When I checked the Archetype I saw a loop. The field Archetype.description.parentResourse was pointing back at the Archetype.

My confusion seems to be in the function org.openehr.rm.common.resource.AuthoredResource.setDescription().

I don’t understand why :
if (description != null && description.getParentResource() != this) {

description.setParentResource(this);

}

In this code we send “this” to be set as its own parentResource in the description.

Can anyone help me understand why this is happening?

Best,

Duarte Ferreira

The Resource contains the Description, so,
Description.parent = Resource

See http://openehr.org/releases/1.0.2/architecture/rm/common_im.pdf page 60

Hi

Can you point us to one of the archetypes ? Open the archetype in ckm and click the envelope button on the toolbar to get the link

Thanks, I’ll check the documentation.

Best,

Duarte Ferreira

I’m using the http://www.openehr.org/ckm/#showArchetype_1013.1.130 as an example.

Best,

Duarte Ferreira

Hi,

If you want to get an archetype object serialized into ADL format use the ADLSerializer class (i.e. new ADLSerializer().output(archetype); ).

Cheers,

iago