Stream: implementers
Topic: Reference by search
Jose Costa Teixeira (Feb 15 2021 at 11:57):
Can a literal reference point to a search? I've seen this somewhere, but I don't think this is accepted. e.g.
POST /Observation
{
...
"subject" : {
"reference" : "Patient?identifier=xyz"
}
...
}
Lin Zhang (Feb 15 2021 at 12:31):
The response would be a bundle.
Jose Costa Teixeira (Feb 15 2021 at 12:37):
correct.
Jose Costa Teixeira (Feb 15 2021 at 12:37):
which is why i ask if this would make sense - i think not but maybe there is some section in the spec I've missed
René Spronk (Feb 15 2021 at 12:41):
No. Such conditional references may be used as part of a conditional-create or conditional-update, but not as part of a literal reference. Use reference .identifier instead.
Jose Costa Teixeira (Feb 15 2021 at 13:01):
thank you
Paul Church (Feb 15 2021 at 14:37):
This is legal as a conditional reference in a transaction bundle.
René Spronk (Feb 15 2021 at 14:41):
True "Note, in addition, that a reference may be by identifier, and if it is, and there is no URL, it may be resolved by scanning the ids in the bundle. Note also that transactions may contain conditional references that must be resolved by the server before processing the matches. "
René Spronk (Feb 15 2021 at 14:42):
Josh has a proposal out there to revamp http://build.fhir.org/bundle.html#references - referencing within bundles remains a tricky subject ...
Jose Costa Teixeira (Feb 23 2021 at 11:08):
So in HAPI we can post this resource
{
"resourceType" : "AllergyIntolerance",
"type" : "allergy",
"category" : [
"food"
],
"code" : {
"text" : "Allergic to shrimp"
},
"patient" : {
"reference" : "Patient?identifier=https://www.ehealth.fgov.be/standards/fhir/NamingSystem/ssin|60102047165"
},
"recordedDate" : "2014-10-09T14:58:00+11:00"
}
Jose Costa Teixeira (Feb 23 2021 at 11:08):
should that be allowed?
Jose Costa Teixeira (Feb 23 2021 at 11:09):
I don't think so, but perhaps I'm missing something
René Spronk (Feb 23 2021 at 11:10):
No, only if it's part of a transaction..
Jose Costa Teixeira (Feb 23 2021 at 11:36):
thank you. Should I submit an issue against HAPI?
Lloyd McKenzie (Feb 23 2021 at 14:43):
It's not technically non-conformant to handle that on an individual call - there's just no expectation it would be handled.
Vassil Peytchev (Feb 23 2021 at 16:31):
Since this is equivalent to
"patient" : {
"identifier" : {
"value" : "60102047165"
"system" : "https://www.ehealth.fgov.be/standards/fhir/NamingSystem/ssin"
}
}
I think it is not helpful to allow the search string in the reference....
Lloyd McKenzie (Feb 23 2021 at 16:41):
It's not really the same. In a transaction, there's an expectation that conditional references will be resolved - and that failure to resolve or resolution to more than one is an error. On the other hand, specifying Reference.identifier imposes no such expectations.
Lloyd McKenzie (Feb 23 2021 at 16:42):
Also, the example with an identifier is just one of the possible ways a conditional reference could be used.
Vassil Peytchev (Feb 23 2021 at 17:53):
I was referring to the observed behavior where there was no bundle. If there is no expectation that the search in the reference will result in any specific action, it seems to be equivalent to a logical reference...
Lloyd McKenzie (Feb 23 2021 at 20:17):
In a transaction, search in the reference must be executed and resolved - or result in an error if not supported. It won't be stored as the search.
Vassil Peytchev (Feb 23 2021 at 20:34):
My point is that when POSTing an individual resource, search in reference will not be executed and resolved, and it shall not be stored as the search. Is that incorrect?
I am not arguing about transaction bundles.
Lloyd McKenzie (Feb 23 2021 at 20:35):
If you POST a bare resource like that, you're non-conformant. Server is free to reject, ignore the element, resolve or whatever it likes.
Vassil Peytchev (Feb 23 2021 at 21:53):
It seems to me that HAPI, being a reference implementation, should reject such a POST in order to alert the client that they are non-conformant.
Lloyd McKenzie (Feb 23 2021 at 22:00):
@James Agnew
James Agnew (Feb 23 2021 at 23:03):
Resolving inline search expressions in references is an optional non-standard feature in HAPI FHIR that is disabled by default (but enabled on the public server)
Lloyd McKenzie (Feb 24 2021 at 03:42):
Can you disable it on the public server @James Agnew - people often use that to see what they can expect in production.
Lloyd McKenzie (Feb 24 2021 at 03:42):
(and to test conformance)
James Agnew (Feb 24 2021 at 10:42):
Yeah, I suppose we should.
Jose Costa Teixeira (Feb 24 2021 at 18:52):
thank you. Indeed, we used that to see what could be admissible
Last updated: Apr 12 2022 at 19:14 UTC