BARDYSV6 ; IHS/SD/SDR - DAYS TO COLLECTION detail print ; 02/09/2009
;;1.8;IHS ACCOUNTS RECEIVABLE;**28**;OCT 26,2005;Build 92
;IHS/SD/SDR - 1.8*28 - HEAT224215 - New routine to print comma-delimited detail report
;
Q
;
PRNTDET ;EP
S ESC=0
S $P(EQUALS,"=",181)=""
D VISHDR
;THESE ARE PAGE SUBTOTALS
S (COLVISIT,COLWITBL,COLNUMBL,COLBILAM,COLCHKIN,COLCREDY,COLREVDY)=0
S (COLTPBA,COLTPBX,COLTOPY,COLEARPY,COLLSTPY,COLTOTPS,PGCNT)=0
S COLTOTPY=0 ;TOT PAY MADE
S VISITIEN=0
F S VISITIEN=$O(^XTMP("BARDYSVS",$J,"DAYS TO COL VISIT","DET",VISITIEN)) Q:'VISITIEN D
.S BARREC=$G(^XTMP("BARDYSVS",$J,"DAYS TO COL VISIT","DET",VISITIEN))
.S:$D(BARY("CSV")) $P(BARREC,U,2)=$$MONTH^BARDYSPR(+$P($P(BARREC,U,2)," ",2))_" "_$P($P(BARREC,U,2)," ") ;format to print MMM CCYY
.S:$D(BARY("XML")) $P(BARREC,U,2)=+$P($P(BARREC,U,2)," ",1)_"-"_$P($P(BARREC,U,2)," ",2)_"-"_"01T00:00:00.000" ;format to print MMM CCYY
.S $P(BARREC,U,3)=$P($G(^AUTTLOC($P(BARREC,U,3),0)),U,2) ;Location short name
.I $D(BARY("CSV")) F I=4,5,7 S $P(BARREC,U,I)=$$CDT^BARDUTL($P(BARREC,U,I)) ;format dates
.I $D(BARY("XML")) F I=4,5,7 S $P(BARREC,U,I)=$$XDT^BARDUTL($P(BARREC,U,I)) ;format dates
.S BARBILLS=$P($G(BARREC),U,9)
.I $TR(BARBILLS,";")'="" D
..F I=1:1:$L(BARBILLS,"~") D ;pull out bills one at a time using second delimiter (~)
...S BARBILL=$P(BARBILLS,"~",I)
...I $D(BARY("CSV")) F J=2:2:10 S $P(BARBILL,";",J)=$P($$CDT^BARDUTL(+$P(BARBILL,";",J)),"@") ;format bill dates
...I $D(BARY("XML")) F J=2:2:10 S $P(BARBILL,";",J)=$P($$XDT^BARDUTL(+$P(BARBILL,";",J)),"@") ;format bill dates
...S:+$P(BARBILL,";",12) $P(BARBILL,";",12)=$P($G(^VA(200,$P(BARBILL,";",12),0)),U) ;provider name
...S $P(BARBILLS,"~",I)=BARBILL
.S $P(BARREC,U,9)=BARBILLS
.;W !,BARREC
.D ROWTOCOL^BARDYSV9(VISITIEN,BARREC) ;IHS/DIT/CPC - 20180424 CR8345 HEAT224215
D:$D(BARY("XML")) PRTXML^BARDYSV9
D:$D(BARY("CSV")) PRTCSV^BARDYSVA
Q
VISHDR ;EP -
S BAR("PG")=BAR("PG")+1
S BAR("HD",0)=""
S BAR("LOC")=""
S BAR("OPT")="BAR RPT DAYS IN AR"
D HD^BARRHD
D:$G(BARY("SUMORDET"))="S" WHD^BARRHD
;W !,"VisitIEN^MonthYear^VisitLocation^VisitAdmitDate^DateCreatedPCC^NumDays^DateReviewed^NumDays^Bills(Bill#;ApprovalDate;NumDays;ExportDate;NumDays;FinalizedBatchDate;NumDays;FirstTransDate;NumDays;LastTransDate;NumDays;Provider;BilledAmount)"
Q
;EOR - IHS/DIT/CPC 1.8*28
BARDYSV6 ; IHS/SD/SDR - DAYS TO COLLECTION detail print ; 02/09/2009
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**28**;OCT 26,2005;Build 92
+2 ;IHS/SD/SDR - 1.8*28 - HEAT224215 - New routine to print comma-delimited detail report
+3 ;
+4 QUIT
+5 ;
PRNTDET ;EP
+1 SET ESC=0
+2 SET $PIECE(EQUALS,"=",181)=""
+3 DO VISHDR
+4 ;THESE ARE PAGE SUBTOTALS
+5 SET (COLVISIT,COLWITBL,COLNUMBL,COLBILAM,COLCHKIN,COLCREDY,COLREVDY)=0
+6 SET (COLTPBA,COLTPBX,COLTOPY,COLEARPY,COLLSTPY,COLTOTPS,PGCNT)=0
+7 ;TOT PAY MADE
SET COLTOTPY=0
+8 SET VISITIEN=0
+9 FOR
SET VISITIEN=$ORDER(^XTMP("BARDYSVS",$JOB,"DAYS TO COL VISIT","DET",VISITIEN))
IF 'VISITIEN
QUIT
Begin DoDot:1
+10 SET BARREC=$GET(^XTMP("BARDYSVS",$JOB,"DAYS TO COL VISIT","DET",VISITIEN))
+11 ;format to print MMM CCYY
IF $DATA(BARY("CSV"))
SET $PIECE(BARREC,U,2)=$$MONTH^BARDYSPR(+$PIECE($PIECE(BARREC,U,2)," ",2))_" "_$PIECE($PIECE(BARREC,U,2)," ")
+12 ;format to print MMM CCYY
IF $DATA(BARY("XML"))
SET $PIECE(BARREC,U,2)=+$PIECE($PIECE(BARREC,U,2)," ",1)_"-"_$PIECE($PIECE(BARREC,U,2)," ",2)_"-"_"01T00:00:00.000"
+13 ;Location short name
SET $PIECE(BARREC,U,3)=$PIECE($GET(^AUTTLOC($PIECE(BARREC,U,3),0)),U,2)
+14 ;format dates
IF $DATA(BARY("CSV"))
FOR I=4,5,7
SET $PIECE(BARREC,U,I)=$$CDT^BARDUTL($PIECE(BARREC,U,I))
+15 ;format dates
IF $DATA(BARY("XML"))
FOR I=4,5,7
SET $PIECE(BARREC,U,I)=$$XDT^BARDUTL($PIECE(BARREC,U,I))
+16 SET BARBILLS=$PIECE($GET(BARREC),U,9)
+17 IF $TRANSLATE(BARBILLS,";")'=""
Begin DoDot:2
+18 ;pull out bills one at a time using second delimiter (~)
FOR I=1:1:$LENGTH(BARBILLS,"~")
Begin DoDot:3
+19 SET BARBILL=$PIECE(BARBILLS,"~",I)
+20 ;format bill dates
IF $DATA(BARY("CSV"))
FOR J=2:2:10
SET $PIECE(BARBILL,";",J)=$PIECE($$CDT^BARDUTL(+$PIECE(BARBILL,";",J)),"@")
+21 ;format bill dates
IF $DATA(BARY("XML"))
FOR J=2:2:10
SET $PIECE(BARBILL,";",J)=$PIECE($$XDT^BARDUTL(+$PIECE(BARBILL,";",J)),"@")
+22 ;provider name
IF +$PIECE(BARBILL,";",12)
SET $PIECE(BARBILL,";",12)=$PIECE($GET(^VA(200,$PIECE(BARBILL,";",12),0)),U)
+23 SET $PIECE(BARBILLS,"~",I)=BARBILL
End DoDot:3
End DoDot:2
+24 SET $PIECE(BARREC,U,9)=BARBILLS
+25 ;W !,BARREC
+26 ;IHS/DIT/CPC - 20180424 CR8345 HEAT224215
DO ROWTOCOL^BARDYSV9(VISITIEN,BARREC)
End DoDot:1
+27 IF $DATA(BARY("XML"))
DO PRTXML^BARDYSV9
+28 IF $DATA(BARY("CSV"))
DO PRTCSV^BARDYSVA
+29 QUIT
VISHDR ;EP -
+1 SET BAR("PG")=BAR("PG")+1
+2 SET BAR("HD",0)=""
+3 SET BAR("LOC")=""
+4 SET BAR("OPT")="BAR RPT DAYS IN AR"
+5 DO HD^BARRHD
+6 IF $GET(BARY("SUMORDET"))="S"
DO WHD^BARRHD
+7 ;W !,"VisitIEN^MonthYear^VisitLocation^VisitAdmitDate^DateCreatedPCC^NumDays^DateReviewed^NumDays^Bills(Bill#;ApprovalDate;NumDays;ExportDate;NumDays;FinalizedBatchDate;NumDays;FirstTransDate;NumDays;LastTransDate;NumDays;Provider;BilledAmount)"
+8 QUIT
+9 ;EOR - IHS/DIT/CPC 1.8*28