In latest Archetype Designer v1.24.7, it seems at codes are not assigned to ITEM_TREE in EVALUATION and ACTION archetypes. Same doesn’t happen with OBSERVATION and INSTRUCTION archetypes. See screenshot below:
I have detected that recently and needed to edit my archetypes and templates manually to add that atcode, so I switched back to the good old Ocean Archetype Editor
In the Better Designer I also detected it adds atcodes at the DV_xxx level, which I also needed to remove manually.
@ian.mcnicoll just checked the model and it seems EVENT_CONTEXT is PATHABLE but not LOCATABLE. I’m wondering, since it has an ITEM_STRUCTURE that needs to be archetyped, if it should be LOCATABLE.
Thanks for the feedback & confirmation, it’s less than ideal to have to add/remove these codes manually. When saving a composition with missing at code on item_tree, CDR does throw validation error correctly. But this happens much too late in the tool chain, ideally this error of missing at code should be caught or prevented early on. Wonder if CKM detects it when archetypes with missing at code get uploaded. @sebastian.garde
If you have the corresponding at code remains in the ontology for example this gives a warning of an unused code (WOUP).
Or if you have a previous revision of the archetype in ckm, this would be detected as a major change, where all the red flags should be up.
Or if you have an internal reference to the ITEM_TREE, the Use_node path would be detected as invalid (VUNP). Typical in e.g. OBSERVATIONs, e.g. Alcohol intake, Draft archetype [Internet]. openEHR Foundation, openEHR Clinical Knowledge Manager [cited: 2023-05-26]. Available from: https://ckm.openehr.org/ckm/archetypes/1013.1.1631
If the rule is indeed the one Ian mentions…
…then this validation shouldn’t be too hard to add as an explicit additional validation check.
I think it’s necessary to add an explicit validation check on this to prevent missing at code in LACATABLE classes from causing issues in downstream software.
In ADL2, every object node has to have a code (but not every code has to have a terminology definition - that is only needed if there are siblings).
I’m mentioning ADL2 because inside Archetype Designer it is AOM2, and there should be internal codes on every node, so AD should be able to provide an equivalent at-code on every object node in the AOM1.4 view.