# Default values in OPT 1.4

**URL:** <https://discourse.openehr.org/t/default-values-in-opt-1-4/1785>\
**Category:** ADL\
**Tags:** template\
**Created:** [17 August 2021 09:57 UTC](https://discourse.openehr.org/t/default-values-in-opt-1-4/1785 "2021-08-17T09:57:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pieterbos](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pieterbos/32/512_2.png) [@pieterbos](https://discourse.openehr.org/u/pieterbos)\
**Post date:** [17 August 2021 09:57 UTC](https://discourse.openehr.org/t/default-values-in-opt-1-4/1785/1 "2021-08-17T09:57:44Z")

</div>

Several versions of the OPT 1.4 XSD seem to be used. Pablo did a comparison of the different versions in [OPT version, schema & document - #34 by pablo](https://discourse.openehr.org/t/opt-version-schema-document/486/34) .

I am currently writing a converter from OPT 1.4 to ADL 2 templates in source form. It now mostly works and can be found in [Opt 1.4 parser and converter by pieterbos · Pull Request #261 · openEHR/archie · GitHub](https://github.com/openEHR/archie/pull/261) . It can also be used to parse OPT 1.4 into the AOM 2 directly, without conversion.

However, in the different OPT 1.4 versions, the way to define default values is very different:

- one has default values on every C\_ARCHETYPE\_ROOT, with a path, in terms of primitive types (string, boolean, integer, etc)
  - a sub-variant, where this can be on every C\_COMPLEX\_OBJECT instead

- one has a separate section, containing a mapping from paths to extended C\_ATTRIBUTES, with default values defined as DV\_ types, so DV\_TEXT, DV\_CODED\_TEXT, etc.

All of the OPTs I found use the second variant, with a separate section. I could write the first one as well relatively easily, but of course only if it is in use.

So my question: Is the other variant of defining default values actually used? If the variant on C\_ARCHETYPE\_ROOT is used, does anyone have any examples of that?

---

<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:** [17 August 2021 14:57 UTC](https://discourse.openehr.org/t/default-values-in-opt-1-4/1785/2 "2021-08-17T14:57:18Z")

</div>

Are you just talking about what the \_default blocks look like in OPT1.4, not the generated OPT2, which should have them inline, like ADL2?

---

<div class="post-metadata">

**Author:** ![pieterbos](https://discourse.openehr.org/user_avatar/discourse.openehr.org/pieterbos/32/512_2.png) [@pieterbos](https://discourse.openehr.org/u/pieterbos)\
**Post date:** [17 August 2021 15:14 UTC](https://discourse.openehr.org/t/default-values-in-opt-1-4/1785/3 "2021-08-17T15:14:26Z")

</div>

Yes, just OPT 1.4 there are several versions of the XSDs in use. So I would like to know if this specific feature is actually in use as well in the different variants.

In OPT2 it is very clear what to do.
