ENY2REP4 ;:(WIRMFO)/DH-Y2K Cum Report ;8.20.98
;;7.0;ENGINEERING;**51,55**;August 17, 1993
EN W @IOF,!,?18,"CUMULATIVE EFFECTS OF Y2K ACTION TAKEN TO DATE"
W !!,"There are approximately "_$P(^ENG(6914,0),U,4)_" entries in your Equipment file. Inactive entries"
W !,"(USE STATUS of 'TURNED-IN' or 'LOST OR STOLEN') will be automatically excluded",!,"from Y2K consideration (unless they were turned in due to Y2K non-compliance)."
W !!,"Equipment entries without a MANUFACTURER and a MODEL will also be excluded",!,"from Y2K consideration."
I $P($G(^DIC(6910,1,0)),U,2)']"" W !!,"There is no STATION NUMBER in your Engineering Init Paramaters file.",!,"Can't proceed.",*7 Q
S ENSTN=0
I $P(^DIC(6910,1,0),U,10)!($D(^DIC(6910,1,3))) D I ENSTN="^" K ENSTN Q
. W !! S DIR(0)="Y",DIR("A")="Do you want a breakout by station",DIR("B")="NO"
. S DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
. S DIR("?")="regardless of which station it belongs to."
. D ^DIR K DIR I $D(DIRUT) S ENSTN="^" Q
. S ENSTN=Y
W ! S DIR(0)="Y",DIR("A")="Do you want a breakout by FUNCTIONAL CLASSIFICATION",DIR("B")="NO"
S DIR("?",1)="If you say 'NO' you will obtain a single report for all of your equipment,"
S DIR("?",2)="regardless of which FUNCTIONAL CLASSIFICATION ('MED', 'PC', 'FS', or 'TEL')"
S DIR("?")="it happens to be assigned to."
D ^DIR K DIR I $D(DIRUT) K ENSTN Q
S ENCLASS=Y
W !! K IO("Q") S %ZIS="QM" D ^%ZIS G:POP EXIT
I $D(IO("Q")) S ZTRTN="DEQ^ENY2REP4" D G EXIT
. S ZTDESC="Y2K Equipment Cumulative",ZTIO=ION
. S ZTSAVE("EN*")=""
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
;
DEQ ; get the net results to date
K ^TMP($J)
N COUNT,TOTAL,STATION,DA,COST,MONTH,YEAR,CLASS,J,K,L
DEQ1 S STATION("PARNT")=$P(^DIC(6910,1,0),U,2),STATION=STATION("PARNT")
; begin initialization
F K="CON",0,"MED","PC","FS","TEL" F J="ACT","Y2K",0,"FC","NC","CC","NA" S COUNT(STATION,K,J)=0
F K="CON",0,"MED","PC","FS","TEL" F J=0,"REP","SREP","RET","USE" S COUNT(STATION,K,"NC",J)=0
F J="CON",0,"MED","PC","FS","TEL" S COUNT(STATION,J,"NC","ATD")=0
F K="CON",0,"MED","PC","FS","TEL" F J="ETD","ATD","ETOT" S ^TMP($J,STATION,K,"NC",J)=0
F J="CON",0,"MED","PC","FS","TEL" S COUNT(STATION,J,"FC","UPG")=0
F K="CON",0,"MED","PC","FS","TEL" F J="ECST","ACST" S COUNT(STATION,K,"FC",J)=0,^TMP($J,STATION,K,"FC",J)=0
F J="CON",0,"MED","PC","FS","TEL" S ^TMP($J,STATION,J,"CC","ECST")=0
F L="CON",0,"MED","PC","FS","TEL" F J=1998,1999,2000 F K=0:1:12 S COUNT(STATION,L,"CC","UPG",J,K)=0,^TMP($J,STATION,L,"CC","ECST",J,K)=0,COUNT(STATION,L,"NC","SCHDT",J,K)=0,^TMP($J,STATION,L,"NC","ECST",J,K)=0
; begin data collection
DATA S STATION=STATION("PARNT"),CLASS="CON",DA=0 F S DA=$O(^ENG(6914,DA)) Q:'DA D
. Q:'$D(^ENG(6914,DA,0))
. I "^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U),$P($G(^(11)),U)'="NC" Q ;inactive and not Y2K NC
. I '$D(ZTQUEUED),'(DA#100) W "." ; activity indicator
. I ENSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT")) D:'$D(COUNT(STATION))
.. F K="CON",0,"MED","PC","FS","TEL" F J="ACT","Y2K",0,"FC","NC","CC","NA" S COUNT(STATION,K,J)=0
.. F K="CON",0,"MED","PC","FS","TEL" F J=0,"REP","SREP","RET","USE" S COUNT(STATION,K,"NC",J)=0
.. F J="CON",0,"MED","PC","FS","TEL" S COUNT(STATION,J,"NC","ATD")=0
.. F K="CON",0,"MED","PC","FS","TEL" F J="ETD","ATD","ETOT" S ^TMP($J,STATION,K,"NC",J)=0
.. F J="CON",0,"MED","PC","FS","TEL" S COUNT(STATION,J,"FC","UPG")=0
.. F K="CON",0,"MED","PC","FS","TEL" F J="ECST","ACST" S COUNT(STATION,K,"FC",J)=0,^TMP($J,STATION,K,"FC",J)=0
.. F J="CON",0,"MED","PC","FS","TEL" S ^TMP($J,STATION,J,"CC","ECST")=0
.. F L="CON",0,"MED","PC","FS","TEL" F J=1998,1999,2000 F K=0:1:12 S COUNT(STATION,L,"CC","UPG",J,K)=0,^TMP($J,STATION,L,"CC","ECST",J,K)=0,COUNT(STATION,L,"NC","SCHDT",J,K)=0,^TMP($J,STATION,L,"NC","ECST",J,K)=0
. I $G(ENCLASS) S CLASS=$P($G(^ENG(6914,DA,9)),U,11) S:CLASS="" CLASS=0
. S COUNT(STATION,CLASS,"ACT")=COUNT(STATION,CLASS,"ACT")+1
. S EN=$G(^ENG(6914,DA,11)) I $P(EN,U)="" Q:$P($G(^ENG(6914,DA,1)),U,4)="" Q:$P(^(1),U,2)="" ;not deemed a Y2K candidate
. S COUNT(STATION,CLASS,"Y2K")=COUNT(STATION,CLASS,"Y2K")+1
. S ENY2K("CAT")=$P(EN,U) I ENY2K("CAT")="" S COUNT(STATION,CLASS,0)=COUNT(STATION,CLASS,0)+1 Q ;no Y2K info
. S COUNT(STATION,CLASS,ENY2K("CAT"))=COUNT(STATION,CLASS,ENY2K("CAT"))+1
. I ENY2K("CAT")="FC" D Q ;fully compliant
.. I $P(^ENG(6914,DA,11),U,9)]"" D
... S COUNT(STATION,CLASS,"FC","UPG")=COUNT(STATION,CLASS,"FC","UPG")+1
... I $P(EN,U,3)]"" S COUNT(STATION,CLASS,"FC","ECST")=COUNT(STATION,CLASS,"FC","ECST")+1,^TMP($J,STATION,CLASS,"FC","ECST")=^TMP($J,STATION,CLASS,"FC","ECST")+$P(EN,U,3)
... I $P(EN,U,4)]"" S COUNT(STATION,CLASS,"FC","ACST")=COUNT(STATION,CLASS,"FC","ACST")+1,^TMP($J,STATION,CLASS,"FC","ACST")=^TMP($J,STATION,CLASS,"FC","ACST")+$P(EN,U,4)
. ;
. I ENY2K("CAT")="NC" D Q ;non-compliant
.. S ENY2K("ACT")=$P(EN,U,6) S:ENY2K("ACT")="" ENY2K("ACT")=0 S COUNT(STATION,CLASS,"NC",ENY2K("ACT"))=COUNT(STATION,CLASS,"NC",ENY2K("ACT"))+1
.. I ENY2K("ACT")="REP" D
... S COST("E")=$P($G(^ENG(6914,DA,2)),U,3),^TMP($J,STATION,CLASS,"NC","ETOT")=^TMP($J,STATION,CLASS,"NC","ETOT")+COST("E")
... I '$D(^ENG(6914,"AO",DA)) D
.... S MONTH=+$E($P(EN,U,13),4,5),YEAR=$E($P(EN,U,13),1,3)+1700 S:MONTH="" MONTH=0
.... I YEAR>1990 S COUNT(STATION,CLASS,"NC","SCHDT",YEAR,MONTH)=COUNT(STATION,CLASS,"NC","SCHDT",YEAR,MONTH)+1 D
..... S ^TMP($J,STATION,CLASS,"NC","ECST",YEAR,MONTH)=^TMP($J,STATION,CLASS,"NC","ECST",YEAR,MONTH)+COST("E"),COUNT(STATION,CLASS,"NC","SREP")=COUNT(STATION,CLASS,"NC","SREP")+1
... I $D(^ENG(6914,"AO",DA)) D
.... S COUNT(STATION,CLASS,"NC","ATD")=COUNT(STATION,CLASS,"NC","ATD")+1,^TMP($J,STATION,CLASS,"NC","ETD")=^TMP($J,STATION,CLASS,"NC","ETD")+COST("E")
.... S DA(1)=$O(^ENG(6914,"AO",DA,0)) I DA(1) S ^TMP($J,STATION,CLASS,"NC","ATD")=^TMP($J,STATION,CLASS,"NC","ATD")+$P($G(^ENG(6914,DA(1),2)),U,3)
. I ENY2K("CAT")="CC" D ;conditionally compliant
.. S ^TMP($J,STATION,CLASS,"CC","ECST")=^TMP($J,STATION,CLASS,"CC","ECST")+$P(EN,U,3)
.. S MONTH=+$E($P(EN,U,2),4,5),YEAR=$E($P(EN,U,2),1,3)+1700
.. I MONTH>0,YEAR>0 S COUNT(STATION,CLASS,"CC","UPG",YEAR,MONTH)=COUNT(STATION,CLASS,"CC","UPG",YEAR,MONTH)+1,^TMP($J,STATION,CLASS,"CC","ECST",YEAR,MONTH)=^TMP($J,STATION,CLASS,"CC","ECST",YEAR,MONTH)+$P(EN,U,3)
. ; end of data collection
Q:$G(ENY2K("VACO")) ; invoked by national roll-up
D PRT^ENY2REP6 ;print routine
EXIT ;
K ^TMP($J)
K ENSTN,ENCLASS
I $D(ZTQUEUED) S ZTREQN="@"
D ^%ZISC,HOME^%ZIS
Q
;ENY2REP4
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2REP4 6644 printed Dec 13, 2024@01:57:28 Page 2
ENY2REP4 ;:(WIRMFO)/DH-Y2K Cum Report ;8.20.98
+1 ;;7.0;ENGINEERING;**51,55**;August 17, 1993
EN WRITE @IOF,!,?18,"CUMULATIVE EFFECTS OF Y2K ACTION TAKEN TO DATE"
+1 WRITE !!,"There are approximately "_$PIECE(^ENG(6914,0),U,4)_" entries in your Equipment file. Inactive entries"
+2 WRITE !,"(USE STATUS of 'TURNED-IN' or 'LOST OR STOLEN') will be automatically excluded",!,"from Y2K consideration (unless they were turned in due to Y2K non-compliance)."
+3 WRITE !!,"Equipment entries without a MANUFACTURER and a MODEL will also be excluded",!,"from Y2K consideration."
+4 IF $PIECE($GET(^DIC(6910,1,0)),U,2)']""
WRITE !!,"There is no STATION NUMBER in your Engineering Init Paramaters file.",!,"Can't proceed.",*7
QUIT
+5 SET ENSTN=0
+6 IF $PIECE(^DIC(6910,1,0),U,10)!($DATA(^DIC(6910,1,3)))
Begin DoDot:1
+7 WRITE !!
SET DIR(0)="Y"
SET DIR("A")="Do you want a breakout by station"
SET DIR("B")="NO"
+8 SET DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
+9 SET DIR("?")="regardless of which station it belongs to."
+10 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET ENSTN="^"
QUIT
+11 SET ENSTN=Y
End DoDot:1
IF ENSTN="^"
KILL ENSTN
QUIT
+12 WRITE !
SET DIR(0)="Y"
SET DIR("A")="Do you want a breakout by FUNCTIONAL CLASSIFICATION"
SET DIR("B")="NO"
+13 SET DIR("?",1)="If you say 'NO' you will obtain a single report for all of your equipment,"
+14 SET DIR("?",2)="regardless of which FUNCTIONAL CLASSIFICATION ('MED', 'PC', 'FS', or 'TEL')"
+15 SET DIR("?")="it happens to be assigned to."
+16 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
KILL ENSTN
QUIT
+17 SET ENCLASS=Y
+18 WRITE !!
KILL IO("Q")
SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO EXIT
+19 IF $DATA(IO("Q"))
SET ZTRTN="DEQ^ENY2REP4"
Begin DoDot:1
+20 SET ZTDESC="Y2K Equipment Cumulative"
SET ZTIO=ION
+21 SET ZTSAVE("EN*")=""
+22 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO EXIT
+23 ;
DEQ ; get the net results to date
+1 KILL ^TMP($JOB)
+2 NEW COUNT,TOTAL,STATION,DA,COST,MONTH,YEAR,CLASS,J,K,L
DEQ1 SET STATION("PARNT")=$PIECE(^DIC(6910,1,0),U,2)
SET STATION=STATION("PARNT")
+1 ; begin initialization
+2 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J="ACT","Y2K",0,"FC","NC","CC","NA"
SET COUNT(STATION,K,J)=0
+3 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J=0,"REP","SREP","RET","USE"
SET COUNT(STATION,K,"NC",J)=0
+4 FOR J="CON",0,"MED","PC","FS","TEL"
SET COUNT(STATION,J,"NC","ATD")=0
+5 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J="ETD","ATD","ETOT"
SET ^TMP($JOB,STATION,K,"NC",J)=0
+6 FOR J="CON",0,"MED","PC","FS","TEL"
SET COUNT(STATION,J,"FC","UPG")=0
+7 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J="ECST","ACST"
SET COUNT(STATION,K,"FC",J)=0
SET ^TMP($JOB,STATION,K,"FC",J)=0
+8 FOR J="CON",0,"MED","PC","FS","TEL"
SET ^TMP($JOB,STATION,J,"CC","ECST")=0
+9 FOR L="CON",0,"MED","PC","FS","TEL"
FOR J=1998,1999,2000
FOR K=0:1:12
SET COUNT(STATION,L,"CC","UPG",J,K)=0
SET ^TMP($JOB,STATION,L,"CC","ECST",J,K)=0
SET COUNT(STATION,L,"NC","SCHDT",J,K)=0
SET ^TMP($JOB,STATION,L,"NC","ECST",J,K)=0
+10 ; begin data collection
DATA SET STATION=STATION("PARNT")
SET CLASS="CON"
SET DA=0
FOR
SET DA=$ORDER(^ENG(6914,DA))
if 'DA
QUIT
Begin DoDot:1
+1 if '$DATA(^ENG(6914,DA,0))
QUIT
+2 ;inactive and not Y2K NC
IF "^4^5^"[(U_$PIECE($GET(^ENG(6914,DA,3)),U)_U)
IF $PIECE($GET(^(11)),U)'="NC"
QUIT
+3 ; activity indicator
IF '$DATA(ZTQUEUED)
IF '(DA#100)
WRITE "."
+4 IF ENSTN
SET STATION=$SELECT($PIECE($GET(^ENG(6914,DA,9)),U,5)]"":$PIECE(^(9),U,5),1:STATION("PARNT"))
if '$DATA(COUNT(STATION))
Begin DoDot:2
+5 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J="ACT","Y2K",0,"FC","NC","CC","NA"
SET COUNT(STATION,K,J)=0
+6 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J=0,"REP","SREP","RET","USE"
SET COUNT(STATION,K,"NC",J)=0
+7 FOR J="CON",0,"MED","PC","FS","TEL"
SET COUNT(STATION,J,"NC","ATD")=0
+8 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J="ETD","ATD","ETOT"
SET ^TMP($JOB,STATION,K,"NC",J)=0
+9 FOR J="CON",0,"MED","PC","FS","TEL"
SET COUNT(STATION,J,"FC","UPG")=0
+10 FOR K="CON",0,"MED","PC","FS","TEL"
FOR J="ECST","ACST"
SET COUNT(STATION,K,"FC",J)=0
SET ^TMP($JOB,STATION,K,"FC",J)=0
+11 FOR J="CON",0,"MED","PC","FS","TEL"
SET ^TMP($JOB,STATION,J,"CC","ECST")=0
+12 FOR L="CON",0,"MED","PC","FS","TEL"
FOR J=1998,1999,2000
FOR K=0:1:12
SET COUNT(STATION,L,"CC","UPG",J,K)=0
SET ^TMP($JOB,STATION,L,"CC","ECST",J,K)=0
SET COUNT(STATION,L,"NC","SCHDT",J,K)=0
SET ^TMP($JOB,STATION,L,"NC","ECST",J,K)=0
End DoDot:2
+13 IF $GET(ENCLASS)
SET CLASS=$PIECE($GET(^ENG(6914,DA,9)),U,11)
if CLASS=""
SET CLASS=0
+14 SET COUNT(STATION,CLASS,"ACT")=COUNT(STATION,CLASS,"ACT")+1
+15 ;not deemed a Y2K candidate
SET EN=$GET(^ENG(6914,DA,11))
IF $PIECE(EN,U)=""
if $PIECE($GET(^ENG(6914,DA,1)),U,4)=""
QUIT
if $PIECE(^(1),U,2)=""
QUIT
+16 SET COUNT(STATION,CLASS,"Y2K")=COUNT(STATION,CLASS,"Y2K")+1
+17 ;no Y2K info
SET ENY2K("CAT")=$PIECE(EN,U)
IF ENY2K("CAT")=""
SET COUNT(STATION,CLASS,0)=COUNT(STATION,CLASS,0)+1
QUIT
+18 SET COUNT(STATION,CLASS,ENY2K("CAT"))=COUNT(STATION,CLASS,ENY2K("CAT"))+1
+19 ;fully compliant
IF ENY2K("CAT")="FC"
Begin DoDot:2
+20 IF $PIECE(^ENG(6914,DA,11),U,9)]""
Begin DoDot:3
+21 SET COUNT(STATION,CLASS,"FC","UPG")=COUNT(STATION,CLASS,"FC","UPG")+1
+22 IF $PIECE(EN,U,3)]""
SET COUNT(STATION,CLASS,"FC","ECST")=COUNT(STATION,CLASS,"FC","ECST")+1
SET ^TMP($JOB,STATION,CLASS,"FC","ECST")=^TMP($JOB,STATION,CLASS,"FC","ECST")+$PIECE(EN,U,3)
+23 IF $PIECE(EN,U,4)]""
SET COUNT(STATION,CLASS,"FC","ACST")=COUNT(STATION,CLASS,"FC","ACST")+1
SET ^TMP($JOB,STATION,CLASS,"FC","ACST")=^TMP($JOB,STATION,CLASS,"FC","ACST")+$PIECE(EN,U,4)
End DoDot:3
End DoDot:2
QUIT
+24 ;
+25 ;non-compliant
IF ENY2K("CAT")="NC"
Begin DoDot:2
+26 SET ENY2K("ACT")=$PIECE(EN,U,6)
if ENY2K("ACT")=""
SET ENY2K("ACT")=0
SET COUNT(STATION,CLASS,"NC",ENY2K("ACT"))=COUNT(STATION,CLASS,"NC",ENY2K("ACT"))+1
+27 IF ENY2K("ACT")="REP"
Begin DoDot:3
+28 SET COST("E")=$PIECE($GET(^ENG(6914,DA,2)),U,3)
SET ^TMP($JOB,STATION,CLASS,"NC","ETOT")=^TMP($JOB,STATION,CLASS,"NC","ETOT")+COST("E")
+29 IF '$DATA(^ENG(6914,"AO",DA))
Begin DoDot:4
+30 SET MONTH=+$EXTRACT($PIECE(EN,U,13),4,5)
SET YEAR=$EXTRACT($PIECE(EN,U,13),1,3)+1700
if MONTH=""
SET MONTH=0
+31 IF YEAR>1990
SET COUNT(STATION,CLASS,"NC","SCHDT",YEAR,MONTH)=COUNT(STATION,CLASS,"NC","SCHDT",YEAR,MONTH)+1
Begin DoDot:5
+32 SET ^TMP($JOB,STATION,CLASS,"NC","ECST",YEAR,MONTH)=^TMP($JOB,STATION,CLASS,"NC","ECST",YEAR,MONTH)+COST("E")
SET COUNT(STATION,CLASS,"NC","SREP")=COUNT(STATION,CLASS,"NC","SREP")+1
End DoDot:5
End DoDot:4
+33 IF $DATA(^ENG(6914,"AO",DA))
Begin DoDot:4
+34 SET COUNT(STATION,CLASS,"NC","ATD")=COUNT(STATION,CLASS,"NC","ATD")+1
SET ^TMP($JOB,STATION,CLASS,"NC","ETD")=^TMP($JOB,STATION,CLASS,"NC","ETD")+COST("E")
+35 SET DA(1)=$ORDER(^ENG(6914,"AO",DA,0))
IF DA(1)
SET ^TMP($JOB,STATION,CLASS,"NC","ATD")=^TMP($JOB,STATION,CLASS,"NC","ATD")+$PIECE($GET(^ENG(6914,DA(1),2)),U,3)
End DoDot:4
End DoDot:3
End DoDot:2
QUIT
+36 ;conditionally compliant
IF ENY2K("CAT")="CC"
Begin DoDot:2
+37 SET ^TMP($JOB,STATION,CLASS,"CC","ECST")=^TMP($JOB,STATION,CLASS,"CC","ECST")+$PIECE(EN,U,3)
+38 SET MONTH=+$EXTRACT($PIECE(EN,U,2),4,5)
SET YEAR=$EXTRACT($PIECE(EN,U,2),1,3)+1700
+39 IF MONTH>0
IF YEAR>0
SET COUNT(STATION,CLASS,"CC","UPG",YEAR,MONTH)=COUNT(STATION,CLASS,"CC","UPG",YEAR,MONTH)+1
SET ^TMP($JOB,STATION,CLASS,"CC","ECST",YEAR,MONTH)=^TMP($JOB,STATION,CLASS,"CC","ECST",YEAR,MONTH)+$PIECE(EN,U,3)
End DoDot:2
+40 ; end of data collection
End DoDot:1
+41 ; invoked by national roll-up
if $GET(ENY2K("VACO"))
QUIT
+42 ;print routine
DO PRT^ENY2REP6
EXIT ;
+1 KILL ^TMP($JOB)
+2 KILL ENSTN,ENCLASS
+3 IF $DATA(ZTQUEUED)
SET ZTREQN="@"
+4 DO ^%ZISC
DO HOME^%ZIS
+5 QUIT
+6 ;ENY2REP4