LR7OSMZU ;VA/SLC/DCM - Silent Micro rpt cont. ;8/11/97
;;5.2;LR;**1018,1030**;Nov 01, 1997
;;5.2;LAB SERVICE;**121,244**;Sep 27, 1994
FH ;from LR7OSMZ1, LR7OSMZ2, LR7OSMZ5
Q
FHR ;from LR7OSMZ1, LR7OSMZ2
D REFS
Q
REFS ;from LR7OSMZ1
S B=1,LREF=0
F S LREF=$O(LRBUG(LREF)) Q:LREF="" S LRIFN=LRBUG(LREF) D LIST Q:LREND
K LRBUG
Q
LIST Q:'$D(^LAB(61.2,LRIFN,"JR",0))
S LRNUM=0
F S LRNUM=$O(^LAB(61.2,LRIFN,"JR",LRNUM)) Q:LRNUM="" D WR Q:LREND
Q
WR ;
S X1=^LAB(61.2,LRIFN,"JR",LRNUM,0)
Q:$P(X1,U,7)'=1
I B=1 D LINE^LR7OSUM4,LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Reference(s): ")
S B=0
D LINE^LR7OSUM4,LINE^LR7OSUM4
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$J(LREF,2)_". "_$P(X1,U,2))
D LINE^LR7OSUM4
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,$P(X1,U))
D LINE^LR7OSUM4
I $L($P(X1,U,3)) S ^TMP("LRC",$J,GCNT,0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(CCNT,CCNT,$P(^LAB(95,$P(X1,U,3),0),U)_" "_$P(X1,U,4)_":")
S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(CCNT,CCNT,$P(X1,U,5))
I $L($P(X1,U,6)) S ^(0)=^TMP("LRC",$J,GCNT,0)_$$S^LR7OS(CCNT,CCNT,","_$E($P(X1,U,6),1,3)+1700)
Q
HDR ;from LR7OSMZ1
S LRPG=LRPG+1,LRJ02=1
D LINE^LR7OSUM4
S X=GIOM/2-(12/2+5),^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(X,CCNT,"---- MICROBIOLOGY ----")
D LINE^LR7OSUM4
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Accession: "_LRACC)_$$S^LR7OS(40,CCNT,"Received: "_LRRC)
D LINE^LR7OSUM4
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Collection sample: "_LRCS)_$$S^LR7OS(40,CCNT,"Collection date: "_LRTK)
I LRCS'=LRST,LRPG=1 D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Site/Specimen: "_LRST)
I LRPG=1 D
. D LINE^LR7OSUM4
. S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Provider: "_LRDOC)
. D LINE^LR7OSUM4
. I $L(LRCMNT) S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Comment on specimen: "_$S($L(LRCMNT)>58:"",1:LRCMNT)) D LINE^LR7OSUM4
. I $L(LRCMNT)>58 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LRCMNT) D LINE^LR7OSUM4
Q
PRE ;from LR7OSMZ2, LR7OSMZ3, LR7OSMZ4
Q:LRTUS["F"&('$D(^XUSEC("LRLAB",DUZ))!$D(LRWRDVEW))
I +$O(^LR(LRDFN,"MI",LRIDT,LRPRE,0)) D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Preliminary Comments: ") S J=0 D
. F S J=+$O(^LR(LRDFN,"MI",LRIDT,LRPRE,J)) Q:J<1 S X=^(J,0) D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(3,CCNT,X)
D LINE^LR7OSUM4
Q
;
; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
IHSKEY ; EP -- New "Key" for Micro Reports
D LINE^LR7OSUM4
S GCNT=GCNT+1,CCNT=1
S ^TMP("LRC",$J,GCNT,0)="S=Sensitive I=Intermediate R=Resistant NI=Not Immune I=Immune"
S GCNT=GCNT+1,CCNT=1
S ^TMP("LRC",$J,GCNT,0)="IB=Inducible Beta Lactam NR=Non Reactive WR=Weakly Reactive R=Reactive"
; ----- END IHS/OIT/MKK -- LR*5.2*1030
LR7OSMZU ;VA/SLC/DCM - Silent Micro rpt cont. ;8/11/97
+1 ;;5.2;LR;**1018,1030**;Nov 01, 1997
+2 ;;5.2;LAB SERVICE;**121,244**;Sep 27, 1994
FH ;from LR7OSMZ1, LR7OSMZ2, LR7OSMZ5
+1 QUIT
FHR ;from LR7OSMZ1, LR7OSMZ2
+1 DO REFS
+2 QUIT
REFS ;from LR7OSMZ1
+1 SET B=1
SET LREF=0
+2 FOR
SET LREF=$ORDER(LRBUG(LREF))
IF LREF=""
QUIT
SET LRIFN=LRBUG(LREF)
DO LIST
IF LREND
QUIT
+3 KILL LRBUG
+4 QUIT
LIST IF '$DATA(^LAB(61.2,LRIFN,"JR",0))
QUIT
+1 SET LRNUM=0
+2 FOR
SET LRNUM=$ORDER(^LAB(61.2,LRIFN,"JR",LRNUM))
IF LRNUM=""
QUIT
DO WR
IF LREND
QUIT
+3 QUIT
WR ;
+1 SET X1=^LAB(61.2,LRIFN,"JR",LRNUM,0)
+2 IF $PIECE(X1,U,7)'=1
QUIT
+3 IF B=1
DO LINE^LR7OSUM4
DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Reference(s): ")
+4 SET B=0
+5 DO LINE^LR7OSUM4
DO LINE^LR7OSUM4
+6 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,$JUSTIFY(LREF,2)_". "_$PIECE(X1,U,2))
+7 DO LINE^LR7OSUM4
+8 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,$PIECE(X1,U))
+9 DO LINE^LR7OSUM4
+10 IF $LENGTH($PIECE(X1,U,3))
SET ^TMP("LRC",$JOB,GCNT,0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,$PIECE(^LAB(95,$PIECE(X1,U,3),0),U)_" "_$PIECE(X1,U,4)_":")
+11 SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,$PIECE(X1,U,5))
+12 IF $LENGTH($PIECE(X1,U,6))
SET ^(0)=^TMP("LRC",$JOB,GCNT,0)_$$S^LR7OS(CCNT,CCNT,","_$EXTRACT($PIECE(X1,U,6),1,3)+1700)
+13 QUIT
HDR ;from LR7OSMZ1
+1 SET LRPG=LRPG+1
SET LRJ02=1
+2 DO LINE^LR7OSUM4
+3 SET X=GIOM/2-(12/2+5)
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(X,CCNT,"---- MICROBIOLOGY ----")
+4 DO LINE^LR7OSUM4
+5 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Accession: "_LRACC)_$$S^LR7OS(40,CCNT,"Received: "_LRRC)
+6 DO LINE^LR7OSUM4
+7 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Collection sample: "_LRCS)_$$S^LR7OS(40,CCNT,"Collection date: "_LRTK)
+8 IF LRCS'=LRST
IF LRPG=1
DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Site/Specimen: "_LRST)
+9 IF LRPG=1
Begin DoDot:1
+10 DO LINE^LR7OSUM4
+11 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Provider: "_LRDOC)
+12 DO LINE^LR7OSUM4
+13 IF $LENGTH(LRCMNT)
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Comment on specimen: "_$SELECT($LENGTH(LRCMNT)>58:"",1:LRCMNT))
DO LINE^LR7OSUM4
+14 IF $LENGTH(LRCMNT)>58
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,LRCMNT)
DO LINE^LR7OSUM4
End DoDot:1
+15 QUIT
PRE ;from LR7OSMZ2, LR7OSMZ3, LR7OSMZ4
+1 IF LRTUS["F"&('$DATA(^XUSEC("LRLAB",DUZ))!$DATA(LRWRDVEW))
QUIT
+2 IF +$ORDER(^LR(LRDFN,"MI",LRIDT,LRPRE,0))
DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Preliminary Comments: ")
SET J=0
Begin DoDot:1
+3 FOR
SET J=+$ORDER(^LR(LRDFN,"MI",LRIDT,LRPRE,J))
IF J<1
QUIT
SET X=^(J,0)
DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(3,CCNT,X)
End DoDot:1
+4 DO LINE^LR7OSUM4
+5 QUIT
+6 ;
+7 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1030
IHSKEY ; EP -- New "Key" for Micro Reports
+1 DO LINE^LR7OSUM4
+2 SET GCNT=GCNT+1
SET CCNT=1
+3 SET ^TMP("LRC",$JOB,GCNT,0)="S=Sensitive I=Intermediate R=Resistant NI=Not Immune I=Immune"
+4 SET GCNT=GCNT+1
SET CCNT=1
+5 SET ^TMP("LRC",$JOB,GCNT,0)="IB=Inducible Beta Lactam NR=Non Reactive WR=Weakly Reactive R=Reactive"
+6 ; ----- END IHS/OIT/MKK -- LR*5.2*1030