Hi Marcel. We're on Conquest Version 1417d. Linux centOS.
And are developing some custom LUA scripts and are wondering if you might be able to assist with why this doesn't seem to be working.
This version currently works just fine.
Code
#Separate and create unique Series with US Cine's#If called "CQUS" and SOPClassUID equals the SOPClass for US Cine's, then Obtain the last 7 characters from the SOP Instance UID(SOPSubs) and remove 10 characters from SeriesInstanceUID.#If new SeriesInstanceUID ends in a period, remove 11 characters from the original SeriesInstanceUID.#Concatinates the values from the new SeriesInstanceUID and new SOPSubs to make a unique US Cine SeriesInstanceUID.ImportConverter6 = if Association.Called == 'CQUS' and Data.SOPClassUID == '1.2.840.10008.5.1.4.1.1.3.1' then SOPSubs = string.sub(Data.SOPInstanceUID, -7); SeriesInstanceUID = string.sub(Data.SeriesInstanceUID, 1, -10); if string.byte(SeriesInstanceUID, -1) == 46 then SeriesInstanceUID = string.sub(Data.SeriesInstanceUID, 1, -11) end; Data.SeriesInstanceUID = SeriesInstanceUID..SOPSubs..'.24'; print('ImportConverter6.0 received an US Cine on AETitle CQUS and has modified SeriesInstanceUID to ', Data.SeriesInstanceUID) end
When we add in a line to rename the SeriesDescription to "CINE"
, see near the end right before the "print" command: "Data.SeriesDescription = 'CINE';".
Code
#Separate and create unique Series with US Cine's#If called "CQUS" and SOPClassUID equals the SOPClass for US Cine's, then Obtain the last 7 characters from the SOP Instance UID(SOPSubs) and remove 10 characters from SeriesInstanceUID.#If new SeriesInstanceUID ends in a period, remove 11 characters from the original SeriesInstanceUID.#Concatinates the values from the new SeriesInstanceUID and new SOPSubs to make a unique US Cine SeriesInstanceUID.#Rename SeriesDescription to "CINE"ImportConverter6 = if Association.Called == 'CQUS' and Data.SOPClassUID == '1.2.840.10008.5.1.4.1.1.3.1' then SOPSubs = string.sub(Data.SOPInstanceUID, -7); SeriesInstanceUID = string.sub(Data.SeriesInstanceUID, 1, -10); if string.byte(SeriesInstanceUID, -1) == 46 then SeriesInstanceUID = string.sub(Data.SeriesInstanceUID, 1, -11) end; Data.SeriesInstanceUID = SeriesInstanceUID..SOPSubs..'.24'; Data.SeriesDescription = 'CINE'; print('ImportConverter6.0 received an US Cine on AETitle CQUS and has modified SeriesInstanceUID to ', Data.SeriesInstanceUID) end
Here's the error we get when adding this line and sending a study that matches the ImportConverter6 requirements of CQUS
Code
Tue Feb 6 16:19:36 2018 *** lua syntax error [string "if Association.Called == 'CQUS' and Data.SOPClassUID == '1.2.84..."]:1: unfinished string near '<eof>' in 'if Association.Called == 'CQUS' and Data.SOPClassUID == '1.2.840.10008.5.1.4.1.1.3.1' then SOPSubs = string.sub(Data.SOPInstanceUID, -7); SeriesInstanceUID = string.sub(Data.SeriesInstanceUID, 1, -10); if string.byte(SeriesInstanceUID, -1) == 46 then SeriesInstanceUID = string.sub(Data.SeriesInstanceUID, 1, -11) end; Data.SeriesInstanceUID = SeriesInstanceUID..SOPSubs..'.24'; Data.SeriesDescription = 'CINE'; print('ImportConverter6.0 received an US Cine on AETitle CQUS and has modified SeriesInstanceUID t'
Any thoughts on why this LUA script might be failing when we add that extra line to rename the SeriesDescription?