# enumerated types in openEHR

**URL:** https://discourse.openehr.org/t/enumerated-types-in-openehr/16681
**Category:** Implementers (archive)
**Created:** [25 February 2010 00:48 UTC](https://discourse.openehr.org/t/enumerated-types-in-openehr/16681 "2010-02-25T00:48:24Z")
**Posts on this page:** 2
**Page:** 1

<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: [25 February 2010 00:48 UTC](https://discourse.openehr.org/t/enumerated-types-in-openehr/16681/1 "2010-02-25T00:48:24Z")

</div>

**While reviewing the AOM spec, I realised that the enumerated type VALIDITY\_KIND contains the constants ‘optional’, ‘mandatory’, ‘disallowed’. The new class I have added ARTEFACT\_TYPE contains constants ‘archetype’, ‘template’ etc. I realised that in typical implementations, certainly the ADL parser I maintain, such constant names are likely to be problematic, and probably should be adjusted in some way. In the kind of code I normally write, this would mean for teh VALIDITY\_KIND ones - something like vk\_optional, vk\_mandatory etc; and for the other type, something like at\_archetype, at\_template, at\_template\_component etc.**

**What do other implementers think?**

**- thomas beale**

---

<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: [25 February 2010 09:11 UTC](https://discourse.openehr.org/t/enumerated-types-in-openehr/16681/2 "2010-02-25T09:11:00Z")

</div>

Hi Thomas,

In the Java implementation, these are implemented as type-safe Java  
enumerations. Usually it's good to avoid using types like string or  
integer for these enumerated types.

Cheers,  
Rong
