source: FOIAVistA/tag/r/ENGINEERING-EN/ENTIRRE.m@ 1694

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

initial load of FOIAVistA 6/30/08 version

File size: 3.3 KB
Line 
1ENTIRRE ;WOIFO/SAB - IT Equipment Report ;2/4/2008
2 ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
3 ;
4 N ENIA,ENKTMP,ENSM,ENSMV,ENSRT,ENX
5 ;
6 ; ask equipment selection method
7 S ENX=$$ASKEQSM^ENTIUTL2("AECULS")
8 S ENSM=$P(ENX,U),ENSMV=$P(ENX,U,2)
9 Q:"^A^E^C^U^L^S^"'[(U_ENSM_U)
10 ;
11 ; ask sort
12 S ENSRT=$$ASKEQSRT^ENTIUTL2(ENSM)
13 Q:ENSRT="" ; user time-out or '^'
14 ;
15 S ENIA=1 ; include equipment with active assignments
16 ;
17 ; if method is E then obtain list of equipment
18 I ENSM="E" D GETEQ^ENTIUTL2(ENSM,ENSMV,ENSRT,ENIA)
19 ;
20 S ENKTMP=1 ; flag to kill TMP global
21 ;
22AEN ; entry point from ENTIRA routine (with it's list of equipment in ^TMP)
23 N ENBFMT
24 ;
25 ; ask format
26 S DIR(0)="Y"
27 S DIR("A")="Do you want the brief display format"
28 S DIR("B")="YES"
29 D ^DIR K DIR G:$D(DIRUT) EXIT
30 S ENBFMT=Y
31 ;
32 ; ask device
33 S %ZIS="Q" D ^%ZIS G:POP EXIT
34 I $D(IO("Q")) D G EXIT
35 . N ENY
36 . S ZTRTN="QEN^ENTIRRE",ZTDESC="IT Equipment Report"
37 . F ENY="ENSM","ENSMV","ENIA","ENSRT","ENBFMT","ENKTMP" S ZTSAVE(ENY)=""
38 . S ZTSAVE("^TMP($J,""ENITEQ"",")=""
39 . D ^%ZTLOAD,HOME^%ZIS K ZTSK,IO("Q")
40 ;
41QEN ; queued entry
42 U IO
43 ;
44 ; generate output
45 K ENT S ENT=0
46 S (END,ENPG)=0 D NOW^%DTC S Y=% D DD^%DT S ENDT=Y
47 ;
48 ; build header line 2 string
49 S ENHL2=$$BLDHL2^ENTIUTL(ENSM,ENSMV,ENSRT)
50 ;
51 D HD
52 ;
53 ; if sorted equipment list is not already built then build it
54 I '$D(^TMP($J,"ENITEQ")) D GETEQ^ENTIUTL2(ENSM,ENSMV,ENSRT,ENIA)
55 ;
56 ; print equipment
57 ; loop thru sort value
58 S ENSRTV=""
59 F S ENSRTV=$O(^TMP($J,"ENITEQ",ENSRTV)) Q:ENSRTV="" D Q:END
60 . ; loop thru equipment
61 . S ENDA=0
62 . F S ENDA=$O(^TMP($J,"ENITEQ",ENSRTV,ENDA)) Q:'ENDA D Q:END
63 . . S ENT=ENT+1
64 . . ; display equipment data
65 . . I $Y+$S(ENBFMT:5,1:8)>IOSL D HD Q:END
66 . . I ENBFMT D
67 . . . S ENCMR=$$GET1^DIQ(6914,ENDA,19)
68 . . . S ENLOC=$$GET1^DIQ(6914,ENDA,24)
69 . . . S ENSVC=$$GET1^DIQ(6914,ENDA,21)
70 . . . S ENNAM=$$GET1^DIQ(6914,ENDA,3)
71 . . . W !,ENDA,?12,ENCMR,?19,ENLOC,?41,ENSVC
72 . . . W !,?2,$E(ENNAM,1,78)
73 . . E D CAPEQ^ENTIUTL(ENDA,"HD^ENTIRRE",,.END) Q:END
74 . . ; display assignments
75 . . D DISASGN(ENDA)
76 . . W !
77 ;
78 I 'END D
79 . ; report footer
80 . I $Y+4>IOSL D HD Q:END
81 . W !!,"Count of IT equipment items on report = ",ENT
82 . I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
83 ;
84 D ^%ZISC
85 ;
86EXIT I $D(ZTQUEUED) S ZTREQ="@"
87 I $G(ENKTMP) K ^TMP($J,"ENITEQ")
88 K DIR,DIROUT,DIRUT,DIWF,DIWL,DTOUT,DUOUT,POP,X,Y
89 K ENCMR,ENDA,ENHL2,ENKTMP,ENLOC,ENNAM,ENNSP,ENSM,ENSMV
90 K ENSRT,ENSRTV,ENSVC,ENT,END,ENDT,ENPG
91 Q
92 ;
93HD ; header
94 I $E(IOST,1,2)="C-",ENPG S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
95 I $E(IOST,1,2)="C-"!ENPG W @IOF
96 S ENPG=ENPG+1
97 W "IT EQUIPMENT REPORT",?48,ENDT,?72,"page ",ENPG
98 W !,ENHL2,!
99 I ENBFMT D
100 . W !,"Entry #",?12,"CMR",?19,"Location",?41,"Using Service"
101 . W !,"---------",?12,"-----",?19,"--------------------"
102 . W ?41,"------------------------------"
103 Q
104 ;
105DISASGN(ENDA) ; Display Active Assignments for Equipment
106 ; check page
107 ; display assignment data
108 N ENADA,ENSTAT
109 S ENADA=0 F S ENADA=$O(^ENG(6916.3,"AEA",ENDA,ENADA)) Q:'ENADA D
110 . I $Y+4>IOSL D HD Q:END W !,"Entry #: ",ENDA," (continued)"
111 . W !," Assign: "
112 . W $$FMTE^XLFDT($$GET1^DIQ(6916.3,ENADA,2,"I"),"2DZ")
113 . W ?20,$$GET1^DIQ(6916.3,ENADA,1)
114 . S ENSTAT=$$GET1^DIQ(6916.3,ENADA,20)
115 . W ?52,"Status: ",ENSTAT
116 . I ENSTAT'="ASSIGNED" W ?71,$$GET1^DIQ(6916.3,ENADA,21)
117 Q
118 ;
119 ;ENTIRRE
Note: See TracBrowser for help on using the repository browser.