forked from troyshelton/CCL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Duplicate_Alert
46 lines (34 loc) · 924 Bytes
/
Duplicate_Alert
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
select
oc.primary_mnemonic
,ocs.mnemonic
,order_type = uar_get_code_display(ocs.mnemonic_type_cd)
,aad.category_duplication_ind
,aad.maximum_occurrences_nbr
,aad.observed_occurrences_nbr
,aad.dcp_entity_reltn_id
,aadd.encntr_id
,aadd.subject_order_id
,aadd.override_reason_cd
,aadd.override_reason_long_text_id
,aat.person_id
,aat.prsnl_id
from
alert_audit_dup aad
,alert_audit_dup_cat_cause aadcc
,alert_audit_dup_dom aadd
,alert_audit_transaction aat
, order_catalog oc
, order_catalog_synonym ocs
plan aad
join aadcc
where aadcc.alert_audit_dup_id = aad.alert_audit_dup_id
join aadd
where aadd.alert_audit_dup_id = aad.alert_audit_dup_id
join aat
where aat.alert_audit_transaction_id = aad.alert_audit_transaction_id
join oc
where outerjoin(oc.cki) = concat("MUL.ORD!",trim(cnvtstring(aad.drug_identifier)))
and oc.active_ind = 1
join ocs
where ocs.catalog_cd = oc.catalog_cd
with time = 120, maxrec = 10