ORWRPL ; slc/dcm - Background GUI Lab Print Driver;10:36 AM 14 Jan 2000 ; 08 Feb 2001 09:02AM [7/2/01 7:27am]
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,109**;Dec 17, 1997
RPTLIST ; -- list of Lab reports
; <ID> ^ <report name> ^ <qualifier type> ^
; <qualifier type> = 0:none,2:DateTime
;;21^Cumulative^2
;;3^Interim^2
;;4^Interim for Selected Tests^2
;;20^Anatomic Path Report^0
;;2^Blood Bank Report^0
;;9^Microbiology Report^2
;;10^Lab Status Report^2
;;$$END
;
PRINT(ORY,ORIO,ORDFN,RPTID,ORDAYSBK,ORTESTS,ORALPHA,OROMEGA) ; -- print report entry point
; See RPC definition for details on input and output parameters
IF '$$CHK() G PRINTQ
N ZTDTH,ZTRTN,ZTSK,ZTDESC,ZTSAVE
S ZTIO=ORIO,ZTDTH=$H
S ZTDESC="GUI Lab Report Print"
S ZTRTN="DEQUE^ORWRPL"
S ZTSAVE("ORDFN")="",ZTSAVE("RPTID")="",ZTSAVE("ORDAYSBK")="",ZTSAVE("DUZ(")="",ZTSAVE("ORTESTS(")="",ZTSAVE("ORALPHA")="",ZTSAVE("OROMEGA")=""
D ^%ZTLOAD
I $D(ZTSK) D
. S ORY="0^Report queued. (Task #"_ZTSK_")"
E D
. S ORY="99^Task Rejected."
PRINTQ Q
REMOTE(ORY,ORIO,ORDFN,RPTID,ORHANDS) ;Print data for remote sites
; RPC: ORWRP PRINT REMOTE REPORT
N ZTDTH,ZTRTN,ZTSK,ZTDESC,ZTSAVE,I
S ZTIO=ORIO,ZTDTH=$H
S ZTDESC="Remote Lab Report Print"
S ZTRTN="DEQUE^ORWRPL"
F I="ORDFN","RPTID","ORHANDS(" S ZTSAVE(I)=""
D ^%ZTLOAD
I $D(ZTSK) D
. S ORY="0^Report queued. (Task #"_ZTSK_")"
E D
. S ORY="99^Task Rejected."
Q
;
PRINTW(ORTEXT,ORDFN,RPTID,ORDAYSBK,ORTESTS,ORALPHA,OROMEGA) ;Windows device print
N ZTQUEUED,ORHFS,ORSUB,ROOT,ORIO
N IOM,IOSL,IOST,IOF,IOT,IOS
S (ORSUB,ROOT)="ORDATA",ORIO="OR WINDOWS HFS"
S ORTEXT=$NA(^TMP(ORSUB,$J,1))
I '$$CHK() S @ORTEXT@(0)=ORY G PRINTWQ
S ORHFS=$$HFS^ORWRP()
D HFSOPEN^ORWRP("ORWRP",ORHFS,"W")
I POP D Q
. I $D(ROOT) D SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file")
D IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
N $ETRAP,$ESTACK
S $ETRAP="D ERR^ORWRP Q"
U IO
D DEQUE
D HFSCLOSE^ORWRP("ORWRP",ORHFS)
PRINTWQ Q
PRINTWR(ORTEXT,ORDFN,RPTID,ORHANDS) ;Windows Remote device print
N ZTQUEUED,ORHFS,ORSUB,ROOT,ORIO,ORHANDLE
N IOM,IOSL,IOST,IOF,IOT,IOS
S (ORSUB,ROOT)="ORDATA",ORIO="OR WINDOWS HFS",ORTEXT=$NA(^TMP(ORSUB,$J,1)),ORHANDLE="ORWRP"
S ORHFS=$$HFS^ORWRP()
D HFSOPEN^ORWRP(ORHANDLE,ORHFS,"W")
I POP D Q
. I $D(ROOT) D SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file")
D IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
N $ETRAP,$ESTACK
S $ETRAP="D ERR^ORWRP Q"
U IO
D DEQUE
D HFSCLOSE^ORWRP(ORHANDLE,ORHFS)
Q
CHK() ; -- do checks for required data
N OROK,FALSE,TRUE,ORRPT,TXT
S FALSE=0,TRUE=1
IF $G(ORIO)']"" S OROK=FALSE,ORY="1^No device selected." G CHKQ
IF '$G(RPTID) S OROK=FALSE,ORY="2^No report specified." G CHKQ
; -- get report definition
S (TXT,ORRPT)=""
F I=3:1 S TXT=$P($TEXT(RPTLIST+I),";;",2) Q:TXT="$$END"!(TXT="") I +TXT=RPTID S ORRPT=TXT Q
IF +ORRPT'=RPTID S OROK=FALSE,ORY="3^Report type specified is not valid." G CHKQ
IF $P(ORRPT,U,3)=2,'$G(ORDAYSBK),'$G(ORALPHA) S OROK=FALSE,ORY="4^No date range specified." G CHKQ
IF '$D(^DPT(+$G(ORDFN),0)) S OROK=FALSE,ORY="6^Patient specified is not valid." G CHKQ
S OROK=TRUE
CHKQ Q OROK
;
DEQUE ; -- logic to print queued report
; -- call build report logic
I '$O(ORHANDS(0)) D LOOP Q
N ORI,ORX
S ORI=0
F S ORI=$O(ORHANDS(ORI)) Q:'ORI S ORX=ORHANDS(ORI) D
. N ORY,PAGE,ORALPHA,OROMEGA,ORID
. D RTNDATA^XWBDRPC(.ORY,$P(ORX,"^",2))
. S:ORY="" ORY="ORY"
. S PAGE=1,ORALPHA=$P(ORX,"^",3),OROMEGA=$P(ORX,"^",4),ORID=$$ID(RPTID)
. D HEAD^ORWRPP1(ORDFN,PAGE,ORID,$P(ORX,"^"))
. D HURL^ORWRPP1(.ORY,ORDFN,ORID,1,$P(ORX,"^"))
Q
ID(ID) ;Get Report ID
I ID=21 Q "LAB CUMULATIVE ("_ORALPHA_" - "_OROMEGA_")"
I ID=3 Q "LAB INTERIM ("_ORALPHA_" - "_OROMEGA_")"
I ID=4 Q "LAB INTERIM FOR SELECTED TESTS ("_ORALPHA_" - "_OROMEGA_")"
I ID=20 Q "PATIENT ANATOMIC PATHOLOGY REPORT"
I ID=2 Q "PATIENT BLOOD BANK REPORT"
I ID=9 Q "MICROBIOLOGY REPORT ("_ORALPHA_" - "_OROMEGA_")"
I ID=10 Q "PATIENT LAB ORDER STATUS REPORT ("_ORALPHA_" - "_OROMEGA_")"
Q ""
LOOP ;
IF RPTID=21 D G DEQUEQ
. N ORY,PAGE,TEXT,X1,X2,X
. D CUM^ORWLR(.ORY,.ORDFN,.ORDAYSBK,.ORALPHA,.OROMEGA)
. Q:'$L(ORY)
. S PAGE=1,X1=DT,X2=-$G(ORDAYSBK,7)
. D C^%DTC
. S TEXT="LAB CUMULATIVE ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
. D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,TEXT)
IF RPTID=3 D G DEQUEQ
. N ORY,PAGE,TEXT,X
. I $L(ORDAYSBK),'$G(ORALPHA) S ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK),OROMEGA=$$NOW^XLFDT
. Q:'$G(ORALPHA) Q:'$G(OROMEGA)
. D INTERIM^ORWLRR(.ORY,.ORDFN,OROMEGA,.ORALPHA)
. Q:'$L(ORY)
. S PAGE=1,TEXT="LAB INTERIM ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
. D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
IF RPTID=4 D G DEQUEQ
. N ORY,PAGE,TEXT,X
. I $L(ORDAYSBK),'$G(ORALPHA) S ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK),OROMEGA=$$NOW^XLFDT
. Q:'$G(ORALPHA) Q:'$G(OROMEGA)
. D INTERIMS^ORWLRR(.ORY,.ORDFN,.OROMEGA,.ORALPHA,.ORTESTS)
. Q:'$L(ORY)
. S PAGE=1,TEXT="LAB INTERIM FOR SELECTED TESTS ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
. D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
IF RPTID=20 D G DEQUEQ
. N ORY,PAGE
. D AP^ORWRP1(.ORY,.ORDFN,.ID,.ORALPHA,.OROMEGA,.ORDTRNG,.REMOTE)
. Q:'$L(ORY)
. S PAGE=1
. D HEAD^ORWRPP1(ORDFN,PAGE,"PATIENT ANATOMIC PATHOLOGY REPORT",$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,"PATIENT ANATOMIC PATHOLOGY REPORT")
IF RPTID=2 D G DEQUEQ
. N ORY,PAGE
. D BLR^ORWRP1(.ORY,.ORDFN,.ID,.ORALPHA,.OROMEGA,.ORDAYSBK,.REMOTE)
. Q:'$L(ORY)
. S PAGE=1
. D HEAD^ORWRPP1(ORDFN,PAGE,"PATIENT BLOOD BANK REPORT",$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,"PATIENT BLOOD BANK REPORT")
IF RPTID=9 D G DEQUEQ
. N ORY,PAGE,TEXT,X
. I $L(ORDAYSBK),'$G(ORALPHA) S ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK),OROMEGA=$$NOW^XLFDT
. Q:'$G(ORALPHA) Q:'$G(OROMEGA)
. D MICRO^ORWLRR(.ORY,.ORDFN,.OROMEGA,.ORALPHA)
. Q:'$L(ORY)
. S PAGE=1,TEXT="MICROBIOLOGY REPORT ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
. D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
IF RPTID=10 D G DEQUEQ
. N ORY,PAGE,TEXT,X,ORVP
. S ORVP=ORDFN_";DPT("
. D EN1^LR7OSOS1(.ORY,ORVP,.ORALPHA,.OROMEGA,.ORDAYSBK)
. I '$O(^TMP("ORDATA",$J,1,0)) S ^TMP("ORDATA",$J,1,1,0)="",^TMP("ORDATA",$J,1,2,0)="No Orders found..."
. S PAGE=1,TEXT="PATIENT LAB ORDER STATUS REPORT ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
. D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D HURL^ORWRPP1(.ORY,ORDFN,TEXT)
DEQUEQ Q
ORWRPL ; slc/dcm - Background GUI Lab Print Driver;10:36 AM 14 Jan 2000 ; 08 Feb 2001 09:02AM [7/2/01 7:27am]
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,109**;Dec 17, 1997
RPTLIST ; -- list of Lab reports
+1 ; <ID> ^ <report name> ^ <qualifier type> ^
+2 ; <qualifier type> = 0:none,2:DateTime
+3 ;;21^Cumulative^2
+4 ;;3^Interim^2
+5 ;;4^Interim for Selected Tests^2
+6 ;;20^Anatomic Path Report^0
+7 ;;2^Blood Bank Report^0
+8 ;;9^Microbiology Report^2
+9 ;;10^Lab Status Report^2
+10 ;;$$END
+11 ;
PRINT(ORY,ORIO,ORDFN,RPTID,ORDAYSBK,ORTESTS,ORALPHA,OROMEGA) ; -- print report entry point
+1 ; See RPC definition for details on input and output parameters
+2 IF '$$CHK()
GOTO PRINTQ
+3 NEW ZTDTH,ZTRTN,ZTSK,ZTDESC,ZTSAVE
+4 SET ZTIO=ORIO
SET ZTDTH=$HOROLOG
+5 SET ZTDESC="GUI Lab Report Print"
+6 SET ZTRTN="DEQUE^ORWRPL"
+7 SET ZTSAVE("ORDFN")=""
SET ZTSAVE("RPTID")=""
SET ZTSAVE("ORDAYSBK")=""
SET ZTSAVE("DUZ(")=""
SET ZTSAVE("ORTESTS(")=""
SET ZTSAVE("ORALPHA")=""
SET ZTSAVE("OROMEGA")=""
+8 DO ^%ZTLOAD
+9 IF $DATA(ZTSK)
Begin DoDot:1
+10 SET ORY="0^Report queued. (Task #"_ZTSK_")"
End DoDot:1
+11 IF '$TEST
Begin DoDot:1
+12 SET ORY="99^Task Rejected."
End DoDot:1
PRINTQ QUIT
REMOTE(ORY,ORIO,ORDFN,RPTID,ORHANDS) ;Print data for remote sites
+1 ; RPC: ORWRP PRINT REMOTE REPORT
+2 NEW ZTDTH,ZTRTN,ZTSK,ZTDESC,ZTSAVE,I
+3 SET ZTIO=ORIO
SET ZTDTH=$HOROLOG
+4 SET ZTDESC="Remote Lab Report Print"
+5 SET ZTRTN="DEQUE^ORWRPL"
+6 FOR I="ORDFN","RPTID","ORHANDS("
SET ZTSAVE(I)=""
+7 DO ^%ZTLOAD
+8 IF $DATA(ZTSK)
Begin DoDot:1
+9 SET ORY="0^Report queued. (Task #"_ZTSK_")"
End DoDot:1
+10 IF '$TEST
Begin DoDot:1
+11 SET ORY="99^Task Rejected."
End DoDot:1
+12 QUIT
+13 ;
PRINTW(ORTEXT,ORDFN,RPTID,ORDAYSBK,ORTESTS,ORALPHA,OROMEGA) ;Windows device print
+1 NEW ZTQUEUED,ORHFS,ORSUB,ROOT,ORIO
+2 NEW IOM,IOSL,IOST,IOF,IOT,IOS
+3 SET (ORSUB,ROOT)="ORDATA"
SET ORIO="OR WINDOWS HFS"
+4 SET ORTEXT=$NAME(^TMP(ORSUB,$JOB,1))
+5 IF '$$CHK()
SET @ORTEXT@(0)=ORY
GOTO PRINTWQ
+6 SET ORHFS=$$HFS^ORWRP()
+7 DO HFSOPEN^ORWRP("ORWRP",ORHFS,"W")
+8 IF POP
Begin DoDot:1
+9 IF $DATA(ROOT)
DO SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file")
End DoDot:1
QUIT
+10 DO IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
+11 NEW $ETRAP,$ESTACK
+12 SET $ETRAP="D ERR^ORWRP Q"
+13 USE IO
+14 DO DEQUE
+15 DO HFSCLOSE^ORWRP("ORWRP",ORHFS)
PRINTWQ QUIT
PRINTWR(ORTEXT,ORDFN,RPTID,ORHANDS) ;Windows Remote device print
+1 NEW ZTQUEUED,ORHFS,ORSUB,ROOT,ORIO,ORHANDLE
+2 NEW IOM,IOSL,IOST,IOF,IOT,IOS
+3 SET (ORSUB,ROOT)="ORDATA"
SET ORIO="OR WINDOWS HFS"
SET ORTEXT=$NAME(^TMP(ORSUB,$JOB,1))
SET ORHANDLE="ORWRP"
+4 SET ORHFS=$$HFS^ORWRP()
+5 DO HFSOPEN^ORWRP(ORHANDLE,ORHFS,"W")
+6 IF POP
Begin DoDot:1
+7 IF $DATA(ROOT)
DO SETITEM^ORWRP(.ROOT,"ERROR: Unable to open HFS file")
End DoDot:1
QUIT
+8 DO IOVAR^ORWRP(.ORIO,,,"P-WINHFS80")
+9 NEW $ETRAP,$ESTACK
+10 SET $ETRAP="D ERR^ORWRP Q"
+11 USE IO
+12 DO DEQUE
+13 DO HFSCLOSE^ORWRP(ORHANDLE,ORHFS)
+14 QUIT
CHK() ; -- do checks for required data
+1 NEW OROK,FALSE,TRUE,ORRPT,TXT
+2 SET FALSE=0
SET TRUE=1
+3 IF $GET(ORIO)']""
SET OROK=FALSE
SET ORY="1^No device selected."
GOTO CHKQ
+4 IF '$GET(RPTID)
SET OROK=FALSE
SET ORY="2^No report specified."
GOTO CHKQ
+5 ; -- get report definition
+6 SET (TXT,ORRPT)=""
+7 FOR I=3:1
SET TXT=$PIECE($TEXT(RPTLIST+I),";;",2)
IF TXT="$$END"!(TXT="")
QUIT
IF +TXT=RPTID
SET ORRPT=TXT
QUIT
+8 IF +ORRPT'=RPTID
SET OROK=FALSE
SET ORY="3^Report type specified is not valid."
GOTO CHKQ
+9 IF $PIECE(ORRPT,U,3)=2
IF '$GET(ORDAYSBK)
IF '$GET(ORALPHA)
SET OROK=FALSE
SET ORY="4^No date range specified."
GOTO CHKQ
+10 IF '$DATA(^DPT(+$GET(ORDFN),0))
SET OROK=FALSE
SET ORY="6^Patient specified is not valid."
GOTO CHKQ
+11 SET OROK=TRUE
CHKQ QUIT OROK
+1 ;
DEQUE ; -- logic to print queued report
+1 ; -- call build report logic
+2 IF '$ORDER(ORHANDS(0))
DO LOOP
QUIT
+3 NEW ORI,ORX
+4 SET ORI=0
+5 FOR
SET ORI=$ORDER(ORHANDS(ORI))
IF 'ORI
QUIT
SET ORX=ORHANDS(ORI)
Begin DoDot:1
+6 NEW ORY,PAGE,ORALPHA,OROMEGA,ORID
+7 DO RTNDATA^XWBDRPC(.ORY,$PIECE(ORX,"^",2))
+8 IF ORY=""
SET ORY="ORY"
+9 SET PAGE=1
SET ORALPHA=$PIECE(ORX,"^",3)
SET OROMEGA=$PIECE(ORX,"^",4)
SET ORID=$$ID(RPTID)
+10 DO HEAD^ORWRPP1(ORDFN,PAGE,ORID,$PIECE(ORX,"^"))
+11 DO HURL^ORWRPP1(.ORY,ORDFN,ORID,1,$PIECE(ORX,"^"))
End DoDot:1
+12 QUIT
ID(ID) ;Get Report ID
+1 IF ID=21
QUIT "LAB CUMULATIVE ("_ORALPHA_" - "_OROMEGA_")"
+2 IF ID=3
QUIT "LAB INTERIM ("_ORALPHA_" - "_OROMEGA_")"
+3 IF ID=4
QUIT "LAB INTERIM FOR SELECTED TESTS ("_ORALPHA_" - "_OROMEGA_")"
+4 IF ID=20
QUIT "PATIENT ANATOMIC PATHOLOGY REPORT"
+5 IF ID=2
QUIT "PATIENT BLOOD BANK REPORT"
+6 IF ID=9
QUIT "MICROBIOLOGY REPORT ("_ORALPHA_" - "_OROMEGA_")"
+7 IF ID=10
QUIT "PATIENT LAB ORDER STATUS REPORT ("_ORALPHA_" - "_OROMEGA_")"
+8 QUIT ""
LOOP ;
+1 IF RPTID=21
Begin DoDot:1
+2 NEW ORY,PAGE,TEXT,X1,X2,X
+3 DO CUM^ORWLR(.ORY,.ORDFN,.ORDAYSBK,.ORALPHA,.OROMEGA)
+4 IF '$LENGTH(ORY)
QUIT
+5 SET PAGE=1
SET X1=DT
SET X2=-$GET(ORDAYSBK,7)
+6 DO C^%DTC
+7 SET TEXT="LAB CUMULATIVE ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+8 DO HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+9 DO HURL^ORWRPP1(.ORY,ORDFN,TEXT)
End DoDot:1
GOTO DEQUEQ
+10 IF RPTID=3
Begin DoDot:1
+11 NEW ORY,PAGE,TEXT,X
+12 IF $LENGTH(ORDAYSBK)
IF '$GET(ORALPHA)
SET ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK)
SET OROMEGA=$$NOW^XLFDT
+13 IF '$GET(ORALPHA)
QUIT
IF '$GET(OROMEGA)
QUIT
+14 DO INTERIM^ORWLRR(.ORY,.ORDFN,OROMEGA,.ORALPHA)
+15 IF '$LENGTH(ORY)
QUIT
+16 SET PAGE=1
SET TEXT="LAB INTERIM ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+17 DO HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+18 DO HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
End DoDot:1
GOTO DEQUEQ
+19 IF RPTID=4
Begin DoDot:1
+20 NEW ORY,PAGE,TEXT,X
+21 IF $LENGTH(ORDAYSBK)
IF '$GET(ORALPHA)
SET ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK)
SET OROMEGA=$$NOW^XLFDT
+22 IF '$GET(ORALPHA)
QUIT
IF '$GET(OROMEGA)
QUIT
+23 DO INTERIMS^ORWLRR(.ORY,.ORDFN,.OROMEGA,.ORALPHA,.ORTESTS)
+24 IF '$LENGTH(ORY)
QUIT
+25 SET PAGE=1
SET TEXT="LAB INTERIM FOR SELECTED TESTS ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+26 DO HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+27 DO HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
End DoDot:1
GOTO DEQUEQ
+28 IF RPTID=20
Begin DoDot:1
+29 NEW ORY,PAGE
+30 DO AP^ORWRP1(.ORY,.ORDFN,.ID,.ORALPHA,.OROMEGA,.ORDTRNG,.REMOTE)
+31 IF '$LENGTH(ORY)
QUIT
+32 SET PAGE=1
+33 DO HEAD^ORWRPP1(ORDFN,PAGE,"PATIENT ANATOMIC PATHOLOGY REPORT",$GET(STATION))
+34 DO HURL^ORWRPP1(.ORY,ORDFN,"PATIENT ANATOMIC PATHOLOGY REPORT")
End DoDot:1
GOTO DEQUEQ
+35 IF RPTID=2
Begin DoDot:1
+36 NEW ORY,PAGE
+37 DO BLR^ORWRP1(.ORY,.ORDFN,.ID,.ORALPHA,.OROMEGA,.ORDAYSBK,.REMOTE)
+38 IF '$LENGTH(ORY)
QUIT
+39 SET PAGE=1
+40 DO HEAD^ORWRPP1(ORDFN,PAGE,"PATIENT BLOOD BANK REPORT",$GET(STATION))
+41 DO HURL^ORWRPP1(.ORY,ORDFN,"PATIENT BLOOD BANK REPORT")
End DoDot:1
GOTO DEQUEQ
+42 IF RPTID=9
Begin DoDot:1
+43 NEW ORY,PAGE,TEXT,X
+44 IF $LENGTH(ORDAYSBK)
IF '$GET(ORALPHA)
SET ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK)
SET OROMEGA=$$NOW^XLFDT
+45 IF '$GET(ORALPHA)
QUIT
IF '$GET(OROMEGA)
QUIT
+46 DO MICRO^ORWLRR(.ORY,.ORDFN,.OROMEGA,.ORALPHA)
+47 IF '$LENGTH(ORY)
QUIT
+48 SET PAGE=1
SET TEXT="MICROBIOLOGY REPORT ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+49 DO HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+50 DO HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
End DoDot:1
GOTO DEQUEQ
+51 IF RPTID=10
Begin DoDot:1
+52 NEW ORY,PAGE,TEXT,X,ORVP
+53 SET ORVP=ORDFN_";DPT("
+54 DO EN1^LR7OSOS1(.ORY,ORVP,.ORALPHA,.OROMEGA,.ORDAYSBK)
+55 IF '$ORDER(^TMP("ORDATA",$JOB,1,0))
SET ^TMP("ORDATA",$JOB,1,1,0)=""
SET ^TMP("ORDATA",$JOB,1,2,0)="No Orders found..."
+56 SET PAGE=1
SET TEXT="PATIENT LAB ORDER STATUS REPORT ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+57 DO HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+58 DO HURL^ORWRPP1(.ORY,ORDFN,TEXT)
End DoDot:1
GOTO DEQUEQ
DEQUEQ QUIT