# Inherited VERSION.uid to be copied to COMPOSITION.uid

**URL:** https://discourse.openehr.org/t/inherited-version-uid-to-be-copied-to-composition-uid/17183
**Category:** Platform
**Created:** [6 August 2026 16:19 UTC](https://discourse.openehr.org/t/inherited-version-uid-to-be-copied-to-composition-uid/17183 "2026-08-06T16:19:29Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![borut.jures](https://discourse.openehr.org/user_avatar/discourse.openehr.org/borut.jures/32/1391_2.png) [@borut.jures](https://discourse.openehr.org/u/borut.jures)
#### Post date: [6 August 2026 16:19 UTC](https://discourse.openehr.org/t/inherited-version-uid-to-be-copied-to-composition-uid/17183/1 "2026-08-06T16:19:29Z")

</div>

In [COMPOSITION Class](https://specifications.openehr.org/releases/RM/latest/ehr.html#_composition_class) is a note:

> It is strongly recommended that the inherited attribute uid be populated in Compositions, using the UID copied from the object\_id() of the uid field of the enclosing VERSION object.For example, the ORIGINAL\_VERSION.uid 87284370-2D4B-4e3d-A3F3-F303D2F4F34B::uk.nhs.ehr1::2 would be copied to the uid field of the Composition.

The note says that only `OBJECT_VERSION_ID.object_id()` part of the VERSION.uid is copied to COMPOSITION.uid. The provided example in the node shows the full OBJECT\_VERSION\_ID.

Based on the similar text found in [9.2.2. Levels of Identification](https://specifications.openehr.org/releases/BASE/development/architecture_overview.html#_levels_of_identification), it seems the note should state that the full VERSION.uid should be copied to COMPOSITION.uid.

The copying is done only if COMPOSITION.uid is not provided in the payload. There was a [discussion](https://discourse.openehr.org/t/sending-uid-in-a-new-composition/2312/4) about what happens when COMPOSITION.uid is specified by the caller. No conclusion was reached and the thread is 4 years old.

Specification uses “is strongly recommended,” which allows UIDs provided by the user. [REST API](https://specifications.openehr.org/releases/ITS-REST/Release-1.1.0/ehr.html#tag/COMPOSITION/operation/composition_create) also allows user provided UID.

We should either explicitly reject COMPOSITION.uid in the payload or allow it. If a CDR accepts a payload with a UID as valid, it shouldn’t silently overwrite it. This might surprise users and data could be lost if they expected their UID to be used and persisted.

I don’t have real world experience regarding whether users can provide their own UIDs. The specifications should be clearer about this.

I’ll put allowing/rejecting COMPOSITION.uid in payload under a configuration flag for now.

How did others implement this? Are you using OBJECT\_VERSION\_ID for COMPOSITION.uid? Do you always overwrite it if it is received in the payload?
