As we transition to ADL2, and update the REST API, there are a couple of issues that are arising with template-version handling in CDRs.
What is changing…
- templateIds will become fully versioned, namespaces, 'technical identifiers e.g.
org.openehr::openEHR-EHR-COMPOSITION.vital_signs_encounter.v1.2.34
. In transition existing uncontrolled templateIds e.g.UCP - Vital signs
will still be allowed and retained in ADL2 templates as a ‘title’ for human visualisation in tooling.
We expect the new structured templateIds will be automatically generated in a similar
that archetypeIds are generated.
- There are discussions in the REST API group about how templates should be handled in CDRs, in particular, which template updates into the CDR should be allowed without special admin rights, or indeed whether some updates should be prevented altogether e.g. a non-breaking update to an existing template where the current templates is in-use by one or more compositions in production
The good aspect of these changes is that we will be able to exert much more control over the revisions of templates that are deployed, improving clinical safety and data coherence.
The downside is that if not managed carefully, it will present a significant burden to modellers and developers, especially in pre-deployment situations where frequent changes to a template are common.
Different CDRs currently behave somewhat differently.
The BetterCDR allows templates to be overridden, as long as the template name does not change. EHRBase does allow updates, but only via an Admin API, and only if the template has never been used by compositions.
As we move into a situation where we are using ADL2 ‘archetypeHRIDs’ and every revision to a template creates a new templateId string, we need to consider the appropriate behaviour.
As an example
-
We create a new template
com.freshehr::openEHR-EHR-COMPOSITION.vital_signs_hexham_icu.v1.0.0
-
After 6 months, the client asks for a currently constrained node to be made visible, perhaps Mean Arterial BP in a BP archetype. This is a non-breaking change, so the new revision is
com.freshehr::openEHR-EHR-COMPOSITION.vital_signs_hexham_icu.v1.1.0
.
Currently both BetterCDR and Ehrbase would treat this as a completely new template, but really it is a minor revision of an existing template. I would assume that we would always want any compositions to be validated against the latest revision? Do we need to keep the previous revisions (I assume, yes), but only normally display / return the most recent revision. i.e do we ask the CDRs to treat them internally as revisions of the same template, not as new templates.
A major revision e.g. com.freshehr::openEHR-EHR-COMPOSITION.vital_signs_hexham_icu.v2.0.0
would be treated as if it were a new template.
An obvious downstream impact will be on other tooling such as form builders that may not want to be tied to a specific minor revision, so need to reference com.freshehr::openEHR-EHR-COMPOSITION.vital_signs_hexham_icu.v1
(which ADL2 calls an archetype_reference) and not the full archetypeHRID . i.e any revision or patch change below v1 is acceptable. The impact here is really on downstream tooling.
Finally, we also need to consider the impact on pre-publication templates.
We now use com.freshehr::openEHR-EHR-COMPOSITION.vital_signs_hexham_icu.v1.0.0-alpha.1
as our starting revision for new templates (and indeed local archetypes), as this makes transition into publication easier, since we don’t have to switch from .v0 to .v1 when we deploy, disrupting all sorts of downstream activity.
Do the rules need to be any different for pre-publication templates?
Possibly the safest approach is to be able to explicitly mark a CDR or CDR domain as being ‘development’, so that looser rules around updates and deletions can be applied. Ehrbase has something like this in config but it is a bit obscure and is still overly restrictive in some places.