| 1 | IBNCPDP ;OAK/ELZ - APIS FOR NCPCP/ECME ;10-JUN-2003 | 
|---|
| 2 | ;;2.0;INTEGRATED BILLING;**223,276,363**;21-MAR-94;Build 35 | 
|---|
| 3 | ;;Per VHA Directive 2004-038, this routine should not be modified. | 
|---|
| 4 | ; | 
|---|
| 5 | ; | 
|---|
| 6 | RX(DFN,IBD) ; pharmacy package call, passing in IBD by ref | 
|---|
| 7 | ; this is called by PSO for all prescriptions issued, return is | 
|---|
| 8 | ; a responce to bill ECME or not with array for billing data elements | 
|---|
| 9 | ; | 
|---|
| 10 | ; IBD("IEN")         = Prescription IEN | 
|---|
| 11 | ;    ("FILL NUMBER") = Fill number (0 is initial) | 
|---|
| 12 | ;    ("FILL DATE")   = Fill or refill date | 
|---|
| 13 | ;    ("RELEASE DATE")= Date of the Rx release in FileMan format | 
|---|
| 14 | ;    ("NDC")         = NDC number for drug | 
|---|
| 15 | ;    ("DEA")         = DEA special handling info | 
|---|
| 16 | ;    ("COST")        = cost of medication being dispenced | 
|---|
| 17 | ;    ("AO")          = Agent Orange (0,1 OR Null) | 
|---|
| 18 | ;    ("EC")          = Environmental Contaminant (0,1 OR Null) | 
|---|
| 19 | ;    ("HNC")         = Head/neck cancer (0,1 OR Null) | 
|---|
| 20 | ;    ("IR")          = Ionizing radiation (0,1 OR Null) | 
|---|
| 21 | ;    ("MST")         = Military sexual trauma (0,1 OR Null) | 
|---|
| 22 | ;    ("SC")          = Service connected (0,1 OR Null) | 
|---|
| 23 | ;    ("CV")          = Combat Veteran (0,1 OR Null) | 
|---|
| 24 | ;    ("QTY")         = Quantity of med | 
|---|
| 25 | ;    ("EPHARM")      = #9002313.56 ien (E-PHARMACY division) | 
|---|
| 26 | ; | 
|---|
| 27 | ; | 
|---|
| 28 | ; IBD("INS",n,1) = insurance array to bill in n order | 
|---|
| 29 | ;                  file 355.3 ien (group)^bin^pcn^payer sheet^group id^ | 
|---|
| 30 | ;                  cardholder id^patient relationship code^ | 
|---|
| 31 | ;                  cardholder first name^cardholder last name^ | 
|---|
| 32 | ;                  home plan state | 
|---|
| 33 | ;    ("INS",n,2) = dispensing fee^basis of cost determination^ | 
|---|
| 34 | ;                  awp or tort rate or cost^gross amount due^ | 
|---|
| 35 | ;                  administrative fee | 
|---|
| 36 | ; | 
|---|
| 37 | ;   for basis of cost determination the following is used: | 
|---|
| 38 | ;      "07" would be sent for Usual & Customary | 
|---|
| 39 | ;      "01" would be sent for AWP | 
|---|
| 40 | ;      "05" would be sent for Cost calculations | 
|---|
| 41 | ; | 
|---|
| 42 | ;    ("INS",n,3) = group name^insurance co^phone number^plan ID | 
|---|
| 43 | N IBRES,IBNB | 
|---|
| 44 | S IBRES=$$RX^IBNCPDP1(DFN,.IBD) | 
|---|
| 45 | ;remove "Not ECME billable: " from the reason text | 
|---|
| 46 | S IBNB="Not ECME billable: " | 
|---|
| 47 | I IBRES[IBNB S IBRES=$P(IBRES,U)_U_$P($P(IBRES,U,2),IBNB,2) | 
|---|
| 48 | Q IBRES | 
|---|
| 49 | ; | 
|---|
| 50 | ; | 
|---|
| 51 | STORESP(DFN,IBD) ; this is an API for pharmacy/ecme to use to relay | 
|---|
| 52 | ; results of billing using the ecme software.  If electronic billing is | 
|---|
| 53 | ; successful, then bills will be established.  If not, then we will | 
|---|
| 54 | ; flag the entry in ct for paper or not billable. | 
|---|
| 55 | ; | 
|---|
| 56 | ; IBD("STATUS")       = Bill status (PAID, REJECTED,REVERSED | 
|---|
| 57 | ;                        CLOSED,RELEASED,or SUBMITTED) | 
|---|
| 58 | ;    ("FILL DATE")    = Fill Date | 
|---|
| 59 | ;    ("PRESCRIPTION") = Prescription IEN from drug file (#52) | 
|---|
| 60 | ;    ("FILL NUMBER")  = Fill or refill number | 
|---|
| 61 | ;    ("BILLED")       = Amount billed | 
|---|
| 62 | ;    ("PAID")         = Amount paid | 
|---|
| 63 | ;    ("BCID")         = Reference number to the claim for payment | 
|---|
| 64 | ;                       BCID stands for Bill Claim ID | 
|---|
| 65 | ;    ("PLAN")         = IEN of the the entry in the GROUP INSURANCE | 
|---|
| 66 | ;                       PLAN file(#355.3)(captured from the | 
|---|
| 67 | ;                       $$RX^IBNCPDP call) | 
|---|
| 68 | ;    ("COPAY")        = Patient's copay from ECME response | 
|---|
| 69 | ;    ("RX NO")        = RX number from file 52 | 
|---|
| 70 | ;    ("DRUG")         = IEN of file #50 DRUG | 
|---|
| 71 | ;    ("DAYS SUPPLY")  = Days Supply | 
|---|
| 72 | ;    ("QTY")          = Quantity | 
|---|
| 73 | ;    ("NDC")          = NDC | 
|---|
| 74 | ;    ("CLOSE REASON") = Optional, Pointer to the IB file #356.8 | 
|---|
| 75 | ;                      "CLAIMS TRACKING NON-BILLABLE REASONS" | 
|---|
| 76 | ;    ("CLOSE COMMENT")= Optional, if the close reason is defined | 
|---|
| 77 | ;                       then the Close Comment parameter may be | 
|---|
| 78 | ;                       sent to IB | 
|---|
| 79 | ;    ("DROP TO PAPER")= Optional, this parameter may be set to 1(TRUE) | 
|---|
| 80 | ;                       for certain Close Claim Reasons, indicating | 
|---|
| 81 | ;                       that that the closed episode still may be | 
|---|
| 82 | ;                       "dropped to paper" - passed to the Autobiller | 
|---|
| 83 | ;    ("RELEASE COPAY")= Optional, if the claim is being closed, setting | 
|---|
| 84 | ;                       this parameter to 1 (TRUE) indicates that the | 
|---|
| 85 | ;                       patients copay should be released off hold | 
|---|
| 86 | ;    ("DIVISION")     = Pointer to the MC DIVISION file (#40.8) | 
|---|
| 87 | ;    ("AUTH #")       = ECME approval/authorization number | 
|---|
| 88 | ;    ("CLAIMID")      = Reference Number to ECME | 
|---|
| 89 | ;    ("EPHARM")       = Optional, #9002313.56 ien (E-PHARMACY division) | 
|---|
| 90 | ; | 
|---|
| 91 | ; | 
|---|
| 92 | ; Return is the bill number for success or 1 if not billable. | 
|---|
| 93 | ; "0^reason" indicates not success | 
|---|
| 94 | ; | 
|---|
| 95 | Q $$ECME^IBNCPDP2(DFN,.IBD) | 
|---|
| 96 | ; | 
|---|
| 97 | ; | 
|---|
| 98 | UPAWP(IBNDC,IBAWP,IBADT) ; used to update AWPs.  This is an API that | 
|---|
| 99 | ; pharmacy will call. | 
|---|
| 100 | ; | 
|---|
| 101 | ;  IBNDC = NDC number to update with the price. | 
|---|
| 102 | ;  IBAWP = average wholesale price of the NDC | 
|---|
| 103 | ;  IBADT  = effective date of change (optional, default it today) | 
|---|
| 104 | ; | 
|---|
| 105 | ;  return will be a positive number indicating success. | 
|---|
| 106 | ;  if it is unsuccessful, then "0^reason" will be returned. | 
|---|
| 107 | ; | 
|---|
| 108 | Q $$UPAWP^IBNCPDP3(IBNDC,IBAWP,$G(IBADT,DT)) | 
|---|
| 109 | ; | 
|---|
| 110 | ; | 
|---|