source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LR334PO.m@ 1679

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

initial load of FOIAVistA 6/30/08 version

File size: 7.9 KB
Line 
1LR334PO ;DALOI/FHS/RSH - LR*5.2*334 PATCH POST INSTALL ROUTINE;31-AUG-2001
2 ;;5.2;LAB SERVICE;**334**;Sep 27, 1994;Build 12
3PRE ;
4 ;$$HTE^XLFDT supported by DBIA #10103
5 ;$$HTFE^XLFDT supported by DBIA #10103
6 ;$$NOW^XLFDT supported by DBIA #10103
7 ;$$CJ^XLFSTR supported by DBIA #10104
8 ;^XMD supported by DBIA #10070
9 ;$$PATCH^XPDUTL supported by DBIA #10141
10 ;BMES^XPDUTL supported by DBIA #10141
11 ;SETUP^XQALERT supported by DBIA $10081
12 ;FILE^DIE supported by DBIA #10018
13 ;GETS^DIQ supported by DBIA #2056
14 ;EN^DIU2 supported by DBIA #10014
15 ;$$SITE^VASITE supported by DBIA #10112
16 ;$$FMTE^XLFDT supported by DBIA #10103
17 ;$$THE^XLFDT supported by DBIA #10103
18 ;$$HTFM^XLFDT supported by DBIA #10103
19 Q:'$D(XPDNM)
20VENDOR ;Save the vender pointer name into the VENDOR field.
21 N LRI,LRVEN
22 S LRI=0 F S LRI=$O(^LAB(64.2,LRI)) Q:LRI<1 S LRVEN=$P($G(^(LRI,0)),U,14) I LRVEN D
23 . S LRVEN=$P($G(^LAB(64.3,+LRVEN,0)),U)
24 . I $L(LRVEN) S $P(^LAB(64.2,LRI,2),U,2)=LRVEN
25 I '$D(^XTMP("LRNLT642")) D
26 . N LRLAST
27 . S LRLAST=$O(^LAB(64.2,99999),-1)
28 . S ^XTMP("LRNLT642",.01)=LRLAST
29 . S ^XTMP("LRNLT642",0)=$$HTFM^XLFDT($H+90,1)_"^"_DT_"^ LAB(64.2 Save"
30 . M ^XTMP("LRNLT642",1)=^LAB(64.2)
31 Q
32EN1 ;Find and correct existing spelling or duplicate numbers errors.
33 N DA,DIC,DIK,DIU,X,Y,DIRUT,DTOUT,DUOUT
34REINDEX ;Reindex LAM to fire new x-refs
35 L +^LAM:999 I '$T G EN1
36 D
37 . N DIK
38 . S DIK="^LAM(" D IXALL^DIK
39 . S $P(^LAM(0),U,3)=99999
40 K ^XTMP("LRNLTERR","LR334") S ^XTMP("LRNLTERR",0)=$$HTFM^XLFDT($H+90,1)_"^"_DT_"^LR52 334 Error Messages"
41 K ^XTMP("LRNLT","LR334")
42 S ^XTMP("LRNLT",0)=$$HTFM^XLFDT($H+90,1)_"^"_DT_"^LR52 334 Messages"
43 N DA,DIK,LRIEN,LRN0,LRN1,LRFILE
44 D POST,ALERT^LR334POA
45 Q
46 ;
47CHK N DIC,X,Y
48 K LRFDA,LRANS,LRNAMX,LRNUMX,LRNAMY,LRNUMY
49 S DIC(0)="ZNMO",(LRNAMX,LRNAMY,X)=$P(LRN0,U)
50 I $G(LRFILE)=64 D
51 . S DIC=64,(LRNUMY,LRNUMX)=$P(LRN0,U,2)
52 . S DIC("S")="I $P(^(0),U,2)=LRNUMX"
53 . D ^DIC I Y<1 D DEL Q
54 . W:$G(LRDBUG) !,Y_" ( "_LRFILE
55 . S LRIENS=+Y_","
56 . I $L($P(LRN0,U,8)) D
57 . . S LRNAMY=$P(LRN0,U,8)
58 . . S LRFDA(LRFILE,LRIENS,.01)=LRNAMY
59 . I $P(LRN0,U,3) D
60 . . S LRNUMY=$P(LRN0,U,3)
61 . . Q:$O(^LAM("C",LRNUMY_" ",0))
62 . . S LRFDA(LRFILE,LRIENS,1)=LRNUMY
63 I $G(LRFILE)=64.2 D
64 . N DIC
65 . S (LRNAMX,LRNAMY,X)=$P(LRN0,U)
66 . S DIC=64.2,LRNUMX=$P(LRN1,U,2)
67 . S DIC("S")="I $P(^(0),U,2)=LRNUMX"
68 . D ^DIC I Y<1 D DEL Q
69 . S LRIENS=+Y_","
70 . I $L($P(LRN0,U,8)) D
71 . . S LRNAMY=$P(LRN0,U,8)
72 . . S LRFDA(LRFILE,LRIENS,.01)=LRNAMY
73 . I $P(LRN1,U,3) D
74 . . S LRNUMY=$P(LRN1,U,3)
75 . . S LRFDA(LRFILE,LRIENS,1)=LRNUMY
76 . I $L($P(LRN1,U,7)) D
77 . . S LRSYN=$P(LRN1,U,7),LRSYNIEN=$O(^LAB(64.2,+LRIENS,1,"B",LRSYN,0))
78 . . Q:'LRSYNIEN
79 . . S LRFDA(64.23,LRSYNIEN_","_LRIENS,.01)="@"
80 . W:$G(LRDBUG) !,Y_" ( "_LRFILE
81 I $D(LRFDA) D SET
82 Q
83SET ;
84 D FILE^DIE("KS","LRFDA","LRANS")
85 I '$D(LRANS) W:$G(LRDBUG) !,"Okay" D Q
86 . D WRT,DEL
87 Q ; EDIT ERRORS are left in ^LAB(64.81)
88 ;
89DEL ;
90 N DA,DIK
91 S DA=LRIEN,DIK="^LAB(64.81," D ^DIK
92 Q
93ERR ;
94 W !,LRIEN_" ( "_LRFILE_" ERROR"
95 Q
96WRT ;
97 D SCR(LRNUMX_" "_LRNAMX)
98 D SCR("Was changed to: "_LRNUMY_" "_LRNAMY)
99 Q
100POST ;TRANSPORT FILE 64.81 INTO FILE 64 IF REQUIRED
101 N LRREC,LRREC9
102 K ^XTMP("LRNLT","LR334") D
103 . S ^XTMP("LRNLT",0)=$$HTFM^XLFDT($H+90,1)_U_DT_U_"LR334 Added NLT Codes List"
104 . S ^XTMP("LRNLT","LR334",0)=""
105 ;D DSS W !
106P1 F L +^LAM:10 Q:$T D BMES^LR334("Attempting to Lock ^LAM Global.")
107 S (LRLAST64,LRNEXT)=$O(^LAM(99999),-1)
108 S:LRNEXT<1 (LRLAST64,LRNEXT)=0
109 S $P(^LAM(0),U,3)=LRNEXT
110 S LRN=$O(^XTMP("LRNLT642",1,99999),-1)
111 S (LRADD,LRCHG,LRDOT)=0
112 D SCR("==========================")
113 D SCR("List of WKLD CODES added to ^LAM (#64)")
114 D SCR(" ")
115 S LRNEXT=0,LRIEN=50
116 F S LRNEXT=$O(^LAB(64.81,LRIEN,2,LRNEXT)) Q:LRNEXT<1 D
117 . K LRFDA,LROUT,LRAR1,LRSIXT4
118 . S LRDOT=$G(LRDOT)+1 I LRDOT#50=0 W ". "
119 . S LRREC=^LAB(64.81,LRIEN,2,LRNEXT,0),LRERR=0
120 . S LRREC9=+$G(^LAB(64.81,LRIEN,2,LRNEXT,9))
121 . I $G(LRDBUG) W !,LRREC_" "
122 . S LRTRIEN=$P(LRREC,U)
123 . I $S($P(LRREC,U,2)["~":1,$P($P(LRREC,U,3),".",2):1,1:0) D KREC Q
124 . D CMP
125 . Q:LRERR
126 . I LRCHG D CHGNM
127 . I LRADD D GNDE
128 . I $S($G(LROUT(42,"DIERR")):0,$G(LROUT(45,"DIERR")):0,1:1) D KREC
129 . K LROUT
130 S $P(^LAM(0),U,3)=99999
131 D:'$G(LRDBUG) MAIL^LR334POA
132KIL K LRADD,LRANS,LRAR1,LRBEG,LRCHG,LRCNT,LRCODE,LRCTR,LRDOT,LREND
133 K LRENODE,LRERR,LRFDA,LRFILE,LRFLD,LRFLE,LRFNAM,LRI,LRIEN,LRIENS
134 K LRMLT,LRN,LRN0,LRN1,LRNAMX,LRNAMY,LRNEXT,LRNIEN,LRNODE,LRNUM
135 K LRNUMX,LRNUMY,LRNX,LROUT,LRPROCNM,LRREC,LRSC,LRSCR,LRSEQ,LRSIXT4
136 K LRSUBFLE,LRSYN,LRSYNIEN,LRTRIEN,LRVAL,LRVR,X,Y
137 Q
138CHGNM ; CHANGE THE PROCEDURE NAME IN THE RECORD
139 K LRFDA
140 S LRFDA(42,64,LRCHG_",",.01)=LRPROCNM
141 D FILE^DIE("K","LRFDA(42)","LROUT(42)")
142 I $G(LROUT(42,"DIERR")) D
143 . S LRERR=1
144 . S LRENODE="LROUT(42,""DIERR"")"
145 . D ERMSG
146 I '$G(LROUT(42,"DIERR")) D SCR(LRCODE_"|"_LRPROCNM_"|"_"**Procedure Name Changed**")
147 K LRFDA(42),LRPROCNM
148 Q
149CMP ; COMPARE FOUND CODES AND PROCEDURE NAMES
150 N DIC,X,Y,ANS
151 S (LRADD,LRCHG,LRERR)=0
152 S LRCODE=$P(LRREC,U,3),LRPROCNM=$P(LRREC,U,2)
153 S Y=+$$FIND1^DIC(64,"","XO",LRCODE_" ","C","","ANS")
154 I Y<1 D
155 . S LRADD=1,LRN=$G(LRN)+1
156 . D SCR(LRCODE_"|"_LRPROCNM_"|")
157 I Y>1,$G(LRREC9) D
158 . I $D(^LAM(+Y,0)),$G(^LAM(+Y,9))<1 S $P(^LAM(+Y,9),U)=LRREC9
159 Q
160SCR(LRMSG) ;Store message in ^XTMP("LRNLT" Global
161 S LRSCR=$G(^XTMP("LRNLT","LR334",1,0))+1,^(0)=LRSCR
162 S ^XTMP("LRNLT","LR334",1,LRSCR)=LRSCR_"|"_LRMSG
163 Q
164SETUP ; SETS UP THE FDA ARRAY TO ADD A NODE
165 F S LRNODE=$Q(@LRNODE) Q:LRNODE="" D
166 . S LRFLE=$QS(LRNODE,1)
167 . S LRFLD=$QS(LRNODE,3)
168 . I LRFLE=64.8117 D
169 . . S LRSUBFLE=64
170 . . I LRFLD=1 S LRFLD=.01
171 . . I LRFLD>1 S LRFLD=LRFLD-1
172 . . S LRIENS="+"_LRTRIEN_","
173 . I LRFLE'=64.8117 D
174 . .; CONSTRUCT THE SUBFILE NUMBER FOR FILE 64 FROM 64.81
175 . . S LRBEG=$P(LRFLE,"8117")
176 . . S LREND=$P(LRFLE,"8117",2)
177 . . S LRSUBFLE=LRBEG_"0"_LREND
178 . . I LRFLD=.01 S LRSEQ=LRSEQ+1
179 . . S LRIENS="+"_LRSEQ_","_"+"_LRTRIEN_","
180 . S LRVAL=@LRNODE
181 . S LRFDA(45,LRSUBFLE,LRIENS,LRFLD)=LRVAL
182 . ;W !,"LRFDA(45,"_LRSUBFLE_","_LRIENS_LRFLD_")="_LRVAL
183 K LRAR1
184 Q
185GNDE ; RETRIEVES NODES FROM THE TRANSPORT MULTIPLE
186 S LRMLT="",LRCTR=1
187 D GETS^DIQ(64.8117,LRTRIEN_","_LRIEN_",",LRMLT_"*","INZ","LRAR1")
188 S LRNODE="LRAR1(64.8117_LRMLT)"
189 D SETUP
190 I $D(^LAB(64.81,50,2,LRTRIEN,1,0)) S LRNUM=$P(^LAB(64.81,50,2,LRTRIEN,1,0),U,4),LRSEQ=LRNUM+1
191 E I '$D(^LAB(64.81,50,2,LRTRIEN,1,0)) S LRSEQ=2
192 S LRMLT=18
193 D GETS^DIQ(64.8117,LRTRIEN_","_LRIEN_",",LRMLT_"*","INZ","LRAR1")
194 S LRNODE="LRAR1(64.8117_LRMLT)"
195 D SETUP
196 S LRMLT=19,LRSEQ=1
197 D GETS^DIQ(64.8117,LRTRIEN_","_LRIEN_",",LRMLT_"*","INZ","LRAR1")
198 S LRNODE="LRAR1(64.8117_LRMLT)"
199 D SETUP
200 D AREC I $G(LRDBUG) W !,"NEW IEN=",$G(LRSIXT4(LRTRIEN))
201 K LRSIXT4,LRFDA(45)
202 Q
203AREC ; ADDS ENTRIES FROM THE TRANSPORT MULTIPLE TO FILE 64
204 D UPDATE^DIE("","LRFDA(45)","LRSIXT4","LROUT(45)")
205 I $G(LROUT(45,"DIERR")) D
206 . S LRENODE="LROUT(45,""DIERR"")"
207 . D ERMSG
208 K LRFDA(45)
209 Q
210ERMSG ;STUFF THE TEMP GLOBAL WITH ANY ERROR MESSAGES
211 S LRN=$G(^XTMP("LRNLT642",1,0))+1
212 S ^XTMP("LRNLT642",1,LRN,0)="|"_LRTRIEN_"|"_LRCODE_"|"_LRPROCNM_"|ERR"
213 F S LRENODE=$Q(@LRENODE) Q:LRENODE="" D
214 . S LRN=LRN+1
215 . S ^XTMP("LRNLT642",1,LRN,0)="|"_LRENODE_"|="_@LRENODE
216 S ^XTMP("LRNLT642",1,0)=LRN
217 S LRERR=1
218 K LRENODE
219 Q
220KREC ; DELETES THE RECORD FROM THE FILE
221 Q:$G(LRDBUG)
222 N DA,DIK
223 S DA(1)=LRIEN,DA=LRTRIEN
224 S DIK="^LAB(64.81,"_DA(1)_",2," D ^DIK
225 Q
226DSS ;Update WKLD CODE file , DSS Feeder Key (#14) field to 'Yes"
227 ;for those NLT codes used for AP professional services
228 D BMES^LR334("Updating DSS Feeder Key for AP NLT Codes")
229 N ERR,FDA,IEN,LST,OUT,NODE,X
230 S NODE="^LAB(64.81,""AC"")"
231 F S NODE=$Q(@NODE) Q:$QS(NODE,2)'="AC" D
232 . S X=$P($$GET1^DIQ(64.8117,$QS(NODE,5)_","_$QS(NODE,4)_",",2,"I","ERR"),".")
233 . Q:'X
234 . K OUT,ERR
235 . D FIND^DIC(64,"","@;1","M",X,"","C","","","OUT","ERR")
236 . Q:$D(ERR)
237 . S LST=0 F S LST=$O(OUT("DILIST",2,LST)) Q:'LST D
238 . . S IEN=$G(OUT("DILIST",2,LST))
239 . . Q:'($D(^LAM(IEN,0))#2)
240 . . K FDA,ERR S FDA(1,64,IEN_",",14)=1
241 . . D FILE^DIE("","FDA(1)","ERR")
242 . . I $D(ERR) W !,$C(7),ERR
243 . . W "*"
244 D BMES^LR334("Update DSS AP Feeder Key Complete")
245 Q
Note: See TracBrowser for help on using the repository browser.