source: FOIAVistA/trunk/r/ENGINEERING-EN/ENY2K4.m@ 1688

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

initial load of FOIAVistA 6/30/08 version

File size: 3.2 KB
Line 
1ENY2K4 ;(WASH ISC)/DH-Delete Y2K Work Orders ;6.16.98
2 ;;7.0;ENGINEERING;**51**;Aug 17, 1993
3 ;
4DEL ; delete Y2K worklist
5 W !!,"Which do you wish to delete?",!,?7,"1. Individual work order(s), or",!,?7,"2. An entire Y2K work list."
6 R !,"Select 1 or 2: ",X:DTIME Q:X="^"!(X="") G:X["?" DELH1 I X?1N,X>0,X<3 G:X=1 DEL1 G DEL2
7 W "??",*7 G DEL
8 ;
9DEL1 ; delete individual work orders
10 N DIC,DIK,DA
11 S DIC="^ENG(6920,",DIC(0)="AEQM",DIC("A")="Enter first Y2K work order to be deleted: ",DIC("S")="I $E($P(^(0),U,1),1,3)=""Y2-""" D ^DIC K DIC("S") G:Y'>0 OUT1 S DA=+Y,ENY2WO=$P(^ENG(6920,DA,0),U)
12 W !,ENY2WO," Are you sure" S %=1 D YN^DICN G:%'=1 DEL1
13 S DIK="^ENG(6920,",EQDA=$P($G(^ENG(6920,DA,3)),U,8)
14 I EQDA?1.N,$D(^ENG(6914,EQDA,0)) S $P(^ENG(6914,EQDA,11),U,8)=""
15 D ^DIK K DIK
16 ;
17DEL10 S ENY2WO(1)=$O(^ENG(6920,"B",ENY2WO)) G:$P(ENY2WO(1),"-",2)'=$P(ENY2WO,"-",2) OUT1
18 ;
19DEL11 W !!,"Next work order: ",ENY2WO(1),"// " R X:DTIME G:X="^" OUT1 I X?1.3N S X=$S($L(X)=1:"00"_X,$L(X)=2:"0"_X,1:X),X=$P(ENY2WO,"-",1,2)_"-"_X
20 I X="" S X=ENY2WO(1)
21 I $E(X,1,3)'="Y2-" D DELH0 G DEL11
22 S ENY2WO=X,DIC(0)="X",DIC("S")="I $E($P(^(0),U),1,3)=""Y2-""" D ^DIC K DIC("S") S DA=+Y I Y'>0 W "??",*7 D DELH0 G DEL11
23 W !,ENY2WO," Are you sure" S %=1 D YN^DICN G:%'=1 DEL10
24 S DIK="^ENG(6920,",EQDA=$P($G(^ENG(6920,DA,3)),U,8)
25 I EQDA?1.N,$D(^ENG(6914,EQDA,0)) S $P(^ENG(6914,EQDA,11),U,8)=""
26 D ^DIK K DIK
27 G DEL10
28 ;
29DEL2 ; delete an entire Y2K work list
30 L +^ENG("Y2KLIST"):1 I '$T W !!,"Another user is processing a Y2K worklist. Please try again later.",*7 Q
31 K ^TMP($J)
32 N SHOPS,COUNT,DIC,DIK,DA
33 S DIR(0)="Y",DIR("A")="Shall we delete Y2K worklists for ALL shops",DIR("B")="YES"
34 D ^DIR K DIR G:$D(DIRUT) OUT S:Y SHOPS="ALL"
35 I '$D(SHOPS) S DIC="^DIC(6922,",DIC(0)="AEMQ" D ^DIC G:Y'>0 OUT S ENSHKEY=+Y,ENSHABR=$P(^DIC(6922,ENSHKEY,0),U,2),ENSHOP=$P(^(0),U)
36DEL22 W @IOF,!!
37 W "This option will delete the entire Y2K worklist of "_$S($G(SHOPS)="ALL":"ALL shops.",1:"the "_ENSHOP_" shop.")
38 W !!,"Just a moment, please..."
39 S ENY2K="Y2-",COUNT=0 F S ENY2K=$O(^ENG(6920,"B",ENY2K)) Q:$E(ENY2K,1,3)'="Y2-" S DA=$O(^(ENY2K,0)) D:DA
40 . I '$D(SHOPS),$P($G(^ENG(6920,DA,2)),U)'=ENSHKEY Q
41 . S COUNT=COUNT+1,^TMP($J,DA)=""
42 I 'COUNT W !!,"No Y2K work orders to delete." D MSG G OUT
43 W !!,"You have selected "_COUNT_" Y2K work orders. Deletion of these work orders",!,"will not affect equipment histories. Are you sure you want to proceed" S %=1 D YN^DICN
44 I %'=1 W !,"Nothing deleted.",*7 D MSG G OUT
45 S DA=0,DIK="^ENG(6920," F S DA=$O(^TMP($J,DA)) Q:'DA D
46 . S EQDA=$P($G(^ENG(6920,DA,3)),U,8) I EQDA?1.N,$D(^ENG(6914,EQDA,0)) S $P(^ENG(6914,EQDA,11),U,8)=""
47 . D ^DIK W:'(DA#10) "."
48 K DIK
49 ;
50OUT L -^ENG("Y2KLIST")
51OUT1 ;
52 K ENY2,ENY2WO,ENINN,ENWON,ENSHKEY,ENSHOP,ENSHABR,EQDA
53 S:$D(ZTQUEUED) ZTREQ="@"
54 Q
55MSG R !,"Press <RETURN> to continue...",X:DTIME Q
56DELH0 W !,"Entry must be an existing work order, beginning with 'Y2-', or the",!,"sequential (numeric) portion thereof. Enter '^' to exit." Q
57DELH1 W !,"Enter '1' to delete individual Y2K work orders or '2' to delete an entire",!,"Y2K worklist."
58 W !,"Deletion of Y2K work orders which have been closed out does NOT remove them",!,"from the equipment history."
59 G DEL
60 ;
61 ;ENY2K4
Note: See TracBrowser for help on using the repository browser.