source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENY2USRD.m@ 1361

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

initial load of WorldVistAEHR

File size: 6.2 KB
RevLine 
[613]1ENY2USRD ;(WASH CIOFO)/DH-Y2K Utility System Reports ;8.27.98
2 ;;7.0;ENGINEERING;**55**;August 17,1993
3EN W @IOF,!,?20,"UTILITY EQUIPMENT DETAILED 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 DIR(0)="SM^CAT:Equipment Category;MFGR:Manufacturer Equipment Name",DIR("A")="Select an IDENTIFIER",DIR("B")="CAT"
6 S DIR("?",1)="The first 15 characters of whichever field you select as your IDENTIFIER"
7 S DIR("?",2)="will be printed with system components in order to help you know what you're"
8 S DIR("?")="looking at. Please choose whichever field is likely to be most helpful."
9 D ^DIR K DIR I $D(DIRUT) G EXIT
10 S ENIDENT=Y
11 S ENSTN=0
12 I $P(^DIC(6910,1,0),U,10)!($D(^DIC(6910,1,3))) D I ENSTN="^" K ENIDENT Q
13 . W !! S DIR(0)="Y",DIR("A")="Do you want a breakout by station",DIR("B")="NO"
14 . S DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
15 . S DIR("?")="regardless of which station it belongs to."
16 . D ^DIR K DIR I $D(DIRUT) S ENSTN="^" Q
17 . S ENSTN=Y
18 W !! K IO("Q") S %ZIS="QM" D ^%ZIS G:POP EXIT
19 I $D(IO("Q")) S ZTRTN="DET^ENY2USRD" D G EXIT
20 . S ZTDESC="Detailed Util Systems Report",ZTIO=ION
21 . S ZTSAVE("ENIDENT")="",ZTSAVE("ENSTN")=""
22 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
23 ;
24DET ; detailed report of utility system status
25 ; first collect all top level components in ^TMP($J,STATION,IEN)
26 ; then add children IENs as additional subscripts
27 K ^TMP($J)
28 N STATION,TYPE,DA,UTIL,NDX,FMLY,X,J
29 S STATION("PARNT")=$P(^DIC(6910,1,0),U,2),STATION=STATION("PARNT")
30 S J=0 F S J=$O(^ENG(6918.1,J)) Q:'J S UTIL(J)=$P(^ENG(6918.1,J,0),U)
31 S DA=0 F S DA=$O(^ENG(6914,"AR","BSE",DA)) Q:'DA I $D(^ENG(6914,DA,0)) D
32 . I '$D(ZTQUEUED),'(DA#100) W "." ; activity indicator
33 . Q:$P(^ENG(6914,DA,0),U,3) ; don't count children
34 . Q:"^4^5^"[(U_$P($G(^ENG(6914,DA,3)),U)_U) ; ck for turn-ins
35 . I ENSTN S STATION=$S($P($G(^ENG(6914,DA,9)),U,5)]"":$P(^(9),U,5),1:STATION("PARNT"))
36 . S FMLY="AAA",X=$P($G(^ENG(6914,DA,9)),U,12) I X,$D(UTIL(X)) S FMLY=UTIL(X)
37 . S ^TMP($J,STATION,FMLY,DA)=""
38 ; now round up the children
39 S STATION="" F S STATION=$O(^TMP($J,STATION)) Q:STATION="" S FMLY="" F S FMLY=$O(^TMP($J,STATION,FMLY)) Q:FMLY="" S DA=0 F S DA=$O(^TMP($J,STATION,FMLY,DA)) Q:'DA D
40 . I '$D(^ENG(6914,"AE",DA)) Q ; simple system
41 . D GETCHLD(DA,"") ; complex system
42 ;
43DETPRNT ; print detailed utility system hierarchy
44 U IO
45 N PAGE,DATE,ESCAPE,NODE,Y2K,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=""
49 F S STATION=$O(^TMP($J,STATION)) Q:STATION="" D:PAGE HOLD D HDRDET S FMLY="" F S FMLY=$O(^TMP($J,STATION,FMLY)) Q:FMLY="" S DA=0 D
50 . F S DA=$O(^TMP($J,STATION,FMLY,DA)) Q:'DA Q:$G(ESCAPE) S Y2K=1 D
51 .. I STATION?.N S NODE="^TMP("_$J_","_STATION_","""_FMLY_""","_DA_")"
52 .. E S NODE="^TMP("_$J_","""_STATION_""","""_FMLY_""","_DA_")"
53 .. F D Q:$QS(NODE,1)'=$J Q:$QS(NODE,4)'=DA Q:$G(ESCAPE)
54 ... I (IOSL-$Y)'>5 D HOLD Q:$G(ESCAPE) D HDRDET
55 ... N IDENT,SYSTEM,LEVEL,COMP
56 ... S IDENT="" I ENIDENT="CAT" S IDENT(0)=$P($G(^ENG(6914,DA,1)),U) I IDENT(0) S IDENT=$E($P($G(^ENG(6911,IDENT(0),0)),U),1,15)
57 ... I ENIDENT="MFGR" S IDENT=$E($P(^ENG(6914,DA,0),U,2),1,15)
58 ... I $QL(NODE)=4 D Q ; top level
59 .... W !!!,DA,?12,IDENT
60 .... I @NODE W " ("_@NODE_" comp.)"
61 .... S Y2K(DA)=$S($P($G(^ENG(6914,DA,11)),U)]"":$P(^(11),U),1:"Null") W " Y2K: ",Y2K(DA) I "^FC^NA^"'[(U_Y2K(DA)_U) S Y2K=0
62 .... W ?60,$S(FMLY'="AAA":FMLY,1:"NONE")
63 .... S NODE=$Q(@NODE) I NODE]"",$QS(NODE,1)=$J,$QL(NODE)=4 W !!,"This Utility Component is " W:'Y2K "NOT " W "Y2K Compliant.",!,UL Q
64 .... I NODE]"",$QS(NODE,1)'=$J W !!,"This Utility Component is " W:'Y2K "NOT " W "Y2K compliant.",!,UL Q
65 .... I NODE="" W !!,"This Utility Component is " W:'Y2K "NOT " W "Y2K compliant.",!,UL
66 ... F D S NODE=$Q(@NODE) Q:NODE="" Q:$QS(NODE,1)'=$J Q:$QS(NODE,4)'=DA Q:$G(ESCAPE)
67 .... S LEVEL=$QL(NODE),DA(LEVEL)=$QS(NODE,LEVEL)
68 .... S IDENT="" I ENIDENT="CAT" S IDENT(0)=$P($G(^ENG(6914,DA(LEVEL),1)),U) I IDENT(0) S IDENT=$E($P($G(^ENG(6911,IDENT(0),0)),U),1,15)
69 .... I ENIDENT="MFGR" S IDENT=$E($P(^ENG(6914,DA(LEVEL),0),U,2),1,15)
70 .... S Y2K(DA(LEVEL))=$S($P($G(^ENG(6914,DA(LEVEL),11)),U)]"":$P(^(11),U),1:"Null") I "^FC^NA^"'[(U_Y2K(DA(LEVEL))_U) S Y2K=0
71 .... W !,?((LEVEL-3)*12),DA(LEVEL),?((LEVEL-2)*12),IDENT
72 .... I @NODE>0 W " ("_@NODE_" comp.)"
73 .... W " Y2K: ",Y2K(DA(LEVEL))
74 .... I (IOSL-$Y)'>5 D HOLD Q:$G(ESCAPE) D HDRDET
75 ... Q:$G(ESCAPE) W !!,"This Utility System is " W:'Y2K "NOT " W "Y2K compliant.",!,UL Q:NODE="" Q:$QS(NODE,1)'=$J Q:$QS(NODE,2)'=STATION
76 D HOLD G EXIT ; design exit for detailed report
77 ;
78HDRDET ; header for detailed utility systems report
79 Q:$G(ESCAPE)
80 W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1
81 W "Detailed Report of Utility Systems as of "_DATE("PRNT"),?70,"Page: "_PAGE
82 W !,$S(ENSTN:"Station: "_STATION,1:"Consolidated ("_STATION("PARNT")_")")
83 W !,"System Entry Number",?60,"System Family"
84 W !,ULD
85 Q
86 ;
87HOLD Q:$E(IOST,1,2)'="C-"!($G(ESCAPE))
88 W !!,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
89 I '$T!($E(X)="^") S ESCAPE=1
90 Q
91 ;
92GETCHLD(PARNT,PRECRSR) ; Get All Components Under Parent System PARNT
93 ;Input
94 ; PARNT - ien of parent system (e.g. 1024)
95 ; PRECRSR - ien list of parent system precursors (e.g.: 150,7019)
96 ;Output
97 ; ^TMP($J,STATION,FMLY,parent ien)=# of components
98 ; ^TMP($J,STATION,FMLY,parent ien,component ien,sub-component ien...)=""
99 N CHILD,COUNT
100 ; init component counter
101 S COUNT=0
102 ; loop thru components of parent system PARNT
103 S CHILD=0 F S CHILD=$O(^ENG(6914,"AE",PARNT,CHILD)) Q:'CHILD D
104 . ; check for endless loop
105 . I ","_PRECRSR_PARNT_","[(","_CHILD_",") D Q
106 . . W !,"ERROR - ENDLESS LOOP DETECTED - SKIPPING ENTRY"
107 . . W !," Entry #",CHILD," already is a parent in "_PARNT_","
108 . Q:"^4^5^"[(U_$P($G(^ENG(6914,CHILD,3)),U)_U) ; ck for turn-ins
109 . ; save component
110 . S @("^TMP($J,STATION,FMLY,"_PRECRSR_PARNT_","_CHILD_")")="",COUNT=COUNT+1
111 . ; if component has components then get them also
112 . I $O(^ENG(6914,"AE",CHILD,0)) D GETCHLD(CHILD,PRECRSR_PARNT_",")
113 ; save parent system component count
114 S @("^TMP($J,STATION,FMLY,"_PRECRSR_PARNT_")")=COUNT
115 Q
116 ;
117EXIT K ENSTN,ENIDENT
118 K ^TMP($J)
119 I $D(ZTQUEUED) S ZTREQN="@"
120 D ^%ZISC,HOME^%ZIS
121 Q
122 ;ENY2USRD
Note: See TracBrowser for help on using the repository browser.