# abstract types in archetypes

**URL:** <https://discourse.openehr.org/t/abstract-types-in-archetypes/15170>\
**Category:** Technical (archive)\
**Created:** [3 May 2012 09:19 UTC](https://discourse.openehr.org/t/abstract-types-in-archetypes/15170 "2012-05-03T09:19:13Z")\
**Posts on this page:** 3\
**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:** [3 May 2012 09:19 UTC](https://discourse.openehr.org/t/abstract-types-in-archetypes/15170/1 "2012-05-03T09:19:13Z")

</div>

Hi all,

Please allow me a short question.

Is it allowed to define abstract types in archetypes, I once saw an archetype which held an EVENT as attribute, so the constructor of the rm-object which had to be validated against the archetype, could at runtime decide if he wanted to use a POINT\_EVENT or INTERVAL\_EVENT.  
Is this allowed?

Same can occur with data\_structures and data\_values.

Suppose (theoretically) an archetype which has LOCATABLE as definition-class.  
It allows virtually everything as valid rm-object.

This question causes me some headache.

Thanks for opinions/answers  
Bert

---

<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:** [3 May 2012 09:24 UTC](https://discourse.openehr.org/t/abstract-types-in-archetypes/15170/2 "2012-05-03T09:24:58Z")

</div>

> Hi all,
> 
> Please allow me a short question.
> 
> Is it allowed to define abstract types in archetypes, I once saw an archetype which held an EVENT as attribute, so the constructor of the rm-object which had to be validated against the archetype, could at runtime decide if he wanted to use a POINT\_EVENT or INTERVAL\_EVENT.  
> Is this allowed?

the runtime has to decide (if not already decided by the archetypes or templates) - there is no choice!

> Same can occur with data\_structures and data\_values.
> 
> Suppose (theoretically) an archetype which has LOCATABLE as definition-class.  
> It allows virtually everything as valid rm-object.

it would but you can't state any interesting constraints with just LOCATABLE, so it is more likely to be something like EVENT.

- thomas

---

<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:** [3 May 2012 14:26 UTC](https://discourse.openehr.org/t/abstract-types-in-archetypes/15170/3 "2012-05-03T14:26:15Z")

</div>

Thanks, Thomas, for your confirmation, I was thinking this, but now I am sure.

The question about Locatable was just to give an extreme example.

regards  
Bert
