ADL2 introduced a new kind of code, the id-code, and also more consistent rules on codes, as follows:

See here for the original work on this.

These rules have the effect that the codes of an ADL1.4 archetype are upgraded on the fly during conversion, as follows:

This code transform can be made reversible from an ADL2 archetype to the ADL1.4 form, for purposes such as:

To achieve round-tripping of the code transform, the following rule must be observed in the creation of any new ADL2 authored archetype:

For the most pedantic form of down-conversion of ADL2 codes, id-codes on nodes that don't need them in ADL 1.4 should be removed (rather than converted down to at-codes).

Synthesizing codes

Synthesizing new codes for constraints that did not have a code in ADL 1.4 presents a small problem. Once the ADL 1.4 gets edited, the new codes added in the ADL 1.4 edit should not conflict with the converted ADL 2. So, it should be done as follows:

Editing ADL 1.4: keeping the ADL 2 conversion backwards compatible

To keep the ADL 2 conversion backwards compatible after the ADL 1.4 form of the archetype has been edited, the same codes should be generated at the same path at subsequent conversions. To do this, the Archie project created a separate conversion log, to be stored together with the ADL 2 archetype. It is not specified and standardized yet, but its implementation can be found at https://github.com/openEHR/archie/tree/master/aom/src/main/java/com/nedap/archie/adl14/log