ORWRPL ; SLC/DCM - Background GUI Lab Print Driver;Dec 02, 2021@12:51:24;04/19/17 13:44
;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,109,332,405**;Dec 17, 1997;Build 211
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
N ORPRTING ;Printing Flag, used when creating report
S ORPRTING=1
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,"^"))
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,ORID,$P(ORX,"^"))
. D LRHURL^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)
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D LRHURL^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)
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D LRHURL^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)
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D LRHURL^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")
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,"PATIENT ANATOMIC PATHOLOGY REPORT",$G(STATION))
. D LRHURL^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")
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,"PATIENT BLOOD BANK REPORT",$G(STATION))
. D LRHURL^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)
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D LRHURL^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)
. ;modified lab header to include facility address
. D LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
. D LRHURL^ORWRPP1(.ORY,ORDFN,TEXT)
DEQUEQ Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HORWRPL 8058 printed Oct 16, 2024@18:37:59 Page 2
ORWRPL ; SLC/DCM - Background GUI Lab Print Driver;Dec 02, 2021@12:51:24;04/19/17 13:44
+1 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**10,85,109,332,405**;Dec 17, 1997;Build 211
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 ;Printing Flag, used when creating report
NEW ORPRTING
+3 SET ORPRTING=1
+4 IF '$ORDER(ORHANDS(0))
DO LOOP
QUIT
+5 NEW ORI,ORX
+6 SET ORI=0
+7 FOR
SET ORI=$ORDER(ORHANDS(ORI))
if 'ORI
QUIT
SET ORX=ORHANDS(ORI)
Begin DoDot:1
+8 NEW ORY,PAGE,ORALPHA,OROMEGA,ORID
+9 DO RTNDATA^XWBDRPC(.ORY,$PIECE(ORX,"^",2))
+10 if ORY=""
SET ORY="ORY"
+11 SET PAGE=1
SET ORALPHA=$PIECE(ORX,"^",3)
SET OROMEGA=$PIECE(ORX,"^",4)
SET ORID=$$ID(RPTID)
+12 ;D HEAD^ORWRPP1(ORDFN,PAGE,ORID,$P(ORX,"^"))
+13 ;D HURL^ORWRPP1(.ORY,ORDFN,ORID,1,$P(ORX,"^"))
+14 ;modified lab header to include facility address
+15 DO LRHEAD^ORWRPP1(ORDFN,PAGE,ORID,$PIECE(ORX,"^"))
+16 DO LRHURL^ORWRPP1(.ORY,ORDFN,ORID,1,$PIECE(ORX,"^"))
End DoDot:1
+17 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 ;D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
+9 ;D HURL^ORWRPP1(.ORY,ORDFN,TEXT)
+10 ;modified lab header to include facility address
+11 DO LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+12 DO LRHURL^ORWRPP1(.ORY,ORDFN,TEXT)
End DoDot:1
GOTO DEQUEQ
+13 IF RPTID=3
Begin DoDot:1
+14 NEW ORY,PAGE,TEXT,X
+15 IF $LENGTH(ORDAYSBK)
IF '$GET(ORALPHA)
SET ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK)
SET OROMEGA=$$NOW^XLFDT
+16 if '$GET(ORALPHA)
QUIT
if '$GET(OROMEGA)
QUIT
+17 DO INTERIM^ORWLRR(.ORY,.ORDFN,OROMEGA,.ORALPHA)
+18 if '$LENGTH(ORY)
QUIT
+19 SET PAGE=1
SET TEXT="LAB INTERIM ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+20 ;D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
+21 ;D HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
+22 ;modified lab header to include facility address
+23 DO LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+24 DO LRHURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
End DoDot:1
GOTO DEQUEQ
+25 IF RPTID=4
Begin DoDot:1
+26 NEW ORY,PAGE,TEXT,X
+27 IF $LENGTH(ORDAYSBK)
IF '$GET(ORALPHA)
SET ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK)
SET OROMEGA=$$NOW^XLFDT
+28 if '$GET(ORALPHA)
QUIT
if '$GET(OROMEGA)
QUIT
+29 DO INTERIMS^ORWLRR(.ORY,.ORDFN,.OROMEGA,.ORALPHA,.ORTESTS)
+30 if '$LENGTH(ORY)
QUIT
+31 SET PAGE=1
SET TEXT="LAB INTERIM FOR SELECTED TESTS ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+32 ;D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
+33 ;D HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
+34 ;modified lab header to include facility address
+35 DO LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+36 DO LRHURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
End DoDot:1
GOTO DEQUEQ
+37 IF RPTID=20
Begin DoDot:1
+38 NEW ORY,PAGE
+39 DO AP^ORWRP1(.ORY,.ORDFN,.ID,.ORALPHA,.OROMEGA,.ORDTRNG,.REMOTE)
+40 if '$LENGTH(ORY)
QUIT
+41 SET PAGE=1
+42 ;D HEAD^ORWRPP1(ORDFN,PAGE,"PATIENT ANATOMIC PATHOLOGY REPORT",$G(STATION))
+43 ;D HURL^ORWRPP1(.ORY,ORDFN,"PATIENT ANATOMIC PATHOLOGY REPORT")
+44 ;modified lab header to include facility address
+45 DO LRHEAD^ORWRPP1(ORDFN,PAGE,"PATIENT ANATOMIC PATHOLOGY REPORT",$GET(STATION))
+46 DO LRHURL^ORWRPP1(.ORY,ORDFN,"PATIENT ANATOMIC PATHOLOGY REPORT")
End DoDot:1
GOTO DEQUEQ
+47 IF RPTID=2
Begin DoDot:1
+48 NEW ORY,PAGE
+49 DO BLR^ORWRP1(.ORY,.ORDFN,.ID,.ORALPHA,.OROMEGA,.ORDAYSBK,.REMOTE)
+50 if '$LENGTH(ORY)
QUIT
+51 SET PAGE=1
+52 ;D HEAD^ORWRPP1(ORDFN,PAGE,"PATIENT BLOOD BANK REPORT",$G(STATION))
+53 ;D HURL^ORWRPP1(.ORY,ORDFN,"PATIENT BLOOD BANK REPORT")
+54 ;modified lab header to include facility address
+55 DO LRHEAD^ORWRPP1(ORDFN,PAGE,"PATIENT BLOOD BANK REPORT",$GET(STATION))
+56 DO LRHURL^ORWRPP1(.ORY,ORDFN,"PATIENT BLOOD BANK REPORT")
End DoDot:1
GOTO DEQUEQ
+57 IF RPTID=9
Begin DoDot:1
+58 NEW ORY,PAGE,TEXT,X
+59 IF $LENGTH(ORDAYSBK)
IF '$GET(ORALPHA)
SET ORALPHA=$$FMADD^XLFDT(DT,-ORDAYSBK)
SET OROMEGA=$$NOW^XLFDT
+60 if '$GET(ORALPHA)
QUIT
if '$GET(OROMEGA)
QUIT
+61 DO MICRO^ORWLRR(.ORY,.ORDFN,.OROMEGA,.ORALPHA)
+62 if '$LENGTH(ORY)
QUIT
+63 SET PAGE=1
SET TEXT="MICROBIOLOGY REPORT ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+64 ;D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
+65 ;D HURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
+66 ;modified lab header to include facility address
+67 DO LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+68 DO LRHURL^ORWRPP1(.ORY,ORDFN,TEXT,1)
End DoDot:1
GOTO DEQUEQ
+69 IF RPTID=10
Begin DoDot:1
+70 NEW ORY,PAGE,TEXT,X,ORVP
+71 SET ORVP=ORDFN_";DPT("
+72 DO EN1^LR7OSOS1(.ORY,ORVP,.ORALPHA,.OROMEGA,.ORDAYSBK)
+73 IF '$ORDER(^TMP("ORDATA",$JOB,1,0))
SET ^TMP("ORDATA",$JOB,1,1,0)=""
SET ^TMP("ORDATA",$JOB,1,2,0)="No Orders found..."
+74 SET PAGE=1
SET TEXT="PATIENT LAB ORDER STATUS REPORT ("_$$FMTE^XLFDT(ORALPHA)_" - "_$$FMTE^XLFDT(OROMEGA)_")"
+75 ;D HEAD^ORWRPP1(ORDFN,PAGE,TEXT,$G(STATION))
+76 ;D HURL^ORWRPP1(.ORY,ORDFN,TEXT)
+77 ;modified lab header to include facility address
+78 DO LRHEAD^ORWRPP1(ORDFN,PAGE,TEXT,$GET(STATION))
+79 DO LRHURL^ORWRPP1(.ORY,ORDFN,TEXT)
End DoDot:1
GOTO DEQUEQ
DEQUEQ QUIT