[613] | 1 | ENEQPMS4 ;(WASH ISC)/DH-Delete PMI Work Orders ;1/11/2001
|
---|
| 2 | ;;7.0;ENGINEERING;**35,48,51,68**;Aug 17, 1993
|
---|
| 3 | LSTH1 W !!,"All worklists are sorted by shop, and within shop they may be sorted again by",!,"RESPONSIBLE TECHNICIAN. You must now choose how this list should be sorted"
|
---|
| 4 | W !,"further. You have the following choices:"
|
---|
| 5 | W !,?10,"'E' for Equipment Entry #"
|
---|
| 6 | W !,?10,"'P' for PM #"
|
---|
| 7 | W !,?10,"'I' for Local Identifier"
|
---|
| 8 | W !,?10,"'L' for Location"
|
---|
| 9 | W !,?10,"'C' for Equipment Category"
|
---|
| 10 | W !,?10,"'S' for Owning Service",!
|
---|
| 11 | Q
|
---|
| 12 | ;
|
---|
| 13 | DEL ; delete PM worklist
|
---|
| 14 | W !!,"Which do you wish to delete?",!,?7,"1. Individual work order(s), or",!,?7,"2. An entire PM work list."
|
---|
| 15 | 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
|
---|
| 16 | W "??",*7 G DEL
|
---|
| 17 | ;
|
---|
| 18 | DEL1 ; delete individual work orders
|
---|
| 19 | S DIC="^ENG(6920,",DIC(0)="AEQM",DIC("A")="Please enter first work order to be deleted ",DIC("S")="I $E($P(^(0),U,1),1,3)=""PM-""" D ^DIC K DIC("S") G:Y'>0 OUT S DA=+Y,ENPMWO=$P(^ENG(6920,DA,0),U,1)
|
---|
| 20 | W !,ENPMWO," Are you sure" S %=1 D YN^DICN G:%'=1 DEL1 S DIK="^ENG(6920," D:$E(^ENG(6920,DA,0),1,3)="PM-" ^DIK
|
---|
| 21 | DEL10 S ENPMWO(1)=$O(^ENG(6920,"B",ENPMWO)) G:$P(ENPMWO(1),"-",2)'=$P(ENPMWO,"-",2) OUT
|
---|
| 22 | DEL11 W !!,"Next work order: ",ENPMWO(1),"// " R X:DTIME G:X="^" OUT I X?1.3N S X=$S($L(X)=1:"00"_X,$L(X)=2:"0"_X,1:X),X=$P(ENPMWO,"-",1,2)_"-"_X
|
---|
| 23 | I X="" S X=ENPMWO(1)
|
---|
| 24 | I $E(X,1,3)'="PM-" D DELH0 G DEL11
|
---|
| 25 | S ENPMWO=X,DIC(0)="X",DIC("S")="I $E($P(^(0),U,1),1,3)=""PM-""" D ^DIC K DIC("S") S DA=+Y I Y'>0 W "??",*7 D DELH0 G DEL11
|
---|
| 26 | W !,ENPMWO," Are you sure" S %=1 D YN^DICN G:%'=1 DEL10 S DIK="^ENG(6920," D:$E(^ENG(6920,DA,0),1,3)="PM-" ^DIK
|
---|
| 27 | G DEL10
|
---|
| 28 | ;
|
---|
| 29 | DEL2 ; delete an entire work list
|
---|
| 30 | S DIC="^DIC(6922,",DIC(0)="AEMQ" D ^DIC Q:Y'>0 S ENSHKEY=+Y,ENSHABR=$P(^DIC(6922,ENSHKEY,0),U,2),ENSHOP=$P(^(0),U,1)
|
---|
| 31 | S Y=$E(DT,1,5)_"00" X ^DD("DD") S %DT("A")="Select Month: ",%DT("B")=Y,%DT="AEFMX" D ^%DT G:Y'>0 OUT S ENPMDT=$E(Y,2,5),ENPMMN=+$E(Y,4,5),ENPMYR=1700+$E(Y,1,3)
|
---|
| 32 | DEL20 R !,"MONTHLY or WEEKLY PM list: MONTHLY// ",X:DTIME G:X="^" OUT S ENPM=$S(X="":"M",$E(X)="M":"M",$E(X)="W":"W",1:"") G:ENPM="M" DEL22 I ENPM']"" D RCOH1^ENEQPMR2 G DEL20
|
---|
| 33 | DEL21 R !,"Which week? ",X:DTIME G:X="^" OUT I X'?1N D DELH2 G DEL21
|
---|
| 34 | I X<1!(X>5) D DELH2 G DEL21
|
---|
| 35 | S ENPMWK=X,ENPM=ENPM_ENPMWK
|
---|
| 36 | DEL22 W @IOF,!!
|
---|
| 37 | W "This option will delete the entire "_$S(ENPM="M":"MONTHLY",ENPM["W":"WEEKLY",1:"")_" PM List of the "_ENSHOP,!,"Shop for "_$P("JANUARY^FEBRUARY^MARCH^APRIL^MAY^JUNE^JULY^AUGUST^SEPTEMBER^OCTOBER^NOVEMBER^DECEMBER",U,ENPMMN)
|
---|
| 38 | W ", "_ENPMYR_$S(ENPM["W":" (Week "_ENPMWK_")",1:"")_"."
|
---|
| 39 | W !!,"Just a moment, please..."
|
---|
| 40 | S I=0,ENPMWO("P")="PM-"_ENSHABR_ENPMDT_ENPM_"-",ENPMWO=ENPMWO("P") F I=0:1 S ENPMWO=$O(^ENG(6920,"B",ENPMWO)) Q:ENPMWO']""!($P(ENPMWO,"-",2)'=$P(ENPMWO("P"),"-",2))
|
---|
| 41 | W !!,"There are ",I," PM work orders on this list. Deletion of these work orders will",!,"not affect equipment histories. Are you sure you want to proceed" S %=1 D YN^DICN
|
---|
| 42 | I %'=1 W !,"Nothing deleted.",*7 D MSG G OUT
|
---|
| 43 | S ENLOCK=ENPMWO("P") L +^ENG("PMLIST",ENPMWO("P")):1 I '$T W !!,"Sorry, another user is processing worklist. Please try again later.",*7 K ENLOCK G OUT
|
---|
| 44 | S ZTRTN="DELDQ^ENEQPMS4",ZTSAVE("EN*")="",ZTDESC="Delete PMI List",ZTIO="" D ^%ZTLOAD K ZTSK D HOME^%ZIS G OUT
|
---|
| 45 | DELDQ L +^ENG("PMLIST",ENLOCK):1
|
---|
| 46 | I $T S ENPMWO=ENPMWO("P"),DIK="^ENG(6920," F I=0:0 S ENPMWO=$O(^ENG(6920,"B",ENPMWO)) Q:ENPMWO']""!($P(ENPMWO,"-",2)'=$P(ENPMWO("P"),"-",2)) S DA=$O(^ENG(6920,"B",ENPMWO,0)) I DA]"",$D(^ENG(6920,DA,0)),$E(^(0),1,3)="PM-" D ^DIK
|
---|
| 47 | OUT I $D(ENLOCK) L -^ENG("PMLIST",ENLOCK) K ENLOCK
|
---|
| 48 | K ENPMWO,ENINN,ENWON,ENPM,ENPMDT,ENPMMN,ENPMWK,ENSHKEY,ENSHOP,ENSHABR,I,DIC,DIK,DA,ENPMYR
|
---|
| 49 | S:$D(ZTQUEUED) ZTREQ="@"
|
---|
| 50 | Q
|
---|
| 51 | MSG R !,"Press <RETURN> to continue...",X:DTIME Q
|
---|
| 52 | DELH0 W !,"Entry must be an existing PM work order, beginning with 'PM-', or the",!,"sequential (numeric) portion thereof. Enter '^' to exit." Q
|
---|
| 53 | DELH1 W !,"Enter '1' to delete individual PM work orders or '2' to delete a specific",!,"worklist (MONTHLY or WEEKLY) for an entire shop."
|
---|
| 54 | W !,"Deletion of PM work orders which have been closed out does NOT remove them",!,"from the equipment history."
|
---|
| 55 | G DEL
|
---|
| 56 | DELH2 W !,"Please enter an integer from 1 to 5."
|
---|
| 57 | Q
|
---|
| 58 | ;ENEQPMS4
|
---|