Stream: implementers
Topic: Searching Document Bundle
Ben Grey (Oct 29 2020 at 18:03):
I am having trouble searching the FHIR server for a document bundle based on its composition id. I tried:
[base]/Bundle?composition=[resource id]
and get no results. If I alter this search I always return this error:
"Unknown search parameter \"composition_id\". Value search parameters for this search are: [_id, _language, composition, identifier, message, timestamp, type]"
Am I doing something wrong? Thanks
John Moehrke (Oct 29 2020 at 18:05):
I would expect that a DocumentReference would index those FHIR-Documents(compositions+) that have been committed to a persistant bundle (binary).
John Moehrke (Oct 29 2020 at 18:06):
http://hl7.org/fhir/documents.html
John Moehrke (Oct 29 2020 at 18:06):
http://hl7.org/fhir/documentreference-mappings.html#fhircomposition
Ben Grey (Oct 29 2020 at 18:23):
@John Moehrke Thanks! If the contents of a document bundle including the composition are not created and stored individually, but only persist on the server within a bundle, can you query the bundles based on on their contents other than bundle id?
Lloyd McKenzie (Oct 29 2020 at 18:42):
You can chain through Composition. So you can say [base]/Bundle?composition.subject=Patient/123
or stuff like that
Lloyd McKenzie (Oct 29 2020 at 18:42):
(providing the server supports the chaining in question)
John Moehrke (Oct 29 2020 at 19:25):
the limitations of Binary elements and unknown of how capable a server will be at searching within a Binary.... is a reason why a DocumentReference is useful metadata
Dave Barnet (Nov 04 2020 at 10:30):
If the Patient resource was in the document Bundle, would the syntax for looking for all documents for Patient 123 be something like
GET [base]/Bundle?composition.subject:Patient.identifier=123 and if I wanted to get a document Bundle based on its identifier the would
GET [base]/Bundle?composition.identifier=abc123 be an OK syntax?
Lloyd McKenzie (Nov 04 2020 at 16:08):
Typically you'll want to include the identifier system, not just the identifier value, but yes, that looks like the appropriate syntaxes
Dave Barnet (Nov 05 2020 at 09:35):
Putting reasons as to why you would want to do this aside, if there was a use case to send both query parameters, it looks from the Search page on the FHIR spec that you use a "$" to AND these 2 parameters together
GET [base]/Bundle?composition.identifier=abc123$composition.subject:Patient.identifier=https://fhir.nhs.uk/Id/nhs-number|123
does that look correct?
René Spronk (Nov 05 2020 at 14:26):
Actually, it'd be an & , not a $ ..
Dave Barnet (Nov 05 2020 at 15:13):
It looks as if it should be a "&", but according to the Search documentation, as we are using chaining in the search parameters, I think you are supposed to use "$" to AND parameters together (http://hl7.org/fhir/R4/search.html#combining)
Paul Church (Nov 05 2020 at 15:51):
Composite search parameters using $ have to be pre-defined, and servers will list which ones they support in the capability statement. It's not an operator that can be applied arbitrarily in a query.
Dave Barnet (Nov 06 2020 at 10:44):
@Paul Church @René Spronk - I didn't pick that up from documentation. Could you point me to the relevant section that says parameters using $ have to be pre-defined?
René Spronk (Nov 06 2020 at 12:37):
See http://build.fhir.org/search.html#composite , which is the only search parameter type that uses $ as a separator
Last updated: Apr 12 2022 at 19:14 UTC