Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: AZAXPIFX

AZAXPIFX.m

Go to the documentation of this file.
  1. AZAXPIFX;IHS/PHXAO/AEF - FIX BAD NODES IN ^AUPNPRVT GLOBAL
  1. ;;1.0;ANNE'S SPECIAL ROUTINES;;MAY 21, 2004
  1. ;
  1. DESC ;----- ROUTINE DESCRIPTION
  1. ;;
  1. ;;This routine can be used to SCAN and DELETE bad entries in the Private
  1. ;;Insurance Eligible file. You should first run the routine in SCAN mode
  1. ;;to determine which entries have bad data. It is HIGHLY RECOMMENDED that
  1. ;;you make a backup copy of your ^AUPNPRVT global before you delete the
  1. ;;bad entries.
  1. ;;
  1. ;;$$END
  1. ;
  1. EN ;EP --- MAIN ENTRY POINT
  1. ;
  1. N DEL,OUT
  1. ;
  1. D TXT
  1. ;
  1. S (DEL,OUT)=0
  1. ;
  1. D ASK(.DEL,.OUT)
  1. Q:OUT
  1. ;
  1. I DEL D BKU(.OUT)
  1. Q:OUT
  1. ;
  1. D LOOP(DEL)
  1. ;
  1. Q
  1. LOOP(DEL) ;
  1. ;----- LOOP THROUGH PRIVATE INSURANCE ELIGIBLE ^AUPNPRVT GLOBAL
  1. ;
  1. N CNT,D0,D1
  1. ;
  1. W !!,"Checking Private Insurance Eligible File... PLEASE WAIT",!!
  1. ;
  1. S CNT=0
  1. ;
  1. S D0=0
  1. F S D0=$O(^AUPNPRVT(D0)) Q:'D0 D
  1. . S D1=0
  1. . F S D1=$O(^AUPNPRVT(D0,11,D1)) Q:'D1 D
  1. . . D ONE(D0,D1,DEL,.CNT)
  1. ;
  1. I CNT W !!,CNT," ENTRIES ",$S(DEL:"FIXED",1:"FOUND")
  1. I 'CNT W !!,"NO BAD ENTRIES FOUND"
  1. W !!,"DONE!",!!
  1. Q
  1. ONE(D0,D1,DEL,CNT) ;
  1. ;----- PROCESS ONE ENTRY
  1. ;
  1. Q:+$G(^AUPNPRVT(D0,11,D1,0))
  1. ;
  1. S CNT=$G(CNT)+1
  1. ;
  1. W !," bad entry at ien: ",D0," ^AUPNPRVT(",D0,",11,",D1,",0)=",^AUPNPRVT(D0,11,D1,0)
  1. ;
  1. Q:'DEL
  1. K ^AUPNPRVT(D0,11,D1,0)
  1. ;
  1. W !,"fixed"
  1. Q
  1. ASK(DEL,OUT) ;
  1. ;----- ASK IF SCAN OR DELETE MODE
  1. ;
  1. N DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. S OUT=0
  1. S DIR(0)="S^0:SCAN;1:DELETE"
  1. S DIR("A")="Run in SCAN or DELETE mode?"
  1. S DIR("B")="SCAN"
  1. D ^DIR
  1. I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S OUT=1
  1. S DEL=+Y
  1. Q
  1. BKU(OUT) ;
  1. ;----- ASK IF BACKUP COPY OF ^AUPNPRVT GLOBAL HAS BEEN DONE
  1. ;
  1. N DIR,DIRUT,DTOUT,DUOUT,X,Y
  1. S DIR(0)="Y"
  1. S DIR("A")="Did you make a backup copy of the ^AUPNPRVT global?"
  1. S DIR("B")="NO"
  1. D ^DIR
  1. I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S OUT=1
  1. I +Y'>0 S OUT=1
  1. Q
  1. TXT ;----- PRINT OPTION TEXT
  1. ;
  1. N I,X
  1. F I=1:1 S X=$P($T(DESC+I),";",3) Q:X["$$END" W !,X
  1. Q