se.acode.openehr.parser.ParseException: Encountered "precision" at line 92, column 25

Should I report more errors?

All these errors do not occur in the adl_workbench

regards
Bert

archetype:
archetypes/dev/adl/test/clinical_types/adl-test-entry.c_dv_quantity.draft.adl

se.acode.openehr.parser.ParseException: Encountered "precision" at line
92, column 25.
Was expecting one of:
    "units" ...
    "units" ...
    
    at
se.acode.openehr.parser.ADLParser.generateParseException(ADLParser.java:7070)
    at
se.acode.openehr.parser.ADLParser.jj_consume_token(ADLParser.java:6932)
    at
se.acode.openehr.parser.ADLParser.c_dv_quantity_item(ADLParser.java:3388)
    at se.acode.openehr.parser.ADLParser.c_dv_quantity(ADLParser.java:3288)
    at se.acode.openehr.parser.ADLParser.c_object(ADLParser.java:2464)
    at se.acode.openehr.parser.ADLParser.c_attr_values(ADLParser.java:2674)
    at se.acode.openehr.parser.ADLParser.c_attribute(ADLParser.java:2646)
    at
se.acode.openehr.parser.ADLParser.c_complex_object_body(ADLParser.java:2439)
    at
se.acode.openehr.parser.ADLParser.c_complex_object(ADLParser.java:2422)
    at se.acode.openehr.parser.ADLParser.cadl_text(ADLParser.java:2388)
    at se.acode.openehr.parser.ADLParser.arch_definition(ADLParser.java:682)
    at se.acode.openehr.parser.ADLParser.archetype(ADLParser.java:276)
    at se.acode.openehr.parser.ADLParser.parse(ADLParser.java:100)

Should I report more errors?

All these errors do not occur in the adl_workbench

Hi Bert,

You can’t use the adl_workbench as the reference. It is the openEHR design specification that counts. It could be more permissive than the specifications due to backwards compatibility reason etc.

In this case, the following ADL is valid dADL but invalid according to the object model it binds to. The units attribute of C_QUANTITY_ITEM is not optional according to the openEHR Archetype Profile.

clinical_quantity_attr_6 matches {
C_DV_QUANTITY <
property = <[openehr::127]>
list = <
[“1”] = <
precision = <|2|>

}

The current Java ADL Parser does some validation of object model as part of parsing. This makes it quite complex thus hard to maintain. I am currently separate the dADL parser from the ADL parser and plan to use reflection on the object model to get information on attributes for validation. This will make the parser much smaller. And we will have other uses for the dADL paser.

Cheers,
Rong

Rong Chen schreef:

    Should I report more errors?

    All these errors do not occur in the adl_workbench

Hi Bert,

You can't use the adl_workbench as the reference. It is the openEHR
design specification that counts. It could be more permissive than the
specifications due to backwards compatibility reason etc.

In this case, the following ADL is valid dADL but invalid according to
the object model it binds to. The units attribute of C_QUANTITY_ITEM
is not optional according to the openEHR Archetype Profile.

Yes, Rong, I checked it, You are right, thanks for this.
I was indeed using the adl_workbench as an extra check, I should have
paid more attention to the stack trace, but the error messages are
difficult to understand. In my opinion, they could be more explanatory,
but now I see, I understand the stacktrace better.

Thanks
Bert