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

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

initial load of FOIAVistA 6/30/08 version

File size: 9.2 KB
Line 
1IBCNERP9 ;DAOU/BHS - IIV STATISTICAL REPORT PRINT ;12-JUN-2002
2 ;;2.0;INTEGRATED BILLING;**184,271**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ; IIV - Insurance Identification and Verification Interface
6 ;
7 ; Input variables from IBCNERP7:
8 ; IBCNERTN = "IBCNERP7"
9 ; **IBCNESPC array ONLY passed by reference
10 ; IBCNESPC("BEGDTM") = Start Date/Time for date/time report range
11 ; IBCNESPC("ENDDTM") = End Date/Time for date/time report range
12 ; IBCNESPC("SECTS") = 1 - All, includes all sections OR
13 ; list of one or more of the following:
14 ; 2 - Outgoing Data, Inquiry Transmission data,
15 ; 3 - Incoming Data, Inquiry Response data,
16 ; 4 - General Data, Insurance Buffer data,
17 ; Communication Failures, Outstanding Inquiries
18 ; IBCNESPC("MM") = "", do not generate MailMan message OR
19 ; MAILGROUP, mailgroup to send MailMan message to
20 ; based on IB site parameter
21 ; Assumes report data exists in ^TMP($J,IBCNERTN,...)
22 ; Based on IBCNESPC("SECTS") parameter the following scratch globals
23 ; will be built
24 ; 1 OR contains 2 -->
25 ; ^TMP($J,RTN,"OUT")=TotInq^InsBufExtSubtotal^PreRegExtSubtotal^...
26 ; NonVerifInsExtSubtotal^NoActInsExtSubtotal
27 ; 1 OR contains 3 -->
28 ; ^TMP($J,RTN,"IN")=TotResp^InsBufExtSubtotal^PreRegExtSubtotal^...
29 ; NonVerifInsExtSubtotal^NoActInsExtSubtotal
30 ; 1 OR contains 4 -->
31 ; ^TMP($J,RTN,"CUR")=TotOutstandingInq^TotInqRetries^...
32 ; TotInqCommFailure^TotInsBufVerified^...
33 ; ManVerifedSubtotal^IIVProcessedSubtotal...
34 ; TotInsBufUnverified^! InsBufSubtotal^...
35 ; ? InsBufSubtotal^- InsBufSubtotal^...
36 ; Other InsBufSubtotal^TQReadyToTransmit^...
37 ; TQHold^TQRetry
38 ; and ^TMP($J,RTN","PYR",PAYER NAME,IEN of file 365.12)=""
39 ;
40 ; Must call at EN
41 Q
42 ;
43EN(IBCNERTN,IBCNESPC) ; Entry pt
44 ;
45 ; Init vars
46 N CRT,MAXCNT,IBPXT,IBPGC,IBBDT,IBEDT,IBSCT,IBMM,RETRY,OUTINQ,ATTEMPT
47 N X,Y,DIR,DTOUT,DUOUT,LIN
48 ;
49 S IBBDT=$G(IBCNESPC("BEGDTM")),IBEDT=$G(IBCNESPC("ENDDTM"))
50 S IBSCT=$G(IBCNESPC("SECTS")),IBMM=$G(IBCNESPC("MM"))
51 ;
52 S (IBPXT,IBPGC,CRT,MAXCNT)=0
53 ;
54 ; Determine IO parameters if output device is NOT MailMan message
55 I IBMM="" D
56 . I IOST["C-" S MAXCNT=IOSL-3,CRT=1 Q
57 . S MAXCNT=IOSL-6,CRT=0
58 ;
59 D PRINT(IBCNERTN,IBBDT,IBEDT,IBSCT,IBMM,.IBPGC,.IBPXT,MAXCNT,CRT)
60 I $G(ZTSTOP)!IBPXT G EXIT
61 I CRT,IBPGC>0,'$D(ZTQUEUED) D G EXIT
62 . I MAXCNT<51 F LIN=1:1:(MAXCNT-$Y) W !
63 . S DIR(0)="E" D ^DIR K DIR
64 ;
65EXIT ; Exit pt
66 Q
67 ;
68 ;
69PRINT(RTN,BDT,EDT,SCT,MM,PGC,PXT,MAX,CRT) ; Print data
70 ; Init vars
71 N EORMSG,NONEMSG,LINECT,DISPDATA,HDRDATA,OFFSET,TMP,DTMRNG,SITE
72 ;
73 S LINECT=0
74 ;
75 ; Build End-Of-Report Message for display
76 S EORMSG="*** END OF REPORT ***"
77 S OFFSET=80-$L(EORMSG)\2
78 S EORMSG=$$FO^IBCNEUT1(EORMSG,OFFSET+$L(EORMSG),"R")
79 ; Build No-Data-Found Message for display
80 S NONEMSG="* * * N O D A T A F O U N D * * *"
81 S OFFSET=80-$L(NONEMSG)\2
82 S NONEMSG=$$FO^IBCNEUT1(NONEMSG,OFFSET+$L(NONEMSG),"R")
83 ; Build Site for display
84 S SITE=$P($$SITE^VASITE,U,2)
85 ; Build Date/Time Range for display
86 ; Build Date/Time display for Starting date/time
87 S TMP=$$FMTE^XLFDT(BDT,"5Z")
88 S DTMRNG=$P(TMP,"@")_" "_$P(TMP,"@",2)
89 ; Calculate Date/Time display for Ending date/time
90 S TMP=$$FMTE^XLFDT(EDT,"5Z")
91 S DTMRNG=DTMRNG_" - "_$P(TMP,"@")_" "_$P(TMP,"@",2)
92 ;
93 ; Print header to DISPDATA for MailMan message ONLY
94 D HEADER^IBCNERP0(.HDRDATA,.PGC,.PXT,MAX,CRT,SITE,DTMRNG,MM)
95 I MM'="" M DISPDATA=HDRDATA S LINECT=+$O(DISPDATA(""),-1)
96 I MM="" KILL HDRDATA
97 ;
98 ; If global does not exist - display No Data message
99 I '$D(^TMP($J,RTN)) S LINECT=LINECT+1,DISPDATA(LINECT)=NONEMSG G PRINT2
100 ;
101 ; Display Outgoing Data - if selected
102 I SCT=1!(SCT[2) D I PXT!$G(ZTSTOP) G PRINTX
103 . ; Build lines of data to display
104 . D DATA(.DISPDATA,.LINECT,RTN,"OUT",MM)
105 ;
106 ; Display Incoming Data - if selected
107 I SCT=1!(SCT[3) D I PXT!$G(ZTSTOP) G PRINTX
108 . ; Build lines of data to display
109 . D DATA(.DISPDATA,.LINECT,RTN,"IN",MM)
110 ;
111 ; Display General Data - if selected
112 I SCT=1!(SCT[4) D I PXT!$G(ZTSTOP) G PRINTX
113 . ; Build lines of data to display
114 . D DATA(.DISPDATA,.LINECT,RTN,"CUR",MM)
115 . D DATA(.DISPDATA,.LINECT,RTN,"PYR",MM)
116 ;
117PRINT2 S LINECT=LINECT+1
118 S DISPDATA(LINECT)=EORMSG
119 ;
120 I MM="" D LINE(.DISPDATA,.PGC,.PXT,MAX,CRT,SITE,DTMRNG,MM)
121 ; Generate MailMan message, if flag is set
122 I MM'="" D MSG^IBCNEUT5(MM,"** IIV Statistical Rpt **","DISPDATA(")
123 ;
124PRINTX ; PRINT exit pt
125 Q
126 ;
127LINE(DISPDATA,PGC,PXT,MAX,CRT,SITE,DTMRNG,MM) ; Print line of data
128 ; Init vars
129 N CT,II,ARRAY,NWPG
130 ;
131 S NWPG=0
132 S CT=+$O(DISPDATA(""),-1)
133 I $Y+1+CT>MAX,PGC>1 D HEADER^IBCNERP0(.ARRAY,.PGC,.PXT,MAX,CRT,SITE,DTMRNG,MM) S NWPG=1 I PXT!$G(ZTSTOP) G LINEX
134 F II=1:1:CT D Q:PXT!$G(ZTSTOP)
135 . I $Y+1>MAX!('PGC) D HEADER^IBCNERP0(.ARRAY,.PGC,.PXT,MAX,CRT,SITE,DTMRNG,MM) S NWPG=1 I PXT!$G(ZTSTOP) Q
136 . I 'NWPG!(NWPG&(DISPDATA(II)'="")) W !,?1,DISPDATA(II)
137 . I NWPG S NWPG=0
138 ;
139LINEX ; LINE exit pt
140 Q
141 ;
142DATA(DISPDATA,LINECT,RTN,TYPE,MM) ; Format lines of data to be printed
143 ; Init vars
144 N DASHES,DASHES2,PEND,RPTDATA,CT,DEFINQ,INSCOS,PAYERS,QUEINQ,TXT
145 ;
146 S $P(DASHES,"=",15)=""
147 I LINECT>0,MM="" S LINECT=LINECT+1,DISPDATA(LINECT)=""
148 S LINECT=LINECT+1
149 S DISPDATA(LINECT)=$S(TYPE="OUT":"Outgoing Data",TYPE="IN":"Incoming Data",1:"Current Status")
150 S LINECT=LINECT+1
151 S DISPDATA(LINECT)=DASHES
152 ; Copy report data to local variable
153 S RPTDATA=$G(^TMP($J,RTN,TYPE)) ; does not work for "PYR"
154 ; Outgoing and Incoming Totals
155 I TYPE="OUT"!(TYPE="IN") D G DATAX
156 . S LINECT=LINECT+1
157 . S DISPDATA(LINECT)=$$FO^IBCNEUT1($S(TYPE="OUT":"Inquiries Sent:",1:"Responses Received:"),36)_$$FO^IBCNEUT1(+$P(RPTDATA,U,1),9,"R")
158 . F CT=1:1:4 D
159 . . S TYPE=" "_$S(CT=1:"Insurance Buffer",CT=2:"Appointment",CT=3:"Non-verified Insurance",1:"No Active Insurance")
160 . . S LINECT=LINECT+1
161 . . S DISPDATA(LINECT)=$$FO^IBCNEUT1(TYPE,46)_$$FO^IBCNEUT1(+$P(RPTDATA,U,CT+1),9,"R")
162 ;
163 ; General Data
164 I TYPE="CUR" D G DATAX
165 . ; Responses Pending
166 . S PEND=+$P(RPTDATA,U,1)
167 . S LINECT=LINECT+1
168 . S DISPDATA(LINECT)=$$FO^IBCNEUT1("Responses Pending:",36)_$$FO^IBCNEUT1(PEND,9,"R")
169 . ; Queued Inqs
170 . S QUEINQ=+$P(RPTDATA,U,2)
171 . S LINECT=LINECT+1
172 . S DISPDATA(LINECT)=$$FO^IBCNEUT1("Queued Inquiries:",36)_$$FO^IBCNEUT1(QUEINQ,9,"R")
173 . ; Deferred Inqs
174 . S DEFINQ=+$P(RPTDATA,U,3)
175 . S LINECT=LINECT+1
176 . S DISPDATA(LINECT)=$$FO^IBCNEUT1("Deferred Inquiries:",36)_$$FO^IBCNEUT1(DEFINQ,9,"R")
177 . ; Ins Cos w/o Nat ID
178 . S INSCOS=+$P(RPTDATA,U,4)
179 . S LINECT=LINECT+1
180 . S DISPDATA(LINECT)=$$FO^IBCNEUT1("Insurance Companies w/o National ID:",36)_$$FO^IBCNEUT1(INSCOS,9,"R")
181 . ; Payers disabled locally
182 . S PAYERS=+$P(RPTDATA,U,5)
183 . S LINECT=LINECT+1
184 . S DISPDATA(LINECT)=$$FO^IBCNEUT1("eIIV Payers Disabled Locally:",36)_$$FO^IBCNEUT1(PAYERS,9,"R")
185 . S LINECT=LINECT+1
186 . S DISPDATA(LINECT)=""
187 . ; Insurance Buffer statistics
188 . S LINECT=LINECT+1
189 . S DISPDATA(LINECT)=$$FO^IBCNEUT1("Insurance Buffer Entries: ",36)_$$FO^IBCNEUT1(($P(RPTDATA,U,6)+$P(RPTDATA,U,9)),9,"R")
190 . ; *,+,#,! or - symbol entries - User action required
191 . S LINECT=LINECT+1
192 . S DISPDATA(LINECT)=$$FO^IBCNEUT1(" User Action Required: ",46)_$$FO^IBCNEUT1(+$P(RPTDATA,U,6),9,"R")
193 . F CT=7,8,13,10,11 D
194 . . S LINECT=LINECT+1
195 . . ; Added # to report
196 . . S TYPE=" # of "
197 . . I CT=7 S TXT="* entries (User Verified policy)"
198 . . I CT=8 S TXT="+ entries (Payer indicated Active policy)"
199 . . I CT=10 S TXT="# entries (Policy status undetermined)"
200 . . I CT=11 S TXT="! entries (IIV needs user assistance for entry)"
201 . . I CT=13 S TXT="- entries (Payer indicated Inactive policy)"
202 . . S TYPE=TYPE_TXT
203 . . S DISPDATA(LINECT)=$$FO^IBCNEUT1(TYPE,56)_$$FO^IBCNEUT1(+$P(RPTDATA,U,CT),9,"R")
204 . ;
205 . S LINECT=LINECT+1
206 . S DISPDATA(LINECT)=$$FO^IBCNEUT1(" Entries Awaiting Processing: ",46)_$$FO^IBCNEUT1(+$P(RPTDATA,U,9),9,"R")
207 . ; Subtotal of ? entries (IIV is waiting for a response)
208 . S LINECT=LINECT+1
209 . S DISPDATA(LINECT)=$$FO^IBCNEUT1(" # of ? entries (IIV is waiting for a response)",56)_$$FO^IBCNEUT1(+$P(RPTDATA,U,12),9,"R")
210 . ; Subtotal of blank entries (yet to be processed or accepted)
211 . S LINECT=LINECT+1
212 . S DISPDATA(LINECT)=$$FO^IBCNEUT1(" # of blank entries (yet to be processed or accepted)",56)_$$FO^IBCNEUT1(+$P(RPTDATA,U,14),9,"R")
213 ;
214 ; New Payers added to File 365.12
215 I TYPE="PYR" D G DATAX
216 . ; Payers added to file 365.12
217 . D DATAX
218 . S LINECT=LINECT+1
219 . S DISPDATA(LINECT)="New eIIV Payers received during report date range:"
220 . S LINECT=LINECT+1
221 . I '$D(^TMP($J,RTN,TYPE)) S DISPDATA(LINECT)=" No new Payers added" Q
222 . S DISPDATA(LINECT)=" Please link the associated active insurance companies to these payers at your"
223 . S LINECT=LINECT+1,DISPDATA(LINECT)=" earliest convenience. Locally activate the payers after you link insurance"
224 . S LINECT=LINECT+1,DISPDATA(LINECT)=" companies to them. For further details regarding this process, please refer"
225 . S LINECT=LINECT+1,DISPDATA(LINECT)=" to the Integrated Billing IIV Interface User Guide."
226 . N PYR,PIEN
227 . S PYR="",PIEN="" F S PYR=$O(^TMP($J,RTN,TYPE,PYR)) Q:PYR="" D
228 . . F S PIEN=$O(^TMP($J,RTN,TYPE,PYR,PIEN)) Q:'PIEN S LINECT=LINECT+1,DISPDATA(LINECT)=" "_PYR
229 ;
230DATAX ; DATA exit pt
231 S LINECT=LINECT+1
232 S DISPDATA(LINECT)=""
233 Q
234 ;
235 ;
Note: See TracBrowser for help on using the repository browser.