ENY2USRS ;(WASH CIOFO)/DH-Y2K Utility System Reports ;8.26.98
;;7.0;ENGINEERING;**55**;August 17,1993
EN W @IOF,!,?20,"UTILITY EQUIPMENT SUMMARY REPORT"
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 !! K IO("Q") S %ZIS="QM" D ^%ZIS G:POP EXIT
I $D(IO("Q")) S ZTRTN="SUM^ENY2USRS" D G EXIT
. S ZTDESC="Summary Util Systems Report",ZTIO=ION
. S ZTSAVE("ENSTN")=""
. D ^%ZTLOAD,HOME^%ZIS K ZTSK
;
SUM ; summarization of utility equipment status
N STATION,COUNT,TOTAL,FMLY,COMP,DA,J,K
SUM1 S STATION("PARNT")=$P(^DIC(6910,1,0),U,2),STATION=STATION("PARNT")
F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" F K="TOT","FC","NC","CC" S COUNT(STATION,"SYS",J,K)=0,COUNT(STATION,"COMP",J,K)=0
F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" S TOTAL(STATION,"ECST",J)=0
S DA=0 F S DA=$O(^ENG(6914,"AR","BSE",DA)) Q:'DA I $D(^ENG(6914,DA,0)) D
. I '$D(ZTQUEUED),'(DA#10) W "." ; activity indicator
. Q:"^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U) ; turned in
. 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 J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" F K="TOT","FC","NC","CC" S COUNT(STATION,"SYS",J,K)=0,COUNT(STATION,"COMP",J,K)=0
.. F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" S TOTAL(STATION,"ECST",J)=0
. I $P(^ENG(6914,DA,0),U,3)="" D Q
.. ;component without a parent (may or may not have children)
.. S FMLY=$P($G(^ENG(6914,DA,9)),U,12) I FMLY="" S FMLY=0
.. E S FMLY=$P($G(^ENG(6918.1,FMLY,0)),U) S:FMLY="" FMLY=0
.. S COUNT(STATION,"COMP",FMLY,"TOT")=COUNT(STATION,"COMP",FMLY,"TOT")+1,COMP("SYS")="FC" D
... I "^FC^NA^"[(U_$P($G(^ENG(6914,DA,11)),U)_U) S COUNT(STATION,"COMP",FMLY,"FC")=COUNT(STATION,"COMP",FMLY,"FC")+1 Q
... I $P($G(^ENG(6914,DA,11)),U)="NC" S COUNT(STATION,"COMP",FMLY,"NC")=COUNT(STATION,"COMP",FMLY,"NC")+1,COMP("SYS")="NC",TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$P($G(^ENG(6914,DA,2)),U,3) Q
... I $P($G(^ENG(6914,DA,11)),U)="CC" S COUNT(STATION,"COMP",FMLY,"CC")=COUNT(STATION,"COMP",FMLY,"CC")+1,COMP("SYS")="NC",TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$P($G(^ENG(6914,DA,11)),U,3)
.. Q:'$D(^ENG(6914,"AE",DA)) ;no children
.. D RCRSN(DA,"")
.. S COUNT(STATION,"SYS",FMLY,"TOT")=COUNT(STATION,"SYS",FMLY,"TOT")+1
.. I COMP("SYS")]"" S COUNT(STATION,"SYS",FMLY,COMP("SYS"))=COUNT(STATION,"SYS",FMLY,COMP("SYS"))+1
;
PRNTSUM ; print the summary report
Q:$G(ENY2K("VACO")) ; invoked by national roll-up
U IO
N PAGE,DATE,ESCAPE,UL,ULD
D NOW^%DTC S Y=% X ^DD("DD") S DATE("PRNT")=$P(Y,":",1,2),PAGE=0
S $P(UL,"-",79)="-",$P(ULD,"=",79)="="
S STATION="" F S STATION=$O(COUNT(STATION)) Q:STATION="" D HDRSUM D D HOLD Q:$G(ESCAPE)
. N PRCNT
. S COUNT(STATION,"SYS")=0,COUNT(STATION,"SYS","FC")=0,COUNT(STATION,"SYS","NC")=0 F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" D
.. S COUNT(STATION,"SYS")=COUNT(STATION,"SYS")+COUNT(STATION,"SYS",J,"TOT"),COUNT(STATION,"SYS","FC")=COUNT(STATION,"SYS","FC")+COUNT(STATION,"SYS",J,"FC")
.. S COUNT(STATION,"SYS","NC")=COUNT(STATION,"SYS","NC")+COUNT(STATION,"SYS",J,"NC")
. I 'COUNT(STATION,"SYS") W !!,?20,"<There are no Utility Systems on which to report>"
. E D
.. S PRCNT("COMP")=$P(100*(COUNT(STATION,"SYS","FC")/COUNT(STATION,"SYS"))+.5,".") S:PRCNT("COMP")="" PRCNT("COMP")=0
.. W !!,"There "_$S(COUNT(STATION,"SYS")=1:"is ",1:"are ")_COUNT(STATION,"SYS")_" Utility System"_$S(COUNT(STATION,"SYS")=1:"",1:"s")_" in this data base."
.. W !,?5,COUNT(STATION,"SYS","FC")_" ("_$J(PRCNT("COMP"),3)_" %) are Y2K compliant."
.. W:IOSL>59 !,ULD
.. W !!,?35,"SYSTEM"
.. W !,?22,"System",?40,"FC System",?60,"NC/CC System"
.. W !,"Family",?22,"Count",?42,"Count",?63,"Count"
.. W !,UL
.. F J="ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" W !,J,?19,$J(COUNT(STATION,"SYS",J,"TOT"),8),?39,$J(COUNT(STATION,"SYS",J,"FC"),8),?60,$J(COUNT(STATION,"SYS",J,"NC"),8)
.. W !,"No Family",?19,$J(COUNT(STATION,"SYS",0,"TOT"),8),?39,$J(COUNT(STATION,"SYS",0,"FC"),8),?60,$J(COUNT(STATION,"SYS",0,"NC"),8)
.. W:IOSL>59 !,UL
.. W !,"TOTALS",?19,$J(COUNT(STATION,"SYS"),8),?39,$J(COUNT(STATION,"SYS","FC"),8),?60,$J(COUNT(STATION,"SYS","NC"),8)
. S COUNT(STATION,"COMP")=0,COUNT(STATION,"COMP","FC")=0,COUNT(STATION,"COMP","NC")=0,COUNT(STATION,"COMP","CC")=0,TOTAL(STATION,"ECST")=0
. F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" D
.. S COUNT(STATION,"COMP")=COUNT(STATION,"COMP")+COUNT(STATION,"COMP",J,"TOT"),COUNT(STATION,"COMP","FC")=COUNT(STATION,"COMP","FC")+COUNT(STATION,"COMP",J,"FC")
.. S COUNT(STATION,"COMP","NC")=COUNT(STATION,"COMP","NC")+COUNT(STATION,"COMP",J,"NC"),COUNT(STATION,"COMP","CC")=COUNT(STATION,"COMP","CC")+COUNT(STATION,"COMP",J,"CC"),TOTAL(STATION,"ECST")=TOTAL(STATION,"ECST")+TOTAL(STATION,"ECST",J)
. I 'COUNT(STATION,"COMP") W !!,?20,"<There is no Utility Equipment on which to report>" Q
. I COUNT(STATION,"SYS"),IOSL<60 D HOLD Q:$G(ESCAPE) D HDRSUM
. I IOSL>59 W !!,ULD
. W !,?34,"COMPONENTS"
. W !,?12,"Component",?24,"FC Component",?39,"NC Component",?54,"CC Component",?69,"Est Comp"
. W !,"Family",?14,"Count",?28,"Count",?43,"Count",?58,"Count",?71,"Cost"
. W !,UL
. F J="ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" W !,J,?12,$J(COUNT(STATION,"COMP",J,"TOT"),8),?27,$J(COUNT(STATION,"COMP",J,"FC"),8),?42,$J(COUNT(STATION,"COMP",J,"NC"),8),?57,$J(COUNT(STATION,"COMP",J,"CC"),8) D
.. W ?67,"$",$J($P(TOTAL(STATION,"ECST",J)+.5,"."),9,0)
. W !,"No Family",?12,$J(COUNT(STATION,"COMP",0,"TOT"),8),?27,$J(COUNT(STATION,"COMP",0,"FC"),8),?42,$J(COUNT(STATION,"COMP",0,"NC"),8),?57,$J(COUNT(STATION,"COMP",0,"CC"),8),?67,"$",$J($P(TOTAL(STATION,"ECST",0)+.5,"."),9,0)
. W !,UL
. W !,"TOTALS",?12,$J(COUNT(STATION,"COMP"),8),?27,$J(COUNT(STATION,"COMP","FC"),8),?42,$J(COUNT(STATION,"COMP","NC"),8),?57,$J(COUNT(STATION,"COMP","CC"),8),?67,"$",$J($P(TOTAL(STATION,"ECST")+.5,"."),9,0)
. W !,ULD
G EXIT ; design exit for summary report
;
HDRSUM ; header for summary utility systems report
Q:$G(ESCAPE)
W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1
W "Summary Report on Utility Equipment as of "_DATE("PRNT"),?70,"Page: "_PAGE
W !,$S(ENSTN:"Station: "_STATION,1:"Consolidated ("_STATION("PARNT")_")")
W !,ULD
Q
;
RCRSN(PARNT,PRECRSR) ; build hierarchical system tree
N CHILD
S CHILD=0 F S CHILD=$O(^ENG(6914,"AE",PARNT,CHILD)) Q:'CHILD D
. Q:","_PRECRSR_PARNT_","[(","_CHILD_",") ; would be an endless loop
. Q:"^4^5^"[(U_$P($G(^ENG(6914,CHILD,3)),U)_U) ; ck for turn-ins
. S COUNT(STATION,"COMP",FMLY,"TOT")=COUNT(STATION,"COMP",FMLY,"TOT")+1 D
.. I "^FC^NA^"[(U_$P($G(^ENG(6914,DA,11)),U)_U) S COUNT(STATION,"COMP",FMLY,"FC")=COUNT(STATION,"COMP",FMLY,"FC")+1 Q
.. I $P($G(^ENG(6914,DA,11)),U)="NC" S COUNT(STATION,"COMP",FMLY,"NC")=COUNT(STATION,"COMP",FMLY,"NC")+1,COMP("SYS")="NC",TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$P($G(^ENG(6914,DA,2)),U,3) Q
.. I $P($G(^ENG(6914,DA,11)),U)="CC" S COUNT(STATION,"COMP",FMLY,"CC")=COUNT(STATION,"COMP",FMLY,"CC")+1,COMP("SYS")="NC",TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$P($G(^ENG(6914,DA,11)),U,3) Q
.. ;this component has Y2K category of null
.. S:COMP("SYS")'="NC" COMP("SYS")=""
. I $O(^ENG(6914,"AE",CHILD,0)) D RCRSN(CHILD,PRECRSR_PARNT_",")
Q
;
HOLD Q:$E(IOST,1,2)'="C-"!($G(ESCAPE))
W !!,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
I '$T!($E(X)="^") S ESCAPE=1
Q
;
EXIT K ENSTN
I $D(ZTQUEUED) S ZTREQN="@"
D ^%ZISC,HOME^%ZIS
Q
;ENY2USRS
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HENY2USRS 8224 printed Dec 13, 2024@01:57:37 Page 2
ENY2USRS ;(WASH CIOFO)/DH-Y2K Utility System Reports ;8.26.98
+1 ;;7.0;ENGINEERING;**55**;August 17,1993
EN WRITE @IOF,!,?20,"UTILITY EQUIPMENT SUMMARY REPORT"
+1 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
+2 SET ENSTN=0
+3 IF $PIECE(^DIC(6910,1,0),U,10)!($DATA(^DIC(6910,1,3)))
Begin DoDot:1
+4 WRITE !!
SET DIR(0)="Y"
SET DIR("A")="Do you want a breakout by station"
SET DIR("B")="NO"
+5 SET DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
+6 SET DIR("?")="regardless of which station it belongs to."
+7 DO ^DIR
KILL DIR
IF $DATA(DIRUT)
SET ENSTN="^"
QUIT
+8 SET ENSTN=Y
End DoDot:1
IF ENSTN="^"
KILL ENSTN
QUIT
+9 WRITE !!
KILL IO("Q")
SET %ZIS="QM"
DO ^%ZIS
if POP
GOTO EXIT
+10 IF $DATA(IO("Q"))
SET ZTRTN="SUM^ENY2USRS"
Begin DoDot:1
+11 SET ZTDESC="Summary Util Systems Report"
SET ZTIO=ION
+12 SET ZTSAVE("ENSTN")=""
+13 DO ^%ZTLOAD
DO HOME^%ZIS
KILL ZTSK
End DoDot:1
GOTO EXIT
+14 ;
SUM ; summarization of utility equipment status
+1 NEW STATION,COUNT,TOTAL,FMLY,COMP,DA,J,K
SUM1 SET STATION("PARNT")=$PIECE(^DIC(6910,1,0),U,2)
SET STATION=STATION("PARNT")
+1 FOR J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
FOR K="TOT","FC","NC","CC"
SET COUNT(STATION,"SYS",J,K)=0
SET COUNT(STATION,"COMP",J,K)=0
+2 FOR J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
SET TOTAL(STATION,"ECST",J)=0
+3 SET DA=0
FOR
SET DA=$ORDER(^ENG(6914,"AR","BSE",DA))
if 'DA
QUIT
IF $DATA(^ENG(6914,DA,0))
Begin DoDot:1
+4 ; activity indicator
IF '$DATA(ZTQUEUED)
IF '(DA#10)
WRITE "."
+5 ; turned in
if "^4^5^"[(U_$PIECE($GET(^ENG(6914,DA,3)),U)_U)
QUIT
+6 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
+7 FOR J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
FOR K="TOT","FC","NC","CC"
SET COUNT(STATION,"SYS",J,K)=0
SET COUNT(STATION,"COMP",J,K)=0
+8 FOR J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
SET TOTAL(STATION,"ECST",J)=0
End DoDot:2
+9 IF $PIECE(^ENG(6914,DA,0),U,3)=""
Begin DoDot:2
+10 ;component without a parent (may or may not have children)
+11 SET FMLY=$PIECE($GET(^ENG(6914,DA,9)),U,12)
IF FMLY=""
SET FMLY=0
+12 IF '$TEST
SET FMLY=$PIECE($GET(^ENG(6918.1,FMLY,0)),U)
if FMLY=""
SET FMLY=0
+13 SET COUNT(STATION,"COMP",FMLY,"TOT")=COUNT(STATION,"COMP",FMLY,"TOT")+1
SET COMP("SYS")="FC"
Begin DoDot:3
+14 IF "^FC^NA^"[(U_$PIECE($GET(^ENG(6914,DA,11)),U)_U)
SET COUNT(STATION,"COMP",FMLY,"FC")=COUNT(STATION,"COMP",FMLY,"FC")+1
QUIT
+15 IF $PIECE($GET(^ENG(6914,DA,11)),U)="NC"
SET COUNT(STATION,"COMP",FMLY,"NC")=COUNT(STATION,"COMP",FMLY,"NC")+1
SET COMP("SYS")="NC"
SET TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$PIECE($GET(^ENG(6914,DA,2)),U,3)
QUIT
+16 IF $PIECE($GET(^ENG(6914,DA,11)),U)="CC"
SET COUNT(STATION,"COMP",FMLY,"CC")=COUNT(STATION,"COMP",FMLY,"CC")+1
SET COMP("SYS")="NC"
SET TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$PIECE($GET(^ENG(6914,DA,11)),U,3)
End DoDot:3
+17 ;no children
if '$DATA(^ENG(6914,"AE",DA))
QUIT
+18 DO RCRSN(DA,"")
+19 SET COUNT(STATION,"SYS",FMLY,"TOT")=COUNT(STATION,"SYS",FMLY,"TOT")+1
+20 IF COMP("SYS")]""
SET COUNT(STATION,"SYS",FMLY,COMP("SYS"))=COUNT(STATION,"SYS",FMLY,COMP("SYS"))+1
End DoDot:2
QUIT
End DoDot:1
+21 ;
PRNTSUM ; print the summary report
+1 ; invoked by national roll-up
if $GET(ENY2K("VACO"))
QUIT
+2 USE IO
+3 NEW PAGE,DATE,ESCAPE,UL,ULD
+4 DO NOW^%DTC
SET Y=%
XECUTE ^DD("DD")
SET DATE("PRNT")=$PIECE(Y,":",1,2)
SET PAGE=0
+5 SET $PIECE(UL,"-",79)="-"
SET $PIECE(ULD,"=",79)="="
+6 SET STATION=""
FOR
SET STATION=$ORDER(COUNT(STATION))
if STATION=""
QUIT
DO HDRSUM
Begin DoDot:1
+7 NEW PRCNT
+8 SET COUNT(STATION,"SYS")=0
SET COUNT(STATION,"SYS","FC")=0
SET COUNT(STATION,"SYS","NC")=0
FOR J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
Begin DoDot:2
+9 SET COUNT(STATION,"SYS")=COUNT(STATION,"SYS")+COUNT(STATION,"SYS",J,"TOT")
SET COUNT(STATION,"SYS","FC")=COUNT(STATION,"SYS","FC")+COUNT(STATION,"SYS",J,"FC")
+10 SET COUNT(STATION,"SYS","NC")=COUNT(STATION,"SYS","NC")+COUNT(STATION,"SYS",J,"NC")
End DoDot:2
+11 IF 'COUNT(STATION,"SYS")
WRITE !!,?20,"<There are no Utility Systems on which to report>"
+12 IF '$TEST
Begin DoDot:2
+13 SET PRCNT("COMP")=$PIECE(100*(COUNT(STATION,"SYS","FC")/COUNT(STATION,"SYS"))+.5,".")
if PRCNT("COMP")=""
SET PRCNT("COMP")=0
+14 WRITE !!,"There "_$SELECT(COUNT(STATION,"SYS")=1:"is ",1:"are ")_COUNT(STATION,"SYS")_" Utility System"_$SELECT(COUNT(STATION,"SYS")=1:"",1:"s")_" in this data base."
+15 WRITE !,?5,COUNT(STATION,"SYS","FC")_" ("_$JUSTIFY(PRCNT("COMP"),3)_" %) are Y2K compliant."
+16 if IOSL>59
WRITE !,ULD
+17 WRITE !!,?35,"SYSTEM"
+18 WRITE !,?22,"System",?40,"FC System",?60,"NC/CC System"
+19 WRITE !,"Family",?22,"Count",?42,"Count",?63,"Count"
+20 WRITE !,UL
+21 FOR J="ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
WRITE !,J,?19,$JUSTIFY(COUNT(STATION,"SYS",J,"TOT"),8),?39,$JUSTIFY(COUNT(STATION,"SYS",J,"FC"),8),?60,$JUSTIFY(COUNT(STATION,"SYS",J,"NC"),8)
+22 WRITE !,"No Family",?19,$JUSTIFY(COUNT(STATION,"SYS",0,"TOT"),8),?39,$JUSTIFY(COUNT(STATION,"SYS",0,"FC"),8),?60,$JUSTIFY(COUNT(STATION,"SYS",0,"NC"),8)
+23 if IOSL>59
WRITE !,UL
+24 WRITE !,"TOTALS",?19,$JUSTIFY(COUNT(STATION,"SYS"),8),?39,$JUSTIFY(COUNT(STATION,"SYS","FC"),8),?60,$JUSTIFY(COUNT(STATION,"SYS","NC"),8)
End DoDot:2
+25 SET COUNT(STATION,"COMP")=0
SET COUNT(STATION,"COMP","FC")=0
SET COUNT(STATION,"COMP","NC")=0
SET COUNT(STATION,"COMP","CC")=0
SET TOTAL(STATION,"ECST")=0
+26 FOR J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
Begin DoDot:2
+27 SET COUNT(STATION,"COMP")=COUNT(STATION,"COMP")+COUNT(STATION,"COMP",J,"TOT")
SET COUNT(STATION,"COMP","FC")=COUNT(STATION,"COMP","FC")+COUNT(STATION,"COMP",J,"FC")
+28 SET COUNT(STATION,"COMP","NC")=COUNT(STATION,"COMP","NC")+COUNT(STATION,"COMP",J,"NC")
SET COUNT(STATION,"COMP","CC")=COUNT(STATION,"COMP","CC")+COUNT(STATION,"COMP",J,"CC")
SET TOTAL(STATION,"ECST")=TOTAL(STATION,"ECST")+TOTAL(STATION,"ECST",J)
End DoDot:2
+29 IF 'COUNT(STATION,"COMP")
WRITE !!,?20,"<There is no Utility Equipment on which to report>"
QUIT
+30 IF COUNT(STATION,"SYS")
IF IOSL<60
DO HOLD
if $GET(ESCAPE)
QUIT
DO HDRSUM
+31 IF IOSL>59
WRITE !!,ULD
+32 WRITE !,?34,"COMPONENTS"
+33 WRITE !,?12,"Component",?24,"FC Component",?39,"NC Component",?54,"CC Component",?69,"Est Comp"
+34 WRITE !,"Family",?14,"Count",?28,"Count",?43,"Count",?58,"Count",?71,"Cost"
+35 WRITE !,UL
+36 FOR J="ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER"
WRITE !,J,?12,$JUSTIFY(COUNT(STATION,"COMP",J,"TOT"),8),?27,$JUSTIFY(COUNT(STATION,"COMP",J,"FC"),8),?42,$JUSTIFY(COUNT(STATION,"COMP",J,"NC"),8),?57,$JUSTIFY(COUNT(STATION,"COMP",J,"CC"),8)
Begin DoDot:2
+37 WRITE ?67,"$",$JUSTIFY($PIECE(TOTAL(STATION,"ECST",J)+.5,"."),9,0)
End DoDot:2
+38 WRITE !,"No Family",?12,$JUSTIFY(COUNT(STATION,"COMP",0,"TOT"),8),?27,$JUSTIFY(COUNT(STATION,"COMP",0,"FC"),8),?42,$JUSTIFY(COUNT(STATION,"COMP",0,"NC"),8),?57,$JUSTIFY(COUNT(STATION,"COMP",0,"CC"),8),?67,"$",$JUSTIFY(...
... $PIECE(TOTAL(STATION,"ECST",0)+.5,"."),9,0)
+39 WRITE !,UL
+40 WRITE !,"TOTALS",?12,$JUSTIFY(COUNT(STATION,"COMP"),8),?27,$JUSTIFY(COUNT(STATION,"COMP","FC"),8),?42,$JUSTIFY(COUNT(STATION,"COMP","NC"),8),?57,$JUSTIFY(COUNT(STATION,"COMP","CC"),8),?67,"$",$JUSTIFY($PIECE(TOTAL(STATION,"ECST")+.5,"."
),9,0)
+41 WRITE !,ULD
End DoDot:1
DO HOLD
if $GET(ESCAPE)
QUIT
+42 ; design exit for summary report
GOTO EXIT
+43 ;
HDRSUM ; header for summary utility systems report
+1 if $GET(ESCAPE)
QUIT
+2 if PAGE>0!($EXTRACT(IOST,1,2)="C-")
WRITE @IOF
SET PAGE=PAGE+1
+3 WRITE "Summary Report on Utility Equipment as of "_DATE("PRNT"),?70,"Page: "_PAGE
+4 WRITE !,$SELECT(ENSTN:"Station: "_STATION,1:"Consolidated ("_STATION("PARNT")_")")
+5 WRITE !,ULD
+6 QUIT
+7 ;
RCRSN(PARNT,PRECRSR) ; build hierarchical system tree
+1 NEW CHILD
+2 SET CHILD=0
FOR
SET CHILD=$ORDER(^ENG(6914,"AE",PARNT,CHILD))
if 'CHILD
QUIT
Begin DoDot:1
+3 ; would be an endless loop
if ","_PRECRSR_PARNT_","[(","_CHILD_",")
QUIT
+4 ; ck for turn-ins
if "^4^5^"[(U_$PIECE($GET(^ENG(6914,CHILD,3)),U)_U)
QUIT
+5 SET COUNT(STATION,"COMP",FMLY,"TOT")=COUNT(STATION,"COMP",FMLY,"TOT")+1
Begin DoDot:2
+6 IF "^FC^NA^"[(U_$PIECE($GET(^ENG(6914,DA,11)),U)_U)
SET COUNT(STATION,"COMP",FMLY,"FC")=COUNT(STATION,"COMP",FMLY,"FC")+1
QUIT
+7 IF $PIECE($GET(^ENG(6914,DA,11)),U)="NC"
SET COUNT(STATION,"COMP",FMLY,"NC")=COUNT(STATION,"COMP",FMLY,"NC")+1
SET COMP("SYS")="NC"
SET TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$PIECE($GET(^ENG(6914,DA,2)),U,3)
QUIT
+8 IF $PIECE($GET(^ENG(6914,DA,11)),U)="CC"
SET COUNT(STATION,"COMP",FMLY,"CC")=COUNT(STATION,"COMP",FMLY,"CC")+1
SET COMP("SYS")="NC"
SET TOTAL(STATION,"ECST",FMLY)=TOTAL(STATION,"ECST",FMLY)+$PIECE($GET(^ENG(6914,DA,11)),U,3)
QUIT
+9 ;this component has Y2K category of null
+10 if COMP("SYS")'="NC"
SET COMP("SYS")=""
End DoDot:2
+11 IF $ORDER(^ENG(6914,"AE",CHILD,0))
DO RCRSN(CHILD,PRECRSR_PARNT_",")
End DoDot:1
+12 QUIT
+13 ;
HOLD if $EXTRACT(IOST,1,2)'="C-"!($GET(ESCAPE))
QUIT
+1 WRITE !!,"Press <RETURN> to continue, '^' to escape..."
READ X:DTIME
+2 IF '$TEST!($EXTRACT(X)="^")
SET ESCAPE=1
+3 QUIT
+4 ;
EXIT KILL ENSTN
+1 IF $DATA(ZTQUEUED)
SET ZTREQN="@"
+2 DO ^%ZISC
DO HOME^%ZIS
+3 QUIT
+4 ;ENY2USRS