On 14/08/2012 10:34, Seref Arikan wrote:
> Greetings,
> According to adl 1.5 document on the openEHR web site (issued 25 Jan 
> 2012), Section 5.3.6.3, the runtime paths for single valued attributes 
> can omit node identifer.
> The example given in the document uses miles per hour and km per hour 
> alternatives. The thing is, if the runtime path is what is going to be 
> persisted (and I can't see any other practical cases), the persisted 
> data will have no information to mark the semantics of the selection 
> of an option among alternatives.

actually, this text is a bit misleading. If we have the archetype

ELEMENT[at0004] matches { -- speed limit
     value matches {
         QUANTITY[at0022] matches { -- miles per hour
             magnitude matches {|0..55|}
             property matches {"velocity"}
             units matches {"mph"}
         }
         QUANTITY[at0023] matches { -- km per hour
             magnitude matches {|0..100|}
             property matches {"velocity"}
             units matches {"km/h"}
         }
     }
}

then the data instance created from the at0022 form of the QUANTITY will 
be (in dADL):

items = <
     ["1"] = < -- ELEMENT
         archetype_node_id = <"at0004">
         value = < -- QUANTITY
             archetype_node_id = <"at0022">
             magnitude = <25>
         >
     >
     ["2"] = <....>
     etc
 >

so the path items[at0004]/value[at0022] will choose the quantity, 
although items[at0004]/value would do just as well. (Remember, the Xpath 
equivalents are 
items[@archetype_node_id='at0004']/value[@archetype_node_id='at0022'] 
etc - the [at0022] is just a shorthand selection predicate.)

The paths are not 'persisted' as such - just the data. The paths are 
always derivates of the data.

>
> In case of a query such as get me all Xs where value is expressed as 
> km per hour, the system can not know what which option was used: kmph 
> or mph, because there is not node identifier.

in this case, use the path items[at0004]/value[at0022].
*
* - thomas

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/attachments/20120814/e99d39c8/attachment.html>

Reply via email to