ENEQPMP3 ;(WASH ISC)/DH-Display PMI Schedules ;6.5.97
;;7.0;ENGINEERING;**35,42**;Aug 17, 1993
DDT ; Display Equipment Category PM Data
; Expects IEN of Equipment Category File as loc var ENDTYP
I '$D(^ENG(6911,ENDTYP,4,0)) W !!,"There is no defined PM schedule for this Equipment Category.",! D HLD Q
N X,IOINLOW,IOINHI,IOINORM D ZIS^ENUTL ;Get BOLD and UNBOLD for CRT
S ENY=2,ENRT="6911",ENDVTYP=$P(^ENG(6911,ENDTYP,0),U) W @IOF,"Equipment Category: " D W(ENDVTYP) W !
S X=^ENG(6911,ENDTYP,0),X(0)=0
I $P(X,U,2) W ?5,"Lockout Required?: " D W("YES") S X(0)=1
I $P(X,U,3)="Y" W ?40,"JCAHO Item: " D W("YES") S X(0)=1
I X(0) W ! S ENY=ENY+2
S I=0 F S I=$O(^ENG(6911,ENDTYP,4,I)) Q:I'>0 S ENSH=$P(^ENG(6911,ENDTYP,4,I,0),"^",1),ENEMP=$P(^(0),"^",2),ENSKP=$P(^(0),"^",3),ENCRIT=$P(^(0),U,4) S ENMN="" S:$D(^ENG(6911,ENDTYP,4,I,1)) ENMN=^(1) D MNTH^ENLIB1,DPM
G EXIT ;End DDT
;
DINV ; Display Equipment Record PM Data
; Expects IEN of Equipment File as loc var DA
I '$D(^ENG(6914,DA,4)) W !!,"There is no defined PM schedule for this piece of equipment.",! D HLD Q
N X,IOINLOW,IOINHI,IOINORM D ZIS^ENUTL
S (ENPMN,ENLID,ENSN,ENDTYP,ENDVTYP)="" S:$D(^ENG(6914,DA,3)) ENPMN=$P(^(3),U,6),ENLID=$P(^(3),U,7) S:$D(^ENG(6914,DA,1)) ENSN=$P(^(1),U,3),ENDTYP=$P(^(1),U,1) I ENDTYP]"" S ENDVTYP=$P($G(^ENG(6911,ENDTYP,0)),U)
S ENY=3,ENRT=6914 W @IOF,"Equipment ID #: " D W(DA) W ?40 D W(ENDVTYP) W !,"PM #: " D W(ENPMN)
W ?25,"Local ID: " D W(ENLID) W ?60,"S/N: " D W(ENSN) W !
S X=0,X(0)=^ENG(6914,DA,0),X(3)=$G(^ENG(6914,DA,3))
I $P(X(0),U,5) W ?5,"Lockout Required? " D W("YES") S X=1
I $P(X(3),U,9)="Y" W ?40,"JCAHO Item: " D W("YES") S X=1
I X W ! S ENY=ENY+2
S I=0 F S I=$O(^ENG(6914,DA,4,I)) Q:I'>0 I $D(^ENG(6914,DA,4,I,0)) S ENSH=$P(^(0),U),ENEMP=$P(^(0),U,2),ENSKP=$P(^(0),U,3),ENCRIT=$P(^(0),U,4) S ENMN="" S:$D(^ENG(6914,DA,4,I,1)) ENMN=^(1) D MNTH^ENLIB1,DPM
G EXIT ;End DINV
;
DPM ; Print data from File 6911 or 6914
N ENDA S ENDA=$S(ENRT=6911:ENDTYP,1:DA)
S:ENSH]"" ENSHOP=$P(^DIC(6922,ENSH,0),U) I ENEMP]"",$D(^ENG("EMP",ENEMP)) S ENEMP=$P(^(ENEMP,0),U)
I ENY>(IOSL-10) R !,"Press <RETURN> to continue...",ENX:DTIME G:ENX="^" EXIT W @IOF,$S(ENRT=6911:"Equip Category (cont'd): ",ENRT=6914:"Entry Number (cont'd): ",1:"") D W($S(ENRT=6911:ENDVTYP,ENRT=6914:ENDA,1:"")) W !! S ENY=2
W !,?30 D W(ENSHOP_" SHOP") W !,"Tech: " D W(ENEMP) W ?50,"Starting Month: " D W(ENMNTH) W !,"Skip Months: " D W(ENSKP)
W ?50,"Criticality: " D W(ENCRIT) W !,"Frequency (multiple):" S ENY=ENY+4
S J=0 F S J=$O(@("^ENG("_ENRT_","_ENDA_",4,"_I_",2,"_J_")")) Q:J'>0 S ENSBSCR=$P(@("^ENG("_ENRT_","_ENDA_",4,"_I_",2,"_J_",0)"),U) I ENSBSCR]"" S EN(ENSBSCR)=^(0)
F J="TA","BA","A","S","Q","BM","M","BW","W","N" I $D(EN(J)) D DPM1
K EN W !! S ENY=ENY+2 Q
;
DPM1 I J="N" W !,?3 D W("NONE") S ENY=ENY+1 Q
I $P(EN(J),U,2)]"",$P(EN(J),U,2)'["." S $P(EN(J),U,2)=$P(EN(J),U,2)_".0"
W !,?5 D W($S(J="TA":"TRI-ANNUAL",J="BA":"BI-ANNUAL",J="A":"ANNUAL",J="S":"SEMI-ANNUAL",J="Q":"QUARTERLY",J="BM":"BI-MONTHLY",J="M":"MONTHLY",J="BW":"BI-WEEKLY",J="W":"WEEKLY",1:""))
W ?18 D W($J($P(EN(J),U,2),5,1)) W " hrs "
D W($J("$"_$S($P(EN(J),"^",3)]"":$P(EN(J),"^",3),1:0),6)) W " (est) Level: " D W($S($P(EN(J),"^",4)]"":$P(EN(J),"^",4),1:"N/A")) S ENY=ENY+1
I $P(EN(J),U,5)]"" W !,?5,"Proc Ref: " S ENA=$G(^ENG(6914.2,$P(EN(J),U,5),0)) D W($P(ENA,U)) W " Title: " D W($P(ENA,U,2)) K ENA S ENY=ENY+1
I "^BA^TA^"[(U_J_U) W !,?5,"Starting Year: " D W($P(EN(J),U,6)) S ENY=ENY+1
Q
;
W(ENDATA) ;Bold ENDATA
N X
S X=$X W IOINHI S $X=X W ENDATA
S X=$X W IOINLOW S $X=X
Q
;
EXIT D:'$D(ENNOHLD) HLD
K ENSH,ENSHOP,ENMN,ENMNTH,ENEMP,ENSKP,ENPRTCL,ENSBSCR,ENRT,ENY
K ENLID,ENPMN,ENSN,ENCRIT
Q
;
HLD I $E(IOST,1,2)="C-" R !,"Press <RETURN> to continue...",X:DTIME
Q
;ENEQPMP3
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENEQPMP3 3853 printed Oct 16, 2024@17:53:34 Page 2
ENEQPMP3 ;(WASH ISC)/DH-Display PMI Schedules ;6.5.97
+1 ;;7.0;ENGINEERING;**35,42**;Aug 17, 1993
DDT ; Display Equipment Category PM Data
+1 ; Expects IEN of Equipment Category File as loc var ENDTYP
+2 IF '$DATA(^ENG(6911,ENDTYP,4,0))
WRITE !!,"There is no defined PM schedule for this Equipment Category.",!
DO HLD
QUIT
+3 ;Get BOLD and UNBOLD for CRT
NEW X,IOINLOW,IOINHI,IOINORM
DO ZIS^ENUTL
+4 SET ENY=2
SET ENRT="6911"
SET ENDVTYP=$PIECE(^ENG(6911,ENDTYP,0),U)
WRITE @IOF,"Equipment Category: "
DO W(ENDVTYP)
WRITE !
+5 SET X=^ENG(6911,ENDTYP,0)
SET X(0)=0
+6 IF $PIECE(X,U,2)
WRITE ?5,"Lockout Required?: "
DO W("YES")
SET X(0)=1
+7 IF $PIECE(X,U,3)="Y"
WRITE ?40,"JCAHO Item: "
DO W("YES")
SET X(0)=1
+8 IF X(0)
WRITE !
SET ENY=ENY+2
+9 SET I=0
FOR
SET I=$ORDER(^ENG(6911,ENDTYP,4,I))
if I'>0
QUIT
SET ENSH=$PIECE(^ENG(6911,ENDTYP,4,I,0),"^",1)
SET ENEMP=$PIECE(^(0),"^",2)
SET ENSKP=$PIECE(^(0),"^",3)
SET ENCRIT=$PIECE(^(0),U,4)
SET ENMN=""
if $DATA(^ENG(6911,ENDTYP,4,I,1))
SET ENMN=^(1)
DO MNTH^ENLIB1
DO DPM
+10 ;End DDT
GOTO EXIT
+11 ;
DINV ; Display Equipment Record PM Data
+1 ; Expects IEN of Equipment File as loc var DA
+2 IF '$DATA(^ENG(6914,DA,4))
WRITE !!,"There is no defined PM schedule for this piece of equipment.",!
DO HLD
QUIT
+3 NEW X,IOINLOW,IOINHI,IOINORM
DO ZIS^ENUTL
+4 SET (ENPMN,ENLID,ENSN,ENDTYP,ENDVTYP)=""
if $DATA(^ENG(6914,DA,3))
SET ENPMN=$PIECE(^(3),U,6)
SET ENLID=$PIECE(^(3),U,7)
if $DATA(^ENG(6914,DA,1))
SET ENSN=$PIECE(^(1),U,3)
SET ENDTYP=$PIECE(^(1),U,1)
IF ENDTYP]""
SET ENDVTYP=$PIECE($GET(^ENG(6911,ENDTYP,0)),U)
+5 SET ENY=3
SET ENRT=6914
WRITE @IOF,"Equipment ID #: "
DO W(DA)
WRITE ?40
DO W(ENDVTYP)
WRITE !,"PM #: "
DO W(ENPMN)
+6 WRITE ?25,"Local ID: "
DO W(ENLID)
WRITE ?60,"S/N: "
DO W(ENSN)
WRITE !
+7 SET X=0
SET X(0)=^ENG(6914,DA,0)
SET X(3)=$GET(^ENG(6914,DA,3))
+8 IF $PIECE(X(0),U,5)
WRITE ?5,"Lockout Required? "
DO W("YES")
SET X=1
+9 IF $PIECE(X(3),U,9)="Y"
WRITE ?40,"JCAHO Item: "
DO W("YES")
SET X=1
+10 IF X
WRITE !
SET ENY=ENY+2
+11 SET I=0
FOR
SET I=$ORDER(^ENG(6914,DA,4,I))
if I'>0
QUIT
IF $DATA(^ENG(6914,DA,4,I,0))
SET ENSH=$PIECE(^(0),U)
SET ENEMP=$PIECE(^(0),U,2)
SET ENSKP=$PIECE(^(0),U,3)
SET ENCRIT=$PIECE(^(0),U,4)
SET ENMN=""
if $DATA(^ENG(6914,DA,4,I,1))
SET ENMN=^(1)
DO MNTH^ENLIB1
DO DPM
+12 ;End DINV
GOTO EXIT
+13 ;
DPM ; Print data from File 6911 or 6914
+1 NEW ENDA
SET ENDA=$SELECT(ENRT=6911:ENDTYP,1:DA)
+2 if ENSH]""
SET ENSHOP=$PIECE(^DIC(6922,ENSH,0),U)
IF ENEMP]""
IF $DATA(^ENG("EMP",ENEMP))
SET ENEMP=$PIECE(^(ENEMP,0),U)
+3 IF ENY>(IOSL-10)
READ !,"Press <RETURN> to continue...",ENX:DTIME
if ENX="^"
GOTO EXIT
WRITE @IOF,$SELECT(ENRT=6911:"Equip Category (cont'd): ",ENRT=6914:"Entry Number (cont'd): ",1:"")
DO W($SELECT(ENRT=6911:ENDVTYP,ENRT=6914:ENDA,1:""))
WRITE !!
SET ENY=2
+4 WRITE !,?30
DO W(ENSHOP_" SHOP")
WRITE !,"Tech: "
DO W(ENEMP)
WRITE ?50,"Starting Month: "
DO W(ENMNTH)
WRITE !,"Skip Months: "
DO W(ENSKP)
+5 WRITE ?50,"Criticality: "
DO W(ENCRIT)
WRITE !,"Frequency (multiple):"
SET ENY=ENY+4
+6 SET J=0
FOR
SET J=$ORDER(@("^ENG("_ENRT_","_ENDA_",4,"_I_",2,"_J_")"))
if J'>0
QUIT
SET ENSBSCR=$PIECE(@("^ENG("_ENRT_","_ENDA_",4,"_I_",2,"_J_",0)"),U)
IF ENSBSCR]""
SET EN(ENSBSCR)=^(0)
+7 FOR J="TA","BA","A","S","Q","BM","M","BW","W","N"
IF $DATA(EN(J))
DO DPM1
+8 KILL EN
WRITE !!
SET ENY=ENY+2
QUIT
+9 ;
DPM1 IF J="N"
WRITE !,?3
DO W("NONE")
SET ENY=ENY+1
QUIT
+1 IF $PIECE(EN(J),U,2)]""
IF $PIECE(EN(J),U,2)'["."
SET $PIECE(EN(J),U,2)=$PIECE(EN(J),U,2)_".0"
+2 WRITE !,?5
DO W($SELECT(J="TA":"TRI-ANNUAL",J="BA":"BI-ANNUAL",J="A":"ANNUAL",J="S":"SEMI-ANNUAL",J="Q":"QUARTERLY",J="BM":"BI-MONTHLY",J="M":"MONTHLY",J="BW":"BI-WEEKLY",J="W":"WEEKLY",1:""))
+3 WRITE ?18
DO W($JUSTIFY($PIECE(EN(J),U,2),5,1))
WRITE " hrs "
+4 DO W($JUSTIFY("$"_$SELECT($PIECE(EN(J),"^",3)]"":$PIECE(EN(J),"^",3),1:0),6))
WRITE " (est) Level: "
DO W($SELECT($PIECE(EN(J),"^",4)]"":$PIECE(EN(J),"^",4),1:"N/A"))
SET ENY=ENY+1
+5 IF $PIECE(EN(J),U,5)]""
WRITE !,?5,"Proc Ref: "
SET ENA=$GET(^ENG(6914.2,$PIECE(EN(J),U,5),0))
DO W($PIECE(ENA,U))
WRITE " Title: "
DO W($PIECE(ENA,U,2))
KILL ENA
SET ENY=ENY+1
+6 IF "^BA^TA^"[(U_J_U)
WRITE !,?5,"Starting Year: "
DO W($PIECE(EN(J),U,6))
SET ENY=ENY+1
+7 QUIT
+8 ;
W(ENDATA) ;Bold ENDATA
+1 NEW X
+2 SET X=$X
WRITE IOINHI
SET $X=X
WRITE ENDATA
+3 SET X=$X
WRITE IOINLOW
SET $X=X
+4 QUIT
+5 ;
EXIT if '$DATA(ENNOHLD)
DO HLD
+1 KILL ENSH,ENSHOP,ENMN,ENMNTH,ENEMP,ENSKP,ENPRTCL,ENSBSCR,ENRT,ENY
+2 KILL ENLID,ENPMN,ENSN,ENCRIT
+3 QUIT
+4 ;
HLD IF $EXTRACT(IOST,1,2)="C-"
READ !,"Press <RETURN> to continue...",X:DTIME
+1 QUIT
+2 ;ENEQPMP3