OCXRU4 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*96) ;JAN 30,2001 at 11:16
;;3.0;ORDER ENTRY/RESULTS REPORTING;**96**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
S ;
; Field Utilities
Q
;
EDITFLD(OCXCREF,OCXDD,OCXFLD,OCXSUB) ;
;
N DDPATH,OCXDA,OCXPC,OCXLVL,QUIT
;
S QUIT=0,DDPATH=$P($P($$APPEND(OCXCREF,OCXDD),"(",2),")",1)
S OCXLVL=$L(DDPATH,",")
F OCXPC=1:1:OCXLVL S OCXDA(OCXLVL-OCXPC)=+$P($P(DDPATH,",",OCXPC),":",2)
S OCXDA=OCXDA(0) K OCXDA(0)
I $L($G(@OCXCREF@(OCXDD,OCXFLD,"E"))) D
.N RESP
.Q:(OCXFLAG["D")
.I (OCXFLAG["A") S RESP=$$READ("Y"," Do you want to change the local '"_$$FILENAME^OCXSENDD(+OCXDD)_"' field ?","YES") I 'RESP S QUIT=(RESP[U) Q
.S OCXGREF=$$GETREF^OCXRU2(+OCXDD,.OCXDA,OCXLVL-1) Q:'$L(OCXGREF)
.D DIE^OCXRU2(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL-1)
;
Q QUIT
;
DELFLD(OCXCREF,OCXDD,OCXFLD,OCXSUB) ;
;
N DDPATH,OCXDA,OCXPC,OCXLVL,QUIT,RESP
;
S QUIT=0,DDPATH=$P($P($$APPEND(OCXCREF,OCXDD),"(",2),")",1)
S OCXLVL=$L(DDPATH,",")
F OCXPC=1:1:OCXLVL S OCXDA(OCXLVL-OCXPC)=+$P($P(DDPATH,",",OCXPC),":",2)
S OCXDA=OCXDA(0) K OCXDA(0)
Q:(OCXFLAG["D") 0
I (OCXFLAG["A") S RESP=$$READ("Y"," Do you want to Delete the local '"_$$FILENAME^OCXSENDD(+OCXDD)_"' value ?","YES") I 'RESP S QUIT=(RESP[U) Q QUIT
S OCXGREF=$$GETREF^OCXRU2(+OCXDD,.OCXDA,OCXLVL-1) Q:'$L(OCXGREF)
D DIE^OCXRU2(OCXDD,OCXGREF,OCXFLD,"@",.OCXDA,OCXLVL-1)
;
Q QUIT
;
CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
;
N OCXFLD,OCXGREF
;
S OCXGREF=$$GETREF^OCXRU2(+OCXDD,.OCXDA,OCXLVL) Q:'$L(OCXGREF) S:'OCXDA OCXDA=$O(@(OCXGREF_"""@"")"),-1)+1
;
I '$D(@(OCXGREF_"0)")) S @(OCXGREF_"0)")=U_$$FILEHDR^OCXSENDD(+OCXDD)_U_U
;
S OCXFLD=0 F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'OCXFLD Q:(OCXFLD[":") I '$$EXFLD^OCXRU1(+OCXDD,OCXFLD) D
.I $L($G(@OCXCREF@(OCXDD,OCXFLD,"E"))) D DIE^OCXRU2(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
;
D PUSH(.OCXDA)
S OCXFLD="" F S OCXFLD=$O(@OCXCREF@(OCXDD,OCXFLD)) Q:'$L(OCXFLD) I (OCXFLD[":") D
.S OCXDA=$P(OCXFLD,":",2) W ! D CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
D POP(.OCXDA)
Q
;
PUSH(OCXDA) ;
N OCXSUB S OCXSUB="" F S OCXSUB=$O(OCXDA(OCXSUB),-1) Q:'OCXSUB S OCXDA(OCXSUB+1)=OCXDA(OCXSUB)
S OCXDA(1)=OCXDA,OCXDA=0
Q
;
POP(OCXDA) ;
N OCXSUB S OCXSUB="" F S OCXSUB=$O(OCXDA(OCXSUB)) Q:'OCXSUB S OCXDA(OCXSUB)=$G(OCXDA(OCXSUB+1))
S OCXDA=OCXDA(1) K OCXDA($O(OCXDA(""),-1))
Q
;
APPEND(ARRAY,OCXSUB) ;
S:'(OCXSUB=+OCXSUB) OCXSUB=""""_OCXSUB_""""
Q:'(ARRAY["(") ARRAY_"("_OCXSUB_")"
Q $E(ARRAY,1,$L(ARRAY)-1)_","_OCXSUB_")"
;
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
;
PAUSE() W " Press Enter " R X:DTIME W ! Q (X[U)
;
OCXRU4 ;SLC/RJS,CLA - OCX PACKAGE RULE TRANSPORT ROUTINE (Delete after Install of OR*3*96) ;JAN 30,2001 at 11:16
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**96**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
S ;
+1 ; Field Utilities
+2 QUIT
+3 ;
EDITFLD(OCXCREF,OCXDD,OCXFLD,OCXSUB) ;
+1 ;
+2 NEW DDPATH,OCXDA,OCXPC,OCXLVL,QUIT
+3 ;
+4 SET QUIT=0
SET DDPATH=$PIECE($PIECE($$APPEND(OCXCREF,OCXDD),"(",2),")",1)
+5 SET OCXLVL=$LENGTH(DDPATH,",")
+6 FOR OCXPC=1:1:OCXLVL
SET OCXDA(OCXLVL-OCXPC)=+$PIECE($PIECE(DDPATH,",",OCXPC),":",2)
+7 SET OCXDA=OCXDA(0)
KILL OCXDA(0)
+8 IF $LENGTH($GET(@OCXCREF@(OCXDD,OCXFLD,"E")))
Begin DoDot:1
+9 NEW RESP
+10 IF (OCXFLAG["D")
QUIT
+11 IF (OCXFLAG["A")
SET RESP=$$READ("Y"," Do you want to change the local '"_$$FILENAME^OCXSENDD(+OCXDD)_"' field ?","YES")
IF 'RESP
SET QUIT=(RESP[U)
QUIT
+12 SET OCXGREF=$$GETREF^OCXRU2(+OCXDD,.OCXDA,OCXLVL-1)
IF '$LENGTH(OCXGREF)
QUIT
+13 DO DIE^OCXRU2(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL-1)
End DoDot:1
+14 ;
+15 QUIT QUIT
+16 ;
DELFLD(OCXCREF,OCXDD,OCXFLD,OCXSUB) ;
+1 ;
+2 NEW DDPATH,OCXDA,OCXPC,OCXLVL,QUIT,RESP
+3 ;
+4 SET QUIT=0
SET DDPATH=$PIECE($PIECE($$APPEND(OCXCREF,OCXDD),"(",2),")",1)
+5 SET OCXLVL=$LENGTH(DDPATH,",")
+6 FOR OCXPC=1:1:OCXLVL
SET OCXDA(OCXLVL-OCXPC)=+$PIECE($PIECE(DDPATH,",",OCXPC),":",2)
+7 SET OCXDA=OCXDA(0)
KILL OCXDA(0)
+8 IF (OCXFLAG["D")
QUIT 0
+9 IF (OCXFLAG["A")
SET RESP=$$READ("Y"," Do you want to Delete the local '"_$$FILENAME^OCXSENDD(+OCXDD)_"' value ?","YES")
IF 'RESP
SET QUIT=(RESP[U)
QUIT QUIT
+10 SET OCXGREF=$$GETREF^OCXRU2(+OCXDD,.OCXDA,OCXLVL-1)
IF '$LENGTH(OCXGREF)
QUIT
+11 DO DIE^OCXRU2(OCXDD,OCXGREF,OCXFLD,"@",.OCXDA,OCXLVL-1)
+12 ;
+13 QUIT QUIT
+14 ;
CREATE(OCXCREF,OCXDD,OCXDA,OCXLVL) ;
+1 ;
+2 NEW OCXFLD,OCXGREF
+3 ;
+4 SET OCXGREF=$$GETREF^OCXRU2(+OCXDD,.OCXDA,OCXLVL)
IF '$LENGTH(OCXGREF)
QUIT
IF 'OCXDA
SET OCXDA=$ORDER(@(OCXGREF_"""@"")"),-1)+1
+5 ;
+6 IF '$DATA(@(OCXGREF_"0)"))
SET @(OCXGREF_"0)")=U_$$FILEHDR^OCXSENDD(+OCXDD)_U_U
+7 ;
+8 SET OCXFLD=0
FOR
SET OCXFLD=$ORDER(@OCXCREF@(OCXDD,OCXFLD))
IF 'OCXFLD
QUIT
IF (OCXFLD["
QUIT
IF '$$EXFLD^OCXRU1(+OCXDD,OCXFLD)
Begin DoDot:1
+9 IF $LENGTH($GET(@OCXCREF@(OCXDD,OCXFLD,"E")))
DO DIE^OCXRU2(OCXDD,OCXGREF,OCXFLD,@OCXCREF@(OCXDD,OCXFLD,"E"),.OCXDA,OCXLVL)
End DoDot:1
+10 ;
+11 DO PUSH(.OCXDA)
+12 SET OCXFLD=""
FOR
SET OCXFLD=$ORDER(@OCXCREF@(OCXDD,OCXFLD))
IF '$LENGTH(OCXFLD)
QUIT
IF (OCXFLD[":")
Begin DoDot:1
+13 SET OCXDA=$PIECE(OCXFLD,":",2)
WRITE !
DO CREATE($$APPEND(OCXCREF,OCXDD),OCXFLD,.OCXDA,OCXLVL+1)
End DoDot:1
+14 DO POP(.OCXDA)
+15 QUIT
+16 ;
PUSH(OCXDA) ;
+1 NEW OCXSUB
SET OCXSUB=""
FOR
SET OCXSUB=$ORDER(OCXDA(OCXSUB),-1)
IF 'OCXSUB
QUIT
SET OCXDA(OCXSUB+1)=OCXDA(OCXSUB)
+2 SET OCXDA(1)=OCXDA
SET OCXDA=0
+3 QUIT
+4 ;
POP(OCXDA) ;
+1 NEW OCXSUB
SET OCXSUB=""
FOR
SET OCXSUB=$ORDER(OCXDA(OCXSUB))
IF 'OCXSUB
QUIT
SET OCXDA(OCXSUB)=$GET(OCXDA(OCXSUB+1))
+2 SET OCXDA=OCXDA(1)
KILL OCXDA($ORDER(OCXDA(""),-1))
+3 QUIT
+4 ;
APPEND(ARRAY,OCXSUB) ;
+1 IF '(OCXSUB=+OCXSUB)
SET OCXSUB=""""_OCXSUB_""""
+2 IF '(ARRAY["(")
QUIT ARRAY_"("_OCXSUB_")"
+3 QUIT $EXTRACT(ARRAY,1,$LENGTH(ARRAY)-1)_","_OCXSUB_")"
+4 ;
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 ;
PAUSE() WRITE " Press Enter "
READ X:DTIME
WRITE !
QUIT (X[U)
+1 ;