# Dv\_coded\_text\_extended

**URL:** <https://discourse.openehr.org/t/dv-coded-text-extended/2288>\
**Category:** ADL\
**Created:** [24 January 2022 18:18 UTC](https://discourse.openehr.org/t/dv-coded-text-extended/2288 "2022-01-24T18:18:18Z")\
**Posts on this page:** 5\
**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:** [24 January 2022 18:18 UTC](https://discourse.openehr.org/t/dv-coded-text-extended/2288/1 "2022-01-24T18:18:18Z")

</div>

I just finished reading all the old posts in the ADL category. There are few threads about ELEMENT with DV\_CODED\_TEXT and DV\_TEXT for free text. Some observations after reading them all in a single sitting:

- I noticied that nobody suggested a dedicated DV\_CODED\_TEXT\_EXTENDED type (pick a better name). It would be DV\_CODED\_TEXT with an additional attribute (e.g. “free\_text”).

- Coded values would be in “defining\_code” and the free text would be in “free\_text” attribute. Edit: or “free\_text” could be a boolean and the text would go into “value” as usually.

- This is such a common scenario that a separate DV\_ type might be reasonable.

- There would be a single “id” for such a value. I hope that is OK from the AQL point of view.

- UI component libraries usually support DV\_CODED\_TEXT\_EXTENDED with a single component which is intuitive to the user and follows the intention of the modeler.

- I might have missed some old email list discussions where a dedicated data value type was already dismissed.

Another observation - threads are discussing two different use cases:

- Extending the lists for DV\_CODED\_TEXT with additional/different values (but still limiting the values to the list).

- Using DV\_TEXT for free text when the needed value is not in the list for DV\_CODED\_TEXT.

Summarized thread:

- [Option to record free text as choice against DV\_CODED\_TEXT - do we need DV\_PLAIN\_TEXT - #71 by thomas.beale](https://discourse.openehr.org/t/option-to-record-free-text-as-choice-against-dv-coded-text-do-we-need-dv-plain-text/623/71)

---

<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:** [27 January 2022 13:14 UTC](https://discourse.openehr.org/t/dv-coded-text-extended/2288/2 "2022-01-27T13:14:00Z")

</div>

> [@borut.jures](#):
>
> - I noticied that nobody suggested a dedicated DV\_CODED\_TEXT\_EXTENDED type (pick a better name). It would be DV\_CODED\_TEXT with an additional attribute (e.g. “free\_text”).

do you mean a free text field distinct from the inherited value field? The semantics of that is more like a term mapping on a DV\_TEXT, which you can already do.

But maybe you meant something else?

---

<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:** [27 January 2022 13:54 UTC](https://discourse.openehr.org/t/dv-coded-text-extended/2288/3 "2022-01-27T13:54:23Z")

</div>

DV\_CODED\_TEXT\_EXTENDED would extend DV\_CODED\_TEXT.

DV\_CODED\_TEXT\_EXTENDED.defining\_code is used when the value is from the terminology.

In case a user cannot use any of the terms in the terminology it would enter the free text value into DV\_CODED\_TEXT\_EXTENDED.free\_text (or into DV\_CODED\_TEXT\_EXTENDED.value and set DV\_CODED\_TEXT\_EXTENDED.free\_text = true).

Currently a single-valued attribute with alternative values:

```auto
ELEMENT[id6] occurrences matches {0..1} matches { -- Result status
     value matches {
         DV_CODED_TEXT[id9005] occurrences matches {0..1} matches {
              defining_code matches {[ac9000]} -- Result status (synthesised)
         }
         DV_TEXT[id9006] occurrences matches {0..1} 
     }
}

```

Using a new data value type DV\_CODED\_TEXT\_EXTENDED:

```auto
ELEMENT[id6] occurrences matches {0..1} matches { -- Result status
     value matches {
         DV_CODED_TEXT_EXTENDED[id9005] occurrences matches {0..1} matches {
              defining_code matches {[ac9000]} -- Result status (synthesised)
         }
     }
}

```

Could this work?

It looks too simple. I must be missing something 🤔

---

<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:** [27 January 2022 14:06 UTC](https://discourse.openehr.org/t/dv-coded-text-extended/2288/4 "2022-01-27T14:06:17Z")

</div>

There have been a lot of of conversations on this - basically we can do this already via DV\_TEXT/DV\_CODED\_TEXT but is a bit confusing so we have been looking to introduce the idea of term-binding strength in ADL/AOM2 which is much more explicit.

> [@Addition of required / extensible / preferred / example terminology constraint to AOM and ADL](https://discourse.openehr.org/t/addition-of-required-extensible-preferred-example-terminology-constraint-to-aom-and-adl/933):
>
> The openEHR SEC has decided on the addition of the required | extensible | preferred | example ‘binding strength’ constraint modifier, following the [model used in HL7 FHIR](https://www.hl7.org/fhir/terminologies.html#strength). The change is documented in [openEHR CR SPECAM-68](https://openehr.atlassian.net/browse/SPECAM-68). The change to AOM2 spec looks like this in the UML: [C\_terminology\_code] We have yet to determine how it should look in ADL2. Currently, the various forms of terminology constraint look as follows in ADL2. ​items matches { ​ELEMENT[id11] occurrences matches {0..1…

---

<div class="post-metadata">

**Author:** ![pablo](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pablo/32/3505_2.png) [@pablo](https://discourse.openehr.org/u/pablo)\
**Post date:** [28 January 2022 14:30 UTC](https://discourse.openehr.org/t/dv-coded-text-extended/2288/5 "2022-01-28T14:30:43Z")

</div>

Thanks to Borut reference I was re-reading the issue and possible solutions and wanted to come back to an old discussion:

If the best solution for a new requirement is a backwards incompatible change:

1. Go with it!
2. Version the spec representing the major semver change
3. Specify a migration path from previous major version to the new version

That way we can keep up with new requirements and allow implementers to migrate code and data if they want to. We shouldn’t be stopping improvements because of backwards incompatibility. But we need to be sure the backwards incompatible change is THE BEST solution for the requirement after thorough analysis.

Another point is: we don’t have hard deadlines like software development, so we can take the time to design a new major version spec with the next batch of backwards incompatible changes, with all the migration guides, etc. etc., then implementers can implement their changes in their own time. Note this neither affects conformance, since conformance is verified against a version of the spec, new major version =\> no problem! still conformant with a previous major version spec.
