Replace a string of text with other text

  • Is it possible to replace a string of text with some other text using CONQUEST? For example, we have some images whose Patient Name has the Patient ID right at the center e.g. John 12345 Doe.

    This is because the last name is usually appended the patient ID at the end, yet our viewer displays the name in the order LAST NAME FIRST NAME. It therefore leaves the patient ID right at the center of the name.

    Can I remove the patient ID: 12345 and place it in the correct field and remain with John Doe as the Patient Name?


    Thank you

  • Hi,


    You can use any lua string pattern matching, of which there are many samples on the internet. Add e.g. this to dicom.ini (untested example):


    [lua]

    ImportConverter0 = Data.PatientName = string.gsub(Data.PatientName, Data.PatientID, '')


    Avoid changing PatientID itself, see sticky "why not change patientID of an image".


    Marcel

Participate now!

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