Bert Verhees said> Or would another solution be better? 

I suggest:

/items[at0008]/value/value = Jan Peter
/items[at0009]/value/value = Balkenende

or 

CLUSTER[at0007] occurrences matches {0..1} matches {    
                            ELEMENT[at0008] occurrences matches {0..*} matches 
{    -- givenname
                                value matches {
                                    DV_TEXT matches {*}
                                }
                            }
                            ELEMENT[at0009] occurrences matches {0..*} matches 
{    -- middlenames
                                value matches {
                                    DV_TEXT matches {*}
                                }
                            }
                            ELEMENT[at0010] occurrences matches {0..1} matches 
{    -- familyname
                                value matches {
                                    DV_TEXT matches {*}
                                }
                            }
                        }

then 

/items[at0008]/value/value = Jan
/items[at0009]/value/value = Peter van Wat
/items[at0010]/value/value = Balkenende

i.e. don't use indexes - especially where they contradict the meaning:
 * How can you have two 'first' names?
 * Family names come first in some asian languages.

Regards,
Colin
________________________________________
From: openEHR-technical [openehr-technical-bounces at lists.openehr.org] on 
behalf of Bert Verhees [[email protected]]
Sent: Tuesday, 19 November 2013 11:45 PM
To: For openEHR technical discussions
Subject: Index in array's in ADL

Hi all,

I had following interesting discussion.

Suppose we have a cluster containing name of a person.

There is a field called firstname, and a field called lastname.

The problem is concerning the ADL-path, what should be used.

This is a part of the archetype:

CLUSTER[at0007] occurrences matches {0..1} matches {    -- voornamen
                        items cardinality matches {0..*; ordered} matches {
                            ELEMENT[at0008] occurrences matches {0..*} matches 
{    -- firstname
                                value matches {
                                    DV_TEXT matches {*}
                                }
                            }
                            ELEMENT[at0009] occurrences matches {0..1} matches 
{    -- lastname
                                value matches {
                                    DV_TEXT matches {*}
                                }
                            }
                        }


This is a hypothecical example, only to explain:

Because at0008 has upper-occurrences of more then 1 ( a person can have
more then one firstnames)
And at0009 has upper-occurrences of 1 (people only have one last-name
(in this hypothetical country))

If we want to express data in a path/value combination, what would be
the best solution?

   /items[at0008][1]/value/value = Jan
   /items[at0008][2]/value/value = Peter
   /items[at0009]/value/value = Balkenende

   /items[at0008][1]/value/value = Jan
   /items[at0008][2]/value/value = Peter
   /items[at0009][1]/value/value = Balkenende

   /items[at0008][1]/value/value = Jan
   /items[at0008][2]/value/value = Peter
   /items[at0009][3]/value/value = Balkenende

Or would another solution be better?
Thanks in advance for suggestions.

Kind regards
Bert Verhees

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

#####################################################################################
Scanned by MailMarshal - M86 Security's comprehensive email content security 
solution. 
Download a free evaluation of MailMarshal at www.m86security.com
#####################################################################################

Reply via email to