# Valid values

**URL:** https://discourse.openehr.org/t/valid-values/12697
**Category:** Clinical (archive)
**Created:** [23 May 2011 12:43 UTC](https://discourse.openehr.org/t/valid-values/12697 "2011-05-23T12:43:22Z")
**Posts on this page:** 4
**Page:** 1

<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: [23 May 2011 12:43 UTC](https://discourse.openehr.org/t/valid-values/12697/1 "2011-05-23T12:43:22Z")

</div>

I have a doubt about valid values (or ranges) for clinical data. Has  
clinical sense to define a range with discontinuous domain?  
I am thinking if something like 'critical range' with [-100, 0] and  
[100, 200] makes sense at all. Or maybe something like 'any positive  
or negative number but zero' ]-inf,0[&]0,+inf[  
I am not talking about normal or reference ranges, but more on the  
kind of ranges that are currently being archetyped

---

<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: [24 May 2011 18:08 UTC](https://discourse.openehr.org/t/valid-values/12697/2 "2011-05-24T18:08:45Z")

</div>

At the moment there is the possibility to define intervals like the following (from the ADL spec):

Examples of 2-sided intervals include:

- length matches {|1000|} – point interval of 1000 (=fixed value)

- length matches {|950..1050|} – allow 950 - 1050

- length matches {|0..1000|} – allow 0 - 1000

- length matches {|0..\<1000|} – allow 0\>= x \<1000

- length matches {|0\>..\<1000|} – allow 0\> x \<1000

- length matches {|100+/-5|} – allow 100 +/- 5, i.e. 95 - 105

- rate matches {|0..infinity|} – allow 0 - infinity, i.e. same as \>= 0  
Examples of one-sided intervals include:

- length matches {|\<10|} – allow up to 9

- length matches {|\>10|} – allow 11 or more

- length matches {|\<=10|} – allow up to 10

- length matches {|\>=10|} – allow 10 or more  
The Interval type doesn’t cope with sets of intervals, i.e. disjoint intervals, and I am not sure that it should directly. If there was a need, we would probably define a new kind of type allowing disjoint intervals. But… is there a real need?

- thomas

---

<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: [24 May 2011 18:51 UTC](https://discourse.openehr.org/t/valid-values/12697/3 "2011-05-24T18:51:57Z")

</div>

That was exactly my question 🙂  
I can see something like the 'critical range' that I defined earlier  
being used. If you want to build archetypes about "wrong" status it is  
quite possible that you want to define disjoint intervals (if you have  
a range of "healthy" values, then the inverse disjoint interval lets  
you define the "unhealthy" range)

---

<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: [24 May 2011 19:38 UTC](https://discourse.openehr.org/t/valid-values/12697/4 "2011-05-24T19:38:02Z")

</div>

it can be done in current ADL/AOM as follows:

some\_attr matches {  
DV\_QUANTITY [at0001] matches {  
magnitude matches {|-200..-100|}  
}  
DV\_QUANTITY [at0002] matches {  
magnitude matches {|100..300|}  
}  
}

The above means that the two DV\_QUANTITYs are alternatives for the single-valued attribute some\_attr (and effectively the same even if some\_attr is a container). So values like -50, 0, + 50 will all fail the above constraints.

Is this close enough to what you want?

- thomas
