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

LRMITRZ3.m

Go to the documentation of this file.
LRMITRZ3 ;AVAMC/REG,SLC/BA- MICRO TRENDS CONTINUED ; 10/7/87  08:23 ;
 ;;V~5.0~;LAB;;02/27/90 17:09
 ;from LRMITRZ2
REPORT S LRT="O" I LRM(LRT)'="N" S LRSINGLE=$S(LRM(LRT)="S":1,1:0) S LRPG=0 D HDR,BUG
 F LRT="S","L","D","P","C" I LRM(LRT)'="N" S LRSINGLE=$S(LRM(LRT)="S":1,1:0) S LRPG=0 D HDR,C
 Q
BUG S LRBI=0 F I=0:0 S LRBI=$O(^UTILITY($J,"B",LRBI)) Q:LRBI=""  S LRBG=$O(^UTILITY($J,"B",LRBI,0)) I LRM(LRT)="A"!(LRSINGLE&(LRBG=LRM(LRT,"S"))) D:$Y>60 HDR W !!,$E(LRBI,2,99),!,?18,$J(^UTILITY($J,"BG",LRBG),5) D ANTI
 Q
ANTI S LRLIN="",$P(LRLIN,"|     ",O+1)="|",LRTOT=LRLIN,LRANTI=0 F I=0:0 S LRANTI=$O(^UTILITY($J,"BAS",LRBG,LRANTI)) Q:LRANTI=""  S LRND=^UTILITY($J,LRBA,LRBG,LRANTI),LRSM=+LRND D WRT
 D NUM
 Q
C S LRCT=LRT_"T",LRCBA=LRT_"BA",LRCTB=LRT_"TB"
 S S=0 F I=0:0 S S=$O(^UTILITY($J,LRCBA,S)) Q:S=""  I LRM(LRT)="A"!(LRSINGLE&(S=LRM(LRT,"S"))) D:$Y>60 HDR W !!,S W:LRT="S"!(LRT="C") " (",^UTILITY($J,LRCT,S),"):" W !,"---------------" D B
 Q
B S LRBI=0 F I=0:0 S LRBI=$O(^UTILITY($J,LRCBA,S,LRBI)) Q:LRBI=""  D:$Y>60 HDR W !!,$P(^LAB(61.2,LRBI,0),U),!,?18,$J(^UTILITY($J,LRCTB,S,LRBI),5) D A
 Q
A S LRLIN="",$P(LRLIN,"|     ",O+1)="|",LRTOT=LRLIN,LRANTI=0 F I=0:0 S LRANTI=$O(^UTILITY($J,LRCBA,S,LRBI,LRANTI)) Q:LRANTI=""  S LRND=^UTILITY($J,LRCBA,S,LRBI,LRANTI),LRSM=+LRND D WRT
 D NUM
 Q
WRT S $P(LRLIN,"|",LRZ(LRANTI)+1)=$J($P(LRND,U,2)/LRSM*100,5,1),$P(LRTOT,"|",LRZ(LRANTI)+1)=LRSM_$E("     ",1,5-$L(LRSM))
 Q
NUM W ?23,LRLIN,!
 D:$Y>60 HDR W !?5,"# tested",?23,LRTOT
 Q
HDR S LRPG=LRPG+1,%DT="T",X="N" D ^%DT,D^LRU W @IOF,Y,?21,"ANTIBIOTIC TREND REPORT  (from: ",LRBEG," to: ",LRFIN,"   ",+^UTILITY($J,0)," patients)"
 W ?100,$S(LRT="O":"BY ORGANISM",LRT="S":"BY SITE/SPECIMEN",LRT="L":"BY LOCATION",LRT="P":"BY PATIENT",LRT="C":"BY COLLECTION SAMPLE",1:"BY PHYSICIAN"),?122,"PAGE ",$J(LRPG,5)
 I LRLOS W !,?2,"** Reports only those specimens collected > ",LRLOS,$S(LRLOS>1:" days",1:" day")," from admission date **"
 W !?23 F I=0:0 S I=$O(B(I)) Q:I=""  W "| ",$P(B(I),U,2)," "
 I $D(LRAP) W "|",!,"* ANTIBIOTIC PATTERN *",?23 F I=0:0 S I=$O(B(I)) Q:I=""  W "|  ",$S($L($P(B(I),U,3)):$P(B(I),U,3),1:" "),"  "
 W "|",! F X=1:1:IOM-1 W "-"
 Q