Currently in openEHR, we retrieve data in the same structures it went in, either:
- as the original COMPOSITION, ENTRY etc, via a direct get from the REST API
- as a list/table of pieces, within an AQL RESULT_SET
Neither of these modes performs two things that would be convenient in many circumstances:
- resolving Links / Citations
- attaching context of matched items
An obvious use case of when we would like this kind of behaviour is the managed list, i.e. Allergy List, Problem List etc. The most common retrieval today is a series of retrievals to out the List together, when really the app dev would like to just get the logical list in one hit. I.e. like this:
Managed Lists are not the only time when Links could usefully be resolved - you might want to materialise out a chain of Obs → Dx → Rx → Action.
We should potentially consider a general solution to this problem that works in both direct retrieve and AQL modes, and allows some control over:
- how deep Links are followed
- which links should be resolved and which not, based on type and meaning field
- whether context should be included with resolved Link targets.
We can think of this as expanded retrieve.
If we distinguish Citation as a special kind of Link for ‘quoting’ other content, as in managed lists, then a common expanded retrieval mode would be ‘retrieve, resolving all citations’.