forked from lewisschmidt/CCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
EKC_DRC_DETAILS_striprtf
106 lines (79 loc) · 2.23 KB
/
EKC_DRC_DETAILS_striprtf
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
DROP PROGRAM DRC_DETAILS_Summary GO
CREATE PROGRAM DRC_DETAILS_Summary
prompt
"Output to File/Printer/MINE" = "CURDATE" ;* Enter or select the printer or file name to send this report to.
with OUTDEV
set BlobOut= fillstring( 32768, ' ' )
set BlobNoRTF = fillstring( 32768, ' ' )
set bsize = 0
SELECT into $OUTDEV
rule = e.dlg_name
, Alert_Dt_Tm = e.dlg_dt_tm
, userloggedin_name = u.NAME_FULL_FORMATTED
, userloggedin = u.username
, userrole = uar_get_code_display(u.position_cd)
, patient = p.name_full_formatted
, FIN = ea.alias
, admit_reason = uar_get_code_display(en.admit_type_cd)
, birth_date1 = p.birth_dt_tm
, override_reason = uar_get_code_display(e.override_reason_cd)
, o.hna_order_mnemonic
, o.order_mnemonic
, o.clinical_display_line
, therapeutic_category = A.LONG_DESCRIPTION
, location = uar_get_code_display(en.loc_facility_cd)
/* long_text lt */
, Free_Text_Override = lt.long_text
, Discern_Alert = trim(lt2.long_text)
FROM
eks_dlg_event e
, person p
, prsnl u
, orders o
, long_text lt
, long_text lt2
, encounter en
, encntr_alias ea
, alt_sel_list ASL
, ALT_SEL_CAT A
; , CLINICAL_EVENT C
; , CE_STRING_RESULT CE
plan e
Where e.dlg_name = "PHA_EKM!PHA_STP_DRC_W_HISTORY_EX"
and E.DLG_DT_TM between cnvtdate(01012018) and cnvtdate(02222018)
join p
where p.person_id = e.person_id
join u
where u.person_id = e.DLG_PRSNL_ID
join o
where o.order_id = e.trigger_order_id
Join lt
where lt.long_text_id = e.long_text_id
; and lt.active_ind = 1
Join lt2
where lt2.long_text_id = e.alert_long_text_id
join en
where en.encntr_id = e.encntr_id
Join ASL
where asl.synonym_id = o.synonym_id
Join A
where a.alt_sel_category_id = asl.alt_sel_category_id
and A.AHFS_IND = 1
join ea
where o.encntr_id =ea.encntr_id
and EA.ENCNTR_ALIAS_TYPE_CD =1077
; and ea.alias = "###FIN#####" ; <--fin number
;Join C
; where c.encntr_id = e.encntr_id
; and c.order_id = e.trigger_entity_id
; and c.catalog_cd = "xxxxx.00"
;Join CE
; where ce.event_id = c.event_id
DETAIL
stat = uar_rtf(l.long_text ,size(l.long_text ),blobnortf,size(blobnortf),bsize,0)
string = TRIM(blobnortf)
COL 1 string
FOOT REPORT
ROW + 0
WITH time = 120,
MAXREC = 20