mountetna / magma

Data server with friendly data loaders
GNU General Public License v2.0
5 stars 2 forks source link

Physician regex filter does not return any results for certain filters? #194

Closed coleshaw closed 3 years ago

coleshaw commented 3 years ago

There seems to be an issue with string match filtering on the Patient physician field when the regex string has certain character combinations (??). Filters using the ~ operator do not return any results, and we get a 500 error from the server (related to #193 -- should be a 422 with no results returned). However, the string match search works for other fields, like Sample notes and Experiment description and other-character physician filters. Since the issue seems specific to physician and some subset of character combinations (that do exist in the database table), is it possible there is bad data somewhere, or do I just misunderstand how the String regex works?

Does not work for patient::physician.

{"model_name":"patient","record_names":"all","attribute_names":"all","filter":"physician~max","page":1,"page_size":10,"collapse_tables":true,"project_name":"ipi"}

Does not work for patient::physician.

{"model_name":"patient","record_names":"all","attribute_names":"all","filter":"physician~sim","page":1,"page_size":10,"collapse_tables":true,"project_name":"ipi"}

Works for patient::physician.

{"model_name":"patient","record_names":"all","attribute_names":"all","filter":"physician~abl","page":1,"page_size":10,"collapse_tables":true,"project_name":"ipi"}

Works for patient::physician.

{"model_name":"patient","record_names":"all","attribute_names":"all","filter":"physician~a","page":1,"page_size":10,"collapse_tables":true,"project_name":"ipi"}

Works for sample::notes:

{"model_name":"sample","record_names":"all","attribute_names":"all","filter":"notes~live","page":1,"page_size":10,"collapse_tables":true,"project_name":"ipi"}

Works for experiment::description:

{"model_name":"experiment","record_names":"all","attribute_names":"all","filter":"description~Colo","page":1,"page_size":10,"collapse_tables":true,"project_name":"ipi"}
coleshaw commented 3 years ago

Search documentation says regexes are case insensitive, but code and behaviour are case-sensitive. Will close this issue and figure out which approach is correct offline.