BARRNBRC ; IHS/SD/POT - Non Ben Payment Report PART 3 ; 08/20/2008
;;1.8;IHS ACCOUNTS RECEIVABLE;**24**;OCT 26,2005;Build 69
; IHS/SD/POT 07/15/13 HEAT114352 NEW REPORT BAR*1.8*24
; IHS/SD/POT 03/20/2014 FIXED ERROR IN PATIENT SELECTION "NO ACCOUNT ASSOCIATED WITH THIS PATIENT?!?"
Q
; ******
LOC ; EP
; Select Location inclusion parameters
W !
K DIC,BARY("LOC")
S DIC="^BAR(90052.05,DUZ(2),"
S DIC(0)="ZAEMQ"
S DIC("A")="Select Visit LOCATION: "
D ^DIC
K DIC
Q:$D(DTOUT)!($D(DUOUT))
Q:+Y<1
S BARY("LOC")=+Y
S BARY("LOC","NM")=Y(0,0)
Q
; **************
TYP ;
K DIR,BARY("TYP"),BARY("ACCT")
;;;K BARY("PAT")
K BARY("ALL"),BARY("ITYP")
S BARY("TYP")="^N^"
S BARY("TYP","NM")="NON-BENEFICIARY"
Q
ACCT ;
; Specific insurer of billing entity parameter
Q
; *******
PAT ;
; Specific patient of billing entity parameter
N BARTMP1,BARTMP2
PAT1 K BARY("TYP"),BARY("PAT")
S DIC="^AUPNPAT("
S DIC(0)="ZQEAM"
D ^DIC
K DIC
Q:$D(DTOUT)!($D(DUOUT))
K AUPNLK("ALL")
Q:+Y<0
;3/20/2014 CODE DEACTIVATED
;I '$D(^BARAC(DUZ(2),"B",+Y_";AUPNPAT(")) D G PAT
;. W !,"NO ACCOUNT ASSOCIATED WITH THIS PATIENT?!?"
;S BARTMP1=$O(^BARAC(DUZ(2),"B",+Y_";AUPNPAT("))
;I BARTMP1="" D G PAT1
;. W !,"NO ACCOUNT ASSOCIATED WITH THIS PATIENT?!?"
;S BARTMP2=$P($G(^BARAC(DUZ(2),BARTMP1,1)),U,15) I BARTMP2 D G PAT1
; . W !,"THIS IS NOT A NON-BENEFICIARY PATIENT"
S BARY("PAT")=+Y
S BARY("PAT","NM")=Y(0,0)
Q
; **********
DT ; EP
; Select Date inclusion parameter
K DIR,BARY("DT"),BARTYP
S DIR(0)="SO^1:Visit Date;2:Transaction Date"
S DIR("A")="Select TYPE of DATE Desired"
D ^DIR
K DIR
I $D(DUOUT)!$D(DTOUT) S BARDONE=1 Q ;P.OTT AUG
S BARTYP=Y
;
DTYP ;
K DIRUT,DUOUT,DTOUT
S BARY("DT")=$S(BARTYP=1:"V",BARTYP=2:"T",1:"V")
;
S BARDTYP="VISIT"
S:BARTYP=2 BARDTYP="TRANSACTION"
S BARDTYP=BARDTYP_" DATE"
W !!," ============ Entry of ",BARDTYP," Range =============",!
S DIR("A")="Enter STARTING "_BARDTYP_" for the Report"
S DIR(0)="DOE"
D ^DIR
G DT:$D(DIRUT)
S BARY("DT",1)=Y
W !
S DIR("A")="Enter ENDING DATE for the Report"
S DIR(0)="DOE"
D ^DIR
K DIR
G DT:$D(DIRUT)
S BARY("DT",2)=Y
I BARY("DT",1)>BARY("DT",2) W !!,*7,"INPUT ERROR: Start Date is Greater than the End Date, TRY AGAIN!",!! G DTYP
Q
; **************************
PRV ; EP
; Select Provider Inclusion Parameter
K BARY("PRV")
W !
S DIC("S")="I $D(^VA(200,""AK.PROVIDER"",$P(^(0),U)))"
S DIC="^VA(200,"
S DIC(0)="QEAM"
D ^DIC
I $D(DTOUT)!($D(DUOUT)) S BARDONE=1 Q
K DIC
S:+Y>0 BARY("PRV")=+Y
Q
; *******************************
ISNB(BARBL) ;
N BARTMP,BARBSTAT,BARPTAC,BARACDA
S BARACDA=$P($G(^BARBL(DUZ(2),BARBL)),U,3)
K BARTMP
D ENP^XBDIQ1(90050.01,BARBL,".01;3;13;15;16;17;17.2;22;101;102;108;112;113;114;115","BARTMP(","I")
S BARBSTAT=BARTMP(17.2) ;Bill Status in TPB which can be diff from A/R
;If bill is in list & has pmts applied, it should print on stmt anyway
I BARBSTAT="CANCELLED" Q "0;CANCELLED" ;S BARCXL=1 ; if cancelled 1.8*19
S BARPTAC=$S(BARACDA=BARTMP(3,"I"):1,1:0) ; PT Resp if INSURER TYPE=NON-BEN or INSURER=SELF
N D0,X
S D0=BARTMP(3,"I")
S X=$$VAL^BARVPM(8) ;(STRING)
;W !,BARBL," ==> ",X," ===> IS NON-BEN: ",BARTMP(115)," ; ",BARTMP(115,"I")
I X["NON-BEN"!(BARPTAC'=0) Q 1 ;
Q 0
;90050.01,115 BEN/NON-BEN 1;15 SET
; '0' FOR NON-BENEFICIARY;
; '1' FOR BENEFICIARY;
GETNBIT() ;RETURNS INS TYPE (TO FIND IN ACCOUNT #)
Q $O(^AUTNINS("B","NON-BENEFICIARY PATIENT",""))
;
BARRNBRC ; IHS/SD/POT - Non Ben Payment Report PART 3 ; 08/20/2008
+1 ;;1.8;IHS ACCOUNTS RECEIVABLE;**24**;OCT 26,2005;Build 69
+2 ; IHS/SD/POT 07/15/13 HEAT114352 NEW REPORT BAR*1.8*24
+3 ; IHS/SD/POT 03/20/2014 FIXED ERROR IN PATIENT SELECTION "NO ACCOUNT ASSOCIATED WITH THIS PATIENT?!?"
+4 QUIT
+5 ; ******
LOC ; EP
+1 ; Select Location inclusion parameters
+2 WRITE !
+3 KILL DIC,BARY("LOC")
+4 SET DIC="^BAR(90052.05,DUZ(2),"
+5 SET DIC(0)="ZAEMQ"
+6 SET DIC("A")="Select Visit LOCATION: "
+7 DO ^DIC
+8 KILL DIC
+9 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+10 IF +Y<1
QUIT
+11 SET BARY("LOC")=+Y
+12 SET BARY("LOC","NM")=Y(0,0)
+13 QUIT
+14 ; **************
TYP ;
+1 KILL DIR,BARY("TYP"),BARY("ACCT")
+2 ;;;K BARY("PAT")
+3 KILL BARY("ALL"),BARY("ITYP")
+4 SET BARY("TYP")="^N^"
+5 SET BARY("TYP","NM")="NON-BENEFICIARY"
+6 QUIT
ACCT ;
+1 ; Specific insurer of billing entity parameter
+2 QUIT
+3 ; *******
PAT ;
+1 ; Specific patient of billing entity parameter
+2 NEW BARTMP1,BARTMP2
PAT1 KILL BARY("TYP"),BARY("PAT")
+1 SET DIC="^AUPNPAT("
+2 SET DIC(0)="ZQEAM"
+3 DO ^DIC
+4 KILL DIC
+5 IF $DATA(DTOUT)!($DATA(DUOUT))
QUIT
+6 KILL AUPNLK("ALL")
+7 IF +Y<0
QUIT
+8 ;3/20/2014 CODE DEACTIVATED
+9 ;I '$D(^BARAC(DUZ(2),"B",+Y_";AUPNPAT(")) D G PAT
+10 ;. W !,"NO ACCOUNT ASSOCIATED WITH THIS PATIENT?!?"
+11 ;S BARTMP1=$O(^BARAC(DUZ(2),"B",+Y_";AUPNPAT("))
+12 ;I BARTMP1="" D G PAT1
+13 ;. W !,"NO ACCOUNT ASSOCIATED WITH THIS PATIENT?!?"
+14 ;S BARTMP2=$P($G(^BARAC(DUZ(2),BARTMP1,1)),U,15) I BARTMP2 D G PAT1
+15 ; . W !,"THIS IS NOT A NON-BENEFICIARY PATIENT"
+16 SET BARY("PAT")=+Y
+17 SET BARY("PAT","NM")=Y(0,0)
+18 QUIT
+19 ; **********
DT ; EP
+1 ; Select Date inclusion parameter
+2 KILL DIR,BARY("DT"),BARTYP
+3 SET DIR(0)="SO^1:Visit Date;2:Transaction Date"
+4 SET DIR("A")="Select TYPE of DATE Desired"
+5 DO ^DIR
+6 KILL DIR
+7 ;P.OTT AUG
IF $DATA(DUOUT)!$DATA(DTOUT)
SET BARDONE=1
QUIT
+8 SET BARTYP=Y
+9 ;
DTYP ;
+1 KILL DIRUT,DUOUT,DTOUT
+2 SET BARY("DT")=$SELECT(BARTYP=1:"V",BARTYP=2:"T",1:"V")
+3 ;
+4 SET BARDTYP="VISIT"
+5 IF BARTYP=2
SET BARDTYP="TRANSACTION"
+6 SET BARDTYP=BARDTYP_" DATE"
+7 WRITE !!," ============ Entry of ",BARDTYP," Range =============",!
+8 SET DIR("A")="Enter STARTING "_BARDTYP_" for the Report"
+9 SET DIR(0)="DOE"
+10 DO ^DIR
+11 IF $DATA(DIRUT)
GOTO DT
+12 SET BARY("DT",1)=Y
+13 WRITE !
+14 SET DIR("A")="Enter ENDING DATE for the Report"
+15 SET DIR(0)="DOE"
+16 DO ^DIR
+17 KILL DIR
+18 IF $DATA(DIRUT)
GOTO DT
+19 SET BARY("DT",2)=Y
+20 IF BARY("DT",1)>BARY("DT",2)
WRITE !!,*7,"INPUT ERROR: Start Date is Greater than the End Date, TRY AGAIN!",!!
GOTO DTYP
+21 QUIT
+22 ; **************************
PRV ; EP
+1 ; Select Provider Inclusion Parameter
+2 KILL BARY("PRV")
+3 WRITE !
+4 SET DIC("S")="I $D(^VA(200,""AK.PROVIDER"",$P(^(0),U)))"
+5 SET DIC="^VA(200,"
+6 SET DIC(0)="QEAM"
+7 DO ^DIC
+8 IF $DATA(DTOUT)!($DATA(DUOUT))
SET BARDONE=1
QUIT
+9 KILL DIC
+10 IF +Y>0
SET BARY("PRV")=+Y
+11 QUIT
+12 ; *******************************
ISNB(BARBL) ;
+1 NEW BARTMP,BARBSTAT,BARPTAC,BARACDA
+2 SET BARACDA=$PIECE($GET(^BARBL(DUZ(2),BARBL)),U,3)
+3 KILL BARTMP
+4 DO ENP^XBDIQ1(90050.01,BARBL,".01;3;13;15;16;17;17.2;22;101;102;108;112;113;114;115","BARTMP(","I")
+5 ;Bill Status in TPB which can be diff from A/R
SET BARBSTAT=BARTMP(17.2)
+6 ;If bill is in list & has pmts applied, it should print on stmt anyway
+7 ;S BARCXL=1 ; if cancelled 1.8*19
IF BARBSTAT="CANCELLED"
QUIT "0;CANCELLED"
+8 ; PT Resp if INSURER TYPE=NON-BEN or INSURER=SELF
SET BARPTAC=$SELECT(BARACDA=BARTMP(3,"I"):1,1:0)
+9 NEW D0,X
+10 SET D0=BARTMP(3,"I")
+11 ;(STRING)
SET X=$$VAL^BARVPM(8)
+12 ;W !,BARBL," ==> ",X," ===> IS NON-BEN: ",BARTMP(115)," ; ",BARTMP(115,"I")
+13 ;
IF X["NON-BEN"!(BARPTAC'=0)
QUIT 1
+14 QUIT 0
+15 ;90050.01,115 BEN/NON-BEN 1;15 SET
+16 ; '0' FOR NON-BENEFICIARY;
+17 ; '1' FOR BENEFICIARY;
GETNBIT() ;RETURNS INS TYPE (TO FIND IN ACCOUNT #)
+1 QUIT $ORDER(^AUTNINS("B","NON-BENEFICIARY PATIENT",""))
+2 ;