fhir_client
fhir_client copied to clipboard
Parser warning during search
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
This could probably be fixed by passing versioned_resource_class('Bundle')
into the parse_reply
method instead of the klass
parameter.