# Bind multiple value sets to an dv\_coded\_text within a template

**URL:** <https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293>\
**Category:** Archetype Designer\
**Created:** [15 February 2021 07:08 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293 "2021-02-15T07:08:00Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)\
**Post date:** [15 February 2021 07:08 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/1 "2021-02-15T07:08:00Z")

</div>

Hi there,

in FHIR it is possible to provide multiple value sets/external codings to an element value:

![image](https://discourse.openehr.org/uploads/default/original/1X/81f431727d629e53f57430c41f361527ea43f2cf.png)

However, in AD Designer it seems the user is limited to choose only one when further contraining a template:

 ![image](https://discourse.openehr.org/uploads/default/original/1X/bba62d1ffc5bc6b744706f28b6a11249a2fcfafc.png)

What would be the correct way to represent this in templates? Asking for our modellers.

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [15 February 2021 10:18 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/2 "2021-02-15T10:18:00Z")

</div>

In openEHR this would be handled by the defining\_code and other mappings. Currently we have a way of constraining the defining\_code but not the mappings. I’m not even sure what that would look like in ADL. TheOcean tools would not support that either - @yampeku = what about LinkEhr?

We can define multiple ‘bindings’ but these are advisory, not formal constraints.

It is a gap, I agree.

---

<div class="post-metadata">

**Author:** ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)\
**Post date:** [15 February 2021 10:33 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/3 "2021-02-15T10:33:35Z")

</div>

Yes, it’s supported

 ![imagen](https://discourse.openehr.org/uploads/default/original/1X/1e86e267b916f660ffe06995ce38d120e16bfb44.png)

In ADL, something like this (assuming you at least put a target)

![imagen](https://discourse.openehr.org/uploads/default/original/1X/5320d1f0a0e226a91e4b19afa18ef05c9f0158d7.png)

---

<div class="post-metadata">

**Author:** ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)\
**Post date:** [15 February 2021 10:35 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/4 "2021-02-15T10:35:59Z")

</div>

Thanks, I think the most important question is how this would be presented in OET and OPT for now

---

<div class="post-metadata">

**Author:** ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)\
**Post date:** [15 February 2021 10:42 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/5 "2021-02-15T10:42:20Z")

</div>

Not different from any other alternative I assume

---

<div class="post-metadata">

**Author:** ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)\
**Post date:** [15 February 2021 10:43 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/6 "2021-02-15T10:43:21Z")

</div>

would you mind show an example?

---

<div class="post-metadata">

**Author:** ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)\
**Post date:** [15 February 2021 10:45 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/7 "2021-02-15T10:45:46Z")

</div>

Same example in OPT

```
<attributes xsi:type="C_SINGLE_ATTRIBUTE">
              <rm_attribute_name>mappings</rm_attribute_name>
              <existence>
                <lower_included>true</lower_included>
                <upper_included>true</upper_included>
                <lower_unbounded>false</lower_unbounded>
                <upper_unbounded>false</upper_unbounded>
              </existence>
              <children xsi:type="C_COMPLEX_OBJECT">
                <rm_type_name>TERM_MAPPING</rm_type_name>
                <occurrences>
                  <lower_included>true</lower_included>
                  <upper_included>true</upper_included>
                  <lower_unbounded>false</lower_unbounded>
                  <upper_unbounded>false</upper_unbounded>
                  <lower>0</lower>
                  <upper>1</upper>
                </occurrences>
                <node_id>at0008</node_id>
                <attributes xsi:type="C_SINGLE_ATTRIBUTE">
                  <rm_attribute_name>target</rm_attribute_name>
                  <existence>
                    <lower_included>true</lower_included>
                    <upper_included>true</upper_included>
                    <lower_unbounded>false</lower_unbounded>
                    <upper_unbounded>false</upper_unbounded>
                    <lower>1</lower>
                    <upper>1</upper>
                  </existence>
                </attributes>
              </children>
              <children xsi:type="C_COMPLEX_OBJECT">
                <rm_type_name>TERM_MAPPING</rm_type_name>
                <occurrences>
                  <lower_included>true</lower_included>
                  <upper_included>true</upper_included>
                  <lower_unbounded>false</lower_unbounded>
                  <upper_unbounded>false</upper_unbounded>
                  <lower>0</lower>
                  <upper>1</upper>
                </occurrences>
                <node_id>at0012</node_id>
                <attributes xsi:type="C_SINGLE_ATTRIBUTE">
                  <rm_attribute_name>target</rm_attribute_name>
                  <existence>
                    <lower_included>true</lower_included>
                    <upper_included>true</upper_included>
                    <lower_unbounded>false</lower_unbounded>
                    <upper_unbounded>false</upper_unbounded>
                    <lower>1</lower>
                    <upper>1</upper>
                  </existence>
                </attributes>
              </children>
              <children xsi:type="C_COMPLEX_OBJECT">
                <rm_type_name>TERM_MAPPING</rm_type_name>
                <occurrences>
                  <lower_included>true</lower_included>
                  <upper_included>true</upper_included>
                  <lower_unbounded>false</lower_unbounded>
                  <upper_unbounded>false</upper_unbounded>
                  <lower>0</lower>
                  <upper>1</upper>
                </occurrences>
                <node_id>at0016</node_id>
                <attributes xsi:type="C_SINGLE_ATTRIBUTE">
                  <rm_attribute_name>target</rm_attribute_name>
                  <existence>
                    <lower_included>true</lower_included>
                    <upper_included>true</upper_included>
                    <lower_unbounded>false</lower_unbounded>
                    <upper_unbounded>false</upper_unbounded>
                    <lower>1</lower>
                    <upper>1</upper>
                  </existence>
                </attributes>
              </children>
            </attributes>

```

[openEHR-EHR-GENERIC\_ENTRY.Medication.v1.opt](https://discourse.openehr.org/uploads/short-url/rst4puQKv0iu8DZ3E5CSRHx3AC5.opt) (49.6 KB)

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [15 February 2021 10:48 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/8 "2021-02-15T10:48:08Z")

</div>

Thanks - .oet might be tricky but it should be easy enough to get this into AD native json, which is largely just AOM2

---

<div class="post-metadata">

**Author:** ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)\
**Post date:** [15 February 2021 10:48 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/9 "2021-02-15T10:48:48Z")

</div>

Well, does not really help as long as we cannot deploy it into an openEHR CDR and CKM ☹

---

<div class="post-metadata">

**Author:** ![yampeku](https://discourse.openehr.org/user_avatar/discourse.openehr.org/yampeku/32/25_2.png) [@yampeku](https://discourse.openehr.org/u/yampeku)\
**Post date:** [15 February 2021 11:23 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/10 "2021-02-15T11:23:23Z")

</div>

What is the issue? It should be legal OPT (or ADL2)

---

<div class="post-metadata">

**Author:** ![birger.haarbrandt](https://discourse.openehr.org/user_avatar/discourse.openehr.org/birger.haarbrandt/32/24_2.png) [@birger.haarbrandt](https://discourse.openehr.org/u/birger.haarbrandt)\
**Post date:** [15 February 2021 11:26 UTC](https://discourse.openehr.org/t/bind-multiple-value-sets-to-an-dv-coded-text-within-a-template/1293/11 "2021-02-15T11:26:13Z")

</div>

> [@ian.mcnicoll](#):
>
> AD native json

@yampeku: was referring to this
