Reformatting of Patient MR Name

  • Hi


    I don't know whether to post this query on the forum on not but i am facing this issue. We had recently installed new DR system and we are facing some problems with the patient ID. There is some limitation in the Software of DR that it cannot use / or - in Patient ID. So our Tech is using _ in patient Names. I tried to update the Patient ID using the lua String functions but as i am not expert in lua so my script works for one patient ID format but not for the other


    Format of Patient IDs are as follow:-


    Patient ID 1 : A123456_1 update to A123456-1


    Patient ID 2 : SO123_1 update to SO123-1


    Patient ID 3 : AA-BBB-1234 update to AA/BBB/1234


    Patient ID 4: AAA-BB-3005 update to AAA/BB/3005


    Patient ID 5 : AAA_BBB_1234 update to AAA/BBB/1234


    I know that it is recommended not to change the Patient ID but for integration of PACS Server with out EMR we need to update the Patient ID as same as they are in our EMR. Badly need helps the data that need to be update is pilling up.


    --HM

  • Hi,


    this can be done with regular Lua programming. Install zerobrane studio and play around a bit. Then you will learn the syntax. I would do exactly the same. Best create an external lua file to be called to do the processing.


    Marcel

  • Two test programs:


    patid='AAA_BBB_1234'

    if string.sub(patid, 4, 4)=='_' then patid=string.sub(patid, 1, 3)..'/'..string.sub(patid, 5, 99) end

    print (patid)


    outputs AAA/BBB_1234


    Another one:


    patid='AAA_BBB_1234';

    patid = string.gsub(patid, '_', '/')

    print (patid)


    outputs AAA/BBB/1234


    see e.g. http://lua-users.org/wiki/StringLibraryTutorial


    Marcel

Participate now!

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