Stream: dotnet
Topic: Search returning OperationOutcome - how to identify?
Santosh Jami (Sep 02 2020 at 20:42):
Santosh Jami [said]
Reposting this on dotnet channel
I have done a standard DiagnosticReport search operation using FhirClient (using .NET FHIR API STU3)
Bundle diagnosticReportSearchBundle = fhirClient.Search<DiagnosticReport>(searchParams);
And based on the bundle results, I am reading the data and executing my logic.
I identified my search params were wrong, so FHIR server returned all the DiagnosticResources, and not just limited to my search criteria.
This stumped me.
What is the way to identify if the search returned "OperationOutcome" resource? Should I traverse all entries for every search and determine that there is no OperationOutcome, this is good result. Seems a bad approach, any better way to identify this?
Brian Postlethwaite (Sep 02 2020 at 22:50):
bundle.search.mode = 'outcome'
refer to here: http://hl7.org/fhir/R4/bundle.html
Christiaan Knaap (Sep 03 2020 at 08:45):
Another quick way can be to compare the value of self-link in the Bundle (or the Content-Location header, at least with Vonk) to your original request. The link will contain only the parameters that were handled. See here for background: http://hl7.org/fhir/R4/search.html#conformance
Santosh Jami (Sep 04 2020 at 13:53):
Thanks for the feedback.
We added the fix to verify the data from parameters used in search as part of "self-link" in the bundle @Christiaan Knaap .
And also will make a check on Bundle.entry.search.mode = 'outcome' @Brian Postlethwaite
Last updated: Apr 12 2022 at 19:14 UTC