# ELEMENT without value in ADL

**URL:** https://discourse.openehr.org/t/element-without-value-in-adl/2386
**Category:** ADL
**Created:** [22 February 2022 08:57 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386 "2022-02-22T08:57:12Z")
**Posts on this page:** 15
**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: [22 February 2022 08:57 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/1 "2022-02-22T08:57:12Z")

</div>

I cannot figure out how to interpret an empty ELEMENT declaration (last line below).

Which DATA\_VALUE type is used for an ELEMENT without a “value matches”?

```auto
CLUSTER[id1] occurrences matches {0..*} matches { -- Laboratory analyte result
    items cardinality matches {1..*; unordered} matches {
        ELEMENT[id28] occurrences matches {0..1} matches { -- Analyte result sequence
            value matches {
                DV_COUNT[id9001] occurrences matches {0..1} 
            }
        }
        ELEMENT[id25] occurrences matches {0..1} matches { -- Analyte name
            value matches {
                DV_TEXT[id9002] occurrences matches {0..1} 
            }
        }
        ELEMENT[id2] occurrences matches {0..*} -- Analyte result

```

---

<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: [22 February 2022 09:33 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/2 "2022-02-22T09:33:39Z")

</div>

The type here is “any”. 😄

---

<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: [22 February 2022 09:43 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/3 "2022-02-22T09:43:24Z")

</div>

Thank you!

This is how “Any” looks like:

 ![any](https://discourse.openehr.org/uploads/default/original/2X/4/49d4926490f09d63977ae5e7b48ad192806614a5.jpeg)

How is one supposed to implement “Any” in the UI? 🤔

Technically it is easy - just present a user with a picker with all the possible data types.  
I wouldn’t be a happy user with such an UX 😒

---

<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: [22 February 2022 09:47 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/4 "2022-02-22T09:47:15Z")

</div>

My thinking has always been that the type would be constrained in the template, or at run time using some sort of business logic.

---

<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: [22 February 2022 09:59 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/5 "2022-02-22T09:59:30Z")

</div>

The example is from the “openEHR-EHR-CLUSTER.laboratory\_test\_analyte.v1.0.2.opt2” template found in “COVID-19 Pneumonia Diagnosis and Treatment - 7th edition”

In my experience there are many possible values and the modeler(s) don’t want to limit the field too much. So it is left for “later”. Usually it is not constrained in the templates and goes to use as “any”.

The decision is left to a programmer who probably doesn’t understand (or care) about the clinical meaning of the field. I suspect that many such fields are implemented as free-text leaving the querying/use problems for “later”. So it would be better to model it properly in the first place.

p.s.  
In my case “a programmer” is a computer program generating the form. It can generate an “any” field in just a second and be done with it. But I believe it is wrong from a UX and clinical perspective.

---

<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: [22 February 2022 10:21 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/6 "2022-02-22T10:21:01Z")

</div>

> [@siljelb](#):
>
> The type here is “any”. 😄

Here, ‘any’ means the ‘any’ of data types, which is technically the [class DATA\_VALUE](https://specifications.openehr.org/releases/UML/latest/index.html#Diagrams___18_1_83e026d_1433773265129_527432_8703).

Much less terrible than the real `Any` type 😉

---

<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: [22 February 2022 10:33 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/7 "2022-02-22T10:33:27Z")

</div>

Yes, I realized it is “only” DATA\_VALUE types. That is 20 types + 20 in combination with DV\_INTERVAL.

So a user would get a list of 40 options before entering any data? Is this how others implement it?

I’m curious because I have to implement this 😊

p.s.  
In practice I believe that “Analyte result” could limit some of the types and not leave it to the programmers to decide.  
Some types on the DATA\_VALUE diagram you linked to will obviously not be used.

---

<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: [22 February 2022 10:41 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/8 "2022-02-22T10:41:09Z")

</div>

> [@borut.jures](#):
>
> That is 20 types x 20 in combination with DV\_INTERVAL

DV\_INTERVAL can only be used with DV\_ORDERED types, so it’s a bit less than that.

> [@borut.jures](#):
>
> In practice I believe that “Analyte result” could limit some of the types and not leave it to the programmers to decide.

Indeed - we know it is limited to:

- the DV\_QUANTIFIED types
- DV\_CODED\_TEXT, maybe occasionally DV\_TEXT
- DV\_BOOLEAN

This might help implementation wise.

---

<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: [22 February 2022 10:56 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/9 "2022-02-22T10:56:30Z")

</div>

Thank you for limiting the types. I’ve documented your “decision” in the code 😇

 ![Screenshot 2022-02-22 at 11.56.12](https://discourse.openehr.org/uploads/default/original/2X/2/2784d181e2c486b3186bad8a94b6064a925d9cd5.png)

In practice my generator still doesn’t know that the empty ELEMENT types can be limited case-per-case.

I’ll probably list your most used types at the top and “hide” all the rest behind a “more…” button.

---

<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: [22 February 2022 11:02 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/10 "2022-02-22T11:02:47Z")

</div>

BTW I have tried to convince the openEHR clinical modelling community that we should specialise the archetype [Laboratory Analyte Result (CLUSTER)](https://ckm.openehr.org/ckm/archetypes/1013.1.2881/mindmap) on the data type of the Analyte Result field, as is done elsewhere, e.g. in the extensive [Intermountain Healthcare Clinical Element Model (CEM) repository](http://www.clinicalelement.com/cimi-browser/#/) - look under ‘laboratory test result’ in the hierarchy view.

So far I didn’t manage to convince our clinical modellers 😉

---

<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: [22 February 2022 11:05 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/11 "2022-02-22T11:05:28Z")

</div>

I missed DV\_ORDINAL - you’ll need that.

---

<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: [22 February 2022 11:08 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/12 "2022-02-22T11:08:42Z")

</div>

> [@thomas.beale](#):
>
> So far I didn’t manage to convince our clinical modellers 😉

Any time I (in the role of a modeler - not clinical - just a database modeler) left some field left to interpretation, it was interpreted incorrectly. I always blamed myself for not being precise enough.

---

<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: [22 February 2022 19:50 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/13 "2022-02-22T19:50:13Z")

</div>

So the rationale for modeling labs this way, is that most lab data is acquired through lab messages where it is often impossible to know in advance, exactly what datatype will be supplied or indeed units.

[https://ckm.openehr.org/ckm/document?cid=1013.17.116](https://ckm.openehr.org/ckm/document?cid=1013.17.116)

So this is message driven data capture, and essentially read-only, with the datatype being resolved at run-time, so you should be able to apply the correct

If the lab data is to be entered manually (quite common in registry-type projects) then I would create a template where everything was pre-constrained.

Example at [Archetype Designer](https://tools.openehr.org/designer/#/viewer/shared/Pz9zaGFyZWRJZD0xJDI5ODc1OTZlMjdhMTQ4N2FhZGFkNmNhYjg5NmJmY2E2)

We are working on adding SNOMED codes for all of the analyte names.

I’ve attached the .opt for you to play with if you want!! I’m sure @videhasharma will not mind!!

[K Cloud Living Donor Assessment.opt](https://discourse.openehr.org/uploads/short-url/8qTV1NnT7r3ot8duqyULYtNQgrl.opt) (562.8 KB)

---

<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: [23 February 2022 08:50 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/14 "2022-02-23T08:50:36Z")

</div>

Thank you Ian for the PDF and the template.

I hope the “Proposed new modelling approach” gets implemented 🤞

---

<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: [23 February 2022 09:09 UTC](https://discourse.openehr.org/t/element-without-value-in-adl/2386/15 "2022-02-23T09:09:28Z")

</div>

It has been implemented!!

Some progress has been made on microbiology archetypes, based on work done by Highmed but using the generic archetypes unconstrained for lab messaging, with the option of templating these locally for manual data entry is working well.
