Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BARTRNS4

BARTRNS4.m

Go to the documentation of this file.
BARTRNS4 ; IHS/SD/SDR - Transaction Summary/Detail Report ; 03/10/2009
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**10,19,20,22,23,28**;OCT 26, 2005;Build 92
 ;IHS/SD/POT 1.8*23 HEAT74599 JUNE 2012 "No Billing Entity" & $T("No Billing Entity"
 ;IHS/SD/POT 1.8*23 MAR 2013 ADDED NEW VA billing
 ;IHS/SD/SDR 1.8*28 Updated p23 documentation
 ;IHS/SD/SDR,POT 1.8*28 CR8397 HEAT155084 (SDR) - Split from routine BARTRNS1 due to size.  Corrected column header from Adj Amt to Adj Cat.  Added column
 ;  for Adj Amt.  Added #DAYS (APPR.DT-ADJ.DT) (Header was printing without data).  Changed loop to
 ;  look thru transaction file, not bill file.
 ;  (POT) - ADD ADJ TYPE IEN TO THE DETAIL REPORT; FIX MISSING #OF DATES (#5PIECE)
PRINT ;
 D HDB
 I '$D(^TMP($J,"BAR-TRANST"))&(BARY("RTYP")=1) D  Q
 .W !!!!!?25,"*** NO DATA TO PRINT ***"
 .D EOP^BARUTL(0)
 ;summary lines
 I $D(^TMP($J,"BAR-TRANST")) W !,"LOCATION^ALLOWANCE CAT^INSURER TYPE^INSURER^BILL COUNT^TOTAL BILL AMOUNT^TOTAL PAYMENTS^ADJ TYPE IEN^ADJUSTMENT TYPE^TOTAL ADJUSTMENTS"
 S BAR("LOC")=0
 F  S BAR("LOC")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"))) Q:'BAR("LOC")  D
 .S BAR("ITYP")=""
 .F  S BAR("ITYP")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"))) Q:BAR("ITYP")=""  D
 ..I BAR("ITYP")="No Billing Entity" Q  ;bar*1.8*23 IHS/SD/POT HEAT74599 
 ..;PKD 1.8*19 12/29/10 -A/R ACCT- Zero if missing
 ..;S BAR("INS")=0
 ..;F  S BAR("INS")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"))) Q:'BAR("INS")  D
 ..S BAR("INS")=""
 ..F  S BAR("INS")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"))) Q:BAR("INS")'?1N.N  D
 ...S BARO("LOC")=$P($G(^AUTTLOC(BAR("LOC"),0)),U,2)
 ...S BARO("ALLC")=$P($T(@BAR("ITYP")),";;",2)
 ...S BARO("ITYP")=$P($T(@BAR("ITYP")),";;",3)
 ...;PKD 1.8*19 fix undef if no A/R acct
 ...;S BARO("INS")=$$GET1^DIQ(90050.02,BAR("INS")_",",.01) 
 ...I BAR("INS")'=0 S BARO("INS")=$$GET1^DIQ(90050.02,BAR("INS")_",",.01) I 1
 ...E  S BARO("INS")="No A/R Account"
 ...S BARREC=BARO("LOC")_U_BARO("ALLC")_U_BARO("ITYP")_U_BARO("INS")_U
 ...W !,BARREC_$G(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS")))
 ...I $D(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS")) D
 ....;PKD 1.8*19 - including AdjTypeIEN
 ....;S BAR("ADJ")=""
 ....;F  S BAR("ADJ")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJ"))) Q:BAR("ADJ")=""  D
 ....S (BAR("ADJ"),BAR("ADJIEN"))=""  ;only one AdjType per AdjTypeIEN
 ....S BARACNT=0
 ....F  S BAR("ADJIEN")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJIEN"))) Q:BAR("ADJIEN")=""  D
 .....S BAR("ADJ")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJIEN"),""))  ;bar*1.8*20
 .....;start old bar*1.8*22 SDR NOHEAT
 .....;I BARACNT'=0 W !,BARREC_U_U
 .....;;W U_BAR("ADJ")_U_$G(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJ"))) 1.8.19
 .....;;W U_BAR("ADJIEN")_U_BAR("ADJ")_U_$G(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJIEN"),BAR("ADJ")))  ;bar*1.8*20
 .....;W U_BAR("ADJIEN")_U_BAR("ADJ")_U_$G(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJIEN")))  ;bar*1.8*20
 .....;S BARACNT=1
 .....;end old start new NOHEAT
 .....S BAR("ADJ TYP")=""
 .....F  S BAR("ADJ TYP")=$O(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJIEN"),BAR("ADJ TYP"))) Q:BAR("ADJ TYP")=""  D
 ......I BARACNT'=0 W !,BARREC_U_U
 ......W U_BAR("ADJIEN")_U_BAR("ADJ")_U_$G(^TMP($J,"BAR-TRANST",BAR("LOC"),BAR("ITYP"),BAR("INS"),"ADJS",BAR("ADJIEN"),BAR("ADJ TYP")))  ;bar*1.8*20
 ......S BARACNT=1
 .....;end new NOHEAT
 ;detail lines
 I '$D(^TMP($J,"BAR-TRANS"))&(BARY("RTYP")=2) D  Q
 .W !!!!!?25,"*** NO DATA TO PRINT ***"
 .D EOP^BARUTL(0)
 ;I $D(^TMP($J,"BAR-TRANS")) W !,"LOCATION^ALLOWANCE CAT^INSURER TYPE^INSURER^BILL^DOS^APPROVAL DT^TOTAL BILL AMT^TOTAL PAYMENTS^#DAYS (DOS-APPR.DT)^ADJUSTMENT DT^ADJUSTMENT TYPE^ADJUSTMENT AMT^#DAYS (APPR.DT-ADJ.DT)"  ;bar*1.8*28 IHS/SD/POT CR8397 HEAT155084
 ;start new bar*1.8*28 IHS/SD/POT CR8397 HEAT155084
 I $D(^TMP($J,"BAR-TRANS")) D
 . W !,"LOCATION^ALLOWANCE CAT^INSURER TYPE^INSURER^BILL^DOS^APPROVAL DT^TOTAL BILL AMT^TOTAL PAYMENTS^#DAYS (DOS-APPR.DT)^ADJUSTMENT DT^ADJ TYPE IEN^ADJUSTMENT TYPE^ADJUSTMENT AMT^#DAYS (APPR.DT-ADJ.DT)"
 ;end new bar*1.8*28 IHS/SD/POT CR8397 HEAT155084
 S BAR("LOC")=0
 F  S BAR("LOC")=$O(^TMP($J,"BAR-TRANS",BAR("LOC"))) Q:'BAR("LOC")  D
 .S BAR("ITYP")=""
 .F  S BAR("ITYP")=$O(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"))) Q:BAR("ITYP")=""  D
 ..I BAR("ITYP")="No Billing Entity" Q  ;bar*1.8*23 IHS/SD/POT HEAT74599 
 ..;PKD 1.8*19 If A/R acct is missing
 ..;S BAR("INS")=0
 ..;F  S BAR("INS")=$O(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"))) Q:'BAR("INS")  D
 ..S BAR("INS")=""
 ..F  S BAR("INS")=$O(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"))) Q:BAR("INS")'?1N.N  D
 ...S BARBILL=""
 ...F  S BARBILL=$O(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"),BARBILL)) Q:BARBILL=""  D
 ....S BARO("LOC")=$P($G(^AUTTLOC(BAR("LOC"),0)),U,2)
 ....S BARO("ALLC")=$P($T(@BAR("ITYP")),";;",2)
 ....S BARO("ITYP")=$P($T(@BAR("ITYP")),";;",3)
 ....;PKD 1.8*19 fix undef if no A/R acct
 ....;S BARO("INS")=$$GET1^DIQ(90050.02,BAR("INS")_",",.01)
 ....I BAR("INS")'=0 S BARO("INS")=$$GET1^DIQ(90050.02,BAR("INS")_",",.01) I 1
 ....E  S BARO("INS")="No A/R Account"
 ....S BARREC=BARO("LOC")_U_BARO("ALLC")_U_BARO("ITYP")_U_BARO("INS")_U_BARBILL_U
 ....;PKD 1.8.20 1/25/11 BARDET - print detail all adj lines
 ....;W !,BARREC_$G(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"),BARBILL))
 ....S BARDTAIL=$G(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"),BARBILL))
 ....W !,BARREC_BARDTAIL
 ....;end 1.8.20
 ....I $D(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"),BARBILL,"ADJS")) D
 .....S BARACNT=0
 .....F  S BARACNT=$O(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"),BARBILL,"ADJS",BARACNT)) Q:'BARACNT  D
 ......;PKD 1.8*20 1/25/11 BARDET - Print bill amt even if >1 adj / bill
 ......;I BARACNT>1 W !,BARREC_U_U_U_U
 ......I BARACNT>1 D
 .......I BARDET W !,BARREC_BARDTAIL
 .......E  W !,BARREC_U_U_U_U
 ......;END 1.8*20
 ......W U_$G(^TMP($J,"BAR-TRANS",BAR("LOC"),BAR("ITYP"),BAR("INS"),BARBILL,"ADJS",BARACNT))
 Q
HDB ; EP
 ;Page & column hdr
 ;EP for writing Rpt Hdr
 W $$EN^BARVDF("IOF"),!
 I $D(BAR("PRIVACY")) W ?($S($D(BAR(132)):34,$D(BAR(180)):68,1:8)),"WARNING: Confidential Patient Information, Privacy Act Applies",!
 K BAR("LINE")
 S $P(BAR("LINE"),"=",$S($D(BAR(133)):132,$D(BAR(180)):181,1:81))=""
 W BAR("LINE"),!
 W BAR("HD",0),?$S($D(BAR(132)):102,$D(BAR(180)):150,1:51)
 D NOW^%DTC
 S Y=%
 X ^DD("DD")
 W $P(Y,":",1,2)
 S BAR("TMPLVL")=0
 F  S BAR("TMPLVL")=$O(BAR("HD",BAR("TMPLVL"))) Q:'BAR("TMPLVL")&(BAR("TMPLVL")'=0)  W:$G(BAR("HD",BAR("TMPLVL")))]"" !,BAR("HD",BAR("TMPLVL"))
 W !,BAR("LINE")
 K BAR("LINE")
 Q
 ;start old bar*1.8*23 IHS/SD/POT
 ;R ;;MEDICARE;;MEDICARE FI
 ;D ;;MEDICAID;;MEDICAID FI
 ;F ;;PRIVATE INSURANCE;;FRATERNAL ORGANIZATION
 ;P ;;PRIVATE INSURANCE;;PRIVATE INSURANCE
 ;H ;;PRIVATE INSURANCE;;HMO
 ;M ;;PRIVATE INSURANCE;;MEDICARE SUPPL.
 ;N ;;OTHER;;NON-BENEFICIARY (NON-INDIAN)
 ;I ;;OTHER;;INDIAN PATIENT
 ;W ;;OTHER;;WORKMEN'S COMP
 ;C ;;OTHER;;CHAMPUS
 ;K ;;MEDICAID;;CHIP (KIDSCARE)
 ;T ;;PRIVATE INSURANCE;;THIRD PARTY LIABILITY
 ;G ;;OTHER;;GUARANTOR
 ;MD ;;MEDICARE;;MCR PART D
 ;MH ;;MEDICARE;;MEDICARE HMO
 ;end old start new bar*1.8*23 IHS/SD/POT
H ;;PRIVATE INSURANCE;;HMO
M ;;PRIVATE INSURANCE;;MEDICARE SUPPL.
D ;;MEDICAID;;MEDICAID FI
R ;;MEDICARE;;MEDICARE FI
P ;;PRIVATE INSURANCE;;PRIVATE INSURANCE
W ;;OTHER;;WORKMEN'S COMP
C ;;OTHER;;CHAMPUS
N ;;OTHER;;NON-BENEFICIARY (NON-INDIAN)
I ;;OTHER;;INDIAN PATIENT
K ;;MEDICAID;;CHIP (KIDSCARE)
T ;;OTHER;;THIRD PARTY LIABILITY 
G ;;OTHER;;GUARANTOR
MD ;;MEDICARE;;MCR PART D
MH ;;MEDICARE;;MEDICARE HMO
MMC ;;MEDICARE;;MCR MANAGED CARE
TSI ;;OTHER;;TRIBAL SELF INSURED
SEP ;;OTHER;;STATE EXCHANGE PLAN
FPL ;;MEDICAID;;FPL 133 PERCENT
MC ;;MEDICARE;;MCR PART C
F ;;PRIVATE INSURANCE;;FRATERNAL ORGANIZATION
V ;;VETERAN;;VETERANS MEDICAL BENEFITS
 ;end new bar*1.8*23 IHS/SD/POT
 ;EOR - IHS/DIT/CPC 1.8*28