ADL Grammar does not seem to support defaultValue

Description

IN C_DEFINED_OBJECT is default_value as property, which has as explanation that it is mostly used by leafnodes, so, these are the primitive_objects. In the grammar, I cannot find a constraint to use for default_value. I think this is an error, or it is not very well explained how to handle this.

I looked further in the previous version of AOM/ADL, which also has a default_value. I looked at the code from Rong, he always has, on the primitives, a constructor which includes a default_value.

For example, look at this:
https://github.com/openEHR/java-libs/blob/master/openehr-aom/src/main/java/org/openehr/am/archetype/constraintmodel/primitive/CDate.java

The first constructor has a default_value, but the second hasn't.

But when you look here:
https://github.com/openEHR/java-libs/blob/master/adl-parser/src/main/javacc/adl.jj
Line 3137 and 3197, both are lines where the constructor of C_DATE is called, Both call the constructor without default_value.

This means, that default_value was in the specs but it was never used in the Java-libs, also not used in all software based on java-libs.

I don't think this is a good situation.

But what to do?

When I look at the current grammar
c_date: ( DATE_CONSTRAINT_PATTERN | date_value | date_list_value | date_interval_value | date_interval_list_value ) assumed_date_value? ;
assumed_date_value: ';' date_value ;

I see the pattern, and in a exclusive or, all the other possible constraints, which are mostly lists. And it ends with assumed_date_value.

So, again, no default_value.

I find this very confusing.

Bert

Activity

Show:

Bert Verhees February 2, 2016 at 2:03 PM

It is confusing, indeed. Better remove it for the time being, is my opinion, it doesn't look good

Thomas Beale February 2, 2016 at 11:10 AM

At the moment the grammar doesn't support default values, and noone uses them in any archetypes, either ADL 1.4 or 2. We probably should put it off until a next release. I'll try and address the documentation, which I agree is currently confusing on this.

Details

Reporter

Components

Affects versions

Priority

Created February 1, 2016 at 9:56 AM
Updated April 4, 2016 at 9:12 AM