source: FOIAVistA/trunk/r/ENGINEERING-EN/ENEQLT2.m@ 813

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

initial load of FOIAVistA 6/30/08 version

File size: 5.7 KB
Line 
1ENEQLT2 ;(WIRMFO)/DH-LOCKOUT FLAG REPORTS ;4.9.97
2 ;;7.0;ENGINEERING;**35**;Aug 17, 1993
3 ;==================================================================
4PRTEC ; Print equipment categories with 'LOCKOUT REQUIRED?' field
5 ; set to 'YES'.
6 ;
7 K IO("Q") S %ZIS="QM" D ^%ZIS Q:POP
8 I $D(IO("Q")) S ZTRTN="DQEC^ENEQLT2" D G EXIT
9 . S ZTDESC="LOCKOUT flag by Equipment Category"
10 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
11DQEC N DATE,CAT,DA,COUNT,PAGE,LINE,ESCAPE,X S (CAT,DA,PAGE)=0
12 K ^TMP($J) D NOW^%DTC S Y=% X ^DD("DD") S DATE=$P(Y,":")_":"_$P(Y,":",2)
13 D TABS
14 F S CAT=$O(^ENG(6911,"AC",1,CAT)) Q:'CAT D
15 . S COUNT=0 F S DA=$O(^ENG(6914,"G",CAT,DA)) Q:'DA S COUNT=COUNT+1
16 . S ^TMP($J,CAT)=COUNT
17PRTEC1 ; Physical printing of EQUIPMENT CATEGORIES
18 U IO D HDREC I '$D(^TMP($J)) W !,?5,"No EQUIPMENT CATEGORIES have 'LOCKOUT REQUIRED?' Flag SET"
19 S CAT=0 F S CAT=$O(^TMP($J,CAT)) Q:'CAT D
20 . W !,?5,$$GET1^DIQ(6911,CAT,.01)_" ("_^TMP($J,CAT)_" Equipment Records)"
21 . S LINE=LINE+1
22 . I LINE>(IOSL-3),$O(^TMP($J,CAT)) D HOLD,HDREC
23 D HOLD,EXIT
24 Q ;Design EXIT POINT
25 ;
26HDREC ; Header for EQUIPMENT CATEGORY List
27 W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1,LINE=3,$X=0
28 W "EQUIPMENT CATEGORIES with 'LOCKOUT REQUIRED?' Flag set to 'YES'"
29 W ?(IOM-7),"Page "_PAGE,!,DATE
30 K X S $P(X,"-",IOM-1)="-" W !,X,!
31 Q
32 ;======================================================================
33 ;
34PRTER ; Print Equipment Records with 'LOCKOUT REQUIRED?' flag set to 'YES'
35 ; Sortable by EQUIPMENT CATEGORY
36 ;
37 S DIR(0)="Y",DIR("A")="Sort Report by EQUIPMENT CATEGORY",DIR("B")="YES"
38 D ^DIR K DIR Q:$D(DIRUT) S ENSORT=Y
39 K IO("Q") S %ZIS="QM" D ^%ZIS Q:POP
40 I $D(IO("Q")) S ZTRTN="DQER^ENEQLT2" D G EXIT
41 . S ZTDESC="'LOCKOUT REQUIRED?' Flag by Equipment Record"
42 . S ZTLOAD("ENSORT")=""
43 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
44DQER N DATE,PAGE,LINE,CAT,ESCAPE,DA,X,T S (PAGE,CAT,ESCAPE,DA)=0
45 D NOW^%DTC S Y=% X ^DD("DD") S DATE=$P(Y,":")_":"_$P(Y,":",2)
46 U IO D TABS
47 I '$D(^ENG(6914,"AJ",1)) D HDRER W !,?5,"No Equipment Records have 'LOCKOUT REQUIRED?' Flag set to 'YES'." D HOLD G EXIT
48 ;
49 ; Sort by EQUIPMENT CATEGORY
50 I ENSORT K ^TMP($J) D D:'ESCAPE HOLD G EXIT ;Design EXIT POINT
51 . F S DA=$O(^ENG(6914,"AJ",1,DA)) Q:'DA D
52 .. S CAT("I")=$P($G(^ENG(6914,DA,1)),U)
53 .. I CAT("I")'>0 S CAT("E")=0
54 .. E S CAT("E")=$P($G(^ENG(6911,CAT("I"),0)),U) S:CAT("E")="" CAT("E")=0
55 .. S ^TMP($J,CAT("E"),DA)=""
56 . D HDRER F S CAT=$O(^TMP($J,CAT)) Q:CAT=""!(ESCAPE) S DA=0 F S DA=$O(^TMP($J,CAT,DA)) Q:'DA!(ESCAPE) D
57 .. D PRTDAT
58 .. I LINE>(IOSL-4),($O(^TMP($J,CAT,DA))!($O(^TMP($J,CAT)))) D HOLD Q:ESCAPE D HDRER
59 ;
60 ; No sort by EQUIPMENT CATEGORY
61 D HDRER F S DA=$O(^ENG(6914,"AJ",1,DA)) Q:'DA!(ESCAPE) D
62 . D PRTDAT
63 . I LINE>(IOSL-4),$O(^ENG(6914,"AJ",1,DA)) D HOLD Q:ESCAPE D HDRER
64 D:'ESCAPE HOLD
65 G EXIT ;Design EXIT POINT
66 ;
67HDRER ; Header for Equipment Records
68 W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1,LINE=5,$X=0
69 W "EQUIPMENT with 'LOCKOUT REQUIRED?' Flag 'SET' "_DATE,?(IOM-8),"Page "_PAGE
70 W !,"ENTRY #",?T(1),"Equipment Category",?T(2),"Manufacturer Equipment Name",?T(3),"Location"
71 W !,?T(11),"Manufacturer",?T(12),"Model",?T(13),"Serial Number"
72 K X S $P(X,"-",(IOM-1))="-" W !,X,!
73 Q
74 ;
75 ;======================================================================
76 ;
77PRTEX ; Print Equipment Records for which 'LOCKOUT REQUIRED?' Flag is CLEAR
78 ; while their EQUIPMENT CATEGORY 'LOCKOUT REQUIRED?' Flag is SET
79 K IO("Q") S %ZIS="QM" D ^%ZIS Q:POP
80 I $D(IO("Q")) S ZTRTN="DQEX^ENEQLT2" D G EXIT
81 . S ZTDESC="'LOCKOUT REQUIRED?' Exception List"
82 . D ^%ZTLOAD,HOME^%ZIS K ZTSK
83DQEX N DATE,PAGE,LINE,ESCAPE,CAT,DA,X,T S (PAGE,ESCAPE,CAT)=0
84 D NOW^%DTC S Y=% X ^DD("DD") S DATE=$P(Y,":")_":"_$P(Y,":",2)
85 U IO D TABS
86 I '$D(^ENG(6911,"AC",1)) D HDREX W !!,?10,"There are no EQUIPMENT CATEGORIES with",!,?10,"'LOCKOUT REQUIRED?' Flag SET." D HOLD G EXIT
87 F S CAT=$O(^ENG(6911,"AC",1,CAT)) Q:'CAT S DA=0 F S DA=$O(^ENG(6914,"G",CAT,DA)) Q:'DA I '$D(^ENG(6914,"AJ",1,DA)) S ^TMP($J,DA)=""
88 I '$D(^TMP($J)) D HDREX W !!,?10,"There are no exceptions to report." D HOLD G EXIT
89 D HDREX S DA=0 F S DA=$O(^TMP($J,DA)) Q:'DA!(ESCAPE) D
90 . D PRTDAT
91 . I LINE>(IOSL-4),$O(^TMP($J,DA)) D HOLD Q:ESCAPE D HDREX
92 D:'ESCAPE HOLD
93 G EXIT ;Design EXIT POINT
94 ;
95HDREX ; Header for 'LOCKOUT REQUIRED?' Exception List
96 W:PAGE>0!($E(IOST,1,2)="C-") @IOF S PAGE=PAGE+1,LINE=6,$X=0
97 W "'LOCKOUT REQUIRED?' Flag Exception List "_DATE,?(IOM-8),"Page ",PAGE
98 W !,"(Flag is CLEAR for these ENTRIES, but their EQUIPMENT CATEGORY Flag is SET)"
99 W !,"ENTRY #",?T(1),"Equipment Category",?T(2),"Manufacturer Equipment Name",?T(3),"Location"
100 W !,?T(11),"Manufacturer",?T(12),"Model",?T(13),"Serial Nummber"
101 K X S $P(X,"-",(IOM-1))="-" W !,X,!
102 Q
103 ;==================================================================
104 ;
105PRTDAT ; Get and print equipment data
106 S X(1)=$$GET1^DIQ(6914,DA,6),X(2)=$$GET1^DIQ(6914,DA,3)
107 S X(3)=$$GET1^DIQ(6914,DA,24),X(4)=$$GET1^DIQ(6914,DA,1)
108 S X(5)=$$GET1^DIQ(6914,DA,4),X(6)=$$GET1^DIQ(6914,DA,5)
109 I T(13)=59 D
110 . S X(1)=$E(X(1),1,20),X(2)=$E(X(2),1,30),X(4)=$E(X(4),1,32)
111 . S X(5)=$E(X(5),1,21)
112 . I $L(X(6))>21 S X(6)=$E(X(6),1,20)_"*"
113 I T(13)=66 S X(1)=$E(X(1),1,30),X(2)=$E(X(2),1,36),X(4)=$E(X(4),1,32)
114 I T(13)=94 S X(4)=$E(X(4),1,60)
115 W !,DA,?T(1),X(1),?T(2),X(2),?T(3),X(3)
116 W !,?T(11),X(4),?T(12),X(5),?T(13),X(6)
117 S LINE=LINE+2
118 Q
119 ;
120TABS ; Store tabs in local array T
121 I IOM<96 S T(1)=12,T(2)=33,T(3)=64,T(11)=4,T(12)=37,T(13)=59
122 I IOM>95,IOM<128 S T(1)=12,T(2)=43,T(3)=80,T(11)=2,T(12)=35,T(13)=66
123 I IOM>127 S T(1)=12,T(2)=43,T(3)=112,T(11)=2,T(12)=63,T(13)=94
124 Q
125 ;
126HOLD Q:$E(IOST,1,2)'="C-"
127 W !!,"Press <RETURN> to continue, '^' to escape..." R X:DTIME
128 S:$E(X)="^" ESCAPE=1
129 Q
130 ;
131EXIT K ^TMP($J) D ^%ZISC
132 I $D(ZTQUEUED) S ZTREQ="@"
133 K ENSORT
134 ;ENEQLT2
Note: See TracBrowser for help on using the repository browser.