source: FOIAVistA/trunk/r/LAB_SERVICE-LR-LS/LRUE.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: 2.1 KB
Line 
1LRUE ;AVAMC/REG - RESULTS FOR SELECTED LAB TESTS ;3/3/94 12:11 ;
2 ;;5.2;LAB SERVICE;;Sep 27, 1994
3 W !!?10,"Find results for one or more tests (maximum of 13)",!?23,"from one date to another",! D END
4 F A=1:1:13 S DIC=60,DIC(0)="AEMQZ",DIC("S")="I $P(^(0),U,5)[""CH""" D ^DIC K DIC Q:X=""!(X[U) S LRC(A)=0,N(A)=$P(^LAB(60,+Y,.1),"^"),L(A)=$P($P(Y(0),U,5),";",2)
5 G:A=1 END D B^LRU G:Y<0 END S LRLDT=9999998-LRLDT,LRSDT=9999999-LRSDT
6 S ZTRTN="QUE^LRUE" D BEG^LRUTL G:POP!($D(ZTSK)) END
7QUE U IO S LRA=0,Z(2)=$O(^LAB(61,"B","SERUM",0)),Z(3)=$O(^LAB(61,"B","BLOOD",0)),Z(5)=$O(^LAB(61,"B","PLASMA",0)) D L^LRU,S^LRU,H
8 F LRDFN=0:0 S LRDFN=$O(^LR(LRDFN)) Q:'LRDFN I $D(^LR(LRDFN,0)),$P(^(0),"^",2)'=62.3 S LRI=LRLDT,W=0 D D
9 D:$Y>50 H W !!?30,"Summary Report",!,"Patient count: ",LRA
10 F A=0:0 S A=$O(LRT(A)) Q:'A W !,N(A),?8,"Repeat tests in one day:",$J(LRT(A),6) W:LRT(A) ?40,"(",$J(LRT(A)*100\LRC(A),2),"%)" W ?46,"Total tests:",$J(LRC(A),5)
11 D END^LRUTL,END Q
12D F A=0:0 S LRI=$O(^LR(LRDFN,"CH",LRI)) Q:'LRI!(LRI>LRSDT) F B=0:0 S B=$O(L(B)) Q:'B I $D(^LR(LRDFN,"CH",LRI,L(B))) D W Q
13 D S Q
14W S W=W+1,X=^LR(LRDFN,"CH",LRI,0),Y=+X_"000",T=$P(X,"^",5),T(1)=$E(Y,4,5)_"/"_$E(Y,6,7)_" "_$S(Y[".":$E(Y,9,10)_":"_$E(Y,11,12),1:""),LRD=$P(Y,".")
15 I W=1 S LRD(1)=LRD,LRA=LRA+1,X=^LR(LRDFN,0),Y=$P(X,"^",3),(LRDPF,X)=$P(X,"^",2),X=^DIC(X,0,"GL"),V=@(X_Y_",0)"),LRP=$P(V,"^"),SSN=$P(V,"^",9),LRL=$S($D(@(X_Y_".1)")):^(.1),$D(^LR(LRDFN,.1)):^(.1),1:"") D SSN^LRU
16 D:$Y>60 H1 W:W=1 !!,SSN,?19,$E(LRL,1,5),?44,LRP W !,T(1) W:T'=Z(2)&(T'=Z(3))&(T'=Z(5)) ?13,$E($P(^LAB(61,T,0),"^"),1,10)
17 F X=0:0 S X=$O(L(X)) Q:'X I $D(^LR(LRDFN,"CH",LRI,L(X))) S Y=$P(^(L(X)),"^") W ?(16+(X*8)),$J(Y,7) I Y'["canc" S:'$D(LRB(X)) LRB(X)=-1 S LRB(X)=LRB(X)+1,LRC(X)=LRC(X)+1
18 I LRD'=LRD(1) S LRD(1)=LRD D S
19 Q
20S F Y=0:0 S Y=$O(LRB(Y)) Q:'Y S:'$D(LRT(Y)) LRT(Y)=0 S LRT(Y)=LRT(Y)+LRB(Y)
21 K LRB Q
22H S LRQ=LRQ+1,%DT="T",X="N" D ^%DT,D^LRU W @IOF,!,Y,?23,"LABORATORY SERVICE ",LRQ(1),?IOM-10,"Pg:",LRQ,!,"From: ",LRSTR," To: ",LRLST,!?3,"SSN",?19,"Loc",?44,"Patient",!?3,"DATE" F X=0:0 S X=$O(N(X)) Q:'X W ?(16+(X*8)),$J(N(X),7)
23 W !,LR("%") Q
24H1 D H I W>1 W !,SSN,?19,$E(LRL,1,5),?44,LRP
25 Q
26END D V^LRU Q
Note: See TracBrowser for help on using the repository browser.