Yes, from memory this be about right, but the VERSIONED_OBJECT part is
redundant as it is not used anywhere in the query.

I notice you are specifying a HIER_OBJECT_ID as the COMPOSITION.uid
criteria.  Although it is not a specified and not a hard rule, it is
recommended that a OBJECT_VERSION_ID is used in the COMPOSITION.uid
otherwise you have no way of getting the exact version of a composition when
the composition is separated from the VERSION object.

Heath

> -----Original Message-----
> From: openehr-technical-bounces at openehr.org [mailto:openehr-technical-
> bounces at openehr.org] On Behalf Of mahdi.asgari at gmail.com
> Sent: Tuesday, 19 July 2011 11:00 PM
> To: openehr-technical at openehr.org
> Subject: Re: Re: AQL VersionedObject Grammar
> 
> Thanks Ian
> 
> Is the bellow EQL query correct for query in all versions of a
> composition ?
> 
> SELECT  v/commit_audit/committer/name,
> v/commit_audit/time_committed/value,
> v/data/uid, v/data/time_created, c FROM EHR e [ehr_id/value =
> 'ecfe6e6e-8868-4fc6-8db8-def71cb8a250'] CONTAINS VERSIONED_OBJECT vo
> CONTAINS VERSION v [all_versions] CONTAINS COMPOSITION
> c[openEHR-EHR-COMPOSITION.encounter.v1]
> Where c/uid = '<hierobjectid>'
> 
> ------------------------------
> 
> Message: 2
> Date: Tue, 19 Jul 2011 07:37:41 +0100
> From: Ian McNicoll <Ian.McNicoll at oceaninformatics.com>
> Subject: Re: AQL VersionedObject Grammar
> To: For openEHR technical discussions <openehr-technical at openehr.org>
> Message-ID:
>       <CAG-n1KzEE1mAFKcqqnGxfxFr3fOuJPz-
> qfcDe6FovusQBwwpgQ at mail.gmail.com>
> Content-Type: text/plain; charset=ISO-8859-1
> 
> Hi Mahdi,
> 
> SELECT  v/commit_audit/committer/name,
> v/commit_audit/time_committed/value, v/data/uid, v/data/time_created, c
> FROM
> EHR e [ehr_id/value = 'ecfe6e6e-8868-4fc6-8db8-def71cb8a250']
> CONTAINS VERSION v
> CONTAINS COMPOSITION c[openEHR-EHR-COMPOSITION.encounter.v1]
> 
> should return commit _audit and versioned_object attributes for all
> Encounter compositions.
> 
> Ian
> 
> 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
> 
> Clinical Modelling Consultant,?Ocean Informatics, UK openEHR Clinical
> Knowledge Editor www.openehr.org/knowledge Honorary Senior Research
> Associate, CHIME, UCL BCS Primary Health Care ?www.phcsg.org
> 
> 
> 
> 
> On 19 July 2011 06:50,  <mahdi.asgari at gmail.com> wrote:
> > Hi dear All
> >
> > I confuse to make a AQL query using versioned_object or Version,
> >
> > Does anyone know some example of using versioned_object and version?
> >
> >
> >
> > Thanks in advance
> >
> >
> >
> > Mahdi Asgari
> >
> > ----------------------------------------------------------------
> >
> > Naji Research and Development
> >
> > EHR Technical Manager
> >
> > ----------------------------------------------------------------
> >
> > Gmail:mahdi.asgari at gmail.com
> >
> > Y! Messenger: mahdiiran
> >
> > ooVoo: mahdi.asgari
> >
> >
> >
> > _______________________________________________
> > openEHR-technical mailing list
> > openEHR-technical at openehr.org
> > http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical
> >
> >
> 
> 
> 
> ------------------------------
> 
> _______________________________________________
> openEHR-technical mailing list
> openEHR-technical at openehr.org
> http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical
> 
> 
> End of openEHR-technical Digest, Vol 60, Issue 5
> ************************************************
> 
> _______________________________________________
> openEHR-technical mailing list
> openEHR-technical at openehr.org
> http://lists.chime.ucl.ac.uk/mailman/listinfo/openehr-technical


Reply via email to