forked from susom/mirc-ctp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfilter.script
130 lines (109 loc) · 5.27 KB
/
filter.script
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
//
// Stanford Research IT MIRC-CTP filtering script
// This script allows specific known pixel PHI, so always use the included pixel scrubbing script.
//
//
// This group contains very specific whitelisted devices. They may or may not have scrubbing rules.
// If a wanted device gets filtered out, they need to be added here
//
(
// KONICA 0402 CR -- SCRUBBED
(Manufacturer.containsIgnoreCase("KONICA") * Modality.equals("CR")
*ManufacturerModelName.containsIgnoreCase("0402")
*(
([0018,1020].startsWithIgnoreCase("6.") * Rows.equalsIgnoreCase("2446") * Columns.equalsIgnoreCase("2446"))
+([0018,1020].startsWithIgnoreCase("2.") * Rows.equalsIgnoreCase("2010") * Columns.equalsIgnoreCase("2446"))
)
)
// MedicaTechUSA KrstyalRad 660 -- SCRUBBED
+(Manufacturer.containsIgnoreCase("Medicatechusa") * (Modality.equalsIgnoreCase("CR") + Modality.equalsIgnoreCase("DX"))
*ManufacturerModelName.startsWithIgnoreCase("KrystalRad 660")
*[0018,1020].startsWithIgnoreCase("1.")
)
// CANON/SHIMADZU AXIOM / CXDI V4/6 -- SCRUBBED
+((Manufacturer.containsIgnoreCase("Shimadzu") + Manufacturer.containsIgnoreCase("Canon")) * (Modality.equalsIgnoreCase("CR") + Modality.equalsIgnoreCase("DX"))
*(
(ManufacturerModelName.startsWithIgnoreCase("AXIOM") + ManufacturerModelName.startsWithIgnoreCase("CXDI"))
*([0018,1020].startsWithIgnoreCase("V6") + [0018,1020].startsWithIgnoreCase("V4") + [0018,1020].startsWithIgnoreCase("2."))
)
)
// Cuattro CloudDR -- SCRUBBED
+(Manufacturer.startsWithIgnoreCase("Cuattro") * Modality.equalsIgnoreCase("DX")
*ManufacturerModelName.startsWithIgnoreCase("CloudDR")
*[0018,1020].startsWithIgnoreCase("3.")
*Rows.equalsIgnoreCase("3072") * Columns.equalsIgnoreCase("3072")
)
// Medlink Imaging AltoDR -- SCRUBBED
+(Manufacturer.startsWithIgnoreCase("Medlink Imaging") * Modality.equalsIgnoreCase("DX")
*ManufacturerModelName.startsWithIgnoreCase("AltoDR")
*[0018,1020].startsWithIgnoreCase("1.")
*Rows.equalsIgnoreCase("2922") * Columns.equalsIgnoreCase("1936")
)
// GE CT+PET -- SCRUBBED
+(Manufacturer.startsWithIgnoreCase("GE MEDICAL") * (Modality.equalsIgnoreCase("PT") + Modality.equals("OT"))
*(ManufacturerModelName.startsWithIgnoreCase("Discovery")
*[0018,1018].startsWithIgnoreCase("Volume Viewer")
*([0018,1020].startsWithIgnoreCase("5") + [0018,1020].startsWithIgnoreCase("4"))
*(
([0028,0010].containsIgnoreCase("512") * [0028,0011].containsIgnoreCase("512"))
+([0028,0010].containsIgnoreCase("512") * [0028,0011].containsIgnoreCase("256"))
)
)
)
// MIMvista standalone -- No scrubbing needed
+((Manufacturer.equalsIgnoreCase("MIMvista Corp") * Modality.equals("CT"))
*[0018,1020].equalsIgnoreCase("")
*Rows.equalsIgnoreCase("512")
*Columns.equalsIgnoreCase("512")
)
// MIMvista + Manufacturer -- No scrubbing needed
+((Manufacturer.containsIgnoreCase("/ MIM") * (Modality.equals("CT") + Modality.equals("PT")))
*ImageType.contains("DERIVED\PRIMARY")
*[0018,1020].equalsIgnoreCase("")
*Columns.equalsIgnoreCase("512") // Rows varies
)
// Siemens Biograph 6, Somaris/5 3D, SOMATOM Definition AS -- No scrubbing needed
+(Manufacturer.startsWithIgnoreCase("SIEMENS") * (Modality.equalsIgnoreCase("CT") + Modality.equals("PT"))
*(
(ManufacturerModelName.containsIgnoreCase("Biograph 6") * [0018,1020].containsIgnoreCase("syngo CT 2006"))
+(ManufacturerModelName.containsIgnoreCase("Somaris/5 3D") * [0018,1020].containsIgnoreCase("VA45A-W"))
+(ManufacturerModelName.containsIgnoreCase("SOMATOM Definition AS") * [0018,1020].containsIgnoreCase("syngo MI.PET/CT 2012"))
+(ManufacturerModelName.containsIgnoreCase("Emotion Duo"))
)
)
)
//
// If not whitelisted above, then the image must pass the gauntlet below
//
+!(
// Encapsulated PDF
[0008,0016].equalsIgnoreCase("1.2.840.10008.5.1.4.1.1.104.1")
// Conversion type is not empty
+!ConversionType.equalsIgnoreCase("")
// the DiCOM box has no ImageType and ComputedRadiographyImageStorage SOPClassUID
// So we can only go by the model name. These are video captures.
+ManufacturersModelName.containsIgnoreCase("the DiCOM box")
// Presentation state and SR are omitted, for now
+Modality.equalsIgnoreCase("PR")
+SOPClassUID.startsWith("1.2.840.10008.5.1.4.1.1.11.") // Soft-copy presentation states
+Modality.equalsIgnoreCase("SR")
+SOPClassUID.startsWith("1.2.840.10008.5.1.4.1.1.8") // SR + KO
// Misc modalities
+Modality.equalsIgnoreCase("KO")
+Modality.equalsIgnoreCase("SC")
// Bad-actor PACS which embed scanned documents as ImageType ORIGINAL and no other hints
// other than a high series number
+(Manufacturer.containsIgnoreCase("INFINITT") * SeriesNumber.matches("[1-9]\d{3,}"))
// Biopsy/pathology are omitted for now, since written text is often included in the photograph/slide
+(Modality.equalsIgnoreCase("DX")
* Manufacturer.startsWithIgnoreCase("Bioptics Inc")
* ManufacturerModelName.startsWithIgnoreCase("PathVision")
)
//
// Sorry, no DERIVED or SECONDARY or NULL Image Types. These must be whitelisted by device.
//
+SOPClassUID.equals("1.2.840.10008.5.1.4.1.1.7") // Secondary capture
+ImageType.containsIgnoreCase("DERIVED")
+ImageType.containsIgnoreCase("SECONDARY")
+ImageType.equals("")
)