AQL on versioned compositions

Dileep V S dileep at
Tue Oct 30 07:43:57 EDT 2018

Hi Ian,

If we take an OP episode, it will consist of possibly a screening
encounter, then a consult encounter and one or more revisit encounters. We
will start with recording data such as complaints, diagnosis, medication
order etc . This data will be reviewed and updated in every subsequent
encounters. So a complaint/diagnosis recorded in the consult may get marked
as resolved during one of the subsequent revisits or sometimes something
new gets added. A medication order made during the consult may get
discontinued and another added later

The folders representing each of the encounters maintain a pointer to the
corresponding versions of the composition so that the snapshot of the
patient status is preserved and can be accessed(using an aql of versioned
composition) any time into the future.

We are not using persistent compositions anywhere. To display a persistent
status(Active complaints, diagnosis or medications), we use an aql to
filter on status to display the relevant information. We expect that the
doctor will review and update status of active items during an encounter.
This is important for us as we are approaching the problem from a person
centric view where the health status of the person concerned is evolving
with every health encounter. Our patient summary is thus, always the last
known status of the person.

By default the clinical information view is limited to an episode using
virtual folders. But a summary view across episodes is also possible if we
run the query outside the virtual folder context. Also in our case the
compositions can get versioned as an episode progresses.

I hope that helps. Do feel free to point out any problems with our approach


Dileep V S
HealtheLife Ventures LLP
m: +91 9632888113
a: 106, Innovation Centre, IIIT, Electronics City, Bangalore 560100
w:  e: dileep at

On Tue, Oct 30, 2018 at 3:02 PM, Ian McNicoll <ian at> wrote:

> Hi Dileep,
> It should be possible to query on versioned compositions but I feel a bit
> uncomfortable about using versioned data this way. For event-type
> compositions, I would only expect versions to be created as a result of an
> error correction, not as part of routine recording. For persistent-type
> compositions, new versions are routinely created but only when the previous
> version is reallyof little interest e.g summaries, status-tracking.
> I'm uneasy about your suggested approach. Can you spell out an example/
> Ian
> Dr Ian McNicoll
> mobile +44 (0)775 209 7859
> office +44 (0)1536 414994
> skype: ianmcnicoll
> email: ian at
> twitter: @ianmcnicoll
> Co-Chair, openEHR Foundation ian.mcnicoll at
> Director, freshEHR Clinical Informatics Ltd.
> Director, HANDIHealth CIC
> Hon. Senior Research Associate, CHIME, UCL
> On Tue, 30 Oct 2018 at 08:45, Dileep V S <dileep at> wrote:
>> Hi,
>> We are implementing virtual folders to organize compositions as per
>> episodes of care and encounters. The plan is to keep track of versioned
>> compositions in encounters to capture the change of information(Complaints
>> and diagnosis getting resolved across encounters inside an episode).This
>> will allow us to view the compositions as they were in any encounter and
>> not the latest version always.
>> For this we need to be able to query specific versions of compositions
>> using aql. Can some body point me to the documentation or examples of how
>> to do this?
>> regards
>> Dileep V S
>> *Founder*
>> HealtheLife Ventures LLP
>> m: +91 9632888113
>> a: 106, Innovation Centre, IIIT, Electronics City, Bangalore 560100
>> w:  e: dileep at
>> _______________________________________________
>> openEHR-technical mailing list
>> openEHR-technical at
> _______________________________________________
> openEHR-technical mailing list
> openEHR-technical at
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the openEHR-technical mailing list