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

BARAWOR.m

Go to the documentation of this file.
BARAWOR ; IHS/SD/LSL - ADJUSTMENT AND REFUND REPORT RPT
 ;;1.8;IHS ACCOUNTS RECEIVABLE;**10,23**;OCT 26, 2005
 ; NEW ROUTINE BAR*1.8*10
 ; JULY 2013 P.OTT ADDED NEW INS TYPES
 ;************************************************************
START ; EP
 ; Collections report using FM print
 ;
S ;
 N DIR
 S DIR(0)="S^D:DETAIL;S:SUMMARY"
 S DIR("A")="Select Report Type"
 D ^DIR
 S BARRDET=Y
 K DIR
 ;S DIR(0)="S^R:MEDICARE;D:MEDICAID;P:PRIVATE INS;H:HMO;M:MEDICARE SUPPL;W:WORKMEN'S COMP;C:CHAMPUS;F:FRATERNAL ORG;N:NON-INDIAN (NON-BEN);I:INDIAN (BENEFICIARY);K:SCHIP;T:TPL;MD:MEDICARE PART D;MH:MEDICARE HMO;A:ALL"
 S DIR("A")="Select Type of Insurer"
 S DIR(0)="SO^R:MEDICARE"
 S DIR(0)=DIR(0)_";D:MEDICAID"
 S DIR(0)=DIR(0)_";P:PRIVATE INSURANCE"
 S DIR(0)=DIR(0)_";H:HMO"
 S DIR(0)=DIR(0)_";M:MEDICARE SUPPL"
 S DIR(0)=DIR(0)_";W:WORKMEN'S COMP"
 S DIR(0)=DIR(0)_";C:CHAMPUS"
 S DIR(0)=DIR(0)_";F:FRATERNAL ORG"
 S DIR(0)=DIR(0)_";N:NON-BENEFICIARY PATIENTS"
 S DIR(0)=DIR(0)_";I:BENEFICIARY PATIENTS"
 S DIR(0)=DIR(0)_";T:TPL"
 S DIR(0)=DIR(0)_";MD:MEDICARE PART D"
 S DIR(0)=DIR(0)_";MH:MEDICARE HMO"
 ;S DIR(0)=DIR(0)_";FPL:MEDICAID" ;FPL 133 PERCENT
 S DIR(0)=DIR(0)_";K:CHIP"
 S DIR(0)=DIR(0)_";V:VETERANS ADMINISTRATION"
 S DIR(0)=DIR(0)_";A:ALL"
 S DIR("A")="Select TYPE of BILLING ENTITY to Display"
 S DIR("?")="Enter TYPE of BILLING ENTITY to display, or press <return> for ALL"
 ; S BARY("TYP")=U_Y_U
 ;S BARY("TYP","NM")=Y(0)
 D ^DIR
 K DIR
 I Y<0!($D(DTOUT))!($D(DUOUT)) Q
 S BAR("RPTYPE")=Y
 D DATE
 G:$D(BAREFLG) END
 D DIPVAR
 D PRINT
 D EOP^BARUTL(1)
 ;
END ;
 Q
 ; *********************************************************************
 ;
DATE ; EP
 ; Select Date Range - Transaction date/time
 K BAREFLG
 W !
 S BAR("BDOS")=$$DATE^BARDUTL(1)
 I Y<0 S BAREFLG=1 Q
 S BAR("XBDOS")=$$MDT^BARDUTL(BAR("BDOS"))
 S BAR("EDOS")=$$DATE^BARDUTL(2)
 I Y<0 S BAREFLG=1 Q
 S BAR("XEDOS")=$$MDT^BARDUTL(BAR("EDOS"))
 Q
 ; *********************************************************************
 ;
PRINT ;
 ; Print
 S BAR("SITE")=$P(^DIC(4,DUZ(2),0),U)
 S DIC="90050.03"
 S L=0
 I BAR("RPTYPE")="P" S FR=BAR("BDOS")_",,PRIVATE,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,PRIVATE,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="R" S FR=BAR("BDOS")_",,MEDICARE FI,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,MEDICARE FI,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="D" S FR=BAR("BDOS")_",,MEDICAID FI,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,MEDICAID FI,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="H" S FR=BAR("BDOS")_",,HMO,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,HMO,,,"
 I BAR("RPTYPE")="M" S FR=BAR("BDOS")_",,MEDICARE SUPPL,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,MEDICARE SUPPL,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="W" S FR=BAR("BDOS")_",,WORKMEN'S COMP,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,WORKMEN'S COMP,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="C" S FR=BAR("BDOS")_",,CHAMPUS,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,CHAMPUS,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="F" S FR=BAR("BDOS")_",,FRATERNAL ORG,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,FRATERNAL ORG,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="N" S FR=BAR("BDOS")_",,NON-BEN (NON-INDIAN),,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,NON-BEN (NON-INDIAN),,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="I" S FR=BAR("BDOS")_",,INDIAN PATIENT,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,INDIAN PATIENT,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="K" S FR=BAR("BDOS")_",,CHIP (KIDSCARE),,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,CHIP (KIDSCARE),,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="T" S FR=BAR("BDOS")_",,3P LIABILITY,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,3P LIABILITY,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="MD" S FR=BAR("BDOS")_",,MCR PART D,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,MCR PART D,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="MH" S FR=BAR("BDOS")_",,MEDICARE HMO,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,MEDICARE HMO,,AUTO WRITE-OFF 2007,"
 I BAR("RPTYPE")="V" S FR=BAR("BDOS")_",,VA,,WRITE-OFF 2000,",TO=BAR("EDOS")_",,VA,,WRITE-OFF 2007,"
 I BAR("RPTYPE")="A" S FR=BAR("BDOS")_",,,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,,,AUTO WRITE-OFF 2007,"
 ;S FR=BAR("BDOS")_",,,,AUTO WRITE-OFF 2000,",TO=BAR("EDOS")_",,,,AUTO WRITE-OFF 2007,"
 D EN1^DIP
 ;
DSP ; EP for VALM
 D ^%ZISC,HOME^%ZIS
 Q
 ; *********************************************************************
 ;
DIPVAR ;
 ; Set up DIP variables and Header routine
 Q:$D(BAREFLG)
 S BY="@'.01,@101,6:1.08;""INSURER TYPE: "",102,+103;""REASON: "";L20,+6;""+"";S1;C1;"""
 D:BARRDET="D" DETAIL
 D:BARRDET="S" SUMMARY
 Q
 ; *********************************************************************
 ;
DETAIL ;
 ;S DHD="[BAR ADAL HDR"
 S DHD="AUTOMATIC WRITE OFF REPORT FOR "
 S FLDS="NUMDATE4(#12);""TRANSACTION DATE"",!4;L18,4:102;""SERVICE DATE"",&3.7;R10;C65;D2;""ADJUSTMENT"""  ;Y2000
 Q
 ;
SUMMARY ;
 S FLDS="6!,&3.7;R10;C45;D2;""ADJUSTMENT"",&3.619;R9;D2""REFUND"",&3.5;R10;D2;""CREDIT/DEBIT"""  ;Print A/R ACCOUNT,ADJ, REF, CREDIT-DEBIT
 ;S DHD="[BAR ADALS HDR]"
 Q