source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRVR1.m@ 1042

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

initial load of WorldVistAEHR

File size: 6.2 KB
Line 
1LRVR1 ;DALOI/CJS/JAH - LAB ROUTINE DATA VERIFICATION ;8/10/04
2 ;;5.2;LAB SERVICE;**42,153,221,286,291**;Sep 27, 1994
3 N LRI,LRN,LRBETST,LRBEY
4 S (LRI,LRN)=0
5 F S LRI=$O(^LAH(LRLL,1,"C",LRAN,LRI)) Q:LRI<1 D
6 . N LRX
7 . S LRX=$G(^LAH(LRLL,1,LRI,0))
8 . ; Quit if different accession area.
9 . I $P(LRX,"^",3),$P(LRX,"^",3)'=LRAA Q
10 . ; Quit if different accession date and not a rollover accession (same original accession date).
11 . I $P(LRX,"^",4),$P(LRX,"^",4)'=LRAD,$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,0)),"^",3)'=$P($G(^LRO(68,LRAA,1,$P(LRX,"^",4),1,LRAN,0)),"^",3) Q
12 . I LRN W !
13 . S LRN=LRN+1,LRSQ=LRI
14 . W !,?2,"Seq #: ",LRI,?13," Accession: ",$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)),"^")
15 . I $P(LRX,"^",10) W ?40," Results received: ",$$FMTE^XLFDT($P(LRX,"^",10),"1M")
16 . W !,?20,"UID: ",$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3),"UNKNOWN"),"^")
17 . I $P(LRX,"^",11) W ?44," Last updated: ",$$FMTE^XLFDT($P(LRX,"^",11),"1M")
18 G VER:LRN=1,T3:LRN>1
19 ;
20 ; If attempting to verify reference lab results and no entry in LAH
21 ; associated with this accession then quit - do not allow manual entry
22 ; of ref lab results via this option. Will not store units/normals.
23 I $G(LRDUZ(2)),DUZ(2)'=LRDUZ(2) W !,"No data there" Q
24 ;
25T1 R !,"What tray: ",X:DTIME Q:X["^"!'$T I X["?"!(X'?.N) W !,"Enter a number" G T1
26 I X'="" S LRTRAY=X G T2
27 I $D(^LRO(68.2,"AS",LRLL)) W !,"Can't MANUALLY add to a SEQUENCE instrument data file." G QUIT
28 W !,"Enter manually" S %=1 D YN^DICN G QUIT:%<1,T1:%=2 S LRSQ=-1 G VER
29 G VER
30T2 R !,"What cup: ",X:DTIME Q:X["^"!'$T I X["?"!(X'?.N) W !,"Enter a number" G T2
31 Q:X="" S LRTRCP=LRTRAY_";"_X
32 K LRPRGSQ
33 S LRN=0 F LRI=0:0 S LRI=$O(^LAH(LRLL,1,"B",LRTRCP,LRI)) Q:LRI<1 S LRN=LRN+1,LRSQ=LRI,LRPRGSQ(LRI)="" W !,?5,LRI
34T3 I LRN=0 W !,"No data for that tray & cup" Q
35 I LRN>1 R !,"Choose sequence number: ",X:DTIME Q:'$T I X["?"!(X'?.N) W !,"Enter a number" G T3
36 I X["^"!(X="") K LRPRGSQ Q
37 S:LRN'=1 LRSQ=X I '$D(^LAH(LRLL,1,LRSQ,0)) W !,"No data there" G T3
38 ;
39VER ; from LRFLAG, LRGP, LRVRW
40 N LRROOT
41 K LRTEST,LRNM,^TMP("LR",$J,"TMP")
42 S LRUID=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3)),"^")
43 ;
44 ; Determine if there are amended results to process via "EM"
45 S LRROOT=$Q(^LAH("LA7 AMENDED RESULTS",LRUID,1,LRLL))
46 I LRROOT'="",$QS(LRROOT,1)="LA7 AMENDED RESULTS",$QS(LRROOT,2)=LRUID,$QS(LRROOT,4)=LRLL D Q
47 . W !!,"Amended results exist for this accession. Please process these"
48 . W !,"first using option Enter/verify/modify data (manual) [LRENTER]"
49 ;
50 D TEST
51 I $O(^TMP("LR",$J,"TMP",0))="" W !,"No tests in editing profile" Q
52 S X=DUZ D DUZ^LRX
53 G V2:LRSQ>0
54 L +^LAH(LRLL)
55 S (^LAH(LRLL),LRSQ)=1+$G(^LAH(LRLL))
56 S ^LAH(LRLL,1,LRSQ,0)="^^"_LRAA_"^"_LRAD_"^"_LRAN_"^^MANUAL"
57 D UID^LAGEN(LRLL,LRSQ,LRUID)
58 D UPDT^LAGEN(LRLL,LRSQ)
59 S ^LAH(LRLL,1,"C",LRAN,LRSQ)=""
60 L -^LAH(LRLL)
61V2 K LRPRGSQ(LRSQ)
62 S LRLLOC=0,LROUTINE=$P(^LAB(69.9,1,3),U,2)
63 I $D(^LRO(69,LRODT,1,LRSN,0)) S LRLLOC=$P(^(0),U,7) S:'$L(LRLLOC) LRLLOC=0 W !,$P(^LRO(69,LRODT,1,LRSN,1),U,6)
64 S LRCDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U)
65 I '$P(^LRO(68,LRAA,1,LRAD,1,LRAN,3),"^",3) D
66 . N %DT,LRA1,LRA2,LRA3
67 . S %DT("B")=$$FMTE^XLFDT(LRCDT,"1")
68 . S LRSTATUS="C",LRA1=LRAA,LRA2=LRAD,LRA3=LRAN
69 . D P15^LROE1
70 . S LRAA=LRA1,LRAD=LRA2,LRAN=LRA3
71 . I LRCDT<1 Q
72 . I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,3) S $P(^(3),U,3)=$$NOW^XLFDT
73 ; If user did not update then go to next
74 I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,3) Q
75 S LRCDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U)
76 I LRCDT<1 Q
77 S LREAL=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,2),LRALERT=LROUTINE
78 S I=0
79 F S I=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,I)) Q:I<.5 I $G(^(I,0)) S LRAL=$P($G(^(0)),U,2) D
80 . I $G(LRAL) S LRALERT=$S(LRAL<50&(LRAL<LRALERT):LRAL,LRAL>50&(LRAL-50<LRALERT):LRAL-50,1:LRALERT)
81 S LRSAMP=$P($G(^LRO(69,LRODT,1,LRSN,0)),U,3)
82 ;
83 S LRSS=$P(^LRO(68,LRAA,0),U,2)
84 I LRSS'="CH" Q
85 ; Check for valid pointer to file #63 and entry in file #63.
86 S LRIDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,5)
87 I LRIDT<1 W !,">>>>ERROR - NO POINTER TO FILE #63 - PLEASE NOTIFY SYSTEM MANAGER^ <<<<<",! Q
88 I '$D(^LR(LRDFN,LRSS,LRIDT,0)) W !,">>>>ERROR - NO ENTRY IN FILE #63 - PLEASE NOTIFY SYSTEM MANAGER<<^ <<<",! Q
89 ;
90 S LRCW=8
91LD S LRSS="CH"
92 I '($D(^LAH(LRLL,1,LRSQ,0))#2) W !!?5,"No Data for this Accession ",!! K ^LAH(LRLL,1,LRSQ),^LAH(LRLL,1,"C",LRAN,LRSQ) K LRPRGSQ Q
93 ;
94 ; Store any new methods with existing methods on file.
95 S LRMETH=$P(^LAH(LRLL,1,LRSQ,0),U,7) S:$D(LRGVP) LRMETH=LRMETH_"(GV)"
96 I $P($G(^LR(LRDFN,LRSS,LRIDT,0)),U,8)'="" D
97 . N I,X
98 . S X=$P(^LR(LRDFN,LRSS,LRIDT,0),U,8)
99 . F I=1:1:$L(X,";") I $P(X,";",I)'="",LRMETH'[$P(X,";",I) S LRMETH=LRMETH_";"_$P(X,";",I)
100 I LRMETH'="" S $P(^LR(LRDFN,LRSS,LRIDT,0),U,8)=LRMETH
101 ;
102 W:$D(^LAB(62,+LRSAMP,0)) !,"Sample: ",$P(^(0),U)
103 ;
104 D ^LRVR2
105 K LRDL,LRPRGSQ
106 Q ; leave LRVR1, back to LRVR
107 ;
108 ;
109TEST ; from LRGV1
110 N LRI,LRX
111 S LRI=0
112 F S LRI=$O(^TMP("LR",$J,"VTO",LRI)) Q:LRI<1 K ^(LRI,"P")
113 S (LRI,LRNT)=0
114 F S LRI=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRI)) Q:LRI<.5 I $D(^(LRI,0)),'$L($P(^(0),U,6)) S X=^(0) I $D(^TMP("LR",$J,"VTO",+X)) D
115 . S LRNT=LRNT+1,LRTEST(LRNT)=+X,LRX=$S($P(X,"^",2)>50:$P(X,"^",9),1:$P(X,"^"))
116 . S LRTEST(LRNT,"P")=LRX_U_$$NLT^LRVER1(LRX)_"!"
117 . S ^TMP("LR",$J,"VTO",+X,"P")=$P(LRTEST(LRNT,"P"),"!")
118 ;
119TEST1 ; from LRFLAG
120 ;
121 N LRI
122 F LRI=1:1:LRNT S:$D(^LAB(60,+LRTEST(LRI),0)) (LRTEST(LRI),LRBETST(LRI))=LRTEST(LRI)_U_^(0)
123 I $G(LRORDR)'="P" K ^TMP("LR",$J,"TMP")
124 S LRNX=0
125 K LRM
126 F I=1:1 Q:'$D(LRTEST(I)) D
127 . S X=LRTEST(I),XP=$G(LRTEST(I,"P"))
128 . K LRTEST(I)
129 . D EX2
130 K LRTEST
131 Q
132 ;
133 ;
134EX2 ;
135 ; If dataname then process and quit
136 S LRSUB=$P(X,U,6)
137 I LRSUB'="" D Q
138 . S LRSB=$P(LRSUB,";",2)
139 . Q:'$D(LRVTS(LRSB))
140 . I $D(^TMP("LR",$J,"TMP",LRSB)) S ^(LRSB,"P")=XP
141 . Q:$D(^TMP("LR",$J,"TMP",LRSB))
142 . S ^TMP("LR",$J,"TMP",LRSB)=+X
143 . S XP=XP_$$RNLT^LRVER1(+X)
144 . S ^TMP("LR",$J,"TMP",LRSB,"P")=XP
145 . S:$P(X,U,18) LRM(LRSB)=+X,LRM(LRSB,"P")=XP
146 . S LRBEY(+XP,LRSB)="" ; CIDC
147 ;
148 I $D(^LAB(60,+X,4)),$P(^(4),"^",2) S LRCFL=LRCFL_$P(^(4),"^",2)_U
149 ;
150 ; If panel then explode components of panel and
151 ; set parent("P" node) to file #60 test being exploded
152 S J=0
153 F S J=$O(^LAB(60,+X,2,J)) Q:J<1 I $D(^(J,0))#2 D
154 . S LRNT=LRNT+1,Y=^LAB(60,+X,2,J,0)
155 . S LRTEST(LRNT)=+Y_U_^LAB(60,+Y,0)
156 . S LRTEST(LRNT,"P")=+XP_U_$$NLT^LRVER1(+XP)_"!"
157 Q
158 ;
159 ;
160QUIT Q
161 ;
162WAIT W !,"Type ""^"" to skip "
163WAIT1 R X:10 G LRVR1:X[U,WAIT1:$O(^LAH(LRLL,1,"C",LRAN,0))<1 G LRVR1
Note: See TracBrowser for help on using the repository browser.