LR7OSMZU ;DALOI/STAFF - Silent Micro rpt cont. ;11/05/09 12:04
;;5.2;LAB SERVICE;**121,244,350**;Sep 27, 1994;Build 230
;
;
FH ;from 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 $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 $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
N LRI,LRPF,LRX
;
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 ----")
;
; Print header with name of facility printing report.
I $$GET^XPAR("DIV^PKG","LR REPORTS FACILITY PRINT",1,"Q")>1 D PFAC
;
; Display reporting lab
I $$GET^XPAR("DIV^PKG","LR REPORTS FACILITY PRINT",1,"Q")#2 D
. S LRX=+$G(^LR(LRDFN,"MI",LRIDT,"RF"))
. I LRX D RL(LRX)
;
;D LINE^LR7OSUM4
K LRX
D ORUA^LRRP1(.LRX,LRDFN,"MI",LRIDT,1)
S LRI=0
F S LRI=$O(LRX(LRI)) Q:LRI<1 D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,LRX(LRI))
;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 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
. D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Preliminary Comments: ")
. S J=0
. 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
;
;
RL(LRX) ; Set reporting lab into TMP global
; Call with LRX = IEN of entry in file #4
;
N LINE
S LINE=$$PLSADDR^LR7OSUM2(LRX)
D LINE^LR7OSUM4
D LINE^LR7OSUM4
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Reporting Lab: "_$P(LINE,"^"))
D LINE^LR7OSUM4
S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT," "_$P(LINE,"^",2))
D LINE^LR7OSUM4
Q
;
;
PFAC ; Print header with name of facility printing report.
;
N LRI,LRPF
D PFAC^LRRP1(DUZ(2),0,1,.LRPF)
S LRI=0
F S LRI=$O(LRPF(LRI)) Q:'LRI D LN^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(CCNT,CCNT,LRPF(LRI))
D LINE^LR7OSUM4 S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(CCNT,CCNT,"As of: "_$$HTE^XLFDT($H,"1M"))
D LINE^LR7OSUM4,LINE^LR7OSUM4
;
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLR7OSMZU 3585 printed Dec 13, 2024@02:05:37 Page 2
LR7OSMZU ;DALOI/STAFF - Silent Micro rpt cont. ;11/05/09 12:04
+1 ;;5.2;LAB SERVICE;**121,244,350**;Sep 27, 1994;Build 230
+2 ;
+3 ;
FH ;from LR7OSMZ2, LR7OSMZ5
+1 QUIT
+2 ;
+3 ;
FHR ;from LR7OSMZ1, LR7OSMZ2
+1 DO REFS
+2 QUIT
+3 ;
+4 ;
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
+5 ;
+6 ;
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
+4 ;
+5 ;
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 $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 $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
+14 ;
+15 ;
HDR ;from LR7OSMZ1
+1 NEW LRI,LRPF,LRX
+2 ;
+3 SET LRPG=LRPG+1
SET LRJ02=1
+4 DO LINE^LR7OSUM4
+5 SET X=GIOM/2-(12/2+5)
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(X,CCNT,"---- MICROBIOLOGY ----")
+6 ;
+7 ; Print header with name of facility printing report.
+8 IF $$GET^XPAR("DIV^PKG","LR REPORTS FACILITY PRINT",1,"Q")>1
DO PFAC
+9 ;
+10 ; Display reporting lab
+11 IF $$GET^XPAR("DIV^PKG","LR REPORTS FACILITY PRINT",1,"Q")#2
Begin DoDot:1
+12 SET LRX=+$GET(^LR(LRDFN,"MI",LRIDT,"RF"))
+13 IF LRX
DO RL(LRX)
End DoDot:1
+14 ;
+15 ;D LINE^LR7OSUM4
+16 KILL LRX
+17 DO ORUA^LRRP1(.LRX,LRDFN,"MI",LRIDT,1)
+18 SET LRI=0
+19 FOR
SET LRI=$ORDER(LRX(LRI))
if LRI<1
QUIT
DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,LRX(LRI))
+20 ;S ^TMP("LRC",$J,GCNT,0)=$$S^LR7OS(1,CCNT,"Accession: "_LRACC)_$$S^LR7OS(40,CCNT,"Received: "_LRRC)
+21 ;
+22 DO LINE^LR7OSUM4
+23 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Collection sample: "_LRCS)_$$S^LR7OS(40,CCNT,"Collection date: "_LRTK)
+24 IF LRCS'=LRST
IF LRPG=1
DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Site/Specimen: "_LRST)
+25 IF LRPG=1
Begin DoDot:1
+26 DO LINE^LR7OSUM4
+27 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Provider: "_LRDOC)
+28 DO LINE^LR7OSUM4
+29 IF LRCMNT'=""
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Comment on specimen: "_$SELECT($LENGTH(LRCMNT)>58:"",1:LRCMNT))
DO LINE^LR7OSUM4
+30 IF $LENGTH(LRCMNT)>58
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,LRCMNT)
DO LINE^LR7OSUM4
End DoDot:1
+31 QUIT
+32 ;
+33 ;
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))
Begin DoDot:1
+3 DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Preliminary Comments: ")
+4 SET J=0
+5 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
+6 DO LINE^LR7OSUM4
+7 QUIT
+8 ;
+9 ;
RL(LRX) ; Set reporting lab into TMP global
+1 ; Call with LRX = IEN of entry in file #4
+2 ;
+3 NEW LINE
+4 SET LINE=$$PLSADDR^LR7OSUM2(LRX)
+5 DO LINE^LR7OSUM4
+6 DO LINE^LR7OSUM4
+7 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT,"Reporting Lab: "_$PIECE(LINE,"^"))
+8 DO LINE^LR7OSUM4
+9 SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(1,CCNT," "_$PIECE(LINE,"^",2))
+10 DO LINE^LR7OSUM4
+11 QUIT
+12 ;
+13 ;
PFAC ; Print header with name of facility printing report.
+1 ;
+2 NEW LRI,LRPF
+3 DO PFAC^LRRP1(DUZ(2),0,1,.LRPF)
+4 SET LRI=0
+5 FOR
SET LRI=$ORDER(LRPF(LRI))
if 'LRI
QUIT
DO LN^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(CCNT,CCNT,LRPF(LRI))
+6 DO LINE^LR7OSUM4
SET ^TMP("LRC",$JOB,GCNT,0)=$$S^LR7OS(CCNT,CCNT,"As of: "_$$HTE^XLFDT($HOROLOG,"1M"))
+7 DO LINE^LR7OSUM4
DO LINE^LR7OSUM4
+8 ;
+9 QUIT