OCXBDTA ;SLC/RJS,CLA - BUILD OCX PACKAGE DIAGNOSTIC ROUTINES (Build Runtime Library Routine OCXDIAG) ;8/04/98 13:21
;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
;
EN() ;
;
N R,LINE,TEXT,NOW,RUCI,XCM
S NOW=$$NOW^OCXBDT3,RUCI=$$CUCI^OCXBDT,CVER=$$VERSION^OCXOCMP
F LINE=1:1:999 S TEXT=$P($T(TEXT+LINE),";",2,999) Q:TEXT S TEXT=$P(TEXT,";",2,999) S R(LINE,0)=$$CONV^OCXBDT3(TEXT)
;
M ^TMP("OCXBDT",$J,"RTN")=R
;
S DIE="^TMP(""OCXBDT"","_$J_",""RTN"",",XCN=0,X="OCXDIAG"
W !,X X ^%ZOSF("SAVE") W " ... ",XCM," Lines filed" K ^TMP("OCXBDT",$J,"RTN")
;
Q XCM
;
;
TEXT ;
;;OCXDIAG ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC UTILITY ROUTINE ;|NOW|
;;|OCXLIN2|
;;|OCXLIN3|
;; ;
;;S ;
;; ;
;; N QUIT,LINE,TEXT,REMOTE,LOCAL,D0,OPCODE,REF,OCXFLGA,OCXFLGC,OCXFLGR,OCXFLGD S QUIT=0
;; ;
;; D DOT
;; I $L($T(VERSION^OCXOCMP)),($$VERSION^OCXOCMP="|CVER|"),1
;; E D Q
;; .W !
;; .W !,"Diagnostic aborted, version mismatch."
;; .W !,"Current Local version: ",$$VERSION^OCXOCMP
;; .W !," Diagnostic Version: |CVER|"
;; I '$D(DTIME) W !!,"DTIME not defined !!",!! Q
;; W !!,"Order Check Expert System Diagnostic Tool"
;; W !," Created: |NOW| in UCI: |RUCI|"
;; W !," Current Date: ",$$NOW^OCXDI0," Current UCI: ",$$CUCI^OCXBDT,!!
;; S LASTFILE=0 K ^TMP("OCXDIAG",$J)
;; S ^TMP("OCXDIAG",$J)=($P($H,",",2)+($H*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
;; S (OCXFLGR,OCXFLGC,OCXFLGA)=1
;; S OCXFLGC=$$READ^OCXDI2("Y"," Do you want ^OCXDIAG to fix differences ?","YES") Q:(OCXFLGC[U)
;; I OCXFLGC S OCXFLGA=$$READ^OCXDI2("Y"," Do you want to stop and ask before each change ?","YES") Q:(OCXFLGA[U)
;; S OCXFLGD=$$READ^OCXDI2("Y"," Do you want ^OCXDIAG to check for extra local records ?","NO") Q:(OCXFLGD[U)
;; ;
;;RUN ;
;; ;
;; ; OCXFLGR = 0-> NO REPORT 1-> REPORT
;; ; OCXFLGA = 0-> NO ASK 1-> ASK
;; ; OCXFLGC = 0-> NO CHANGE 1-> CHANGE
;; ; OCXFLGD = 0-> NO CHECK FOR EXTRAS 1-> CHECK
;; ;
;; D MESG("Loading Data ") D ^OCXDI001
;; ;
;; S LINE=0 F S LINE=$O(^TMP("OCXDIAG",$J,LINE)) Q:'LINE D Q:QUIT
;; .D:'(LINE#50) STATUS^OCXOPOST(LINE,$O(^TMP("OCXDIAG",$J," "),-1))
;; .S TEXT=$G(^TMP("OCXDIAG",$J,LINE)) I $L(TEXT) D Q:QUIT
;; ..S TEXT=$P(TEXT,";",2,999),OPCODE=$P(TEXT,U,1),TEXT=$P(TEXT,U,2,999)
;; ..;
;; ..I OPCODE="RTN" K RSUM S RSUM(0)=TEXT Q
;; ..I OPCODE="RSUM" S RSUM($O(RSUM(""),-1)+1)=TEXT Q
;; ..I OPCODE="RND" S QUIT=$$RTN^OCXDI0(.RSUM) Q
;; ..I OPCODE="REND" K RSUM D MESG("Scanning Data Files ") Q
;; ..I OPCODE="RSTRT" D MESG("Scanning Routines ") Q
;; ..I OPCODE="KEY" D DOT S LOCAL="",D0=$$GETFILE^OCXDI0(+$P(TEXT,U,1),$P(TEXT,U,2),.LOCAL) S QUIT=(D0=(-10)) Q
;; ..I OPCODE="R" S REF="REMOTE("_$P($P(TEXT,U,1),":",1)_":"_D0_$P($P(TEXT,U,1),":",2,99)_")" Q
;; ..I OPCODE="D",$D(REF) S @REF=$P(TEXT,U,1,999) K REF Q
;; ..;
;; ..I OPCODE="EOR" S QUIT=$$COMPARE^OCXDI1(.LOCAL,.REMOTE) K LOCAL,REMOTE Q
;; ..I OPCODE="EOF" S QUIT=$$LISTFILE^OCXDI0(U_$P(TEXT,U,1),(+$P(TEXT,U,2)&OCXFLGD)) K LOCAL,REMOTE Q
;; ..I OPCODE="SOF" D MESG(" Scanning '"_(TEXT)_"' file ") S:(('OCXFLGA)&(+TEXT=101.41)) OCXFLGC=0 Q
;; ..I OPCODE="ROOT" D Q
;; ...N FILE,DATA
;; ...S FILE=U_$P(TEXT,U,1),DATA=$P(TEXT,U,2,3)
;; ...Q:$D(@FILE)
;; ...S @FILE=DATA
;; ...D MESG(" Restoring file #"_(+$P(DATA,U,2))_" zero node")
;; ..;
;; ..W !,"Unknown OpCode: ",OPCODE," in: ",TEXT S QUIT=$$PAUSE^OCXDI0 W !
;; ;
;; D MESG("Checking protocols ") Q:$$EN^OCXDI5
;; ;
;; K ^TMP("OCXDIAG",$J)
;; ;
;; D MESG("Diagnostic Finished...")
;; ;
;; Q
;; ;
;;AUTO ;
;; ;
;; N QUIT,LINE,TEXT,REMOTE,LOCAL,D0,OPCODE,REF,OCXFLGA,OCXFLGC,OCXFLGR,OCXFLGD S QUIT=0
;; ;
;; S LASTFILE=0 K ^TMP("OCXDIAG",$J)
;; S ^TMP("OCXDIAG",$J)=($P($H,",",2)+($H*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
;; S (OCXFLGD,OCXFLGA,OCXFLGR)=0,(OCXAUTO,OCXFLGC)=1
;; ;
;; D MESG(" ")
;; D MESG("Order Check Expert System Diagnostic Tool")
;; D MESG(" Created: |NOW| in UCI: |RUCI|")
;; D MESG(" Current Date: "_($$NOW^OCXDI0)_" Current UCI: "_($$CUCI^OCXBDT))
;; D MESG(" ")
;; D MESG(" ")
;; ;
;; D RUN
;; ;
;; Q
;; ;
;;MESG(X) ;
;; ;
;; I '$G(OCXAUTO) W !,X
;; E D BMES^XPDUTL(.X)
;; Q
;; ;
;; ;
;;DOT Q:$G(OCXAUTO) W:($X>70) ! W " ." Q
;; ;
;;$
;1;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOCXBDTA 4451 printed Nov 22, 2024@17:32:29 Page 2
OCXBDTA ;SLC/RJS,CLA - BUILD OCX PACKAGE DIAGNOSTIC ROUTINES (Build Runtime Library Routine OCXDIAG) ;8/04/98 13:21
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
+2 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
+3 ;
EN() ;
+1 ;
+2 NEW R,LINE,TEXT,NOW,RUCI,XCM
+3 SET NOW=$$NOW^OCXBDT3
SET RUCI=$$CUCI^OCXBDT
SET CVER=$$VERSION^OCXOCMP
+4 FOR LINE=1:1:999
SET TEXT=$PIECE($TEXT(TEXT+LINE),";",2,999)
if TEXT
QUIT
SET TEXT=$PIECE(TEXT,";",2,999)
SET R(LINE,0)=$$CONV^OCXBDT3(TEXT)
+5 ;
+6 MERGE ^TMP("OCXBDT",$JOB,"RTN")=R
+7 ;
+8 SET DIE="^TMP(""OCXBDT"","_$JOB_",""RTN"","
SET XCN=0
SET X="OCXDIAG"
+9 WRITE !,X
XECUTE ^%ZOSF("SAVE")
WRITE " ... ",XCM," Lines filed"
KILL ^TMP("OCXBDT",$JOB,"RTN")
+10 ;
+11 QUIT XCM
+12 ;
+13 ;
TEXT ;
+1 ;;OCXDIAG ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC UTILITY ROUTINE ;|NOW|
+2 ;;|OCXLIN2|
+3 ;;|OCXLIN3|
+4 ;; ;
+5 ;;S ;
+6 ;; ;
+7 ;; N QUIT,LINE,TEXT,REMOTE,LOCAL,D0,OPCODE,REF,OCXFLGA,OCXFLGC,OCXFLGR,OCXFLGD S QUIT=0
+8 ;; ;
+9 ;; D DOT
+10 ;; I $L($T(VERSION^OCXOCMP)),($$VERSION^OCXOCMP="|CVER|"),1
+11 ;; E D Q
+12 ;; .W !
+13 ;; .W !,"Diagnostic aborted, version mismatch."
+14 ;; .W !,"Current Local version: ",$$VERSION^OCXOCMP
+15 ;; .W !," Diagnostic Version: |CVER|"
+16 ;; I '$D(DTIME) W !!,"DTIME not defined !!",!! Q
+17 ;; W !!,"Order Check Expert System Diagnostic Tool"
+18 ;; W !," Created: |NOW| in UCI: |RUCI|"
+19 ;; W !," Current Date: ",$$NOW^OCXDI0," Current UCI: ",$$CUCI^OCXBDT,!!
+20 ;; S LASTFILE=0 K ^TMP("OCXDIAG",$J)
+21 ;; S ^TMP("OCXDIAG",$J)=($P($H,",",2)+($H*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
+22 ;; S (OCXFLGR,OCXFLGC,OCXFLGA)=1
+23 ;; S OCXFLGC=$$READ^OCXDI2("Y"," Do you want ^OCXDIAG to fix differences ?","YES") Q:(OCXFLGC[U)
+24 ;; I OCXFLGC S OCXFLGA=$$READ^OCXDI2("Y"," Do you want to stop and ask before each change ?","YES") Q:(OCXFLGA[U)
+25 ;; S OCXFLGD=$$READ^OCXDI2("Y"," Do you want ^OCXDIAG to check for extra local records ?","NO") Q:(OCXFLGD[U)
+26 ;; ;
+27 ;;RUN ;
+28 ;; ;
+29 ;; ; OCXFLGR = 0-> NO REPORT 1-> REPORT
+30 ;; ; OCXFLGA = 0-> NO ASK 1-> ASK
+31 ;; ; OCXFLGC = 0-> NO CHANGE 1-> CHANGE
+32 ;; ; OCXFLGD = 0-> NO CHECK FOR EXTRAS 1-> CHECK
+33 ;; ;
+34 ;; D MESG("Loading Data ") D ^OCXDI001
+35 ;; ;
+36 ;; S LINE=0 F S LINE=$O(^TMP("OCXDIAG",$J,LINE)) Q:'LINE D Q:QUIT
+37 ;; .D:'(LINE#50) STATUS^OCXOPOST(LINE,$O(^TMP("OCXDIAG",$J," "),-1))
+38 ;; .S TEXT=$G(^TMP("OCXDIAG",$J,LINE)) I $L(TEXT) D Q:QUIT
+39 ;; ..S TEXT=$P(TEXT,";",2,999),OPCODE=$P(TEXT,U,1),TEXT=$P(TEXT,U,2,999)
+40 ;; ..;
+41 ;; ..I OPCODE="RTN" K RSUM S RSUM(0)=TEXT Q
+42 ;; ..I OPCODE="RSUM" S RSUM($O(RSUM(""),-1)+1)=TEXT Q
+43 ;; ..I OPCODE="RND" S QUIT=$$RTN^OCXDI0(.RSUM) Q
+44 ;; ..I OPCODE="REND" K RSUM D MESG("Scanning Data Files ") Q
+45 ;; ..I OPCODE="RSTRT" D MESG("Scanning Routines ") Q
+46 ;; ..I OPCODE="KEY" D DOT S LOCAL="",D0=$$GETFILE^OCXDI0(+$P(TEXT,U,1),$P(TEXT,U,2),.LOCAL) S QUIT=(D0=(-10)) Q
+47 ;; ..I OPCODE="R" S REF="REMOTE("_$P($P(TEXT,U,1),":",1)_":"_D0_$P($P(TEXT,U,1),":",2,99)_")" Q
+48 ;; ..I OPCODE="D",$D(REF) S @REF=$P(TEXT,U,1,999) K REF Q
+49 ;; ..;
+50 ;; ..I OPCODE="EOR" S QUIT=$$COMPARE^OCXDI1(.LOCAL,.REMOTE) K LOCAL,REMOTE Q
+51 ;; ..I OPCODE="EOF" S QUIT=$$LISTFILE^OCXDI0(U_$P(TEXT,U,1),(+$P(TEXT,U,2)&OCXFLGD)) K LOCAL,REMOTE Q
+52 ;; ..I OPCODE="SOF" D MESG(" Scanning '"_(TEXT)_"' file ") S:(('OCXFLGA)&(+TEXT=101.41)) OCXFLGC=0 Q
+53 ;; ..I OPCODE="ROOT" D Q
+54 ;; ...N FILE,DATA
+55 ;; ...S FILE=U_$P(TEXT,U,1),DATA=$P(TEXT,U,2,3)
+56 ;; ...Q:$D(@FILE)
+57 ;; ...S @FILE=DATA
+58 ;; ...D MESG(" Restoring file #"_(+$P(DATA,U,2))_" zero node")
+59 ;; ..;
+60 ;; ..W !,"Unknown OpCode: ",OPCODE," in: ",TEXT S QUIT=$$PAUSE^OCXDI0 W !
+61 ;; ;
+62 ;; D MESG("Checking protocols ") Q:$$EN^OCXDI5
+63 ;; ;
+64 ;; K ^TMP("OCXDIAG",$J)
+65 ;; ;
+66 ;; D MESG("Diagnostic Finished...")
+67 ;; ;
+68 ;; Q
+69 ;; ;
+70 ;;AUTO ;
+71 ;; ;
+72 ;; N QUIT,LINE,TEXT,REMOTE,LOCAL,D0,OPCODE,REF,OCXFLGA,OCXFLGC,OCXFLGR,OCXFLGD S QUIT=0
+73 ;; ;
+74 ;; S LASTFILE=0 K ^TMP("OCXDIAG",$J)
+75 ;; S ^TMP("OCXDIAG",$J)=($P($H,",",2)+($H*86400)+(4*60*60))_" <- ^TMP ENTRY EXPIRATION DATE FOR ^OCXOPURG"
+76 ;; S (OCXFLGD,OCXFLGA,OCXFLGR)=0,(OCXAUTO,OCXFLGC)=1
+77 ;; ;
+78 ;; D MESG(" ")
+79 ;; D MESG("Order Check Expert System Diagnostic Tool")
+80 ;; D MESG(" Created: |NOW| in UCI: |RUCI|")
+81 ;; D MESG(" Current Date: "_($$NOW^OCXDI0)_" Current UCI: "_($$CUCI^OCXBDT))
+82 ;; D MESG(" ")
+83 ;; D MESG(" ")
+84 ;; ;
+85 ;; D RUN
+86 ;; ;
+87 ;; Q
+88 ;; ;
+89 ;;MESG(X) ;
+90 ;; ;
+91 ;; I '$G(OCXAUTO) W !,X
+92 ;; E D BMES^XPDUTL(.X)
+93 ;; Q
+94 ;; ;
+95 ;; ;
+96 ;;DOT Q:$G(OCXAUTO) W:($X>70) ! W " ." Q
+97 ;; ;
+98 ;;$
+99 ;1;