The resulting “openEHR-EHR-COMPOSITION.report-result.v1.0.4.opt2” has a “specialize” section which is not expected by the ANTLR4 openEHR/adl-antlr Adl2.g4 grammar:
Without the specialize section in an OPT 2 you do not know which archetype is being specialized. So it is necessary to have it there, and I consider it an error in the ANTLR grammar if it is missing.
@thomas.beale should I create an issue in specpr about this? The OPT2 spec says the specialise section should be removed, and it is missing from the grammar.
However, that means with just an OPT2 it is impossible to know which archetype is used at the root of the OPT, and you would need both the OPT2 and the source template to know this. This would make the OPT2 no longer the standalone artifact it is intended to be. Hence, I think the specialize section is necessary in the OPT2 adl, and the text about removing that section should be removed from the OPT2 spec.
OPT 1.4 also contains this information, meaning that omitting this will further complicate migration from 1.4 to 2.
Agreed that this is an issue that we should address?
I think so. I did think about this a long time ago, and came to the conclusion that we didn’t need it, but now can’t remember how that made sense So, yes, PR…