fhir_client icon indicating copy to clipboard operation
fhir_client copied to clipboard

Parser warning during search

Open rdingwell opened this issue 6 years ago • 1 comments

When performing a search I see a warning along these lines: WARN -- : Expected FHIR::Observation but got FHIR::Bundle

Tracing this back to the search method in the Sections module it looks like the client tries assert that the response is of the type being searched against. This doesn't seem to make sense as a search response is going to be a bundle, thus the warning message. Is there a reason for this or should it be refactored?

https://github.com/fhir-crucible/fhir_client/blob/5b1325d60a5310e20ff33a866d7c6dcb9bb3e0fa/lib/fhir_client/sections/search.rb#L11

rdingwell avatar Jul 12 '18 12:07 rdingwell

This could probably be fixed by passing versioned_resource_class('Bundle') into the parse_reply method instead of the klass parameter.

jawalonoski avatar Jul 12 '18 12:07 jawalonoski