OCXOED10 ;SLC/RJS,CLA - Rule Editor (Element Expression Options) ;10/29/98 12:37
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
;
S ;
;
Q
EN(OCXD0,OCXR1,OCXRD,OCXACT) ;
;
;
N OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN
;
S OCXTNLN=$C(27,91,48,109),OCXTRLN=$C(27,91,55,109),OCXTULN=$C(27,91,52,109),OCXTHLN=$C(27,91,49,109)
;
S OCXOPT=$$GETOPT^OCXOEDT(.OCXACT) Q:(OCXOPT=U) 1 X:$L(OCXOPT) OCXOPT
;
Q 0
;
;
EDEXP(OCXD0,OCXD1) ;
N X,DA S DA=OCXD1,DA(1)=OCXD0
S X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"1PRIMARY DATA FIELD~")
Q:'$D(^OCXS(860.3,OCXD0,"COND",OCXD1))
S X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"2")
S OCXP=$$PARNUM(+$G(^OCXS(860.3,OCXD0,"COND",OCXD1,"OPER")))
Q:(OCXP=1)
I (OCXP=2) D
.N OCXP
.S X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"3COMPARE VALUE~;S:$L(X) Y=""@1"";4COMPARE DATA FIELD~;@1")
I (OCXP=3) D
.N OCXP
.S X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"3COMPARE VALUE 1~;S:$L(X) Y=""@1"";4COMPARE DATA FIELD 1~;@1")
.W !!,"AND",!!
.S X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"3.1COMPARE VALUE 2~;S:$L(X) Y=""@1"";5COMPARE DATA FIELD 2~;@1")
Q
;
EDDF(OCXD0) ;
D EN^OCXOED11(OCXD0)
Q
;
PARNUM(OCXOPER) ;
;
N OCXPF,OCXPFN
S OCXPF=$O(^OCXS(863.9,+OCXOPER,"PAR","B","OCXO GENERATE CODE FUNCTION",0)) Q:'OCXPF 0
S OCXPF=$G(^OCXS(863.9,+OCXOPER,"PAR",+OCXPF,"VAL"))
Q:'$L(OCXPF) 0
I OCXPF S OCXPFN=OCXPF
E S OCXPFN=0 F S OCXPFN=$O(^OCXS(863.7,"B",$E(OCXPF,1,30),OCXPFN)) Q:'OCXPFN Q:($P($G(^OCXS(863.7,+OCXPFN,0)),U,1)=OCXPF)
Q:'OCXPFN 0 Q +$O(^OCXS(863.7,+OCXPFN,"PAR",999),-1)
;
;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
N OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
Q:'$L($G(OCXZ0)) U
S DIR(0)=OCXZ0
S:$L($G(OCXZA)) DIR("A")=OCXZA
S:$L($G(OCXZB)) DIR("B")=OCXZB
F OCXLINE=1:1:($G(OCXZL)-1) W !
D ^DIR
I $D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT) Q U
Q Y
;
DIE(DIE,DA,DR) ;
;
D RM(IOM) N DUOUT,DTOUT,DIC S DIC=DIE D ^DIE D RM(0) Q:$G(DTOUT) 0 Q:$G(DUOUT) 0 Q 1
;
RM(X) X ^%ZOSF("RM") Q
;
DIC(OCXDIC,OCXDIC0,OCXDICA,OCXX,OCXDICS,OCXDR,DA) ;
;
N DIC,X,Y
S DIC=$G(OCXDIC) Q:'$L(DIC) -1
S DIC(0)=$G(OCXDIC0) S:$L($G(OCXX)) X=OCXX
S:$L($G(OCXDICS)) DIC("S")=OCXDICS
S:$L($G(OCXDICA)) DIC("A")=OCXDICA
S:$L($G(OCXDR)) DIC("DR")=OCXDR
D ^DIC Q:(Y<1) 0 Q Y
;
OCXOED10 ;SLC/RJS,CLA - Rule Editor (Element Expression Options) ;10/29/98 12:37
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
+4 ;
S ;
+1 ;
+2 QUIT
EN(OCXD0,OCXR1,OCXRD,OCXACT) ;
+1 ;
+2 ;
+3 NEW OCXTHLN,OCXTNLN,OCXTRLN,OCXTULN,OCXTNLN
+4 ;
+5 SET OCXTNLN=$CHAR(27,91,48,109)
SET OCXTRLN=$CHAR(27,91,55,109)
SET OCXTULN=$CHAR(27,91,52,109)
SET OCXTHLN=$CHAR(27,91,49,109)
+6 ;
+7 SET OCXOPT=$$GETOPT^OCXOEDT(.OCXACT)
IF (OCXOPT=U)
QUIT 1
IF $LENGTH(OCXOPT)
XECUTE OCXOPT
+8 ;
+9 QUIT 0
+10 ;
+11 ;
EDEXP(OCXD0,OCXD1) ;
+1 NEW X,DA
SET DA=OCXD1
SET DA(1)=OCXD0
+2 SET X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"1PRIMARY DATA FIELD~")
+3 IF '$DATA(^OCXS(860.3,OCXD0,"COND",OCXD1))
QUIT
+4 SET X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"2")
+5 SET OCXP=$$PARNUM(+$GET(^OCXS(860.3,OCXD0,"COND",OCXD1,"OPER")))
+6 IF (OCXP=1)
QUIT
+7 IF (OCXP=2)
Begin DoDot:1
+8 NEW OCXP
+9 SET X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"3COMPARE VALUE~;S:$L(X) Y=""@1"";4COMPARE DATA FIELD~;@1")
End DoDot:1
+10 IF (OCXP=3)
Begin DoDot:1
+11 NEW OCXP
+12 SET X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"3COMPARE VALUE 1~;S:$L(X) Y=""@1"";4COMPARE DATA FIELD 1~;@1")
+13 WRITE !!,"AND",!!
+14 SET X=$$DIE("^OCXS(860.3,"_OCXD0_",""COND"",",.DA,"3.1COMPARE VALUE 2~;S:$L(X) Y=""@1"";5COMPARE DATA FIELD 2~;@1")
End DoDot:1
+15 QUIT
+16 ;
EDDF(OCXD0) ;
+1 DO EN^OCXOED11(OCXD0)
+2 QUIT
+3 ;
PARNUM(OCXOPER) ;
+1 ;
+2 NEW OCXPF,OCXPFN
+3 SET OCXPF=$ORDER(^OCXS(863.9,+OCXOPER,"PAR","B","OCXO GENERATE CODE FUNCTION",0))
IF 'OCXPF
QUIT 0
+4 SET OCXPF=$GET(^OCXS(863.9,+OCXOPER,"PAR",+OCXPF,"VAL"))
+5 IF '$LENGTH(OCXPF)
QUIT 0
+6 IF OCXPF
SET OCXPFN=OCXPF
+7 IF '$TEST
SET OCXPFN=0
FOR
SET OCXPFN=$ORDER(^OCXS(863.7,"B",$EXTRACT(OCXPF,1,30),OCXPFN))
IF 'OCXPFN
QUIT
IF ($PIECE($GET(^OCXS(863.7,+OCXPFN,0)),U,1)=OCXPF)
QUIT
+8 IF 'OCXPFN
QUIT 0
QUIT +$ORDER(^OCXS(863.7,+OCXPFN,"PAR",999),-1)
+9 ;
+10 ;
READ(OCXZ0,OCXZA,OCXZB,OCXZL) ;
+1 NEW OCXLINE,DIR,DTOUT,DUOUT,DIRUT,DIROUT
+2 IF '$LENGTH($GET(OCXZ0))
QUIT U
+3 SET DIR(0)=OCXZ0
+4 IF $LENGTH($GET(OCXZA))
SET DIR("A")=OCXZA
+5 IF $LENGTH($GET(OCXZB))
SET DIR("B")=OCXZB
+6 FOR OCXLINE=1:1:($GET(OCXZL)-1)
WRITE !
+7 DO ^DIR
+8 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT)
QUIT U
+9 QUIT Y
+10 ;
DIE(DIE,DA,DR) ;
+1 ;
+2 DO RM(IOM)
NEW DUOUT,DTOUT,DIC
SET DIC=DIE
DO ^DIE
DO RM(0)
IF $GET(DTOUT)
QUIT 0
IF $GET(DUOUT)
QUIT 0
QUIT 1
+3 ;
RM(X) XECUTE ^%ZOSF("RM")
QUIT
+1 ;
DIC(OCXDIC,OCXDIC0,OCXDICA,OCXX,OCXDICS,OCXDR,DA) ;
+1 ;
+2 NEW DIC,X,Y
+3 SET DIC=$GET(OCXDIC)
IF '$LENGTH(DIC)
QUIT -1
+4 SET DIC(0)=$GET(OCXDIC0)
IF $LENGTH($GET(OCXX))
SET X=OCXX
+5 IF $LENGTH($GET(OCXDICS))
SET DIC("S")=OCXDICS
+6 IF $LENGTH($GET(OCXDICA))
SET DIC("A")=OCXDICA
+7 IF $LENGTH($GET(OCXDR))
SET DIC("DR")=OCXDR
+8 DO ^DIC
IF (Y<1)
QUIT 0
QUIT Y
+9 ;