Filtering for Simple Queries in REST APIs

Problem

Provide an easy way to filter returned Compositions and possibly Entries, separate from full AQL. This simple filtered retrieval would be based on these criteria:

  • time-window - an interval of time (including one-sided, i.e. 'since T')
  • archetype id(s) - match specific data in Compositions based on specific archetypes, regardless of form (template) it was captured in
  • template id(s) - match specific data sets, i.e. based on template ids corresponding to particular forms or messages.

The motivation to do this is that without an ability to filter Compostions, the current GET calls are not very useful to developers, e.g. to do obvious things like obtaining last month of BPs.

See https://github.com/openEHR/specifications-ITS/issues/31 for more discussion.

Design Notes

This might be implemented with some 'canned query' calls, which might actually be implemented with standard AQL, and whose semantics could be expressed as AQL equivalents at the specification level.

Some systems with no AQL, but other methods of querying, could implement canned queries with their own methods.

An additional idea would be to add ENTRY end-point, i.e. calls that return Entries based on the above filtering, which would take care of probably a large proportion of routine queries without invoking AQL. This would suit new developers and simple applications.