source: FOIAVistA/tag/r/ENGINEERING-EN/ENEQLT.m@ 1641

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1ENEQLT ;;(WASHIRMFO)/DH-Control Status of LOCKOUT REQUIRED flags ;2.12.97
2 ;;7.0;ENGINEERING;**35**;August 17,1993
3 ;If field set to YES then equipment must be isolated and rendered
4 ;inoperative prior to service.
5 ; No input data expected
6 ; Edits Equipment File (6914) and prints reports
7 ; Fictitious global ^ENG("ENEQLT") is LOCKED to insure that only
8 ; one user at a time can edit LOCKOUT REQUIRED Flags
9 ; Edits are not individually LOCKED
10EN N METHOD,ESCAPE,CATEGORY,CAT,DA,DIC,DIE,DR
11 L +^ENG("ENEQLT"):1 I '$T W !!,"Sorry, but another user is editing 'LOCKOUT REQUIRED?' flags.",*7 G EXIT
12 ;
13ACTION ; SET or CLEAR?
14 S DIR("A")="Should 'LOCKOUT REQUIRED?' Flag be SET or CLEARED"
15 S DIR("B")="Set",DIR(0)="S^S:Set;C:Cleared"
16 D ^DIR K DIR S ENACT=$E(Y) I $D(DIRUT) G EXIT
17 ;
18METHOD W @IOF S DIR("A")=$S(ENACT="S":"SET",1:"CLEAR")_" 'LOCKOUT REQUIRED?' Flag by"
19 S DIR("B")=1
20 S DIR(0)="S^1:Equipment Categories;2:Equipment Entries"
21 S DIR("?",1)="This utility is to manage (SET or CLEAR) the LOCKOUT REQUIRED field in the"
22 S DIR("?",2)="Equipment File. You may specify changes to all equipment belonging to"
23 S DIR("?",3)="selected EQUIPMENT CATEGORIES (Option 1) or you may select Equipment Records"
24 S DIR("?",4)="individually (Option 2)."
25 S DIR("?",5)=" "
26 S DIR("?")="Please enter '1' or '2' or '^' to escape."
27 S ESCAPE=0 D ^DIR K DIR S METHOD=Y I $D(DIRUT) G EXIT
28 ;
29GETLIST ; Create a list in '^XUTL("ENLT",ENDATE("I"),' of records to be edited
30 D NOW^%DTC S (Y,ENDATE("I"))=% X ^DD("DD") S ENDATE=$P(Y,":")_":"_$P(Y,":",2)
31 K ^XUTL("ENLT",ENDATE("I")) S ESCAPE=0
32 I METHOD=1 D ECAT I ESCAPE K ^XUTL("ENLT",ENDATE("I")) G EXIT
33 ;
34EDITEC I $D(CATEGORY) S DA=0,DIE="^ENG(6911,",DR="2///^S X="_$S(ENACT="S":1,1:0) F S DA=$O(CATEGORY(DA)) Q:'DA D ^DIE
35 I METHOD=2 D ELIST I $D(DTOUT)!($D(DUOUT)) K ^XUTL("ENLT",ENDATE("I")) G EXIT
36 I '$D(^XUTL("ENLT",ENDATE("I"))) W !!,?20,"Equipment File unchanged." D HOLD G EXIT
37 ;
38EDITER S DIE="^ENG(6914,",DR="9///^S X="_$S(ENACT="S":1,1:0)
39 S DA=0 F S DA=$O(^XUTL("ENLT",ENDATE("I"),DA)) Q:'DA D ^DIE
40 D REPAT^ENEQLT1 ;Summary of action taken
41 G EXIT ;Design EXIT POINT
42 Q
43 ;
44ECAT ; Build Equipment List by Equipment Category
45 W ! S DIC="^ENG(6911,",DIC(0)="AEQM"
46 F D SELCT Q:ESCAPE!(Y'>0)
47 Q:'$D(CATEGORY)!(ESCAPE)
48 D BUILD
49 Q
50 ;
51SELCT ; Select Equipment Categories
52 D ^DIC I Y'>0 S:$D(DTOUT)!($D(DUOUT)) ESCAPE=1 Q
53 I $O(^ENG(6914,"G",+Y,0))'>0 W !,"There are no Equipment Entries on file for this Equipment Category, but the",!,"Equipment Category File will be updated."
54 I '$D(CATEGORY(+Y)) S CATEGORY(+Y)=$P(^ENG(6911,+Y,0),U)
55SELCT1 S DIR(0)="SBM^Y:YES;N:NO;L:LIST",DIR("A")="Would you like to add another Equipment Category",DIR("B")="NO"
56 S DIR("?",1)="Please indicate whether or not you want to add another Equipment Category"
57 S DIR("?",2)="to your processing list. You may also enter 'L' for a list of Equipment"
58 S DIR("?")="Categories already selected or '^' to escape without changing anything."
59 W ! D ^DIR K DIR I $D(DIRUT) S ESCAPE=1 Q
60 I Y="Y" G SELCT
61 I Y="L" D LST^ENEQLT1 Q:ESCAPE G SELCT1
62 Q
63 ;
64BUILD ; Build equipment list from selected EQUIPMENT CATEGORIES
65 S CAT=0 F S CAT=$O(CATEGORY(CAT)) Q:'CAT D
66 . S DA=0 F S DA=$O(^ENG(6914,"G",CAT,DA)) Q:'DA S ^XUTL("ENLT",ENDATE("I"),DA)=""
67 Q
68 ;
69ELIST ; Build Equipment List directly from EQUIPMENT FILE
70 W ! F D Q:Y'>0
71 . D GETEQ^ENUTL I Y'>0 S:$D(DTOUT)!($D(DUOUT)) ESCAPE=1 Q
72 . S ^XUTL("ENLT",ENDATE("I"),+Y)=""
73 Q
74HOLD Q:$E(IOST,1,2)'="C-"
75 W !!,"Press <RETURN> to continue, or '^' to escape..." R X:DTIME
76 S:$E(X)="^" ESCAPE=1
77 Q
78 ;
79EXIT L -^ENG("ENEQLT")
80 K ENDATE,ENACT
81 Q
82 ;ENEQLT
Note: See TracBrowser for help on using the repository browser.