oehf / xds-registry-to-fhir

IHE XDS.b Registry using a FHIR server as backend
https://github.com/oehf/xds-registry-to-fhir/wiki
Apache License 2.0
12 stars 2 forks source link

FindDocuments Registry Stored Query (ITI-18) is missing the "author" query parameter #10

Open nick-mpampamis opened 2 months ago

nick-mpampamis commented 2 months ago

According to the IHE ITI TF Vol2 for the Registry Stored Query (ITI-18), the FindDocuments stored query shall support the optional "author" query parameter.

Additionally, the note on this query parameter says:

The value for this parameter is a pattern compatible with the SQL keyword LIKE which allows the use of the following wildcard characters: % to match any (or no) characters and _ to match a single character. The match shall be applied to the text contained in the Value elements of the authorPerson Slot on the author Classification (value strings of the authorPerson sub-attribute)

Thopap commented 2 months ago

Hello @nick-mpampamis,

definitely valid observation. This is currently one of the limitations.

The background here: Currently author is implemented with a fhir contained resource. With this approach, most fhir server's do not support a search on contained resources.

The simple option might be a in-memory search, so the xds-registry-to-fhir service will fetch more fhir resources that necessary.

Does this sound reasonable for you? Do you any further proposoals / idea's here.

nick-mpampamis commented 2 months ago

Hello @Thopap!

I think we should be able to search contained resources in FHIR, according to the Search documentation.

I tested it with the Firely and Hapi FHIR server and they both support it.

curl 'https://server.fire.ly/DocumentReference?author%3APractitionerRole.practitioner.name:exact=Norbi'

Unfortunately FHIR :exact and :contains modifiers do not cover all the needs of the XDS query param (e.g. SQL LIKE).

Your solution for in-memory filtering by author after fetching the results from FHIR is simple and will work and seems to be the only solution for now.

Thopap commented 2 months ago

Good to know that the firely testserver can be used.

I will play around a bit and see what can be done provided here.

Thopap commented 2 months ago

AuthorPerson evaluation as in-memory filtering implemented (will affect FindDocuments, FindSubmissionSet and FindDocumentsByReferenceId). XDSTools now also mark these tests as green.

Before closing this issue, i will check if fhir criteria can be added on top to reduce the number of documents that are evaluated in-memory.

Demo deployment on http://xds.thopap.de:8081/ was updated.