1 | FBFPTR ;WOIFO/SAB-FPPS TRANSMIT REPORT ;9/8/2003
|
---|
2 | ;;3.5;FEE BASIS;**61**;JAN 30, 1995
|
---|
3 | ;
|
---|
4 | W !,"This option generates a report of transmissions to FPPS for a date range.",!
|
---|
5 | ; ask start date
|
---|
6 | S DIR(0)="D^::EX",DIR("A")="From Date"
|
---|
7 | D ^DIR K DIR G:$D(DIRUT) EXIT
|
---|
8 | S FBDT1=Y
|
---|
9 | ;
|
---|
10 | ; ask end date
|
---|
11 | S DIR(0)="DA^"_FBDT1_":"_DT_":EX",DIR("A")="To Date: "
|
---|
12 | D ^DIR K DIR G:$D(DIRUT) EXIT
|
---|
13 | S FBDT2=Y
|
---|
14 | ;
|
---|
15 | ; ask device
|
---|
16 | S %ZIS="QM" D ^%ZIS G:POP EXIT
|
---|
17 | I $D(IO("Q")) D G EXIT
|
---|
18 | . S ZTRTN="QEN^FBFPTR",ZTDESC="FPPS Transmit Report"
|
---|
19 | . F FBX="FBDT*" S ZTSAVE(FBX)=""
|
---|
20 | . D ^%ZTLOAD,HOME^%ZIS K ZTSK
|
---|
21 | ;
|
---|
22 | QEN ; queued entry
|
---|
23 | U IO
|
---|
24 | ;
|
---|
25 | GATHER ; collect and sort data
|
---|
26 | S FBQUIT=0
|
---|
27 | ; initialize totals array
|
---|
28 | K FBT
|
---|
29 | ;
|
---|
30 | ; loop thru MESSAGE DATE/TIME x-ref by date and process transmissions
|
---|
31 | S FBC=0 ; initialize count of records processed
|
---|
32 | S FBDT=FBDT1
|
---|
33 | F S FBDT=$O(^FBHL(163.5,"AMD",FBDT)) Q:FBDT=""!($P(FBDT,".")>FBDT2) D Q:FBQUIT
|
---|
34 | . S FBDA=0 F S FBDA=$O(^FBHL(163.5,"AMD",FBDT,FBDA)) Q:'FBDA D Q:FBQUIT
|
---|
35 | . . S FBC=FBC+1 ; increment count of records processed
|
---|
36 | . . ; if tasked then check for stop request
|
---|
37 | . . I $D(ZTQUEUED),FBC\1000,$$S^%ZTLOAD S ZTSTOP=1,FBQUIT=1 Q
|
---|
38 | . . ; get data
|
---|
39 | . . S FBY=$G(^FBHL(163.5,FBDA,0))
|
---|
40 | . . S FBFILE=$P(FBY,U,2) ; invoice file number
|
---|
41 | . . I FBFILE="" S FBFILE="U"
|
---|
42 | . . S FBTTYP=$P(FBY,U,6) ; transaction type
|
---|
43 | . . I FBTTYP="" S FBTTYP="U"
|
---|
44 | . . S FBSTA=" "_$P(FBY,U,7) ; station number
|
---|
45 | . . I FBSTA=" " S FBSTA=" UNK"
|
---|
46 | . . ; add to transmitted total
|
---|
47 | . . S $P(FBT(FBSTA,FBFILE,FBTTYP),U)=$P($G(FBT(FBSTA,FBFILE,FBTTYP)),U)+1
|
---|
48 | . . ; if accepted by interface engine then add to accepted total
|
---|
49 | . . I $P(FBY,U,8)="A" S $P(FBT(FBSTA,FBFILE,FBTTYP),U,2)=$P($G(FBT(FBSTA,FBFILE,FBTTYP)),U,2)+1
|
---|
50 | ;
|
---|
51 | PRINT ; report data
|
---|
52 | S FBPG=0 D NOW^%DTC S Y=% D DD^%DT S FBDTR=Y
|
---|
53 | K FBDL S FBDL="",$P(FBDL,"-",IOM)=""
|
---|
54 | ;
|
---|
55 | ; build page header text for selection criteria
|
---|
56 | S FBHDT(1)=" For "_$$FMTE^XLFDT(FBDT1)_" through "_$$FMTE^XLFDT(FBDT2)
|
---|
57 | ;
|
---|
58 | D HD
|
---|
59 | ;
|
---|
60 | I 'FBQUIT,'$D(FBT) W !,"No invoices were transmitted during specified period."
|
---|
61 | ;
|
---|
62 | I 'FBQUIT,$D(FBT) D RSUM
|
---|
63 | ;
|
---|
64 | I FBQUIT W !!,"REPORT STOPPED AT USER REQUEST"
|
---|
65 | ;
|
---|
66 | I 'FBQUIT,$E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR K DIR
|
---|
67 | D ^%ZISC
|
---|
68 | ;
|
---|
69 | EXIT ;
|
---|
70 | I $D(ZTQUEUED) S ZTREQ="@"
|
---|
71 | K FBC,FBDA,FBDL,FBDT,FBDT1,FBDT2,FBDTR,FBFILE,FBHDT,FBPG,FBQUIT
|
---|
72 | K FBSTA,FBT,FBTTYP,FBX,FBY
|
---|
73 | K %,DIC,DIR,DIROUT,DIRUT,DTOUT,DUOUT,I,J,POP,X,Y
|
---|
74 | Q
|
---|
75 | ;
|
---|
76 | RSUM ; report summary
|
---|
77 | N FBCC,FBCL,FBCX
|
---|
78 | ;
|
---|
79 | W !!,"SUMMARY OF EDI INVOICES TRANSMITTED TO FPPS"
|
---|
80 | ;
|
---|
81 | ; summary header
|
---|
82 | D HDSUM
|
---|
83 | ;
|
---|
84 | ; init grand total
|
---|
85 | S FBT="0^0^0" ; confirm^cancel^accepted
|
---|
86 | ;
|
---|
87 | ; loop thru station
|
---|
88 | S FBSTA="" F S FBSTA=$O(FBT(FBSTA)) Q:FBSTA="" D Q:FBQUIT
|
---|
89 | . I $Y+9>IOSL D HD Q:FBQUIT D HDSUM
|
---|
90 | . ; init station totals
|
---|
91 | . S FBT(FBSTA)="0^0^0" ; confirm^cancel^accepted
|
---|
92 | . ;
|
---|
93 | . W !
|
---|
94 | . ;
|
---|
95 | . ; loop thru file type
|
---|
96 | . S FBFILE="" F S FBFILE=$O(FBT(FBSTA,FBFILE)) Q:FBFILE="" D Q:FBQUIT
|
---|
97 | . . ;
|
---|
98 | . . ; get counts for each transaction types
|
---|
99 | . . S FBCC=$P($G(FBT(FBSTA,FBFILE,"C")),U) ; claim
|
---|
100 | . . S FBCL=$P($G(FBT(FBSTA,FBFILE,"L")),U) ; line
|
---|
101 | . . S FBCX=$P($G(FBT(FBSTA,FBFILE,"X")),U) ; cancel
|
---|
102 | . . S FBCA=$P($G(FBT(FBSTA,FBFILE,"C")),U,2)+$P($G(FBT(FBSTA,FBFILE,"L")),U,2)+$P($G(FBT(FBSTA,FBFILE,"X")),U,2) ; accepted
|
---|
103 | . . ;
|
---|
104 | . . ; write the line for the file type
|
---|
105 | . . W !,FBSTA
|
---|
106 | . . W ?9,$S(FBFILE=3:"Outpatient/Ancillary",FBFILE=5:"Pharmacy",FBFILE=9:"Inpatient",1:"Unknown")
|
---|
107 | . . W ?31,$J($FN(FBCL+FBCC,","),9)
|
---|
108 | . . W ?42,$J($FN(FBCX,","),9)
|
---|
109 | . . W ?53,$J($FN(FBCL+FBCC+FBCX,","),9)
|
---|
110 | . . W ?64,$J($FN(FBCA,","),14)
|
---|
111 | . . ;
|
---|
112 | . . ; add file type counts to station totals
|
---|
113 | . . S $P(FBT(FBSTA),U)=$P(FBT(FBSTA),U)+FBCL+FBCC
|
---|
114 | . . S $P(FBT(FBSTA),U,2)=$P(FBT(FBSTA),U,2)+FBCX
|
---|
115 | . . S $P(FBT(FBSTA),U,3)=$P(FBT(FBSTA),U,3)+FBCA
|
---|
116 | . ;
|
---|
117 | . ; write station total
|
---|
118 | . W !,?31,"---------",?42,"---------",?53,"---------",?64,"--------------"
|
---|
119 | . W !,FBSTA," Station Totals",?31,$J($FN($P(FBT(FBSTA),U),","),9)
|
---|
120 | . W ?42,$J($FN($P(FBT(FBSTA),U,2),","),9)
|
---|
121 | . W ?53,$J($FN($P(FBT(FBSTA),U)+$P(FBT(FBSTA),U,2),","),9)
|
---|
122 | . W ?64,$J($FN($P(FBT(FBSTA),U,3),","),14)
|
---|
123 | . ;
|
---|
124 | . ; add station totals to grand total
|
---|
125 | . S $P(FBT,U)=$P(FBT,U)+$P(FBT(FBSTA),U)
|
---|
126 | . S $P(FBT,U,2)=$P(FBT,U,2)+$P(FBT(FBSTA),U,2)
|
---|
127 | . S $P(FBT,U,3)=$P(FBT,U,3)+$P(FBT(FBSTA),U,3)
|
---|
128 | ;
|
---|
129 | Q:FBQUIT
|
---|
130 | ;
|
---|
131 | ; write report totals
|
---|
132 | W !!,?31,"=========",?42,"=========",?53,"=========",?64,"=============="
|
---|
133 | W !,"Report Totals",?31,$J($FN($P(FBT,U),","),9)
|
---|
134 | W ?42,$J($FN($P(FBT,U,2),","),9)
|
---|
135 | W ?53,$J($FN($P(FBT,U)+$P(FBT,U,2),","),9)
|
---|
136 | W ?64,$J($FN($P(FBT,U,3),","),14)
|
---|
137 | Q
|
---|
138 | ;
|
---|
139 | HD ; page header
|
---|
140 | N FBI
|
---|
141 | I $D(ZTQUEUED),$$S^%ZTLOAD S ZTSTOP=1,FBQUIT=1 Q
|
---|
142 | I $E(IOST,1,2)="C-",FBPG S DIR(0)="E" D ^DIR K DIR I 'Y S FBQUIT=1 Q
|
---|
143 | I $E(IOST,1,2)="C-"!FBPG W @IOF
|
---|
144 | S FBPG=FBPG+1
|
---|
145 | W !,"FPPS Transmission Report ",?49,FBDTR,?72,"page ",FBPG
|
---|
146 | S FBI=0 F S FBI=$O(FBHDT(FBI)) Q:'FBI W !,FBHDT(FBI)
|
---|
147 | W !,FBDL
|
---|
148 | Q
|
---|
149 | ;
|
---|
150 | HDSUM ; report summary header
|
---|
151 | W !!,?31,"------------- Transmission Counts -------------"
|
---|
152 | W !,?31,"Payment",?42,"Payment",?64,"Accepted by"
|
---|
153 | W !,"Station",?9,"Invoice Type",?31,"Confirmed",?42,"Cancelled",?53,"Total",?64,"Interface Eng."
|
---|
154 | W !,"-------",?9,"------------",?31,"---------",?42,"---------",?53,"---------",?64,"--------------"
|
---|
155 | Q
|
---|
156 | ;
|
---|
157 | ;FBFPTR
|
---|