FHIR Chat · Reference by search · implementers

Stream: implementers

Topic: Reference by search


view this post on Zulip 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"
  }
...
}

view this post on Zulip Lin Zhang (Feb 15 2021 at 12:31):

The response would be a bundle.

view this post on Zulip Jose Costa Teixeira (Feb 15 2021 at 12:37):

correct.

view this post on Zulip 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

view this post on Zulip 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.

view this post on Zulip Jose Costa Teixeira (Feb 15 2021 at 13:01):

thank you

view this post on Zulip Paul Church (Feb 15 2021 at 14:37):

This is legal as a conditional reference in a transaction bundle.

view this post on Zulip 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. "

view this post on Zulip 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 ...

view this post on Zulip 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"
}

view this post on Zulip Jose Costa Teixeira (Feb 23 2021 at 11:08):

should that be allowed?

view this post on Zulip Jose Costa Teixeira (Feb 23 2021 at 11:09):

I don't think so, but perhaps I'm missing something

view this post on Zulip René Spronk (Feb 23 2021 at 11:10):

No, only if it's part of a transaction..

view this post on Zulip Jose Costa Teixeira (Feb 23 2021 at 11:36):

thank you. Should I submit an issue against HAPI?

view this post on Zulip 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.

view this post on Zulip 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....

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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...

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip 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.

view this post on Zulip Lloyd McKenzie (Feb 23 2021 at 22:00):

@James Agnew

view this post on Zulip 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)

view this post on Zulip 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.

view this post on Zulip Lloyd McKenzie (Feb 24 2021 at 03:42):

(and to test conformance)

view this post on Zulip James Agnew (Feb 24 2021 at 10:42):

Yeah, I suppose we should.

view this post on Zulip 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