We're updating the issue view to help you get more done. 

Add Composition.context.category to support report Compositions


The use-case is discharge summaries. These are Compositions which only (“mostly”) contains links to existing entries. We will be using links but since the Composition should be transferred to another health provider it must be serialized and validated against an template.

Technically this Compostions contains a lot of entries which is “link to self”.

The most important thing is to precisely define the semantic meaning of the content in a composition. In this specific use-case the content of the composition is always a copy of the primary source. This means that the Discharge letter only bring one new thing into the EHR - that is the fact that there is an approved discharge letter. But the entries in the composition is link and copies of entries in other primary sources.

The requirements to the system is quite small:

  • Content of "report" documents MUST not be in the resultset when doing normal AQL queries.

  • It MUST be possible to query for "report" compositions with specific content.

The solution to this problem is simple and I can give an example with an AQL query. Below is a standard query for body weight. Look at the WHERE condition. Here I am looking for all body weights which are NOT part of a report composition. This WHERE condition will be the default filter on all queries. If the client would like to query for all body weights in report document, then just change from NOT EQUALS 434 to EQUALS 434.

SELECT o/data[at0002]/events[at0003]/data[at0001]/items[at0004]/value/magnitude
WHERE c/category/defining_code/terminology_id/value = 'openehr'AND c/category/defining_code/code_string != '434'

Given that we agree that there is a class of compositions which belongs to the "report" group. Then we should add such semantic into the RM to make it precise and consistent.

The proposed solution is to add a new code for composition category:

<group name="composition category">
<concept id="431" rubric="persistent"/>
<concept id="433" rubric="event"/>
<concept id="434" rubric="report"/>

Impact Analysis


Change Description




Ian McNicoll


Bjørn Næss

Raised By

Bjørn Næss


Affects versions

Release 1.0.2