source: FOIAVistA/trunk/r/ORDER_ENTRY_RESULTS_REPORTING-OR-OCX--ORRC--ORRJ/ORVAA.m@ 1607

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

initial load of FOIAVistA 6/30/08 version

File size: 7.4 KB
Line 
1ORVAA ;;SLC OIFO/GDU - VA Advantage Indicator for GUI;[01/04/05 08:33]
2 ;;3.0;ORDER ENTRY/RESULTS REPORTING;**215**;Dec 17, 1999
3 ;Input Variable
4 ; DFN - Patient IEN
5 ;Ouput Variable
6 ; ORY - Any array variable that will contain the following.
7 ; If the patient does not have insurance
8 ; Y(0)=0
9 ; If the patient has active insurance
10 ; Y(0)="Pt Insur"^"Patient has active insurance"
11 ; Y(1)=Company ID
12 ; Y(2)=Company Name
13 ; Y(3)=Company Street Address
14 ; Y(4)=Company State, Zip Code
15 ; Y(5)=Phone number
16 ; Y(6)=Coordination of Benefits indicator
17 ; Y(7)=Policy Name
18 ; Y(8)=Policy Reimburasble indicator
19 ; Y(9)=Effective date
20 ; Y(10)=Expiration date
21 ; Y(11)=Subscriber relationship to patient
22 ; Y(12)=Subscriber name
23 ; Y(13)=Subscriber ID
24 ; Y(14)=Pharmacy coverage
25 ; Y(15)=Outpatient coverage
26 ; Y(16)=Inpatient coverage
27 ; Y(17)=Group Number
28 ; Y(18)=Patient relationship to subscriber
29 ; If this is a Tricare plan or Champus plan:
30 ; Y(19)="This is a TriCare/Champus plan."
31 ; If this is a VA Advantage plan:
32 ; Y(19)="This is a VA Advantage plan"
33 ; Y(20)=A blank line
34 ; Repeats as needed for each active policy
35 ;
36 ;Internal Variables
37 ; LC - Loop Counter
38 ; LQ - Loop Quit, stop loop execution
39 ; U - Default delimiter variable, set to "^" by FileMan/Kernel
40 ;External References
41 ; %ZTER - DBIA 1621
42 ; Kernel Standard Error Recording Routine
43 ; $$NOW^XLFDT - DBIA 10103
44 ; Returns current date/time
45 ; $$REPEAT^XLFSTR - DBIA 10104
46 ; Returns a string of character repeated a number of times
47 ; $$INSUR^IBBAPI - DBIA 4419
48 ; API input variables:
49 ; DFN - Patient IEN
50 ; IBDT - Date to check for active insurance
51 ; IBSTAT - Status filter
52 ; ORIBR - Array to store returned Insurance information
53 ; IBFLDS - Specifies what insurance information is to be returned
54 ; API output variables:
55 ; PIC - Patient Insurance Check
56 ; If equal to -1 an error occured during insurance lookup.
57 ; Error message is built and returned to user. This data
58 ; is contained in ORIBR.
59 ;
60 ; If equal to 0 patient has no active insurance. Y is set
61 ; to 0, program run ended.
62 ;
63 ; If equal to 1 patient has actie insurance. The insurance
64 ; information is parsed, a message is built, and returned
65 ; to the user. This data is contained in ORIBR.
66 ;
67VAA(ORY,DFN) ;
68 ;Returns primary insurance policy name if VAA or TriCare
69 N I,IBDT,IBFLDS,IBSTAT,LC,LQ,ORIBR,ORX,PIC,WI
70 S ORY(0)=""
71 ;Get active insurance information
72 S IBSTAT="RB",(LC,ORIBR,PIC)="",(LQ,WI)=0,IBFLDS="*"
73 S IBDT=$$NOW^XLFDT
74 S PIC=$$INSUR^IBBAPI(DFN,IBDT,IBSTAT,.ORIBR,IBFLDS)
75 I PIC<0 S ORY(0)=0 Q
76 I PIC=0 S:ORY(0)="" ORY(0)=0 Q
77 S $P(ORY(0),U)="Pt Insur",$P(ORY(0),U,2)="Patient has active Insurance"
78 S $P(ORY(0),U,3)=""
79 F S LC=$O(ORIBR("IBBAPI","INSUR",LC)) Q:LC=""!(LQ) D
80 . D FLD01,FLD02,FLD03,FLD04,FLD05,FLD06,FLD07,FLD08,FLD09,FLD10
81 . D FLD11,FLD12,FLD13,FLD14,FLD15,FLD16,FLD17,FLD18,FLD19,FLD20
82 . S WI=WI+1,ORY(WI)=""
83 I ORY(0)="" S ORY(0)=0
84 Q
85FLD01 ;Insurance Company Name
86 S WI=WI+1,ORY(WI)=$$SBS($P($P($T(F01T),";",3),U),30)
87 I $G(ORIBR("IBBAPI","INSUR",LC,1))'="" D
88 . S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,1),U)
89 S WI=WI+1,ORY(WI)=$$SBS($P($P($T(F01T),";",3),U,2),30)
90 I $G(ORIBR("IBBAPI","INSUR",LC,1))'="" D
91 . S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,1),U,2)
92 Q
93FLD02 ;Insurance Company Street Address
94 S WI=WI+1,ORY(WI)=$$SBS($P($T(F02T),";",3),30)
95 I $G(ORIBR("IBBAPI","INSUR",LC,2))="" Q
96 S ORY(WI)=ORY(WI)_ORIBR("IBBAPI","INSUR",LC,2)
97 Q
98FLD03 ;Insurance Company City
99 I $G(ORIBR("IBBAPI","INSUR",LC,3))="" S WI=WI+1,ORY(WI)="" Q
100 S WI=WI+1,ORY(WI)=$$REPEAT^XLFSTR(" ",30)_ORIBR("IBBAPI","INSUR",LC,3)
101 Q
102FLD04 ;Insurance Company State
103 I $G(ORIBR("IBBAPI","INSUR",LC,4))="" Q
104 S ORY(WI)=ORY(WI)_", "_$P(ORIBR("IBBAPI","INSUR",LC,4),U,2)
105 Q
106FLD05 ;Insurance Company Zip
107 I $G(ORIBR("IBBAPI","INSUR",LC,5))="" Q
108 S ORY(WI)=ORY(WI)_" "_ORIBR("IBBAPI","INSUR",LC,5)
109 Q
110FLD06 ;Insurance Company Phone
111 S WI=WI+1,ORY(WI)=$$SBS($P($T(F06T),";",3),30)
112 I $G(ORIBR("IBBAPI","INSUR",LC,6))="" Q
113 S ORY(WI)=ORY(WI)_ORIBR("IBBAPI","INSUR",LC,6)
114 Q
115FLD07 ;Coordination of Benefits
116 S WI=WI+1,ORY(WI)=$$SBS($P($P($T(F07T),";",3),U),30)
117 I $G(ORIBR("IBBAPI","INSUR",LC,7))="" Q
118 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,7),U,2)_" insurer"
119 Q
120FLD08 ;Policy Name
121 S WI=WI+1,ORY(WI)=$$SBS($P($T(F08T),";",3),30)
122 I $G(ORIBR("IBBAPI","INSUR",LC,8))="" Q
123 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,8),U)
124 S ORY(WI)=ORY(WI)_" - "_$P(ORIBR("IBBAPI","INSUR",LC,8),U,2)
125 Q
126FLD09 ;Policy Reimbursable
127 S WI=WI+1,ORY(WI)=$$SBS($P($T(F09T),";",3),30)
128 I $G(ORIBR("IBBAPI","INSUR",LC,9))="" Q
129 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,9),U,2)
130 Q
131FLD10 ;Effective Date
132 S WI=WI+1,ORY(WI)=$$SBS($P($T(F10T),";",3),30)
133 I $G(ORIBR("IBBAPI","INSUR",LC,10))="" Q
134 S ORY(WI)=ORY(WI)_$$FMTE^XLFDT(ORIBR("IBBAPI","INSUR",LC,10))
135 Q
136FLD11 ;Expiration Date
137 S WI=WI+1,ORY(WI)=$$SBS($P($T(F11T),";",3),30)
138 I $G(ORIBR("IBBAPI","INSUR",LC,11))="" Q
139 S ORY(WI)=ORY(WI)_$$FMTE^XLFDT(ORIBR("IBBAPI","INSUR",LC,11))
140 Q
141FLD12 ;Subscriber Relationship
142 S WI=WI+1,ORY(WI)=$$SBS($P($T(F12T),";",3),40)
143 I $G(ORIBR("IBBAPI","INSUR",LC,12))="" Q
144 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,12),U,2)
145 Q
146FLD13 ;Subscriber Name
147 S WI=WI+1,ORY(WI)=$$SBS($P($T(F13T),";",3),40)
148 I $G(ORIBR("IBBAPI","INSUR",LC,13))="" Q
149 S ORY(WI)=ORY(WI)_ORIBR("IBBAPI","INSUR",LC,13)
150 Q
151FLD14 ;Subscriber ID
152 S WI=WI+1,ORY(WI)=$$SBS($P($T(F14T),";",3),40)
153 I $G(ORIBR("IBBAPI","INSUR",LC,14))="" Q
154 S ORY(WI)=ORY(WI)_ORIBR("IBBAPI","INSUR",LC,14)
155 Q
156FLD15 ;Pharmacy Coverage
157 S WI=WI+1,ORY(WI)=$$SBS($P($T(F15T),";",3),30)
158 I $G(ORIBR("IBBAPI","INSUR",LC,15))="" Q
159 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,15),U,2)
160 Q
161FLD16 ;Outpatient Coverage
162 S WI=WI+1,ORY(WI)=$$SBS($P($T(F16T),";",3),30)
163 I $G(ORIBR("IBBAPI","INSUR",LC,16))="" Q
164 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,16),U,2)
165 Q
166FLD17 ;Inpatient Coverage
167 S WI=WI+1,ORY(WI)=$$SBS($P($T(F17T),";",3),30)
168 I $G(ORIBR("IBBAPI","INSUR",LC,17))="" Q
169 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,17),U,2)
170 Q
171FLD18 ;Group Number
172 S WI=WI+1,ORY(WI)=$$SBS($P($T(F18T),";",3),30)
173 I $G(ORIBR("IBBAPI","INSUR",LC,18))="" Q
174 S ORY(WI)=ORY(WI)_ORIBR("IBBAPI","INSUR",LC,18)
175 Q
176FLD19 ;Patient Relationship to Subscriber
177 S WI=WI+1,ORY(WI)=$$SBS($P($T(F19T),";",3),40)
178 I $G(ORIBR("IBBAPI","INSUR",LC,19))="" Q
179 S ORY(WI)=ORY(WI)_$P(ORIBR("IBBAPI","INSUR",LC,19),U,2)
180 Q
181FLD20 ;VA Advantage Flag - Tricare/Champus Flag
182 S WI=WI+1,ORY(WI)=""
183 I $G(ORIBR("IBBAPI","INSUR",LC,20))="" Q
184 I $P(ORIBR("IBBAPI","INSUR",LC,20),U)=1 D
185 . S ORY(WI)="This is a VA Advantage plan"
186 I $P(ORIBR("IBBAPI","INSUR",LC,20),U,2)=1 D
187 . S ORY(WI)="This is a TriCare/Champus plan"
188 Q
189SBS(X,X1) ;Stuff Blank Spaces in line headers
190 N X2
191 S X2=X1-$L(X)
192 S X=X_$$REPEAT^XLFSTR(" ",X2)
193 Q X
194 ;Field text for output
195F01T ;;Company ID:^Company Name:
196F02T ;;Company Address:
197F06T ;;Phone Number:
198F07T ;;Coordination of Benefits:^insurer
199F08T ;;Policy Name:
200F09T ;;Policy Reimbursable:
201F10T ;;Effective Date:
202F11T ;;Expiration Date:
203F12T ;;Subscriber Relationship to Patient:
204F13T ;;Subscriber Name:
205F14T ;;Subscriber ID:
206F15T ;;Pharmacy Coverage:
207F16T ;;Outpatient Coverage:
208F17T ;;Inpatient Coverage:
209F18T ;;Group Number:
210F19T ;;Patient Relationship to Subscriber:
211F20T1 ;;This is a VA Advantage plan.
212F20T2 ;;This is a TriCare/Champus plan.
Note: See TracBrowser for help on using the repository browser.