Lua Field Length comparisons fail when above a 255 chars

  • Hey marcelvanherk I've got a problem for ya.


    We had an exam arrive today that had 1024 characters in ReasonForStudy (0032,1030) which choked our Exports. We've been slowly building a DICOM normalizer lua that we run against all images that come in to clean up VL mismatches that our long-term archive does not like and ReasonForStudy is one of the tags we fire against.


    I spent a little while tonight trying to figure out if we had an issue in our lua and after some trial and error I've found that if a DICOM tag is greater than 255 characters, the comparison will not fire. What can be done to extend that char length limitation?


    Here's a snip of the lua


    Code
    for i, TAG in pairs(VL64) do
    if Data[TAG] and Data[TAG]:len() > 64 then
    Data[TAG] = string.sub(Data[TAG], 1, 64)
    print ('ic-dicomnormalizer.lua UPACS THREAD ' .. Association.Thread .. ': has truncated: ' .. Data[TAG] ..' to 64 characters')
    end
    end
  • Got it, thanks.


Participate now!

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