Posts by johncronin

    Hi Marcel,


    Thanks for the suggestion, I didn't think of that at all!


    Apologies but I'm pretty new to lua and coding in general but here's how I split it up. Same error occurs. I simplified things by querying PatientID and STUDYDATE so I get back 1 result only. It's gets to line 18 (highlighted in red below) and that's where it has issues with the "r" and "keys" arrays. So possibly our PAC's is not sending back a standard format?


    Here is the code I used in ZBS and also see attached image of my watch window and output with error.


    Thanks very much for getting the time to look at this,


    John

    Hi Marcel,


    No luck I'm afraid. Here is the log each time:


    STUDY:

    Code
    [RTPHYSICS] 0000,0002     18 UI AffectedSOPClassUID    "1.2.840.10008.1.1"
    [RTPHYSICS] 0000,0100      2 US CommandField           48
    [RTPHYSICS] 0000,0110      2 US MessageID              7
    [RTPHYSICS] 0000,0800      2 US DataSetType            257
    [RTPHYSICS] 0002,0010     17 UI TransferSyntaxUID      "1.2.840.10008.1.2"
    [RTPHYSICS] 9999,0400   1050 LO ConquestConsoleComma   "lua:local first=true; local ae=[[UHGEIPROD]];local level=[[STUDY]];local q={QueryRetrieveLevel=[[STUDY]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q"
    [RTPHYSICS] *** lua run error [string "local first=true; local ae=[[UHGEIPROD]];lo..."]:1: attempt to concatenate field '?' (a table value) in 'local first=true; local ae=[[UHGEIPROD]];local level=[[STUDY]];local q={QueryRetrieveLevel=[[STUDY]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s=tempfile("txt") f=io.open(s, "wb");if r2==nil then f:write("no connection with "..ae.."\n") returnfile=s f:close() return end; local r = loadstring("return "..r2:Serialize())();r[1].QueryRetrieveLevel=nil; r[1].TransferSyntaxUID=nil; local keys={} for k,v in pairs(r[1]) do keys[#keys+1]=k end; table.sort(keys, function(a, b) return string.sub(a, 1, 7)<string.sub(b, 1, 7) end); if first then for k,v in ipairs(keys) do f:write(v.."    ") end f:write("\n") end if first then f:write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n") end for k,v in ipairs(r) do   for k2,v2 in ipairs(keys) do f:write("["..v[v2].."]    ") end f:write("\n") end returnfile=s f:close();'

    SERIES:

    Code
    [RTPHYSICS] 0000,0002     18 UI AffectedSOPClassUID    "1.2.840.10008.1.1"
    [RTPHYSICS] 0000,0100      2 US CommandField           48
    [RTPHYSICS] 0000,0110      2 US MessageID              7
    [RTPHYSICS] 0000,0800      2 US DataSetType            257
    [RTPHYSICS] 0002,0010     17 UI TransferSyntaxUID      "1.2.840.10008.1.2"
    [RTPHYSICS] 9999,0400   1106 LO ConquestConsoleComma   "lua:local first=true; local ae=[[UHGEIPROD]];local level=[[SERIES]];local q={QueryRetrieveLevel=[[SERIES]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],SeriesNumber=[[]],SeriesDescription=[[]],Modality=[[]],};local q2=DicomObject:new(); for k,v in"
    [RTPHYSICS] *** lua run error [string "local first=true; local ae=[[UHGEIPROD]];lo..."]:1: attempt to call a nil value in 'local first=true; local ae=[[UHGEIPROD]];local level=[[SERIES]];local q={QueryRetrieveLevel=[[SERIES]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],SeriesNumber=[[]],SeriesDescription=[[]],Modality=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s=tempfile("txt") f=io.open(s, "wb");if r2==nil then f:write("no connection with "..ae.."\n") returnfile=s f:close() return end; local r = loadstring("return "..r2:Serialize())();r[1].QueryRetrieveLevel=nil; r[1].TransferSyntaxUID=nil; local keys={} for k,v in pairs(r[1]) do keys[#keys+1]=k end; table.sort(keys, function(a, b) return string.sub(a, 1, 7)<string.sub(b, 1, 7) end); if first then for k,v in ipairs(keys) do f:write(v.."    ") end f:write("\n") end if first then f:write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n") end for k,v in ipairs(r) do   for k2,v2 in ipairs(keys) do f:write("["..v[v2].."]    ") end f:write("\n") end returnfile=s f:close();'
    Code
    IMAGE:
    [RTPHYSICS] 0000,0002     18 UI AffectedSOPClassUID    "1.2.840.10008.1.1"
    [RTPHYSICS] 0000,0100      2 US CommandField           48
    [RTPHYSICS] 0000,0110      2 US MessageID              7
    [RTPHYSICS] 0000,0800      2 US DataSetType            257
    [RTPHYSICS] 0002,0010     17 UI TransferSyntaxUID      "1.2.840.10008.1.2"
    [RTPHYSICS] 9999,0400   1144 LO ConquestConsoleComma   "lua:local first=true; local ae=[[UHGEIPROD]];local level=[[IMAGE]];local q={QueryRetrieveLevel=[[IMAGE]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],SeriesNumber=[[]],SeriesDescription=[[]],Modality=[[]],InstanceNumber=[[]],SOPInstanceUID=[[]],};"
    [RTPHYSICS] *** lua run error [string "local first=true; local ae=[[UHGEIPROD]];lo..."]:1: attempt to call a nil value in 'local first=true; local ae=[[UHGEIPROD]];local level=[[IMAGE]];local q={QueryRetrieveLevel=[[IMAGE]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],SeriesNumber=[[]],SeriesDescription=[[]],Modality=[[]],InstanceNumber=[[]],SOPInstanceUID=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s=tempfile("txt") f=io.open(s, "wb");if r2==nil then f:write("no connection with "..ae.."\n") returnfile=s f:close() return end; local r = loadstring("return "..r2:Serialize())();r[1].QueryRetrieveLevel=nil; r[1].TransferSyntaxUID=nil; local keys={} for k,v in pairs(r[1]) do keys[#keys+1]=k end; table.sort(keys, function(a, b) return string.sub(a, 1, 7)<string.sub(b, 1, 7) end); if first then for k,v in ipairs(keys) do f:write(v.."    ") end f:write("\n") end if first then f:write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n") end for k,v in ipairs(r) do   for k2,v2 in ipairs(keys) do f:write("["..v[v2].."]    ") end f:write("\n") end returnfile=s f:close();'


    PATIENT PatientStudyOnly:

    Code
    [RTPHYSICS] 0000,0002     18 UI AffectedSOPClassUID    "1.2.840.10008.1.1"
    [RTPHYSICS] 0000,0100      2 US CommandField           48
    [RTPHYSICS] 0000,0110      2 US MessageID              7
    [RTPHYSICS] 0000,0800      2 US DataSetType            257
    [RTPHYSICS] 0002,0010     17 UI TransferSyntaxUID      "1.2.840.10008.1.2"
    [RTPHYSICS] 9999,0400   1040 LO ConquestConsoleComma   "lua:local first=true; local ae=[[UHGEIPROD]];local level=[[PATIENTP]];local q={QueryRetrieveLevel=[[PATIENTP]],PatientID=[[0381930]],PatientName=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local "
    [RTPHYSICS] *** lua run error [string "local first=true; local ae=[[UHGEIPROD]];lo..."]:1: attempt to concatenate field '?' (a table value) in 'local first=true; local ae=[[UHGEIPROD]];local level=[[PATIENTP]];local q={QueryRetrieveLevel=[[PATIENTP]],PatientID=[[0381930]],PatientName=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s=tempfile("txt") f=io.open(s, "wb");if r2==nil then f:write("no connection with "..ae.."\n") returnfile=s f:close() return end; local r = loadstring("return "..r2:Serialize())();r[1].QueryRetrieveLevel=nil; r[1].TransferSyntaxUID=nil; local keys={} for k,v in pairs(r[1]) do keys[#keys+1]=k end; table.sort(keys, function(a, b) return string.sub(a, 1, 7)<string.sub(b, 1, 7) end); if first then for k,v in ipairs(keys) do f:write(v.."    ") end f:write("\n") end if first then f:write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n") end for k,v in ipairs(r) do   for k2,v2 in ipairs(keys) do f:write("["..v[v2].."]    ") end f:write("\n") end returnfile=s f:close();'

    STUDY PatientStudyOnly:

    Code
    [RTPHYSICS] 0000,0002     18 UI AffectedSOPClassUID    "1.2.840.10008.1.1"
    [RTPHYSICS] 0000,0100      2 US CommandField           48
    [RTPHYSICS] 0000,0110      2 US MessageID              7
    [RTPHYSICS] 0000,0800      2 US DataSetType            257
    [RTPHYSICS] 0002,0010     17 UI TransferSyntaxUID      "1.2.840.10008.1.2"
    [RTPHYSICS] 9999,0400   1052 LO ConquestConsoleComma   "lua:local first=true; local ae=[[UHGEIPROD]];local level=[[STUDYP]];local q={QueryRetrieveLevel=[[STUDYP]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level,"
    [RTPHYSICS] *** lua run error [string "local first=true; local ae=[[UHGEIPROD]];lo..."]:1: attempt to concatenate field '?' (a table value) in 'local first=true; local ae=[[UHGEIPROD]];local level=[[STUDYP]];local q={QueryRetrieveLevel=[[STUDYP]],PatientID=[[0381930]],PatientName=[[]],StudyDate=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s=tempfile("txt") f=io.open(s, "wb");if r2==nil then f:write("no connection with "..ae.."\n") returnfile=s f:close() return end; local r = loadstring("return "..r2:Serialize())();r[1].QueryRetrieveLevel=nil; r[1].TransferSyntaxUID=nil; local keys={} for k,v in pairs(r[1]) do keys[#keys+1]=k end; table.sort(keys, function(a, b) return string.sub(a, 1, 7)<string.sub(b, 1, 7) end); if first then for k,v in ipairs(keys) do f:write(v.."    ") end f:write("\n") end if first then f:write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n") end for k,v in ipairs(r) do   for k2,v2 in ipairs(keys) do f:write("["..v[v2].."]    ") end f:write("\n") end returnfile=s f:close();'


    Initially I thought it might have been PACS setup was incorrect but I can ECHO no problem and Query from ZeroBrane works.


    John

    Hi Marcel/All,


    Sorry but I'm possibly missing something simple, I seem to have an issue with a new node I have recently set up.


    I have recently convinced our PAC's system here to set up a Q/R node for us to query and retrieve images from. They have since set up our Conquest system as a node set up for Q/R.


    So I have added their PAC's node details to my ConQuest server.


    Then when I try to query the node with a PatientID value, I'm getting an error. I've tried restarting service/PC mmultiple times but still the same result.


    Then I have installed ZeroBrane application and manually used the query.lua script and it was successful and reported back that a patient exists for that PatientID and there are 4 different studies.


    The log of the error I get when I submit the query from the GUI is:

    Code
    [RTPHYSICS] 0000,0002 18 UI AffectedSOPClassUID "1.2.840.10008.1.1"
    [RTPHYSICS] 0000,0100 2 US CommandField 48
    [RTPHYSICS] 0000,0110 2 US MessageID 7
    [RTPHYSICS] 0000,0800 2 US DataSetType 257
    [RTPHYSICS] 0002,0010 17 UI TransferSyntaxUID "1.2.840.10008.1.2"
    [RTPHYSICS] 9999,0400 1038 LO ConquestConsoleComma "lua:local first=true; local ae=[[UHGEIPROD]];local level=[[PATIENT]];local q={QueryRetrieveLevel=[[PATIENT]],PatientID=[[0381930]],PatientName=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s="
    [RTPHYSICS] *** lua run error [string "local first=true; local ae=[[UHGEIPROD]];lo..."]:1: attempt to concatenate field '?' (a table value) in 'local first=true; local ae=[[UHGEIPROD]];local level=[[PATIENT]];local q={QueryRetrieveLevel=[[PATIENT]],PatientID=[[0381930]],PatientName=[[]],};local q2=DicomObject:new(); for k,v in pairs(q) do q2[k]=v end;local r2=dicomquery(ae, level, q2);local s=tempfile("txt") f=io.open(s, "wb");if r2==nil then f:write("no connection with "..ae.."\n") returnfile=s f:close() return end; local r = loadstring("return "..r2:Serialize())();r[1].QueryRetrieveLevel=nil; r[1].TransferSyntaxUID=nil; local keys={} for k,v in pairs(r[1]) do keys[#keys+1]=k end; table.sort(keys, function(a, b) return string.sub(a, 1, 7)<string.sub(b, 1, 7) end); if first then for k,v in ipairs(keys) do f:write(v.." ") end f:write("\n") end if first then f:write("---------------------------------------------------------------------------------------------------------------------------------------------------------------\n") end for k,v in ipairs(r) do for k2,v2 in ipairs(keys) do f:write("["..v[v2].."] ") end f:write("\n") end returnfile=s f:close();'

    Also see attached screenshots of what I'm seeing.


    Any suggestions anyone on how to get this working via the GUI or more importantly the Web Application?


    Thanks

    John

    Hi Marcel/All,


    First of all, thanks very much for all your work. I am a casual user of ConQuest over the years and much to your credit, I have seamlessly set up the Web Application via WAMP recently.


    I see there are two options, the old web application and the newweb one with user account option.


    I would love to use the newer dgate.php but it doesn't seem to have the Query/Retrieve option like the old web application? See my screenshots attached.


    Apologies for my lack of Apache/PHP/CGI knowledge but I'm possibly missing something very simple.


    Is there a way to get back the "Find" function on the new web application?


    Thanks,

    John