source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBJDB12.m@ 1679

Last change on this file since 1679 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 6.9 KB
Line 
1IBJDB12 ;ALB/CPM - BILLING LAG TIME REPORT (OPT PRINT/SUMMARIES) ; 30-DEC-96
2 ;;2.0;INTEGRATED BILLING;**69,100,118**;21-MAR-94
3 ;
4OPT ; - Print the outpatient report.
5 F IBX=1,"2I",9,10,"3I","4I",11,2,3,4 I IBSEL[(","_IBX_",") D Q:IBQ
6 .I '$D(^TMP("IBJDB1",$J,IBDIV,"OP",IBX)) D Q
7 ..S IBPAG=0 D OPTH I IBQ Q
8 ..W !!,"There was no ",$$TITLE^IBJDB1(+IBX,0)
9 ..I IBX["I" W " (Late Insurance)"
10 ..W !," claim activity during this period." D PAUSE
11 .;
12 .S IBPAG=0 D OPTH I IBQ Q
13 .K IBCT,IBTL S (IBCT(IBX),IBTL(IBX))=0,IBX1=""
14 .F S IBX1=$O(^TMP("IBJDB1",$J,IBDIV,"OP",IBX,IBX1)) Q:IBX1="" D Q:IBQ
15 ..I $Y>(IOSL-2) D PAUSE Q:IBQ D OPTH Q:IBQ
16 ..D WPAT S (IBH,IBX2)=0
17 ..F S IBX2=$O(^TMP("IBJDB1",$J,IBDIV,"OP",IBX,IBX1,IBX2)) Q:'IBX2 S IBX3=$G(^(IBX2)) D Q:IBQ
18 ...I $Y>(IOSL-4) D PAUSE Q:IBQ D OPTH,WPAT Q:IBQ S IBH=0
19 ...;
20 ...; - Write bill #, dates and total days.
21 ...W:IBH ! I 'IBH S IBH=1
22 ...W ?40,$P(IBX3,U),?50,$$DTE($P(IBX3,U,2)),$P(IBX3,U,5)
23 ...W ?63,$$DTE($P(IBX3,U,3)),?76,$J($P(IBX3,U,4),4)
24 ...S IBCT(IBX)=IBCT(IBX)+1,IBTL(IBX)=IBTL(IBX)+$P(IBX3,U,4)
25 .;
26 .D AVG,PAUSE
27 ;
28OPTQ Q
29 ;
30OPTH ; - Write the outpatient detail report header.
31 W @IOF,*13 S IBPAG=$G(IBPAG)+1
32 W !,"Outpatient Billing Lag Time Report"
33 W ?48,IBRUN,?72,"Page ",$J(IBPAG,3)
34 W !,$$TITLE^IBJDB1(+IBX,0) I IBX["I" W " (Late Insurance)"
35 W !,"Claims w/activity from ",$$DTE(IBBDT)," to ",$$DTE(IBEDT)
36 W " (*=Insurance found after trmt)"
37 W:IBDIV !,"Division: ",$P($G(^DG(40.8,IBDIV,0)),U) W !!
38 W:IBX[2!(IBX=11) ?50,"Date of" W:IBX=9!(IBX=10) ?50,"Date Claim"
39 W:IBX=1!(IBX[3)!(IBX=10) ?63,"Date of" W:IBX[2!(IBX=9) ?63,"Date Claim"
40 W ?76,"# of",!,"Patient",?27,"SSN",?40,"Bill #"
41 W:IBX=1!(IBX[3)!(IBX[4) ?50,"Date of Care"
42 W:IBX[2 ?50,"Check Out" W:IBX=9 ?50,"Authorized"
43 W:IBX=10 ?51,"Activated" W:IBX=11 ?50,"First Paymt"
44 W:IBX=1 ?63,"Check Out" W:IBX[3!(IBX=10) ?63,"First Paymt"
45 W:IBX[4!(IBX=11) ?63,"Date Closed" W:IBX[2 ?63,"Authorized"
46 W:IBX=9 ?64,"Activated" W ?76,"Days",!,$$DASH(80)
47 S IBQ=$$STOP^IBOUTL("Billing Lag Time Report")
48 Q
49 ;
50AVG ; - Write total days and average line.
51 W !?75,"-----",!,"Average Number of Days for",?75,$J(IBTL(IBX),5)
52 W !,$$TITLE^IBJDB1(+IBX,0),$S(IBX["I":" (Late Ins)",1:""),": "
53 W $J($S('IBCT(IBX):0,1:IBTL(IBX)/IBCT(IBX)),0,2)
54 W " (",IBCT(IBX)," claim",$S(IBCT(IBX)>1:"s",1:""),")"
55 Q
56 ;
57WPAT ; - Write patient data.
58 W !,$E($P(IBX1,"@@"),1,25),?27,$$SSN($P(IBX1,"@@",2))
59 Q
60 ;
61SUM ; - Print the summary reports.
62 D OPTS,PAUSE I IBQ G SUMQ
63 D INPS,PAUSE
64SUMQ Q
65 ;
66OPTS ; - Print the outpatient summary report.
67 I $E(IOST,1,2)="C-" W @IOF,*13
68 W !?32,"BILLING LAG TIME"
69 D CTR("OUTPATIENT SUMMARY REPORT"_$S(IBDIV:" for "_$P($G(^DG(40.8,IBDIV,0)),U),1:""))
70 D CTR("Receivables with activity from "_$$DTE(IBBDT)_" to "_$$DTE(IBEDT))
71 D CTR("Run Date: "_IBRUN) W !?12,$$DASH(55)
72 W !!?2,"Time Period",?50,"Average Number of days"
73 W !?2,"-----------",?50,"----------------------"
74 W !?2,$$TITLE^IBJDB1(1,0),?55,$J($S('IBCT(IBDIV,"OP",1):0,1:IBTL(IBDIV,"OP",1)/IBCT(IBDIV,"OP",1)),7,2)," (",IBCT(IBDIV,"OP",1)," claims)"
75 W !?2,$$TITLE^IBJDB1(2,0),"-LI",?55,$J($S('IBCT(IBDIV,"OP","2I"):0,1:IBTL(IBDIV,"OP","2I")/IBCT(IBDIV,"OP","2I")),7,2)," (",IBCT(IBDIV,"OP","2I")," claims)"
76 W !?2,$$TITLE^IBJDB1(9,0),?55,$J($S('IBCT(IBDIV,"OP",9):0,1:IBTL(IBDIV,"OP",9)/IBCT(IBDIV,"OP",9)),7,2)," (",IBCT(IBDIV,"OP",9)," claims)"
77 W !?2,$$TITLE^IBJDB1(10,0),?55,$J($S('IBCT(IBDIV,"OP",10):0,1:IBTL(IBDIV,"OP",10)/IBCT(IBDIV,"OP",10)),7,2)," (",IBCT(IBDIV,"OP",10)," claims)"
78 W !?2,$$TITLE^IBJDB1(3,0),"-LI",?55,$J($S('IBCT(IBDIV,"OP","3I"):0,1:IBTL(IBDIV,"OP","3I")/IBCT(IBDIV,"OP","3I")),7,2)," (",IBCT(IBDIV,"OP","3I")," claims)"
79 W !?2,$$TITLE^IBJDB1(4,0),"-LI",?55,$J($S('IBCT(IBDIV,"OP","4I"):0,1:IBTL(IBDIV,"OP","4I")/IBCT(IBDIV,"OP","4I")),7,2)," (",IBCT(IBDIV,"OP","4I")," claims)"
80 W !?2,$$TITLE^IBJDB1(11,0),?55,$J($S('IBCT(IBDIV,"OP",11):0,1:IBTL(IBDIV,"OP",11)/IBCT(IBDIV,"OP",11)),7,2)," (",IBCT(IBDIV,"OP",11)," claims)"
81 W !!?2,$$TITLE^IBJDB1(2,0),"+",?55,$J($S('IBCT(IBDIV,"OP",2):0,1:IBTL(IBDIV,"OP",2)/IBCT(IBDIV,"OP",2)),7,2)," (",IBCT(IBDIV,"OP",2)," claims)"
82 W !?2,$$TITLE^IBJDB1(3,0),"+",?55,$J($S('IBCT(IBDIV,"OP",3):0,1:IBTL(IBDIV,"OP",3)/IBCT(IBDIV,"OP",3)),7,2)," (",IBCT(IBDIV,"OP",3)," claims)"
83 W !?2,$$TITLE^IBJDB1(4,0),"+",?55,$J($S('IBCT(IBDIV,"OP",4):0,1:IBTL(IBDIV,"OP",4)/IBCT(IBDIV,"OP",4)),7,2)," (",IBCT(IBDIV,"OP",4)," claims)"
84 I $E(IOST,1,2)="C-" D
85 .W !!?2,"*LI=Late Insurance (policy identified after treatment)"
86 .W !?2,"+This element does not include Late Insurance claims"
87 E W !!
88 Q
89 ;
90INPS ; - Print the inpatient summary report.
91 I $E(IOST,1,2)="C-" W @IOF,*13
92 W !?32,"BILLING LAG TIME"
93 D CTR("INPATIENT SUMMARY REPORT"_$S(IBDIV:" for "_$P($G(^DG(40.8,IBDIV,0)),U),1:""))
94 D CTR("Receivables with activity from "_$$DTE(IBBDT)_" to "_$$DTE(IBEDT))
95 I $E(IOST,1,2)="C-" D CTR("Run Date: "_IBRUN)
96 W !?12,$$DASH(55)
97 W !!?2,"Time Period",?50,"Average Number of days"
98 W !?2,"-----------",?50,"----------------------"
99 W !?2,$$TITLE^IBJDB1(5,0),?55,$J($S('IBCT(IBDIV,"IN",5):0,1:IBTL(IBDIV,"IN",5)/IBCT(IBDIV,"IN",5)),7,2)," (",IBCT(IBDIV,"IN",5)," claims)"
100 W !?2,$$TITLE^IBJDB1(6,0),"-LI",?55,$J($S('IBCT(IBDIV,"IN","6I"):0,1:IBTL(IBDIV,"IN","6I")/IBCT(IBDIV,"IN","6I")),7,2)," (",IBCT(IBDIV,"IN","6I")," claims)"
101 W !?2,$$TITLE^IBJDB1(9,0),?55,$J($S('IBCT(IBDIV,"IN",9):0,1:IBTL(IBDIV,"IN",9)/IBCT(IBDIV,"IN",9)),7,2)," (",IBCT(IBDIV,"IN",9)," claims)"
102 W !?2,$$TITLE^IBJDB1(10,0),?55,$J($S('IBCT(IBDIV,"IN",10):0,1:IBTL(IBDIV,"IN",10)/IBCT(IBDIV,"IN",10)),7,2)," (",IBCT(IBDIV,"IN",10)," claims)"
103 W !?2,$$TITLE^IBJDB1(7,0),"-LI",?55,$J($S('IBCT(IBDIV,"IN","7I"):0,1:IBTL(IBDIV,"IN","7I")/IBCT(IBDIV,"IN","7I")),7,2)," (",IBCT(IBDIV,"IN","7I")," claims)"
104 W !?2,$$TITLE^IBJDB1(8,0),"-LI",?55,$J($S('IBCT(IBDIV,"IN","8I"):0,1:IBTL(IBDIV,"IN","8I")/IBCT(IBDIV,"IN","8I")),7,2)," (",IBCT(IBDIV,"IN","8I")," claims)"
105 W !?2,$$TITLE^IBJDB1(11,0),?55,$J($S('IBCT(IBDIV,"IN",11):0,1:IBTL(IBDIV,"IN",11)/IBCT(IBDIV,"IN",11)),7,2)," (",IBCT(IBDIV,"IN",11)," claims)"
106 W !!?2,$$TITLE^IBJDB1(6,0),"+",?55,$J($S('IBCT(IBDIV,"IN",6):0,1:IBTL(IBDIV,"IN",6)/IBCT(IBDIV,"IN",6)),7,2)," (",IBCT(IBDIV,"IN",6)," claims)"
107 W !?2,$$TITLE^IBJDB1(7,0),"+",?55,$J($S('IBCT(IBDIV,"IN",7):0,1:IBTL(IBDIV,"IN",7)/IBCT(IBDIV,"IN",7)),7,2)," (",IBCT(IBDIV,"IN",7)," claims)"
108 W !?2,$$TITLE^IBJDB1(8,0),"+",?55,$J($S('IBCT(IBDIV,"IN",8):0,1:IBTL(IBDIV,"IN",8)/IBCT(IBDIV,"IN",8)),7,2)," (",IBCT(IBDIV,"IN",8)," claims)"
109 W !!?2,"*LI=Late Insurance (policy identified after treatment)"
110 W !?2,"+This element does not include Late Insurance claims"
111 Q
112 ;
113CTR(X) ; - Center and write text.
114 W !?(80-$L(X))\2,X
115 Q
116 ;
117DASH(X) ; - Return a dashed line.
118 Q $TR($J("",X)," ","=")
119 ;
120PAUSE ; - Page break.
121 I $E(IOST,1,2)'="C-" Q
122 N IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
123 F IBX=$Y:1:(IOSL-3) W !
124 S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S IBQ=1
125 Q
126 ;
127SSN(X) ; - Format the SSN.
128 Q $S(X]"":$E(X,1,3)_"-"_$E(X,4,5)_"-"_$E(X,6,10),1:"")
129 ;
130DTE(X) ; - Format date (MMM DD,YYYY).
131 S:'X X="" S Y=X X ^DD("DD") Q Y
Note: See TracBrowser for help on using the repository browser.