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

BARUFRP1.m

Go to the documentation of this file.
BARUFRP1 ; IHS/SD/TPF - UFMS REPORTS SECONDARY CALLS ; 12/22/2008
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**3,6,10,20**;OCT 26, 2005
 Q
 ;
ASKDEV(START,END,RPTTYP) ;EP - ENTRY POINT FROM BARUFRPT
 S %ZIS="MQ"
 D ^%ZIS
 Q:POP
 I $D(IO("Q")) D QUE Q
 I IO'=IO(0) U IO
 D PRINT,^%ZISC
 Q
QUE ; EP - QUE REPORT
 I RPTTYP="G" S ZTRTN="GRNTOT^BARUFRP1(START,END)"
 I RPTTYP="SS" S ZTRTN="SUMSESS^BARUFRP1(START,END)"
 I RPTTYP="D" S ZTRTN="DETAIL^BARUFRP1(START,END)"
 I RPTTYP="F" S ZTRTN="BATFILE^BARUFRP1(START,END)"
 I RPTTYP="SC" S ZTRTN="SUMCASH^BARUFRP1(START,END)"
 I RPTTYP="SF" S ZTRTN="SUMBAT^BARUFRP1(START,END)"
 S ZTDESC=$S(RPTTYP="S":"FILE TOTALS BY SESSION",RPTTYP="D":"DETAIL",RPTTYP="G":"GRAND TOTAL ALL FILES",RPTTYP="F":"FILE & FILE NAMES",RPTTYP="SF":"FILE TOTALS",RPTTYP="SC":"BATCH TOTAL BY CASHIER",1:"")_" REPORT"
 S ZTSAVE("START")=""
 S ZTSAVE("END")=""
 S ZTSAVE("RPTTYP")=""
 S ZTSAVE("DASH")=""
 D ^%ZTLOAD
 I $D(ZTSK)[0 W !!?5,"Report Cancelled!"
 E  W !!?5,"Report task #: ",$G(ZTSK)
 D HOME^%ZIS
 Q
 ;
PRINT ;EP - ENTER FROM TASKMAN
 I RPTTYP="SS" D SUMSESS^BARUFRP1(START,END)  ;SESSION TOTALS
 I RPTTYP="SC" D SUMCASH^BARUFRP1(START,END)  ;CASHIER TOTALS
 I RPTTYP="SF" D SUMBAT^BARUFRP1(START,END)  ;FILE TOTALS
 I RPTTYP="G" D GRNTOT^BARUFRP1(START,END)   ;GRANDTOTAL ALL FILES
 I RPTTYP="D" D DETAIL^BARUFRP1(START,END)   ;DETAIL
 I RPTTYP="F" D BATFILE^BARUFRP1(START,END)  ;FILE DATES AND FILE NAME
 Q
 ;
DETAIL(START,END) ;EP - PRINT View File DETAIL REPORT
 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND PRINTS
 ;OUT TRANSACTION DETAILS FOR EACH TRANSACTION TRANSMITTED AS WELL AS THE FILES
 ;CREATED
 K PAGE
 D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
 S Y=START X ^DD("DD") S EXSTART=Y
 S Y=END X ^DD("DD") S EXEND=Y
 S RPTTYP="D"
 S ESC=0
 D BATHDR^BARUFRPT(DATE,RPTTYP)
 D BATDET^BARUFRPT("")
 S:END'[(".") END=END_".999999"
 S BATCH=START-.000001
 F  S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END)  D
 .I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP)
 .W !,"SESSION FILE: ",BATCH
 .S UDUZ=""
 .F  S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC)  D
 ..S SESSID=""
 ..F  S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC)  D
 ...S TRDATE=0
 ...F  S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC)  D
 .... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
 .... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
 .... I $P(TRQUIT,U,2)'=1 Q  ; Not Transmitted
 .... S TRQUIT=$P(TRQUIT,U,4)  ; Date this TRX EXPORT to UFMS
 .... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
 .... ; END 1.8*20
 ....S IENS=TRDATE_","
 ....;Begin new code    ;MRS:BAR*1.8*10 H1087
 ....D GETDATA^BARUFRP3
 ....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
 ....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
 ....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
 ....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
 ....Q:'BILL
 ....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
 ....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
 ....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
 ....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
 ....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
 ....;End new code    ;MRS:BAR*1.8*10 H1087
 ....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH)
 ....W !?3,BILL
 ....S Y=TRDATE X ^DD("DD") S EXDATE=Y
 ....W ?25,EXDATE
 ....W !?10,ENTRYBY
 ....W ?35,CREDDEBT
 ....W ?52,$E(TRANTYP,1,15)
 ....W ?70,$E(ADJCAT,1,10)
 ....;GET TRANSMIT FILES
 ....Q:'$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0))
 ....W !!?35,"TRANSMISSION FILES: "
 ....S (RECORD,LN)=0
 ....F  S RECORD=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,RECORD)) Q:'RECORD!(ESC)  D
 .....S IENS=RECORD_","_SESSID_","_UDUZ_","
 .....S FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
 .....Q:FILENAME=""
 .....S LN=LN+1
 .....S DELDATE=$P(FILENAME,"_",7)
 .....S DELDATE=$E(DELDATE,7,8)_"/"_$E(DELDATE,5,6)_"/"_$E(DELDATE,1,4)
 .....S DELTIME=$P($P(FILENAME,"_",8),".")
 .....S DELTIME=$E(DELTIME,1,2)_":"_$E(DELTIME,3,4)
 .....S TRANSBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
 .....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP),BATDET^BARUFRPT(BATCH)
 .....W !?35,FILENAME
 ....W !
 I $D(IO("S")) W @IOF Q  ;flush buffer
 Q:ESC
 I '$D(ZTQUEUED)&(IO=IO(0)) D
 .K DIR
 .S DIR(0)="E"
 .W !
 .D ^DIR
 Q
 ;
SUMSESS(START,END) ;EP - PRINT TOTALS FOR EACH SESSION
 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
 ;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
 ;IN THE DATE RANGE
 K PAGE
 D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
 S Y=START X ^DD("DD") S EXSTART=Y
 S Y=END X ^DD("DD") S EXEND=Y
 S ESC=0
 S RPTTYP="SS"
 D BATHDR^BARUFRPT(DATE,RPTTYP)
 S:END'[(".") END=END_".999999"
 S BATCH=START-.000001
 F BATCNT=1:1 S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END)  D
 .S UDUZ=""
 .I '(BATCNT#2),(IO'=IO(0)) D BATHDR^BARUFRPT(DATE,RPTTYP)
 .F  S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC)  D
 ..D SUMINIT^BARUFRPT
 ..S SESSID=""
 ..F SESSCNT=1:1 S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC)  D
 ...I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP)
 ...W !,"SESSION FILE: ",BATCH
 ...W ?25,"CASHIER: ",$P($G(^VA(200,UDUZ,0)),U)
 ...W ?53,"SESSION ID: ",SESSID
 ...S TRDATE=0
 ...F  S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC)  D
 .... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
 .... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
 .... I $P(TRQUIT,U,2)'=1 Q  ; Not Transmitted
 .... S TRQUIT=$P(TRQUIT,U,4)  ; Date this TRX EXPORT to UFMS
 .... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
 .... ; END 1.8*20
 ....S IENS=TRDATE_","
 ....;Begin new code    ;MRS:BAR*1.8*10 H1087
 ....D GETDATA^BARUFRP3
 ....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
 ....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
 ....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
 ....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
 ....Q:'BILL
 ....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
 ....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
 ....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
 ....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
 ....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
 ....;End new code    ;MRS:BAR*1.8*10 H1087
 ....D COUNT^BARUFRPT(.TOTALS)
 ..D LIST^BARUFRPT(.TOTALS)
 ..I '$D(ZTQUEUED)&(IO=IO(0)) D
 ...Q:$D(IO("S"))
 ...K DIR
 ...S DIR(0)="E"
 ...D ^DIR
 ...S ESC=U=X
 ...Q:ESC
 ...D BATHDR^BARUFRPT(DATE,RPTTYP)
 I $D(IO("S")) W @IOF  ;flush buffer
 Q
 ;
SUMCASH(START,END) ;EP - PRINT TOTALS FOR EACH CASHIER
 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
 ;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
 ;IN THE DATE RANGE
 K PAGE
 D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
 S Y=START X ^DD("DD") S EXSTART=Y
 S Y=END X ^DD("DD") S EXEND=Y
 S ESC=0
 S RPTTYP="SC"
 D BATHDR^BARUFRPT(DATE,RPTTYP)
 S:END'[(".") END=END_".999999"
 S BATCH=START-.000001
 F BATCNT=1:1 S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END)  D
 .I '(BATCNT#3),(IO'=IO(0)) D BATHDR^BARUFRPT(DATE,RPTTYP)
 .S UDUZ=""
 .F  S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC)  D
 ..D SUMINIT^BARUFRPT
 ..W !,"SESSION FILE: ",BATCH
 ..W ?25,"CASHIER: ",$P($G(^VA(200,UDUZ,0)),U)
 ..S SESSID=""
 ..F SESSCNT=1:1 S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC)  D
 ...W:SESSCNT'=1 !
 ...W ?53,"SESSION ID: ",SESSID
 ...S TRDATE=0
 ...F  S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC)  D
 .... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
 .... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
 .... I $P(TRQUIT,U,2)'=1 Q  ; Not Transmitted
 .... S TRQUIT=$P(TRQUIT,U,4)  ; Date this TRX EXPORT to UFMS
 .... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
 .... ; END 1.8*20
 ....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP)
 ....S IENS=TRDATE_","
 ....;Begin new code    ;MRS:BAR*1.8*10 H1087
 ....D GETDATA^BARUFRP3
 ....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
 ....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
 ....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
 ....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
 ....Q:'BILL
 ....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
 ....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
 ....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
 ....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
 ....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
 ....;End new code    ;MRS:BAR*1.8*10 H1087
 ....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP)
 ....D COUNT^BARUFRPT(.TOTALS)
 ..D LIST^BARUFRPT(.TOTALS)
 .;
 .I '$D(ZTQUEUED)&(IO=IO(0)) D
 ..K DIR
 ..S DIR(0)="E"
 ..D ^DIR
 ..S ESC=U=X
 ..Q:ESC
 ..Q:'$O(^BARSESS(DUZ(2),"F",BATCH))
 ..D BATHDR^BARUFRPT(DATE,RPTTYP)
 I $D(IO("S")) W @IOF Q  ;flush buffer
 Q
 ;
SUMBAT(START,END) ;EP - PRINT  TOTALS FOR EACH BATCH
 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND
 ;TOTALS ALL THE TRANSACTIONS ACTIVITY FOR EACH BATCH OR TRANSMISSION/DATE
 ;IN THE DATE RANGE
 K PAGE
 D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
 S Y=START X ^DD("DD") S EXSTART=Y
 S Y=END X ^DD("DD") S EXEND=Y
 S ESC=0
 S RPTTYP="SF"
 D BATHDR^BARUFRPT(DATE,RPTTYP)
 S:END'[(".") END=END_".999999"
 S BATCH=START-.000001
 F  S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END)  D
 .D SUMINIT^BARUFRPT
 .S UDUZ=""
 .F  S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC)  D
 ..S SESSID=""
 ..F SESSCNT=1:1 S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC)  D
 ...I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP)
 ...W !,"SESSION FILE: ",BATCH
 ...W ?25,"CASHIER: ",$P($G(^VA(200,UDUZ,0)),U)
 ...W ?53,"SESSION ID: ",SESSID
 ...S TRDATE=0
 ...F  S TRDATE=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE)) Q:'TRDATE!(ESC)  D
 .... ;IHS/SD/PKD 1/9/11 1.8*20 HEAT P/U TRX ONLY IF IN EXPORT DATE RANGE
 .... N TRQUIT S TRQUIT=^BARSESS(DUZ(2),UDUZ,11,SESSID,2,TRDATE,0)
 .... I $P(TRQUIT,U,2)'=1 Q  ; Not Transmitted
 .... S TRQUIT=$P(TRQUIT,U,4)  ; Date this TRX EXPORT to UFMS
 .... I TRQUIT<(START-.000001)!(TRQUIT>END) Q
 .... ; END 1.8*20
 ....S IENS=TRDATE_","
 ....;Begin new code    ;MRS:BAR*1.8*10 H1087,IM30577
 ....D GETDATA^BARUFRP3
 ....;S CREDIT=$$GET1^DIQ(90050.03,IENS,2)
 ....;S DEBIT=$$GET1^DIQ(90050.03,IENS,3)
 ....;S (CREDDEBT,AMT)=$$GET1^DIQ(90050.03,IENS,3.5,"E")
 ....;S BILL=$$GET1^DIQ(90050.03,IENS,4)
 ....Q:'BILL
 ....;S BLLIEN=$$GET1^DIQ(90050.03,IENS,4,"I")
 ....;S ENTRYBY=$$GET1^DIQ(90050.03,IENS,13,"E")
 ....;S TPBIEN=$$GET1^DIQ(90050.01,BLLIEN_",",17,"I")
 ....;S TRANTYP=$$GET1^DIQ(90050.03,IENS,101,"E")
 ....;S ADJCAT=$$GET1^DIQ(90050.03,IENS,102,"E")
 ....;End new code    ;MRS:BAR*1.8*10 H1087,IM30577
 ....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP) Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP)
 ....D COUNT^BARUFRPT(.TOTALS)
 .Q:$G(ESC)
 .D LIST^BARUFRPT(.TOTALS)
 I $D(IO("S")) W @IOF
 Q
 ;
GRNTOT(START,END) ;EP - PRINT GRAND TOTAL (ALL BATCHES) REPORT
 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND PRINTS THE
 ;TOTAL ALL THE TRANSACTIONS ACTIVITY FOR THOSE BATCHES TRANSMITTED IN THAT
 ;DATE RANGE
 D GRNTOT^BARUFRP3  ;split routine due to size
 Q
 ;
BATFILE(START,END) ;EP - PRINT View Batch/File BATCH & FILE REPORT
 ;THIS REPORT USES THE "F" CROSS REFERENCE TO PRINT OUT A DATE RANGE OF
 ;TRANSMISSION DATE/TIME AT THE 90057.210101 SUBFILE LEVEL AND SHOW WHAT FILES
 ;WERE TRANSMITTED ON THAT DATE.
 S $P(DASH,"-",81)=""
 K PAGE
 D NOW^%DTC S Y=% X ^DD("DD") S DATE=Y
 S Y=START X ^DD("DD") S EXSTART=Y
 S Y=END X ^DD("DD") S EXEND=Y
 S ESC=0
 S RPTTYP="F"
 D BATHDR^BARUFRPT(DATE,RPTTYP)
 D BFHDR
 S:END'[(".") END=END_".999999"
 S BATCH=START-.000001
 F  S BATCH=$O(^BARSESS(DUZ(2),"F",BATCH)) Q:'BATCH!(ESC)!(BATCH>END)  D
 .S UDUZ=""
 .F  S UDUZ=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ)) Q:'UDUZ!(ESC)  D
 ..S SESSID=""
 ..F  S SESSID=$O(^BARSESS(DUZ(2),"F",BATCH,UDUZ,SESSID)) Q:'SESSID!(ESC)  D
 ...;GET TRANSMIT FILES
 ...Q:'$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,0))
 ...S (RECORD,LN)=0
 ...F  S RECORD=$O(^BARSESS(DUZ(2),UDUZ,11,SESSID,21,RECORD)) Q:'RECORD!(ESC)  D
 ....S IENS=RECORD_","_SESSID_","_UDUZ_","
 ....S FILENAME=$$GET1^DIQ(90057.210101,IENS,.02,"E")
 ....Q:FILENAME=""
 ....S LN=LN+1
 ....S DELDATE=$P(FILENAME,"_",7)
 ....S DELDATE=$E(DELDATE,7,8)_"/"_$E(DELDATE,5,6)_"/"_$E(DELDATE,1,4)
 ....S DELTIME=$P($P(FILENAME,"_",8),".")
 ....S DELTIME=$E(DELTIME,1,2)_":"_$E(DELTIME,3,4)
 ....S TRANSBY=$$GET1^DIQ(90057.210101,IENS,.03,"E")
 ....I $Y>(IOSL-4) W ! D:$D(IO("S")) BATHDR^BARUFRPT(DATE,RPTTYP),BFHDR Q:$D(IO("S"))  K DIR S DIR(0)="E" D:'$D(ZTQUEUED)&(IO=IO(0)) ^DIR S ESC=X=U Q:ESC  D BATHDR^BARUFRPT(DATE,RPTTYP),BFHDR
 ....; IHS/SD/PKD 1.8*20 2/9/11  HEAT24212 Print Session DATE.Time, not Export DATE.TIME
 ....;W:LN=1 !!,BATCH
 ....W:LN=1 !!,SESSID
 ....W:LN'=1 !
 ....W ?35,FILENAME
 I $D(IO("S")) W @IOF  ;flush buffer
 Q
BFHDR ;EP - FILE DETAIL
 W !?5,"SESSION FILE"
 W ?45,"TRANSMISSION FILES"
 W !,DASH
 Q