BARRCXL ; IHS/SD/LSL - Cancelled Bills Report - Driver ;
;;1.8;IHS ACCOUNTS RECEIVABLE;**19**;OCT 26, 2005
;
; IHS/SD/PKD - 05/07/10 - BAR*1.8.19
; Mirror questions asked in 3rd Party Billing CXL report
; IHS/SD/LSL - 03/06/03 - Routine created
;
Q
; *********************************************************************
;
EN ; EP
K BARY,BAR,BARP
S BARP("RTN")="BARRCXL" ; Default to Visit
S BAR("PRIVACY")=1 ; Privacy act applies
D:'$D(BARUSR) INIT^BARUTL ; Set A/R basic variable
S BAR("LOC")="VISIT" ; Location always VISIT
; BEGIN BAR*1.8*19 - chgs to questions asked in Cancellation rpt. PKD 5/07/10
;D ASKQUES ; Ask user questions
D ASKAGAIN^BARRSEL
Q:$D(DTOUT)!$D(DUOUT)
; date range no longer required for ALL bills BAR*1.8*19
; I '+BARY("OBAL"),'$D(BARY("DT",1)) Q
D PROCEED ; Ask proceed
Q:'+BAROK ; User chose not to continue
D SETHDR
S BARQ("RC")="COMPUTE^BARRCXL1" ; Compute routine
S BARQ("RP")="PRINT^BARRCXL2" ; Print routine
S BARQ("NS")="BAR" ; Namespace for variables
S BARQ("RX")="POUT^BARRUTL" ; Clean-up routine
D ^BARDBQUE ; Double queuing
I $G(X)'="^" D PAZ^BARRUTL ; pause if not ^
Q
; ********************************************************************
;
;ASKQUES ; No longer in use: BAR/SD/PKD 1.8*19 5/10/10
; Ask user questions
D MSG^BARRSEL ; Message about BILL/VIS loc
D LOC^BARRSL1 ; Ask loc - return BARY("LOC")
Q:$D(DTOUT)!($D(DUOUT)) ; Q if time or "^" out
W:'$D(BARY("LOC")) "ALL"
D OBAL ; Ask open balance only
Q:($D(DUOUT)!$D(DTOUT))
I '+BARY("OBAL") D ASKDATE Q:'$D(BARY("DT",1))
D RTYPE
Q
; ********************************************************************
;
OBAL ;
; Ask bills w/open balance only
W !
K DIR
S DIR("A")="Include ONLY bills with an open balance"
S DIR("B")="YES"
S DIR(0)="Y"
D ^DIR
K DIR
Q:($D(DUOUT)!$D(DTOUT))
S BARY("OBAL")=Y ; 1=YES ; 0=NO
I +BARY("OBAL") D
. W ?51,"ONLY BILLS W/OPEN BALANCE",!
. S BARY("STCR")=1 ; Needed to loop OBAL x-ref in BARRUTL
E W ?51,"ALL BILLS"
Q
; ********************************************************************
;
;ASKDATE ;No longer in use: BAR/SD/PKD 1.8*19 5/10/10
; Ask type of date and date range
K DIR
S DIR(0)="SO^1:Approval Date;2:Visit Date"
S DIR("A")="Select TYPE of DATE Desired"
S DIR("B")=1
D ^DIR
Q:$D(DUOUT)!$D(DTOUT)
S BARTYP=Y
;
BEGDATE ; EP
; Ask date range
W !
K BARY("DT")
K DIR
S BARY("DT")=$S(BARTYP=1:"A",1:"V")
S BARDTYP=$S(BARTYP=1:"APPROVAL",1:"VISIT")_" Date"
S DIR(0)="DOE"
S DIR("A")="Enter beginning "_BARDTYP
D ^DIR
G ASKDATE:$D(DIRUT)
S BARY("DT",1)=Y
W ?45,$$SDT^BARDUTL(BARY("DT",1))
;
W !
K DIR
S DIR(0)="DOE"
S DIR("A")=" Enter ending "_BARDTYP
D ^DIR
K DIR
G BEGDATE:$D(DIRUT)
S BARY("DT",2)=Y
W ?45,$$SDT^BARDUTL(BARY("DT",2))
I BARY("DT",1)>BARY("DT",2) D G BEGDATE
. W !!,*7,$$EN^BARVDF("RVN")
. W "INPUT ERROR:"
. W $$EN^BARVDF("RVF")
. W " Start Date is Greater than the End Date, TRY AGAIN!"
Q
; ********************************************************************
;
RTYPE ;
; Ask Report Type
K DIR,BARY("RTYP")
S DIR(0)="SO^1:Detail;2:Summary"
S DIR("A")="Select TYPE of REPORT desired"
S DIR("B")=1
D ^DIR
K DIR
Q:$D(DUOUT)!$D(DTOUT)
S BARY("RTYP")=Y
S BARY("RTYP","NM")=Y(0)
Q
; ********************************************************************
;
PROCEED ;
; Tell user what they selected and ask proceed
K DIR,BARHDR1,BARHDR2
S BARHDR1="For "_$S('$D(BARY("LOC")):"ALL",1:BARY("LOC","NM"))_" Visit Locations"
I +BARY("OBAL") D
. S BARHDR2="containing ONLY bills with an Open Balance."
E S BARHDR2="" I $D(BARY("DT")) D
. S BARHDR2="containing ALL bills within " ;_BARDTYP_"s of "
. S BARHDR2=BARHDR2_$$SDT^BARDUTL(BARY("DT",1))_" to "_$$SDT^BARDUTL(BARY("DT",2))
W !!,$$EN^BARVDF("RVN"),"NOTE:",$$EN^BARVDF("RVF")
W ?7,"You have selected to produce a "_BARY("RTYP","NM")_" Cancelled Bills Report"
W !?7,BARHDR1
W !?7,BARHDR2,!
S DIR(0)="Y"
S DIR("A")="Proceed"
S DIR("B")="YES"
D ^DIR
I '+Y S BAROK=0
E S BAROK=1
Q
; ********************************************************************
;
SETHDR ;
; Set header Array
S BAR("HD",0)=""
S BAR("TXT")=BARY("RTYP","NM")_" Cancelled Bills Report"
S BAR("LVL")=0
S BAR("CONJ")=""
D CHK^BARRHD ; Line 1 of Report header
F I=1:1:2 D
. S BAR("LVL")=BAR("LVL")+1
. S BAR("HD",BAR("LVL"))=""
. S BAR("TXT")=@("BARHDR"_I)
. D CHK^BARRHD ; Line 2 and 3 of Report header
Q
BARRCXL ; IHS/SD/LSL - Cancelled Bills Report - Driver ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**19**;OCT 26, 2005
+2 ;
+3 ; IHS/SD/PKD - 05/07/10 - BAR*1.8.19
+4 ; Mirror questions asked in 3rd Party Billing CXL report
+5 ; IHS/SD/LSL - 03/06/03 - Routine created
+6 ;
+7 QUIT
+8 ; *********************************************************************
+9 ;
EN ; EP
+1 KILL BARY,BAR,BARP
+2 ; Default to Visit
SET BARP("RTN")="BARRCXL"
+3 ; Privacy act applies
SET BAR("PRIVACY")=1
+4 ; Set A/R basic variable
IF '$DATA(BARUSR)
DO INIT^BARUTL
+5 ; Location always VISIT
SET BAR("LOC")="VISIT"
+6 ; BEGIN BAR*1.8*19 - chgs to questions asked in Cancellation rpt. PKD 5/07/10
+7 ;D ASKQUES ; Ask user questions
+8 DO ASKAGAIN^BARRSEL
+9 IF $DATA(DTOUT)!$DATA(DUOUT)
QUIT
+10 ; date range no longer required for ALL bills BAR*1.8*19
+11 ; I '+BARY("OBAL"),'$D(BARY("DT",1)) Q
+12 ; Ask proceed
DO PROCEED
+13 ; User chose not to continue
IF '+BAROK
QUIT
+14 DO SETHDR
+15 ; Compute routine
SET BARQ("RC")="COMPUTE^BARRCXL1"
+16 ; Print routine
SET BARQ("RP")="PRINT^BARRCXL2"
+17 ; Namespace for variables
SET BARQ("NS")="BAR"
+18 ; Clean-up routine
SET BARQ("RX")="POUT^BARRUTL"
+19 ; Double queuing
DO ^BARDBQUE
+20 ; pause if not ^
IF $GET(X)'="^"
DO PAZ^BARRUTL
+21 QUIT
+22 ; ********************************************************************
+23 ;
+24 ;ASKQUES ; No longer in use: BAR/SD/PKD 1.8*19 5/10/10
+25 ; Ask user questions
+26 ; Message about BILL/VIS loc
DO MSG^BARRSEL
+27 ; Ask loc - return BARY("LOC")
DO LOC^BARRSL1
+28 ; Q if time or "^" out
IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+29 IF '$DATA(BARY("LOC"))
WRITE "ALL"
+30 ; Ask open balance only
DO OBAL
+31 IF ($DATA(DUOUT)!$DATA(DTOUT))
QUIT
+32 IF '+BARY("OBAL")
DO ASKDATE
IF '$DATA(BARY("DT",1))
QUIT
+33 DO RTYPE
+34 QUIT
+35 ; ********************************************************************
+36 ;
OBAL ;
+1 ; Ask bills w/open balance only
+2 WRITE !
+3 KILL DIR
+4 SET DIR("A")="Include ONLY bills with an open balance"
+5 SET DIR("B")="YES"
+6 SET DIR(0)="Y"
+7 DO ^DIR
+8 KILL DIR
+9 IF ($DATA(DUOUT)!$DATA(DTOUT))
QUIT
+10 ; 1=YES ; 0=NO
SET BARY("OBAL")=Y
+11 IF +BARY("OBAL")
Begin DoDot:1
+12 WRITE ?51,"ONLY BILLS W/OPEN BALANCE",!
+13 ; Needed to loop OBAL x-ref in BARRUTL
SET BARY("STCR")=1
End DoDot:1
+14 IF '$TEST
WRITE ?51,"ALL BILLS"
+15 QUIT
+16 ; ********************************************************************
+17 ;
+18 ;ASKDATE ;No longer in use: BAR/SD/PKD 1.8*19 5/10/10
+19 ; Ask type of date and date range
+20 KILL DIR
+21 SET DIR(0)="SO^1:Approval Date;2:Visit Date"
+22 SET DIR("A")="Select TYPE of DATE Desired"
+23 SET DIR("B")=1
+24 DO ^DIR
+25 IF $DATA(DUOUT)!$DATA(DTOUT)
QUIT
+26 SET BARTYP=Y
+27 ;
BEGDATE ; EP
+1 ; Ask date range
+2 WRITE !
+3 KILL BARY("DT")
+4 KILL DIR
+5 SET BARY("DT")=$SELECT(BARTYP=1:"A",1:"V")
+6 SET BARDTYP=$SELECT(BARTYP=1:"APPROVAL",1:"VISIT")_" Date"
+7 SET DIR(0)="DOE"
+8 SET DIR("A")="Enter beginning "_BARDTYP
+9 DO ^DIR
+10 IF $DATA(DIRUT)
GOTO ASKDATE
+11 SET BARY("DT",1)=Y
+12 WRITE ?45,$$SDT^BARDUTL(BARY("DT",1))
+13 ;
+14 WRITE !
+15 KILL DIR
+16 SET DIR(0)="DOE"
+17 SET DIR("A")=" Enter ending "_BARDTYP
+18 DO ^DIR
+19 KILL DIR
+20 IF $DATA(DIRUT)
GOTO BEGDATE
+21 SET BARY("DT",2)=Y
+22 WRITE ?45,$$SDT^BARDUTL(BARY("DT",2))
+23 IF BARY("DT",1)>BARY("DT",2)
Begin DoDot:1
+24 WRITE !!,*7,$$EN^BARVDF("RVN")
+25 WRITE "INPUT ERROR:"
+26 WRITE $$EN^BARVDF("RVF")
+27 WRITE " Start Date is Greater than the End Date, TRY AGAIN!"
End DoDot:1
GOTO BEGDATE
+28 QUIT
+29 ; ********************************************************************
+30 ;
RTYPE ;
+1 ; Ask Report Type
+2 KILL DIR,BARY("RTYP")
+3 SET DIR(0)="SO^1:Detail;2:Summary"
+4 SET DIR("A")="Select TYPE of REPORT desired"
+5 SET DIR("B")=1
+6 DO ^DIR
+7 KILL DIR
+8 IF $DATA(DUOUT)!$DATA(DTOUT)
QUIT
+9 SET BARY("RTYP")=Y
+10 SET BARY("RTYP","NM")=Y(0)
+11 QUIT
+12 ; ********************************************************************
+13 ;
PROCEED ;
+1 ; Tell user what they selected and ask proceed
+2 KILL DIR,BARHDR1,BARHDR2
+3 SET BARHDR1="For "_$SELECT('$DATA(BARY("LOC")):"ALL",1:BARY("LOC","NM"))_" Visit Locations"
+4 IF +BARY("OBAL")
Begin DoDot:1
+5 SET BARHDR2="containing ONLY bills with an Open Balance."
End DoDot:1
+6 IF '$TEST
SET BARHDR2=""
IF $DATA(BARY("DT"))
Begin DoDot:1
+7 ;_BARDTYP_"s of "
SET BARHDR2="containing ALL bills within "
+8 SET BARHDR2=BARHDR2_$$SDT^BARDUTL(BARY("DT",1))_" to "_$$SDT^BARDUTL(BARY("DT",2))
End DoDot:1
+9 WRITE !!,$$EN^BARVDF("RVN"),"NOTE:",$$EN^BARVDF("RVF")
+10 WRITE ?7,"You have selected to produce a "_BARY("RTYP","NM")_" Cancelled Bills Report"
+11 WRITE !?7,BARHDR1
+12 WRITE !?7,BARHDR2,!
+13 SET DIR(0)="Y"
+14 SET DIR("A")="Proceed"
+15 SET DIR("B")="YES"
+16 DO ^DIR
+17 IF '+Y
SET BAROK=0
+18 IF '$TEST
SET BAROK=1
+19 QUIT
+20 ; ********************************************************************
+21 ;
SETHDR ;
+1 ; Set header Array
+2 SET BAR("HD",0)=""
+3 SET BAR("TXT")=BARY("RTYP","NM")_" Cancelled Bills Report"
+4 SET BAR("LVL")=0
+5 SET BAR("CONJ")=""
+6 ; Line 1 of Report header
DO CHK^BARRHD
+7 FOR I=1:1:2
Begin DoDot:1
+8 SET BAR("LVL")=BAR("LVL")+1
+9 SET BAR("HD",BAR("LVL"))=""
+10 SET BAR("TXT")=@("BARHDR"_I)
+11 ; Line 2 and 3 of Report header
DO CHK^BARRHD
End DoDot:1
+12 QUIT