LUA IncomingFindRequestFilter field values extraction

Hello,
i want to use function IncomingFindRequestFilter(source, origin)

is it possible to check inside this function what is AETitle of the Client who is doing C-FIND and than base on that clear som fileds of C-FIND or not ?

an example:

client AETittle = XXX
Client is looking for all studies from InstitutionName=“YYY”

IncomingFindRequestFilter(source, origin)

if Client AETitle == “XXX” and Client “institutionName” == “YYY”

than

local v = source

v**[‘0008,0000’]** = nil

else

do nothing

“institutionName” is what the client is looking for.

i just dont know how to extract “aetitle” and “institutionName” field value from that incoming C-FIND query

Greetings
Krzysiek

Hi,

I would advise you to add these 2 lines at the beginning of your lua callback and you’ll probably find what you’re looking for.

PrintRecursive(query)
print(origin)

Hello,
i successfuly printed table of origin but every time i want to access fields from it i have c-query failed
here is lua script:

function IncomingFindRequestFilter(query, origin)

local v = origin
print(v[‘RemoteAet’])
return v

end

W dniu piątek, 10 lipca 2020 15:19:15 UTC+2 użytkownik Alain Mazy napisał:

Hello,

Here is a working Lua script that should match your requirements:

function IncomingFindRequestFilter(query, origin)
print(‘---------------------------------------------’)
print(‘C-FIND query received from:’)
PrintRecursive(origin)

print(‘Original query:’)
PrintRecursive(query)

if origin[‘RemoteAet’] == ‘FINDSCU’ then
query[‘0008,0080’] = nil – Remove the “InstitutionName” tag
end

print(‘Modified query:’)
PrintRecursive(query)

return query
end

HTH,
Sébastien-