Agree on the general idea. But the second bullet makes for a complicated query.
It seems to me that we might want to contemplate a method of options or switches in queries, e.g.
INCLUDE DRAFT
: include data classified as ‘draft’.
A rule that states what ‘is_draft’ means for openEHR data would need to be written once and hidden in the system (something that looks for an owner object of type VERSION
with lifecycle_state = incomplete
).
Maybe the same approach could be used for the exclusion of data not relating to the data subject of the record, e.g .
EXCLUDE NON-SUBJECT
would translate to a rule e.g. one that looks for an owner object of type ENTRY
with typeof(subject != PARTY_SELF)
.
I’m just thinking of ways to make life easier for the query author.