source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRVR.m@ 1487

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

initial load of FOIAVistA 6/30/08 version

File size: 4.8 KB
Line 
1LRVR ;DALOI/CJS/DALOI/FHS - LAB ROUTINE DATA VERIFICATION ;3/28/90 17:06
2 ;;5.2;LAB SERVICE;**42,153,263,286**;Sep 27, 1994
3 N LRDUZ,LRVBY
4 D INIT G QUIT:$G(LREND)
5 S LRVBY=$$SELBY^LRWU4("Verify by")
6 I LRVBY=0 D QUIT Q
7 I LRVBY=2 D ^LRVRA,QUIT Q
8DAT D ADATE^LRWU G:LRAD<1 QUIT
9 I $P(^LRO(68,LRAA,0),U,3)="D" F I=0:0 S I=$O(^LRO(68,LRAA,1,LRAD,1,I)) Q:I<1 I $D(^LRO(68,LRAA,1,LRAD,1,I,3)),'$P(^(3),U,4) S LRAN=I Q
10 S:$D(^LRO(68,LRAA,1,LRAD,2))&'LRAN LRAN=$P(^(2),U,4)
11 D
12 . N X
13 . S X=$S(+$P($G(^LAB(69.9,1,0)),U,7):+$P(^(0),U,7),1:1)
14 . S LRTM60=9999999-$$FMADD^XLFDT(DT,-X)
15L10 S LRCFL="",EAMODE=1
16 K LRTEST,C5,LRSET,LRLDT,DIC,LRNM,LRNG,LRDL,LRDEL,T,LRFP,LRAB,LRVER,Y,Z
17 D WLN G QUIT:LREND
18 D ^LRVR1,NEXT
19 G L10
20 ;
21 ;
22YN R X:DTIME Q:X=""!(X["N")!(X["Y") W !,"Answer 'Y' or 'N': " G YN
23 ;
24WLN ;
25 S LRNOP=0
26 K DIR,DIRUT,DTOUT,DUOUT
27 S DIR(0)="NAO^1:999999:0"
28 S DIR("A")="Accession NUMBER: ",DIR("?")="^D LW^LRVR"
29 I LRAN'="" S DIR("B")=LRAN
30 D ^DIR K DIR
31 I $D(DIRUT) G STOP
32 S LRAN=Y
33 I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) W !,"NOT ON FILE" S LRNOP=1
34 I '$G(LRNOP) D
35 . S LRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRCEN=$S($D(^(.1)):^(.1),1:0),LRODT=$S($P(^(0),U,4):$P(^(0),U,4),1:$P(^(0),U,3)),LRSN=$P(^(0),U,5)
36 . S LRORU3=$G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3))
37 I '$G(LRNOP),$P(LRORU3,U)="" W !?10,"No UID number for this accession",! S LRNOP=1
38 I '$G(LRNOP) S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX W !,PNM,?30,SSN W:LRCEN !,"ORDER #: ",LRCEN
39 S LRCDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U)
40 I '$G(LRNOP),'$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),"^",3) D
41 . N %DT,LRA1,LRA2,LRA3
42 . S %DT("B")=$$FMTE^XLFDT(LRCDT,"1")
43 . S LRSTATUS="C",LRA1=LRAA,LRA2=LRAD,LRA3=LRAN
44 . D P15^LROE1
45 . S LRAA=LRA1,LRAD=LRA2,LRAN=LRA3
46 . I LRCDT<1 S LRNOP=1 Q
47 . I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,3) S $P(^(3),U,3)=$$NOW^XLFDT
48 ; If user did not update then go to next accession
49 I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,3) S LRNOP=1
50 S LRCDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U)
51 I $G(LRCDT)<1 S (LRCDT,LRNOP)=1
52 ;
53 S LRSS=$P(^LRO(68,LRAA,0),U,2)
54 I '$G(LRNOP),LRSS'="CH" S LRNOP=1
55 ; Check for valid pointer to file #63 and entry in file #63.
56 S LRIDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,5)
57 I '$G(LRNOP),LRIDT<1 W !,">>>>ERROR - NO POINTER TO FILE #63 - PLEASE NOTIFY SYSTEM MANAGER^ <<<<<",! S LRNOP=1
58 I '$G(LRNOP),'$D(^LR(LRDFN,LRSS,LRIDT,0)) W !,">>>>ERROR - NO ENTRY IN FILE #63 - PLEASE NOTIFY SYSTEM MANAGER<<^ <<<",! S LRNOP=1
59 ;
60 I '$G(LRNOP),$D(^LRO(69,LRODT,1,LRSN)),'$D(^(LRSN,1)) W !,"This Order # has not been collected",$C(7) S LRNOP=1
61 I '$G(LRNOP),$D(^LRO(69,LRODT,1,LRSN,1)),$P(^LRO(69,LRODT,1,LRSN,1),U,4)'="C" W !,"You cannot verify an accession which has not been collected.",$C(7) S LRNOP=1
62 I $G(LRNOP) D NEXT G WLN
63 Q
64 ;
65 ;
66LW ;
67 N S
68 W !,"Enter range of accession numbers which might apply."
69 D LRAN^LRWU3 Q:LREND
70 S LRDT=$$FMTE^XLFDT($$DT^XLFDT,"5F")
71 S S("LRAA")=LRAA,S("LRAD")=LRAD,S("LRAN")=LRAN
72 D W^LRWRKLST
73 S LREND=0,LRAA=S("LRAA"),LRAD=S("LRAD"),LRAN=S("LRAN")
74 Q
75 ;
76 ;
77QUIT I $G(LRAN),$G(LRAA),$G(LRAD) S LREND=1 I $D(^LRO(68,LRAA,1,LRAD,0)) S:'$D(^(2)) ^(2)="^^" S ^(2)=$P(^(2),U,1,3)_U_LRAN_U_$P(^(2),U,5,99),LREND=1
78 ;
79CLEAN ;
80 I $D(LRCSQ),'$O(^XTMP("LRCAP",LRCSQ,DUZ,0)) K ^XTMP("LRCAP",LRCSQ,DUZ)
81 E I $D(LRAA) D:$P(LRPARAM,U,14)&($P($G(^LRO(68,+LRAA,0)),U,16)) STD^LRCAPV K LRIDIV
82 K DIR,LRCMTDSP,LRNOP,XP
83 D ^LRVRKIL
84 S ZTIO="",ZTRTN="LRCAPV2",ZTDTH=$H,ZTDESC="LAB LRCAPV2 ROUTINE"
85 D ^%ZTLOAD K ZTSK
86 Q
87 ;
88 ;
89NEXT S LRAN=$O(^LRO(68,LRAA,1,LRAD,1,LRAN)) I LRAN'>0 W !,"LAST IN WORK LIST" S LRAN="^"
90 S LREND=0
91 Q
92 ;
93 ;
94LIST W " the following tests: " F I=0:0 S I=$O(LRTST(I)) Q:I<1 W !,?10,$P(LRTST(I),"^",1)
95 Q
96 ;
97 ;
98EXPAND D EXPLODE^LRGP2
99SKPEX Q:$O(LRVTS(0)) ; READY TO GO
100STOP S LREND=1
101 Q
102 ;
103 ;
104INIT ;from LRVRW
105 N DIC,LRX
106 D ^LRPARAM Q:$G(LREND) S LREND=0,LRAN=0 K LRORD,LRDUZ
107 S DIC="^LRO(68.2,",DIC(0)="AEMZ",DIC("S")="S LRX=$P(^(0),U,12) Q:'$L(LRX) I $D(^XUSEC($P($G(^DIC(19.1,LRX,0)),U),DUZ))"
108 D ^DIC K DIC("S") G STOP:Y<1 S LRLL=+Y,LRTYPE=$P(Y(0),U,3)
109 S LRPROF=$O(^LRO(68.2,LRLL,10,0))
110 I LRPROF<1 S LREND=1 W !,"No profile defined." Q
111 S B=$O(^LRO(68.2,LRLL,10,LRPROF))
112 I B>0 S DIC="^LRO(68.2,"_LRLL_",10," D ^DIC G STOP:Y<1 S LRPROF=+Y
113 S X=^LRO(68.2,LRLL,10,LRPROF,0),LRAA=$P(X,U,2),LRPANEL=$P(X,U) I '$D(^LRO(68,LRAA,0))#2 W !?10,$C(7),"Error in your DATABASE. There is not an accession area # ",LRAA,!! Q
114 ;
115 ; Select performing laboratory to use
116 S LRX=$$SELPL^LRVERA($S($P(X,"^",5):$P(X,"^",5),1:DUZ(2)))
117 I LRX<1 S LREND=1 Q
118 I LRX,LRX'=DUZ(2) S LRDUZ(2)=LRX
119 ;
120 D:$P(LRPARAM,U,14)&($P($G(^LRO(68,LRAA,0)),U,16)) AUTO^LRCAPV Q:LREND
121 I $P(^LRO(68,LRAA,0),U,2)="MI" D ^LRMIEDZ S LREND=1 Q
122 G STOP:$P(^LRO(68,LRAA,0),U,2)'="CH"
123 S LREND=0 D EXPAND G STOP:LREND!($O(LRVTS(0))<0)
124 F I=0:0 S I=$O(LRORD(I)) Q:I<1 S J=LRORD(I),X=$P(^LAB(60,J,0),U,5),LRORD(I)=$P(X,";",2)
125 S Y=^LRO(68,LRAA,0),LRTSE=-1
126 ;
127 D CMTDSP^LRVERA
128 ;
129REV ;
130 K LRPER
131 D REV^LRVER
132 Q
Note: See TracBrowser for help on using the repository browser.