101.lua:
-- Dicom Routing and store ----------------------------------
-- Variables ------------------------------------------------
sinstn = Data.InstitutionName
sinsta = Data.InstitutionAddress
-- rules ----------------------------------------------------
if sinstn == "Hospital1 XY" then
sacc = Data.AccessionNumber
spid = Data.PatientID
stoid = 'HIX'
Data.AccessionNumber = "HIX" .. sacc
Data.PatientID = "HIX" .. spid
end
if string.sub(sinsta,0,15) == "Hotel Street 13" then
sacc = Data.AccessionNumber
spid = Data.PatientID
stoid = 'HTS'
Data.AccessionNumber = "HTS" .. sacc
Data.PatientID = "HTS" .. spid
end
-- and some more rules ---
-- test and Log entry ------------------------------------------
destaet = "DST" .. stoid
print('receive from ', Association.Calling, ' --- ', sinstn, ' for destination ',destaet) -- that works
-- forwarding --------------------------------------------------
script('forward study to ' destaet ) -- command doesn't work as variable or
script('forward study to DSTHTS') -- command doesn't work as text too