Stream: implementers
Topic: Compartment search
Christiaan Knaap (Dec 13 2017 at 13:37):
CompartmentDefinition.code is restricted to Patient | Encounter | RelatedPerson | Practitioner | Device. Why is it not permitted to create a CompartmentDefinition for e.g. Location?
Christiaan Knaap (Dec 13 2017 at 13:41):
And if the client does a request for /Organization within a Patient compartment, is the client authorized to get:
- all Organizations (since the compartment is not linked to Organization, so it does not restrict it)
- no Organizations (since the compartment is not linked to Organization, and you cannot query outside of it)?
Obviously access to Organization could be restricted in another way (e.g. Smart scopes), but I see this decision apart from that.
Lloyd McKenzie (Dec 13 2017 at 15:57):
Compartments tie deeply into how query can work, so we don't want implementers going off and defining their own compartments - and particularly defining them differently. If there's a use-case for a Location compartment, submit a change request. I do agree that we should clarify expectations around querying for a resource within a compartment when that resource isn't defined as being part of the compartment. Personally, I think this should be an error. I think that's safest for forward compatibility reasons. In any case, definitely submit a change proposal for us to clarify expectations.
Christiaan Knaap (Dec 14 2017 at 12:19):
Thanks @Lloyd McKenzie
I think it is not so uncommon to go beyond the bounderies of a compartment, e.g. for an _include:
[base]/Patient?_include=general-practitioner
where Practitioner nor Organization is in the patient CompartmentDefinition.
So I agree, I'll make a change proposal for clarification.
Christiaan Knaap (Dec 14 2017 at 12:31):
Angus Millar (Apr 27 2018 at 09:53):
Look out for _revinclude on Compartments. I had to cater for this search on Compartments to ensure the user did not get all Observations for all the Organizations they can access: {{ServiceRootUrl}}/Patient/FCC-PAT-00001/Observation?_revinclude=Observation:performer
Christiaan Knaap (May 03 2018 at 06:30):
I don't see the problem: Observation:performer has no Observation type as target, so think this _revInclude will not do anything. Or am I missing the point?
Angus Millar (May 03 2018 at 10:20):
Sorry @Christiaan Knaap i ballsed that query up, I mean this query:
[base]/Patient/[id]/Organization?_revinclude=DiagnosticReport:performer
Don't want a patient who can access all Organization to then be able to reinclude all Observations
Angus Millar (May 03 2018 at 10:30):
Actually, looking at this again, I can see it is not clear what it means to have a Resource listed as in the Compartment yet have no search parameters. Such as Organization in the Patient CompartmentDefinition opposed to a resource type that is not listed at all in the CompartmentDefinition? I had interpreted a Resource listed yet with no search parameters to infer that all instances are in the compartment, much like a general search query with no parameters and then a Resource not listed at all to mean no instances of that type are in the compartment.
Christiaan Knaap (May 03 2018 at 12:21):
That is indeed not very clear, see https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=14332&start=0
Last updated: Apr 12 2022 at 19:14 UTC