# Replacing an archetyped value set - AD and CKM bug?

**URL:** https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958
**Category:** Tool Support
**Tags:** archetype, template
**Created:** [26 November 2024 14:37 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958 "2024-11-26T14:37:54Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [26 November 2024 14:37 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/1 "2024-11-26T14:37:54Z")

</div>

I was just made aware that AD allows a template modeller to replace an internal value set from an archetyped DV\_CODED\_TEXT data element:

 ![image](https://discourse.openehr.org/uploads/default/original/2X/4/4e795adeae74d1ad45888ff65b5120d13756df65.png)  
 ![image](https://discourse.openehr.org/uploads/default/original/2X/8/813bf4ddfbb61c33ede98e1d2ed31a7ae30d74a8.png)

The way I understand the whole concept of constraint modelling, this shouldn’t be allowed. When we constrain an archetyped DV\_CODED\_TEXT to a specific set of values, without the alternative of an unconstrained DV\_TEXT, it’s because the included value set should always be used.

The values also follow when exporting an oet from the template, and the CKM gladly accepts them without sounding the validation alarm.

@borut.fabjan and @sebastian.garde, do you have any thoughts about this?

---

<div class="post-metadata">

### Author: ![sebastian.garde](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.garde/32/3070_2.png) [@sebastian.garde](https://discourse.openehr.org/u/sebastian.garde)
#### Post date: [26 November 2024 14:48 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/2 "2024-11-26T14:48:02Z")

</div>

@siljelb This is definitely not allowed in 1.4 land, although I have heard that some find it useful regardless…

This is why we had the Binding strength / constraint strength discussion and have added the ability to mark a value set as

_required, preferred, extensible, example_

in 2.x.

In 1.4, it is always “required” and then this is not allowed - the only alternative I know is the DV\_TEXT/DV\_CODED\_TEXT cludge you mentioned.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [27 November 2024 07:38 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/3 "2024-11-27T07:38:26Z")

</div>

When setting it as “required”, especially in an international context, I think, the author(s) should be very cautious.

For example, FHIR Patient.gender has a “required” binding to the [AdministrativeGender](https://hl7.org/fhir/R4/valueset-administrative-gender.html) ValueSet:

 ![image](https://discourse.openehr.org/uploads/default/original/2X/3/3e4254019e427e32dd1785f7aa4de9c906536864.png)  
But, sometimes, it might be kinda annoying. For example, for a national implementation guide, it might be necessary to change its binding to a national ValueSet.

Similarly, in contrast, a good practice is to set the minimum cardinality to zero for most elements of FHIR resources.

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [27 November 2024 07:52 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/4 "2024-11-27T07:52:15Z")

</div>

> [@linforest](#):
>
> When setting it as “required”, especially in an international context, I think, the author(s) should be very cautious.

I agree, and the pattern we mostly use nowadays reflects this. But when we do choose to require a specific value set, it shouldn’t be up to the template modeller to change it.

---

<div class="post-metadata">

### Author: ![linforest](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/l/ac8455/32.png) [@linforest](https://discourse.openehr.org/u/linforest)
#### Post date: [27 November 2024 07:55 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/5 "2024-11-27T07:55:52Z")

</div>

Understand. However, when releasing the archetype(s), it’s hard to think of all the use case scenarios, especially some edge cases.

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [29 November 2024 15:12 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/6 "2024-11-29T15:12:47Z")

</div>

@borut.fabjan, what are your thoughts about this? 😊

---

<div class="post-metadata">

### Author: ![siljelb](https://discourse.openehr.org/user_avatar/discourse.openehr.org/siljelb/32/12_2.png) [@siljelb](https://discourse.openehr.org/u/siljelb)
#### Post date: [3 March 2025 14:39 UTC](https://discourse.openehr.org/t/replacing-an-archetyped-value-set-ad-and-ckm-bug/5958/7 "2025-03-03T14:39:54Z")

</div>

`*`_ **bump** _`*`

This choice is still available in AD, and beginners are still using it because of course they are when it’s presented as a valid option by the modelling tool.

Can we get it removed from AD, please? 😄

@borut.fabjan
