| 1 | IBBDOC ;OAK/ELZ - APIS FOR OTHER PACKAGES FOR PFSS - DOCUMENT ;5-AUG-2004 | 
|---|
| 2 | ;;2.0;INTEGRATED BILLING;**267,260,286,361**;21-MAR-94;Build 9 | 
|---|
| 3 | ;;Per VHA Directive 2004-038, this routine should not be modified. | 
|---|
| 4 | ; | 
|---|
| 5 | ; Documents the calls to the routine IBBAPI. | 
|---|
| 6 | ; | 
|---|
| 7 | INSUR ;(DFN,IBDT,IBSTAT,IBR,IBFLDS) | 
|---|
| 8 | ; Function to return patient insurance information | 
|---|
| 9 | ; --Input: | 
|---|
| 10 | ;   DFN    = patient | 
|---|
| 11 | ;   IBDT   = date insured (optional - default is today's date) | 
|---|
| 12 | ;   IBSTAT = Insurance Status filter (combinable based on groups below) | 
|---|
| 13 | ;      Group 1 | 
|---|
| 14 | ;          A = Inactive included (Default is active only) | 
|---|
| 15 | ;      Group 2 | 
|---|
| 16 | ;          R = Not reimbursable included (Default is reimbursable only) | 
|---|
| 17 | ;          B = Indemnity included (Default is not included) | 
|---|
| 18 | ;      Group 3 | 
|---|
| 19 | ;          P = Prescription coverage required (Default is all coverages) | 
|---|
| 20 | ;          O = Outpatient coverage required (Default is all coverages) | 
|---|
| 21 | ;          I = Inpatient coverage only (Default is all coverages) | 
|---|
| 22 | ; | 
|---|
| 23 | ;   IBR    = Array to return insurance information - passed by reference | 
|---|
| 24 | ;   IBFLDS = List of fields to return (1-22) in a comma separated list or "*" for all | 
|---|
| 25 | ; | 
|---|
| 26 | ; --Output: | 
|---|
| 27 | ;   -1     = error occurred (error message passed back in | 
|---|
| 28 | ;            IBR("IBBAPI","INSUR","ERROR",x) where x is error number | 
|---|
| 29 | ;            between 101 & 111 | 
|---|
| 30 | ;    0     = No insurance found based on parameters | 
|---|
| 31 | ;    1     = Insurance found | 
|---|
| 32 | ; | 
|---|
| 33 | ; | 
|---|
| 34 | CIDC  ; (DFN) | 
|---|
| 35 | ; Input:    DFN for the patient in question. | 
|---|
| 36 | ; Output:   1 = Ask CIDC questions for the specified patient | 
|---|
| 37 | ;           0 = Don't ask CIDC questions for the specified patient | 
|---|
| 38 | ; | 
|---|
| 39 | ; The API will evaluate both a CIDC switch and the patient's insurance | 
|---|
| 40 | ; to determine if the CIDC questions should be asked. | 
|---|
| 41 | ; | 
|---|
| 42 | ; The switch will have three internal values: | 
|---|
| 43 | ;    0 = Don't ask any patients | 
|---|
| 44 | ;    1 = Ask for patients only with active billable insurance | 
|---|
| 45 | ;    2 = Ask for all patients | 
|---|
| 46 | ; | 
|---|
| 47 | ; | 
|---|
| 48 | SWSTAT ; () | 
|---|
| 49 | ; Returns the current status of the PFSS On/Off Switch | 
|---|
| 50 | ; | 
|---|
| 51 | ; Output:   <switch_status>^<status_date/time> | 
|---|
| 52 | ; | 
|---|
| 53 | ; <switch_status> will be one of the following: | 
|---|
| 54 | ;    0 = OFF | 
|---|
| 55 | ;    1 = ON | 
|---|
| 56 | ; | 
|---|
| 57 | GETACCT ; (IBBDFN,IBBARFN,IBBEVENT,IBBAPLR,IBBPV1,IBBPV2,IBBPR1,IBBDG1,IBBZCL,IBBDIV,IBBRAIEN,IBBSURG) | 
|---|
| 58 | ; Pass data to IBB for account/visit (ADT) messaging. | 
|---|
| 59 | ; | 
|---|
| 60 | ; Input: | 
|---|
| 61 | ; IBBDFN   = Patient; IEN to file #2 [required] | 
|---|
| 62 | ; IBBARFN  = Account Reference; | 
|---|
| 63 | ;            IEN to file #375 or null [required] | 
|---|
| 64 | ; IBBEVENT = HL7 Event Code; e.g., "A04" [required] | 
|---|
| 65 | ; IBBAPLR  = Calling Application; | 
|---|
| 66 | ;            <routine> or <tag>_;_<routine> | 
|---|
| 67 | ; IBBPV1   = array for PV1 segment data [required] | 
|---|
| 68 | ;   IBBPV1(2)  - Patient Class (O=Outpatient;I=Inpatient) | 
|---|
| 69 | ;   IBBPV1(3)  - IEN to file #44, or "FEE BASIS" | 
|---|
| 70 | ;   IBBPV1(4)  - Appointment Type; IEN to file #409.1 | 
|---|
| 71 | ;   IBBPV1(7)  - Attending Physician; IEN to file #200 | 
|---|
| 72 | ;   IBBVP1(9)  - Consulting Physician; IEN to file #200 | 
|---|
| 73 | ;   IBBPV1(10) - Purpose of Visit; | 
|---|
| 74 | ;                (Scheduling: 1=C&P;2=10-10;3=SV;4=UV) | 
|---|
| 75 | ;   IBBPV1(17) - Admitting Physician or Surgeon; | 
|---|
| 76 | ;                IEN to file #200 | 
|---|
| 77 | ;   IBBPV1(18) - Primary Stop Code; IEN to file #40.7 | 
|---|
| 78 | ;   IBBPV1(25) - Check-In Date/Time (Scheduling) | 
|---|
| 79 | ;   IBBPV1(41) - Credit Stop Code; IEN to file #40.7 | 
|---|
| 80 | ;   IBBPV1(44) - Admit Date/Time | 
|---|
| 81 | ;   IBBPV1(45) - Check-Out Date/Time (Scheduling) | 
|---|
| 82 | ;   IBBPV1(50) - Prescription #; IEN to file #52 (Pharmacy) | 
|---|
| 83 | ;   IBBPV1(52) - Other Provider; IEN to file #200 | 
|---|
| 84 | ; IBBPV2   = array for PV2 segment data | 
|---|
| 85 | ;   IBBPV2(7)  - Eligibility of Visit; IEN to file #8.1 | 
|---|
| 86 | ;   IBBPV2(8)  - Expected Admit/Visit Date/Time | 
|---|
| 87 | ;   IBBPV2(24) - Appointment Status; | 
|---|
| 88 | ;                (Scheduling: | 
|---|
| 89 | ;                 R=Scheduled/Kept;I=Inpatient; | 
|---|
| 90 | ;                 NS=No-Show;NSR=No-Show, Rescheduled; | 
|---|
| 91 | ;                 CP=Cancelled by Patient; | 
|---|
| 92 | ;                 CPR=Cancelled by Patient, Rescheduled; | 
|---|
| 93 | ;                 CC=Cancelled by Clinic; | 
|---|
| 94 | ;                 CCR=Cancelled by Clinic, Rescheduled; | 
|---|
| 95 | ;                 NT=No Action Taken) | 
|---|
| 96 | ;   IBBPV2(46) - Date Appointment Made (Scheduling) | 
|---|
| 97 | ; IBBPR1   = array for PR1 segment data | 
|---|
| 98 | ;   IBBPR1(3)  - Procedure; IEN to file #81 | 
|---|
| 99 | ;   IBBPR1(4)  - Procedure; free text | 
|---|
| 100 | ;   IBBPR1(5)  - Procedure Date/Time | 
|---|
| 101 | ;   IBBPR1(6)  - Functional Type; | 
|---|
| 102 | ;                (Prosthetics: | 
|---|
| 103 | ;                 O=Home Oxygen;P=Purchasing; | 
|---|
| 104 | ;                 I=Stock Issue) | 
|---|
| 105 | ;                (Radiology: | 
|---|
| 106 | ;                 ANI=Angio/Neuro/Interventional; | 
|---|
| 107 | ;                 CARD=Cardiology Studies;CT=CT Scan; | 
|---|
| 108 | ;                 RAD=General Radiology; | 
|---|
| 109 | ;                 MRI=Magnetic Resonance Imaging; | 
|---|
| 110 | ;                 MAM=Mammography;NM=Nuclear Medicine; | 
|---|
| 111 | ;                 US=Ultrasound;VAS=Vascular Lab) | 
|---|
| 112 | ;   IBBPR1(11) - Surgeon; IEN to file #200 | 
|---|
| 113 | ;   IBBPR1(16) - <modifier>;<modifier>;<modifier>;... | 
|---|
| 114 | ;                where each <modifier> is an IEN to file #81.3 | 
|---|
| 115 | ; IBBDG1   = array for DG1 segment data | 
|---|
| 116 | ;   IBBDG1(n,3) - Diagnosis; IEN to file #80 | 
|---|
| 117 | ;   IBBDG1(1,4) - Diagnosis; free text; only one allowed | 
|---|
| 118 | ;   IBBDG1(n,6) - Diagnosis Type; (A=Admitting; | 
|---|
| 119 | ;                                  W=Working; | 
|---|
| 120 | ;                                  D=Discharge; | 
|---|
| 121 | ;                                  F=Final) | 
|---|
| 122 | ; IBBZCL   = array for ZCL segment data | 
|---|
| 123 | ;   IBBZCL(n,2) - Classification Type; | 
|---|
| 124 | ;                 (1=AO;2=IR;3=SC;4=EC;5=MST;6=HNC; | 
|---|
| 125 | ;                  7=CV;8=SHAD) | 
|---|
| 126 | ;   IBBZCL(n,3) - Classification Value; (1=YES;0=NO) | 
|---|
| 127 | ; IBBDIV   = IEN to file #40.8 | 
|---|
| 128 | ; IBBRAIEN = IEN to file #75.1 | 
|---|
| 129 | ; IBBSURG  = array for special Surgery data | 
|---|
| 130 | ;   IBBSURG(1) - Surgical Case #; IEN to file #130 | 
|---|
| 131 | ;   IBBSURG(2) - Surgical Specialty; IEN to file #45.3 | 
|---|
| 132 | ; | 
|---|
| 133 | ; Returns the pointer to the PFSS ACCOUNT file (#375) where | 
|---|
| 134 | ; all application input data is stored. | 
|---|
| 135 | ; | 
|---|
| 136 | ; Output:  IEN to file #375, or 0, if unsuccessful | 
|---|
| 137 | ; | 
|---|
| 138 | GETCHGID ; () | 
|---|
| 139 | ; Returns a Unique Charge ID. | 
|---|
| 140 | ; | 
|---|
| 141 | ; Output: 1 + current value of field #2 of file #372. | 
|---|
| 142 | ; | 
|---|
| 143 | CHARGE ; (IBBDFN,IBBARFN,IBBCTYPE,IBBUCID,IBBFT1,IBBPR1,IBBDG1,IBBZCL,IBBRXE,IBBORIEN,IBBPROS) | 
|---|
| 144 | ; Pass data to IBB for charge (DFT) messaging. | 
|---|
| 145 | ; | 
|---|
| 146 | ; Input: | 
|---|
| 147 | ; IBBDFN   = Patient; IEN to file #2 [required] | 
|---|
| 148 | ; IBBARFN  = Account Reference; IEN to file #375 [required] | 
|---|
| 149 | ; IBBCTYPE = Charge Type; (CG=debit;CD=credit) [required] | 
|---|
| 150 | ; IBBUCID  = Unique Charge ID [required] | 
|---|
| 151 | ; IBBFT1   = array for FT1 segment data [required] | 
|---|
| 152 | ;   IBBFT1(4)  - Transaction Date/Time | 
|---|
| 153 | ;   IBBFT1(7)  - Pharmacy Service Code | 
|---|
| 154 | ;   IBBFT1(10) - Transaction Quantity | 
|---|
| 155 | ;   IBBFT1(13) - Department Code | 
|---|
| 156 | ;   IBBFT1(16) - Patient Location; IEN to file #44 | 
|---|
| 157 | ;   IBBFT1(18) - Patient Status; (Pharmacy: 1=Rx Copay Exempt; | 
|---|
| 158 | ;                                           0=Not Exempt) | 
|---|
| 159 | ;   IBBFT1(20) - Rendering Provider; IEN to file #200 | 
|---|
| 160 | ;   IBBFT1(21) - Ordering Provider; IEN to file #200 | 
|---|
| 161 | ;   IBBFT1(22) - Unit Cost | 
|---|
| 162 | ;   IBBFT1(29) - <NDC>;<generic_name> | 
|---|
| 163 | ;   IBBFT1(31) - Transaction Type; | 
|---|
| 164 | ;                (Pharmacy: 1=PSO NSC Rx Copay; | 
|---|
| 165 | ;                           2=PSO SC Rx Copay; | 
|---|
| 166 | ;                           3=PSO NSC Rx Copay Cancel | 
|---|
| 167 | ;                           4=PSO NSC Rx Copay Update | 
|---|
| 168 | ;                           5=PSO SC Rx Copay Cancel | 
|---|
| 169 | ;                           6=PSO SC Rx Copay Update) | 
|---|
| 170 | ; IBBPR1   = array for PR1 segment data; | 
|---|
| 171 | ;            (required except Pharmacy) | 
|---|
| 172 | ;   IBBPR1(3)    - Procedure; IEN to file #81 | 
|---|
| 173 | ;   IBBPR1(4)    - Procedure; free text | 
|---|
| 174 | ;   IBBPR1(5)    - Procedure Date/Time | 
|---|
| 175 | ;   IBBPR1(6)    - Functional Type; | 
|---|
| 176 | ;                  (Prosthetics: O=Home Oxygen; | 
|---|
| 177 | ;                                P=Purchasing; | 
|---|
| 178 | ;                                I=Stock Issue) | 
|---|
| 179 | ;   IBBPR1(11,1) - Surgeon; IEN to file #200 | 
|---|
| 180 | ;   IBBPR1(11,2) - Attending Surgeon; IEN to file #200 | 
|---|
| 181 | ;   IBBPR1(16)   - <modifier>;<modifier>;<modifier>;...; | 
|---|
| 182 | ;                  each <modifier> is an IEN to file #81.3 | 
|---|
| 183 | ; IBBDG1   = array for DG1 segment data | 
|---|
| 184 | ;   IBBDG1(n,3) - Diagnosis; IEN to file #80 | 
|---|
| 185 | ;   IBBDG1(n,6) - Diagnosis Type; (A=Admitting;W=Working; | 
|---|
| 186 | ;                                  D=Discharge;F=Final) | 
|---|
| 187 | ; IBBZCL   = array for ZCL segment data | 
|---|
| 188 | ;   IBBZCL(n,2) - Classification Type; | 
|---|
| 189 | ;                 (1=AO;2=IR;3=SC;4=EC;5=MST; | 
|---|
| 190 | ;                  6=HNC;7=CV;8=SHAD) | 
|---|
| 191 | ;   IBBZCL(n,3) - Classification Value; (1=YES;0=NO) | 
|---|
| 192 | ; IBBRXE   = data for RXE segment data (Pharmacy only) | 
|---|
| 193 | ;   IBBRXE(1)  - <quantity>_;_<days_supply> | 
|---|
| 194 | ;   IBBRXE(17) - Refills Dispensed | 
|---|
| 195 | ;   IBBRXE(18) - Release Date/Time | 
|---|
| 196 | ;   IBBRXE(31) - DEA, Special Handling codes | 
|---|
| 197 | ; IBBPROS  = array for special Prosthetics data | 
|---|
| 198 | ;   IBBPROS(1) - Vendor; IEN to file #440 | 
|---|
| 199 | ;   IBBPROS(2) - OBL# | 
|---|
| 200 | ; | 
|---|
| 201 | ; Returns success indicator. | 
|---|
| 202 | ; | 
|---|
| 203 | ; Output: 1, if successful; 0 otherwise | 
|---|
| 204 | ; | 
|---|
| 205 | SETACCT ; (IBBDFN,HLMTIENS) | 
|---|
| 206 | ; Store visit/account # from external billing system in PFSS | 
|---|
| 207 | ; ACCOUNT record; the file #375 record is found based on data | 
|---|
| 208 | ; contained in the HL7 message referenced by HLMTIENS. | 
|---|
| 209 | ; Most of the ADT messages involved originate in VistA and | 
|---|
| 210 | ; are returned by the external billing system with visit# | 
|---|
| 211 | ; attached. | 
|---|
| 212 | ; Some ADT-A01 messages originate in the external billing | 
|---|
| 213 | ; system; these cause a new record to be created in file #375. | 
|---|
| 214 | ; | 
|---|
| 215 | ; Input: | 
|---|
| 216 | ; IBBDFN   = Patient; IEN to file #2 [required] | 
|---|
| 217 | ; HLMTIENS = HL7 Message (standard VistA HL7 variable); | 
|---|
| 218 | ;            IEN to file #773 [required] | 
|---|
| 219 | ; | 
|---|
| 220 | ; Returns PFSS Account Reference. | 
|---|
| 221 | ; | 
|---|
| 222 | ; Output: IEN to file #375 | 
|---|
| 223 | ; | 
|---|
| 224 | EXTNUM ; (IBBDFN,IBBARFN) | 
|---|
| 225 | ; Obtain the visit/account # of the external billing system | 
|---|
| 226 | ; that has been associated with the PFSS ACCOUNT file (#375) | 
|---|
| 227 | ; record. | 
|---|
| 228 | ; | 
|---|
| 229 | ; Input: | 
|---|
| 230 | ; IBBDFN   = Patient; IEN to file #2 [required] | 
|---|
| 231 | ; IBBARFN  = Account Reference; IEN to file #375 [required] | 
|---|
| 232 | ; | 
|---|
| 233 | ; Returns the value of field #.02 from the file #375 record. | 
|---|
| 234 | ; | 
|---|
| 235 | ; Output: external visit/account #, or 0, if unsuccessful | 
|---|
| 236 | ; | 
|---|