OCXOZ0U ;SLC/RJS,CLA - Order Check Scan ;OCT 30,2024 at 12:49
;;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
;
R51R1A ; Verify all Event/Elements of Rule #51 'RECENT CHOLECYSTOGRAM ORDER' Relation #1 'RECENT CHOLECGRM'
; Called from EL63+5^OCXOZ0G.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE63( -----------> Verify Event/Element: 'PATIENT HAS RECENT CHOLECYSTOGRAM'
;
Q:$G(^OCXS(860.2,51,"INACT"))
;
I $$MCE63 D R51R1B
Q
;
R51R1B ; Send Order Check, Notication messages and/or Execute code for Rule #51 'RECENT CHOLECYSTOGRAM ORDER' Relation #1 'RECENT CHOLECGRM'
; Called from R51R1A+10.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R51R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^15^^Recent Cholecystogram: "_$$GETDATA(DFN,"63^",61)_" ["_$$GETDATA(DFN,"63^",122)_"]" I 1
E S OCXCMSG="Recent Cholecystogram: "_$$GETDATA(DFN,"63^",61)_" ["_$$GETDATA(DFN,"63^",122)_"]"
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R53R1A ; Verify all Event/Elements of Rule #53 'RENAL FUNCTIONS OVER AGE 65 CHECK' Relation #1 'PHARM PAT OVER 65'
; Called from EL64+5^OCXOZ0G.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE64( -----------> Verify Event/Element: 'PHARMACY PATIENT OVER 65'
;
Q:$G(^OCXS(860.2,53,"INACT"))
;
I $$MCE64 D R53R1B
Q
;
R53R1B ; Send Order Check, Notication messages and/or Execute code for Rule #53 'RENAL FUNCTIONS OVER AGE 65 CHECK' Relation #1 'PHARM PAT OVER 65'
; Called from R53R1A+10.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R53R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^21^^Patient >65. Renal Results: "_$$GETDATA(DFN,"64^",64) I 1
E S OCXCMSG="Patient >65. Renal Results: "_$$GETDATA(DFN,"64^",64)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R54R1A ; Verify all Event/Elements of Rule #54 'CONCURRENT LAB ORDERS FOR ANGIOGRAM, CAT...' Relation #1 'ANGIOGRAM'
; Called from EL65+5^OCXOZ0G.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE65( -----------> Verify Event/Element: 'SESSION ORDER FOR ANGIOGRAM'
;
Q:$G(^OCXS(860.2,54,"INACT"))
;
I $$MCE65 D R54R1B
Q
;
R54R1B ; Send Order Check, Notication messages and/or Execute code for Rule #54 'CONCURRENT LAB ORDERS FOR ANGIOGRAM, CAT...' Relation #1 'ANGIOGRAM'
; Called from R54R1A+10.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R54R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^22^^Missing Labs for Angiogram: "_$$GETDATA(DFN,"65^",68) I 1
E S OCXCMSG="Missing Labs for Angiogram: "_$$GETDATA(DFN,"65^",68)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R55R1A ; Verify all Event/Elements of Rule #55 'ALLERGY - CONTRAST MEDIA REACTION' Relation #1 'ALLERGY'
; Called from EL66+5^OCXOZ0G.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE66( -----------> Verify Event/Element: 'CONTRAST MEDIA ALLERGY'
;
Q:$G(^OCXS(860.2,55,"INACT"))
;
I $$MCE66 D R55R1B
Q
;
R55R1B ; Send Order Check, Notication messages and/or Execute code for Rule #55 'ALLERGY - CONTRAST MEDIA REACTION' Relation #1 'ALLERGY'
; Called from R55R1A+10.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R55R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^4^^Patient allergic to contrast media. ("_$$GETDATA(DFN,"66^",159)_") This procedure uses: "_$$GETDATA(DFN,"66^",66) I 1
E S OCXCMSG="Patient allergic to contrast media. ("_$$GETDATA(DFN,"66^",159)_") This procedure uses: "_$$GETDATA(DFN,"66^",66)
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R56R1A ; Verify all Event/Elements of Rule #56 'RECENT BARIUM STUDY' Relation #1 'BARIUM'
; Called from EL67+5^OCXOZ0G.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE67( -----------> Verify Event/Element: 'RECENT BARIUM STUDY ORDERED'
;
Q:$G(^OCXS(860.2,56,"INACT"))
;
I $$MCE67 D R56R1B
Q
;
R56R1B ; Send Order Check, Notication messages and/or Execute code for Rule #56 'RECENT BARIUM STUDY' Relation #1 'BARIUM'
; Called from R56R1A+10.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; GETDATA( ---------> GET DATA FROM THE ACTIVE DATA FILE
;
Q:$D(OCXRULE("R56R1B"))
;
N OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
I ($G(OCXOSRC)="CPRS ORDER PRESCAN") S OCXCMSG=(+OCXPSD)_"^14^^Recent Barium study: "_$$GETDATA(DFN,"67^",70)_" ["_$$GETDATA(DFN,"67^",121)_"]" I 1
E S OCXCMSG="Recent Barium study: "_$$GETDATA(DFN,"67^",70)_" ["_$$GETDATA(DFN,"67^",121)_"]"
S OCXNMSG=""
;
Q:$G(OCXOERR)
;
; Send Order Check Message
;
S OCXOCMSG($O(OCXOCMSG(999999),-1)+1)=OCXCMSG
Q
;
R57R1A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #1 'CLOZAPINE AND (NO WBC W/IN 7 DAYS OR NO ANC W/IN 7...'
; Called from EL116+5^OCXOZ0G, and EL117+5^OCXOZ0G, and EL118+5^OCXOZ0H.
;
Q:$G(OCXOERR)
;
; Local Extrinsic Functions
; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
; MCE117( ----------> Verify Event/Element: 'CLOZAPINE NO ANC W/IN 7 DAYS'
; MCE118( ----------> Verify Event/Element: 'CLOZAPINE NO WBC W/IN 7 DAYS'
;
Q:$G(^OCXS(860.2,57,"INACT"))
;
I $$MCE116 D
.I $$MCE118 D R57R1B^OCXOZ0V
.I $$MCE117 D R57R1B^OCXOZ0V
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
;
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
;
MCE117() ; Verify Event/Element: CLOZAPINE NO ANC W/IN 7 DAYS
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(117,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),117)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),117))
Q 0
;
MCE118() ; Verify Event/Element: CLOZAPINE NO WBC W/IN 7 DAYS
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(118,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),118)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),118))
Q 0
;
MCE63() ; Verify Event/Element: PATIENT HAS RECENT CHOLECYSTOGRAM
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(63,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),63)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),63))
Q 0
;
MCE64() ; Verify Event/Element: PHARMACY PATIENT OVER 65
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(64,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),64)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),64))
Q 0
;
MCE65() ; Verify Event/Element: SESSION ORDER FOR ANGIOGRAM
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(65,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),65)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),65))
Q 0
;
MCE66() ; Verify Event/Element: CONTRAST MEDIA ALLERGY
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(66,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),66)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),66))
Q 0
;
MCE67() ; Verify Event/Element: RECENT BARIUM STUDY ORDERED
;
; OCXDF(37) -> PATIENT IEN data field
;
N OCXRES
S OCXDF(37)=$G(DFN) I $L(OCXDF(37)) S OCXRES(67,37)=OCXDF(37)
Q:'(OCXDF(37)) 0 I $D(^TMP("OCXCHK",$J,OCXDF(37),67)) Q $G(^TMP("OCXCHK",$J,OCXDF(37),67))
Q 0
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXOZ0U 9314 printed Dec 13, 2024@02:26:16 Page 2
OCXOZ0U ;SLC/RJS,CLA - Order Check Scan ;OCT 30,2024 at 12:49
+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 ;
R51R1A ; Verify all Event/Elements of Rule #51 'RECENT CHOLECYSTOGRAM ORDER' Relation #1 'RECENT CHOLECGRM'
+1 ; Called from EL63+5^OCXOZ0G.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE63( -----------> Verify Event/Element: 'PATIENT HAS RECENT CHOLECYSTOGRAM'
+7 ;
+8 if $GET(^OCXS(860.2,51,"INACT"))
QUIT
+9 ;
+10 IF $$MCE63
DO R51R1B
+11 QUIT
+12 ;
R51R1B ; Send Order Check, Notication messages and/or Execute code for Rule #51 'RECENT CHOLECYSTOGRAM ORDER' Relation #1 'RECENT CHOLECGRM'
+1 ; Called from R51R1A+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("R51R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^15^^Recent Cholecystogram: "_$$GETDATA(DFN,"63^",61)_" ["_$$GETDATA(DFN,"63^",122)_"]"
IF 1
+12 IF '$TEST
SET OCXCMSG="Recent Cholecystogram: "_$$GETDATA(DFN,"63^",61)_" ["_$$GETDATA(DFN,"63^",122)_"]"
+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 ;
R53R1A ; Verify all Event/Elements of Rule #53 'RENAL FUNCTIONS OVER AGE 65 CHECK' Relation #1 'PHARM PAT OVER 65'
+1 ; Called from EL64+5^OCXOZ0G.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE64( -----------> Verify Event/Element: 'PHARMACY PATIENT OVER 65'
+7 ;
+8 if $GET(^OCXS(860.2,53,"INACT"))
QUIT
+9 ;
+10 IF $$MCE64
DO R53R1B
+11 QUIT
+12 ;
R53R1B ; Send Order Check, Notication messages and/or Execute code for Rule #53 'RENAL FUNCTIONS OVER AGE 65 CHECK' Relation #1 'PHARM PAT OVER 65'
+1 ; Called from R53R1A+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("R53R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^21^^Patient >65. Renal Results: "_$$GETDATA(DFN,"64^",64)
IF 1
+12 IF '$TEST
SET OCXCMSG="Patient >65. Renal Results: "_$$GETDATA(DFN,"64^",64)
+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 ;
R54R1A ; Verify all Event/Elements of Rule #54 'CONCURRENT LAB ORDERS FOR ANGIOGRAM, CAT...' Relation #1 'ANGIOGRAM'
+1 ; Called from EL65+5^OCXOZ0G.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE65( -----------> Verify Event/Element: 'SESSION ORDER FOR ANGIOGRAM'
+7 ;
+8 if $GET(^OCXS(860.2,54,"INACT"))
QUIT
+9 ;
+10 IF $$MCE65
DO R54R1B
+11 QUIT
+12 ;
R54R1B ; Send Order Check, Notication messages and/or Execute code for Rule #54 'CONCURRENT LAB ORDERS FOR ANGIOGRAM, CAT...' Relation #1 'ANGIOGRAM'
+1 ; Called from R54R1A+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("R54R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^22^^Missing Labs for Angiogram: "_$$GETDATA(DFN,"65^",68)
IF 1
+12 IF '$TEST
SET OCXCMSG="Missing Labs for Angiogram: "_$$GETDATA(DFN,"65^",68)
+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 ;
R55R1A ; Verify all Event/Elements of Rule #55 'ALLERGY - CONTRAST MEDIA REACTION' Relation #1 'ALLERGY'
+1 ; Called from EL66+5^OCXOZ0G.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE66( -----------> Verify Event/Element: 'CONTRAST MEDIA ALLERGY'
+7 ;
+8 if $GET(^OCXS(860.2,55,"INACT"))
QUIT
+9 ;
+10 IF $$MCE66
DO R55R1B
+11 QUIT
+12 ;
R55R1B ; Send Order Check, Notication messages and/or Execute code for Rule #55 'ALLERGY - CONTRAST MEDIA REACTION' Relation #1 'ALLERGY'
+1 ; Called from R55R1A+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("R55R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^4^^Patient allergic to contrast media. ("_$$GETDATA(DFN,"66^",159)_") This procedure uses: "_$$GETDATA(DFN,"66^",66)
IF 1
+12 IF '$TEST
SET OCXCMSG="Patient allergic to contrast media. ("_$$GETDATA(DFN,"66^",159)_") This procedure uses: "_$$GETDATA(DFN,"66^",66)
+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 ;
R56R1A ; Verify all Event/Elements of Rule #56 'RECENT BARIUM STUDY' Relation #1 'BARIUM'
+1 ; Called from EL67+5^OCXOZ0G.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE67( -----------> Verify Event/Element: 'RECENT BARIUM STUDY ORDERED'
+7 ;
+8 if $GET(^OCXS(860.2,56,"INACT"))
QUIT
+9 ;
+10 IF $$MCE67
DO R56R1B
+11 QUIT
+12 ;
R56R1B ; Send Order Check, Notication messages and/or Execute code for Rule #56 'RECENT BARIUM STUDY' Relation #1 'BARIUM'
+1 ; Called from R56R1A+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("R56R1B"))
QUIT
+9 ;
+10 NEW OCXNMSG,OCXCMSG,OCXPORD,OCXFORD,OCXDATA,OCXNUM,OCXDUZ,OCXQUIT,OCXLOGS,OCXLOGD
+11 IF ($GET(OCXOSRC)="CPRS ORDER PRESCAN")
SET OCXCMSG=(+OCXPSD)_"^14^^Recent Barium study: "_$$GETDATA(DFN,"67^",70)_" ["_$$GETDATA(DFN,"67^",121)_"]"
IF 1
+12 IF '$TEST
SET OCXCMSG="Recent Barium study: "_$$GETDATA(DFN,"67^",70)_" ["_$$GETDATA(DFN,"67^",121)_"]"
+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 ;
R57R1A ; Verify all Event/Elements of Rule #57 'CLOZAPINE' Relation #1 'CLOZAPINE AND (NO WBC W/IN 7 DAYS OR NO ANC W/IN 7...'
+1 ; Called from EL116+5^OCXOZ0G, and EL117+5^OCXOZ0G, and EL118+5^OCXOZ0H.
+2 ;
+3 if $GET(OCXOERR)
QUIT
+4 ;
+5 ; Local Extrinsic Functions
+6 ; MCE116( ----------> Verify Event/Element: 'CLOZAPINE DRUG SELECTED'
+7 ; MCE117( ----------> Verify Event/Element: 'CLOZAPINE NO ANC W/IN 7 DAYS'
+8 ; MCE118( ----------> Verify Event/Element: 'CLOZAPINE NO WBC W/IN 7 DAYS'
+9 ;
+10 if $GET(^OCXS(860.2,57,"INACT"))
QUIT
+11 ;
+12 IF $$MCE116
Begin DoDot:1
+13 IF $$MCE118
DO R57R1B^OCXOZ0V
+14 IF $$MCE117
DO R57R1B^OCXOZ0V
End DoDot:1
+15 QUIT
+16 ;
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 ;
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 ;
MCE117() ; Verify Event/Element: CLOZAPINE NO ANC W/IN 7 DAYS
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(117,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),117))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),117))
+7 QUIT 0
+8 ;
MCE118() ; Verify Event/Element: CLOZAPINE NO WBC W/IN 7 DAYS
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(118,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),118))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),118))
+7 QUIT 0
+8 ;
MCE63() ; Verify Event/Element: PATIENT HAS RECENT CHOLECYSTOGRAM
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(63,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),63))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),63))
+7 QUIT 0
+8 ;
MCE64() ; Verify Event/Element: PHARMACY PATIENT OVER 65
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(64,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),64))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),64))
+7 QUIT 0
+8 ;
MCE65() ; Verify Event/Element: SESSION ORDER FOR ANGIOGRAM
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(65,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),65))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),65))
+7 QUIT 0
+8 ;
MCE66() ; Verify Event/Element: CONTRAST MEDIA ALLERGY
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(66,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),66))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),66))
+7 QUIT 0
+8 ;
MCE67() ; Verify Event/Element: RECENT BARIUM STUDY ORDERED
+1 ;
+2 ; OCXDF(37) -> PATIENT IEN data field
+3 ;
+4 NEW OCXRES
+5 SET OCXDF(37)=$GET(DFN)
IF $LENGTH(OCXDF(37))
SET OCXRES(67,37)=OCXDF(37)
+6 if '(OCXDF(37))
QUIT 0
IF $DATA(^TMP("OCXCHK",$JOB,OCXDF(37),67))
QUIT $GET(^TMP("OCXCHK",$JOB,OCXDF(37),67))
+7 QUIT 0
+8 ;