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

IBJDF62.m

Go to the documentation of this file.
  1. IBJDF62 ;ALB/RB - MISC. BILLS FOLLOW-UP REPORT (PRINT) ;15-APR-00
  1. ;;2.0;INTEGRATED BILLING;**123,159,618**;21-MAR-94;Build 61
  1. ;;Per VHA Directive 6402, this routine should not be modified.
  1. ;
  1. ;Read ^PRCA(430.2) via Private IA 594
  1. ;
  1. EN ; - Print the Follow-up report.
  1. S IBQ=0 D NOW^%DTC S IBRUN=$$DAT2^IBOUTL(%) G:IBRPT="S" SUM
  1. I 'IBSDV D DET(0) G SUM
  1. S IBDIV=""
  1. F S IBDIV=$O(VAUTD(IBDIV)) Q:IBDIV="" D Q:IBQ
  1. . D DET(IBDIV)
  1. ;
  1. SUM I 'IBQ D PRT^IBJDF63 ; Print summary.
  1. ENQ K IBN,IBIN,IBC,IBCD,IBC1,IBC2,IBCAT1,IBD,IBDIV,IBGBL,IBPAG,IBP,IBPD,IBPTD,IBQ,IBRUN,%
  1. Q
  1. ;
  1. DET(IBDIV) ; - Print report for a specific division.
  1. ; Input: IBDIV=Pointer to the division in file #40.8
  1. S IBCAT=0
  1. F S IBCAT=$O(IBCAT(IBCAT)) Q:'IBCAT D Q:IBQ
  1. . S IBCAT1=IBCAT(IBCAT),IBGBL=$S(IBCAT1<8:"IBJDF6P",1:"IBJDF6D") ;IB*2.0*618
  1. . I IBDIV,IBCAT1'<8 Q ;IB*2.0*618
  1. . I IBSDV,'IBDIV,IBCAT1<8 Q ;IB*2.0*618
  1. . I '$D(^TMP(IBGBL,$J,IBDIV,IBCAT)) D HDR1 Q:IBQ D NAR,PAUSE Q
  1. . D HDR1 Q:IBQ
  1. . S IBIN="" F S IBIN=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN)) Q:IBIN="" D Q:IBQ
  1. . . I $Y>(IOSL-5) D PAUSE Q:IBQ D HDR1 Q:IBQ
  1. . . D HDR2
  1. . . S (IBPTD,IB0,IBD)=""
  1. . . F S IBPTD=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD)) Q:IBPTD="" D Q:IBQ
  1. . . . I $Y>(IOSL-5) D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ
  1. . . . S IBPD=$G(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD))
  1. . . . D WPAT
  1. . . . F S IB0=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0)) Q:IB0="" D Q:IBQ
  1. . . . . S IBN=$G(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0))
  1. . . . . I $Y>(IOSL-3) D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ D WPAT
  1. . . . . I IBCAT1<8 D ;IB*2.0*618
  1. . . . . . W ?71,IB0,?84,$$DAT1^IBOUTL(+IBN),?94,$$DAT1^IBOUTL($P(IBN,U,2))
  1. . . . . . W ?104,$$DAT1^IBOUTL($P(IBN,U,3)),?114,$J($P(IBN,U,4),8,2)
  1. . . . . . W ?124,$J($P(IBN,U,5),8,2),!
  1. . . . . E D
  1. . . . . . W ?33,IB0,?47,$$DAT1^IBOUTL(+IBN),?59,$P($P(IBN,U,2),"@@")
  1. . . . . . W ?92,$J($P(IBN,U,3),8,2),?103,$J($P(IBN,U,4),8,2)
  1. . . . . . W ?114,$J($P(IBN,U,5),8,2),!
  1. . . . . ;
  1. . . . . ; - Display bill comment history, if necessary.
  1. . . . . I IBSH D COM
  1. . ;
  1. . I 'IBQ D PAUSE
  1. ;
  1. DETQ Q
  1. ;
  1. DASH(X) ; - Return a dashed line.
  1. Q $TR($J("",X)," ","=")
  1. ;
  1. PAUSE ; - Page break.
  1. I $E(IOST,1,2)'="C-" Q
  1. N IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
  1. F IBX=$Y:1:(IOSL-3) W !
  1. S DIR(0)="E" D ^DIR S:$D(DIRUT)!($D(DUOUT)) IBQ=1
  1. Q
  1. ;
  1. HDR1 ; - Write the primary report header.
  1. N IBCATNM
  1. I $E(IOST,1,2)="C-"!$G(IBPAG) W @IOF,*13
  1. S IBPAG=$G(IBPAG)+1 W "Miscellaneous Bills Follow-Up Report"
  1. I IBDIV W " for ",$P($G(^DG(40.8,IBDIV,0)),U)
  1. W ?60," Run Date: ",IBRUN,?123,"Page: ",$J(IBPAG,3)
  1. ;
  1. S IBCATNM=$$ARCAT(IBCAT) ; patch IB*2.0*618
  1. S X="ALL ACTIVE "_$G(IBCATNM)_" RECEIVABLES "
  1. I IBSMN S X=X_"OVER "_IBSMN_" AND LESS THAN "_IBSMX_" DAYS OLD "
  1. I IBCAT(IBCAT)<8 D ;IB*2.0*618
  1. . S X=X_" / BY PATIENT "_$S(IBSN="N":"NAME",1:"LAST 4 DIGITS OF SSN")
  1. . S X=X_" ("_$S($G(IBSNA)="ALL":"ALL",1:"From "_$S(IBSNF="":"FIRST",1:IBSNF)_" to "_$S(IBSNL="zzzzz":"LAST",1:IBSNL))_") / "
  1. I IBCAT(IBCAT)>7 D ;IB*2.0*618
  1. . S X=X_" / BY DEBTOR NAME"
  1. . S X=X_" ("_$S($G(IBSDA)="ALL":"ALL",1:"From "_$S(IBSDF="":"FIRST",1:IBSDF)_" to "_$S(IBSDL="zzzzz":"LAST",1:IBSDL))_") / "
  1. S X=X_$S('IBSAM:"NO ",1:"")_" MINIMUM BALANCE"
  1. I IBSAM S X=X_$S(IBSAM:": $"_$FN(IBSAM,",",2),1:"")
  1. S X=X_" / "_$S('IBSH:"NO ",IBSH1="A":"ALL ",1:"ONLY ")_"COMMENTS"
  1. S X=X_$S($G(IBSH2):" NOT OLDER THAN "_IBSH2_" DAYS",1:"")
  1. S X=X_" / '*' AFTER THE PATIENT/DEBTOR NAME = VA EMPLOYEE"
  1. F I=1:1 W !,$E(X,1,132) S X=$E(X,133,999) I X="" Q
  1. ;
  1. I IBCAT1<8 D G HDQ ;IB*2.0*618
  1. .W !!?84,"Date",?94,"Bill",?104,"Bill",?114,"Original Current"
  1. .W !,"Patient (Age)",?33,"SSN",?47,"Other Insurance",?71,"Bill Number"
  1. .W ?84,"Prepared From Dte To Date",?116,"Amount Balance"
  1. ;
  1. W !!?47,"Date Bill",?92,"Original Last Amt Current"
  1. W !,"Debtor",?33,"Bill Number Prepared Processed By",?94,"Amount"
  1. W ?107,"Paid Balance" S:$G(IBD) IBD=""
  1. HDQ W !,$$DASH(IOM),!
  1. S IBQ=$$STOP^IBOUTL("Miscellaneous Bills Follow-Up Report")
  1. Q
  1. ;
  1. HDR2 ; - Write the insurance company sub-header.
  1. N X,X13 Q:IBCAT1>7 ;IB*2.0*618
  1. W ?2,"Carrier: ",$P(IBIN,"@@")
  1. S X=$G(^DIC(36,+$P(IBIN,"@@",2),.11)),X13=$G(^(.13))
  1. I X]"" D
  1. .W ", ",$P(X,U),", ",$P(X,U,4),", ",$P($G(^DIC(5,+$P(X,U,5),0)),U,2)," ",$P(X,U,6)
  1. .I $P(X13,U,2)]"" W " Billing Phone: ",$P(X13,U,2) Q
  1. .I $P(X13,U)]"" W " Main Phone: ",$P(X13,U)
  1. ;
  1. W !
  1. Q
  1. ;
  1. NAR ; - Write detail line (if '$D).
  1. N I
  1. W !!,"There are no active receivables "
  1. I IBSMN W IBSMN,$S(IBSMX>IBSMN:" to "_IBSMX,1:"")," days old "
  1. I IBDIV W "for this division."
  1. I IBSDV,IBDIV,IBCAT1<8 Q ;IB*2.0*618
  1. I IBSDV,'IBDIV,IBCAT1'<8 Q ;IB*2.0*618
  1. F I=1:1:8 S IB(+IBDIV,IBCAT,I)=""
  1. Q
  1. ;
  1. WPAT ; - Write patient data.
  1. I IBCAT1<8 D Q ;IB*2.0*618
  1. . W $P(IBPD,U)," (",$P(IBPD,U,2),")",?33,$P(IBPD,U,3),?47,$P(IBPD,U,4)
  1. W $P(IBPD,U)
  1. Q
  1. ;
  1. COM ; - Write comments
  1. N CONT,DIWL,DIWR,IBC,IBC1,IBC2,X
  1. ;
  1. S (IBC,CONT)=0,IBC1="",DIWL=1,DIWR=104 K ^UTILITY($J,"W")
  1. F S IBC=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC)) Q:'IBC D Q:IBQ
  1. . I $Y>(IOSL-4) D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ D WPAT W !
  1. . F S IBC1=$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC,IBC1)) Q:IBC1="" D Q:IBQ
  1. . . S IBC2=^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC,IBC1)
  1. . . I $Y>(IOSL-4) D WCPB Q:IBQ
  1. . . I 'IBC1 S IBCD=IBC2 D WCD Q
  1. . . S X=IBC2 I $E(X)=" ",$L(X)>1 S $E(X)=""
  1. . . D ^DIWP
  1. . . I 'CONT,$L(IBC2)<66 D WCTXT Q
  1. . . S CONT=$L(IBC2)>65
  1. . . I '$O(^TMP(IBGBL,$J,IBDIV,IBCAT,IBIN,IBPTD,IB0,IBC,IBC1)) D
  1. . . . D:$D(^UTILITY($J,"W")) WCTXT
  1. K ^UTILITY($J,"W")
  1. Q
  1. ;
  1. WCTXT ; - Write comment text
  1. N LIN,WLIN
  1. S LIN=""
  1. F S LIN=$O(^UTILITY($J,"W",1,LIN)) Q:LIN="" D Q:IBQ
  1. . S WLIN=$G(^UTILITY($J,"W",1,LIN,0))
  1. . I $Y>(IOSL-4) D WCPB Q:IBQ
  1. . W:WLIN'="" ?26,WLIN,!
  1. K ^UTILITY($J,"W")
  1. Q
  1. ;
  1. WCPB ; - Page Break in the middle of Comments
  1. D PAUSE Q:IBQ D HDR1,HDR2 Q:IBQ
  1. W ! D WPAT W ! D WCD W:IBC1>1 ?26,"(continued)",!
  1. Q
  1. ;
  1. WCD ; - Write comment date.
  1. W ?2,"Comment Date: ",$$DAT1^IBOUTL(IBCD)
  1. Q
  1. ;
  1. ARCAT(IBCAT) ; obtain AR Category's name - patch IB*2.0*618
  1. N IBCATNAM
  1. S IBCATNAM=$$GET1^DIQ(430.2,IBCAT,.01) ; get AR CATEGORY
  1. Q IBCATNAM