source: FOIAVistA/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCOPR1.m@ 1009

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

initial load of FOIAVistA 6/30/08 version

File size: 5.4 KB
Line 
1IBCOPR1 ;WISC/RFJ,BOISE/WRL-print dollar amts for pre-registration ; 05 May 97 8:34 AM
2 ;;2.0; INTEGRATED BILLING ;**75,345**; 21-MAR-94;Build 28
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 Q
5 ;
6 ;
7PRINT ; print report
8 N %,%H,%I,DATA,DATEDIS1,DATEDIS2,DFN,IBCNFLAG,IBCNLINE,INSCO,NOW,PAGE,SCREEN,X,Y,SOI
9 ;
10 S Y=$P(DATESTRT,".") D DD^%DT S DATEDIS1=Y
11 S Y=$P(DATEEND,".") D DD^%DT S DATEDIS2=Y
12 D NOW^%DTC S Y=% D DD^%DT S NOW=Y
13 S PAGE=1,IBCNLINE="",$P(IBCNLINE,"-",81)=""
14 S SCREEN=0 I '$D(ZTQUEUED),IO=IO(0),$E(IOST)="C" S SCREEN=1
15 U IO
16 S SOI=0
17P1 S SOI=$O(COUNTNEW(SOI)) I SOI="" Q
18 I SCREEN,PAGE>1 D PAUSE Q:$G(IBCNFLAG)
19 D H
20 ;
21 ; show list of new patients for source
22 I IBCNFSUM=2 D H1 S DFN=0 F S DFN=$O(^TMP($J,"IBCOPR","NEW",SOI,DFN)) Q:'DFN!($G(IBCNFLAG)) D
23 . S INSCO=0 F S INSCO=$O(^TMP($J,"IBCOPR","NEW",SOI,DFN,INSCO)) Q:'INSCO!($G(IBCNFLAG)) D
24 . . S DATA=^TMP($J,"IBCOPR","ALL",DFN,INSCO)
25 . . W !,$E($P(DATA,"^"),1,25),?27,$P(DATA,"^",2),?34,$E($P($G(^DIC(36,INSCO,0)),"^"),1,30),?68,$P(DATA,"^",3)
26 . . I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H,H1
27 ;
28 I $G(IBCNFLAG) Q
29 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
30 ;
31 W !," TOTAL NEW POLICIES IDENTIFIED WITH ",$P(^IBE(355.12,SOI,0),"^",2),": ",COUNTNEW(SOI),!
32 ;
33 ; *** INPATIENT ***
34 ; show list of new inpatient bills
35 I $G(IBCNFSUM)=2 D BILL(1)
36 I $G(IBCNFLAG) Q
37 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
38 ;
39 W !," TOTAL INPATIENT BILLS COUNT: ",$G(TOTALCNT(SOI,1))+0,?44,"AMOUNT: ",$J($FN(+$G(TOTALAMT(SOI,1)),",",2),12),!
40 I $G(IBCNFLAG) Q
41 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
42 ;
43 ; show list of inpatient transactions
44 I $G(IBCNFSUM)=2 D TRAN(1)
45 I $G(IBCNFLAG) Q
46 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
47 ;
48 W !," TOTAL INPATIENT PAYMENT COUNT: ",$G(PAYMTCNT(SOI,1))+0,?44,"AMOUNT: ",$J($FN(+$G(PAYMTAMT(SOI,1)),",",2),12),!
49 ;
50 ; *** OUTPATIENT ***
51 ; show list of new outpatient bills
52 I $G(IBCNFSUM)=2 D BILL(3)
53 I $G(IBCNFLAG) Q
54 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
55 ;
56 W !," TOTAL OUTPATIENT BILLS COUNT: ",$G(TOTALCNT(SOI,3))+0,?44,"AMOUNT: ",$J($FN(+$G(TOTALAMT(SOI,3)),",",2),12),!
57 I $G(IBCNFLAG) Q
58 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
59 ;
60 ; show list of outpatient transactions
61 I $G(IBCNFSUM)=2 D TRAN(3)
62 I $G(IBCNFLAG) Q
63 I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H
64 ;
65 W !," TOTAL OUTPATIENT PAYMENT COUNT: ",$G(PAYMTCNT(SOI,3))+0,?44,"AMOUNT: ",$J($FN(+$G(PAYMTAMT(SOI,3)),",",2),12),!
66 G P1
67 ;
68 ;
69 ;
70BILL(CLASS) ; print bills where class=1 inpatient, class=3 outpatient
71 N CANCEL,DA,DATE,DATA,DATA1,Y
72 D H2
73 S DATE=0 F S DATE=$O(^TMP($J,"IBCOPR","BILL",SOI,CLASS,DATE)) Q:'DATE!($G(IBCNFLAG)) D
74 . S DA=0 F S DA=$O(^TMP($J,"IBCOPR","BILL",SOI,CLASS,DATE,DA)) Q:'DA!($G(IBCNFLAG)) D
75 . . ; data1 = dfn ^ insco ^ cancel ^ bill number ^ amount
76 . . S DATA1=$G(^TMP($J,"IBCOPR","BILL",SOI,CLASS,DATE,DA))
77 . . S DATA=$G(^TMP($J,"IBCOPR","ALL",+$P(DATA1,"^"),$P(DATA1,"^",2)))
78 . . S Y=DATE D DD^%DT
79 . . W !,$E($P(DATA,"^"),1,25),?27,$P(DATA,"^",2),?33,$P(DATA1,"^",3),?34,$P(DATA1,"^",4),?54,$J($FN(+$P(DATA1,"^",5),",",2),10),?68,Y
80 . . I $P(DATA1,"^",3)'="" S CANCEL=1
81 . . I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H,H2
82 I $G(IBCNFLAG) Q
83 I $G(CANCEL) W !," * Next to bill indicates bill is canceled and not used in totals"
84 Q
85 ;
86 ;
87TRAN(CLASS) ; print transaction where class=1 inpatient, class=3 outpatient
88 N CANCEL,DA,DATE,DATA,DATA1,TYPE,Y
89 D H3
90 S DATE=0 F S DATE=$O(^TMP($J,"IBCOPR","TRAN",SOI,CLASS,DATE)) Q:'DATE!($G(IBCNFLAG)) D
91 . S DA=0 F S DA=$O(^TMP($J,"IBCOPR","TRAN",SOI,CLASS,DATE,DA)) Q:'DA!($G(IBCNFLAG)) D
92 . . ; data1 = dfn ^ insco ^ cancel ^ trans # ^ type ^ amount
93 . . S DATA1=$G(^TMP($J,"IBCOPR","TRAN",SOI,CLASS,DATE,DA))
94 . . S DATA=$G(^TMP($J,"IBCOPR","ALL",+$P(DATA1,"^"),$P(DATA1,"^",2)))
95 . . S Y=DATE D DD^%DT
96 . . S TYPE=$P(DATA1,"^",5),TYPE=$S(TYPE=34:"FULL",1:"PART")
97 . . W !,$E($P(DATA,"^"),1,25),?27,$P(DATA,"^",2),?33,$P(DATA1,"^",3),?34,$P(DATA1,"^",4),?46,TYPE,?54,$J($FN(+$P(DATA1,"^",6),",",2),10),?68,Y
98 . . I $P(DATA1,"^",3)'="" S CANCEL=1
99 . . I $Y>(IOSL-6) D:SCREEN PAUSE Q:$G(IBCNFLAG) D H,H3
100 I $G(IBCNFLAG) Q
101 I $G(CANCEL) W !," * Next to payment indicates payment is canceled and not used in totals"
102 Q
103 ;
104 ;
105PAUSE ; pause at end of page
106 N X U IO(0) W !,"Press RETURN to continue, '^' to exit:" R X:DTIME
107 S:'$T X="^" S:X["^" IBCNFLAG=1 U IO
108 Q
109 ;
110 ;
111H ; header
112 S %=NOW_" PAGE "_PAGE,PAGE=PAGE+1 I PAGE'=2!(SCREEN) W @IOF
113 W $C(13),"SOURCE OF INFORMATION REPORT",?(80-$L(%)),%
114 W !," FOR THE DATE RANGE: ",DATEDIS1," TO ",DATEDIS2,?65,$J("TYPE: "_$S(IBCNFSUM=1:"SUMMARY",1:"DETAILED"),15)
115 W !," SOURCE OF INFORMATION: ",$P(^IBE(355.12,SOI,0),"^",2)
116 W !,IBCNLINE
117 Q
118 ;
119 ;
120H1 ; header for patient list
121 W !,"Patient Name",?27,"SSN",?34,"Insurance Company",?68,"Source Date"
122 W !,$TR(IBCNLINE,"-",".")
123 Q
124 ;
125 ;
126H2 ; header for bill list
127 W !,$E($TR(IBCNLINE,"-","."),1,27)," ",$S(CLASS=1:" Inpatient",1:"Outpatient")," Bills Entered ",$E($TR(IBCNLINE,"-","."),1,27)
128 W !,"Patient Name",?27,"SSN",?34,"Bill Number",?54,$J("Amount",10),?68,"Bill Date"
129 W !,$TR(IBCNLINE,"-",".")
130 Q
131 ;
132 ;
133H3 ; header for transaction list
134 W !,$E($TR(IBCNLINE,"-","."),1,24)," ",$S(CLASS=1:" Inpatient",1:"Outpatient")," Payments Collected ",$E($TR(IBCNLINE,"-","."),1,25)
135 W !,"Patient Name",?27,"SSN",?34,"Tran Number",?46,"Type",?54,$J("Amount",10),?68,"Bill Date"
136 W !,$TR(IBCNLINE,"-",".")
137 Q
Note: See TracBrowser for help on using the repository browser.