how to deal with case sensitive name queries from viewers

  • Hello everyone


    I'd like to ask how do you deal with case sensitive name queries from different dicom clients. For example:


    Patient name in my pg database looks like this: "John Smith"


    Let's say doctor typed in "smith" and hit search button.
    Now, depending on the viewer, there are few cases:
    1) some dicom viewers ( like Efilm for example) ask for "SMITH" (to be more precise: ...WHERE DICOMStudies.PatientNam LIKE E'SMITH%'...)
    2) other viewers (like Radiant) leave everything as it was so it'll ask for "smith"


    so.. they both return 0 results.


    For now I can't even be sure if the name format in my db is always consistent/correct - 99% of the time study is made based on worklist entry so it'll be like 'John Smith' but sometimes sth goes wrong and study is made manually.. so I can not guarantee that someone didn't type in "John SMITH' for example.
    This can be easily fixed by ImportConverter using '^' ... so let's say I'll use it to guarantee that ALL entries in db will be in upper cases.


    Case 1 fixed.. but what about case 2?


    Can I force Conquest to always ask db for upper('smith')? as in ...WHERE DICOMStudies.PatientNam LIKE upper(E'smith%')\
    or
    can I modify incoming c-find and replace 'smith' with 'SMITH' on the fly?
    or
    maybe there is another easy solution I can't see?

  • Hi,


    I'm not sure I understand. I just tested this on both viewers and outcome is still the same.


    Query from Radiant:
    1) smith generates -> LIKE E'%smith%'
    2) *smith* generates the same -> LIKE E'%smith%'


    Query from Efilm:
    1) smith generates -> LIKE E'SMITH%'
    2) *smith* generates -> LIKE E'%SMITH%%'


    In both cases resulting db queries are case sensitive, so I'm not sure what you meant by this.
    The only way this could work is by using ILIKE instead of LIKE, but ILIKE has it's own problems - if I remember correctly it has trouble using index scans and seq scans on big db can be painful :(

  • Hi,


    What database are you using? In my memory LIKE has always been case insensitive. But that may not be true for all database (versions).


    You can easily modify incoming c-find and replace 'smith' with 'SMITH' on the fly. Use


    [lua]
    QueryConverter0 = Data.PatientName = string.upper(Data.PatientName)


    regards


    Marcel

  • Thanks - this will solve everything:

    Quote from marcelvanherk


    [lua]
    QueryConverter0 = Data.PatientName = string.upper(Data.PatientName)


    I'm using postgres 9.x and LIKE is case sensitive since at least v8.0, not sure about other DB.

  • Hi,


    Another solution could be to change the collation on the database, but I am not sure how to do that.


    I will add a bug to try and address this in a more controlled way the future.


    regards,


    Marcel

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!