Stream: hapi
Topic: Bundle search using composition attributes
Lars Rückert (Jan 23 2019 at 12:18):
Hello,
I am trying to implement my own operation on the Bundle type, to retrieve document bundles for a given Patient.
To do this I need to figure out how I can search on Bundles using the attributes of the composition, specifically the subject.
According to what I understood reading the FHIR API it should be possible to search for this using chained parameters like so: <url>/Bundle?composition.subject=<id>.
This does however not work. I tried it on http://hapi.fhir.org/baseDstu3 using this example Bundle http://hapi.fhir.org/baseDstu3/Bundle/1230334.
(I also tried it using other bundles with the same result, in case this one didn't work.)
Some of the requests I tried:
http://hapi.fhir.org/baseDstu3/Bundle?composition.subject=941852 -> 0 results
http://hapi.fhir.org/baseDstu3/Bundle?composition.patient=941852 -> 0 results
http://hapi.fhir.org/baseDstu3/Bundle?composition.subject=Patient/941852 -> Error: "theResourceName must not be blank"
I also tried variations with more type specifications or using the ID of the composition instead of the subject, but nothing worked.
However, using the example from the search reference of the STU3 search reference works:
http://hapi.fhir.org/baseDstu3/DiagnosticReport?subject.name=peter does yield results.
I would really appreciate some pointers on how I can get this search on the composition attributes to work, or if it is even possible.
As I am implementing an Operation in the server, therefore I also have access to the BundleResourceProvider and the Dao.
Thanks
Patrick Werner (Jan 23 2019 at 13:00):
Hi Lars,
$document is already implemented in hapi, so you don't have to implement it yourself
Patrick Werner (Jan 23 2019 at 13:02):
the query you are looking for is: http://hapi.fhir.org/baseDstu3/Composition?subject=Patient/941852
Patrick Werner (Jan 23 2019 at 13:04):
Then you parse the Composition resource and invoke $document like this:
http://hapi.fhir.org/baseDstu3/Composition/1230333/$document
Patrick Werner (Jan 23 2019 at 13:05):
We had a productive bof session at the dev days Amsterdam to create a custom operation which would allow to execute the search and the document creation in one call.
Lars Rückert (Jan 23 2019 at 14:19):
Hi Patrick,
thank you for the answer, I think this will help.
Unfortunately I currently have the bundle only as the self contained bundle, so there is no composition in my fhir server.
Is there also the reverse operation of $document, which takes an incoming bundle and splits it up to store all the components of the document where they belong?
Patrick Werner (Jan 24 2019 at 09:16):
Ahh, now i understand the problem. You are right http://hapi.fhir.org/baseDstu3/Bundle?composition.subject=Patient/941852 should work, but doesn't.
I'll have a look at this issue.
Lars Rückert (Jan 24 2019 at 09:19):
Thank you very much!
Lars Rückert (Jan 30 2019 at 08:51):
@Patrick Werner Any news on this issue?
Patrick Werner (Jan 30 2019 at 16:02):
didn't had time to look into it yet :-/ I hope i'll have some time this weekend.
Last updated: Apr 12 2022 at 19:14 UTC