forked from troyshelton/CCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathOncology_Oral_agents_adhoc
152 lines (133 loc) · 3.96 KB
/
Oncology_Oral_agents_adhoc
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
SELECT distinct
primary_mnemonic = oc.primary_mnemonic
,order_synonym = ocs.mnemonic
, os.order_sentence_display_line
, route = cv.display
, therapeutic_category = a.long_description
FROM
order_catalog_synonym ocs
, order_catalog oc
, order_sentence os
, code_value cv
, order_sentence_detail osd2
, alt_sel_list ASL
, ALT_SEL_CAT A
Plan ocs ; Order_Catalog_Synonym
where ocs.active_ind = 1
and ocs.activity_type_cd = 705.00
and ocs.mnemonic_type_cd in(
;CODE_VALUE DISPLAY
2580 ;Brand Name
,2581 ;Direct Care Provider
,614542 ;C - Dispensable Drug Names
;2582 ;Generic Name
,614548 ;Y - Generic Products
,614544 ;M - Generic Miscellaneous Products
,614543 ;E - IV Fluids and Nicknames
;614546 ;Outreach
;614547 ;PathLink
,2583 ;Primary
;2584 ;Rx Mnemonic
;2585 ;Surgery Med
,614549 ;Z - Trade Products
,614545 ;N - Trade Miscellaneous Products
)
or ocs.mnemonic in (
"*tablet*"
,"*Tab*"
,"*Tablet*"
,"*cap*"
)
JOIN oc ; Order_catalog
WHERE oc.catalog_cd = ocs.catalog_cd
and oc.activity_type_cd = 705.00
and ocs.active_ind = 1
and oc.primary_mnemonic != "zz*"
and oc.primary_mnemonic != "ZZ"
JOIN os ; ORDER_SENTENCE
WHERE os.order_sentence_id = ocs.order_sentence_id
and os.usage_flag > 0
Join cv ; code_value
where cv.code_set = 4001
and cv.display != "IntraMuscular"
and cv.display != "IntraVesical"
and cv.display != "IV Piggyback"
and cv.display != "SubCutaneous"
and cv.display != "IV Push"
and cv.display != "IntraPeritoneal"
or cv.display = "Oral Topical"
or cv.display = "Buccal"
or cv.display = "Gastrostomy Tube"
or cv.display = "Jejunostomy Tube"
or cv.display = "Nasogastric Tube"
or cv.display = "Oral"
or cv.display = "Chew"
or cv.display = "Feeding Tube"
or cv.display = "Swish and Spit"
or cv.display = "Oral Gastric Tube"
or cv.display = "Nasojejunum Tube"
or cv.display = "SubLingual"
;or cv.display = "
join osd2; order_sentence_detail
where osd2.order_sentence_id = os.order_sentence_id
and osd2.default_parent_entity_name = "CODE_VALUE"
and osd2.default_parent_entity_id = cv.code_value
Join ASL
where asl.synonym_id = ocs.synonym_id
Join A
where asl.alt_sel_category_id = a.alt_sel_category_id
and A.AHFS_IND = 1
and A.Long_Description in (
;ORDERCATALOG_THERAPEUTIC_CATEGORY
"5-alpha-reductase inhibitors"
,"alkylating agents"
,"anti-PD-1 monoclonal antibodies"
,"antiandrogens"
,"antigonadotropic agents"
,"antimetabolites"
,"antineoplastic antibiotics"
,"antineoplastic combinations"
,"antineoplastic detoxifying agents"
,"antineoplastic hormones"
,"antineoplastic interferons"
,"antineoplastic interferons"
,"antineoplastic monoclonal antibodies"
,"antineoplastics"
,"antiviral interferons"
,"aromatase inhibitors"
,"BCR-ABL tyrosine kinase inhibitors"
,"bisphosphonates"
,"CD20 monoclonal antibodies"
,"CD30 monoclonal antibodies"
,"CD33 monoclonal antibodies"
,"CD38 monoclonal antibodies"
,"CD52 monoclonal antibodies"
,"CDK 4/6 inhibitors"
,"estrogen receptor antagonists"
,"estrogens"
,"gonadotropin-releasing hormone antagonists"
,"gonadotropin-releasing hormone and analogs"
,"hedgehog pathway inhibitors"
,"HER2 inhibitors"
,"histone deacetylase inhibitors"
,"integrase strand transfer inhibitor"
,"interferons"
,"interleukin inhibitors"
,"interleukins"
,"miscellaneous antineoplastics"
,"mitotic inhibitors"
,"mTOR inhibitors"
,"mTOR kinase inhibitors"
,"multikinase inhibitors"
,"PI3K inhibitors"
,"progesterone receptor modulators"
,"radiopharmaceuticals"
,"selective estrogen receptor modulators"
,"therapeutic radiopharmaceuticals"
,"topical antineoplastics"
,"TNF alpha inhibitors"
,"VEGF/VEGFR inhibitors"
)
ORDER BY
oc.primary_mnemonic, ocs.mnemonic
WITH time = 300