1 | OCXOCMPG ;SLC/RJS,CLA - ORDER CHECK CODE COMPILER (Sort Code Segments cont...) ;5/08/01 10:11
|
---|
2 | ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,105**;Dec 17,1997
|
---|
3 | ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
|
---|
4 | ;
|
---|
5 | EN(OCXL,OCXCNT) ;
|
---|
6 | ;
|
---|
7 | N OCXCODE,OCXVAR
|
---|
8 | D IN^OCXOCMP4(OCXL," ;")
|
---|
9 | S OCXCODE=""
|
---|
10 | ;
|
---|
11 | I $L(OCXMCOD) D
|
---|
12 | .;
|
---|
13 | .D IN^OCXOCMP4(OCXL," ;")
|
---|
14 | .D IN^OCXOCMP4(OCXL," ; Run Execute Code")
|
---|
15 | .D IN^OCXOCMP4(OCXL," ;")
|
---|
16 | .;
|
---|
17 | .N NEWVAL,FLDNAME,FCNT,X
|
---|
18 | .S NEWVAL=OCXMCOD
|
---|
19 | .F FCNT=1:1 Q:'(NEWVAL["|") S NEWVAL=$P(NEWVAL,"|",1)_"X"_FCNT_$P(NEWVAL,"|",3,$L(NEWVAL,"|"))
|
---|
20 | .S X=NEWVAL D ^DIM
|
---|
21 | .I '$D(X) D Q
|
---|
22 | ..N MESG
|
---|
23 | ..S MESG(1)="**** WARNING *****************************************************"
|
---|
24 | ..S MESG(2)=""
|
---|
25 | ..S MESG(3)="The Execute code: "_OCXMCOD
|
---|
26 | ..S MESG(4)=" Rule Format: "_$G(OCXR("R",OCXD1,"MCODE"))
|
---|
27 | ..S MESG(5)=""
|
---|
28 | ..S MESG(6)=" In Rule: ["_(+$G(OCXD0))_"] "_$P($G(^OCXS(860.2,+$G(OCXD0),0)),U,1)
|
---|
29 | ..S MESG(7)=" Relation: ["_(+$G(OCXD1))_"] "_$G(^OCXS(860.2,+$G(OCXD0),"R",+$G(OCXD1),"E"))
|
---|
30 | ..S MESG(8)=""
|
---|
31 | ..S MESG(9)=" Did not pass the mumps syntax check. The code has been disabled."
|
---|
32 | ..S MESG(10)=" This rule may not work correctly until the code is fixed."
|
---|
33 | ..S MESG(11)="******************************************************************"
|
---|
34 | ..S MESG(12)=""
|
---|
35 | ..F FCNT=1:1 Q:'$D(MESG(FCNT)) D IN^OCXOCMP4(OCXL," ;"_MESG(FCNT))
|
---|
36 | ..F FCNT=1:1 Q:'$D(MESG(FCNT)) D MESG(MESG(FCNT))
|
---|
37 | .;
|
---|
38 | .D IN^OCXOCMP4(OCXL," "_OCXMCOD)
|
---|
39 | ;
|
---|
40 | D IN^OCXOCMP4(OCXL," Q:$G(OCXOERR)")
|
---|
41 | I ($P(OCXNOD0,U,3)),$L(OCXNMSG) D
|
---|
42 | .D IN^OCXOCMP4(OCXL," ;")
|
---|
43 | .D IN^OCXOCMP4(OCXL," ; Send Notification")
|
---|
44 | .D IN^OCXOCMP4(OCXL," ;")
|
---|
45 | .D IN^OCXOCMP4(OCXL," S (OCXDUZ,OCXDATA)="""",OCXNUM=0")
|
---|
46 | .D IN^OCXOCMP4(OCXL," I ($G(OCXOSRC)=""GENERIC HL7 MESSAGE ARRAY"") D")
|
---|
47 | .D IN^OCXOCMP4(OCXL," .S OCXDATA="_$$HL7("ORC",2)_"_""|""_"_$$HL7("ORC",3))
|
---|
48 | .D IN^OCXOCMP4(OCXL," .S OCXDATA=$TR(OCXDATA,""^"",""@""),OCXNUM=+OCXDATA")
|
---|
49 | .D IN^OCXOCMP4(OCXL," I ($G(OCXOSRC)=""CPRS ORDER PROTOCOL"") D")
|
---|
50 | .D IN^OCXOCMP4(OCXL," .I $P($G(OCXORD),U,3) S OCXDUZ(+$P(OCXORD,U,3))=""""")
|
---|
51 | .D IN^OCXOCMP4(OCXL," .S OCXNUM=+$P(OCXORD,U,2)")
|
---|
52 | .D IN^OCXOCMP4(OCXL," S:($G(OCXOSRC)=""CPRS ORDER PRESCAN"") OCXNUM=+$P(OCXPSD,""|"",5)")
|
---|
53 | .D IN^OCXOCMP4(OCXL," S OCXRULE("""_OCXL_""")=""""")
|
---|
54 | .D IN^OCXOCMP4(OCXL," I $$NEWRULE(DFN,OCXNUM,"_OCXD0_","_OCXD1_","_(+$P(OCXNOD0,U,3))_",OCXNMSG) D I 1")
|
---|
55 | .D IN^OCXOCMP4(OCXL," .D:($G(OCXTRACE)<5) EN^ORB3("_(+$P(OCXNOD0,U,3))_",DFN,OCXNUM,.OCXDUZ,OCXNMSG,.OCXDATA)")
|
---|
56 | .I $G(OCXTRACE) D
|
---|
57 | ..D IN^OCXOCMP4(OCXL," .I $G(OCXTRACE) D I 1")
|
---|
58 | ..D IN^OCXOCMP4(OCXL," ..N OCXANS")
|
---|
59 | ..D IN^OCXOCMP4(OCXL," ..W !")
|
---|
60 | ..D IN^OCXOCMP4(OCXL," ..I ($G(OCXTRACE)>5) W !,"" *** TEST MODE - Notification not sent to ORB3 ***""")
|
---|
61 | ..D IN^OCXOCMP4(OCXL," ..E W !,"" *** Notification sent to EN^ORB3 ***""")
|
---|
62 | ..D IN^OCXOCMP4(OCXL," ..W !,"" Notification: "_+$P(OCXNOD0,U,3)_" ("_$P(OCXNOD0,U,3)_")""")
|
---|
63 | ..D IN^OCXOCMP4(OCXL," ..W !,"" DFN: "",DFN")
|
---|
64 | ..D IN^OCXOCMP4(OCXL," ..W !,"" Order Number: "",OCXNUM")
|
---|
65 | ..D IN^OCXOCMP4(OCXL," ..W !,"" Message: "",OCXNMSG")
|
---|
66 | ..D IN^OCXOCMP4(OCXL," ..W !,"" DATA: "",OCXDATA")
|
---|
67 | ..D IN^OCXOCMP4(OCXL," ..W !,"" OCXTRACE: "",OCXTRACE")
|
---|
68 | ..D IN^OCXOCMP4(OCXL," ..W:$D(OCXORD) !,"" OCXORD DATA: "",OCXORD")
|
---|
69 | ..D IN^OCXOCMP4(OCXL," ..I $L($T(LOGAL^OCXDEBUG)) D LOGAL^OCXDEBUG("_OCXD0_","_OCXD1_","_(+$P(OCXNOD0,U,3))_",DFN,OCXNUM,"""",OCXNMSG,.OCXDATA)")
|
---|
70 | ..D IN^OCXOCMP4(OCXL," E I $G(OCXTRACE) W !,||LNTAG||,?30,""Message: Rule already triggered""")
|
---|
71 | ;
|
---|
72 | I ($P(OCXNOD0,U,2)),$L(OCXCMSG) D
|
---|
73 | .D IN^OCXOCMP4(OCXL," ;")
|
---|
74 | .D IN^OCXOCMP4(OCXL," ; Send Order Check Message")
|
---|
75 | .D IN^OCXOCMP4(OCXL," ;")
|
---|
76 | .D IN^OCXOCMP4(OCXL," S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG")
|
---|
77 | ;
|
---|
78 | Q OCXWARN
|
---|
79 | ;
|
---|
80 | HL7(S,P) ;
|
---|
81 | ;
|
---|
82 | ;Q "$G(OCXODATA("""_S_""","_P_"))"
|
---|
83 | Q "$G(^TMP(""OCXSWAP"",$J,""OCXODATA"","""_S_""","_P_"))"
|
---|
84 | ;
|
---|
85 | ;
|
---|
86 | MESG(OCXX) ;
|
---|
87 | I '$G(OCXAUTO) W !,OCXX
|
---|
88 | I ($G(OCXAUTO)=1) D BMES^XPDUTL(.OCXX)
|
---|
89 | Q
|
---|
90 | ;
|
---|