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

SDPURG.m

Go to the documentation of this file.
  1. SDPURG ;ALB/TMP - Purge Routine Parameter Selection ; 12/24/85
  1. ;;5.3;Scheduling;**140,132**;Aug 13, 1993
  1. S:'$D(DTIME) DTIME=300 I '$D(DT) D DT^SDUTL
  1. S SDLIM=($E(DT,1,3)-$S($E(DT,4,5)>9:1,1:2))_"1001"
  1. W !,"The date you select to delete through may not exceed " S X1=SDLIM,X2=-1 D C^%DTC S (Y,SDLFY)=X D DT^DIQ W "."
  1. W !,"The files you may choose to delete from and the nodes that will be deleted are:",!!," from the HOSPITAL LOCATION File",!," - the 'S' nodes, APPOINTMENT multiple"
  1. W !," - the 'ST' nodes, clinic PATTERN multiple",!," - the 'OST' nodes, clinic SPECIAL PATTERN multiple",!," - the 'C' nodes, CHART CHECK multiple",!," - the 'AAS' nodes, 10/10 visits cross-reference"
  1. W !," from the PATIENT File",!," - the 'ASDPSD' nodes, Special Survey cross-reference"
  1. W !!,"OK to continue" S %=1 D YN^DICN Q:%<0!(%>1) I '% G SDPURG
  1. A1 S %=2 W !!,"Do you want to purge the Hospital Location file nodes" D YN^DICN Q:%<0 I '% W !,"Reply YES or NO" G A1
  1. S SD44=$S('(%-1):1,1:0)
  1. A2 S %=2 W !!,"Do you want to purge the Patient file nodes" D YN^DICN Q:%<0 I '% W !,"Reply YES or NO" G A2
  1. S SD2=$S('(%-1):1,1:0)
  1. I 'SD2,'SD44 W !!,*7,"No files selected for purging --- NO PURGING DONE!!" G Q^SDPURG1
  1. DT1 S Y=SDLFY D D^DIQ W !!,"Select date through which you want these files purged: ",Y," // " R X:DTIME Q:X["^" I X']"" S SDLIM1=SDLIM G OV
  1. I X?1"?".E W !,"This date may be different from the default - choose the date through which",!," you want to purge" G DT1
  1. W ! S %DT="E",%DT(0)=-DT D ^%DT I Y'>0 W !,"Invalid date" G DT1
  1. I Y>SDLFY W !,*7,"You can only purge data up to " S Y=SDLFY D DT^DIQ G DT1
  1. K %DT S SDLIM1=+Y_.9
  1. OV I 'SD2,'SD44 W !!,*7,"No files selected for purging --- NO PURGING DONE!!" G Q^SDPURG1
  1. A4 S %=2 W !!,"Do you want to print nodes (in GLOBAL format - %G) as they are deleted" D YN^DICN Q:%<0 I '% W !,"Reply YES or NO" G A4
  1. S SDPR=$S('(%-1):1,1:0)
  1. A5 S %=1 W !!,"Is everything OK to proceed" D YN^DICN Q:%<0 I '% W !,"Reply YES or NO" G A5
  1. I (%-1) W !,*7,"NO PURGING DONE!!" G Q^SDPURG1
  1. S VAR="SDLIM^SDLIM1^SD44^SD2^SDPR",VAL=SDLIM_"^"_SDLIM1_"^"_SD44_"^"_SD2_"^"_SDPR,PGM="START^SDPURG1" D ZIS^DGUTQ G:POP Q^SDPURG1
  1. G START^SDPURG1