Given a composition C that has multiple instances of the same observation archetype O, should I be able to query for all instances of O?
A trivial example: for the given ehr, there is one composition that contains two progress_note observations.
Using EHRBase and the query below, I only get one of the observations returned.
SELECT
o
FROM EHR e
CONTAINS OBSERVATION o[openEHR-EHR-OBSERVATION.progress_note.v1]
WHERE e/ehr_id/value = $ehr_id
If I add a second composition with multiple notes, I get 2 results; one note form each composition.
Is this expected? If so, how/can my query be adjusted to return all progress notes in this example?
Hi Alex, selecting observation and filtering by archetype id should return all the instances of the observations complying with that archetype, single or multiple inside the same compo.
Hi Alex,
EhrBase is quite mature, so I too would expect your query to return two observations, given a composition with two observations.
There used to be a period during which EhrBase team were talking about implementing behaviour that would be more intuitive for users who may be less exposed to query languages such as SQL or XQuery etc.
AQL’s story is kind of complicated when it comes to how it behaves. I advocated for it to have a formal execution semantics for years (literally) but we could not get that effort off the ground (for good reasons). So as things stand, each vendor may or may not give you an explanation of how it functions, but these days most implementations converge in terms of results, except when they don’t
I still think the outcome should be what you’re expecting. If you’re able to perform a GET from the REST api and share the json form (or XML) of your compositions, we can speculate with a bit more confidence.