Remove or Replace a Character in Patient Name

  • The system we use for creating reports saves reports as pdf files in a folder with patient name as the file name.


    Sometimes, users enter patient names with unacceptable characters e.g "/". This leads to failure in saving report.


    Is it possible to create a converter that replaces or removes such characters from the name.


    Regards.

  • Hi,


    [lua]
    ImportConverter0 = Data.PatientName = string.gsub(Data.PatientName, '[\\/]', '')


    might do the trick. Where inside the [] you put all the characters it does not like; see the lua string library tutorial


    Marcel

  • Thanks Marcel for your response.


    I have never figured out how to use lua. I guess I will miss out on some conquest features as a consequence!


    I will change manually for the moment, hopefully, some day I will learn lua.


    Regards.

  • Hi,


    try modify image from the GUI, you get a small lua editor to try things out:


    e.g.


    Data["7005,1011"] = string.gsub(Data["7005,1011"] or "", "%%", "pc")
    print(Data["7005,1011"])


    use test syntax to try it without making any change.


    Marcel

Participate now!

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