OCXOZ0X ;SLC/RJS,CLA - Order Check Scan ;JAN 28,2014 at 03:37
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221,243**;Dec 17,1997;Build 242
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
; ***************************************************************
; ** Warning: This routine is automatically generated by the **
; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine **
; ** will be lost the next time the rule compiler executes. **
; ***************************************************************
;
Q
;
R57R1B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #1 'CLOZAPINE AND (NO WBC W/IN 7 DAYS OR NO ANC W/IN 7...'
; Called from R57R1A+13^OCXOZ0W.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R57R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^Clozapine orders require a CBC/Diff within past 7 days. Please order CBC/Diff with WBC and ANC immediately. Most recent results - "_$$GETDATA(DFN,"116^117^118",130) I 1
E S OCXCMSG="Clozapine orders require a CBC/Diff within past 7 days. Please order CBC/Diff with WBC and ANC immediately. Most recent results - "_$$GETDATA(DFN,"116^117^118",130)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R57R2A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #2 'CLOZAPINE AND (WBC < 3.0 OR ANC < 1.5)'
; Called from EL116+6^OCXOZ0H, and EL114+5^OCXOZ0H, and EL119+5^OCXOZ0H.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE114( ----------> Verify Event/Element: 'CLOZAPINE ANC < 1.5'
; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
; MCE119( ----------> Verify Event/Element: 'CLOZAPINE WBC < 3.0'
;
Q:$G(^OCXS(860.2,57,"INACT"))
;
I $$MCE116 D
.I $$MCE119 D R57R2B
.I $$MCE114 D R57R2B
Q
;
R57R2B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #2 'CLOZAPINE AND (WBC < 3.0 OR ANC < 1.5)'
; Called from R57R2A+13.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R57R2B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^WBC < 3.0 and/or ANC < 1.5 - pharmacy cannot fill clozapine order. Most recent results - "_$$GETDATA(DFN,"114^116^119",130) I 1
E S OCXCMSG="WBC < 3.0 and/or ANC < 1.5 - pharmacy cannot fill clozapine order. Most recent results - "_$$GETDATA(DFN,"114^116^119",130)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R57R3A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #3 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND ANC >= 1.5'
; Called from EL116+7^OCXOZ0H, and EL115+5^OCXOZ0H, and EL120+5^OCXOZ0H.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE115( ----------> Verify Event/Element: 'CLOZAPINE ANC >= 1.5'
; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
; MCE120( ----------> Verify Event/Element: 'CLOZAPINE WBC >= 3.0 & < 3.5'
;
Q:$G(^OCXS(860.2,57,"INACT"))
;
I $$MCE116 D
.I $$MCE120 D
..I $$MCE115 D R57R3B
Q
;
R57R3B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #3 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND ANC >= 1.5'
; Called from R57R3A+14.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R57R3B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^WBC between 3.0 and 3.5 with ANC >= 1.5 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"115^116^120",130) I 1
E S OCXCMSG="WBC between 3.0 and 3.5 with ANC >= 1.5 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"115^116^120",130)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R57R4A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #4 'CLOZAPINE AND 1.5 <= ANC < 2.0'
; Called from EL116+8^OCXOZ0H, and EL141+5^OCXOZ0H.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
; MCE141( ----------> Verify Event/Element: 'CLOZAPINE ANC >= 1.5 & < 2.0'
;
Q:$G(^OCXS(860.2,57,"INACT"))
;
I $$MCE116 D
.I $$MCE141 D R57R4B
Q
;
R57R4B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #4 'CLOZAPINE AND 1.5 <= ANC < 2.0'
; Called from R57R4A+12.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R57R4B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^19^^ANC between 1.5 and 2.0 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"116^141",130) I 1
E S OCXCMSG="ANC between 1.5 and 2.0 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"116^141",130)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R59R1A ; Verify all Event/Elements of Rule #59 'AMINOGLYCOSIDE ORDER' Relation #1 'AGS ORDER'
; Called from EL71+5^OCXOZ0H.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE71( -----------> Verify Event/Element: 'AMINOGLYCOSIDE ORDER SESSION'
;
Q:$G(^OCXS(860.2,59,"INACT"))
;
I $$MCE71 D R59R1B
Q
;
R59R1B ; Send Order Check, Notication messages and/or Execute code for Rule #59 'AMINOGLYCOSIDE ORDER' Relation #1 'AGS ORDER'
; Called from R59R1A+10.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R59R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^20^^Aminoglycoside - est. CrCl: "_$$GETDATA(DFN,"71^",76)_" ("_$$GETDATA(DFN,"71^",64)_") [Est. CrCl based on modified Cockcroft-Gault equation using Adjusted Body Weight (if ht > 60 in)]" I 1
E S OCXCMSG="Aminoglycoside - est. CrCl: "_$$GETDATA(DFN,"71^",76)_" ("_$$GETDATA(DFN,"71^",64)_") [Est. CrCl based on modified Cockcroft-Gault equation using Adjusted Body Weight (if ht > 60 in)]"
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
;
N OCXE,VAL,PC S VAL=""
F PC=1:1:$L(OCXL,U) S OCXE=$P(OCXL,U,PC) I OCXE S VAL=$G(^TMP("OCXCHK",$J,DFN,OCXE,OCXDFI)) Q:$L(VAL)
Q VAL
;
MCE114() ; Verify Event/Element: CLOZAPINE ANC < 1.5
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(114,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),114)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),114))
Q 0
;
MCE115() ; Verify Event/Element: CLOZAPINE ANC >= 1.5
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(115,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),115)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),115))
Q 0
;
MCE116() ; Verify Event/Element: CLOZAPINE DRUG SELECTED
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(116,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),116)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),116))
Q 0
;
MCE119() ; Verify Event/Element: CLOZAPINE WBC < 3.0
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(119,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),119)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),119))
Q 0
;
MCE120() ; Verify Event/Element: CLOZAPINE WBC >= 3.0 & < 3.5
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(120,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),120)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),120))
Q 0
;
MCE141() ; Verify Event/Element: CLOZAPINE ANC >= 1.5 & < 2.0
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(141,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),141)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),141))
Q 0
;
MCE71() ; Verify Event/Element: AMINOGLYCOSIDE ORDER SESSION
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(71,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),71)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),71))
Q 0
;
OCXOZ0X ;SLC/RJS,CLA - Order Check Scan ;JAN 28,2014 at 03:37
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32,221,243**;Dec 17,1997;Build 242
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
+4 ; ***************************************************************
+5 ; ** Warning: This routine is automatically generated by the **
+6 ; ** Rule Compiler (^OCXOCMP) and ANY changes to this routine **
+7 ; ** will be lost the next time the rule compiler executes. **
+8 ; ***************************************************************
+9 ;
+10 QUIT
+11 ;
R57R1B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #1 'CLOZAPINE AND (NO WBC W/IN 7 DAYS OR NO ANC W/IN 7...'
+1 ; Called from R57R1A+13^OCXOZ0W.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
+7 ;
+8 IF $DATA(OCXRULE("R57R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^19^^Clozapine orders require a CBC/Diff within past 7 days. Please order CBC/Diff with WBC and ANC immediately. Most recent results - "_$$GETDATA(DFN,"116^117^118",130)
IF 1
+12 IF '$TEST
SET OCXCMSG="Clozapine orders require a CBC/Diff within past 7 days. Please order CBC/Diff with WBC and ANC immediately. Most recent results - "_$$GETDATA(DFN,"116^117^118",130)
+13 SET OCXNMSG=""
+14 ;
+15 IF $GET(OCXOERR)
QUIT
+16 ;
+17 ; Send Order Check Message
+18 ;
+19 SET OCXOCMSG($ORDER(OCXOCMSG(999999),-1)+1)=OCXCMSG
+20 QUIT
+21 ;
R57R2A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #2 'CLOZAPINE AND (WBC < 3.0 OR ANC < 1.5)'
+1 ; Called from EL116+6^OCXOZ0H, and EL114+5^OCXOZ0H, and EL119+5^OCXOZ0H.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE114( ----------> Verify Event/Element: 'CLOZAPINE ANC < 1.5'
+7 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
+8 ; MCE119( ----------> Verify Event/Element: 'CLOZAPINE WBC < 3.0'
+9 ;
+10 IF $GET(^OCXS(860.2,57,"INACT"))
QUIT
+11 ;
+12 IF $$MCE116
Begin DoDot:1
+13 IF $$MCE119
DO R57R2B
+14 IF $$MCE114
DO R57R2B
End DoDot:1
+15 QUIT
+16 ;
R57R2B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #2 'CLOZAPINE AND (WBC < 3.0 OR ANC < 1.5)'
+1 ; Called from R57R2A+13.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
+7 ;
+8 IF $DATA(OCXRULE("R57R2B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^19^^WBC < 3.0 and/or ANC < 1.5 - pharmacy cannot fill clozapine order. Most recent results - "_$$GETDATA(DFN,"114^116^119",130)
IF 1
+12 IF '$TEST
SET OCXCMSG="WBC < 3.0 and/or ANC < 1.5 - pharmacy cannot fill clozapine order. Most recent results - "_$$GETDATA(DFN,"114^116^119",130)
+13 SET OCXNMSG=""
+14 ;
+15 IF $GET(OCXOERR)
QUIT
+16 ;
+17 ; Send Order Check Message
+18 ;
+19 SET OCXOCMSG($ORDER(OCXOCMSG(999999),-1)+1)=OCXCMSG
+20 QUIT
+21 ;
R57R3A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #3 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND ANC >= 1.5'
+1 ; Called from EL116+7^OCXOZ0H, and EL115+5^OCXOZ0H, and EL120+5^OCXOZ0H.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE115( ----------> Verify Event/Element: 'CLOZAPINE ANC >= 1.5'
+7 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
+8 ; MCE120( ----------> Verify Event/Element: 'CLOZAPINE WBC >= 3.0 & < 3.5'
+9 ;
+10 IF $GET(^OCXS(860.2,57,"INACT"))
QUIT
+11 ;
+12 IF $$MCE116
Begin DoDot:1
+13 IF $$MCE120
Begin DoDot:2
+14 IF $$MCE115
DO R57R3B
End DoDot:2
End DoDot:1
+15 QUIT
+16 ;
R57R3B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #3 'CLOZAPINE AND 3.0 <= WBC < 3.5 AND ANC >= 1.5'
+1 ; Called from R57R3A+14.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
+7 ;
+8 IF $DATA(OCXRULE("R57R3B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^19^^WBC between 3.0 and 3.5 with ANC >= 1.5 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"115^116^120",130)
IF 1
+12 IF '$TEST
SET OCXCMSG="WBC between 3.0 and 3.5 with ANC >= 1.5 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"115^116^120",130)
+13 SET OCXNMSG=""
+14 ;
+15 IF $GET(OCXOERR)
QUIT
+16 ;
+17 ; Send Order Check Message
+18 ;
+19 SET OCXOCMSG($ORDER(OCXOCMSG(999999),-1)+1)=OCXCMSG
+20 QUIT
+21 ;
R57R4A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #4 'CLOZAPINE AND 1.5 <= ANC < 2.0'
+1 ; Called from EL116+8^OCXOZ0H, and EL141+5^OCXOZ0H.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
+7 ; MCE141( ----------> Verify Event/Element: 'CLOZAPINE ANC >= 1.5 & < 2.0'
+8 ;
+9 IF $GET(^OCXS(860.2,57,"INACT"))
QUIT
+10 ;
+11 IF $$MCE116
Begin DoDot:1
+12 IF $$MCE141
DO R57R4B
End DoDot:1
+13 QUIT
+14 ;
R57R4B ; Send Order Check, Notication messages and/or Execute code for Rule #57 'CLOZAPINE' Relation #4 'CLOZAPINE AND 1.5 <= ANC < 2.0'
+1 ; Called from R57R4A+12.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
+7 ;
+8 IF $DATA(OCXRULE("R57R4B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^19^^ANC between 1.5 and 2.0 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"116^141",130)
IF 1
+12 IF '$TEST
SET OCXCMSG="ANC between 1.5 and 2.0 - please repeat CBC/Diff including WBC and ANC immediately and twice weekly. Most recent results - "_$$GETDATA(DFN,"116^141",130)
+13 SET OCXNMSG=""
+14 ;
+15 IF $GET(OCXOERR)
QUIT
+16 ;
+17 ; Send Order Check Message
+18 ;
+19 SET OCXOCMSG($ORDER(OCXOCMSG(999999),-1)+1)=OCXCMSG
+20 QUIT
+21 ;
R59R1A ; Verify all Event/Elements of Rule #59 'AMINOGLYCOSIDE ORDER' Relation #1 'AGS ORDER'
+1 ; Called from EL71+5^OCXOZ0H.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE71( -----------> Verify Event/Element: 'AMINOGLYCOSIDE ORDER SESSION'
+7 ;
+8 IF $GET(^OCXS(860.2,59,"INACT"))
QUIT
+9 ;
+10 IF $$MCE71
DO R59R1B
+11 QUIT
+12 ;
R59R1B ; Send Order Check, Notication messages and/or Execute code for Rule #59 'AMINOGLYCOSIDE ORDER' Relation #1 'AGS ORDER'
+1 ; Called from R59R1A+10.
+2 ;
+3 IF $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
+7 ;
+8 IF $DATA(OCXRULE("R59R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^20^^Aminoglycoside - est. CrCl: "_$$GETDATA(DFN,"71^",76)_" ("_$$GETDATA(DFN,"71^",64)_") [Est. CrCl based on modified Cockcroft-Gault equation using Adjusted Body Weight (if ht > 60 in)]"
IF 1
+12 IF '$TEST
SET OCXCMSG="Aminoglycoside - est. CrCl: "_$$GETDATA(DFN,"71^",76)_" ("_$$GETDATA(DFN,"71^",64)_") [Est. CrCl based on modified Cockcroft-Gault equation using Adjusted Body Weight (if ht > 60 in)]"
+13 SET OCXNMSG=""
+14 ;
+15 IF $GET(OCXOERR)
QUIT
+16 ;
+17 ; Send Order Check Message
+18 ;
+19 SET OCXOCMSG($ORDER(OCXOCMSG(999999),-1)+1)=OCXCMSG
+20 QUIT
+21 ;
GETDATA(DFN,OCXL,OCXDFI) ; This Local Extrinsic Function returns runtime data
+1 ;
+2 NEW OCXE,VAL,PC
SET VAL=""
+3 FOR PC=1:1:$LENGTH(OCXL,U)
SET OCXE=$PIECE(OCXL,U,PC)
IF OCXE
SET VAL=$GET(^TMP("OCXCHK",$JOB,DFN,OCXE,OCXDFI))
IF $LENGTH(VAL)
QUIT
+4 QUIT VAL
+5 ;
MCE114() ; Verify Event/Element: CLOZAPINE ANC < 1.5
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(114,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),114))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),114))
+7 QUIT 0
+8 ;
MCE115() ; Verify Event/Element: CLOZAPINE ANC >= 1.5
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(115,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),115))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),115))
+7 QUIT 0
+8 ;
MCE116() ; Verify Event/Element: CLOZAPINE DRUG SELECTED
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(116,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),116))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),116))
+7 QUIT 0
+8 ;
MCE119() ; Verify Event/Element: CLOZAPINE WBC < 3.0
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(119,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),119))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),119))
+7 QUIT 0
+8 ;
MCE120() ; Verify Event/Element: CLOZAPINE WBC >= 3.0 & < 3.5
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(120,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),120))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),120))
+7 QUIT 0
+8 ;
MCE141() ; Verify Event/Element: CLOZAPINE ANC >= 1.5 & < 2.0
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(141,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),141))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),141))
+7 QUIT 0
+8 ;
MCE71() ; Verify Event/Element: AMINOGLYCOSIDE ORDER SESSION
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(71,37)=OCXDF(37)
+6 IF '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),71))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),71))
+7 QUIT 0
+8 ;