BARRSEL1 ;IHS/SD/PKD - Selective Report Parameters CON'T ; 12/30/10
;;1.8;IHS ACCOUNTS RECEIVABLE;**6,19,20,21,23,24**;OCT 26, 2005;Build 69
;routine BARRSEL grew too big for SAC requirements
;Code moved here and called from original tags (ie, called from BARRSEL)
;IHS/SD/POT JUN 2013 - MOD FOR ICD9/10 DX - BAR*1.8*.24
;IHS/SD/POT JAN 2014 - MOD FOR ICD9/10 DX - BAR*1.8*.24
DISP ;
W !!?3,"INCLUSION PARAMETERS in Effect for ",BARMENU,":"
W !?3,"====================================================================="
I $D(BARY("LOC")) W !?3,"- Visit Location........: ",BARY("LOC","NM")
I $D(BARY("ACCT")) W !?3,"- Billing Entity........: ",BARY("ACCT","NM")
I $D(BARY("PAT")) W !?3,"- Billing Entity........: ",BARY("PAT","NM")
I $D(BARY("TYP")) W !?3,"- Billing Entity........: ",BARY("TYP","NM")
I $D(BARY("ALL")) W !?3,"- Allowance Category....: ",BARY("ALL","NM")
I $D(BARY("ITYP")) W !?3,"- Insurer Type...........: ",BARY("ITYP","NM")
I $D(BARY("PTYP")) W !?3,"- Eligbility Status......: ",BARY("PTYP","NM")
I $D(BARY("CLIN"))&($G(BAR("OPT"))="PAY") W !,?3,"- Clinic................: ",BARY("CLIN","NM")
I $D(BARY("ADJ CAT")) W !?3,"- Adjustment Type.......: ",BARY("ADJ CAT","NM")
I $G(BARY("ADJTYP")) W !,?3,"Adjustment.............: ",$P(^BAR(90052.01,BARY("ADJTYP"),0),U)
I $D(BARY("DATA SRC")) W !?3,"- Data Source........: ",BARY("DATA SRC") ;bar*1.8*20 REQ10
I $D(BARY("TRANS TYPE")) D
.N TT S TT=0
.F S TT=$O(BARY("TRANS TYPE",TT)) Q:'TT D
..W !?3,"- Transaction Type.....: ",$P($G(BARY("TRANS TYPE",TT)),U)
I $D(BARY("TRANS TYPE","ADJ CAT")) D
.N TT S TT=0
.F S TT=$O(BARY("TRANS TYPE","ADJ CAT",TT)) Q:'TT D
..W !?10,"- Adjustment Category...: ",$P($G(BARY("TRANS TYPE","ADJ CAT",TT)),U)
I $D(BARY("TRANS TYPE","ADJ TYPE")) D
.N TT S TT=0
.F S TT=$O(BARY("TRANS TYPE","ADJ TYPE",TT)) Q:'TT D
..W !?10,"- Adjustment Type.......: ",$P($G(BARY("TRANS TYPE","ADJ TYPE",TT)),U)
I $D(BARY("TDN")) D
. W !?3,"- TDN Selected..........: "
. N TDN S TDN=0
. F S TDN=$O(BARY("TDN",TDN)) Q:TDN="" D
. . W ?29,TDN,!
I $D(BARY("DT")) D
. W !?3,"- "
. W:BARY("DT")="A" "Approval Dates from...: "
. W:BARY("DT")="CB" "Batch Open Dates......: "
. I BARY("DT")="V" D
. . W:BAR("OPT")'="IPDR" "Visit Dates from........: "
. . W:BAR("OPT")="IPDR" "Admission Dates from..: "
. W:BARY("DT")="X" "Export Dates from.......: "
. W:BARY("DT")="T" "Transaction Dates from..: "
. S X=BARY("DT",1)
. X BARY("X")
. W " to: "
. S X=BARY("DT",2)
. X BARY("X")
I $D(BARY("COLPT")) W !?3,"- Collection Point......: ",BARY("COLPT","NM")
I $D(BARY("BATCH")) W !?3,"- Collection Batch......: ",BARY("BATCH","NM")
I $D(BARY("ITEM")) W !?3,"- Collection Batch Item.: ",BARY("ITEM","NM")
I $D(BARY("AR")),BAR("OPT")="CXL" W !?3,"- Cancelling Official...: ",$P(^VA(200,BARY("AR"),0),U)
I $D(BARY("AR")) W !?3,"- A/R Entry Clerk.......: ",$P(^VA(200,BARY("AR"),0),U)
I $D(BARY("APPR")) W !,?3,"- Approving Official....: ",BARY("APPR","NM")
I $D(BARY("CANC")) W !?3,"- Cancelling Official...: ",$P(^VA(200,BARY("CANC"),0),U)
I $D(BARY("PRV")) W !?3,"- Provider..............: ",$P(^VA(200,BARY("PRV"),0),U)
I $D(BARY("DSVC")) W !?3,"- Discharge Service.....: ",BARY("DSVC","NM")
D DX
I $G(BARY("RTYP")) W !?3,"- Report Type...........: ",BARY("RTYP","NM")
I +$G(BARY("LBL")) W !?3,"- Large Balance.........: $",$FN(BARY("LBL"),",",2)
I +$G(BARY("SBL")) W !?3,"- Small Balance.........: $",$FN(BARY("SBL"),",",2)
;
;IHS/SD/TMM 1.8*19 7/20/10
I $D(BARY("GRP PLAN")) D
.N TT S TT=0
.F S TT=$O(BARY("GRP PLAN",TT)) Q:'TT D
..W !?3,"- Group Plan...........: ",$P($G(BARY("GRP PLAN",TT)),U)
Q
; *********
CLIN ; EP
; Select clinics to sort by
K BARY("CLIN")
K DIC,DIE,DR,DA ;
S DIC="^DIC(40.7,"
S DIC(0)="AEMQ"
S DIC("A")="Select Clinic: ALL// "
F D Q:+Y<0 Q:$G(BAR("OPT"))="PAY"
. I $D(BARY("CLIN")) S DIC("A")="Select Another Clinic: "
. D ^DIC
. Q:+Y<0
. S BARY("CLIN",+Y)=""
. I $G(BAR("OPT"))="PAY" S BARY("CLIN","NM")=$P(Y,U,2)
I '$D(BARY("CLIN")) D
. I $D(DUOUT) K BARY("SORT") Q
. W "ALL"
K DIC,DIE,DR,DA ;
Q
; ***********
;
VTYP ; EP
; Select Vitst Types to sort by
K BARY("VTYP")
K DIC,DIE,DR,DA ;
S DIC="^ABMDVTYP("
S DIC(0)="AEMQ"
S DIC("A")="Select Visit Type: ALL// "
F D Q:+Y<0
. I $D(BARY("VTYP")) S DIC("A")="Select Another Visit Type: "
. D ^DIC
. Q:+Y<0
. S BARY("VTYP",+Y)=""
I '$D(BARY("VTYP")) D
. I $D(DUOUT) K BARY("SORT") Q
. W "ALL"
K DIC,DIE,DR,DA ;
Q
DX ;LIST SELECTED DX - BAR*1.8*.24
N BARICD,BARICDX,BARDX
F BARICD=9,10 D DX01(BARICD)
I $D(BARY("DXTYPE")) D ;
. S BARTMP1=0
. I $G(BARY("DXTYPE"))="P" S BARTMP1=1
. I $G(BARY("DXTYPE"))="O" S BARTMP1=2
. I $G(BARY("DXTYPE"))="A" S BARTMP1=3
. W !?3,"- Search "_$P("Primary;Primary Only;Other Only;ALL (Primary + Other);",";",BARTMP1+1)_" Diagnosis"
;LINES ADDED IN P24 TO SELECT ALL DXs
I $G(BARY("DX9"))="ALL" I $G(BARY("DX9_ALL"))="ALL" I $G(BARY("DX10"))="ALL" I $G(BARY("DX10_ALL"))="ALL" D Q
. W !?3,"- ALL Primary Diagnosis (ICD-9 and ICD-10)" ;;- BAR*1.8*.24 3/13/2014
I $G(BARY("DX9"))="ALL" I $G(BARY("DX9_ALL"))="ALL" W !?3,"- ALL Primary ICD-9 Diagnosis"
I $G(BARY("DX10"))="ALL" I $G(BARY("DX10_ALL"))="ALL" W !?3,"- ALL Primary ICD-10 Diagnosis"
Q
DX01(BARICD) ;
S BARICDX="DX"_BARICD
I $D(BARY(BARICDX,1)) W !?3,"- Diagnosis Range ICD",BARICD," from: ",$G(BARY(BARICDX,1))," to: ",$G(BARY(BARICDX,2)) ;P.OTT
I $D(BARY(BARICDX,3)) D
. W !?3,"- Individual Diagnosis ICD",BARICD,": "
. S BARDX="" F S BARDX=$O(BARY(BARICDX,3,BARDX)) Q:BARDX="" W ! D DXINFO^BARRSL1(BARDX) I $O(BARY(BARICDX,3,BARDX))]"" ;W !
I $D(BARY(BARICDX,4)) D
. W !?3,"- Diagnosis ICD",BARICD," begins: "
. S BARDX="" F S BARDX=$O(BARY(BARICDX,4,BARDX)) Q:BARDX="" W !?12,BARDX I $O(BARY(BARICDX,3,BARDX))]"" ;W !
Q
BARRSEL1 ;IHS/SD/PKD - Selective Report Parameters CON'T ; 12/30/10
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**6,19,20,21,23,24**;OCT 26, 2005;Build 69
+2 ;routine BARRSEL grew too big for SAC requirements
+3 ;Code moved here and called from original tags (ie, called from BARRSEL)
+4 ;IHS/SD/POT JUN 2013 - MOD FOR ICD9/10 DX - BAR*1.8*.24
+5 ;IHS/SD/POT JAN 2014 - MOD FOR ICD9/10 DX - BAR*1.8*.24
DISP ;
+1 WRITE !!?3,"INCLUSION PARAMETERS in Effect for ",BARMENU,":"
+2 WRITE !?3,"====================================================================="
+3 IF $DATA(BARY("LOC"))
WRITE !?3,"- Visit Location........: ",BARY("LOC","NM")
+4 IF $DATA(BARY("ACCT"))
WRITE !?3,"- Billing Entity........: ",BARY("ACCT","NM")
+5 IF $DATA(BARY("PAT"))
WRITE !?3,"- Billing Entity........: ",BARY("PAT","NM")
+6 IF $DATA(BARY("TYP"))
WRITE !?3,"- Billing Entity........: ",BARY("TYP","NM")
+7 IF $DATA(BARY("ALL"))
WRITE !?3,"- Allowance Category....: ",BARY("ALL","NM")
+8 IF $DATA(BARY("ITYP"))
WRITE !?3,"- Insurer Type...........: ",BARY("ITYP","NM")
+9 IF $DATA(BARY("PTYP"))
WRITE !?3,"- Eligbility Status......: ",BARY("PTYP","NM")
+10 IF $DATA(BARY("CLIN"))&($GET(BAR("OPT"))="PAY")
WRITE !,?3,"- Clinic................: ",BARY("CLIN","NM")
+11 IF $DATA(BARY("ADJ CAT"))
WRITE !?3,"- Adjustment Type.......: ",BARY("ADJ CAT","NM")
+12 IF $GET(BARY("ADJTYP"))
WRITE !,?3,"Adjustment.............: ",$PIECE(^BAR(90052.01,BARY("ADJTYP"),0),U)
+13 ;bar*1.8*20 REQ10
IF $DATA(BARY("DATA SRC"))
WRITE !?3,"- Data Source........: ",BARY("DATA SRC")
+14 IF $DATA(BARY("TRANS TYPE"))
Begin DoDot:1
+15 NEW TT
SET TT=0
+16 FOR
SET TT=$ORDER(BARY("TRANS TYPE",TT))
IF 'TT
QUIT
Begin DoDot:2
+17 WRITE !?3,"- Transaction Type.....: ",$PIECE($GET(BARY("TRANS TYPE",TT)),U)
End DoDot:2
End DoDot:1
+18 IF $DATA(BARY("TRANS TYPE","ADJ CAT"))
Begin DoDot:1
+19 NEW TT
SET TT=0
+20 FOR
SET TT=$ORDER(BARY("TRANS TYPE","ADJ CAT",TT))
IF 'TT
QUIT
Begin DoDot:2
+21 WRITE !?10,"- Adjustment Category...: ",$PIECE($GET(BARY("TRANS TYPE","ADJ CAT",TT)),U)
End DoDot:2
End DoDot:1
+22 IF $DATA(BARY("TRANS TYPE","ADJ TYPE"))
Begin DoDot:1
+23 NEW TT
SET TT=0
+24 FOR
SET TT=$ORDER(BARY("TRANS TYPE","ADJ TYPE",TT))
IF 'TT
QUIT
Begin DoDot:2
+25 WRITE !?10,"- Adjustment Type.......: ",$PIECE($GET(BARY("TRANS TYPE","ADJ TYPE",TT)),U)
End DoDot:2
End DoDot:1
+26 IF $DATA(BARY("TDN"))
Begin DoDot:1
+27 WRITE !?3,"- TDN Selected..........: "
+28 NEW TDN
SET TDN=0
+29 FOR
SET TDN=$ORDER(BARY("TDN",TDN))
IF TDN=""
QUIT
Begin DoDot:2
+30 WRITE ?29,TDN,!
End DoDot:2
End DoDot:1
+31 IF $DATA(BARY("DT"))
Begin DoDot:1
+32 WRITE !?3,"- "
+33 IF BARY("DT")="A"
WRITE "Approval Dates from...: "
+34 IF BARY("DT")="CB"
WRITE "Batch Open Dates......: "
+35 IF BARY("DT")="V"
Begin DoDot:2
+36 IF BAR("OPT")'="IPDR"
WRITE "Visit Dates from........: "
+37 IF BAR("OPT")="IPDR"
WRITE "Admission Dates from..: "
End DoDot:2
+38 IF BARY("DT")="X"
WRITE "Export Dates from.......: "
+39 IF BARY("DT")="T"
WRITE "Transaction Dates from..: "
+40 SET X=BARY("DT",1)
+41 XECUTE BARY("X")
+42 WRITE " to: "
+43 SET X=BARY("DT",2)
+44 XECUTE BARY("X")
End DoDot:1
+45 IF $DATA(BARY("COLPT"))
WRITE !?3,"- Collection Point......: ",BARY("COLPT","NM")
+46 IF $DATA(BARY("BATCH"))
WRITE !?3,"- Collection Batch......: ",BARY("BATCH","NM")
+47 IF $DATA(BARY("ITEM"))
WRITE !?3,"- Collection Batch Item.: ",BARY("ITEM","NM")
+48 IF $DATA(BARY("AR"))
IF BAR("OPT")="CXL"
WRITE !?3,"- Cancelling Official...: ",$PIECE(^VA(200,BARY("AR"),0),U)
+49 IF $DATA(BARY("AR"))
WRITE !?3,"- A/R Entry Clerk.......: ",$PIECE(^VA(200,BARY("AR"),0),U)
+50 IF $DATA(BARY("APPR"))
WRITE !,?3,"- Approving Official....: ",BARY("APPR","NM")
+51 IF $DATA(BARY("CANC"))
WRITE !?3,"- Cancelling Official...: ",$PIECE(^VA(200,BARY("CANC"),0),U)
+52 IF $DATA(BARY("PRV"))
WRITE !?3,"- Provider..............: ",$PIECE(^VA(200,BARY("PRV"),0),U)
+53 IF $DATA(BARY("DSVC"))
WRITE !?3,"- Discharge Service.....: ",BARY("DSVC","NM")
+54 DO DX
+55 IF $GET(BARY("RTYP"))
WRITE !?3,"- Report Type...........: ",BARY("RTYP","NM")
+56 IF +$GET(BARY("LBL"))
WRITE !?3,"- Large Balance.........: $",$FNUMBER(BARY("LBL"),",",2)
+57 IF +$GET(BARY("SBL"))
WRITE !?3,"- Small Balance.........: $",$FNUMBER(BARY("SBL"),",",2)
+58 ;
+59 ;IHS/SD/TMM 1.8*19 7/20/10
+60 IF $DATA(BARY("GRP PLAN"))
Begin DoDot:1
+61 NEW TT
SET TT=0
+62 FOR
SET TT=$ORDER(BARY("GRP PLAN",TT))
IF 'TT
QUIT
Begin DoDot:2
+63 WRITE !?3,"- Group Plan...........: ",$PIECE($GET(BARY("GRP PLAN",TT)),U)
End DoDot:2
End DoDot:1
+64 QUIT
+65 ; *********
CLIN ; EP
+1 ; Select clinics to sort by
+2 KILL BARY("CLIN")
+3 ;
KILL DIC,DIE,DR,DA
+4 SET DIC="^DIC(40.7,"
+5 SET DIC(0)="AEMQ"
+6 SET DIC("A")="Select Clinic: ALL// "
+7 FOR
Begin DoDot:1
+8 IF $DATA(BARY("CLIN"))
SET DIC("A")="Select Another Clinic: "
+9 DO ^DIC
+10 IF +Y<0
QUIT
+11 SET BARY("CLIN",+Y)=""
+12 IF $GET(BAR("OPT"))="PAY"
SET BARY("CLIN","NM")=$PIECE(Y,U,2)
End DoDot:1
IF +Y<0
QUIT
IF $GET(BAR("OPT"))="PAY"
QUIT
+13 IF '$DATA(BARY("CLIN"))
Begin DoDot:1
+14 IF $DATA(DUOUT)
KILL BARY("SORT")
QUIT
+15 WRITE "ALL"
End DoDot:1
+16 ;
KILL DIC,DIE,DR,DA
+17 QUIT
+18 ; ***********
+19 ;
VTYP ; EP
+1 ; Select Vitst Types to sort by
+2 KILL BARY("VTYP")
+3 ;
KILL DIC,DIE,DR,DA
+4 SET DIC="^ABMDVTYP("
+5 SET DIC(0)="AEMQ"
+6 SET DIC("A")="Select Visit Type: ALL// "
+7 FOR
Begin DoDot:1
+8 IF $DATA(BARY("VTYP"))
SET DIC("A")="Select Another Visit Type: "
+9 DO ^DIC
+10 IF +Y<0
QUIT
+11 SET BARY("VTYP",+Y)=""
End DoDot:1
IF +Y<0
QUIT
+12 IF '$DATA(BARY("VTYP"))
Begin DoDot:1
+13 IF $DATA(DUOUT)
KILL BARY("SORT")
QUIT
+14 WRITE "ALL"
End DoDot:1
+15 ;
KILL DIC,DIE,DR,DA
+16 QUIT
DX ;LIST SELECTED DX - BAR*1.8*.24
+1 NEW BARICD,BARICDX,BARDX
+2 FOR BARICD=9,10
DO DX01(BARICD)
+3 ;
IF $DATA(BARY("DXTYPE"))
Begin DoDot:1
+4 SET BARTMP1=0
+5 IF $GET(BARY("DXTYPE"))="P"
SET BARTMP1=1
+6 IF $GET(BARY("DXTYPE"))="O"
SET BARTMP1=2
+7 IF $GET(BARY("DXTYPE"))="A"
SET BARTMP1=3
+8 WRITE !?3,"- Search "_$PIECE("Primary;Primary Only;Other Only;ALL (Primary + Other);",";",BARTMP1+1)_" Diagnosis"
End DoDot:1
+9 ;LINES ADDED IN P24 TO SELECT ALL DXs
+10 IF $GET(BARY("DX9"))="ALL"
IF $GET(BARY("DX9_ALL"))="ALL"
IF $GET(BARY("DX10"))="ALL"
IF $GET(BARY("DX10_ALL"))="ALL"
Begin DoDot:1
+11 ;;- BAR*1.8*.24 3/13/2014
WRITE !?3,"- ALL Primary Diagnosis (ICD-9 and ICD-10)"
End DoDot:1
QUIT
+12 IF $GET(BARY("DX9"))="ALL"
IF $GET(BARY("DX9_ALL"))="ALL"
WRITE !?3,"- ALL Primary ICD-9 Diagnosis"
+13 IF $GET(BARY("DX10"))="ALL"
IF $GET(BARY("DX10_ALL"))="ALL"
WRITE !?3,"- ALL Primary ICD-10 Diagnosis"
+14 QUIT
DX01(BARICD) ;
+1 SET BARICDX="DX"_BARICD
+2 ;P.OTT
IF $DATA(BARY(BARICDX,1))
WRITE !?3,"- Diagnosis Range ICD",BARICD," from: ",$GET(BARY(BARICDX,1))," to: ",$GET(BARY(BARICDX,2))
+3 IF $DATA(BARY(BARICDX,3))
Begin DoDot:1
+4 WRITE !?3,"- Individual Diagnosis ICD",BARICD,": "
+5 ;W !
SET BARDX=""
FOR
SET BARDX=$ORDER(BARY(BARICDX,3,BARDX))
IF BARDX=""
QUIT
WRITE !
DO DXINFO^BARRSL1(BARDX)
IF $ORDER(BARY(BARICDX,3,BARDX))]""
End DoDot:1
+6 IF $DATA(BARY(BARICDX,4))
Begin DoDot:1
+7 WRITE !?3,"- Diagnosis ICD",BARICD," begins: "
+8 ;W !
SET BARDX=""
FOR
SET BARDX=$ORDER(BARY(BARICDX,4,BARDX))
IF BARDX=""
QUIT
WRITE !?12,BARDX
IF $ORDER(BARY(BARICDX,3,BARDX))]""
End DoDot:1
+9 QUIT