forked from lewisschmidt/CCL
-
Notifications
You must be signed in to change notification settings - Fork 1
/
quick_orders_os
81 lines (58 loc) · 1.95 KB
/
quick_orders_os
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
;-------------------Folders Order Report 1--------
SELECT
FOLDER_NAME = AC.LONG_DESCRIPTION
,FOLDER_DISPLAY = AC.SHORT_DESCRIPTION
,ORDER_SYNONYM = OCS.MNEMONIC
,ORDER_SENTENCE = OS.ORDER_SENTENCE_DISPLAY_LINE
,ORDER_COMMENT =L.LONG_TEXT
FROM
ALT_SEL_CAT AC
,ALT_SEL_LIST AL
,ALT_SEL_CAT AC2
,ORDER_CATALOG_SYNONYM OCS
,ORDER_SENTENCE OS
,PATHWAY_CATALOG PC
,PW_CAT_SYNONYM PCS
,LONG_TEXT L
PLAN AC
WHERE AC.OWNER_ID = 0 ;filters out favorite folders
AND AC.AHFS_IND IN (0,NULL) ;filters out therapeutic class categories
AND AC.ADHOC_IND IN (0,NULL) ;filters out ad hoc charting folders
JOIN AL
WHERE AL.ALT_SEL_CATEGORY_ID = AC.ALT_SEL_CATEGORY_ID
JOIN AC2
WHERE AC2.ALT_SEL_CATEGORY_ID = AL.CHILD_ALT_SEL_CAT_ID
JOIN OCS
WHERE OCS.SYNONYM_ID = AL.SYNONYM_ID
and ocs.active_ind = 1
and ocs.catalog_type_cd = 2516 ; pharmacy
JOIN OS WHERE OS.ORDER_SENTENCE_ID = AL.ORDER_SENTENCE_ID
JOIN L WHERE OS.ORD_COMMENT_LONG_TEXT_ID = L.LONG_TEXT_ID
JOIN PC WHERE PC.PATHWAY_CATALOG_ID = AL.PATHWAY_CATALOG_ID
JOIN PCS WHERE PCS.PW_CAT_SYNONYM_ID = AL.PW_CAT_SYNONYM_ID
ORDER BY AC.LONG_DESCRIPTION, AC.SHORT_DESCRIPTION, AL.SEQUENCE
with time = 60
;--------------------Folders Order Report 2 --------------------------
/*
select distinct
Folder = ac.long_description
, ocs.mnemonic
, syn_type = uar_get_code_display(ocs.mnemonic_type_cd)
, os.order_sentence_display_line
from
alt_sel_cat ac
, alt_sel_list al
, order_catalog_synonym ocs
, order_entry_format oef
, order_sentence os
, order_sentence_detail osd
plan ocs where ocs.active_ind = 1 and ocs.catalog_type_cd = 2516 ; pharmacy
join oef where ocs.oe_format_id = oef.oe_format_id
join al where ocs.synonym_id = al.synonym_id
join ac where al.alt_sel_category_id = ac.alt_sel_category_id
join os where al.order_sentence_id = os.order_sentence_id
join osd where al.order_sentence_id = osd.order_sentence_id
order by ac.long_description
with time = 30
*/
;-------------------------------------------