BARDYSV2 ; IHS/SD/MAS,TPF - OMB - DAYS TO COLLECTION REPORT FOR SQL ; 02/09/2009
;;1.8;IHS ACCOUNTS RECEIVABLE;**12,13**;JULY 2,2009
;
;
; IHS/SD/TMM 07/02/09
; Routine ^BARDYSV2 created as a continuation of ^BARDYSVZ due to
; large routine size for SAC checker.
;
Q
;
SENDFILE(XBGL,XBFN) ; EP - CREATE FLAT FILE FOR UFMS USING XBGSAVE
S:$G(XBFN)="" XBFN="OMB.TST"
S:$G(XBGL)="" XBGL="BAROMB(" ;TEMP FILE KILLED AFTER FTP SEND. CAN'T USE ^XTMP($J
S XBQSHO=""
S XBF=$J ; Beginning 1st level numeric subscript
S XBE=$J ; Ending 1st level numeric subscript
S XBFLT=1 ; indicates flat file
S XBMED="F" ; Flag indicates file as media
S XBCON=1 ; Q if non-cononic
S XBS1="BAR OMB F" ; ZISH SEND PARAMETERS entry
I $D(ZTQUEUED) S XBS1="BAR OMB B"
S XBQ="N"
S XBUF=$P($G(^BAR(90052.06,DUZ(2),DUZ(2),16)),U) ;A/R SITE PARAMETER FILE, OMB DIRECTORY
I XBUF="" D Q
.W !!,"Before OMB files can be created a non-public directory must be created"
.W !,"on the Host File System. This directory must be entered in to A/R Site Parameter"
.W !,"field OMB DIRECTORY using the 'SPE Site Parameter Edit' option"
.D ASKFORRT^BARUFUT
S XBFLG=0
;
;S XBS1="" ;IF SET TO "" IT WON'T FTP ACROSS
;
I XBUF="" D Q
. S XBFLG=-1
. S XBFLG(1)="Missing OMB REPORT storage directory. Please check A/R OMB Parameters"
I IO=IO(0) W !!
;
D ^XBGSAVE
Q
;
WRITE ;TEMP WRITE WHILE TESTING
N BARVLOC,BARVDA,BARBIL,VISITREC,BILLREC,TRANDT,TRANREC
S BARVLOC=0
F S BARVLOC=$O(^BAROMB($J,BARVLOC)) Q:'BARVLOC D
.S BARVDA=0
.F S BARVDA=$O(^BAROMB($J,BARVLOC,BARVDA)) Q:'BARVDA D
..S VISITREC=^BAROMB($J,BARVLOC,BARVDA,"A VISITREC")
..;W !,BARVLOC,U,BARVDA,U,"A",U,VISITREC
..W !,BARVLOC,U,BARVDA,U,VISITREC
..S BARBIL=0
..F S BARBIL=$O(^BAROMB($J,BARVLOC,BARVDA,"BILLREC",BARBIL)) Q:BARBIL="" D
...S BILLREC=^BAROMB($J,BARVLOC,BARVDA,"BILLREC",BARBIL)
...;W !,BARVLOC,U,BARVDA,U,"B",U,BILLREC
...W !,BARVLOC,U,BARVDA,U,BILLREC
...S TRANDT=0
...F S BARBIL=$O(^BAROMB($J,BARVLOC,BARVDA,"TRANS REC",TRANDT)) Q:TRANDT="" D
....S TRANREC=^BAROMB($J,BARVLOC,BARVDA,"TRANS REC",TRANDT)
....W !,BARVLOC,U,BARVDA,U,TRANREC
Q
BARDYSV2 ; IHS/SD/MAS,TPF - OMB - DAYS TO COLLECTION REPORT FOR SQL ; 02/09/2009
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**12,13**;JULY 2,2009
+2 ;
+3 ;
+4 ; IHS/SD/TMM 07/02/09
+5 ; Routine ^BARDYSV2 created as a continuation of ^BARDYSVZ due to
+6 ; large routine size for SAC checker.
+7 ;
+8 QUIT
+9 ;
SENDFILE(XBGL,XBFN) ; EP - CREATE FLAT FILE FOR UFMS USING XBGSAVE
+1 IF $GET(XBFN)=""
SET XBFN="OMB.TST"
+2 ;TEMP FILE KILLED AFTER FTP SEND. CAN'T USE ^XTMP($J
IF $GET(XBGL)=""
SET XBGL="BAROMB("
+3 SET XBQSHO=""
+4 ; Beginning 1st level numeric subscript
SET XBF=$JOB
+5 ; Ending 1st level numeric subscript
SET XBE=$JOB
+6 ; indicates flat file
SET XBFLT=1
+7 ; Flag indicates file as media
SET XBMED="F"
+8 ; Q if non-cononic
SET XBCON=1
+9 ; ZISH SEND PARAMETERS entry
SET XBS1="BAR OMB F"
+10 IF $DATA(ZTQUEUED)
SET XBS1="BAR OMB B"
+11 SET XBQ="N"
+12 ;A/R SITE PARAMETER FILE, OMB DIRECTORY
SET XBUF=$PIECE($GET(^BAR(90052.06,DUZ(2),DUZ(2),16)),U)
+13 IF XBUF=""
Begin DoDot:1
+14 WRITE !!,"Before OMB files can be created a non-public directory must be created"
+15 WRITE !,"on the Host File System. This directory must be entered in to A/R Site Parameter"
+16 WRITE !,"field OMB DIRECTORY using the 'SPE Site Parameter Edit' option"
+17 DO ASKFORRT^BARUFUT
End DoDot:1
QUIT
+18 SET XBFLG=0
+19 ;
+20 ;S XBS1="" ;IF SET TO "" IT WON'T FTP ACROSS
+21 ;
+22 IF XBUF=""
Begin DoDot:1
+23 SET XBFLG=-1
+24 SET XBFLG(1)="Missing OMB REPORT storage directory. Please check A/R OMB Parameters"
End DoDot:1
QUIT
+25 IF IO=IO(0)
WRITE !!
+26 ;
+27 DO ^XBGSAVE
+28 QUIT
+29 ;
WRITE ;TEMP WRITE WHILE TESTING
+1 NEW BARVLOC,BARVDA,BARBIL,VISITREC,BILLREC,TRANDT,TRANREC
+2 SET BARVLOC=0
+3 FOR
SET BARVLOC=$ORDER(^BAROMB($JOB,BARVLOC))
IF 'BARVLOC
QUIT
Begin DoDot:1
+4 SET BARVDA=0
+5 FOR
SET BARVDA=$ORDER(^BAROMB($JOB,BARVLOC,BARVDA))
IF 'BARVDA
QUIT
Begin DoDot:2
+6 SET VISITREC=^BAROMB($JOB,BARVLOC,BARVDA,"A VISITREC")
+7 ;W !,BARVLOC,U,BARVDA,U,"A",U,VISITREC
+8 WRITE !,BARVLOC,U,BARVDA,U,VISITREC
+9 SET BARBIL=0
+10 FOR
SET BARBIL=$ORDER(^BAROMB($JOB,BARVLOC,BARVDA,"BILLREC",BARBIL))
IF BARBIL=""
QUIT
Begin DoDot:3
+11 SET BILLREC=^BAROMB($JOB,BARVLOC,BARVDA,"BILLREC",BARBIL)
+12 ;W !,BARVLOC,U,BARVDA,U,"B",U,BILLREC
+13 WRITE !,BARVLOC,U,BARVDA,U,BILLREC
+14 SET TRANDT=0
+15 FOR
SET BARBIL=$ORDER(^BAROMB($JOB,BARVLOC,BARVDA,"TRANS REC",TRANDT))
IF TRANDT=""
QUIT
Begin DoDot:4
+16 SET TRANREC=^BAROMB($JOB,BARVLOC,BARVDA,"TRANS REC",TRANDT)
+17 WRITE !,BARVLOC,U,BARVDA,U,TRANREC
End DoDot:4
End DoDot:3
End DoDot:2
End DoDot:1
+18 QUIT