LRAPTT1 ; IHS/DIR/AAB - TURNAROUND TIME PATH 2/13/98 09:42 ; [ 07/09/1998 9:14 AM ]
;;5.2;LR;**1002,1006**;SEP 01, 1998
;
;;5.2;LAB SERVICE;**72,201**;Sep 27, 1994
I $D(LR("F")),IOST?1"C".E D M^LRU Q:LR("Q")
D F^LRU W !,$S('$D(LR("AU")):"",LR("AU")=1:"PAD",1:"FAD")," Turnaround time for ",LRO(68)," (",LRABV,")" W:LRL " (Exceeding ",LRB," ",$S(LRB=1:"day",1:"days"),")" W !,"From: ",LRSTR," To: ",LRLST,?57,"Lab work"
W !,"Acc #",?6,$S(LRSS="AU":" Performed",1:" Rec'd"),?19,"Entry",?40,"ID",?43,"Typist",?51,$S('$D(LR("AU")):"Released",LR("AU")=2:"Released",1:"Completed"),?61,"Days",?66,"Pathologist",!,LR("%") Q
T R !,"Enter limit in days: ",X:DTIME Q:X=""!(X[U) I +X'=X!(X<1)!(X>120) W $C(7),!,"Must be 1-120 days." G T
S LRB=X,LRL=X+1 Q
F S B=0 F A=0:0 S A=$O(LRM(A)) Q:'A I A'=2,LRM(A) S B=1 Q
Q:'B F LRA=0:0 S LRA=$O(LRM(LRA)) Q:'LRA I LRM(LRA) D:$Y>(IOSL-8) LRAPTT1 Q:LR("Q") D E
Q
E W !!,"Total ",$P(^DIC(LRA,0),U)," file cases: ",LRM(LRA) S X=LRM(LRA)-LRF(LRA) W:X !?3,"Incomplete cases:",$J(X,4) W !?3,"Complete cases:",$J(LRF(LRA),4)
W:LRF(LRA) !?5,"Average turnaround time (days): ",$J(LRE(LRA)/LRF(LRA),2,2) W:LRL&(LRF(LRA)) ?44,"Cases exceeding limit: ",LRA(LRA)," (",$J(LRA(LRA)/LRF(LRA)*100,2,2),"%)" Q
LRAPTT1 ; IHS/DIR/AAB - TURNAROUND TIME PATH 2/13/98 09:42 ; [ 07/09/1998 9:14 AM ]
+1 ;;5.2;LR;**1002,1006**;SEP 01, 1998
+2 ;
+3 ;;5.2;LAB SERVICE;**72,201**;Sep 27, 1994
+4 IF $DATA(LR("F"))
IF IOST?1"C".E
DO M^LRU
IF LR("Q")
QUIT
+5 DO F^LRU
WRITE !,$SELECT('$DATA(LR("AU")):"",LR("AU")=1:"PAD",1:"FAD")," Turnaround time for ",LRO(68)," (",LRABV,")"
IF LRL
WRITE " (Exceeding ",LRB," ",$SELECT(LRB=1:"day",1:"days"),")"
WRITE !,"From: ",LRSTR," To: ",LRLST,?57,"Lab work"
+6 WRITE !,"Acc #",?6,$SELECT(LRSS="AU":" Performed",1:" Rec'd"),?19,"Entry",?40,"ID",?43,"Typist",?51,$SELECT('$DATA(LR("AU")):"Released",LR("AU")=2:"Released",1:"Completed"),?61,"Days",?66,"Pathologist",!,LR("%")
QUIT
T READ !,"Enter limit in days: ",X:DTIME
IF X=""!(X[U)
QUIT
IF +X'=X!(X<1)!(X>120)
WRITE $CHAR(7),!,"Must be 1-120 days."
GOTO T
+1 SET LRB=X
SET LRL=X+1
QUIT
F SET B=0
FOR A=0:0
SET A=$ORDER(LRM(A))
IF 'A
QUIT
IF A'=2
IF LRM(A)
SET B=1
QUIT
+1 IF 'B
QUIT
FOR LRA=0:0
SET LRA=$ORDER(LRM(LRA))
IF 'LRA
QUIT
IF LRM(LRA)
IF $Y>(IOSL-8)
DO LRAPTT1
IF LR("Q")
QUIT
DO E
+2 QUIT
E WRITE !!,"Total ",$PIECE(^DIC(LRA,0),U)," file cases: ",LRM(LRA)
SET X=LRM(LRA)-LRF(LRA)
IF X
WRITE !?3,"Incomplete cases:",$JUSTIFY(X,4)
WRITE !?3,"Complete cases:",$JUSTIFY(LRF(LRA),4)
+1 IF LRF(LRA)
WRITE !?5,"Average turnaround time (days): ",$JUSTIFY(LRE(LRA)/LRF(LRA),2,2)
IF LRL&(LRF(LRA))
WRITE ?44,"Cases exceeding limit: ",LRA(LRA)," (",$JUSTIFY(LRA(LRA)/LRF(LRA)*100,2,2),"%)"
QUIT