Hi Ian
Thank you for a quick response!

Ok - so my modeling is ok :) Still there is a minor problem/challenge. I have 
to make a report from the Archetype. Given the following value instance of the 
archetype element:

<items xsi:type="ELEMENT" archetype_node_id="at0072">
        <name>
          <value>AccidentSite_001</value>
        </name>
        <value xsi:type="DV_CODED_TEXT">
          <value>T - Other transport area </value>
          <defining_code>
            <terminology_id>
              <value>local</value>
            </terminology_id>
            <code_string>at0074</code_string>
          </defining_code>
        </value>
</items>

I need to transform this into the following XML element in the report:

<injuryReport accidentSite="T"/>

As I can see there is no way to model the key of the coded text ("T"). I can do 
some business logic to look up the value from an external terminology. But it 
would be simple and clean if I could model the key ("T") in the Archetype. Then 
a value instance could look like this:

<items xsi:type="ELEMENT" archetype_node_id="at0072">
        <name>
          <value>AccidentSite_001</value>
        </name>
        <value xsi:type="DV_CODED_TEXT">
          <value>T - Other transport area </value>
         <key>T</key>
          <defining_code>
            <terminology_id>
              <value>local</value>
            </terminology_id>
            <code_string>at0074</code_string>
          </defining_code>
        </value>
</items>

Are there anyone facing the same problem? How do you handle this?

With regards,
Bj?rn N?ss
Product owner
Telephone +47 75 59 24 55
Mobile +47 93 43 29 10
www.dips.com<http://www.dips.com/>

[cid:image001.png at 01CE50BF.24E24FB0]

This message is for the designated recipient only and may contain confidential 
or private information. If you have received it in error, please notify the 
sender immediately and delete the original.

Fra: openEHR-technical [mailto:openehr-technical-bounces at lists.openehr.org] 
P? vegne av Ian McNicoll
Sendt: 13. mai 2013 10:45
Til: For openEHR technical discussions
Emne: Re: How to model this XML type as Archetype?

Hi Bjorn,

This is exactly how I would have modelled it. This is not really an Ordinal 
which implies some sort of ordering or scale of the values e.g -,0,+,+++,++++.

In your examples the letters V, T , B , G etc are really just shortcuts.

Ian

                }



On 13 May 2013 06:22, Bj?rn N?ss <bna at dips.no<mailto:bna at dips.no>> wrote:
Authorities require the reporting of injury. It is defined XSD for the message 
to be sent. Some items have numbers. These are perfect ordinal. The problem is 
the following XML type. How should these be modeled as archetype data types?

<simpleType  name = ' accidentSite '   >
   <restriction base= 'string'>  <!--  Coding scheme: 8604 Accident Site -->
      <enumeration value = 'V' />  <!-- ' Road, street, pavement, pedestrian, 
bicycle ' -->
      <enumeration value = 'T' />  <!-- ' Other transport area ' -->
      <enumeration value = 'B' />  <!-- ' Housing, residential ' -->
      <enumeration value = 'G' />  <!-- ' Agriculture Business, forestry ' -->
      <enumeration value = 'A' />  <!-'other scene' -->
      <enumeration value = 'U' />  <!-- ' Unknown scene ' -->
   </restriction>
</simpleType>

So far I have modelled it like below. Is there a better way? I wish I could use 
ordinal with letters....

ELEMENT[at0072] occurrences matches {0..1} matches {             -- Skadested
                value matches {
                               DV_CODED_TEXT matches {
                                               defining_code matches {
                                                               [local::
                                                               at0073,          
       -- V - Vei, gate, fortau, gang- , sykkelvei
                                                               at0074,          
       -- T - Annet transportomr?de
                                                               at0075,          
       -- B - Bolig boligomr?de
                                                               at0076,          
       -- G - Jordbruksbedrift, skogbruk
                                                               at0077,          
       -- I - Institusjon, sykehus, syke-, adershjem, off.kontor
                                                               at0078,          
       -- H - Lekeplass
                                                               at0079,          
       -- S - Skole, h?yskole, universitet, barnehage, familiebarnehage i 
privat hjem eller liknende skolefritidsordning
                                                               at0080,          
       -- P - Sport-, idrettsomr?de (ogs? p? skole/h?yskole/universitet)
                                                               at0081,          
       -- N - Fri natur, hav, sj? og vann
                                                               at0082,          
       -- A - Annet skadested
                                                               at0083] -- U - 
Ukjent skadested
                                                               }
                                               }
                               }
                }


With regards,
Bj?rn N?ss
Product owner
Telephone +47 75 59 24 55<tel:%2B47%2075%2059%2024%2055>
Mobile +47 93 43 29 10<tel:%2B47%2093%2043%2029%2010>
www.dips.com<http://www.dips.com/>

This message is for the designated recipient only and may contain confidential 
or private information. If you have received it in error, please notify the 
sender immediately and delete the original.


_______________________________________________
openEHR-technical mailing list
openEHR-technical at lists.openehr.org<mailto:openEHR-technical at 
lists.openehr.org>
http://lists.openehr.org/mailman/listinfo/openehr-technical_lists.openehr.org



--
Dr Ian McNicoll
office +44 (0)1536 414 994
fax +44 (0)1536 516317
mobile +44 (0)775 209 7859
skype ianmcnicoll
ian.mcnicoll at oceaninformatics.com<mailto:ian.mcnicoll at 
oceaninformatics.com>
Clinical Modelling Consultant, Ocean Informatics, UK
Director openEHR Foundation  
www.openehr.org/knowledge<http://www.openehr.org/knowledge>
Honorary Senior Research Associate, CHIME, UCL
SCIMP Working Group, NHS Scotland
BCS Primary Health Care  www.phcsg.org<http://www.phcsg.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20130514/25f7114d/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 4149 bytes
Desc: image001.png
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20130514/25f7114d/attachment-0001.png>

Reply via email to