source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRGV.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.6 KB
Line 
1LRGV ;DALIO/RWF - INSTRUMENT GROUP VERIFY DATA ;2/5/91 13:26
2 ;;5.2;LAB SERVICE;**269**;Sep 27, 1994
3 ;
4 N LRANYAA,LRUID,LRVBY
5 ;
6 D ^LRGVK,^LRPARAM
7 I $G(LREND) D END Q
8 ;
9 S U="^",LRSS="CH",LROUTINE=$P(^LAB(69.9,1,3),U,2),(LRANYAA,LRUID,LRVBY)=""
10 ;
11 ; Get user's initials to use to verify results
12 S X=DUZ D DUZ^LRX
13 X ^%ZOSF("EOFF")
14 N DIR
15 S DIR(0)="FAO^1:10",DIR("A")="Please enter your initials to verify: "
16 D ^DIR K DIR
17 X ^%ZOSF("EON")
18 I $D(DIRUT)!(Y'=LRUSI) D END Q
19 ;
20 D ^LRGP1
21 I LREND D END Q
22 ;
23 D COM
24 I LREND D NOP,END Q
25 ;
26 S %ZIS="Q" D ^%ZIS
27 I POP D END Q
28 ;
29 I $D(IO("Q")) D Q
30 . N ZTDTH,ZTRTN,ZTSAVE,ZTDESC
31 . K IO("Q")
32 . S ZTRTN="DQ^LRGV",ZTSAVE("LR*")="",ZTSAVE("^TMP(""LR"",$J,")="",ZTDESC="Group verify (EA, EL, EW)"
33 . D ^%ZTLOAD
34 . U IO(0) W !,"Task ",$S($G(ZTSK):ZTSK,1:"NOT")," Queued"
35 . D END
36 ;
37DQ ;
38 U IO
39 S LRNOW=$$NOW^XLFDT,LRDT=$$FMTE^XLFDT(LRNOW,"1M"),(LREND,LRPAGE)=0
40 S LRLLNM=$P(^LRO(68.2,LRLL,0),"^")
41 D HDR
42 D LRTRAY:LRWT="T",ACCLST:LRWT="A",SEQ:LRWT="M",WRKLST:LRWT="W"
43 I $E(IOST,1,2)="P-" W @IOF
44 ;
45END ;
46 I $D(ZTQUEUED) S ZTREQ="@"
47 E D ^%ZISC
48 D ^LRGVK
49 K LRCSQQ,LRLLNM,LRNGS,LRPAGE
50 Q
51 ;
52 ;
53ACCLST ; Verify by accession number/UID
54 ;
55 S LRVWLE=""
56 ;
57 ; Verify by accession number
58 I LRVBY=1 D
59 . S LRAN=LRFAN
60 . F S LRAN=$O(^LRO(68,LRAA,1,LRAD,1,LRAN)) Q:LRAN<1!(LRAN>LRLIX) D ACC2 Q:LREND
61 . I $L(LRVWLE) D
62 . . S $P(^LRO(68,LRAA,1,LRAD,2),"^")=LRUSI
63 . . S $P(^LRO(68,LRAA,1,LRAD,2),"^",4)=LRVWLE
64 ;
65 ; Verify by UID
66 I LRVBY=2 D
67 . S LRANYAA=+$P($G(^LRO(68.2,LRLL,10,LRPROF,0)),"^",3),LRUID=""
68 . F D NEXT^LRVRA Q:LRUID="" D ACC2 Q:LREND
69 ;
70 Q
71 ;
72 ;
73ACC2 ; Only select those entries in ^LAH that match the accession area and
74 ; date selected by the user.
75 ;
76 I $Y>(IOSL-10) D HDR Q:LREND
77 W ! D DASH^LRX
78 W !,"Accession #: ",LRAN
79 I LRVBY=2 D
80 . W " [UID: ",LRUID,"]"
81 . I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) D Q
82 . . W " No accession on file for this UID."
83 . W " <",$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)),"^"),">"
84 ;
85 I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),"^",3) D Q
86 . W " Has not been received. Unable to verify."
87 ;
88 I +^LRO(68,LRAA,1,LRAD,1,LRAN,3)>$$NOW^XLFDT D Q
89 . W " Has a collection time in the future. Unable to verify."
90 ;
91 I $O(^LAH(LRLL,1,"C",LRAN,0))<1 D Q
92 . W " NO Instrument Data Found."
93 ;
94 S LRSQ=0
95 F S LRSQ=$O(^LAH(LRLL,1,"C",LRAN,LRSQ)) Q:LRSQ<1 D Q:LREND
96 . S X=^LAH(LRLL,1,LRSQ,0)
97 . I LRAA'=$P(X,"^",3)!(LRAD'=$P(X,"^",4)) Q
98 . S LRAN=$P(X,"^",5)
99 . I LRAN D STUFF^LRGV1
100 Q
101 ;
102 ;
103LRTRAY ; Verify by tray/cup
104 ;
105 F LRTRAY=LRFTRAY:1:LRLTRAY D Q:LREND
106 . I $Y>(IOSL-10) D HDR Q:LREND
107 . W ! D DASH^LRX
108 . W !!,"Start TRAY: ",LRTRAY
109 . D TR2
110 Q
111 ;
112 ;
113TR2 ; Verify by tray/cup
114 ; Only select those entries in ^LAH that match the accession area and date
115 ; selected by the user.
116 N LRSC,LREC,X
117 ;
118 ; Figure out starting and ending cups for this tray
119 S LRSC=$S(LRTRAY=LRFTRAY:LRFCUP,1:1)
120 S LREC=$S(LRTRAY=LRLTRAY:LRLCUP,1:LRMAXCUP)
121 ;
122 F LRCUP=LRSC:1:LREC D Q:LREND
123 . S LRITC=LRTRAY_";"_LRCUP
124 . I $Y>(IOSL-10) D HDR Q:LREND
125 . W ! D DASH^LRX
126 . W !,"Tray ",$J(LRTRAY,3)," Cup ",$J(LRCUP,3)
127 . I $O(^LAH(LRLL,1,"B",LRITC,0))<1 W ?35,"No Instrument Data Found" Q
128 . ;
129 . S LRSQ=0
130 . F S LRSQ=$O(^LAH(LRLL,1,"B",LRITC,LRSQ)) Q:LRSQ<1 D Q:LREND
131 . . I '$D(^LAH(LRLL,1,+LRSQ,0)) D Q
132 . . . K ^LAH(LRLL,1,"B",LRTIC,LRSQ)
133 . . . W ?35,"No Instrument Data Found"
134 . . S X=^LAH(LRLL,1,LRSQ,0)
135 . . I LRAA'=$P(X,"^",3)!(LRAD'=$P(X,"^",4)) Q
136 . . S LRAN=$P(X,"^",5)
137 . . I LRAN D STUFF^LRGV1 Q
138 . . W ?35," Does not have a link to an Accession."
139 Q
140 ;
141 ;
142SEQ ; Verify by sequence number
143 ; Only select those entries in ^LAH that match the accession area and date
144 ; selected by the user.
145 ;
146 N X
147 ;
148 S LRSQ=LRSQ-1
149 F S LRSQ=$O(^LAH(LRLL,1,LRSQ)) Q:LRSQ<1!(LRSQ>LRESEQ) D Q:LREND
150 . I $Y>(IOSL-10) D HDR Q:LREND
151 . W ! D DASH^LRX
152 . S X=^LAH(LRLL,1,LRSQ,0)
153 . I LRAA'=$P(X,"^",3)!(LRAD'=$P(X,"^",4)) Q
154 . S LRAN=$P(X,"^",5)
155 . I LRAN D STUFF^LRGV1 Q
156 . W !!,"SEQ: ",LRSQ,". Does not have a link to an Accession."
157 Q
158 ;
159 ;
160WRKLST ; Verify by worklist
161 ; Only select those entries in file #68.2 that match the profile selected
162 ; by the user.
163 ;
164 N X
165 ;
166 S LRCUP=LRCUP-1
167 F S LRCUP=$O(^LRO(68.2,LRLL,1,1,1,LRCUP)) Q:'LRCUP!(LRCUP>LRECUP) D Q:LREND
168 . I $Y>(IOSL-10) D HDR Q:LREND
169 . W ! D DASH^LRX
170 . S X=^LRO(68.2,LRLL,1,1,1,LRCUP,0)
171 . I $P(X,"^",4),$P(X,"^",4)'=LRPROF Q
172 . S LRAA=$P(X,"^"),LRAD=$P(X,"^",2),LRAN=$P(X,"^",3)
173 . W !,"Sequence #",$J(LRCUP,4)
174 . I $O(^LAH(LRLL,1,"C",+LRAN,0))<1 W ?35,"No Instrument Data Found" Q
175 . ;
176 . S LRSQ=0
177 . F S LRSQ=$O(^LAH(LRLL,1,"C",LRAN,LRSQ)) Q:LRSQ<1 D STUFF^LRGV1 Q:LREND
178 Q
179 ;
180 ;
181COM ; Ask common questions
182 ;
183 N DIR,DIRUT,DTOUT,DUOUT,X,Y
184 ;
185 S LRVRFYAL=0
186 I $D(^XUSEC("LRSUPER",DUZ))!1 D
187 . S DIR(0)="YAO",DIR("B")="NO"
188 . S DIR("A",1)="Verify accessions specified, even if"
189 . S DIR("A")=" DELTA check or CRITICAL range flag? "
190 . D ^DIR
191 . I $D(DIRUT) S LREND=1 Q
192 . S LRVRFYAL=Y
193 ;
194 I LREND Q
195 ;
196 K DIR
197 S DIR(0)="YO",DIR("A")="Everything OK",DIR("B")="YES"
198 D ^DIR
199 I $D(DIRUT)!(Y'=1) S LREND=1
200 Q
201 ;
202 ;
203NOP ;
204 W !!,"NOTHING VERIFIED"
205 Q
206 ;
207 ;
208HDR ;
209 ;
210 N DIR,DIRUT,DTOUT,DUOUT,X,Y
211 ;
212 I $E(IOST,1,2)="C-",'$D(ZTQUEUED),LRPAGE D
213 . S DIR(0)="E" D ^DIR
214 . I $D(DIRUT) S LREND=1
215 I LREND Q
216 ;
217 I LRPAGE!($E(IOST,1,2)="C-") W @IOF
218 S LRPAGE=LRPAGE+1
219 W "Group verification report - Verify with",$S(LRVRFYAL:"",1:"out")," flags"
220 W ?(IOM-27)," Date: ",LRDT
221 W !,"Load/Work list: ",LRLLNM," Panel: ",LRPANEL,?(IOM-27)," Page: ",LRPAGE
222 ;
223 ; Check if task has been asked to stop.
224 I $D(ZTQUEUED),$$S^%ZTLOAD D Q
225 . S (LREND,ZTSTOP)=1
226 . W !!,"*** Report requested to stop by TaskMan ***"
227 . W !,"*** Task #",$G(ZTQUEUED,"UNKNOWN")," stopped at ",$$HTE^XLFDT($H)," ***"
228 Q
Note: See TracBrowser for help on using the repository browser.