source: WorldVistAEHR/trunk/r/E_CLAIMS_MGMT_ENGINE-BPS/BPSOSC2.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.7 KB
Line 
1BPSOSC2 ;BHAM ISC/FCS/DRS - certification testing ;06/01/2004
2 ;;1.0;E CLAIMS MGMT ENGINE;**1,5**;JUN 2004;Build 45
3 ;;Per VHA Directive 2004-038, this routine should not be modified.
4 ;
5 Q
6 ; SETBPS - Overwrite BPS array with values from BPS Certfication file
7 ; Input
8 ; ENTRY - IEN for BPS Certification (#9002313.31)
9 ; Output
10 ; BPS Array - This is newed in BPSOSCA and is shared by all BPSOSC* routines
11 ; and others
12SETBPS(ENTRY) ;
13 ;
14 I $G(ENTRY)="" Q
15 ; If there is a payer in the Certification File, reset transaction header
16 ; values based on this payer sheet
17 N XDATA
18 I $P(^BPS(9002313.31,ENTRY,0),"^",4) D
19 . S BPS("NCPDP","IEN")=$P(^BPS(9002313.31,ENTRY,0),"^",4)
20 . S XDATA=$G(^BPSF(9002313.92,BPS("NCPDP","IEN"),1))
21 . S BPS("NCPDP","Version")=$P(XDATA,U,2)
22 . S BPS("NCPDP","# Meds/Claim")=$P(XDATA,U,3)
23 . S BPS("NCPDP","Software Vendor/Cert ID")=$P(XDATA,U,13)
24 ;
25 ; DMB 11/28/2006 - Existing Code, not sure if this is needed.
26 S BPS("Patient","SSN")=""
27 ;
28 ; Loop through claim header fields
29 N A,N S A=0
30 F S A=$O(^BPS(9002313.31,ENTRY,1,A)) Q:'A D
31 . N X S X=^BPS(9002313.31,ENTRY,1,A,0)
32 . N FIELD S FIELD=$P(^BPSF(9002313.91,$P(X,U),0),U)
33 . D SETBPS1(FIELD,$P(X,U,2))
34 ;
35 ; Loop through prescription fields
36 S N=0
37 F S N=$O(^BPS(9002313.31,ENTRY,2,N)) Q:'N D
38 . N A S A=0
39 . F S A=$O(^BPS(9002313.31,ENTRY,2,N,1,A)) Q:'A D
40 .. S X=^BPS(9002313.31,ENTRY,2,N,1,A,0)
41 .. N FIELD S FIELD=$P(^BPSF(9002313.91,$P(X,U),0),U)
42 .. D SETBPS1(FIELD,$P(X,U,2),N)
43 ;
44 ; Construct a few other fields that weren't already set
45 ; DMB 11/28/2006 - Existing Code, not sure if this is needed.
46 S BPS("Patient","Name")=$G(BPS("Patient","Last Name"))_","_$G(BPS("Patient","First Name"))
47 I '$D(BPS("RX",1,"Quantity")) S BPS("RX",1,"Quantity")=$G(BPS("RX",1,"Metric Decimal Quantity"))
48 Q
49 ;
50 ; Overwrite BPS array values
51SETBPS1(FIELD,VALUE,N) ;
52 N OK S OK=0
53 N I F I=1:1 Q:$T(TABLE+I)[";;*" D Q:OK
54 . N X S X=$T(TABLE+I)
55 . I $P(X,";",3)'=FIELD Q
56 . S @("BPS("_$P(X,";",4)_")=VALUE")
57 . S OK=1
58 Q
59 ;
60TABLE ;;
61 ;;101;"NCPDP","BIN Number"
62 ;;102;"NCPDP","Version"
63 ;;103;"Transaction Code"
64 ;;104;"NCPDP","PCN"
65 ;;109;"Transaction Count"
66 ;;110;"NCPDP","Software Vendor/Cert ID"
67 ;;111;"NCPDP","Segment Identification"
68 ;;201;"Site","Pharmacy #"
69 ;;202;"Service Provider ID Qual"
70 ;;301;"Insurer","Group #"
71 ;;302;"Insurer","Policy #"
72 ;;303;"Insurer","Person Code"
73 ;;304;"Patient","DOB"
74 ;;305;"Patient","Sex"
75 ;;306;"Insurer","Relationship"
76 ;;308;"Patient","Other Coverage Code"
77 ;;307;"Customer Location"
78 ;;309;"Eligibility Clarification Code"
79 ;;310;"Patient","First Name"
80 ;;311;"Patient","Last Name"
81 ;;312;"Cardholder","First Name"
82 ;;313;"Cardholder","Last Name"
83 ;;322;"Patient","Street Address"
84 ;;323;"Patient","City"
85 ;;324;"Patient","State"
86 ;;325;"Patient","Zip"
87 ;;331;"Patient","Patient ID Qualifier"
88 ;;332;"Patient","SSN"
89 ;;326;"Patient","Phone #"
90 ;;401;"RX","Date Filled"
91 ;;402;"RX",N,"RX Number"
92 ;;403;"RX",N,"Refill #"
93 ;;404;"RX",N,"Quantity"
94 ;;405;"RX",N,"Days Supply"
95 ;;406;"RX",N,"Compound Code"
96 ;;407;"RX",N,"NDC"
97 ;;408;"RX",N,"DAW"
98 ;;409;"RX",N,"Ingredient Cost"
99 ;;410;"RX",N,"Sales Tax"
100 ;;411;"RX",N,"Prescriber ID"
101 ;;412;"RX",N,"Dispensing Fee"
102 ;;414;"RX",N,"Date Written"
103 ;;415;"RX",N,"# Refills"
104 ;;416;"RX",N,"Preauth #"
105 ;;418;"RX",N,"Level of Service"
106 ;;419;"RX",N,"Origin Code"
107 ;;420;"RX",N,"Clarification"
108 ;;421;"RX",N,"Primary Prescriber"
109 ;;422;"RX",N,"Clinic ID"
110 ;;423;"RX",N,"Basis of Cost Determination"
111 ;;424;"RX",N,"Diagnosis Code"
112 ;;426;"RX",N,"Usual & Customary"
113 ;;427;"RX",N,"Prescriber Last Name"
114 ;;429;"RX",N,"Unit Dose Indicator"
115 ;;430;"RX",N,"Gross Amount Due"
116 ;;431;"RX",N,"Other Payor Amount"
117 ;;433;"RX",N,"Patient Paid Amount"
118 ;;436;"RX",N,"Alt. Product Type"
119 ;;438;"RX",N,"Incentive Amount"
120 ;;439;"RX",N,"DUR","DUR Conflict Code",439
121 ;;440;"RX",N,"DUR","DUR Intervention Code",440
122 ;;441;"RX",N,"DUR","DUR Outcome Code",441
123 ;;442;"RX",N,"Metric Decimal Quantity"
124 ;;443;"RX",N,"Primary Payor Denial Date"
125 ;;444;"RX",N,"Provider ID"
126 ;;455;"RX",N,"Rx/Service Ref Num Qual"
127 ;;460;"RX",N,"Quantity"
128 ;;461;"Claim",N,"Prior Auth Type"
129 ;;462;"Claim",N,"Prior Auth Num Sub"
130 ;;465;"RX",N,"Provider ID"
131 ;;466;"RX",N,"Prescriber ID Qualifier"
132 ;;467;"RX",N,"Prescriber Location Code"
133 ;;468;"RX",N,"Primary Care Prov ID Qual"
134 ;;469;"RX",N,"Primary Care Prov ID"
135 ;;470;"RX",N,"Primary Care Prov Last Name"
136 ;;473;"RX",N,"DUR","DUR/PPS CODE COUNTER",473
137 ;;478;"Insurer","Other Amt Claim Sub Cnt"
138 ;;479;"Insurer","Other Amt Claim Sub Qual"
139 ;;480;"Insurer","Other Amt Claim Submitted"
140 ;;481;"Insurer","Flat Sales Tax Amt Sub"
141 ;;482;"Insurer","Percentage Sales Tax Amt Sub"
142 ;;483;"Insurer","Percent Sales Tax Rate Sub"
143 ;;484;"Insurer","Percent Sales Tax Basis Sub"
144 ;;498;"RX",N,"Prescriber Phone #"
145 ;;*
Note: See TracBrowser for help on using the repository browser.