FHIR Search response

Hello,

Why does OpenEMR return a FHIR Bundle of type “collection” in response to a FHIR Search?

I believe the FHIR standard defines that a response to a search must be a bundle of type “searchset”(see Http - FHIR v4.0.1). As the USCore Search Parameter and Operation section also references the same (see Search Parameters and Operations - US Core Implementation Guide v7.0.0-ballot) I believe this OpenEMR response is not ideal.

Can this behaviour be changed through a configuration option?

Thanks,

Andries Hamster

No, this can’t be changed by configuration. I looked into the Bundle resource and it does look like we are not properly setting the ‘type’ property when a search operation is used. I’m surprised that the ONC validation tool didn’t catch this for us when we went through certification.

If your interested in submitting a pull request to fix this behavior, we’d be happy to review it.

Unfortunately I am not a software engineer :frowning: Would not know how to submit a pull request.

After reviewing some of the FHIR search responses I do believe I am seeing other non-expected FHIR responses. For example the way the response to a FHIR Observation Search is returned is, as far as I can tell, not how it should be. It looks like an observation resource (with category: vital-signs and (loinc) code: 85353-1) is “mis-used” to group a number of vital sign observations that are linked to the same encounter/visit through the “hasMember” attribute. I would have expected a encounter reference on each (vital-sign) observation. The encounter reference is not included in the responses though. The hasMember attribute should be used to return a set of observation beloning to a “battery” or “panel”.

So the forum is great for discussion, but if you see bugs you can create a new issue thread on github to report bugs / problems you see. That is where the software team works to resolve issues. If you or your organization are interested in funding any of these bug fixes / work let me know and we can get you in contact with developers in the community.