AZAXFIX ;FIX ROUTINE [ 08/13/2003 12:27 PM ]
;;
;TO FIX BAD NODES IN ^AUPNPRVT GLOBAL
;THIS ROUTINE IS COPIED FROM AZHAFIX AND MODIFIED BY AEF
;;
START ;start
;
N DEL,OUT
;
D TEXT
;
S (DEL,OUT)=0
;
D ASK(.DEL,.OUT)
Q:OUT
;
I DEL D BKU(.OUT)
Q:OUT
;
W !!,"Checking Private Insurance Eligible File",!!
S I=0
BY ;bypass with I set
F S I=$O(^AUPNPRVT(I)) Q:'I D
.I '(I#100) W "."
.S J=0
.F S J=$O(^AUPNPRVT(I,11,J)) Q:'J D
..D ONE
W !!,"Done",!!
Q
ONE ;one entry
Q:+$G(^AUPNPRVT(I,11,J,0))
W !," bad entry at ien: ",I," ^AUPNPRVT(",I,",11,",J,",0)=",^AUPNPRVT(I,11,J,0),!
;K ^AUPNPRVT(I,11,J,0) W "fixed"
Q
ASK(DEL,OUT) ;
;----- ASK IF SCAN OR DELETE MODE
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S OUT=0
S DIR(0)="S^0:SCAN;1:DELETE"
S DIR("A")="Run in SCAN or DELETE mode?"
S DIR("B")="SCAN"
D ^DIR
I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S OUT=1
S DEL=+Y
Q
BKU(OUT) ;
;----- ASK IF BACKUP COPY OF ^AUPNPRVT GLOBAL HAS BEEN DONE
;
N DIR,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)="Y"
S DIR("A")="Did you make a backup copy of the ^AUPNPRVT global?"
S DIR("B")="NO"
D ^DIR
I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S OUT=1
I +Y'>0 S OUT=1
Q
TEXT ;
;----- WHAT THIS ROUTINE DOES
;
W !!,"This routine can be used to SCAN and DELETE bad entries in the Private"
W !,"Insurance Eligible file. You should first run the routine in SCAN mode"
W !,"to determine which entries have bad data. It is HIGHLY RECOMMENDED that"
W !,"you make a backup copy of your ^AUPNPRVT global before you delete the"
W !,"bad entries."
W !!
Q
AZAXFIX ;FIX ROUTINE [ 08/13/2003 12:27 PM ]
+1 ;;
+2 ;TO FIX BAD NODES IN ^AUPNPRVT GLOBAL
+3 ;THIS ROUTINE IS COPIED FROM AZHAFIX AND MODIFIED BY AEF
+4 ;;
START ;start
+1 ;
+2 NEW DEL,OUT
+3 ;
+4 DO TEXT
+5 ;
+6 SET (DEL,OUT)=0
+7 ;
+8 DO ASK(.DEL,.OUT)
+9 IF OUT
QUIT
+10 ;
+11 IF DEL
DO BKU(.OUT)
+12 IF OUT
QUIT
+13 ;
+14 WRITE !!,"Checking Private Insurance Eligible File",!!
+15 SET I=0
BY ;bypass with I set
+1 FOR
SET I=$ORDER(^AUPNPRVT(I))
IF 'I
QUIT
Begin DoDot:1
+2 IF '(I#100)
WRITE "."
+3 SET J=0
+4 FOR
SET J=$ORDER(^AUPNPRVT(I,11,J))
IF 'J
QUIT
Begin DoDot:2
+5 DO ONE
End DoDot:2
End DoDot:1
+6 WRITE !!,"Done",!!
+7 QUIT
ONE ;one entry
+1 IF +$GET(^AUPNPRVT(I,11,J,0))
QUIT
+2 WRITE !," bad entry at ien: ",I," ^AUPNPRVT(",I,",11,",J,",0)=",^AUPNPRVT(I,11,J,0),!
+3 ;K ^AUPNPRVT(I,11,J,0) W "fixed"
+4 QUIT
ASK(DEL,OUT) ;
+1 ;----- ASK IF SCAN OR DELETE MODE
+2 ;
+3 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+4 SET OUT=0
+5 SET DIR(0)="S^0:SCAN;1:DELETE"
+6 SET DIR("A")="Run in SCAN or DELETE mode?"
+7 SET DIR("B")="SCAN"
+8 DO ^DIR
+9 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
SET OUT=1
+10 SET DEL=+Y
+11 QUIT
BKU(OUT) ;
+1 ;----- ASK IF BACKUP COPY OF ^AUPNPRVT GLOBAL HAS BEEN DONE
+2 ;
+3 NEW DIR,DIRUT,DTOUT,DUOUT,X,Y
+4 SET DIR(0)="Y"
+5 SET DIR("A")="Did you make a backup copy of the ^AUPNPRVT global?"
+6 SET DIR("B")="NO"
+7 DO ^DIR
+8 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
SET OUT=1
+9 IF +Y'>0
SET OUT=1
+10 QUIT
TEXT ;
+1 ;----- WHAT THIS ROUTINE DOES
+2 ;
+3 WRITE !!,"This routine can be used to SCAN and DELETE bad entries in the Private"
+4 WRITE !,"Insurance Eligible file. You should first run the routine in SCAN mode"
+5 WRITE !,"to determine which entries have bad data. It is HIGHLY RECOMMENDED that"
+6 WRITE !,"you make a backup copy of your ^AUPNPRVT global before you delete the"
+7 WRITE !,"bad entries."
+8 WRITE !!
+9 QUIT