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

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

initial load of WorldVistAEHR

File size: 2.8 KB
Line 
1IBJDB13 ;ALB/CPM - BILLING LAG TIME REPORT (INPT PRINT) ; 02-JAN-97
2 ;;2.0;INTEGRATED BILLING;**100,118**;21-MAR-94
3 ;
4INP ; - Print the inpatient report.
5 F IBX=5,"6I",9,10,"7I","8I",11,6,7,8 I IBSEL[(","_IBX_",") D Q:IBQ
6 .I '$D(^TMP("IBJDB1",$J,IBDIV,"IN",IBX)) D Q
7 ..S IBPAG=0 D INPH 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 INPH I IBQ Q
13 .K IBCT,IBTL S (IBCT(IBX),IBTL(IBX))=0,IBX1=""
14 .F S IBX1=$O(^TMP("IBJDB1",$J,IBDIV,"IN",IBX,IBX1)) Q:IBX1="" D Q:IBQ
15 ..I $Y>(IOSL-2) D PAUSE Q:IBQ D INPH Q:IBQ
16 ..D WPATI S (IBH,IBX2)=0
17 ..F S IBX2=$O(^TMP("IBJDB1",$J,IBDIV,"IN",IBX,IBX1,IBX2)) Q:'IBX2 S IBX3=$G(^(IBX2)) D Q:IBQ
18 ...I $Y>(IOSL-4) D PAUSE Q:IBQ D INPH,WPATI 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 ;
28INPQ Q
29 ;
30WPATI ; - Write inpatient patient data.
31 W !,$E($P(IBX1,"@@"),1,25),?27,$$SSN($P(IBX1,"@@",2))
32 Q
33 ;
34INPH ; - Write the inpatient detail report header.
35 W @IOF,*13 S IBPAG=$G(IBPAG)+1
36 W !,"Inpatient Billing Lag Time Report"
37 W ?48,IBRUN,?72,"Page ",$J(IBPAG,3)
38 W !,$$TITLE^IBJDB1(+IBX,0) I IBX["I" W " (Late Insurance)"
39 W !,"Claims w/activity from ",$$DTE(IBBDT)," to ",$$DTE(IBEDT)
40 W " (*=Insurance found after trmt)"
41 W:IBDIV !,"Division: ",$P($G(^DG(40.8,IBDIV,0)),U) W !!
42 W:IBX=5!(IBX[7)!(IBX[8)!(IBX=11) ?50,"Date of"
43 W:IBX[6 ?50,"Date PTF" W:IBX=9!(IBX=10) ?50,"Date Claim"
44 W:IBX=5 ?63,"Date PTF" W:IBX[7!(IBX=10) ?63,"Date of"
45 W:IBX[6!(IBX=9) ?63,"Date Claim"
46 W ?76,"# of",!,"Patient",?27,"SSN",?40,"Bill #"
47 W:IBX=5!(IBX[7)!(IBX[8) ?50,"Discharge"
48 W:IBX[6 ?50,"Transmitted" W:IBX=9 ?50,"Authorized"
49 W:IBX=10 ?51,"Activated" W:IBX=11 ?50,"First Paymt"
50 W:IBX=5 ?63,"Transmitted" W:IBX[6 ?63,"Authorized"
51 W:IBX[7!(IBX=10) ?63,"First Paymt" W:IBX[8!(IBX=11) ?63,"Date Closed"
52 W:IBX=9 ?64,"Activated" W ?76,"Days",!,$$DASH(80)
53 S IBQ=$$STOP^IBOUTL("Billing Lag Time Report")
54 Q
55 ;
56AVG ; - Write total days and average line.
57 W !?75,"-----",!,"Average Number of Days for",?75,$J(IBTL(IBX),5)
58 W !,$$TITLE^IBJDB1(+IBX,0),$S(IBX["I":" (Late Ins)",1:""),": "
59 W $J($S('IBCT(IBX):0,1:IBTL(IBX)/IBCT(IBX)),0,2)
60 W " (",IBCT(IBX)," claim",$S(IBCT(IBX)>1:"s",1:""),")"
61 Q
62 ;
63DASH(X) ; - Return a dashed line.
64 Q $TR($J("",X)," ","=")
65 ;
66PAUSE ; - Page break.
67 I $E(IOST,1,2)'="C-" Q
68 N IBX,DIR,DIRUT,DUOUT,DTOUT,DIROUT,X,Y
69 F IBX=$Y:1:(IOSL-3) W !
70 S DIR(0)="E" D ^DIR I $D(DIRUT)!($D(DUOUT)) S IBQ=1
71 Q
72 ;
73SSN(X) ; - Format the SSN.
74 Q $S(X]"":$E(X,1,3)_"-"_$E(X,4,5)_"-"_$E(X,6,10),1:"")
75 ;
76DTE(X) ; - Format date (MMM DD,YYYY).
77 S:'X X="" S Y=X X ^DD("DD") Q Y
Note: See TracBrowser for help on using the repository browser.