source: FOIAVistA/trunk/r/AUTO_REPLENISHMENT_WARD_STOCK-PSGW/PSGWAP.m@ 1015

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

initial load of FOIAVistA 6/30/08 version

File size: 1.5 KB
Line 
1PSGWAP ;BHAM ISC/PTD,CML-Purge Old AMIS Data ; 14 Feb 1989 1:36 PM
2 ;;2.3; Automatic Replenishment/Ward Stock ;;4 JAN 94
3 W !!,"This option will purge data from file PSI(58.5) - AMIS stats file.",!,"You should retain the data for at least 1 quarter.",!,"Therefore, the option will NOT ALLOW DELETION of data newer than ""T-100"".",!!
4BDT S BDT=0 I '$O(^PSI(58.5,"B",BDT)) W !,"There is NO data in the AMIS stats file.",!! K BDT Q
5 E S BDT=$O(^PSI(58.5,"B",BDT))
6EDT S %DT="AEXP",%DT("A")="Purge AMIS data older than (and including): ",%DT("B")="T-100" D ^%DT K %DT G:Y<0 END S (EDT,X2)=Y
7 D NOW^%DTC S X1=$P(%,".") D ^%DTC I X<100 W !!,"Data less than 100 days old may NOT BE DELETED!",!! G EDT
8 I BDT>EDT W !!,"No AMIS data to purge in selected date range.",!! G END
9ASK S Y=EDT X ^DD("DD") W !!,"I will now delete AMIS data that is older than (and including) ",Y,!,"Are you SURE that is what you want to do? NO// " R X:DTIME
10 G:'$T!("^Nn"[$E(X)) END
11 I "Yy"'[$E(X) W *7,*7,!!,"Answer ""yes"" if you wish to purge AMIS data.",!,"Answer ""no"" or <return> if you do not.",!! G ASK
12 S ZTRTN="ENQ^PSGWAP",ZTDTH=$H,ZTIO="",ZTDESC="Purge Old AMIS Data" F G="BDT","EDT" S:$D(@G) ZTSAVE(G)=""
13 D ^%ZTLOAD,HOME^%ZIS W !,"AMIS purge queued!" K ZTSK G END
14 ;
15ENQ ;ENTRY POINT WHEN QUEUED
16 S LPDT=BDT-1,DATDA=0
17DTLP S LPDT=$O(^PSI(58.5,"B",LPDT)) G:(LPDT>EDT)!'LPDT END
18DTDA S DATDA=$O(^PSI(58.5,"B",LPDT,DATDA)) G:'DATDA DTLP
19 S DIE="^PSI(58.5,",DA=DATDA,DR=".01///@" D ^DIE K DIE G DTDA
20 ;
21END K ZTSK,BDT,EDT,X,Y,LPDT,DATDA,%,%I,%H,G,ZTIO,DA,DR S:$D(ZTQUEUED) ZTREQ="@" Q
Note: See TracBrowser for help on using the repository browser.