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 {
             use_node SECTION /items[at0001]
             use_node SECTION /items[at0002]
         }
         attribute4 matches {
             use_node SECTION[at0005] /items[at0001]
             use_node SECTION[at0006] /items[at0002]
         }

I copied the needed code-change down below:

ArchetypeInternalRef archetype_internal_ref(String path, CAttribute 
parent) :
{
   String type;
   Interval<Integer> occurrences = new Interval<Integer>(1, 1);
   String target;
   String nodeID = null;
}
{
   <SYM_USE_NODE> type = type_identifier()
    [ nodeID = constraint_ref() ]
    [ occurrences = c_occurrences() ]
   target = absolute_path()
   {
       return new ArchetypeInternalRef(path, type, occurrences, nodeID, 
parent,
               target);
   }
}
---------------------------------------
Also, I mentioned another problem in the ADL-parser last week, but I got 
no feedback on that, it was maybe because it was a bit confusing.

Again, below the description and how to change the code:

The ADL-Parser is not capable of parsing EN13606 archetypes because of 
the keyword "units" which belongs to the EN13606 datatype PQ.

I solved this problem by commenting out all occurrences of SYM_UNITS

This is in line 2958, becomes:
CDvQuantityItem c_dv_quantity_item() :
{
   Interval value = null;
   Interval precision = null;
   String units;
}
{
   "[" string_value() "]" <SYM_EQ> "<"

     (<SYM_C_QUANTITY_UNITS>) <SYM_EQ> "<"
       units = string_value()
     ">"

     [
       <SYM_MAGNITUDE> <SYM_EQ> "<"
         value = real_interval_value()
       ">"
     ]

     [
       <SYM_PRECISION> <SYM_EQ> "<"
         precision = integer_interval_value()
       ">"
     ]
   ">"
   {
       return new CDvQuantityItem(value, precision, units);
   }
}

and line 341 containing: | < SYM_UNITS: "units"> :DOMAIN_TYPE_C_QUANTITY
is removed
--------------------------
I don't know if it is wished that both issues which are repaired this 
way will be posted in the according repository.
If so, I can post the change.

If not, it works for me.

Thanks
Bert


Reply via email to