Randolph,

You could consider AQL to be a logical query language, this allows semantic
queries to be shared amongst heterogeneous (and potentially, non-openEHR)
systems without the need to know the systems underlying data model.
Therefore, AQL logically runs against the Information Model (using Tim's
words) gaining its semantics from Archetype Models.  The Ocean
Implementation of the query processor physically uses both the data model
and information model to execute a query.  Another implementation might
purely use the data model or information model.  Non-openEHR or
non-Archetype-based  systems may support only a small subset of AQL queries
where they have provided an AQL to native query mapping.  The point is, AQL
is independent of the implementation and are sharable, semantic queries
based on shared archetypes.

 

Regards

 

Heath

 

Heath Frankel
Product Development Manager

Ocean Informatics



Ground Floor, 64 Hindmarsh Square

Adelaide, SA, 5000

Australia

 

ph: +61 (0)8 8223 3075

mb: +61 (0)412 030 741 
email: heath.frankel at oceaninformatics.com
<mailto:heath.frankel at oceaninformatics.biz>  



 

 

From: [email protected]
[mailto:openehr-technical-bounces at openehr.org] On Behalf Of Randolph Neall
Sent: Tuesday, 6 November 2007 3:35 AM
To: For openEHR technical discussions
Subject: Re: OpenEHR queries

 

As a developer from the US who sometimes tries to follow discussions here, I
have a question probably well answered if I took more time myself to find
the answer. Against what do your archetype queries run? Against the DB
itself or some representation of the data in memory? I ask because a few
months ago, someone from openEHR said in one of the discussions that a DB
schema is not part of openEHR, that some private participant in openEHR had
one for sale, and Ocean, maybe, but that was it. So, again against what do
these queries (see example in Chunlan Ma's message below) run? 

 

Thanks,

 

Randy Neall

Veriqant, L.L.C.



 

On 11/4/07, Chunlan Ma <chunlan.ma at oceaninformatics.com> wrote: 

Hi Greg,

Rong has indicated there is a paper about archetype query language. Thanks
Rong. That paper introduced basic query syntax. It was written at the 
beginning of this year. The query syntax has been enriched recently in order
to support more complicated queries. I've already started to write the
specifications, but need to resolve some known issues before release. 

Anyway, I handcrafted the following queries for you (I cannot build my query
builder at the moment because of some integration issues).

The query statement below shows that all observation instances with 
respiratory rate greater than n will be returned.

SELECT o
FROM EHR e[ehr_id/value=$ehrId] CONTAINS COMPOSITION CONTAINS OBSERVATION
o[openEHR-EHR-OBSERVATION.respiration.v1.adl]
WHERE o/data/events[at0002]/data[at0003]/items[at0004]/value/magnitude>n AND

o/data/events[at0002]/data[at0003]/items[at0004]/value/units = '/min'

If you want the respiratory quantity object been returned, the query would
look like:

SELECT o/data/events[at0002]/data[at0003]/items[at0004]/value 
FROM EHR e[ehr_id/value=$ehrId] CONTAINS COMPOSITION CONTAINS OBSERVATION
o[openEHR-EHR-OBSERVATION.respiration.v1.adl]
WHERE o/data/events[at0002]/data[at0003]/items[at0004]/value/magnitude>n AND
o/data/events[at0002]/data[at0003]/items[at0004]/value/units = '/min' 

Just for your information, the single letter 'o' is the observation class
variable name, "/data/events[at0002]/data[at0003]/items[at0004]/value" is
the archetype path to respiratory quantity node. If you have the archetype 
workbench running, you can identify this path there. '$ehrId' is the
parameter name which can be substituted with real EHR ehr_id value at run
time. The query language supports parameterization.

Some archetype query statements would be very long if the query criteria are

complicated. In fact, we don't need to write the above queries by hand.
Ocean Informatics has implemented a tool - Archetype Query Builder, which
can be used to create/edit queries easily. Additionally, Ocean has also 
implemented a query parser and query engine as well.

The above query statements are consistent to the query syntax introduced by
the MedInfo paper. The current query tools also support this query syntax.
However, as I have said that we have enriched the query syntax and all the
enhancements can be found from the query specifications.

Hope this helps.

Regards,
Chunlan

-----Original Message-----
From: [email protected]
[mailto:openehr-technical-bounces at openehr.org] On Behalf Of Greg Caulton 
Sent: Monday, November 05, 2007 6:48 AM
To: openEHR-technical at openehr.org
Subject: OpenEHR queries

Hi,

Somewhere I recall reading that there was an OpenEHR query that 
theoretically an OpenEHR compliant system could execute a return
results for.

Is there a spec somewhere, preferably with a simple example.

So if someone knew my patient and queried for all instances of 
Respiratory Rate greater than n?

openEHR-EHR-OBSERVATION.respiration.v1.adl

Rate  at0004 > n
Units /min (is that a default or are the units passed in the query)

Or is this future functionality? 

thanks

Greg

http://www.patientos.org
_______________________________________________
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 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.openehr.org/mailman/private/openehr-technical_lists.openehr.org/attachments/20071106/46a509ba/attachment.html>

Reply via email to