BARRSEL ; IHS/SD/LSL - Selective Report Parameters ;
;;1.8;IHS ACCOUNTS RECEIVABLE;**6,16,19,20,23,24,28**;OCT 26,2005;Build 92
;
; IHS/ASDS/LSL - 08/26/00 - Routine created
; IHS/ASDS/LSL - 01/16/01 - Add Allowance Category Parameter for Period
; Summary Report at the request of Finance/AR group
; IHS/ASDS/SDH - 11/21/01 - A/R Statistical Report
; Modified to check if it is the statistical report and only
; show related choices
; IHS/SD/LSL - 05/16/02 - V1.6 Patch 2
; Modified to display message based on Location type for reports parameter.
; IHS/SD/LSL - 03/12/04 - V1.8 - Added reports to use inclusion parameters
; IHS/SD/SDR - v1.8 p6 - DD 4.1.3 - Added negative balance
; IHS/SD/PKD - 05/07/10 1.8*19 CXL;TDN;PAY reports- Added inclusion parameters
; IHS/SD/TMM 07/20/2010 1.8*19 Add Group Plan.
; IHS/SD/PKD 1/26/11 1.8*20 Move code from tags: DISP; CLIN; VTYP to BARRSEL1
;IHS/SD/POT - 1.8*23 - JUN 2013 MOD FOR ICD9/10 DX (DROPPED 'PRIMARY')
;IHS/SD/POT - 1.8*23 - SEP 2013 made selection of DXs BAR(DX) mandatory for IPDR report
; ASKAGAIN replaced by ASKAGAI1 (to keep the current selection in BARY()
;IHS/SD/POT - 1.8*24 - HEAT150941 Allow ALL DX9/10 2/9/2014: if no DX selected: show ALL DX of ALL available coding systems; 3/10/2014
;IHS/SD/SDR - 1.8*28 - Updated p23, p24 documentation'
;IHS/SD/POT - 1.8*28 - MADE DT SELECTION MANDATORY FOR IPDR REPORT
;
; *********************************************************************
;
;start old bar*1.8*23 IHS/SD/POT
;ASKAGAIN ;EP - IHS/SD/TPF BAR*1.8*6 DD 4.1.5
;K DIC,DIR,BARY
;end old start new bar*1.8*23 IHS/SD/POT
ASKAGAIN ;EP
K BARY
;start new bar*1.8*24 IHS/SD/POT
;DEFAULT DX VALUES ; 3/10/2014
I BARP("RTN")="BARRIDR"!(BARP("RTN")="BARRPAY") D
.I $T(+1^ICDEX)="" S BARY("DX-ICDVER")="9",BARY("DX9")="ALL"
.I $T(+1^ICDEX)]"" S BARY("DX-ICDVER")="B",BARY("DX9")="ALL",BARY("DX10")="ALL"
;end new bar*1.8*24 IHS/SD/POT
ASKAGAI1 ;KEEP CURRENT BARY SELECTION
K DIC,DIR
;end new bar*1.8*23 IHS/SD/POT
S BARY("X")="W $$SDT^BARDUTL(X)"
S (BARASK,BARDONE)=0
S BARMENU=$S($D(XQY0):$P(XQY0,U,2),1:$P($G(^XUTL("XQ",$J,"S")),U,3))
S BAR("OPT")="LIST" ; Default
S:BARMENU["Negative" BAR("OPT")="NEG" ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
S:BARMENU["Transaction" BAR("OPT")="TAR"
S:BARMENU["Age Detail" BAR("OPT")="AGE"
S:BARMENU["Statistical" BAR("OPT")="STA"
S:BARMENU["Inpatient" BAR("OPT")="IPDR"
S:BARMENU["Payment" BAR("OPT")="PRP"
S:BARMENU["Transaction" BAR("OPT")="TAR"
S:BARMENU["Days in AR" BAR("OPT")="DAYS" ;BAR*1.8*16 IHS/SD/TPF 1/27/10
; BAR*1.8*19 IHS/SD/PKD 5/05/10
I BARMENU["Cancelled Bills Report" D ; Set Defaults
.S BAR("OPT")="CXL"
.I '$D(BARY("OBAL")) D OBAL^BARRCXL
.I '$G(BARY("RTYP")) S BARY("RTYP")=1,BARY("RTYP","NM")="DETAIL"
S:BARMENU="Payment Summary Report by TDN" BAR("OPT")="TDN"
S:BARMENU="Top Payer Report" BAR("OPT")="PAY"
I BAR("OPT")="TDN"!(BAR("OPT")="PAY") S BAR("RTYP")=1,BAR("RTYP","NM")="Summary"
; END BAR*1.8*19
;IHS/SD/TPF 5/22/08 BAR*1.8*6 DD 4.1.5
I BARMENU["Transaction Statistical" D
.S BAR("OPT")="TSR"
.S BARY("RTYP")=1
.S BARY("RTYP","NM")="DETAIL"
.S BARY("TRANS TYPE",40)="PAYMENT"
.S BARY("DATA SRC")="BOTH" ;bar*1.8*20 REQ10
;END BAR*1.8*6 DD 4.1.5
I BARMENU["Large" D
.S BAR("OPT")="LBL"
.S BARY("LBL")=5000
I BARMENU["Small" D
.S BAR("OPT")="SBL"
.S BARY("SBL")=5
I ",TAR,AGE,LIST,"[(","_BAR("OPT")_",") D
.S BARY("RTYP")=1
.S BARY("RTYP","NM")="Detail"
D MSG
;F D Q:+BARDONE2!(+BARDONE) ;bar*1.8*28 IHS/SD/SDR HEAT204148
F D Q:+BARDONE2!(+BARDONE)!$D(DIRUT) ;bar*1.8*28 IHS/SD/SDR HEAT204148
.Q:$G(DIRUT) ;bar*1.8*28 IHS/SD/POT HEAT182240
.D DISP ; Display current parameters
.D PARM ; Select additional parameters
I $G(DUOUT) D ^BARVKL0 Q ;bar*1.8*28 IHS/SD/POT HEAT182240
I +BARDONE D ^BARVKL0 Q
;start old bar*1.8*24 IHS/SD/POT
;;start new bar*1.8*23 IHS/SD/POT
;I BAR("OPT")="IPDR" I '$D(BARY("DX9")) I '$D(BARY("DX10")) D G ASKAGAI1
;.W !!,"The 'Inpatient Primary Diagnosis Report' requires you enter"
;.W !,"a diagnosis.",!!
;.Q
;;end new bar*1.8*23 IHS/SD/POT
;end old bar*1.8*24 IHS/SD/POT
;
I BAR("OPT")="IPDR"&('$D(BARY("DT"))) G ASKAGAI1 ;bar*1.8*28 IHS/SD/POT HEAT182240
Q:BAR("OPT")="IPDR"!(BAR("OPT")="PRP")
;BEGIN BAR*1.8*16 IHS/SD/TPF 1/27/10
I (BAR("OPT")="DAYS"),'$D(BARY("DT")) D G ASKAGAIN
.W !!,"The 'Days in AR' report requires you to enter"
.W !,"a Visit date range."
.W !!
.D ^XBFMK ;bar*1.8*28 IHS/SD/SDR HEAT224215
.H 1 ;bar*1.8*28 IHS/SD/SDR HEAT224215
.Q ;bar*1.8*24 IHS/SD/POT
;END BAR*1.8*16
; BEGIN BAR*1.8.19 PKD
;I BAR("OPT")="PAY"&('$D(BARY("DT"))) D G ASKAGAIN ;bar*1.8*23 IHS/SD/POT
I BAR("OPT")="PAY"&('$D(BARY("DT"))) D G ASKAGAI1 ;bar*1.8*23 IHS/SD/POT
.W !!,"This is a required response. Enter '^' to exit.",!,*7," A Date Range must be entered for the report."
; IHS/SD/PKD 1.8*19 6/28/10
TDNCHK ;
I BAR("OPT")="TDN"&('$D(BARY("DT"))&('$D(BARY("TDN")))) D G ASKAGAIN
.W !!,"This is a required response. Enter '^' to exit."
.W !," A Date Range must be entered for the report.",!! ;bar*1.8*24 IHS/SD/POT
.Q ;bar*1.8*24 IHS/SD/POT
; end BAR 1.8*19
;IHS/SD/TPF BEGIN BAR*1.8*6 DD 4.1.5
I ((BAR("OPT")="TSR"))&('$D(BARY("TRANS TYPE"))) D G ASKAGAIN
.W !!,"The 'Transaction Statistical Report' requires you enter"
.W !,"a transaction type."
;END BAR*1.8*6
;IHS/SD/AR BAR*1.8*19
I "TSR"[BAR("OPT") S BARY("SORT")="N"
;I ",LBL,SBL,"[(","_BAR("OPT")_",") D Q ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
I ",LBL,SBL,NEG,"[(","_BAR("OPT")_",") D Q ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
.D ASKSORT
.D:BARASK SORT
D SORT
Q
; *********************************************************************
;
MSG ; EP
N X S X=$G(BAR("OPT")) Q:(X="PAY"!(X="TDN"))&($I(BARMSGPT)>1) ; IHS/BAR*1.8*19 PKD
W !!,$$EN^BARVDF("RVN"),"NOTE:",$$EN^BARVDF("RVF")
I BAR("LOC")="BILLING" D MSG1
E D MSG2
Q
; *********************************************************************
;
MSG1 ;
; Message if Site Parameter "Location type for Reports" is BILLING
W ?7,"This report will contain data for the BILLING location you are logged "
W !?7,"into. Selecting a Visit Location will allow you to run the report for"
W !?7,"a specific VISIT location under this BILLING location."
Q
; *********************************************************************
;
MSG2 ;
; Message if Site Parameter "Location type for Reports" is VISIT
W ?7,"This report will contain data for VISIT location(s) regardless of"
W !?7,"BILLING location."
Q
; *********************************************************************
; *********************************************************************
;
DISP ;
; Display current inclusion parameters
; IHS/SD/PKD 1.8*20 SAC size limitations: move code
D DISP^BARRSEL1
Q
; *********************************************************************
; *********************************************************************
;
PARM ;
; Choose additional inclusion parameters
S (BARDONE2,BARDONE3)=0
K DIR
S DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:DATE RANGE;4:PROVIDER;5:REPORT TYPE"
S:BAR("OPT")="AGE" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:PROVIDER;4:REPORT TYPE"
S:BAR("OPT")="TAR" DIR(0)="SO^1:LOCATION;2:TRANSACTION DATE RANGE;3:COLLECTION BATCH;4:COLLECTION BATCH ITEM;5:A/R ENTRY CLERK;6:PROVIDER;7:REPORT TYPE"
S:BAR("OPT")="STA" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:DATE RANGE;4:PROVIDER"
;S:BAR("OPT")="IPDR" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:ALLOWANCE CATEGORY;4:DATE RANGE;5:PROVIDER;6:PRIMARY DIAGNOSIS;7:DISCHARGE SERVICE" ;bar*1.8*24 IHS/SD/POT
;S:BAR("OPT")="IPDR" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:ALLOWANCE CATEGORY;4:DATE RANGE;5:PROVIDER;6:DIAGNOSIS;7:DISCHARGE SERVICE" ;bar*1.8*24 IHS/SD/POT
S:BAR("OPT")="LBL" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:ALLOWANCE CATEGORY;4:LARGE BALANCE"
S:BAR("OPT")="SBL" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:ALLOWANCE CATEGORY;4:SMALL BALANCE"
S:BAR("OPT")="PRP" DIR(0)="SO^1:LOCATION;2:COLLECTION POINT;3:INSURER TYPE"
S:BAR("OPT")="NEG" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:ALLOWANCE CATEGORY" ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
;IHS/SD/TPF BAR*1.8*6 DD 4.1.5
I BAR("OPT")="TSR" D
.;S DIR(0)="SO^1:DATE RANGE;2:BILLING ENTITY;3:COLLECTION BATCH;4:COLLECTION BATCH ITEM;5:POSTING CLERK;6:LOCATION;7:PROVIDER;8:ALLOWANCE CATEGORY;9:TRANSACTION TYPE;10:REPORT TYPE" ;bar*1.8*20 REQ10
.S DIR(0)="SO^1:DATE RANGE;2:BILLING ENTITY;3:COLLECTION BATCH;4:COLLECTION BATCH ITEM;5:POSTING CLERK;6:LOCATION;7:PROVIDER;8:ALLOWANCE CATEGORY;9:TRANSACTION TYPE;10:REPORT TYPE;11:DATA SOURCE" ;bar*1.8*20 REQ10
;END
;BEGIN BAR*1.8*16 IHS/SD/TPF 1/2/7/10
S:BAR("OPT")="DAYS" DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:DATE RANGE;4:PROVIDER"
;END
;BEGIN BAR*1.8.19 IHS/SD/PKD 5/05/10
I BAR("OPT")="CXL" D
.S DIR(0)="SO^1:LOCATION;2:BILLING ENTITY;3:DATE RANGE;4:CANCELLING OFFICIAL;5:PROVIDER;6:ELIGIBILITY STATUS;7:REPORT TYPE"
S:BAR("OPT")="TDN" DIR(0)="SO^1:LOCATION;2:One or more TDN's;3:DATE RANGE"
;S:BAR("OPT")="PAY" DIR(0)="SO^1:LOCATION;2:DATE RANGE;3:PROVIDER;4:CLINIC;5:APPROVING OFFICIAL;6:PRIMARY DIAGNOSIS;7:ADJUSTMENT;8:ALLOWANCE CATEGORY" ;bar*1.8*24 IHS/SD/POT
S:BAR("OPT")="PAY" DIR(0)="SO^1:LOCATION;2:DATE RANGE;3:PROVIDER;4:CLINIC;5:APPROVING OFFICIAL;6:DIAGNOSIS;7:ADJUSTMENT;8:ALLOWANCE CATEGORY" ;bar*1.8*24 IHS/SD/POT
;END
S DIR("A")="Select ONE or MORE of the above INCLUSION PARAMETERS"
S DIR("?")="The report can be restricted to one or more of the listed parameters. A parameter can be removed by reselecting it and making a null entry."
D ^DIR
K DIR
I $D(DIRUT) Q ;bar*1.8*28 IHS/SD/POT HEAT182240
;I $E(X)="^" S BARDONE=1 Q ;bar*1.8*28 IHS/SD/POT HEAT182240
I $E(Y)="^" S BARDONE=1 Q ;bar*1.8*28 IHS/SD/POT HEAT182240
I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S BARDONE2=1 Q
S BARSEL=Y
K BARTAG
;
;BEGIN IHS/SD/TPF BAR*1.8*6 DD 4.1.5
I BAR("OPT")="TSR" D Q
.S:BARSEL=1 BARTAG="DT"
.S:BARSEL=2 BARTAG="TYP"
.S:BARSEL=3 BARTAG="BATCH"
.S:BARSEL=4 BARTAG="ITEM"
.S:BARSEL=5 BARTAG="AR"
.S:BARSEL=6 BARTAG="LOC"
.S:BARSEL=7 BARTAG="PRV"
.S:BARSEL=8 BARTAG="ALL"
.S:BARSEL=9 BARTAG="TRANTYP"
.S:BARSEL=10 BARTAG="RTYP"
.S:BARSEL=11 BARTAG="DATASRC" ;bar*1.8*20 REQ10
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;END NEW CODE
;BEGIN IHS/SD/PKD BAR*1.8*19 4/27/10
CXL I BAR("OPT")="CXL" D Q
.S BARTAG=$P("LOC^TYP^DT^CANC^PRV^PTYP^RTYP",U,BARSEL)
.I BARSEL=4!(BARSEL=6) S BARTAG=BARTAG_"^BARRSL2"
.E S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
PAY I BAR("OPT")="PAY" D Q
.S BARTAG=$P("LOC^DT^PRV^CLIN^APPR^DX^ADJTYP^ALL",U,BARSEL)
.I "12368"[BARSEL S BARTAG=BARTAG_"^BARRSL1" ;
.I "5"[BARSEL S BARTAG=BARTAG_"^BARRSL2" ; ApprOfficial
.I BARSEL=7 S BARTAG=BARTAG_"^BARRPAY" ; AdjTyp
.D @BARTAG
TDN I BAR("OPT")="TDN" D Q
.S:BARSEL=1 BARTAG="LOC^BARRSL1"
.S:BARSEL=2 BARTAG="TDN^BARRSL2",BARSRT=2
.S:BARSEL=3 BARTAG="DATES^BARRPTD",BARSRT=1
.D @BARTAG
;END NEW CODE 1.8*19
;
I BAR("OPT")="AGE" D Q
.S BARTAG="RTYP"
.S:BARSEL=1 BARTAG="LOC"
.S:BARSEL=2 BARTAG="TYP"
.S:BARSEL=3 BARTAG="PRV"
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;
I BAR("OPT")="TAR" D Q
.S BARTAG="RTYP"
.S:BARSEL=1 BARTAG="LOC"
.S:BARSEL=2 BARTAG="DT"
.S:BARSEL=3 BARTAG="BATCH"
.S:BARSEL=4 BARTAG="ITEM"
.S:BARSEL=5 BARTAG="AR"
.S:BARSEL=6 BARTAG="PRV"
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;
I BAR("OPT")="IPDR" D Q
.S BARTAG="DSVC"
.S:BARSEL=1 BARTAG="LOC"
.S:BARSEL=2 BARTAG="TYP"
.S:BARSEL=3 BARTAG="ALL"
.S:BARSEL=4 BARTAG="DT"
.S:BARSEL=5 BARTAG="PRV"
.S:BARSEL=6 BARTAG="DX"
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;
I ",LBL,SBL,"[(","_BAR("OPT")_",") D Q
.S BARTAG="ALL"
.S:BARSEL=1 BARTAG="LOC"
.S:BARSEL=2 BARTAG="TYP"
.I BARSEL=4,BAR("OPT")="LBL" S BARTAG="LBL"
.I BARSEL=4,BAR("OPT")="SBL" S BARTAG="SBL"
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;
I BAR("OPT")="PRP" D Q
.S BARTAG="ITYP"
.S:BARSEL=1 BARTAG="LOC"
.S:BARSEL=2 BARTAG="COLPT"
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;
;start new code IHS/SD/SDR bar*1.8*6 DD 4.1.3
I BAR("OPT")="NEG" D Q
.S BARTAG="ALL"
.S:BARSEL=1 BARTAG="LOC"
.S:BARSEL=2 BARTAG="TYP"
.S BARTAG=BARTAG_"^BARRSL1"
.D @BARTAG
;end new code 4.1.3
;
S BARTAG="RTYP"
S:BARSEL=1 BARTAG="LOC"
S:BARSEL=2 BARTAG="TYP"
S:BARSEL=3 BARTAG="DT"
S:BARSEL=4 BARTAG="PRV"
S BARTAG=BARTAG_"^BARRSL1"
D @BARTAG
Q
; *********************************************************************
; *********************************************************************
;
ASKSORT ; EP
W !
K DIR
S DIR(0)="Y^A"
S DIR("A")="INCLUDE CLINIC OR VISIT TYPE? "
S DIR("B")="N"
D ^DIR
S:Y BARASK=1
K DIR
Q
; *********************************************************************
;
SORT ; EP
; Sort criteria
; BAR*1.8*19 IHS/SD/PKD 6/9/10
Q:BAR("OPT")="TDN"!(BAR("OPT")="PAY") ; Sort by TDN or Date ; END
W !
K DIR
S DIR(0)="SA^C:CLINIC;V:VISIT TYPE"
S DIR("A")="Sort Report by [V]isit Type or [C]linic: "
S DIR("B")="V"
S DIR("?")="Enter 'V' to sort the report by Visit Type (inpatient, outpatient, etc.) or a 'C' to sort it by the Clinic associated with each visit."
D ^DIR
K DIR
I $D(DIROUT)!$D(DIRUT) S BARDONE=1 Q
S BARY("SORT")=Y
I BARY("SORT")="C" D CLIN Q
D VTYP
Q
; *********************************************************************
;
CLIN ; EP
; Select clinics to sort by
; IHS/SD/PKD 1.8*20 Move Code SAC size
D CLIN^BARRSEL1
Q
; *********************************************************************
;
VTYP ; EP
; Select Vitst Types to sort by
; IHS/SD/PKD 1.8*20 SAC Size limits move code
D VTYP^BARRSEL1
Q
BARRSEL ; IHS/SD/LSL - Selective Report Parameters ;
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**6,16,19,20,23,24,28**;OCT 26,2005;Build 92
+2 ;
+3 ; IHS/ASDS/LSL - 08/26/00 - Routine created
+4 ; IHS/ASDS/LSL - 01/16/01 - Add Allowance Category Parameter for Period
+5 ; Summary Report at the request of Finance/AR group
+6 ; IHS/ASDS/SDH - 11/21/01 - A/R Statistical Report
+7 ; Modified to check if it is the statistical report and only
+8 ; show related choices
+9 ; IHS/SD/LSL - 05/16/02 - V1.6 Patch 2
+10 ; Modified to display message based on Location type for reports parameter.
+11 ; IHS/SD/LSL - 03/12/04 - V1.8 - Added reports to use inclusion parameters
+12 ; IHS/SD/SDR - v1.8 p6 - DD 4.1.3 - Added negative balance
+13 ; IHS/SD/PKD - 05/07/10 1.8*19 CXL;TDN;PAY reports- Added inclusion parameters
+14 ; IHS/SD/TMM 07/20/2010 1.8*19 Add Group Plan.
+15 ; IHS/SD/PKD 1/26/11 1.8*20 Move code from tags: DISP; CLIN; VTYP to BARRSEL1
+16 ;IHS/SD/POT - 1.8*23 - JUN 2013 MOD FOR ICD9/10 DX (DROPPED 'PRIMARY')
+17 ;IHS/SD/POT - 1.8*23 - SEP 2013 made selection of DXs BAR(DX) mandatory for IPDR report
+18 ; ASKAGAIN replaced by ASKAGAI1 (to keep the current selection in BARY()
+19 ;IHS/SD/POT - 1.8*24 - HEAT150941 Allow ALL DX9/10 2/9/2014: if no DX selected: show ALL DX of ALL available coding systems; 3/10/2014
+20 ;IHS/SD/SDR - 1.8*28 - Updated p23, p24 documentation'
+21 ;IHS/SD/POT - 1.8*28 - MADE DT SELECTION MANDATORY FOR IPDR REPORT
+22 ;
+23 ; *********************************************************************
+24 ;
+25 ;start old bar*1.8*23 IHS/SD/POT
+26 ;ASKAGAIN ;EP - IHS/SD/TPF BAR*1.8*6 DD 4.1.5
+27 ;K DIC,DIR,BARY
+28 ;end old start new bar*1.8*23 IHS/SD/POT
ASKAGAIN ;EP
+1 KILL BARY
+2 ;start new bar*1.8*24 IHS/SD/POT
+3 ;DEFAULT DX VALUES ; 3/10/2014
+4 IF BARP("RTN")="BARRIDR"!(BARP("RTN")="BARRPAY")
Begin DoDot:1
+5 IF $TEXT(+1^ICDEX)=""
SET BARY("DX-ICDVER")="9"
SET BARY("DX9")="ALL"
+6 IF $TEXT(+1^ICDEX)]""
SET BARY("DX-ICDVER")="B"
SET BARY("DX9")="ALL"
SET BARY("DX10")="ALL"
End DoDot:1
+7 ;end new bar*1.8*24 IHS/SD/POT
ASKAGAI1 ;KEEP CURRENT BARY SELECTION
+1 KILL DIC,DIR
+2 ;end new bar*1.8*23 IHS/SD/POT
+3 SET BARY("X")="W $$SDT^BARDUTL(X)"
+4 SET (BARASK,BARDONE)=0
+5 SET BARMENU=$SELECT($DATA(XQY0):$PIECE(XQY0,U,2),1:$PIECE($GET(^XUTL("XQ",$JOB,"S")),U,3))
+6 ; Default
SET BAR("OPT")="LIST"
+7 ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
IF BARMENU["Negative"
SET BAR("OPT")="NEG"
+8 IF BARMENU["Transaction"
SET BAR("OPT")="TAR"
+9 IF BARMENU["Age Detail"
SET BAR("OPT")="AGE"
+10 IF BARMENU["Statistical"
SET BAR("OPT")="STA"
+11 IF BARMENU["Inpatient"
SET BAR("OPT")="IPDR"
+12 IF BARMENU["Payment"
SET BAR("OPT")="PRP"
+13 IF BARMENU["Transaction"
SET BAR("OPT")="TAR"
+14 ;BAR*1.8*16 IHS/SD/TPF 1/27/10
IF BARMENU["Days in AR"
SET BAR("OPT")="DAYS"
+15 ; BAR*1.8*19 IHS/SD/PKD 5/05/10
+16 ; Set Defaults
IF BARMENU["Cancelled Bills Report"
Begin DoDot:1
+17 SET BAR("OPT")="CXL"
+18 IF '$DATA(BARY("OBAL"))
DO OBAL^BARRCXL
+19 IF '$GET(BARY("RTYP"))
SET BARY("RTYP")=1
SET BARY("RTYP","NM")="DETAIL"
End DoDot:1
+20 IF BARMENU="Payment Summary Report by TDN"
SET BAR("OPT")="TDN"
+21 IF BARMENU="Top Payer Report"
SET BAR("OPT")="PAY"
+22 IF BAR("OPT")="TDN"!(BAR("OPT")="PAY")
SET BAR("RTYP")=1
SET BAR("RTYP","NM")="Summary"
+23 ; END BAR*1.8*19
+24 ;IHS/SD/TPF 5/22/08 BAR*1.8*6 DD 4.1.5
+25 IF BARMENU["Transaction Statistical"
Begin DoDot:1
+26 SET BAR("OPT")="TSR"
+27 SET BARY("RTYP")=1
+28 SET BARY("RTYP","NM")="DETAIL"
+29 SET BARY("TRANS TYPE",40)="PAYMENT"
+30 ;bar*1.8*20 REQ10
SET BARY("DATA SRC")="BOTH"
End DoDot:1
+31 ;END BAR*1.8*6 DD 4.1.5
+32 IF BARMENU["Large"
Begin DoDot:1
+33 SET BAR("OPT")="LBL"
+34 SET BARY("LBL")=5000
End DoDot:1
+35 IF BARMENU["Small"
Begin DoDot:1
+36 SET BAR("OPT")="SBL"
+37 SET BARY("SBL")=5
End DoDot:1
+38 IF ",TAR,AGE,LIST,"[(","_BAR("OPT")_",")
Begin DoDot:1
+39 SET BARY("RTYP")=1
+40 SET BARY("RTYP","NM")="Detail"
End DoDot:1
+41 DO MSG
+42 ;F D Q:+BARDONE2!(+BARDONE) ;bar*1.8*28 IHS/SD/SDR HEAT204148
+43 ;bar*1.8*28 IHS/SD/SDR HEAT204148
FOR
Begin DoDot:1
+44 ;bar*1.8*28 IHS/SD/POT HEAT182240
IF $GET(DIRUT)
QUIT
+45 ; Display current parameters
DO DISP
+46 ; Select additional parameters
DO PARM
End DoDot:1
IF +BARDONE2!(+BARDONE)!$DATA(DIRUT)
QUIT
+47 ;bar*1.8*28 IHS/SD/POT HEAT182240
IF $GET(DUOUT)
DO ^BARVKL0
QUIT
+48 IF +BARDONE
DO ^BARVKL0
QUIT
+49 ;start old bar*1.8*24 IHS/SD/POT
+50 ;;start new bar*1.8*23 IHS/SD/POT
+51 ;I BAR("OPT")="IPDR" I '$D(BARY("DX9")) I '$D(BARY("DX10")) D G ASKAGAI1
+52 ;.W !!,"The 'Inpatient Primary Diagnosis Report' requires you enter"
+53 ;.W !,"a diagnosis.",!!
+54 ;.Q
+55 ;;end new bar*1.8*23 IHS/SD/POT
+56 ;end old bar*1.8*24 IHS/SD/POT
+57 ;
+58 ;bar*1.8*28 IHS/SD/POT HEAT182240
IF BAR("OPT")="IPDR"&('$DATA(BARY("DT")))
GOTO ASKAGAI1
+59 IF BAR("OPT")="IPDR"!(BAR("OPT")="PRP")
QUIT
+60 ;BEGIN BAR*1.8*16 IHS/SD/TPF 1/27/10
+61 IF (BAR("OPT")="DAYS")
IF '$DATA(BARY("DT"))
Begin DoDot:1
+62 WRITE !!,"The 'Days in AR' report requires you to enter"
+63 WRITE !,"a Visit date range."
+64 WRITE !!
+65 ;bar*1.8*28 IHS/SD/SDR HEAT224215
DO ^XBFMK
+66 ;bar*1.8*28 IHS/SD/SDR HEAT224215
HANG 1
+67 ;bar*1.8*24 IHS/SD/POT
QUIT
End DoDot:1
GOTO ASKAGAIN
+68 ;END BAR*1.8*16
+69 ; BEGIN BAR*1.8.19 PKD
+70 ;I BAR("OPT")="PAY"&('$D(BARY("DT"))) D G ASKAGAIN ;bar*1.8*23 IHS/SD/POT
+71 ;bar*1.8*23 IHS/SD/POT
IF BAR("OPT")="PAY"&('$DATA(BARY("DT")))
Begin DoDot:1
+72 WRITE !!,"This is a required response. Enter '^' to exit.",!,*7," A Date Range must be entered for the report."
End DoDot:1
GOTO ASKAGAI1
+73 ; IHS/SD/PKD 1.8*19 6/28/10
TDNCHK ;
+1 IF BAR("OPT")="TDN"&('$DATA(BARY("DT"))&('$DATA(BARY("TDN"))))
Begin DoDot:1
+2 WRITE !!,"This is a required response. Enter '^' to exit."
+3 ;bar*1.8*24 IHS/SD/POT
WRITE !," A Date Range must be entered for the report.",!!
+4 ;bar*1.8*24 IHS/SD/POT
QUIT
End DoDot:1
GOTO ASKAGAIN
+5 ; end BAR 1.8*19
+6 ;IHS/SD/TPF BEGIN BAR*1.8*6 DD 4.1.5
+7 IF ((BAR("OPT")="TSR"))&('$DATA(BARY("TRANS TYPE")))
Begin DoDot:1
+8 WRITE !!,"The 'Transaction Statistical Report' requires you enter"
+9 WRITE !,"a transaction type."
End DoDot:1
GOTO ASKAGAIN
+10 ;END BAR*1.8*6
+11 ;IHS/SD/AR BAR*1.8*19
+12 IF "TSR"[BAR("OPT")
SET BARY("SORT")="N"
+13 ;I ",LBL,SBL,"[(","_BAR("OPT")_",") D Q ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
+14 ;IHS/SD/SDR bar*1.8*6 DD 4.1.3
IF ",LBL,SBL,NEG,"[(","_BAR("OPT")_",")
Begin DoDot:1
+15 DO ASKSORT
+16 IF BARASK
DO SORT
End DoDot:1
QUIT
+17 DO SORT
+18 QUIT
+19 ; *********************************************************************
+20 ;
MSG ; EP
+1 ; IHS/BAR*1.8*19 PKD
NEW X
SET X=$GET(BAR("OPT"))