# mandatory occurrences in ADL Parser

**URL:** https://discourse.openehr.org/t/mandatory-occurrences-in-adl-parser/12609
**Category:** Reference Implementation: Java (archive)
**Created:** [7 September 2007 03:45 UTC](https://discourse.openehr.org/t/mandatory-occurrences-in-adl-parser/12609 "2007-09-07T03:45:00Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sebastian.garde](https://discourse.openehr.org/user_avatar/discourse.openehr.org/sebastian.garde/32/3070_2.png) [@sebastian.garde](https://discourse.openehr.org/u/sebastian.garde)
#### Post date: [7 September 2007 03:45 UTC](https://discourse.openehr.org/t/mandatory-occurrences-in-adl-parser/12609/1 "2007-09-07T03:45:00Z")

</div>

Hi,

In using the ADL Parser, I just want to be sure I got this right:

CComplexObject myNode = \<get a node within a parsed archetype from somewhere\>;  
Interval\<Integer\> myOccurrences = myNode.getOccurrences();

Now, if the occurrence is mandatory (1..1), myOccurrences will be null as mandatory is the default. For easier handling I therefore want to set the following in my code before proceeding:

if (myOccurrence == null) myOccurrence = new Interval\<Integer\>(1,1);  
&nbsp;&nbsp;  
This should be semantically exactly the same I believe?

Regards  
Sebastian

Dr Sebastian Garde  
Dr. sc. hum., Dipl.-Inform. Med, FACHI

Faculty of Business and Informatics, Central Queensland University  
Austin Centre for Applied Clinical Informatics, Austin Health  
Heidelberg Vic 3084, Australia  
s.garde@cqu.edu.au  
Ph: +61 (0)3 9496 4040  
Fax: +61 (0)3 9496 4224  
[http://healthinformatics.cqu.edu.au](http://healthinformatics.cqu.edu.au)  
[http://www.acaci.org.au](http://www.acaci.org.au)  
Visit the new open access electronic Journal of Health Informatics (eJHI): [http://ejhi.net](http://ejhi.net)

---

<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: [7 September 2007 08:12 UTC](https://discourse.openehr.org/t/mandatory-occurrences-in-adl-parser/12609/2 "2007-09-07T08:12:30Z")

</div>

Hi Sebastian,

Actually it’s the CObject from AOM in question. The current code needs to be updated to make “occurrences” attribute mandatory according to the latest AOM specs from 1.0.1 release. When “occurrences” is not mentioned in ADL, the default one is {1..1}. So the solution you described is correct.

Cheers,  
Rong
