OREOR0 ; slc/dcm - Check things ;7/23/97 12:49
;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
EN ;Check for mutliple keys
W !,"This utility identifies users that have more than one OR key assigned."
W !,"Users with more than one key can encounter problems when adding orders."
W !,"Any users listed will need to have their Keys edited and correctly assigned.",!
W !,"Ok to continue" S %=1 D YN^DICN G:%=0 EN Q:%'=1
N IFN,X,KEY1,KEY2,KEY3,USER
S IFN=0 F S IFN=$O(^VA(200,IFN)) Q:IFN<.1 S USER=$P(^(IFN,0),"^"),(KEY1,KEY2,KEY3)=0 D
. I $D(^XUSEC("ORES",IFN)) S KEY1=1
. I $D(^XUSEC("ORELSE",IFN)) S KEY2=1
. I $D(^XUSEC("OREMAS",IFN)) S KEY3=1
. S X=KEY1+KEY2+KEY3 I X>1 W !,USER_" ("_IFN_") has more than 1 OR key: ",?60 W:KEY1 "ORES " W:KEY2 "ORELSE " W:KEY3 "OREMAS"
Q
ER ;Error check utility
N VAR,VAL,ERDT,ERTXT,IFN,VI,FIRST,EVAL,LISTVAR
W !!,"This utility will look for errors that happened with a certain variable set."
W !,"You can even specify a specific value to look for.",!
W !,"Variable: " R X:DTIME Q:'$L(X) S VAR=X
W !,"Value (optional- enter 'NULL' to look for """"): " R X:DTIME I $L(X) S:X="NULL" X="" S VAL=X
W !,"List variables: " S %=2 D YN^DICN S LISTVAR=$S(%=1:1,1:0)
DATE ;
W ! S %DT="AEX",%DT("A")="ERROR DATE: " D ^%DT Q:$D(DTOUT) Q:X["^" G:Y<1 ER
S X=Y D H^%DTC S ERDT=%H
I '$D(^%ZTER(1,+ERDT)) W !,"No errors on that date",! G DATE
S IFN=0 F S IFN=$O(^%ZTER(1,+ERDT,1,IFN)) Q:IFN<1 S ERTXT=$E($G(^(IFN,"ZE")),1,70),FIRST=1 D
. S VI=0 F S VI=$O(^%ZTER(1,+ERDT,1,IFN,"ZV",VI)) Q:VI<1 S X=^(VI,0),EVAL=$G(^("D")) I $E(X,1,$L(VAR))[VAR D
.. I $G(VAL) Q:VAL'=$P(EVAL,"^")
.. I FIRST S FIRST=0 W !!,IFN_". "_ERTXT
.. I LISTVAR W !?3,X,?15,EVAL
G DATE
Q
ORYX ;Find things in the OE/RR Error file
N OREND
W !!?10,"ORYX('ORERR' file search"
I '$O(^ORYX("ORERR",0)) W !!,"No errors in the file." Q
F D YX Q:OREND
Q
YX ;
N ORSSTRT,ORSSTOP,I,X,Y,Z,GOT,YES
D RANGE^ORPRS01()
Q:OREND
W !!,"Enter text to search for (case sensitive & optional): "
R X:DTIME Q:'$T
S GOT=0,YES=0,%=1
I X'="" W !,"Show details" D YN^DICN Q:%=-1 S:%'=2 YES=1
S I=0 W " searching..."
F S I=$O(^ORYX("ORERR",I)) Q:I<1 S Y=^(I,0),GOT=0 D
. I +Y<ORSSTRT!(+Y>ORSSTOP) Q
. I X="" W !,I_"=>"_Y Q
. I Y[X S GOT=1
. I 'GOT S J=0 F S J=$O(^ORYX("ORERR",I,1,J)) Q:J<1 S Z=^(J,0) I Z[X S GOT=1 Q
. I GOT D VIEW(I,YES) ;W !,I_"=>"_Y Q:'YES S J=0 F S J=$O(^ORYX("ORERR",I,1,J)) Q:J<1 W !?12,^(J,0)
V1 I 'YES W !!,"View #: " R X:DTIME I X,$D(^ORYX("ORERR",X)) D VIEW(X,1) G V1
Q
VIEW(I,DETAIL) ;View log
N J,Y
Q:'$D(^ORYX("ORERR",+$G(I),0)) S Y=^(0)
W !,I_"=>"_Y Q:'$G(DETAIL) S J=0 F S J=$O(^ORYX("ORERR",I,1,J)) Q:J<1 W !?12,^(J,0)
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HOREOR0 2750 printed Dec 13, 2024@02:30:31 Page 2
OREOR0 ; slc/dcm - Check things ;7/23/97 12:49
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;;Dec 17, 1997
EN ;Check for mutliple keys
+1 WRITE !,"This utility identifies users that have more than one OR key assigned."
+2 WRITE !,"Users with more than one key can encounter problems when adding orders."
+3 WRITE !,"Any users listed will need to have their Keys edited and correctly assigned.",!
+4 WRITE !,"Ok to continue"
SET %=1
DO YN^DICN
if %=0
GOTO EN
if %'=1
QUIT
+5 NEW IFN,X,KEY1,KEY2,KEY3,USER
+6 SET IFN=0
FOR
SET IFN=$ORDER(^VA(200,IFN))
if IFN<.1
QUIT
SET USER=$PIECE(^(IFN,0),"^")
SET (KEY1,KEY2,KEY3)=0
Begin DoDot:1
+7 IF $DATA(^XUSEC("ORES",IFN))
SET KEY1=1
+8 IF $DATA(^XUSEC("ORELSE",IFN))
SET KEY2=1
+9 IF $DATA(^XUSEC("OREMAS",IFN))
SET KEY3=1
+10 SET X=KEY1+KEY2+KEY3
IF X>1
WRITE !,USER_" ("_IFN_") has more than 1 OR key: ",?60
if KEY1
WRITE "ORES "
if KEY2
WRITE "ORELSE "
if KEY3
WRITE "OREMAS"
End DoDot:1
+11 QUIT
ER ;Error check utility
+1 NEW VAR,VAL,ERDT,ERTXT,IFN,VI,FIRST,EVAL,LISTVAR
+2 WRITE !!,"This utility will look for errors that happened with a certain variable set."
+3 WRITE !,"You can even specify a specific value to look for.",!
+4 WRITE !,"Variable: "
READ X:DTIME
if '$LENGTH(X)
QUIT
SET VAR=X
+5 WRITE !,"Value (optional- enter 'NULL' to look for """"): "
READ X:DTIME
IF $LENGTH(X)
if X="NULL"
SET X=""
SET VAL=X
+6 WRITE !,"List variables: "
SET %=2
DO YN^DICN
SET LISTVAR=$SELECT(%=1:1,1:0)
DATE ;
+1 WRITE !
SET %DT="AEX"
SET %DT("A")="ERROR DATE: "
DO ^%DT
if $DATA(DTOUT)
QUIT
if X["^"
QUIT
if Y<1
GOTO ER
+2 SET X=Y
DO H^%DTC
SET ERDT=%H
+3 IF '$DATA(^%ZTER(1,+ERDT))
WRITE !,"No errors on that date",!
GOTO DATE
+4 SET IFN=0
FOR
SET IFN=$ORDER(^%ZTER(1,+ERDT,1,IFN))
if IFN<1
QUIT
SET ERTXT=$EXTRACT($GET(^(IFN,"ZE")),1,70)
SET FIRST=1
Begin DoDot:1
+5 SET VI=0
FOR
SET VI=$ORDER(^%ZTER(1,+ERDT,1,IFN,"ZV",VI))
if VI<1
QUIT
SET X=^(VI,0)
SET EVAL=$GET(^("D"))
IF $EXTRACT(X,1,$LENGTH(VAR))[VAR
Begin DoDot:2
+6 IF $GET(VAL)
if VAL'=$PIECE(EVAL,"^")
QUIT
+7 IF FIRST
SET FIRST=0
WRITE !!,IFN_". "_ERTXT
+8 IF LISTVAR
WRITE !?3,X,?15,EVAL
End DoDot:2
End DoDot:1
+9 GOTO DATE
+10 QUIT
ORYX ;Find things in the OE/RR Error file
+1 NEW OREND
+2 WRITE !!?10,"ORYX('ORERR' file search"
+3 IF '$ORDER(^ORYX("ORERR",0))
WRITE !!,"No errors in the file."
QUIT
+4 FOR
DO YX
if OREND
QUIT
+5 QUIT
YX ;
+1 NEW ORSSTRT,ORSSTOP,I,X,Y,Z,GOT,YES
+2 DO RANGE^ORPRS01()
+3 if OREND
QUIT
+4 WRITE !!,"Enter text to search for (case sensitive & optional): "
+5 READ X:DTIME
if '$TEST
QUIT
+6 SET GOT=0
SET YES=0
SET %=1
+7 IF X'=""
WRITE !,"Show details"
DO YN^DICN
if %=-1
QUIT
if %'=2
SET YES=1
+8 SET I=0
WRITE " searching..."
+9 FOR
SET I=$ORDER(^ORYX("ORERR",I))
if I<1
QUIT
SET Y=^(I,0)
SET GOT=0
Begin DoDot:1
+10 IF +Y<ORSSTRT!(+Y>ORSSTOP)
QUIT
+11 IF X=""
WRITE !,I_"=>"_Y
QUIT
+12 IF Y[X
SET GOT=1
+13 IF 'GOT
SET J=0
FOR
SET J=$ORDER(^ORYX("ORERR",I,1,J))
if J<1
QUIT
SET Z=^(J,0)
IF Z[X
SET GOT=1
QUIT
+14 ;W !,I_"=>"_Y Q:'YES S J=0 F S J=$O(^ORYX("ORERR",I,1,J)) Q:J<1 W !?12,^(J,0)
IF GOT
DO VIEW(I,YES)
End DoDot:1
V1 IF 'YES
WRITE !!,"View #: "
READ X:DTIME
IF X
IF $DATA(^ORYX("ORERR",X))
DO VIEW(X,1)
GOTO V1
+1 QUIT
VIEW(I,DETAIL) ;View log
+1 NEW J,Y
+2 if '$DATA(^ORYX("ORERR",+$GET(I),0))
QUIT
SET Y=^(0)
+3 WRITE !,I_"=>"_Y
if '$GET(DETAIL)
QUIT
SET J=0
FOR
SET J=$ORDER(^ORYX("ORERR",I,1,J))
if J<1
QUIT
WRITE !?12,^(J,0)
+4 QUIT