source: FOIAVistA/trunk/r/ENGINEERING-EN/ENTIUTL.m@ 677

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

initial load of FOIAVistA 6/30/08 version

File size: 6.8 KB
Line 
1ENTIUTL ;WOIFO/SAB - Engineering Utilities ;2/14/2008
2 ;;7.0;ENGINEERING;**87**;Aug 17, 1993;Build 16
3 ;
4DISEQ(ENDA) ; Display Equipment
5 N ENCMR,ENLOC,ENMFGR,ENMOD,ENNAM,ENSER,ENSVC
6 ; display equipment data
7 S ENCMR=$$GET1^DIQ(6914,ENDA,19)
8 S ENLOC=$$GET1^DIQ(6914,ENDA,24)
9 S ENSVC=$$GET1^DIQ(6914,ENDA,21)
10 S ENNAM=$$GET1^DIQ(6914,ENDA,3)
11 S ENMFGR=$$GET1^DIQ(6914,ENDA,1)
12 S ENMOD=$$GET1^DIQ(6914,ENDA,4)
13 S ENSER=$$GET1^DIQ(6914,ENDA,5)
14 W !,"Entry #",?12,"CMR",?19,"Location",?41,"Using Service"
15 W !,"---------",?12,"-----",?19,"--------------------"
16 W ?41,"------------------------------"
17 W !,ENDA,?12,ENCMR,?19,ENLOC,?41,ENSVC
18 W !,ENNAM
19 W !!,"Mfgr: ",ENMFGR
20 W !,"Model: ",ENMOD,?39,"Serial #: ",ENSER
21 Q
22 ;
23CAPEQ(ENDA,ENTAG,SITC,END) ; Captioned Equipment Display
24 ; input
25 ; ENDA = equipment ien (file 6914)
26 ; ENTAG = (optional) line tag to call at page break
27 ; this utility expects there to be at least 5 lines to display
28 ; the normal data and will only issue page breaks during the
29 ; IT REMOTE LOCATION or IT COMMENTS output.
30 ; SITC = (optional) flag, true to suppress IT comments from printing
31 ; output
32 ; END = true if user enter "^" or timed-out, passed by reference
33 N ENCMR,ENI,ENITRL,ENLOC,ENLOCS,ENMFGR,ENMOD,ENNAM,ENSER,ENSVC,X
34 S ENTAG=$G(ENTAG,"CAPEQHD^ENTIUTL")
35 S END=$G(END)
36 ; display equipment data
37 S ENCMR=$$GET1^DIQ(6914,ENDA,19)
38 S ENLOC=$$GET1^DIQ(6914,ENDA,24)
39 S ENLOCS=$$GET1^DIQ(6914,ENDA,"24:1.5")
40 S ENSVC=$$GET1^DIQ(6914,ENDA,21)
41 S ENNAM=$$GET1^DIQ(6914,ENDA,3)
42 S ENMFGR=$$GET1^DIQ(6914,ENDA,1)
43 S ENMOD=$$GET1^DIQ(6914,ENDA,4)
44 S ENSER=$$GET1^DIQ(6914,ENDA,5)
45 W !,"Entry #: ",ENDA,?21,"CMR: ",ENCMR,?33,"Using Service: ",ENSVC
46 W !,?2,"Location: ",ENLOC,?34,"Svc of Location: ",ENLOCS
47 W !,?2,"Mfgr Name: ",$E(ENNAM,1,65) W:$E(ENNAM,66,80)]"" "*"
48 W !,?2,"Mfgr: ",ENMFGR
49 W !,?2,"Model: ",ENMOD,?41,"Ser. #: ",ENSER
50 S ENITRL=$$GET1^DIQ(6914,ENDA,91)
51 I ENITRL]"" D Q:END
52 . I $Y+3>IOSL D @ENTAG Q:END D CAPEQHD1
53 . N DIWF,DIWL,DIWR,X
54 . K ^UTILITY($J,"W")
55 . S DIWL=3,DIWR=79,DIWF="W|"
56 . S X="IT Remote Location: " D ^DIWP
57 . S X=ENITRL D ^DIWP
58 . D ^DIWW
59 I '$G(SITC),$O(^ENG(6914,ENDA,"ITC",0)) D
60 . N DIWF,DIWL,DIWR,X
61 . K ^UTILITY($J,"W")
62 . S DIWL=3,DIWR=79,DIWF="W|"
63 . S X="IT Comments: " D ^DIWP
64 . S ENI=0 F S ENI=$O(^ENG(6914,ENDA,"ITC",ENI)) Q:'ENI D Q:END
65 . . I $Y+3>IOSL D @ENTAG Q:END D CAPEQHD1
66 . . S X=$G(^ENG(6914,ENDA,"ITC",ENI,0)) D ^DIWP
67 . I END K ^UTILITY($J,"W") Q
68 . I $Y+3>IOSL D @ENTAG I END K ^UTILITY($J,"W") Q
69 . D ^DIWW
70 Q
71 ;
72CAPEQHD ; Captioned Equipment Display Default Header
73 I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
74 W @IOF
75 Q
76CAPEQHD1 ; Captioned Equipment Display Second Header
77 W "Equipment Entry #: ",ENDA," (continued)"
78 Q
79 ;
80DISASGN(ENDA) ; Display Active Assignments for Equipment to Screen
81 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,ENADA,END,ENSTAT,X,Y
82 ; display assignment data
83 S END=0
84 D DISASGNH
85 I '$D(^ENG(6916.3,"AEA",ENDA)) W !," no active assignments" Q
86 S ENADA=0
87 F S ENADA=$O(^ENG(6916.3,"AEA",ENDA,ENADA)) Q:'ENADA D Q:END
88 . I $Y+4>IOSL D Q:END
89 . . S DIR(0)="E" D ^DIR K DIR I 'Y S END=1 Q
90 . . W @(IOF) D DISASGNH W !," Entry #: ",ENDA," (continued)"
91 . W !,$$GET1^DIQ(6916.3,ENADA,1)
92 . W ?32,$P($$GET1^DIQ(6916.3,ENADA,2),"@")
93 . S ENSTAT=$$GET1^DIQ(6916.3,ENADA,20)
94 . W ?46,ENSTAT
95 . I ENSTAT'="ASSIGNED" W ?57,$$GET1^DIQ(6916.3,ENADA,21)
96 Q
97DISASGNH ; Display Assignments Header
98 W !!,"Responsible Person",?32,"Assigned DT",?46,"Status",?57,"Status DT"
99 W !,"------------------------------",?32,"------------"
100 W ?46,"---------",?57,"------------"
101 Q
102 ;
103BLDHL2(ENSM,ENSMV,ENSRT) ; Build Header Line 2 String for Reports
104 ; input
105 ; ENSM = equipment selection method code
106 ; ENSMV = selection method ien value (for applicable methods)
107 ; ENSRT = sort by code
108 ; returns string for page header second line
109 N ENHL2
110 ;
111 S ENHL2=" for "
112 S:ENSM="A" ENHL2=ENHL2_"All tracked IT equipment"
113 S:ENSM="E" ENHL2=ENHL2_"selected equipment"
114 S:ENSM="C" ENHL2=ENHL2_"CMR: "_$$GET1^DIQ(6914.1,ENSMV,.01)
115 S:ENSM="U" ENHL2=ENHL2_"Using Service: "_$$GET1^DIQ(49,ENSMV,.01)
116 S:ENSM="L" ENHL2=ENHL2_"Location: "_$$GET1^DIQ(6928,ENSMV,.01)
117 S:ENSM="S" ENHL2=ENHL2_"Service of Loc: "_$$GET1^DIQ(49,ENSMV,.01)
118 S ENHL2=ENHL2_" sorted by "
119 S:ENSRT="E" ENHL2=ENHL2_"Entry #"
120 S:ENSRT="C" ENHL2=ENHL2_"CMR"
121 S:ENSRT="U" ENHL2=ENHL2_"Using Service"
122 S:ENSRT="L" ENHL2=ENHL2_"Location"
123 S:ENSRT="S" ENHL2=ENHL2_"Service of Loc."
124 ;
125 Q ENHL2
126 ;
127ADDNP ; Add New Person
128 ; called by option ENIT ADD NEW PERSON
129 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,ENX,X,Y
130 W !!,"This option should only be used to add a person to the NEW PERSON"
131 W !,"(#200) file when that person will be assigned responsibility for"
132 W !,"IT equipment but is not already in the file and will NOT be given"
133 W !,"a user account to sign on the computer.",!
134 ;
135 S DIR(0)="Y"
136 S DIR("A")="Do you want to add an entry to the NEW PERSON file"
137 S DIR("B")="NO"
138 D ^DIR K DIR Q:$D(DIRUT)
139 ;
140 I Y W ! S ENX=$$ADD^XUSERNEW()
141 I $P($G(ENX),U)>0,'$P(ENX,U,3) D
142 . W !!,$P(ENX,U,2)," already exists with internal number ",$P(ENX,U),"."
143 . W !,"If you want to enter a new record with that name, enter the"
144 . W !,"name within quotes (e.g. ""Last,First"")",!
145 Q
146 ;
147USRTRM ;Send MailMan message when user with active assignments is terminated
148 Q:'$D(^ENG(6916.3,"AOA",XUIFN))
149 N ENDA,ENERR,ENI,ENL,ENMFGNM,ENNAME,ENSPACE,ENTX,ENNBR,ENSTATUS,ENDATE,ENX,XMDUZ,XMMG,XMROU,XMSTRIP,XMSUB,XMTEXT,XMY,XMYBLOB,XMZ
150 K ^TMP($J,"ENITUTL") S ENDA=XUIFN,$P(ENSPACE," ",41)=""
151 D FIND^DIC(6916.3,"","@;.01;1;20;21","PQ",ENDA,"","AOA","","","^TMP($J,""ENITUTL"")","ENERR")
152 I $P($G(^TMP($J,"ENITUTL","DILIST",0)),U)'>0 K ^TMP($J,"ENITUTL") Q
153 S ENNAME=$$GET1^DIQ(200,ENDA_",",".01","","","ENERR")
154 S ENTX(1)="Owner: "_ENNAME_" ("_ENDA_")"
155 S ENTX(2)="was terminated while having the following active IT responsibility assignments:"
156 S ENTX(3)=" ",ENTX(4)="Entry#"_$E(ENSPACE,1,6)_"Mfg Equip Name"_$E(ENSPACE,1,11)_"Assignment Status"_$E(ENSPACE,1,3)_"Status Date",ENL=4
157 S ENI=0
158 F S ENI=$O(^TMP($J,"ENITUTL","DILIST",ENI)) Q:+ENI'=ENI D
159 . S ENX=$G(^TMP($J,"ENITUTL","DILIST",ENI,0)) Q:ENX=""
160 . S ENNBR=$P(ENX,U,2),ENSTATUS=$P(ENX,U,4),ENDATE=$P(ENX,U,5)
161 . S ENMFGNM=$E($$GET1^DIQ(6914,ENNBR_",","3","","","ENERR"),1,20)
162 . S ENL=ENL+1,ENTX(ENL)=ENNBR_$E(ENSPACE,$L(ENNBR)+1,12)_ENMFGNM_$E(ENSPACE,$L(ENMFGNM)+1,25)_ENSTATUS_$E(ENSPACE,$L(ENSTATUS)+1,20)_ENDATE
163 S ENL=ENL+1,ENTX(ENL)=" ",ENL=ENL+1,ENTX(ENL)=" Number of Items= "_($P($G(^TMP($J,"ENITUTL","DILIST",0)),U)+0)
164 S ENL=ENL+1,ENTX(ENL)=" ",ENL=ENL+1,ENTX(ENL)="These IT assignments are still active for "_ENNAME_".",ENL=ENL+1,ENTX(ENL)="If appropriate, use the transfer or terminate option to make changes."
165 S XMDUZ="AEMS/MERS",XMSUB="Assigned Equipment of Terminated Owner: "_ENNAME
166 S XMY("G.EN IT EQUIPMENT")="",XMTEXT="ENTX("
167 D ^XMD
168 K ^TMP($J,"ENITUTL")
169 Q
170 ;
171 ;ENITUTL
Note: See TracBrowser for help on using the repository browser.