source: WorldVistAEHR/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSOSCC.m@ 1006

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

initial load of WorldVistAEHR

File size: 4.6 KB
Line 
1BPSOSCC ;BHAM ISC/FCS/DRS/DLF - Set up BPS() ;06/01/2004
2 ;;1.0;E CLAIMS MGMT ENGINE;**1,2,5**;JUN 2004;Build 45
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 ; GETINFO - Create BPS array for non-repeating data
6 ; IEN59 - Pointer to BPS Transactions
7 ; IEN5902 - IEN for Insurance multiple of BPS Transactions
8 ;
9 ; Note that the BPS array is shared by all of the BPSOSC* routines and
10 ; is newed by BPSOSCA
11 ; Note that VAINFO is newed/set in BPSOSCB
12 Q
13GETINFO(IEN59,IEN5902) ; EP - BPSOSCB
14 ; Check parameters
15 I $G(IEN59)="" Q
16 I $G(IEN5902)="" Q
17 ;
18 ; New variables and parse parameter data
19 N RXIEN,IENS,XDATA,PHARMACY,DFN,VAPA,VADM,SITE,NPI
20 ;
21 ; Setup Prescription IEN and IENS for transaction multiple
22 S RXIEN=$P(IEN59,".",1)
23 S IENS=IEN5902_","_IEN59_","
24 ;
25 ; Site Information
26 S PHARMACY=$P(^BPST(IEN59,1),U,7)
27 S XDATA=^BPS(9002313.56,PHARMACY,0)
28 S BPS("Site","NABP #")=$P(XDATA,U,2)
29 S BPS("Site","Default DEA #")=$P(XDATA,U,3)
30 S BPS("Site","Medicaid Pharmacy #")="" ; Referenced in payer sheet special code
31 S BPS("Site","Pharmacy #")=BPS("Site","NABP #")
32 S SITE=$P($G(^BPST(IEN59,1)),U,4)
33 S NPI=$$NPI^BPSNPI("Pharmacy_ID",SITE)
34 I +NPI=-1 S NPI=""
35 S BPS("Site","NPI")=$P(NPI,U,1)
36 ;
37 ; Transaction Header Data
38 S BPS("NCPDP","IEN")=$G(VAINFO(9002313.59902,IENS,902.02,"I"))
39 S BPS("NCPDP","BIN Number")=$G(VAINFO(9002313.59902,IENS,902.03,"I"))
40 S BPS("NCPDP","PCN")=$G(VAINFO(9002313.59902,IENS,902.04,"I"))
41 I BPS("NCPDP","IEN")="" D IMPOSS^BPSOSUE("P","TI","Payer Sheet pointer missing from multiple",,1,$T(+0))
42 I BPS("NCPDP","IEN") S XDATA=$G(^BPSF(9002313.92,BPS("NCPDP","IEN"),1))
43 I XDATA="" D IMPOSS^BPSOSUE("DB","TI","VA - Payer sheet info missing.",,2,$T(+0))
44 I BPS("NCPDP","BIN Number")="" S BPS("NCPDP","BIN Number")=$P(XDATA,U,1)
45 S BPS("NCPDP","Version")=$P(XDATA,U,2)
46 S BPS("NCPDP","# Meds/Claim")=$P(XDATA,U,3)
47 S BPS("NCPDP","Software Vendor/Cert ID")=$G(VAINFO(9002313.59902,IENS,902.18,"I"))
48 ;
49 ; Patient Data
50 S DFN=$P(^BPST(IEN59,0),U,6)
51 I 'DFN D IMPOSS^BPSOSUE("DB","TI","DFN",,,$T(+0))
52 I DFN,'$D(^DPT(DFN,0)) D IMPOSS^BPSOSUE("DB","TI","^DPT(DFN)",,,$T(+0))
53 D DEM^VADPT,ADD^VADPT
54 S BPS("Patient","IEN")=DFN
55 S BPS("Patient","Name")=$G(VADM(1))
56 S BPS("Patient","Sex")=$P($G(VADM(5)),"^",1)
57 S BPS("Patient","DOB")=$P($G(VADM(3)),"^",1)
58 S BPS("Patient","DOB")=($E(BPS("Patient","DOB"),1,3)+1700)_$E(BPS("Patient","DOB"),4,7)
59 S BPS("Patient","SSN")=$P($G(VADM(2)),"^",1)
60 S BPS("Patient","State")=$P($G(VAPA(5)),"^",1)
61 I BPS("Patient","State")'="" S BPS("Patient","State")=$P($G(^DIC(5,BPS("Patient","State"),0)),"^",2)
62 S BPS("Patient","Street Address")=$G(VAPA(1))
63 S BPS("Patient","City")=$G(VAPA(4))
64 S BPS("Patient","Zip")=$G(VAPA(6))
65 S BPS("Patient","Phone #")=$TR($P($G(VAPA(8)),"^",1),"()-/*# ")
66 S BPS("Patient","Plan ID")=$$GET1^DIQ(2.312,"1,"_DFN_",",.18)
67 ;
68 ; Insurer Data
69 S BPS("Insurer","IEN")=$G(VAINFO(9002313.59902,IENS,.01,"I"))
70 S BPS("Insurer","Relationship")=$G(VAINFO(9002313.59902,IENS,902.07,"I"))
71 S BPS("Insurer","Administrative Fee")=$G(VAINFO(9002313.59902,IENS,902.16,"I"))
72 I BPS("Insurer","Administrative Fee")'="",BPS("Insurer","Administrative Fee")'=0 S BPS("Insurer","Other Amt Claim Sub Qual")="04"
73 E S BPS("Insurer","Other Amt Claim Sub Qual")=""
74 I BPS("Insurer","Relationship")="" S BPS("Insurer","Relationship")=0 ;if not there, mark it as unspecified.
75 S BPS("Patient","Primary Care Prov Location Code")=$G(VAINFO(9002313.59902,IENS,902.11,"I"))
76 S BPS("Insurer","Person Code")=$S(BPS("Insurer","Relationship")=1:"01",BPS("Insurer","Relationship")=2:"02",BPS("Insurer","Relationship")=3:03,1:"")
77 S BPS("Insurer","Group #")=$G(VAINFO(9002313.59902,IENS,902.05,"I"))
78 S BPS("Insurer","Policy #")=$G(VAINFO(9002313.59902,IENS,902.06,"I")) ;CARDHOLDER ID
79 S BPS("Insurer","Full Policy #")=BPS("Insurer","Policy #")
80 S:'$D(BPS("Insurer","Percent Sales Tax Rate Sub")) BPS("Insurer","Percent Sales Tax Rate Sub")=""
81 S:'$D(BPS("Insurer","Percent Sales Tax Basis Sub")) BPS("Insurer","Percent Sales Tax Basis Sub")=""
82 S BPS("Insurer","Percentage Sales Tax Amt Sub")=0
83 S BPS("Insurer","Flat Sales Tax Amount Sub")=0
84 ;
85 ; DMB - The next pair of lines may seem odd. However, there was an error in the IHS code, so
86 ; this array element was always set to "". I fixed the code, but do not want to implement the fix
87 ; until it can be determined whether the fix will not cause rejects
88 S BPS("Insurer","Facility ID")=$$RXAPI1^BPSUTIL1(RXIEN,5,"E")
89 S BPS("Insurer","Facility ID")=""
90 ;
91 ; Cardholder Data
92 S BPS("Cardholder","First Name")=$G(VAINFO(9002313.59902,IENS,902.08,"I"))
93 S BPS("Cardholder","Last Name")=$G(VAINFO(9002313.59902,IENS,902.09,"I"))
94 S BPS("Home Plan")=$G(VAINFO(9002313.59902,IENS,902.11,"I"))
95 Q
Note: See TracBrowser for help on using the repository browser.