source: WorldVistAEHR/trunk/r/LAB_SERVICE-LR-LS/LRVER3A.m@ 691

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

revised back to 6/30/08 version

File size: 5.7 KB
RevLine 
[623]1LRVER3A ;SLC/CJS/DALOI/FHS - DATA VERIFICATION ;5/27/03 14:49
2 ;;5.2;LAB SERVICE;**1,5,42,100,121,153,190,221,254,263,266,274,295**;Sep 27, 1994
3 ;Also contains LRORFLG to restrict multiple OERR alerts (VER+2)
4 ; Reference to ^DIC(42 supported by IA #10039
5 ; Reference to ^%ZTLOAD supported by DBIA #10063
6 ; Reference to IN5^VADPT supported by DBIA #10061
7 ; Reference to $$NOW^XLFDT supported by DBIA #10103
8 ;
9VER ;Call with L ^LR(LRDFN,LRSS,LRIDT) from LRGV2, LRGVG1, LRSTUF1, LRSTUF2, LRVR3
10 Q:'$O(LRSB(0))
11 N LRVCHK,LRORTST,LRORFLG,LRT
12 S LRORU3=$G(^LRO(68,LRAA,1,LRAD,1,LRAN,.3)),(LRAOD,LRACD)=$P(^(0),U,3)
13 S LRACD=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,9)):^(9),1:LRACD)
14 S:'$D(^LRO(68,LRAA,1,LRACD,1,LRAN,0))#2 LRACD=LRAD
15 S LRAOD=$S($D(^LRO(68,LRAA,1,LRAOD,1,LRAN,0))#2:LRAOD,1:LRAD)
16 I '$G(LRFIX) S LRNOW=$$NOW^XLFDT,$P(^LR(LRDFN,LRSS,LRIDT,0),U,3,4)=LRNOW_U_$S($G(LRDUZ):LRDUZ,1:DUZ)
17 K A2 I '$D(PNM) S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D PT^LRX S:PNM="" PNM="NONAME"
18 N LRT S LRT=0 F S LRT=$O(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT)) Q:LRT<.5 S:$P(^(LRT,0),U,5)="" A2(LRT)=1 I $D(^TMP("LR",$J,"VTO",LRT)) S LRVCHK=+^(LRT) D
19 . I $S(LRVCHK<1:1,$D(LRSB(LRVCHK))#2:1,1:0) D
20 . . I $D(LRSB(LRVCHK)) Q:$P(LRSB(LRVCHK),U)=""
21 . . I LRVCHK<1,$L($P(^LRO(68,LRAA,1,LRAD,1,LRAN,4,LRT,0),U,6)) Q
22 . . D
23 . . . S $P(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0),U,4)=$S($G(LRDUZ):LRDUZ,$G(DUZ):DUZ,1:"")
24 . . . S:'$P(^(0),U,5) $P(^(0),U,5)=LRNOW
25 . . . S $P(^(0),U,6)="",$P(^(0),U,8)=$G(LRCDEF)
26 . . S LRORTST(LRT)=""
27 . . I LRACD'=LRAD D
28 . . . Q:'$D(^LRO(68,LRAA,1,LRACD,1,LRAN,4,+LRT,0)) D
29 . . . . S $P(^LRO(68,LRAA,1,LRACD,1,LRAN,4,+LRT,0),U,4)=$S($G(LRDUZ):LRDUZ,$G(DUZ):DUZ,1:"")
30 . . . . S:'$P(^(0),U,5) $P(^(0),U,5)=LRNOW
31 . . . . S $P(^(0),U,6)="",$P(^(0),U,8)=$G(LRCDEF)
32 . . I $P($G(LRPARAM),U,14),$P($G(^LRO(68,+LRAA,0)),U,16) S ^LRO(68,"AA",LRAA_"|"_LRAD_"|"_LRAN_"|"_LRT)=""
33 . . K A2(LRT)
34 . . I +$G(LRDPF)=2,$$VER^LR7OU1<3 D
35 . . . N I,Y
36 . . . S Y=LRNOW,I=LRT D V^LROR ;OE/RR 2.5
37 ;-K ZZCARE,ZRECORD I $D(^LR(LRDFN,.3)),^LR(LRDFN,.3)'="" D FCS ; CJS/MPLS 12-4-91 LINK TO CIS ; CJS/MPLS 3-16-92 KILL LOCAL VARIABLES
38 ;-I $P(^LR(LRDFN,0),U,2)=2 I '$D(ZZCARE) S ZRECORD=0,ZRECORD=$O(^SC("C",LRLLOC,ZRECORD)) I ZRECORD'="",$D(^LRTXFCS(5000024,1,618001,"B",ZRECORD)) D FCS ; CJS/MPLS 3-16-92 LINE ADDED TO CHECK IF REQUESTING LOCATION IS CAREVUE SUPPORTED ++RG
39 S D1=1,X=0 F S X=$O(^TMP("LR",$J,"TMP",X)) Q:X<1 S LRT=+^(X) I $D(LRM(X)) D REQ
40 S:$D(^LRO(69,LRODT,1,LRSN,0)) ^(3)=$S($D(^(3)):+^(3),1:LRNOW) S:'$P(^(3),U,2) $P(^(3),U,2)=LRNOW
41 I D1,'$D(A2) S:'$P(^LRO(68,LRAA,1,LRAD,1,LRAN,3),U,4) $P(^(3),U,4)=LRNOW,^LRO(68,LRAA,1,LRAD,1,"AC",LRNOW,LRAN)=""
42 ; Class I CareVue routine TASKED if CareVue ward - pwc/10-2000
43 D
44 . N I,LR7DLOC D IN5^VADPT S LR7DLOC=$G(^DIC(42,+$P($G(VAIP(5)),"^"),44))
45 . Q:'LR7DLOC D:$D(^LAB(62.487,"C",LR7DLOC)) ;good ward location
46 . . S ZTRTN="^LA7DLOC",ZTDESC="LAB AUTOMATION CAREVUE SUPPORTED WARDS"
47 . . S ZTIO="",ZTDTH=$H,ZTSAVE("L*")="" D ^%ZTLOAD
48 . . K ZTSAVE,ZTSK,ZTRTN,ZTIO,ZTDTH,ZTDESC,ZTREQ,ZTQUEUED
49 ;D ^VEICVLOC ;* PLS 6/3/99 -For HL7 interface
50 I D1,'$D(A2),LRAD'=LRACD S:'$P(^LRO(68,LRAA,1,LRACD,1,LRAN,3),U,4) $P(^(3),U,4)=LRNOW,^LRO(68,LRAA,1,LRACD,1,"AC",LRNOW,LRAN)=""
51 D XREF I $D(^LRO(68,LRAA,.2))'[0 X ^(.2)
52 N CORRECT S:$G(LRCORECT) CORRECT=1 D NEW^LR7OB1(LRODT,LRSN,"RE",,.LRORTST)
53 L -^LR(LRDFN,LRSS,LRIDT) ;unlock
54 Q
55XREF ;from COM1^LRVER4 and VER^LRVER3A
56 I +$G(LRDPF)=2,$$VER^LR7OU1<3 D EN^LROR(LRAA,LRAD,LRAN) ;OE/RR 2.5
57 I LRDPF=62.3 S ^LRO(68,LRAA,1,LRAD,1,"AD",DT,LRAN)="" Q
58 S LRPRAC=$$PRAC^LRX($P(^LR(LRDFN,LRSS,LRIDT,0),U,10)) ;get doc name
59 S ^LRO(68,LRAA,1,LRAD,1,"AD",DT,LRAN)=""
60 S ^LRO(69,9999999-LRIDT\1,1,"AL",$E(LRLLOC,1,15),$E(PNM,1,20),LRDFN)=""
61 S ^LRO(69,9999999-LRIDT\1,1,"AP",LRPRAC,$E(PNM,1,20),LRDFN)=""
62 S ^LRO(69,DT,1,"AN",$E(LRLLOC,1,15),LRDFN,LRIDT)=""
63 S ^LRO(69,DT,1,"AR",$E(LRLLOC,1,15),$E(PNM,1,20),LRDFN)=""
64 S ^LRO(69,"AN",$E(LRLLOC,1,20),LRDFN,LRIDT)=""
65 D CHSET^LRPX(LRDFN,LRIDT)
66 Q:'$P(LRPARAM,U,3)
67TSKM F KK="LRDFN","LRAA","LRAOD","LRAD","LRAN","LRIDT","LRSS","LRLLOC","LRSN","LRODT" S ZTSAVE(KK)=""
68 N %X S ZTRTN="DQ^LRTP",ZTIO="",ZTDTH=$H,ZTDESC="LAB INTERIM REPORTS" D ^%ZTLOAD
69 K KK,ZTSK,ZTRTN,ZTDTH,ZTSAVE,ZTIO Q
70REQ ;
71 Q:$P($G(LRSB(X)),U)="comment"
72 I $D(LRSB(X)),$P(LRSB(X),U)="canc" Q
73 I $D(LRSB(X)),$P(LRSB(X),U)'["pending" Q
74 I $L($P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0)),U,6)) Q
75 S:'$G(LRALERT) LRALERT=$S($G(LROUTINE):LROUTINE,1:9)
76 S D1=0 N A,LRPPURG
77 I $D(LRSB(X)),LRSB(X)["pending",$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0))#2 D G REQ1
78 . S $P(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0),U,4)="",$P(^(0),U,5,6)="^",$P(^(0),U,9)=+$G(LRM(X,"P"))
79 I '$D(LRSB(X)),'$L($P($G(^LR(LRDFN,"CH",LRIDT,X)),U)) S $P(^(X),U)="pending"
80 I '$D(LRSB(X)),$P($G(^LR(LRDFN,"CH",LRIDT,X)),U)'="pending" Q
81 I $D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0))#2 S $P(^(0),U,4,5)="^",A=$P(^(0),U,2) I A>49 S $P(^(0),U,2)=$S(A=50:9,1:A-50)
82 I '$D(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0))#2 D
83 . S ^LRO(68,LRAA,1,LRAD,1,LRAN,4,"B",+LRT,+LRT)=""
84 . S LRPPURG=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,4,+$G(LRM(X,"P")),0)),U,2)
85 . S:'LRPPURG LRPPURG=$S($G(LRALERT):+LRALERT,1:9)
86 . S ^LRO(68,LRAA,1,LRAD,1,LRAN,4,+LRT,0)=+LRT_U_LRPPURG,$P(^(0),U,9)=+$G(LRM(X,"P"))
87 . S $P(^LRO(68,LRAA,1,LRAD,1,LRAN,4,0),U,3)=+LRT,$P(^(0),U,4)=$P(^(0),U,4)+1 Q
88REQ1 ;
89 Q:LRACD=LRAD I $D(^LRO(68,LRAA,1,LRACD,1,LRAN,4,+LRT,0))#2,'$L($P(^(0),U,6)) S ^(0)=$P(^(0),U,1,2),$P(^(0),U,7)=1,$P(^(0),U,9)=+$G(LRM(X,"P"))
90 K CNT,LRAMC Q
91FCS ; SET UP FOR FOREIGN COMPUTER SYSTEM ; CJS/MPLS 12-4-91 LINK TO CIS
92 ;-S:'$D(ZRECORD) ZZCARE=1 S:$D(ZRECORD) ZTSAVE("LRLLOC")="" ; CJS/MPLS 3-18-92 SET ZZCARE IF PATIENT IN ICU'S, SET ZTSAVE IF TEST REQUESTED FROM PAR/OR
93 ;-F KK="LRDFN","LRIDT","DFN" S ZTSAVE(KK)=""
94 ;-S ZTRTN="EN^LAFCCVX2",ZTIO="",ZTDTH=$H D ^%ZTLOAD
95 ;-Q
Note: See TracBrowser for help on using the repository browser.