source: WorldVistAEHR/trunk/r/ENGINEERING-EN/ENY2REP3.m@ 1270

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

initial load of WorldVistAEHR

File size: 5.0 KB
Line 
1ENY2REP3 ;;(WIRMFO)/DH-Y2K Detail by Man~Mod ;1.19.99
2 ;;7.0;ENGINEERING;**51,55,61**;August 17, 1993
3 ;
4DET ; detailed snapshot of Y2K data base by manufacturer~model
5 ; list can include all items or a user specified subset
6 W @IOF,!!,?15,"** DETAILED REPORT OF Y2K EQUIPMENT DATA BASE **"
7 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
8 N ALLSTN,ENSUP,CRITER,ESCAPE,ENY2K,DATE,CAT,CSN,CMR,SRVC,MFG,LOC,END,SHOP,SORT
9 S ALLSTN=0
10 I $P(^DIC(6910,1,0),U,1)!($D(^DIC(6910,1,3))) D Q:ALLSTN="^"
11 . W !! S DIR(0)="Y",DIR("A")="Do you want a breakout by station",DIR("B")="NO"
12 . S DIR("?",1)="If you say 'NO' you will obtain a single report for all your equipment,"
13 . S DIR("?")="regardless of which station it belongs to."
14 . D ^DIR K DIR I $D(DIRUT) S ALLSTN="^" Q
15 . S ALLSTN=Y
16 Q:ALLSTN=U
17 W !! S DIR(0)="YA",DIR("A")="Shall we ignore equipment records with no Y2K issues? ",DIR("B")="YES"
18 S DIR("?",1)="Enter YES if you do not wish the counts to include equipment records for"
19 S DIR("?")="which the Y2K CATEGORY is 'FC' or 'NA'."
20 D ^DIR K DIR Q:$D(DIRUT)
21 S ENSUP=Y
22 W !!,"Shall we ignore equipment entries for which either the MANUFACTURER or the" S DIR("A")="MODEL field is null"
23 S DIR(0)="Y",DIR("B")="YES"
24 S DIR("?",1)="Line items on a Detailed Y2K Report that do not contain both a MANUFACTURER"
25 S DIR("?",2)="and a MODEL may be of limited value. Enter 'YES' at this point if you wish"
26 S DIR("?")="to suppress them."
27 D ^DIR K DIR Q:$D(DIRUT)
28 S ENY2K("INC")='Y
29 W !! S DIR(0)="SM^1:EQUIPMENT CATEGORY;2:CATEGORY STOCK NUMBER;3:CMR;4:SERVICE;5:MANUFACTURER;6:LOCAL ID;7:RESPONSIBLE SHOP;8:ENTIRE FILE"
30 S DIR("A")="How should Equipment Records be selected",DIR("B")="EQUIPMENT CATEGORY"
31 S DIR("?",1)="Unless you choose ENTIRE FILE, the system will look only at those equipment"
32 S DIR("?")="records that match your selection criteria."
33 D ^DIR K DIR Q:$D(DIRUT)
34 S CRITER=Y
35 I CRITER=1 N CAT D CAT1^ENY2K Q:$G(ESCAPE) S SORT=CAT G DEV
36 I CRITER=2 N CSN D CSN1^ENY2K Q:$G(ESCAPE) S SORT=CSN G DEV
37 I CRITER=3 N CMR D CMR Q:$G(ESCAPE) S SORT=CMR G DEV
38 I CRITER=4 N SRVC D SRVC Q:$G(ESCAPE) S SORT=SRVC G DEV
39 I CRITER=5 N MFG D MFG1^ENY2K Q:$G(ESCAPE) S SORT=MFG G DEV
40 I CRITER=6 N LOC,END D LOC1^ENY2K9 Q:$G(ESCAPE) S SORT=LOC_"=>"_END G DEV
41 I CRITER=7 N SHOP D SHOP Q:$G(ESCAPE) S SORT=SHOP G DEV
42 I CRITER=8 D S SORT="ENTIRE FILE" G DEV
43 . S DA=0 F S DA=$O(^ENG(6914,DA)) Q:'DA W:'(DA#200) "." I $D(^(DA,0)),"^4^5^"'[(U_$P($G(^(3)),U)_U) S ^TMP($J,DA)=""
44 Q ;error condition
45 ;
46CMR K ^TMP($J)
47 S DIC="^ENG(6914.1,",DIC(0)="AEQM" D ^DIC I Y'>0 S ESCAPE=1 Q
48 S CMR=$P(Y,U,2),CMR(0)=$P(Y,U)
49 S (COUNT,DA)=0 F S DA=$O(^ENG(6914,"AD",CMR(0),DA)) Q:'DA I $D(^ENG(6914,DA,0)),"^4^5^"'[(U_$P($G(^(3)),U)_U) S COUNT=COUNT+1,^TMP($J,DA)=""
50 I 'COUNT W !!,"There are no active equipment records in CMR "_CMR_"." G CMR
51 W !!,"There are "_COUNT_" active equipment records in CMR "_CMR_".",!,"Do you wish to proceed?"
52 S DIR(0)="Y",DIR("B")="YES"
53 D ^DIR K DIR I $D(DIRUT) S ESCAPE=1 Q
54 S ENY2K("CONT")=Y I 'ENY2K("CONT") G CMR
55 Q
56 ;
57SRVC K ^TMP($J)
58 S DIC="^DIC(49,",DIC(0)="AEQM" D ^DIC I Y'>0 S ESCAPE=1 Q
59 S SRVC=$P(Y,U,2),SRVC(0)=$P(Y,U)
60 S (COUNT,DA)=0 F S DA=$O(^ENG(6914,"AC",SRVC(0),DA)) Q:'DA I $D(^ENG(6914,DA,0)),"^4^5^"'[(U_$P($G(^(3)),U)_U) S COUNT=COUNT+1,^TMP($J,DA)=""
61 I 'COUNT W !!,"There are no active equipment entries assigned to "_SRVC_"." G SRVC
62 W !!,"There are "_COUNT_" active equipment entries assigned to "_SRVC_".","Do you wish to proceed?"
63 S DIR(0)="Y",DIR("B")="YES"
64 D ^DIR K DIR I $D(DIRUT) S ESCAPE=1 Q
65 S ENY2K("CONT")=Y I 'ENY2K("CONT") G SRVC
66 Q
67 ;
68SHOP K ^TMP($J)
69 S DIC="^DIC(6922,",DIC(0)="AEQM" D ^DIC I Y'>0 S ESCAPE=1 Q
70 S SHOP=$P(Y,U,2),SHOP(0)=$P(Y,U)
71 S (COUNT,DA)=0 F S DA=$O(^ENG(6914,DA)) Q:'DA W:'(DA#100) "." I $D(^(0)),$P($G(^(11)),U,7)=SHOP(0),"^4^5^"'[(U_$P($G(^(3)),U)_U) S COUNT=COUNT+1,^TMP($J,DA)=""
72 S DA=0 F S DA=$O(^ENG(6914,"AB",SHOP(0),DA)) Q:'DA I $D(^ENG(6914,DA,0)),"^4^5^"'[(U_$P($G(^(3)),U)_U) S COUNT=COUNT+1,^TMP($J,DA)=""
73 I 'COUNT W !!,"There are no equipment entries assigned to "_SHOP_"." G SHOP
74 W !!,"There are "_COUNT_" equipment entries assigned to "_SHOP_".",!,"Do you wish to continue?"
75 S DIR(0)="Y",DIR("B")="YES"
76 D ^DIR K DIR I $D(DIRUT) S ESCAPE=1 Q
77 S ENY2K("CONT")=Y I 'ENY2K("CONT") G SHOP
78 Q
79 ;
80DEV W !! K IO("Q") S %ZIS="QM" D ^%ZIS G:POP EXIT
81 I IOM<130 W !,"Sorry, but this report requires at least 130 columns.",*7 G DEV
82 I $D(IO("Q")) S ZTRTN="DEQDET^ENY2REP3" D G EXIT
83 . S ZTDESC="Y2K Equipment Snapshot",ZTIO=ION
84 . S ZTSAVE("ALLSTN")="",ZTSAVE("ENSUP")="",ZTSAVE("CRITER")=""
85 . D NOW^%DTC S DATE=%,ZTSAVE("DATE")="",ZTSAVE("SORT")=""
86 . S %X="^TMP($J,",%Y="^XUTL(""ENY2"",DATE," D %XY^%RCR
87 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
88 ;
89DEQDET ;
90 D DEQDET^ENY2REPC
91 G EXIT
92 ;
93HOLD Q:$E(IOST,1,2)'="C-"!($G(ESCAPE))
94 W !!,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
95 I '$T!($E(X)="^") S ESCAPE=1
96 Q
97EXIT ;
98 K ^TMP($J)
99 I '$D(ZTQUEUED) D ^%ZISC,HOME^%ZIS
100 I $D(ZTQUEUED) K ALLSTN,ENSUP,CRITER,SORT S ZTREQN="@"
101 K J,K,X
102 Q
103 ;ENY2REP3
Note: See TracBrowser for help on using the repository browser.