ENEQLT ;;(WASHIRMFO)/DH-Control Status of LOCKOUT REQUIRED flags ;2.12.97
;;7.0;ENGINEERING;**35**;August 17,1993
;If field set to YES then equipment must be isolated and rendered
;inoperative prior to service.
; No input data expected
; Edits Equipment File (6914) and prints reports
; Fictitious global ^ENG("ENEQLT") is LOCKED to insure that only
; one user at a time can edit LOCKOUT REQUIRED Flags
; Edits are not individually LOCKED
EN N METHOD,ESCAPE,CATEGORY,CAT,DA,DIC,DIE,DR
L +^ENG("ENEQLT"):1 I '$T W !!,"Sorry, but another user is editing 'LOCKOUT REQUIRED?' flags.",*7 G EXIT
;
ACTION ; SET or CLEAR?
S DIR("A")="Should 'LOCKOUT REQUIRED?' Flag be SET or CLEARED"
S DIR("B")="Set",DIR(0)="S^S:Set;C:Cleared"
D ^DIR K DIR S ENACT=$E(Y) I $D(DIRUT) G EXIT
;
METHOD W @IOF S DIR("A")=$S(ENACT="S":"SET",1:"CLEAR")_" 'LOCKOUT REQUIRED?' Flag by"
S DIR("B")=1
S DIR(0)="S^1:Equipment Categories;2:Equipment Entries"
S DIR("?",1)="This utility is to manage (SET or CLEAR) the LOCKOUT REQUIRED field in the"
S DIR("?",2)="Equipment File. You may specify changes to all equipment belonging to"
S DIR("?",3)="selected EQUIPMENT CATEGORIES (Option 1) or you may select Equipment Records"
S DIR("?",4)="individually (Option 2)."
S DIR("?",5)=" "
S DIR("?")="Please enter '1' or '2' or '^' to escape."
S ESCAPE=0 D ^DIR K DIR S METHOD=Y I $D(DIRUT) G EXIT
;
GETLIST ; Create a list in '^XUTL("ENLT",ENDATE("I"),' of records to be edited
D NOW^%DTC S (Y,ENDATE("I"))=% X ^DD("DD") S ENDATE=$P(Y,":")_":"_$P(Y,":",2)
K ^XUTL("ENLT",ENDATE("I")) S ESCAPE=0
I METHOD=1 D ECAT I ESCAPE K ^XUTL("ENLT",ENDATE("I")) G EXIT
;
EDITEC 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
I METHOD=2 D ELIST I $D(DTOUT)!($D(DUOUT)) K ^XUTL("ENLT",ENDATE("I")) G EXIT
I '$D(^XUTL("ENLT",ENDATE("I"))) W !!,?20,"Equipment File unchanged." D HOLD G EXIT
;
EDITER S DIE="^ENG(6914,",DR="9///^S X="_$S(ENACT="S":1,1:0)
S DA=0 F S DA=$O(^XUTL("ENLT",ENDATE("I"),DA)) Q:'DA D ^DIE
D REPAT^ENEQLT1 ;Summary of action taken
G EXIT ;Design EXIT POINT
Q
;
ECAT ; Build Equipment List by Equipment Category
W ! S DIC="^ENG(6911,",DIC(0)="AEQM"
F D SELCT Q:ESCAPE!(Y'>0)
Q:'$D(CATEGORY)!(ESCAPE)
D BUILD
Q
;
SELCT ; Select Equipment Categories
D ^DIC I Y'>0 S:$D(DTOUT)!($D(DUOUT)) ESCAPE=1 Q
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."
I '$D(CATEGORY(+Y)) S CATEGORY(+Y)=$P(^ENG(6911,+Y,0),U)
SELCT1 S DIR(0)="SBM^Y:YES;N:NO;L:LIST",DIR("A")="Would you like to add another Equipment Category",DIR("B")="NO"
S DIR("?",1)="Please indicate whether or not you want to add another Equipment Category"
S DIR("?",2)="to your processing list. You may also enter 'L' for a list of Equipment"
S DIR("?")="Categories already selected or '^' to escape without changing anything."
W ! D ^DIR K DIR I $D(DIRUT) S ESCAPE=1 Q
I Y="Y" G SELCT
I Y="L" D LST^ENEQLT1 Q:ESCAPE G SELCT1
Q
;
BUILD ; Build equipment list from selected EQUIPMENT CATEGORIES
S CAT=0 F S CAT=$O(CATEGORY(CAT)) Q:'CAT D
. S DA=0 F S DA=$O(^ENG(6914,"G",CAT,DA)) Q:'DA S ^XUTL("ENLT",ENDATE("I"),DA)=""
Q
;
ELIST ; Build Equipment List directly from EQUIPMENT FILE
W ! F D Q:Y'>0
. D GETEQ^ENUTL I Y'>0 S:$D(DTOUT)!($D(DUOUT)) ESCAPE=1 Q
. S ^XUTL("ENLT",ENDATE("I"),+Y)=""
Q
HOLD Q:$E(IOST,1,2)'="C-"
W !!,"Press <RETURN> to continue, or '^' to escape..." R X:DTIME
S:$E(X)="^" ESCAPE=1
Q
;
EXIT L -^ENG("ENEQLT")
K ENDATE,ENACT
Q
;ENEQLT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQLT 3741 printed Nov 22, 2024@17:02:37 Page 2
ENEQLT ;;(WASHIRMFO)/DH-Control Status of LOCKOUT REQUIRED flags ;2.12.97
+1 ;;7.0;ENGINEERING;**35**;August 17,1993
+2 ;If field set to YES then equipment must be isolated and rendered
+3 ;inoperative prior to service.
+4 ; No input data expected
+5 ; Edits Equipment File (6914) and prints reports
+6 ; Fictitious global ^ENG("ENEQLT") is LOCKED to insure that only
+7 ; one user at a time can edit LOCKOUT REQUIRED Flags
+8 ; Edits are not individually LOCKED
EN NEW METHOD,ESCAPE,CATEGORY,CAT,DA,DIC,DIE,DR
+1 LOCK +^ENG("ENEQLT"):1
IF '$TEST
WRITE !!,"Sorry, but another user is editing 'LOCKOUT REQUIRED?' flags.",*7
GOTO EXIT
+2 ;
ACTION ; SET or CLEAR?
+1 SET DIR("A")="Should 'LOCKOUT REQUIRED?' Flag be SET or CLEARED"
+2 SET DIR("B")="Set"
SET DIR(0)="S^S:Set;C:Cleared"
+3 DO ^DIR
KILL DIR
SET ENACT=$EXTRACT(Y)
IF $DATA(DIRUT)
GOTO EXIT
+4 ;
METHOD WRITE @IOF
SET DIR("A")=$SELECT(ENACT="S":"SET",1:"CLEAR")_" 'LOCKOUT REQUIRED?' Flag by"
+1 SET DIR("B")=1
+2 SET DIR(0)="S^1:Equipment Categories;2:Equipment Entries"
+3 SET DIR("?",1)="This utility is to manage (SET or CLEAR) the LOCKOUT REQUIRED field in the"
+4 SET DIR("?",2)="Equipment File. You may specify changes to all equipment belonging to"
+5 SET DIR("?",3)="selected EQUIPMENT CATEGORIES (Option 1) or you may select Equipment Records"
+6 SET DIR("?",4)="individually (Option 2)."
+7 SET DIR("?",5)=" "
+8 SET DIR("?")="Please enter '1' or '2' or '^' to escape."
+9 SET ESCAPE=0
DO ^DIR
KILL DIR
SET METHOD=Y
IF $DATA(DIRUT)
GOTO EXIT
+10 ;
GETLIST ; Create a list in '^XUTL("ENLT",ENDATE("I"),' of records to be edited
+1 DO NOW^%DTC
SET (Y,ENDATE("I"))=%
XECUTE ^DD("DD")
SET ENDATE=$PIECE(Y,":")_":"_$PIECE(Y,":",2)
+2 KILL ^XUTL("ENLT",ENDATE("I"))
SET ESCAPE=0
+3 IF METHOD=1
DO ECAT
IF ESCAPE
KILL ^XUTL("ENLT",ENDATE("I"))
GOTO EXIT
+4 ;
EDITEC IF $DATA(CATEGORY)
SET DA=0
SET DIE="^ENG(6911,"
SET DR="2///^S X="_$SELECT(ENACT="S":1,1:0)
FOR
SET DA=$ORDER(CATEGORY(DA))
if 'DA
QUIT
DO ^DIE
+1 IF METHOD=2
DO ELIST
IF $DATA(DTOUT)!($DATA(DUOUT))
KILL ^XUTL("ENLT",ENDATE("I"))
GOTO EXIT
+2 IF '$DATA(^XUTL("ENLT",ENDATE("I")))
WRITE !!,?20,"Equipment File unchanged."
DO HOLD
GOTO EXIT
+3 ;
EDITER SET DIE="^ENG(6914,"
SET DR="9///^S X="_$SELECT(ENACT="S":1,1:0)
+1 SET DA=0
FOR
SET DA=$ORDER(^XUTL("ENLT",ENDATE("I"),DA))
if 'DA
QUIT
DO ^DIE
+2 ;Summary of action taken
DO REPAT^ENEQLT1
+3 ;Design EXIT POINT
GOTO EXIT
+4 QUIT
+5 ;
ECAT ; Build Equipment List by Equipment Category
+1 WRITE !
SET DIC="^ENG(6911,"
SET DIC(0)="AEQM"
+2 FOR
DO SELCT
if ESCAPE!(Y'>0)
QUIT
+3 if '$DATA(CATEGORY)!(ESCAPE)
QUIT
+4 DO BUILD
+5 QUIT
+6 ;
SELCT ; Select Equipment Categories
+1 DO ^DIC
IF Y'>0
if $DATA(DTOUT)!($DATA(DUOUT))
SET ESCAPE=1
QUIT
+2 IF $ORDER(^ENG(6914,"G",+Y,0))'>0
WRITE !,"There are no Equipment Entries on file for this Equipment Category, but the",!,"Equipment Category File will be updated."
+3 IF '$DATA(CATEGORY(+Y))
SET CATEGORY(+Y)=$PIECE(^ENG(6911,+Y,0),U)
SELCT1 SET DIR(0)="SBM^Y:YES;N:NO;L:LIST"
SET DIR("A")="Would you like to add another Equipment Category"
SET DIR("B")="NO"
+1 SET DIR("?",1)="Please indicate whether or not you want to add another Equipment Category"
+2 SET DIR("?",2)="to your processing list. You may also enter 'L' for a list of Equipment"
+3 SET DIR("?")="Categories already selected or '^' to escape without changing anything."
+4 WRITE !
DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET ESCAPE=1
QUIT
+5 IF Y="Y"
GOTO SELCT
+6 IF Y="L"
DO LST^ENEQLT1
if ESCAPE
QUIT
GOTO SELCT1
+7 QUIT
+8 ;
BUILD ; Build equipment list from selected EQUIPMENT CATEGORIES
+1 SET CAT=0
FOR
SET CAT=$ORDER(CATEGORY(CAT))
if 'CAT
QUIT
Begin DoDot:1
+2 SET DA=0
FOR
SET DA=$ORDER(^ENG(6914,"G",CAT,DA))
if 'DA
QUIT
SET ^XUTL("ENLT",ENDATE("I"),DA)=""
End DoDot:1
+3 QUIT
+4 ;
ELIST ; Build Equipment List directly from EQUIPMENT FILE
+1 WRITE !
FOR
Begin DoDot:1
+2 DO GETEQ^ENUTL
IF Y'>0
if $DATA(DTOUT)!($DATA(DUOUT))
SET ESCAPE=1
QUIT
+3 SET ^XUTL("ENLT",ENDATE("I"),+Y)=""
End DoDot:1
if Y'>0
QUIT
+4 QUIT
HOLD if $EXTRACT(IOST,1,2)'="C-"
QUIT
+1 WRITE !!,"Press <RETURN> to continue, or '^' to escape..."
READ X:DTIME
+2 if $EXTRACT(X)="^"
SET ESCAPE=1
+3 QUIT
+4 ;
EXIT LOCK -^ENG("ENEQLT")
+1 KILL ENDATE,ENACT
+2 QUIT
+3 ;ENEQLT