# abstract data types

**URL:** <https://discourse.openehr.org/t/abstract-data-types/14905>\
**Category:** Technical (archive)\
**Created:** [8 June 2009 09:08 UTC](https://discourse.openehr.org/t/abstract-data-types/14905 "2009-06-08T09:08:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Masoumeh\_Seydi](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/m/e47c2d/32.png) [@Masoumeh\_Seydi](https://discourse.openehr.org/u/Masoumeh_Seydi)\
**Post date:** [8 June 2009 09:08 UTC](https://discourse.openehr.org/t/abstract-data-types/14905/1 "2009-06-08T09:08:36Z")

</div>

> Hi All,  
> Could it be possible to use an abstract data type (like DV\_ORDERED, DV\_AMOUNT, …) as a type for any data?  
>   
> Regards  
> Masoumeh  
> |

---

<div class="post-metadata">

**Author:** ![Vanna](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/v/a9a28c/32.png) [@Vanna](https://discourse.openehr.org/u/Vanna)\
**Post date:** [8 June 2009 10:07 UTC](https://discourse.openehr.org/t/abstract-data-types/14905/2 "2009-06-08T10:07:20Z")

</div>

Hi Masoumeh,

yes you can do so.  
when you assign the value, you need to assign it to the sub class.

ex. in java:

DvAmount da;  
DvCount dc = new DvCount(10);  
da = dc;

In case you have DvAmount (assigned to DvCount object), and you want the DvCount object, you can cast it like this:

dc = (DvCount ) a;

Hope this help,

cheers,

Kruy Vanna

* * *

---

<div class="post-metadata">

**Author:** ![ian.mcnicoll](https://discourse.openehr.org/user_avatar/discourse.openehr.org/ian.mcnicoll/32/4430_2.png) [@ian.mcnicoll](https://discourse.openehr.org/u/ian.mcnicoll)\
**Post date:** [8 June 2009 10:40 UTC](https://discourse.openehr.org/t/abstract-data-types/14905/3 "2009-06-08T10:40:02Z")

</div>

Hi Masoumeh,

This is particularly useful when archetyping lab results where the exact pattern of lab reporting and units is extremely variable. We specify a Result element in a parent lab test archetype with a data type of ANY, which can be redefined within a specialisation or at template level to the correct local data type. This allows us to minimise the number of archetypes and give a consistent path to the Result node, which is important for querying purposes.

Ian

Dr Ian McNicoll  
office / fax +44(0)141 560 4657  
mobile +44 (0)775 209 7859  
skype ianmcnicoll  
[ian@mcmi.co.uk](mailto:ian@mcmi.co.uk)

Clinical Analyst Ocean Informatics [ian.mcnicoll@oceaninformatics.com](mailto:ian.mcnicoll@oceaninformatics.com)  
BCS Primary Health Care Specialist Group [www.phcsg.org](http://www.phcsg.org)

2009/6/8 Vanna \<[kruyvanna@gmail.com](mailto:kruyvanna@gmail.com)\>

---

<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:** [8 June 2009 12:07 UTC](https://discourse.openehr.org/t/abstract-data-types/14905/4 "2009-06-08T12:07:11Z")

</div>

Ian McNicoll wrote:
