source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRVER.m@ 1742

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

initial load of FOIAVistA 6/30/08 version

File size: 5.7 KB
Line 
1LRVER ;DALOI/CJS/FHS - LAB ROUTINE DATA VERIFICATION ; Nov 4, 2004;
2 ;;5.2;LAB SERVICE;**153,286**;Sep 27, 1994
3 D ^LRPARAM
4 S LRCW=8,LREND=0,LRPANEL=0,LRUID=""
5 K DIC,LRPER,DUOUT
6 D REV
7 I LREND D QUIT Q
8 D VERDIS
9 I LREND D QUIT Q
10 D CMTDSP^LRVERA
11 S (LRAA,LRAD,LRAN)=0
12 N LRVBY S LRVBY=$$SELBY^LRWU4("Verify by")
13 D:LRVBY=1 ^LRVERA D:LRVBY=2 UID^LRVERA
14 I 'LRVBY!(LRAA<1) D QUIT Q
15 S X=$$SELPL^LRVERA(DUZ(2))
16 I X<1 D QUIT Q
17 I X'=DUZ(2) N LRDUZ S LRDUZ(2)=X
18 I $P(LRPARAM,U,14),$P($G(^LRO(68,LRAA,0)),U,16) D ^LRCAPV G QUIT:$G(LREND)
19SLOW S LRSS=$P(^LRO(68,LRAA,0),U,2)
20 ;
21 I LRSS="MI" D Q
22 . S X=DUZ D DUZ^LRX S LRTEC=LRUSI
23 . S LRPTP=-1,LRMIDEF=$P(^LAB(69.9,1,1),U,10),LRMIOTH=$P(^(1),U,11)
24 . D ^LRMIEDZ2,END^LRMIEDZ,QUIT
25 ;
26 I LRSS'="CH" G QUIT
27 ;
28 ; The rest of the code only works on the "CH" area.
29DAT I LRAD<1 D ADATE^LRWU
30 Q:LRAD<1
31 S %H=$H-$P(^LAB(69.9,1,0),U,7) D YMD^%DTC S LRTM60=9999999-X
32 I LRAN>0 D WLN1 G QUIT:$G(LREND) G L11
33 I $P(^LRO(68,LRAA,0),U,3)="D" S I=0 F 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
34 S:$D(^LRO(68,LRAA,1,LRAD,2))&(LRAN<1) LRAN=$P(^(2),U,4)
35 ;
36L10 K LRTEST,LRSET,LRLDT,DIC,LRNAME,LRNG,LRDEL,T,LRTX,LRFP,LRAB,LRVERVER,Y,Z
37 G QUIT:$G(LREND) D WLN G QUIT:$G(LREND)
38 ;
39L11 I $D(LRFASTS) D ^LRVER1,SLOWK^LRFASTS Q
40 D ^LRVER1,NEXT
41 G L10
42 ;
43YN S DUOUT=0 S:'$D(%) %=1 D YN^DICN S:%<0 DUOUT=1 W:%=0 !,"Answer with a YES or NO or '^' to exit" Q:% G YN
44 ;
45WLN I LRVBY=2 S:LRAN<1 LRUID="" S:$L(LRAN) LRUID=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3)),"^") D UID^LRVERA G LREND:LRUID="" G WLN1
46 ;
47 S:LRAN<1 LRAN=""
48 K DIR,DIRUT,DTOUT,DUOUT
49 S DIR(0)="NAO^1:999999:0"
50 S DIR("A")="Accession NUMBER: ",DIR("?")="^D LW^LRVR"
51 I LRAN'="" S DIR("B")=LRAN
52 D ^DIR K DIR
53 I $D(DIRUT) G LREND
54 S LRAN=Y
55 G WLN:LRAN=""
56WLN1 I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,0)) W !,"Accession does not exist." D NEXT G WLN
57 S LRDFN=+^LRO(68,LRAA,1,LRAD,1,LRAN,0),LRORD=$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)
58 S LRUID=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3)),"^")
59 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX
60 W !,PNM,?30,SSN
61 W:LRDPF=2 " LOC:",$S($L(LRWRD):LRWRD,1:$S($L($P(^LRO(68,LRAA,1,LRAD,1,LRAN,0),U,7)):$P(^(0),U,7),1:"??"))
62 W !
63 S LRCDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U)
64 ; If no lab arrival time then have user update order/accession
65 I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,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 . Q:LRCDT<1
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 accession
74 I '$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,3) D NEXT G WLN
75 S LRCDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U)
76 I $G(LRCDT)<1 S LRCDT=1 D NEXT G WLN
77 ; Check for valid pointer to file #63 and entry in file #63.
78 S LRIDT=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,5)
79 I LRIDT<1 D G WLN
80 . W !,">>>>ERROR - NO POINTER TO FILE #63 - PLEASE NOTIFY SYSTEM MANAGER<<<<<",!
81 . D NEXT
82 I '$D(^LR(LRDFN,"CH",LRIDT,0)) D G WLN
83 . W !,">>>>ERROR - NO ENTRY IN FILE #63 - PLEASE NOTIFY SYSTEM MANAGER<<<<<",!
84 . D NEXT
85 I $D(^LRO(69,LRODT,1,LRSN)),'$D(^(LRSN,1)) W !,"This Order # has not been collected",$C(7) D NEXT G WLN
86 I $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) D NEXT G WLN
87 Q
88 ;
89 ;
90LREND I $D(^LRO(68,LRAA,1,LRAD,0)) S:'$D(^(2)) ^(2)="^^" S ^(2)=$P(^(2),U,1,3)_U_LRAN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OW,S2,ZTSK,Y,LRTIME,LRMAX2,LRMAXX,LRMX,LRODTSV,LRSNSV,LRSPN,LRTNSV,LRTY
111 K W,Y,Z,Z1,Z2,I1,LRALERT,LRDIYCNT,LRNOCODE,LRREP,LRSTATUS,LRUN,LRX,LRTIM,LRAL,LRPANEL,LRTM60,LRNDISP
112 D KVA^VADPT K LRIDIV,LROLLOC,LRORIFN,LRPRAC,LRRB,LRSD,LRTREA,LRTT,LRUID
113 K NAME,LRSUFO,LRCSQQ
114 Q
115 ;
116 ;
117REV ; Ask if user wants to review data before and after editing
118 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
119 S DIR(0)="YO",DIR("B")="YES"
120 S DIR("A")="Do you want to review the data before and after you edit"
121 S DIR("?",1)="Answer YES, and the data will be displayed in its entirety as a panel before"
122 S DIR("?",2)="you edit if data already exists, and will be displayed after you edit."
123 S DIR("?")="NO, will skip the extra displays."
124 D ^DIR
125 I $D(DIRUT) S LREND=1
126 I Y=0 S LRPER=""
127 Q
128 ;
129 ;
130VERDIS ; Prevent test not selected by the user with verified data
131 ; entered from being displayed on the editing screens.
132 N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
133 S DIR(0)="YO",DIR("B")="NO"
134 S DIR("A")="Do you wish to see all previously verified results"
135 S DIR("?",1)="Do you want to see every test that has results entered"
136 S DIR("?",2)="or only the test(s) you select to edit "
137 S DIR("?")="Answer with YES or NO"
138 D ^DIR
139 I $D(DIRUT) S LREND=1
140 I Y=0 S LRNDISP=1
141 Q
Note: See TracBrowser for help on using the repository browser.