# Updating archetype of a composition

**URL:** <https://discourse.openehr.org/t/updating-archetype-of-a-composition/1789>\
**Category:** RM\
**Created:** [19 August 2021 13:00 UTC](https://discourse.openehr.org/t/updating-archetype-of-a-composition/1789 "2021-08-19T13:00:55Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jelte](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/j/a5b964/32.png) [@Jelte](https://discourse.openehr.org/u/Jelte)\
**Post date:** [19 August 2021 13:00 UTC](https://discourse.openehr.org/t/updating-archetype-of-a-composition/1789/1 "2021-08-19T13:00:56Z")

</div>

We are looking into updating existing compositions to use a new version of an archetype.

However the [VERSIONED\_COMPOSITION](https://specifications.openehr.org/releases/RM/latest/ehr.html#_versioned_composition_class) class has this invariant:

> _Archetype\_node\_id\_valid_: `for_all v in all_versions | v.archetype_node_id.is_equal (all_versions.first.archetype_node_id)`

And the archetype\_node\_id [should contain the stringified archetype\_id](https://specifications.openehr.org/releases/RM/latest/common.html#_locatable_class):

> At an archetype root point, the value of this attribute _[archetype\_node\_id]_ is always the stringified form of the `archetype_id` found in the `archetype_details` object.

This seems to imply that the archetype\_id (including the version number) cannot change between composition versions.

Is my understanding of this constraint correct, i.e. is updating the archetype of a composition currently not allowed?

If so, should this be allowed? I think it is valid for long-lived (e.g. `persistent` and `episodic`) compositions to be migrated to a new archetype version. For example, when a new field is added it should become usable in existing compositions.

What do you think?

---

<div class="post-metadata">

**Author:** ![thomas.beale](https://discourse.openehr.org/user_avatar/discourse.openehr.org/thomas.beale/32/35_2.png) [@thomas.beale](https://discourse.openehr.org/u/thomas.beale)\
**Post date:** [20 August 2021 10:59 UTC](https://discourse.openehr.org/t/updating-archetype-of-a-composition/1789/2 "2021-08-20T10:59:39Z")

</div>

Jelte,  
We are now discussing this issue in [SPECPR-373](https://openehr.atlassian.net/browse/SPECPR-373).
