# null value of Element

**URL:** https://discourse.openehr.org/t/null-value-of-element/12925
**Category:** Technical (archive)
**Created:** [10 March 2011 15:41 UTC](https://discourse.openehr.org/t/null-value-of-element/12925 "2011-03-10T15:41:36Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![system](https://discourse.openehr.org/uploads/default/original/2X/f/f0a1dedb20c42747bddcafd6c7df9db5f34f003c.svg) [@system](https://discourse.openehr.org/u/system)
#### Post date: [10 March 2011 15:41 UTC](https://discourse.openehr.org/t/null-value-of-element/12925/1 "2011-03-10T15:41:36Z")

</div>

Hi,

I have an archetype with following Element

ELEMENT[at0033] occurrences matches {0..1} matches { -- Condition Status  
&nbsp;&nbsp;&nbsp;&nbsp;value matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DV\_TEXT matches {\*}  
&nbsp;&nbsp;&nbsp;&nbsp;}  
}

I noticed that it is not possible te create an Element-instance with  
data-value null, because my own Object-validator validates against this  
archetype and complains that in this case, value is a required attribute.

Now I wonder, is that so? Maybe I should change my object-validator?

Is it so that in an archetype-snippet like this, value is a required  
attribute? Or is it also possible to use the nullFlavor-attribute  
instead, in that case I need to change my Object Validator

Thanks for any advise

Bert

---

<div class="post-metadata">

### Author: ![Peter\_Gummer1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/p/258eb7/32.png) [@Peter\_Gummer1](https://discourse.openehr.org/u/Peter_Gummer1)
#### Post date: [10 March 2011 20:50 UTC](https://discourse.openehr.org/t/null-value-of-element/12925/2 "2011-03-10T20:50:15Z")

</div>

Bert Verhees wrote:

> ELEMENT[at0033] occurrences matches {0..1} matches { -- Condition  
> Status  
> &nbsp;&nbsp;&nbsp;value matches {  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DV\_TEXT matches {\*}  
> &nbsp;&nbsp;&nbsp;}  
> }  
> ...
> 
> Is it so that in an archetype-snippet like this, value is a required  
> attribute?

According to the openEHR data structures specification, ELEMENT.value  
is 0..1. It's optional, as long as a null flavour is supplied.

Invariants:  
Is\_null\_valid: is\_null = (value = Void)  
Null\_flavour\_indicated: is\_null xor null\_flavour = Void

In other words, (value = Void) = not (null\_flavour = Void). The  
ELEMENT must have either a value, or a null flavour, but not both.

- Peter Gummer
