41
|
1 function OnStoredInstance(instanceId, tags, metadata, origin)
|
|
2 -- The "origin" is only available since Orthanc 0.9.4
|
|
3 PrintRecursive(origin)
|
16
|
4
|
|
5 -- Extract the value of the "PatientName" DICOM tag
|
|
6 local patientName = string.lower(tags['PatientName'])
|
|
7
|
|
8 if string.find(patientName, 'knee') ~= nil then
|
|
9 -- Only send patients whose name contains "Knee"
|
|
10 Delete(SendToModality(instanceId, 'orthanctest'))
|
|
11
|
|
12 else
|
|
13 -- Delete the patients that are not called "Knee"
|
|
14 Delete(instanceId)
|
|
15 end
|
|
16 end
|