BARRSYNC ; IHS/SD/LSL - AUTO SYNC MANAGEMENT REPORT ;
;;1.8;IHS ACCOUNTS RECEIVABLE;**1,3**;MAR 27,2007
;
; IHS/SD/LSL - 05/29/02 - V1.6 Patch 2
; Routine created
;
; IHS/SD/LSL - 01/13/03 - V1.7
; Modified to accomodate new global structure for multiple runs
; of the Auto Sync (BARSYNC).
;
; *********************************************************************
;
; This routine will traverse the ^BARSYNC global created in BARSYNC
; that was run when A/R V1.6 Patch 2 was installed. A report will
; be generated that displays those bills that had an AUTO IN SYNC
; transaction created. The BARSYNC global looks like:
;
; ^BARSYNC(BARSTART,DUZ(2),BARVISOU,BARAC,BARDOS,BARBILL)=BARBAMT^BARTAMT
;
; Where: BARSTART = Date AUTO SYNC was run
; DUZ(2) = Billing location
; BARVIS = Visit type on A/R Bill
; BARAC = A/R Account on A/R Bill
; BARDOS = DOS Begin on A/R Bill
; BARBILL = A/R Bill
; BARBAMT = Current Bill Amount from A/R Bill File
; BARTAMT = Transaction History Balance
;
; *********************************************************************
Q
; *********************************************************************
;
EN ; EP
K BARY,BAR
I '$D(^BARSYNC) D NODATA Q ; Auto Sync did not run
D:'$D(BARUSR) INIT^BARUTL ; Set up basic A/R variables
S BARP("RTN")="BARRSYNC" ; Routine used to gather data
S BAR("PRIVACY")=1 ; Privacy act applies (used BARRHD)
S BAR("LOC")=$$GET1^DIQ(90052.06,DUZ(2),16) ; BILLING or VISIT
I BAR("LOC")="" S BAR("LOC")="VISIT"
D MSG^BARRSEL ; Message about BILLING/VISIT loc
D LOC^BARRSL1 ; Ask location - BARY("LOC")
Q:$D(DTOUT)!($D(DUOUT))
W:'$D(BARY("LOC")) "ALL"
D SETHDR ; Build header array
S BARQ("RC")="COMPUTE^BARRSYNC" ; Gather data
S BARQ("RP")="PRINT^BARRSYNC" ; Print report
S BARQ("NS")="BAR" ; Namespace for variables
S BARQ("RX")="POUT^BARRUTL" ; Clean-up routine
D ^BARDBQUE ; Double queuing
D PAZ^BARRUTL ; Press return to continue
Q
; *********************************************************************
;
NODATA ;
; Write message because Auto Sync did not run
W !!?5,$$EN^BARVDF("RVN"),"WARNING:",$$EN^BARVDF("RVF")
W ?18,"Auto Sync has not been executed. This report contains no data."
W !?18,"Contact your site manager for further assistance."
D PAZ^BARRUTL
Q
; *********************************************************************
;
SETHDR ;
; Build header array
S BAR("LVL")=0
S BAR("HD",0)="Auto Sync Management Report"
S BAR("TXT")="ALL"
I $D(BARY("LOC")) S BAR("TXT")=$P(^DIC(4,BARY("LOC"),0),U)
I BAR("LOC")="BILLING" D
. S BAR("TXT")=BAR("TXT")_" Visit location(s) under "
. S BAR("TXT")=BAR("TXT")_$P(^DIC(4,DUZ(2),0),U)
. S BAR("TXT")=BAR("TXT")_" Billing Location"
E S BAR("TXT")=BAR("TXT")_" Visit location(s) regardless of Billing Location"
S BAR("CONJ")="at "
D CHK^BARRHD
Q
; *********************************************************************
;
COMPUTE ;
N BARSTART
Q:BAR("LOC")="BILLING"
S BARSTART=0
F S BARSTART=$O(^BARSYNC(BARSTART)) Q:'+BARSTART D
. S BARBLOC=0
. F S BARBLOC=$O(^BARSYNC(BARSTART,BARBLOC)) Q:'+BARBLOC D
. . S BARVLOC=""
. . F S BARVLOC=$O(^BARSYNC(BARSTART,BARBLOC,BARVLOC)) Q:BARVLOC="" D
. . . I $D(BARY("LOC")),BARY("LOC","NM")'=BARVLOC Q
. . . S BAR("VISIT",BARVLOC)=""
Q
; *********************************************************************
;
PRINT ;
; Print report
K BARRCNT,BARR1,BARR2,BARR3
S BAR("PG")=0
S BARDASH="W !?43,""---------- ---------- ----------"""
S BAREQUAL="W !?43,""========== ========== =========="""
D HDB ; Print page and column headers
I '+$O(^BARSYNC(0)) D Q
. W !!!,"*** NO DATA TO PRINT ***"
. D EOP^BARUTL(0)
I BAR("LOC")="BILLING" D BILL
E D VISIT
Q:$G(BAR("F1"))
I '$D(BARRCNT) D Q
. W !!!,"*** NO DATA TO PRINT ***"
E D
. X BAREQUAL
. W !,"*** REPORT TOTAL (Bill cnt:"
. W ?37,$J(BARRCNT,4),")"
. W ?43,$J($FN(BARR1,",",2),10)
. W ?56,$J($FN(BARR2,",",2),10)
. W ?69,$J($FN(BARR3,",",2),10)
Q
; *********************************************************************
;
HD ; EP
D PAZ^BARRUTL
I $D(DTOUT)!$D(DUOUT)!$D(DIROUT) S BAR("F1")=1 Q
;
HDB ; EP
; Page and column header
S BAR("PG")=BAR("PG")+1
S BAR("I")=""
D WHD^BARRHD ; Page header
W !?48,"BILL",?56,"TRANSACTION"
W !,"A/R BILL",?15,"DOS",?27,"A/R ACCOUNT",?46,"BALANCE",?56,"HISTORY BAL",?69,"DIFFERENCE"
S $P(BAR("DASH"),"=",$S($D(BAR(132)):132,1:80))=""
W !,BAR("DASH"),!
Q
; *********************************************************************
;
BILL ;
; Report of selected visit types for DUZ(2) logged into.
I $D(BARY("LOC")) D Q
. ;BEGIN NEW CODE IM23858
. S BARSTART=0
. F S BARSTART=$O(^BARSYNC(BARSTART)) Q:'+BARSTART!($G(BAR("F1"))) D
. .S Y=BARSTART
. .D DD^%DT
. .W !!,$$CJ^XLFSTR("(As of Auto Sync run on "_Y_")",IOM)
. .S BARVIS=BARY("LOC","NM")
. .S (BARV1,BARV2,BARV3,BARVCNT)=0
. .D BILL2
. .;END NEW CODE
. ;S BARVIS=BARY("LOC","NM")
. ;K BARV1,BARV2,BARV3,BARVCNT
. ;D BILL2
E D
. S BARSTART=0
. F S BARSTART=$O(^BARSYNC(BARSTART)) Q:'+BARSTART!($G(BAR("F1"))) D
. . S Y=BARSTART
. . D DD^%DT
. . W !!,$$CJ^XLFSTR("(As of Auto Sync run on "_Y_")",IOM)
. . S BARVIS=""
. . F S BARVIS=$O(^BARSYNC(BARSTART,DUZ(2),BARVIS)) Q:BARVIS=""!($G(BAR("F1"))) D
. . . K BARV1,BARV2,BARV3,BARVCNT
. . . D BILL2
Q
; *********************************************************************
;
BILL2 ;
W !!?5,"Visit Location: ",BARVIS,!
S BARAC=""
F S BARAC=$O(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC)) Q:BARAC=""!$G(BAR("F1")) D
. S BARDOS=0
. F S BARDOS=$O(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS)) Q:'+BARDOS!$G(BAR("F1")) D
. . S BARBILL=0
. . F S BARBILL=$O(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS,BARBILL)) Q:'+BARBILL!$G(BAR("F1")) D
. . . S BARBAMT=$P(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS,BARBILL),U)
. . . S BARTAMT=$P(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS,BARBILL),U,2)
. . . S BARDIFF=BARBAMT-BARTAMT
. . . I $Y>(IOSL-5) D HD Q:$G(BAR("F1"))
. . . W !,$E($$GET1^DIQ(90050.01,BARBILL,.01),1,12)
. . . I BARDOS=99 W ?14,"NO DOS"
. . . E W ?14,$$SDT^BARDUTL(BARDOS)
. . . W ?26,$E(BARAC,1,15)
. . . W ?43,$J($FN(BARBAMT,",",2),10)
. . . W ?56,$J($FN(BARTAMT,",",2),10)
. . . W ?69,$J($FN(BARDIFF,",",2),10)
. . . ;
. . . S BARVCNT=$G(BARVCNT)+1
. . . S BARRCNT=$G(BARRCNT)+1
. . . S BARV1=$G(BARV1)+BARBAMT
. . . S BARV2=$G(BARV2)+BARTAMT
. . . S BARV3=$G(BARV3)+BARDIFF
. . . S BARR1=$G(BARR1)+BARBAMT
. . . S BARR2=$G(BARR2)+BARTAMT
. . . S BARR3=$G(BARR3)+BARDIFF
Q:$G(BAR("F1"))
X BARDASH
W !," ** Visit Location Total (Bill cnt:"
;W ?37,$J(BARVCNT,4),")"
;W ?43,$J($FN(BARV1,",",2),10)
;W ?56,$J($FN(BARV2,",",2),10)
;W ?69,$J($FN(BARV3,",",2),10)
;IHS/SD/TPF BAR*1.8*3 IM25783
W ?37,$J($G(BARVCNT),4),")"
W ?43,$J($FN($G(BARV1),",",2),10)
W ?56,$J($FN($G(BARV2),",",2),10)
W ?69,$J($FN($G(BARV3),",",2),10)
;END BAR*1.8*3 IM25783
Q
; *********************************************************************
;
VISIT ;
Q:'$D(BAR("VISIT"))
S BARSTART=0
F S BARSTART=$O(^BARSYNC(BARSTART)) Q:'+BARSTART!($G(BAR("F1"))) D
. S Y=BARSTART
. D DD^%DT
. W !!,$$CJ^XLFSTR("(As of Auto Sync run on "_Y_")",IOM)
. S BARVIS=""
. F S BARVIS=$O(BAR("VISIT",BARVIS)) Q:BARVIS=""!($G(BAR("F1"))) D VISIT2
Q
; *********************************************************************
;
VISIT2 ;
K BARVCNT,BARV1,BARV2,BARV3
S BARHOLD=DUZ(2)
S DUZ(2)=0
F S DUZ(2)=$O(^BARSYNC(BARSTART,DUZ(2))) Q:'+DUZ(2)!($G(BAR("F1"))) D
. Q:'$D(^BARSYNC(BARSTART,DUZ(2),BARVIS))
. D BILL2
S DUZ(2)=BARHOLD
Q
BARRSYNC ; IHS/SD/LSL - AUTO SYNC MANAGEMENT REPORT ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**1,3**;MAR 27,2007
+2 ;
+3 ; IHS/SD/LSL - 05/29/02 - V1.6 Patch 2
+4 ; Routine created
+5 ;
+6 ; IHS/SD/LSL - 01/13/03 - V1.7
+7 ; Modified to accomodate new global structure for multiple runs
+8 ; of the Auto Sync (BARSYNC).
+9 ;
+10 ; *********************************************************************
+11 ;
+12 ; This routine will traverse the ^BARSYNC global created in BARSYNC
+13 ; that was run when A/R V1.6 Patch 2 was installed. A report will
+14 ; be generated that displays those bills that had an AUTO IN SYNC
+15 ; transaction created. The BARSYNC global looks like:
+16 ;
+17 ; ^BARSYNC(BARSTART,DUZ(2),BARVISOU,BARAC,BARDOS,BARBILL)=BARBAMT^BARTAMT
+18 ;
+19 ; Where: BARSTART = Date AUTO SYNC was run
+20 ; DUZ(2) = Billing location
+21 ; BARVIS = Visit type on A/R Bill
+22 ; BARAC = A/R Account on A/R Bill
+23 ; BARDOS = DOS Begin on A/R Bill
+24 ; BARBILL = A/R Bill
+25 ; BARBAMT = Current Bill Amount from A/R Bill File
+26 ; BARTAMT = Transaction History Balance
+27 ;
+28 ; *********************************************************************
+29 QUIT
+30 ; *********************************************************************
+31 ;
EN ; EP
+1 KILL BARY,BAR
+2 ; Auto Sync did not run
IF '$DATA(^BARSYNC)
DO NODATA
QUIT
+3 ; Set up basic A/R variables
IF '$DATA(BARUSR)
DO INIT^BARUTL
+4 ; Routine used to gather data
SET BARP("RTN")="BARRSYNC"
+5 ; Privacy act applies (used BARRHD)
SET BAR("PRIVACY")=1
+6 ; BILLING or VISIT
SET BAR("LOC")=$$GET1^DIQ(90052.06,DUZ(2),16)
+7 IF BAR("LOC")=""
SET BAR("LOC")="VISIT"
+8 ; Message about BILLING/VISIT loc
DO MSG^BARRSEL
+9 ; Ask location - BARY("LOC")
DO LOC^BARRSL1
+10 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+11 IF '$DATA(BARY("LOC"))
WRITE "ALL"
+12 ; Build header array
DO SETHDR
+13 ; Gather data
SET BARQ("RC")="COMPUTE^BARRSYNC"
+14 ; Print report
SET BARQ("RP")="PRINT^BARRSYNC"
+15 ; Namespace for variables
SET BARQ("NS")="BAR"
+16 ; Clean-up routine
SET BARQ("RX")="POUT^BARRUTL"
+17 ; Double queuing
DO ^BARDBQUE
+18 ; Press return to continue
DO PAZ^BARRUTL
+19 QUIT
+20 ; *********************************************************************
+21 ;
NODATA ;
+1 ; Write message because Auto Sync did not run
+2 WRITE !!?5,$$EN^BARVDF("RVN"),"WARNING:",$$EN^BARVDF("RVF")
+3 WRITE ?18,"Auto Sync has not been executed. This report contains no data."
+4 WRITE !?18,"Contact your site manager for further assistance."
+5 DO PAZ^BARRUTL
+6 QUIT
+7 ; *********************************************************************
+8 ;
SETHDR ;
+1 ; Build header array
+2 SET BAR("LVL")=0
+3 SET BAR("HD",0)="Auto Sync Management Report"
+4 SET BAR("TXT")="ALL"
+5 IF $DATA(BARY("LOC"))
SET BAR("TXT")=$PIECE(^DIC(4,BARY("LOC"),0),U)
+6 IF BAR("LOC")="BILLING"
Begin DoDot:1
+7 SET BAR("TXT")=BAR("TXT")_" Visit location(s) under "
+8 SET BAR("TXT")=BAR("TXT")_$PIECE(^DIC(4,DUZ(2),0),U)
+9 SET BAR("TXT")=BAR("TXT")_" Billing Location"
End DoDot:1
+10 IF '$TEST
SET BAR("TXT")=BAR("TXT")_" Visit location(s) regardless of Billing Location"
+11 SET BAR("CONJ")="at "
+12 DO CHK^BARRHD
+13 QUIT
+14 ; *********************************************************************
+15 ;
COMPUTE ;
+1 NEW BARSTART
+2 IF BAR("LOC")="BILLING"
QUIT
+3 SET BARSTART=0
+4 FOR
SET BARSTART=$ORDER(^BARSYNC(BARSTART))
IF '+BARSTART
QUIT
Begin DoDot:1
+5 SET BARBLOC=0
+6 FOR
SET BARBLOC=$ORDER(^BARSYNC(BARSTART,BARBLOC))
IF '+BARBLOC
QUIT
Begin DoDot:2
+7 SET BARVLOC=""
+8 FOR
SET BARVLOC=$ORDER(^BARSYNC(BARSTART,BARBLOC,BARVLOC))
IF BARVLOC=""
QUIT
Begin DoDot:3
+9 IF $DATA(BARY("LOC"))
IF BARY("LOC","NM")'=BARVLOC
QUIT
+10 SET BAR("VISIT",BARVLOC)=""
End DoDot:3
End DoDot:2
End DoDot:1
+11 QUIT
+12 ; *********************************************************************
+13 ;
PRINT ;
+1 ; Print report
+2 KILL BARRCNT,BARR1,BARR2,BARR3
+3 SET BAR("PG")=0
+4 SET BARDASH="W !?43,""---------- ---------- ----------"""
+5 SET BAREQUAL="W !?43,""========== ========== =========="""
+6 ; Print page and column headers
DO HDB
+7 IF '+$ORDER(^BARSYNC(0))
Begin DoDot:1
+8 WRITE !!!,"*** NO DATA TO PRINT ***"
+9 DO EOP^BARUTL(0)
End DoDot:1
QUIT
+10 IF BAR("LOC")="BILLING"
DO BILL
+11 IF '$TEST
DO VISIT
+12 IF $GET(BAR("F1"))
QUIT
+13 IF '$DATA(BARRCNT)
Begin DoDot:1
+14 WRITE !!!,"*** NO DATA TO PRINT ***"
End DoDot:1
QUIT
+15 IF '$TEST
Begin DoDot:1
+16 XECUTE BAREQUAL
+17 WRITE !,"*** REPORT TOTAL (Bill cnt:"
+18 WRITE ?37,$JUSTIFY(BARRCNT,4),")"
+19 WRITE ?43,$JUSTIFY($FNUMBER(BARR1,",",2),10)
+20 WRITE ?56,$JUSTIFY($FNUMBER(BARR2,",",2),10)
+21 WRITE ?69,$JUSTIFY($FNUMBER(BARR3,",",2),10)
End DoDot:1
+22 QUIT
+23 ; *********************************************************************
+24 ;
HD ; EP
+1 DO PAZ^BARRUTL
+2 IF $DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIROUT)
SET BAR("F1")=1
QUIT
+3 ;
HDB ; EP
+1 ; Page and column header
+2 SET BAR("PG")=BAR("PG")+1
+3 SET BAR("I")=""
+4 ; Page header
DO WHD^BARRHD
+5 WRITE !?48,"BILL",?56,"TRANSACTION"
+6 WRITE !,"A/R BILL",?15,"DOS",?27,"A/R ACCOUNT",?46,"BALANCE",?56,"HISTORY BAL",?69,"DIFFERENCE"
+7 SET $PIECE(BAR("DASH"),"=",$SELECT($DATA(BAR(132)):132,1:80))=""
+8 WRITE !,BAR("DASH"),!
+9 QUIT
+10 ; *********************************************************************
+11 ;
BILL ;
+1 ; Report of selected visit types for DUZ(2) logged into.
+2 IF $DATA(BARY("LOC"))
Begin DoDot:1
+3 ;BEGIN NEW CODE IM23858
+4 SET BARSTART=0
+5 FOR
SET BARSTART=$ORDER(^BARSYNC(BARSTART))
IF '+BARSTART!($GET(BAR("F1")))
QUIT
Begin DoDot:2
+6 SET Y=BARSTART
+7 DO DD^%DT
+8 WRITE !!,$$CJ^XLFSTR("(As of Auto Sync run on "_Y_")",IOM)
+9 SET BARVIS=BARY("LOC","NM")
+10 SET (BARV1,BARV2,BARV3,BARVCNT)=0
+11 DO BILL2
+12 ;END NEW CODE
End DoDot:2
+13 ;S BARVIS=BARY("LOC","NM")
+14 ;K BARV1,BARV2,BARV3,BARVCNT
+15 ;D BILL2
End DoDot:1
QUIT
+16 IF '$TEST
Begin DoDot:1
+17 SET BARSTART=0
+18 FOR
SET BARSTART=$ORDER(^BARSYNC(BARSTART))
IF '+BARSTART!($GET(BAR("F1")))
QUIT
Begin DoDot:2
+19 SET Y=BARSTART
+20 DO DD^%DT
+21 WRITE !!,$$CJ^XLFSTR("(As of Auto Sync run on "_Y_")",IOM)
+22 SET BARVIS=""
+23 FOR
SET BARVIS=$ORDER(^BARSYNC(BARSTART,DUZ(2),BARVIS))
IF BARVIS=""!($GET(BAR("F1")))
QUIT
Begin DoDot:3
+24 KILL BARV1,BARV2,BARV3,BARVCNT
+25 DO BILL2
End DoDot:3
End DoDot:2
End DoDot:1
+26 QUIT
+27 ; *********************************************************************
+28 ;
BILL2 ;
+1 WRITE !!?5,"Visit Location: ",BARVIS,!
+2 SET BARAC=""
+3 FOR
SET BARAC=$ORDER(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC))
IF BARAC=""!$GET(BAR("F1"))
QUIT
Begin DoDot:1
+4 SET BARDOS=0
+5 FOR
SET BARDOS=$ORDER(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS))
IF '+BARDOS!$GET(BAR("F1"))
QUIT
Begin DoDot:2
+6 SET BARBILL=0
+7 FOR
SET BARBILL=$ORDER(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS,BARBILL))
IF '+BARBILL!$GET(BAR("F1"))
QUIT
Begin DoDot:3
+8 SET BARBAMT=$PIECE(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS,BARBILL),U)
+9 SET BARTAMT=$PIECE(^BARSYNC(BARSTART,DUZ(2),BARVIS,BARAC,BARDOS,BARBILL),U,2)
+10 SET BARDIFF=BARBAMT-BARTAMT
+11 IF $Y>(IOSL-5)
DO HD
IF $GET(BAR("F1"))
QUIT
+12 WRITE !,$EXTRACT($$GET1^DIQ(90050.01,BARBILL,.01),1,12)
+13 IF BARDOS=99
WRITE ?14,"NO DOS"
+14 IF '$TEST
WRITE ?14,$$SDT^BARDUTL(BARDOS)
+15 WRITE ?26,$EXTRACT(BARAC,1,15)
+16 WRITE ?43,$JUSTIFY($FNUMBER(BARBAMT,",",2),10)
+17 WRITE ?56,$JUSTIFY($FNUMBER(BARTAMT,",",2),10)
+18 WRITE ?69,$JUSTIFY($FNUMBER(BARDIFF,",",2),10)
+19 ;
+20 SET BARVCNT=$GET(BARVCNT)+1
+21 SET BARRCNT=$GET(BARRCNT)+1
+22 SET BARV1=$GET(BARV1)+BARBAMT
+23 SET BARV2=$GET(BARV2)+BARTAMT
+24 SET BARV3=$GET(BARV3)+BARDIFF
+25 SET BARR1=$GET(BARR1)+BARBAMT
+26 SET BARR2=$GET(BARR2)+BARTAMT
+27 SET BARR3=$GET(BARR3)+BARDIFF
End DoDot:3
End DoDot:2
End DoDot:1
+28 IF $GET(BAR("F1"))
QUIT
+29 XECUTE BARDASH
+30 WRITE !," ** Visit Location Total (Bill cnt:"
+31 ;W ?37,$J(BARVCNT,4),")"
+32 ;W ?43,$J($FN(BARV1,",",2),10)
+33 ;W ?56,$J($FN(BARV2,",",2),10)
+34 ;W ?69,$J($FN(BARV3,",",2),10)
+35 ;IHS/SD/TPF BAR*1.8*3 IM25783
+36 WRITE ?37,$JUSTIFY($GET(BARVCNT),4),")"
+37 WRITE ?43,$JUSTIFY($FNUMBER($GET(BARV1),",",2),10)
+38 WRITE ?56,$JUSTIFY($FNUMBER($GET(BARV2),",",2),10)
+39 WRITE ?69,$JUSTIFY($FNUMBER($GET(BARV3),",",2),10)
+40 ;END BAR*1.8*3 IM25783
+41 QUIT
+42 ; *********************************************************************
+43 ;
VISIT ;
+1 IF '$DATA(BAR("VISIT"))
QUIT
+2 SET BARSTART=0
+3 FOR
SET BARSTART=$ORDER(^BARSYNC(BARSTART))
IF '+BARSTART!($GET(BAR("F1")))
QUIT
Begin DoDot:1
+4 SET Y=BARSTART
+5 DO DD^%DT
+6 WRITE !!,$$CJ^XLFSTR("(As of Auto Sync run on "_Y_")",IOM)
+7 SET BARVIS=""
+8 FOR
SET BARVIS=$ORDER(BAR("VISIT",BARVIS))
IF BARVIS=""!($GET(BAR("F1")))
QUIT
DO VISIT2
End DoDot:1
+9 QUIT
+10 ; *********************************************************************
+11 ;
VISIT2 ;
+1 KILL BARVCNT,BARV1,BARV2,BARV3
+2 SET BARHOLD=DUZ(2)
+3 SET DUZ(2)=0
+4 FOR
SET DUZ(2)=$ORDER(^BARSYNC(BARSTART,DUZ(2)))
IF '+DUZ(2)!($GET(BAR("F1")))
QUIT
Begin DoDot:1
+5 IF '$DATA(^BARSYNC(BARSTART,DUZ(2),BARVIS))
QUIT
+6 DO BILL2
End DoDot:1
+7 SET DUZ(2)=BARHOLD
+8 QUIT