Best way to change patient ID's

  • We are planning on migrating to new servers and recompress all our images from nk1 to jpg compression
    During this migration we are also planning on updating all our patient ID's to unique values
    We are currently running into issues where certain patients generate duplicates

    One way we thought of doing this would be to first migrate all the data and the run batch files against dgate with --modifypatid...
    One time for each patient we have that needs to be modified.
    This way, we would need to touch all images multiple times, which will take more time.

    I started testing with importconverters and was wondering if we could make all changes on the fly when the images are coming in
    through an importconverter and something like:
    ImportConverter0 = Data.PatientID = string.gsub(Data.PatientID, 'oldpatientid1', 'newpatientid1');Data.PatientID = string.gsub(Data.PatientID, 'oldpatientid2', 'newpatientid2');Data.PatientID = string.gsub(Data.PatientID, 'oldpatientid3', 'newpatientid3');Data.PatientID = string.gsub(Data.PatientID, 'oldpatientid4', 'newpatientid4')

    I was wondering if I can put 150k patients in a row in an importconverter
    Or if there is a way to read them from an array, csv or something else

    Or is there a better way of mass changing patient id's like this?

  • Hi,

    create a Lua file with a big table of old to new patient ID, e.g. table = [old=new, ], and include it as follows:

    Association = dofile('table.lua')
    Importconverter0 = local t = table[Data.OldPatientID] if t~=Data.PatientID then script('newuids'); Data.PatientID=t end

    This would allow very big change tables to be supported with fairly limited overhead. Note code is untested.


Participate now!

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