Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BLR2SORD

BLR2SORD.m

Go to the documentation of this file.
BLR2SORD ; IHS/DIR/FJE - SLC/RWF- ABNORMAL & CRITICAL VALUE REPORT 9/26/95 14:18 ;
 ;;5.2;BLR;;NOV 01, 1997
 ;;copied routine DWLRSORD modified by Walts (PIMC) to print for selected provider.  SJ
 ;;MODIFIED BY FJ FOR LAB 5.2 ***CLASS 3 ***
 I '$D(DUZ) W "DUZ NOT SET - ABORT" Q
 I '$D(^VA(200,DUZ,0)) W "NOT A VALID USER - ABORTING" Q
 ;;D ^DWSETSCR,^%AUCLS,HEADING
 S DIC("B")=$P(^VA(200,DUZ,0),"^",1),DIC("A")="Select PROVIDER NAME:"
 S DIC=200,DIC(0)="AEMQ",DIC("S")="I $L($P(^VA(200,Y,0),U,16))"
 D ^DIC I Y<1 K DIC Q
 S DWNA=$P(Y,"^",2)
 ;S DWPDFN=$O(^DIC(16,"B",DWNA,0))
 S DWPDFN=+Y
 ;;
 D HEADING
 S LREDT="T-1",LREND=0 D ^LRWU3 S %ZIS="Q" D ^%ZIS Q:POP
 I $D(IO("Q")) K IO("Q") S ZTRTN="DQ^BLR2SORD" D ZTLOAD D ^%ZTLOAD G END
DQ U IO S LREND=0 D HDR:$D(AZQ21) S AZQ21=""
DT F LRPDT=LREDT-.01:0 S LRPDT=$O(^LRO(69,LRPDT)) Q:LRPDT<LREDT!(LRPDT>LRSDT)  D LRLLOC Q:LREND
END D ^%ZISC
 K DWNA,DWPDFN,DWPRVNUM,DWP,DWPRVNA,DIC,DWY,DWRLOW,DWRHIGH,DWR1,DWRANGE
 K LRSDT,LREDT,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK
 K %H,DTOUT,I,L0,LAST,LRAA,LRAD,LRDFN,LRDPF,LREND,LRFAN,LRIDT,LRLAN,LRLLOC,LRLOX,LRPDT,LRSTAR,LRTX,LRWDTL,PNM,POP,SSN,HRCN,T  ;IHS/ANMC/CLS 10/11/92 HRCN
 Q
 ;
ZTLOAD S ZTSAVE("LREDT")="",ZTSAVE("LRSDT")="",ZTSAVE("DWNA")="",ZTSAVE("DWPDFN")="",ZTSAVE("DWPRVNUM")="",ZTSAVE("DWP")="",ZTSAVE("DWPRVNA")="",ZSAVE("DWY")="",ZSAVW("DWRLOW")="",ZTSAVE("DWRHIGH")="" Q
 ;
LRLLOC S LRLLOC="" F LRLOX=0:0 S LRLLOC=$O(^LRO(69,LRPDT,1,"AN",LRLLOC)) Q:LRLLOC=""  D PT Q:LREND
 Q
PT S DWP="" F LRDFN=0:0 S LRDFN=$O(^LRO(69,LRPDT,1,"AN",LRLLOC,LRDFN)) Q:LRDFN<1  D DWSETPRV D:(DWPDFN=DWPRVNUM) LRIDT Q:LREND
 Q
LRIDT F LRIDT=0:0 S LRIDT=$O(^LRO(69,LRPDT,1,"AN",LRLLOC,LRDFN,LRIDT)) Q:LRIDT<1  D LOOK Q:LREND
 Q
LOOK K T S L0=$S($D(^LR(LRDFN,"CH",LRIDT,0)):^(0),1:"") Q:L0=""
 S T=0 F I=1:0 S I=$O(^LR(LRDFN,"CH",LRIDT,I)) Q:I<1  I $P(^(I),U,2)'="" S T=T+1,T(I)=^(I)
 D PRINT:T Q
PRINT D SETUPDT S X=^LR(LRDFN,0),LRDPF=$P(X,U,2),DFN=$P(X,U,3) D PT^LRX
 D HDR:$Y>(IOSL-7) Q:LREND  W !!,"Provider: "_DWPRVNA,!,PNM,?35,HRCN W:LRDPF=2 " ",$S($D(^DPT(DFN,.1)):^(.1),1:LRLLOC) W ?60,$P(L0,U,6)  W:$D(DWY) !,?35,"Collection Date/Time: "_DWY ;IHS/ANMC/CLS 10/11/92
 F I=0:0 S I=$O(T(I)) Q:I<1  S LRTX=$O(^LAB(60,"C","CH;"_I_";1",0)) I LRTX>0 W !,?5,$J($P(^LAB(60,LRTX,0),U,1),20),$J($P(T(I),U,1),8)," ",$P(T(I),U,2) D SETRANGE W ?45,"Low: "_DWRLOW,?60,"High: "_DWRHIGH D:$Y>(IOSL-7) HDR Q:LREND
 Q
HDR D WAIT Q:LREND  W @IOF,"SPECAL REPORT: SEARCHING FOR ABNORMAL & CRITICAL FLAGS ** By Selected Provider",!,?50," " D STAMP^LRX
 D DASH^LRX
 Q
WAIT Q:IOST'["C-"  W *7 R !!?20,"Press any key to continue, ""^"" to quit.",X:DTIME S:X["^" LREND=1
 Q
DWSETPRV S DWPRVNUM=""
 F  S DWP=$O(^LRO(69,LRPDT,1,"AA",LRDFN,DWP)) Q:DWP=""  D C1
 Q
C1 S DWPRVNUM=$P(^LRO(69,LRPDT,1,DWP,0),"^",6)
 S DWPRVNA=$P(^VA(200,DWPRVNUM,0),"^",1)
 Q
HEADING W !,?7,"AIH Search for ABNORMAL & CRITICAL Flags by Slected Provider"
 W !!!,"Note: This report will only show results for which",!,DWNA," is recorded as being the ordering provider in the computer!"
 W !!,"     Verified results display based on the ORDERING Date.",!!!
 R:DTIME "Press RETURN to continue",X
 Q
SETUPDT I '$D(L0) S DWY="" Q
 S Y=$P(L0,"^",1)
 I '$D(Y)!(Y="") S DWY="" Q
 S DWY=$E(Y,4,5)_"/"_$E(Y,6,7)_"/"_$E(Y,2,3)_" "
 X ^DD("DD")
 S DWT=$P(Y,"@",2),DWY=DWY_$E(DWT,1,2)_":"_$E(DWT,4,5)
 Q
SETRANGE S DWRL0W="",DWRHIGH="" I '$D(L0) Q
 I '$D(LRTX) Q
 S DWR1=$P(L0,"^",5)
 I '$D(^LAB(60,LRTX,1,DWR1,0)) Q
 S DWRANGE=^LAB(60,LRTX,1,DWR1,0)
 I DWRANGE["$S" S XDW="S DWRLOW="_$P(DWRANGE,"^",2) X XDW S XDW="S DWRHIGH="_$P(DWRANGE,"^",3) X XDW Q
 S DWRLOW=$P(DWRANGE,"^",2),DWRHIGH=$P(DWRANGE,"^",3)
 Q