source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENY2USRS.m@ 767

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

initial load of WorldVistAEHR

File size: 7.9 KB
Line 
1ENY2USRS ;(WASH CIOFO)/DH-Y2K Utility System Reports ;8.26.98
2 ;;7.0;ENGINEERING;**55**;August 17,1993
3EN W @IOF,!,?20,"UTILITY EQUIPMENT SUMMARY REPORT"
4 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
5 S ENSTN=0
6 I $P(^DIC(6910,1,0),U,10)!($D(^DIC(6910,1,3))) D I ENSTN="^" K ENSTN Q
7 . W !! S DIR(0)="Y",DIR("A")="Do you want a breakout by station",DIR("B")="NO"
8 . S DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
9 . S DIR("?")="regardless of which station it belongs to."
10 . D ^DIR K DIR I $D(DIRUT) S ENSTN="^" Q
11 . S ENSTN=Y
12 W !! K IO("Q") S %ZIS="QM" D ^%ZIS G:POP EXIT
13 I $D(IO("Q")) S ZTRTN="SUM^ENY2USRS" D G EXIT
14 . S ZTDESC="Summary Util Systems Report",ZTIO=ION
15 . S ZTSAVE("ENSTN")=""
16 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
17 ;
18SUM ; summarization of utility equipment status
19 N STATION,COUNT,TOTAL,FMLY,COMP,DA,J,K
20SUM1 S STATION("PARNT")=$P(^DIC(6910,1,0),U,2),STATION=STATION("PARNT")
21 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
22 F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" S TOTAL(STATION,"ECST",J)=0
23 S DA=0 F S DA=$O(^ENG(6914,"AR","BSE",DA)) Q:'DA I $D(^ENG(6914,DA,0)) D
24 . I '$D(ZTQUEUED),'(DA#10) W "." ; activity indicator
25 . Q:"^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U) ; turned in
26 . I ENSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT")) D:'$D(COUNT(STATION))
27 .. 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
28 .. F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" S TOTAL(STATION,"ECST",J)=0
29 . I $P(^ENG(6914,DA,0),U,3)="" D Q
30 .. ;component without a parent (may or may not have children)
31 .. S FMLY=$P($G(^ENG(6914,DA,9)),U,12) I FMLY="" S FMLY=0
32 .. E S FMLY=$P($G(^ENG(6918.1,FMLY,0)),U) S:FMLY="" FMLY=0
33 .. S COUNT(STATION,"COMP",FMLY,"TOT")=COUNT(STATION,"COMP",FMLY,"TOT")+1,COMP("SYS")="FC" D
34 ... 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
35 ... 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
36 ... 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)
37 .. Q:'$D(^ENG(6914,"AE",DA)) ;no children
38 .. D RCRSN(DA,"")
39 .. S COUNT(STATION,"SYS",FMLY,"TOT")=COUNT(STATION,"SYS",FMLY,"TOT")+1
40 .. I COMP("SYS")]"" S COUNT(STATION,"SYS",FMLY,COMP("SYS"))=COUNT(STATION,"SYS",FMLY,COMP("SYS"))+1
41 ;
42PRNTSUM ; print the summary report
43 Q:$G(ENY2K("VACO")) ; invoked by national roll-up
44 U IO
45 N PAGE,DATE,ESCAPE,UL,ULD
46 D NOW^%DTC S Y=% X ^DD("DD") S DATE("PRNT")=$P(Y,":",1,2),PAGE=0
47 S $P(UL,"-",79)="-",$P(ULD,"=",79)="="
48 S STATION="" F S STATION=$O(COUNT(STATION)) Q:STATION="" D HDRSUM D D HOLD Q:$G(ESCAPE)
49 . N PRCNT
50 . 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
51 .. 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")
52 .. S COUNT(STATION,"SYS","NC")=COUNT(STATION,"SYS","NC")+COUNT(STATION,"SYS",J,"NC")
53 . I 'COUNT(STATION,"SYS") W !!,?20,"<There are no Utility Systems on which to report>"
54 . E D
55 .. S PRCNT("COMP")=$P(100*(COUNT(STATION,"SYS","FC")/COUNT(STATION,"SYS"))+.5,".") S:PRCNT("COMP")="" PRCNT("COMP")=0
56 .. 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."
57 .. W !,?5,COUNT(STATION,"SYS","FC")_" ("_$J(PRCNT("COMP"),3)_" %) are Y2K compliant."
58 .. W:IOSL>59 !,ULD
59 .. W !!,?35,"SYSTEM"
60 .. W !,?22,"System",?40,"FC System",?60,"NC/CC System"
61 .. W !,"Family",?22,"Count",?42,"Count",?63,"Count"
62 .. W !,UL
63 .. 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)
64 .. 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)
65 .. W:IOSL>59 !,UL
66 .. W !,"TOTALS",?19,$J(COUNT(STATION,"SYS"),8),?39,$J(COUNT(STATION,"SYS","FC"),8),?60,$J(COUNT(STATION,"SYS","NC"),8)
67 . S COUNT(STATION,"COMP")=0,COUNT(STATION,"COMP","FC")=0,COUNT(STATION,"COMP","NC")=0,COUNT(STATION,"COMP","CC")=0,TOTAL(STATION,"ECST")=0
68 . F J=0,"ALARM","COMM","ELECT","ENVRN","FIRE","OTHER","SCRTY","TRANS","WATER" D
69 .. 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")
70 .. 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)
71 . I 'COUNT(STATION,"COMP") W !!,?20,"<There is no Utility Equipment on which to report>" Q
72 . I COUNT(STATION,"SYS"),IOSL<60 D HOLD Q:$G(ESCAPE) D HDRSUM
73 . I IOSL>59 W !!,ULD
74 . W !,?34,"COMPONENTS"
75 . W !,?12,"Component",?24,"FC Component",?39,"NC Component",?54,"CC Component",?69,"Est Comp"
76 . W !,"Family",?14,"Count",?28,"Count",?43,"Count",?58,"Count",?71,"Cost"
77 . W !,UL
78 . 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
79 .. W ?67,"$",$J($P(TOTAL(STATION,"ECST",J)+.5,"."),9,0)
80 . 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)
81 . W !,UL
82 . 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)
83 . W !,ULD
84 G EXIT ; design exit for summary report
85 ;
86HDRSUM ; header for summary utility systems report
87 Q:$G(ESCAPE)
88 W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1
89 W "Summary Report on Utility Equipment as of "_DATE("PRNT"),?70,"Page: "_PAGE
90 W !,$S(ENSTN:"Station: "_STATION,1:"Consolidated ("_STATION("PARNT")_")")
91 W !,ULD
92 Q
93 ;
94RCRSN(PARNT,PRECRSR) ; build hierarchical system tree
95 N CHILD
96 S CHILD=0 F S CHILD=$O(^ENG(6914,"AE",PARNT,CHILD)) Q:'CHILD D
97 . Q:","_PRECRSR_PARNT_","[(","_CHILD_",") ; would be an endless loop
98 . Q:"^4^5^"[(U_$P($G(^ENG(6914,CHILD,3)),U)_U) ; ck for turn-ins
99 . S COUNT(STATION,"COMP",FMLY,"TOT")=COUNT(STATION,"COMP",FMLY,"TOT")+1 D
100 .. 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
101 .. 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
102 .. 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
103 .. ;this component has Y2K category of null
104 .. S:COMP("SYS")'="NC" COMP("SYS")=""
105 . I $O(^ENG(6914,"AE",CHILD,0)) D RCRSN(CHILD,PRECRSR_PARNT_",")
106 Q
107 ;
108HOLD Q:$E(IOST,1,2)'="C-"!($G(ESCAPE))
109 W !!,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
110 I '$T!($E(X)="^") S ESCAPE=1
111 Q
112 ;
113EXIT K ENSTN
114 I $D(ZTQUEUED) S ZTREQN="@"
115 D ^%ZISC,HOME^%ZIS
116 Q
117 ;ENY2USRS
Note: See TracBrowser for help on using the repository browser.