# Constant Values and "sub" Elements

**URL:** <https://discourse.openehr.org/t/constant-values-and-sub-elements/16711>\
**Category:** Technical (archive)\
**Created:** [5 May 2008 08:58 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711 "2008-05-05T08:58:47Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [5 May 2008 08:58 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/1 "2008-05-05T08:58:47Z")

</div>

Hello!

Within the context of my bachelor thesis, i am trying to transform a domain  
model into an archetype, but now i am having some problems and i hope maybe  
some of you here can help me.

My first question is, is it possible to define constant or "hard coded"  
values ie. constant text which contains a description?  
So far I am trying to add a CODED\_TEXT that matches a defined constraint  
ac0001, but i am not sure if this is a valid solution.

&nbsp;&nbsp;ITEM\_TREE[at0003] matches { -- ITEM\_TREE  
&nbsp;&nbsp;&nbsp;&nbsp;items cardinality matches {0..\*; unordered} matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLUSTER[at0004] occurrences matches {0..1} matches { -- Top  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;items cardinality matches {0..\*; unordered} matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELEMENT[at0005] occurrences matches {0..1} matches { -- SpokenDefault  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DV\_CODED\_TEXT matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;defining\_code matches {[ac0001]} -- Top  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

and the other question  
How do i add "sub-elements", is it even possible? ie. I have a Text field  
"Top" and i want to add a Text field "SpokenDefault" to it, which shows how  
to pronounce the word Top. the way i do it right now is creating a cluster  
for every "element" which is not very effective.

thanks in advance  
TimmyX

---

<div class="post-metadata">

**Author:** ![Thilo\_Schuler1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@Thilo\_Schuler1](https://discourse.openehr.org/u/Thilo_Schuler1)\
**Post date:** [5 May 2008 09:18 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/2 "2008-05-05T09:18:01Z")

</div>

Hi TimmyX

an acXXXX constraint has been designed for defining terminology value  
sets by query.

In your case several constraining the text ELEMENT to several at codes  
should do the job (the Archetype Editor supports that via 'internal  
codes' in the constraints tab right to the definition area.

Something like that should do

ITEM\_TREE[at0003] matches { -- Tree  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;items cardinality matches {0..\*; unordered} matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;CLUSTER[at0004] occurrences matches {0..1} matches { -- Top  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;items cardinality matches {0..\*; unordered} matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;ELEMENT[at0005] occurrences matches {0..1} matches { --  
Default Spoken  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;value matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;DV\_CODED\_TEXT matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;defining\_code matches {  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[local::  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}

Regarding sub elements you were right: CLUSTERS are the way to do that  
in Archetypes! If you have a pattern which is always the same, you  
could create a CLUSTER-Archetype and reuse it...

Cheers, Thilo

---

<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:** [5 May 2008 09:35 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/3 "2008-05-05T09:35:02Z")

</div>

Hi Timmy,

Can you explain the domain model in a little more detail?

Ian

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [5 May 2008 09:53 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/4 "2008-05-05T09:53:21Z")

</div>

Hi,

sure, it consist of a parent node and several child nodes, which describes the appearance of a patient.

structured by  
-common information  
weight  
birthdate  
height  
-face  
–eyes  
color  
–mouth  
–nose

and so on  
all elements have an attribute which says how it should be pronounced which is constant.

Thanks for the quick replies.  
Timmy

---

<div class="post-metadata">

**Author:** ![Thilo\_Schuler1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@Thilo\_Schuler1](https://discourse.openehr.org/u/Thilo_Schuler1)\
**Post date:** [5 May 2008 10:36 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/5 "2008-05-05T10:36:20Z")

</div>

Timmy,

I guess in your case with so littel elements I would bite the bullet  
and model the 'spoken default' explicitly with a text ELEMENT that is  
preset to the constant value.

An option would be to model a generic element as a CLUSTER-archetype  
(including the 'spoken default' element) and specialize an from it for  
every element you need. These specialised CLUSTERS could be assembled  
in an OBSERVATION archetype via slots. But it think this would be to  
complex for such a simple model and the specialisation would not  
provide much added value.

Cheers, Thilo

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [5 May 2008 11:56 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/6 "2008-05-05T11:56:15Z")

</div>

Thanks Thilo,

although this might not be worth it, i will try to model a generic element as cluster-archetype.

also i dont quite understand what you meant with  
“model the ‘spoken default’ explicitly with a text ELEMENT that is  
preset to the constant value.”

how would i do that if i wanted to add a “spoken default field” to a date field?

thanks in advance  
Timmy

---

<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:** [5 May 2008 13:11 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/7 "2008-05-05T13:11:02Z")

</div>

Thanks Timmy,

I am still struggling to understand the purpose of the  
'pronounciation' attribute. Does this have to be computable or is it  
just for designer/user guidance? Can you give little more background  
to your project?

Ian

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [5 May 2008 14:16 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/8 "2008-05-05T14:16:41Z")

</div>

Sorry for being that unspecific.. The project i am working on is about  
speech recognition. A Software which allows med. experts to fill out a  
Form with speech only, so currently the xml File with the Domain Model  
generates a Form with Checkboxes, date Fields and so on and it  
includes also a spokendefault value which tells the speech recognition  
how this Element Name Sounds like. In the End the generated Form can  
be controled or navigated with speech.

I would say it has to be computable.

Thanks,  
Timmy

---

<div class="post-metadata">

**Author:** ![Thilo\_Schuler1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@Thilo\_Schuler1](https://discourse.openehr.org/u/Thilo_Schuler1)\
**Post date:** [6 May 2008 07:03 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/9 "2008-05-06T07:03:21Z")

</div>

> Thanks Thilo,
> 
> although this might not be worth it, i will try to model a generic element  
> as cluster-archetype.

you can try it, but I think in this case it is more complex (takes  
longer) and doesn't have added value. Also the archetype editor  
currently can't view assembled structures (templates).

> also i dont quite understand what you meant with  
> "model the 'spoken default' explicitly with a text ELEMENT that is  
> preset to the constant value."
> 
> how would i do that if i wanted to add a "spoken default field" to a date  
> field?

similar to what I send you before just a date element in the cluster

---

<div class="post-metadata">

**Author:** ![Thilo\_Schuler1](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/a4c791/32.png) [@Thilo\_Schuler1](https://discourse.openehr.org/u/Thilo_Schuler1)\
**Post date:** [6 May 2008 07:09 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/10 "2008-05-06T07:09:36Z")

</div>

Timmy,

I think this speech recognition stuff is more an interface thing and  
IMHO it doesn't belong into an archetype (if you see an archetype as a  
means to share interoperable health information). You could have a  
seperate XML file that tags every appropriate field to a  
'spokendefault' value(what would be the format? - sound file, phonetic  
spelling,...) via the atXXXX code.

Lets see what others think

-Thilo

---

<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:** [6 May 2008 07:37 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/11 "2008-05-06T07:37:40Z")

</div>

I sent the following yesterday, but it didn't make it to the list for whatever reason...I had this a couple of times now that my emails to the openehr lists don't arrive...maybe you can check Thomas?  
In essence I agree with you Thilo...not sure this should be in the archetype

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [6 May 2008 07:44 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/12 "2008-05-06T07:44:58Z")

</div>

Thilo,

I think you’re right, this actually really doesn’t make sense, my current approach somehow mixes information with knowledge.  
Which is kind of the opposite of the two-level modelling and the whole archetype architecture.

Actually my project is to check if the “domain model” can be transformed into a archetype.

I guess I’m still having problems understanding openehr.

Timmy

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [6 May 2008 08:10 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/13 "2008-05-06T08:10:32Z")

</div>

Ok I guess pronunciation wasn’t the best description of it.

in my project sample domain model the concept name really is the spoken default.

as I’ve heard it will be used in the future as a common word for a concept, i guess some medical terms which are used by med. experts which are not the official term, like abbreviations.

ie. saying MRI instead of Magnetic Resonance Imaging.

i guess it would be a better approach to model a generic archetype which shows how the domain model should be structured and add information at runtime, does this make sense?

Thanks in advance  
Timmy

---

<div class="post-metadata">

**Author:** ![Colin\_Sutton](https://discourse.openehr.org/user_avatar/discourse.openehr.org/colin_sutton/32/47_2.png) [@Colin\_Sutton](https://discourse.openehr.org/u/Colin_Sutton)\
**Post date:** [6 May 2008 12:37 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/14 "2008-05-06T12:37:22Z")

</div>

Timmy,

It seems to me that your 'spoken default' corresponds to the description associated with a SNOMED terminology code.

i.e. the SNOMED code has an english description, a french description, etc.  
For speech recognition you would need to store a phonetic representation (e.g. a markov model) of each term for each language/dialect to be recognised.  
No small task!

Regards,  
Colin Sutton

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [6 May 2008 13:33 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/15 "2008-05-06T13:33:31Z")

</div>

Sorry but I don’t understand what you mean with “Spoken default corresponds to the description associated with a SNOMED terminology code.”

Timmy

---

<div class="post-metadata">

**Author:** ![Timmy\_K](https://discourse.openehr.org/letter_avatar_proxy/v4/letter/t/3e96dc/32.png) [@Timmy\_K](https://discourse.openehr.org/u/Timmy_K)\
**Post date:** [24 May 2008 17:12 UTC](https://discourse.openehr.org/t/constant-values-and-sub-elements/16711/16 "2008-05-24T17:12:08Z")

</div>

i think that’s a very good idea to make a seperate XML-File if i understand it correctly.

i.e. i have a textfield [at0003] which is referencing to values in a global XML-File (containing all SpokenDefaults of all nodes of the domain model).

similar to SNOMED term\_binding or is it something completely different?

```auto
term_binding = <
		["SNOMED-CT"] = <
			items = <
				["at0000"] = <[SNOMED-CT::19019007]>
				["at0002"] = <[SNOMED-CT::162408000]>

```

```auto

```

so SpokenDefault is still computable and i can use it in the Application but instead of parsing it from the archetype, i get the SpokenDefault via Referencing?

thanks in advance,  
Timmy
