| 1 | IBCNERP7 ;DAOU/BHS - IIV STATISTICAL REPORT ;10-JUN-2002 | 
|---|
| 2 | ;;2.0;INTEGRATED BILLING;**184**;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 parameter: N/A | 
|---|
| 8 | ; Other relevant variables: | 
|---|
| 9 | ;   IBCNERTN = "IBCNERP7" (current routine name for queueing the | 
|---|
| 10 | ;                          COMPILE process) | 
|---|
| 11 | ;   IBCNESPC("BEGDTM") = start date/time for date/time range | 
|---|
| 12 | ;   IBCNESPC("ENDDTM") = end date/time for date/time range | 
|---|
| 13 | ;   IBCNESPC("SECTS") = list of sections to display on the report | 
|---|
| 14 | ;                       1 = All (Outgoing, Incoming and General), | 
|---|
| 15 | ;                       2 = Outgoing - Inquiry Response data, | 
|---|
| 16 | ;                       3 = Incoming - Inquiry Transmission data, | 
|---|
| 17 | ;                       4 = General - Ins Buffer data, Outstanding | 
|---|
| 18 | ;                           Inquiries, Communication Failures, Retries | 
|---|
| 19 | ;                       may equal a list of values if '1' is not the | 
|---|
| 20 | ;                       the only value | 
|---|
| 21 | ;   IBCNESPC("MM") = "", not for MailMan message OR | 
|---|
| 22 | ;                    MAILGROUP, generate as MailMan message for this | 
|---|
| 23 | ;                               MAILGROUP as defined in IB site | 
|---|
| 24 | ;                               parameters | 
|---|
| 25 | ; | 
|---|
| 26 | ; Only enter routine from EN or MAILMSG tags | 
|---|
| 27 | Q | 
|---|
| 28 | ; | 
|---|
| 29 | ; Entry pt | 
|---|
| 30 | EN ; | 
|---|
| 31 | ; Init vars | 
|---|
| 32 | N STOP,IBCNERTN,POP,IBCNESPC | 
|---|
| 33 | ; | 
|---|
| 34 | S STOP=0 | 
|---|
| 35 | S IBCNERTN="IBCNERP7" | 
|---|
| 36 | W @IOF | 
|---|
| 37 | W !,"IIV Statistical Report",! | 
|---|
| 38 | W !,"Please select the timeframe for which to view the Insurance Identification" | 
|---|
| 39 | W !,"and Verification statistics and current status." | 
|---|
| 40 | ; | 
|---|
| 41 | ; Default to MailMan flag to No from the EN tag | 
|---|
| 42 | S IBCNESPC("MM")="" | 
|---|
| 43 | ; | 
|---|
| 44 | ; Prompts for Payer Report | 
|---|
| 45 | ; Date Range parameters | 
|---|
| 46 | S10 D DTMRNG I STOP G EXIT | 
|---|
| 47 | ; Sort by parameter - Payer or Total Inquiries (Payer Report) | 
|---|
| 48 | S20 D SECTS I STOP G:$$STOP^IBCNERP1 EXIT G S10 | 
|---|
| 49 | ; Select the output device | 
|---|
| 50 | S50 D DEVICE^IBCNERP1(IBCNERTN,.IBCNESPC) I STOP G:$$STOP^IBCNERP1 EXIT G S20 | 
|---|
| 51 | ; | 
|---|
| 52 | EXIT ; Quit this routine | 
|---|
| 53 | Q | 
|---|
| 54 | ; | 
|---|
| 55 | ; | 
|---|
| 56 | DTMRNG ; Determine the start and end date/times for the report | 
|---|
| 57 | ; Init vars | 
|---|
| 58 | N DIR,X,Y,DIRUT | 
|---|
| 59 | ; | 
|---|
| 60 | W ! | 
|---|
| 61 | ; | 
|---|
| 62 | S DIR(0)="DO^::ERX" | 
|---|
| 63 | S DIR("A")="Start DATE/TIME" | 
|---|
| 64 | S DIR("?",1)="    Enter Start DATE/TIME for report range." | 
|---|
| 65 | S DIR("?")="    The time element is required." | 
|---|
| 66 | D ^DIR K DIR | 
|---|
| 67 | I $D(DIRUT) S STOP=1 G DTMRNGX | 
|---|
| 68 | S IBCNESPC("BEGDTM")=Y | 
|---|
| 69 | ; | 
|---|
| 70 | DTMRNG1 S DIR(0)="D^::ERX" | 
|---|
| 71 | S DIR("A")="  End DATE/TIME" | 
|---|
| 72 | S DIR("?",1)="    Enter End DATE/TIME for report range." | 
|---|
| 73 | S DIR("?")="    The time element is required." | 
|---|
| 74 | D ^DIR K DIR | 
|---|
| 75 | I $D(DIRUT) S STOP=1 G DTMRNGX | 
|---|
| 76 | I Y<IBCNESPC("BEGDTM") D  G DTMRNG1 | 
|---|
| 77 | . W !,"    The End Date/Time must not precede the Start Date/Time." | 
|---|
| 78 | . W !,"    Please reenter." | 
|---|
| 79 | S IBCNESPC("ENDDTM")=Y | 
|---|
| 80 | ; | 
|---|
| 81 | DTMRNGX ; DTMRNG exit pt | 
|---|
| 82 | Q | 
|---|
| 83 | ; | 
|---|
| 84 | ; | 
|---|
| 85 | SECTS ; Prompt to allow users to include the available sections in the report | 
|---|
| 86 | ; Init vars | 
|---|
| 87 | N DIR,X,Y,DIRUT | 
|---|
| 88 | ; | 
|---|
| 89 | W ! | 
|---|
| 90 | S DIR(0)="L^1:4" | 
|---|
| 91 | S DIR("A",1)="Choose all sections to be reviewed" | 
|---|
| 92 | S DIR("A",2)="1  -  All            = All three report sections (Default)" | 
|---|
| 93 | S DIR("A",3)="2  -  Outgoing Data  = Inquiry Transmission statistics" | 
|---|
| 94 | S DIR("A",4)="3  -  Incoming Data  = Inquiry Response statistics" | 
|---|
| 95 | S DIR("A",5)="4  -  Current Status = Pending Responses, Queued Inquiries, etc." | 
|---|
| 96 | S DIR("A")="Select one or more sections: " | 
|---|
| 97 | S DIR("B")=1 | 
|---|
| 98 | S DIR("?",1)="  Please select one or more sections of the report to view." | 
|---|
| 99 | S DIR("?",2)="  To select multiple sections enter a comma separated list" | 
|---|
| 100 | S DIR("?",3)="  (ex. 2,4)." | 
|---|
| 101 | S DIR("?",4)="  1  -  Include all three sections in the report.  (Default)" | 
|---|
| 102 | S DIR("?",5)="  2  -  Include statistics on inquiries transmitted during the" | 
|---|
| 103 | S DIR("?",6)="        timeframe by extract type." | 
|---|
| 104 | S DIR("?",7)="  3  -  Include statistics on responses received during the" | 
|---|
| 105 | S DIR("?",8)="        timeframe by extract type." | 
|---|
| 106 | S DIR("?",9)="  4  -  Include statistics on the current state of the system." | 
|---|
| 107 | S DIR("?",10)="        This section is independent of the timeframe for the" | 
|---|
| 108 | S DIR("?",11)="        report and includes responses pending, queued inquiries," | 
|---|
| 109 | S DIR("?",12)="        deferred inquiries, payer statistics and insurance" | 
|---|
| 110 | S DIR("?")="        buffer statistics." | 
|---|
| 111 | D ^DIR K DIR | 
|---|
| 112 | I $D(DIRUT) S STOP=1 G SECTSX | 
|---|
| 113 | ; Default to all if 1 is included OR if 2,3 and 4 are included in any | 
|---|
| 114 | ; order | 
|---|
| 115 | S Y=","_Y | 
|---|
| 116 | I Y[(",1,") S IBCNESPC("SECTS")=1 G SECTSX | 
|---|
| 117 | I Y[(",2,"),Y[(",3,"),Y[(",4,") S IBCNESPC("SECTS")=1 G SECTSX | 
|---|
| 118 | S IBCNESPC("SECTS")=Y | 
|---|
| 119 | ; | 
|---|
| 120 | SECTSX ; SECTS exit pt | 
|---|
| 121 | Q | 
|---|
| 122 | ; | 
|---|
| 123 | ; | 
|---|
| 124 | MAILMSG ; Tag to be called by TaskMan to generate report with default values | 
|---|
| 125 | ; and send as MailMan message | 
|---|
| 126 | ; Init vars | 
|---|
| 127 | N IBCNERTN,IBCNESPC,EDT,BDT,TM | 
|---|
| 128 | ; | 
|---|
| 129 | ; Default report parameters | 
|---|
| 130 | ; Start Date/Time - End Date/Time range | 
|---|
| 131 | ;  Determine start time based on IB site parameter | 
|---|
| 132 | S TM=$$GET1^DIQ(350.9,"1,",51.03,"E") | 
|---|
| 133 | I TM=""!(+TM=0) S TM="2400" | 
|---|
| 134 | S EDT=$$DT^XLFDT | 
|---|
| 135 | S BDT=$$FMADD^XLFDT(EDT,-1) | 
|---|
| 136 | S IBCNESPC("BEGDTM")=+(BDT_"."_TM) | 
|---|
| 137 | S IBCNESPC("ENDDTM")=+(EDT_"."_TM) | 
|---|
| 138 | ; Display all sections | 
|---|
| 139 | S IBCNESPC("SECTS")=1 | 
|---|
| 140 | ; Set MailMan flag to IB site parameter MAILGROUP | 
|---|
| 141 | S IBCNESPC("MM")=$$MGRP^IBCNEUT5 | 
|---|
| 142 | ; If there is no MailGroup to send message - do not continue | 
|---|
| 143 | I IBCNESPC("MM")="" QUIT | 
|---|
| 144 | ; If the send MailMan message parameter is turned off, stop the process | 
|---|
| 145 | I '$P($G(^IBE(350.9,1,51)),U,2) QUIT | 
|---|
| 146 | ; | 
|---|
| 147 | ; Set routine parameter | 
|---|
| 148 | S IBCNERTN="IBCNERP7" | 
|---|
| 149 | ; | 
|---|
| 150 | ; Initialize scratch global | 
|---|
| 151 | KILL ^TMP($J,IBCNERTN) | 
|---|
| 152 | ; Compile the report data | 
|---|
| 153 | D EN^IBCNERP8(IBCNERTN,.IBCNESPC) | 
|---|
| 154 | ; Print the report - to MailMan | 
|---|
| 155 | I '$G(ZTSTOP) D EN^IBCNERP9(IBCNERTN,.IBCNESPC) | 
|---|
| 156 | ; | 
|---|
| 157 | ; Kill scratch global | 
|---|
| 158 | KILL ^TMP($J,IBCNERTN) | 
|---|
| 159 | ; | 
|---|
| 160 | ; Purge the task record | 
|---|
| 161 | I $D(ZTQUEUED) S ZTREQ="@" | 
|---|
| 162 | ; | 
|---|
| 163 | ; MAILMSG exit pt | 
|---|
| 164 | Q | 
|---|
| 165 | ; | 
|---|
| 166 | ; | 
|---|