# concerning adl-parser

**URL:** <https://discourse.openehr.org/t/concerning-adl-parser/16438>\
**Category:** Reference Implementation: Java (archive)\
**Created:** [2 September 2013 19:00 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438 "2013-09-02T19:00:51Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [2 September 2013 19:00 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438/1 "2013-09-02T19:00:51Z")

</div>

LinkEHR writes an archetypenode id in a use\_node, the Java ADL-parser regards this as erroneous, although it is permitted in the AOM, where there is an nodeId in the ArchetypeInternalRef constructor.

The repair in adl.jj was, however simply to do. I tested it with all available testfiles, and also with adding an nodeId in the adl-test-entry.archetype\_internal\_ref.test-arc hetype, like this:

attribute3 matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use\_node SECTION /items[at0001]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use\_node SECTION /items[at0002]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;attribute4 matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use\_node SECTION[at0005] /items[at0001]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use\_node SECTION[at0006] /items[at0002]  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

I copied the needed code-change down below:

ArchetypeInternalRef archetype\_internal\_ref(String path, CAttribute parent) :  
{  
&nbsp;&nbsp;&nbsp;String type;  
&nbsp;&nbsp;&nbsp;Interval\<Integer\> occurrences = new Interval\<Integer\>(1, 1);  
&nbsp;&nbsp;&nbsp;String target;  
&nbsp;&nbsp;&nbsp;String nodeID = null;  
}  
{  
&nbsp;&nbsp;&nbsp;\<SYM\_USE\_NODE\> type = type\_identifier()  
&nbsp;&nbsp;&nbsp;&nbsp;[nodeID = constraint\_ref()]  
&nbsp;&nbsp;&nbsp;&nbsp;[occurrences = c\_occurrences()]  
&nbsp;&nbsp;&nbsp;target = absolute\_path()  
&nbsp;&nbsp;&nbsp;{  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return new ArchetypeInternalRef(path, type, occurrences, nodeID, parent,  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;target);  
&nbsp;&nbsp;&nbsp;}  
}

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [3 September 2013 07:32 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438/2 "2013-09-03T07:32:28Z")

</div>

Hi Bert,

As you say, we support node identifiers at internal reference node to make ADL consistent to what the AOM specifications say. That was informed to the lists back in February 2009: [http://lists.openehr.org/pipermail/openehr-technical\_lists.openehr.org/2009-February/004361.html](http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2009-February/004361.html)

We also removed the “units” keyword from ADL parser long time ago as you did 🙂

David

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [3 September 2013 07:52 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438/3 "2013-09-03T07:52:00Z")

</div>

Hi David, Very funny, so I did it too. I did not remember your message from almost 5 years ago 🙂 In Holland we have a saying: “Having a job is one thing, but keeping a job is another thing” So we, in this community are sometimes busy reinventing the wheel. I checked it in github, the reparations are still not in there. But OK, my local version is repaired. Now something else, for lobbying for the good things: Diego promised yesterday, he would very soon update the LinkEHR lite version. I hope he will also post a 64-bit Linux-version, which will help me really a lot. I can then finally use it on my daily workstation. Which will be a great relieve. Thanks, and have a nice day Bert

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [3 September 2013 07:54 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438/4 "2013-09-03T07:54:03Z")

</div>

Hi Bert,  
Could you do a pull request on github with these changes?  
It's much easier for us to keep up with the modifications that way.  
Thank you.

Cheers,

iago

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [3 September 2013 08:02 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438/5 "2013-09-03T08:02:49Z")

</div>

Hi Iago,

Of course I can, I will do it later to day.

Do you want a new branch, or just in the master-branch?

Bert

---

<div class="post-metadata">

**Author:** ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)\
**Post date:** [3 September 2013 08:04 UTC](https://discourse.openehr.org/t/concerning-adl-parser/16438/6 "2013-09-03T08:04:57Z")

</div>

Master should be fine.

Thanks,

iago
