":contains" not working in 2.7.0

224 views
Skip to first unread message

ja...@interopion.com

unread,
Mar 13, 2019, 2:39:52 PM3/13/19
to HAPI FHIR
This is occuring in 3.7.0 and 3.8.0-SNAPSHOT

When adding the ":contains" modifier to the "name" parameter in a Patient GET call, I get an error saying that ":contains modifier is disabled on this server"

You can try the call below:

We could omit the ":contains" tag but then we can't search for name by letters found in the middle or end.

Was this done intentionally or by accident. If this was intentional, is there another filter we could use that does the same thing?

ja...@interopion.com

unread,
Mar 13, 2019, 2:40:20 PM3/13/19
to HAPI FHIR
Of course in the title I meant 3.7.0, not 2.7.0.

ja...@interopion.com

unread,
Mar 13, 2019, 3:31:05 PM3/13/19
to HAPI FHIR
I now see that :contains is not allowed by default but that there is a way to override it. However, when working on this for the HSPC sandbox, I see no way of doing so. I assume this would require overriding the createPredicateString method on the ca.uhn.fhir.jpa.dao.SearchBuilder class, but I can't because the SearchBuilder constructor is not public. Am I missing something here?

Thanks,
Jacob

James Agnew

unread,
Mar 13, 2019, 5:06:24 PM3/13/19
to ja...@interopion.com, HAPI FHIR
Hmm.. I see what you mean.

The setting to enable it is on the DaoConfig object if you wanted to enable it for the HSPC sandbox.

I'm not sure why it wasn't enabled on our public server. I just did so and that resolved the error, but I can't get it to return any results.. :(

This needs further investigation!

Cheers,
James

--
You received this message because you are subscribed to the Google Groups "HAPI FHIR" group.
To unsubscribe from this group and stop receiving emails from it, send an email to hapi-fhir+...@googlegroups.com.
To post to this group, send email to hapi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/hapi-fhir/fe62e5b4-bf58-4041-892d-b64821060fa6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

ja...@interopion.com

unread,
Mar 13, 2019, 5:33:03 PM3/13/19
to HAPI FHIR
Thanks James!

I just added "mydaoconfig.setAllowContainsSearches(true)" to my configuration and I'm seeing the same thing as you. I no longer get an error but I also get no results in the bundle.

Jacob

James Agnew

unread,
Mar 14, 2019, 11:22:50 AM3/14/19
to ja...@interopion.com, HAPI FHIR
I think I figured this out.

If that setting (enable contains searches) is changed after the fact, you need to run a reindex of all of the data, because it introduces a change in the way that string indexes are written.

You can do this by issuing the following SQL query (assuming Postgres):

insert into hfj_res_reindex_job (pid, update_threshold_high, job_deleted) values (1, now(), false);

You can also go this by invoking the "$mark-all-resources-for-reindexing" operation (assuming security/permissions are sufficient, and this operation is enabled).

I'm trying this on the public HAPI FHIR server and I'm now getting a different error (siiiigh) relating to terminology reindexing. Just looking into this now. If you aren't using terminology services in the HSPC sandbox that's probably not an issue for you.

Cheers,
James


Reply all
Reply to author
Forward
0 new messages