source: WorldVistAEHR/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/OCXDIAG.m@ 738

Last change on this file since 738 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1OCXDIAG ;SLC/RJS,CLA - OCX PACKAGE DIAGNOSTIC UTILITY ROUTINE ;SEP 7,1999 at 10:30
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**32**;Dec 17,1997
3 ;; ;;ORDER CHECK EXPERT version 1.01 released OCT 29,1998
4 ;
5S ;
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="ORDER CHECK EXPERT version 1.01 released OCT 29,1998"),1
11 E D Q
12 .W !
13 .W !,"Diagnostic aborted, version mismatch."
14 .W !,"Current Local version: ",$$VERSION^OCXOCMP
15 .W !," Diagnostic Version: ORDER CHECK EXPERT version 1.01 released OCT 29,1998"
16 I '$D(DTIME) W !!,"DTIME not defined !!",!! Q
17 W !!,"Order Check Expert System Diagnostic Tool"
18 W !," Created: SEP 7,1999 at 10:30 in UCI: OEX,OER"
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 ;
27RUN ;
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 ;
70AUTO ;
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: SEP 7,1999 at 10:30 in UCI: OEX,OER")
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 ;
89MESG(X) ;
90 ;
91 I '$G(OCXAUTO) W !,X
92 E D BMES^XPDUTL(.X)
93 Q
94 ;
95 ;
96DOT Q:$G(OCXAUTO) W:($X>70) ! W " ." Q
97 ;
Note: See TracBrowser for help on using the repository browser.