# value of DV\_COUNT::magnitude as Integer or C\_INTEGER?

**URL:** https://discourse.openehr.org/t/value-of-dv-count-magnitude-as-integer-or-c-integer/16661
**Category:** Implementers (archive)
**Created:** [24 January 2008 09:20 UTC](https://discourse.openehr.org/t/value-of-dv-count-magnitude-as-integer-or-c-integer/16661 "2008-01-24T09:20:24Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Cati\_Martinez](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@Cati\_Martinez](https://discourse.openehr.org/u/Cati_Martinez)
#### Post date: [24 January 2008 09:20 UTC](https://discourse.openehr.org/t/value-of-dv-count-magnitude-as-integer-or-c-integer/16661/1 "2008-01-24T09:20:24Z")

</div>

Hello again!

Now, I have a new doubt, if for example I have the following  
openehr\_ELEMENT which value is a DV\_COUNT datatype...

&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELEMENT[at0025] occurrences matches {0..1} matches { -- Rating  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value matches {  
&nbsp;&nbsp;DV\_COUNT matches {  
&nbsp;&nbsp;&nbsp;&nbsp;magnitude matches {|0..10|}  
&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

Then the property "magnitude" of DV\_COUNT according to OpenEHR  
specification should be an Integer, but here I think It's a C\_INTEGER.

Then, should I represent all the Integer values as C\_INTEGER elements?

Thank you very much!!

---

<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: [24 January 2008 10:23 UTC](https://discourse.openehr.org/t/value-of-dv-count-magnitude-as-integer-or-c-integer/16661/2 "2008-01-24T10:23:11Z")

</div>

Hi Cati,

Yes, it is an INTEGER, which is (further) constrained by a C\_INTEGER.  
That means in an instance of this archetype, an INTEGER will be  
recorded, AND this INTEGER has to be from 0 to 10... as defined by the  
C\_INTEGER constraint.

Cheers  
Sebastian

Cati Martínez wrote:

---

<div class="post-metadata">

### Author: ![Cati\_Martinez](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/c/85f322/32.png) [@Cati\_Martinez](https://discourse.openehr.org/u/Cati_Martinez)
#### Post date: [24 January 2008 10:33 UTC](https://discourse.openehr.org/t/value-of-dv-count-magnitude-as-integer-or-c-integer/16661/3 "2008-01-24T10:33:29Z")

</div>

Hi,

But I don't know how implement it. According to your reply, the  
attribute "magnitude" should be of Integer type, If its type is  
Integer, a primitive type, how can I associate the restriction  
C\_INTEGER to "magnitude" attribute.

Thank you again!

---

<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: [30 January 2008 20:37 UTC](https://discourse.openehr.org/t/value-of-dv-count-magnitude-as-integer-or-c-integer/16661/4 "2008-01-30T20:37:00Z")

</div>

Hi Cati

In ADL C\_INTEGER has the syntax as in ADL 1.4 |\>=0| or some such constraint:

value matches {  
DV\_COUNT matches {  
magnitude matches {|\>=1|}  
}  
}

In XML the AOM constraint is expressed as:

value true true false false 1 1 DV\_COUNT true true false false 1 1 magnitude true true false false 1 1 INTEGER true true false false 1 1 true false true 1

It is the same thing. The XML is very verbose as it is the full reference model specification so existence is expressed at every level.

The ADL and XML parsers in C# and Java are open source.

Cheers, Sam

Cati Martínez wrote:

> **(attachments)**
>
> ![OceanCsmall.png](https://discourse.openehr.org/images/transparent.png)
