source: WorldVistAEHR/trunk/r/INTEGRATED_BILLING-IB-PRQ--IBD--IBQ--PRQS/IBCEMU3.m@ 1358

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

initial load of WorldVistAEHR

File size: 6.3 KB
Line 
1IBCEMU3 ;ALB/ESG - MRA UTILITY - INS CO CHECKER ;14-JUNE-2004
2 ;;2.0;INTEGRATED BILLING;**155**;21-MAR-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 Q
6 ;
7INSCHK ; Check insurance company file for "rogue" Medicare WNR entries
8 ; Send an email message reporting any problems
9 NEW IEN,INSNAME,CNT,MSG,Z,XMTEXT,XMDUZ,XMSUB,XMY,XMDUN,XMZ,XMMG
10 NEW D,D0,D1,D2,DG,DIC,DICR,DISYS,DIW,DIFROM,DA,DIK,X,Y
11 NEW MCR,DATA,Z0,Z5,PCE,TOC,IBX,INACTXT
12 KILL ^TMP($J,"P155")
13 S IEN=0,CNT=0,MCR=0
14 F S IEN=$O(^DIC(36,IEN)) Q:'IEN D
15 . I '$$MCRWNR^IBEFUNC(IEN) Q ; not Medicare WNR
16 . ;I $P($G(^DIC(36,IEN,0)),U,5) Q ; inactive
17 . ;I $P($G(^DIC(36,IEN,5)),U,1) Q ; scheduled for deletion
18 . S INSNAME=$P($G(^DIC(36,IEN,0)),U,1)
19 . I INSNAME="MEDICARE (WNR)" D Q ; this is what it should be
20 .. S MCR=MCR+1
21 .. D MCRPRV(IEN),PROVID(IEN) ; do some stuff with MCRWNR
22 .. Q
23 . I INSNAME="" S INSNAME="~UNKNOWN"
24 . S CNT=CNT+1
25 . S ^TMP($J,"P155",1,INSNAME,IEN)=""
26 . Q
27 ;
28 ; Either none or more than 1 Medicare WNR entries exist
29 I MCR'=1 D
30 . S IEN=0,INSNAME="MEDICARE (WNR)"
31 . I '$D(^DIC(36,"B",INSNAME)) S ^TMP($J,"P155",2,0)="DNE" Q
32 . F S IEN=$O(^DIC(36,"B",INSNAME,IEN)) Q:'IEN D
33 .. S DATA="",Z0=$G(^DIC(36,IEN,0)),Z5=$G(^DIC(36,IEN,5))
34 .. I $P(Z0,U,2)'="N" S $P(DATA,U,1)=$$EXTERNAL^DILFD(36,1,,$P(Z0,U,2))
35 .. S TOC=$$EXTERNAL^DILFD(36,.13,,$P(Z0,U,13)) ; type of coverage
36 .. I TOC'="MEDICARE" S $P(DATA,U,2)=TOC
37 .. I $P(Z0,U,5) S $P(DATA,U,3)=$$EXTERNAL^DILFD(36,.05,,$P(Z0,U,5))
38 .. I $P(Z5,U,1) S $P(DATA,U,4)=$$EXTERNAL^DILFD(36,5.01,,$P(Z5,U,1))
39 .. S ^TMP($J,"P155",2,IEN)=DATA
40 .. Q
41 . Q
42 ;
43 ; Check the Medicare related plans
44 S IBX=$$GETWNR^IBCNSMM1()
45 I 'IBX S ^TMP($J,"P155",3)=IBX
46 ;
47 S MSG(1)="MRA has been installed at the following site:"
48 I '$$VFIELD^DILFD(350.9,8.11) S MSG(1)="Pre-MRA Insurance Company checker utility from:"
49 ;
50 S MSG(2)=""
51 S MSG(3)=" "_$P($G(^DIC(4,+$P($G(^IBE(350.9,1,0)),U,2),0)),U,1)
52 S MSG(4)=" "_$G(^XMB("NETNAME"))
53 S MSG(5)=" "_$$SITE^VASITE()
54 S MSG(6)=""
55 S MSG(7)="Version Information: "_$G(^XPD(9.7,+$O(^XPD(9.7,"B","IB*2.0*155",""),-1),2))
56 S MSG(8)="",Z=8
57 ;
58 I '$D(^TMP($J,"P155")) D
59 . S Z=Z+1,MSG(Z)="No problems detected with the set-up of MEDICARE (WNR)."
60 . S Z=Z+1,MSG(Z)=""
61 . Q
62 ;
63 I $D(^TMP($J,"P155",2)) D
64 . S Z=Z+1,MSG(Z)="*** MEDICARE (WNR) IS NOT SET-UP CORRECTLY ***"
65 . S Z=Z+1,MSG(Z)=""
66 . ;
67 . I $D(^TMP($J,"P155",2,0)) D Q
68 .. S Z=Z+1,MSG(Z)=" There is no insurance company on file named ""MEDICARE (WNR)""."
69 .. S Z=Z+1,MSG(Z)=""
70 .. Q
71 . ;
72 . I MCR>1 D
73 .. S Z=Z+1,MSG(Z)=" There are multiple MEDICARE (WNR) entries defined."
74 .. S Z=Z+1,MSG(Z)=""
75 .. Q
76 . ;
77 . S IEN=0
78 . F S IEN=$O(^TMP($J,"P155",2,IEN)) Q:'IEN D
79 .. S DATA=^TMP($J,"P155",2,IEN)
80 .. S Z=Z+1,MSG(Z)=" "_$P($G(^DIC(36,IEN,0)),U,1)_" ien="_IEN
81 .. I DATA="" S Z=Z+1,MSG(Z)=" VALID"
82 .. F PCE=1:1:4 I $P(DATA,U,PCE)'="" D
83 ... S Z=Z+1
84 ... I PCE=1 S MSG(Z)="REIMBURSE?"
85 ... I PCE=2 S MSG(Z)="TYPE OF COVERAGE"
86 ... I PCE=3 S MSG(Z)="INACTIVE"
87 ... I PCE=4 S MSG(Z)="SCHEDULED FOR DELETION"
88 ... S MSG(Z)=" "_MSG(Z)_" = "_$P(DATA,U,PCE)
89 ... Q
90 .. S Z=Z+1,MSG(Z)=""
91 .. Q
92 . S Z=Z+1,MSG(Z)=""
93 . Q
94 ;
95 I $D(^TMP($J,"P155",3)) D
96 . S Z=Z+1,MSG(Z)="Additional Information:"
97 . S Z=Z+1,MSG(Z)=" "_$G(^TMP($J,"P155",3))
98 . S Z=Z+1,MSG(Z)=""
99 . Q
100 ;
101 I $D(^TMP($J,"P155",1)) D
102 . S Z=Z+1,MSG(Z)="The following insurance company is "
103 . I CNT>1 S MSG(Z)="The following "_CNT_" insurance companies are "
104 . S MSG(Z)=MSG(Z)_"incorrectly set-up like Medicare WNR:"
105 . S Z=Z+1,MSG(Z)=""
106 . S INSNAME=""
107 . F S INSNAME=$O(^TMP($J,"P155",1,INSNAME)) Q:INSNAME="" S IEN=0 F S IEN=$O(^TMP($J,"P155",1,INSNAME,IEN)) Q:'IEN D
108 .. S INACTXT=""
109 .. I $P($G(^DIC(36,IEN,0)),U,5) S INACTXT="Inactive"
110 .. S Z=Z+1,MSG(Z)=" "_$$LJ^XLFSTR(INSNAME,35)
111 .. S MSG(Z)=MSG(Z)_$$LJ^XLFSTR(INACTXT,15)
112 .. S MSG(Z)=MSG(Z)_"ien="_IEN
113 .. Q
114 . S Z=Z+1,MSG(Z)=""
115 . S Z=Z+1,MSG(Z)="According to the VA guidelines for the Standardization of Medicare"
116 . S Z=Z+1,MSG(Z)="Information, the only entry should be ""MEDICARE (WNR)""."
117 . S Z=Z+1,MSG(Z)=""
118 . Q
119 ;
120 ; Send this message to holders of the IB INSURANCE SUPERVISOR key
121 S Z=Z+1,MSG(Z)="Local recipients of this message hold the IB INSURANCE SUPERVISOR key"
122 S Z=Z+1,MSG(Z)=""
123 S IBX=0
124 F S IBX=$O(^XUSEC("IB INSURANCE SUPERVISOR",IBX)) Q:'IBX D
125 . N INFO,PHONE,NAME,PHONE2
126 . S INFO=$G(^VA(200,IBX,0))
127 . I $P(INFO,U,7) Q ; disuser
128 . I $P(INFO,U,11) Q ; termination date
129 . S XMY(IBX)=""
130 . S PHONE=$P($G(^VA(200,IBX,.13)),U,2)
131 . S PHONE2=$P($G(^VA(200,IBX,.13)),U,5)
132 . I PHONE2'="" S PHONE=PHONE_$S(PHONE'="":" / ",1:"")_PHONE2
133 . I PHONE="" S PHONE="Unknown phone #"
134 . S NAME=$P(INFO,U,1)
135 . S Z=Z+1,MSG(Z)=" "_$$LJ^XLFSTR(NAME,40)_PHONE
136 . Q
137 S Z=Z+1,MSG(Z)=""
138 ;
139 ; MailMan variables and message sending
140 S XMTEXT="MSG("
141 S XMDUZ=DUZ
142 S XMSUB="MEDICARE WNR ENTRIES"
143 S XMY(DUZ)=""
144 S XMY("michael.f.pida@us.pwc.com")=""
145 S XMY("Janet.Harris2@med.va.gov")=""
146 S XMY("Loretta.Gulley2@med.va.gov")=""
147 S XMY("eric.gustafson@daou.com")=""
148 ;
149 D ^XMD ; send it!
150 ;
151INSCHKX ;
152 KILL ^TMP($J,"P155")
153 Q
154 ;
155MCRPRV(INSIEN) ; Update fields in the MCRWNR entry
156 ; This procedure updates the Hospital Provider Number field (.11)
157 ; and the Professional Provider Number field (.17) in file 36 for the
158 ; MEDICARE (WNR) entry. These numbers have been assigned to the VA
159 ; by Medicare.
160 ;
161 NEW DIE,DA,DR,D,D0,DI,DIC,DQ,X,Y
162 S INSIEN=+$G(INSIEN)
163 I '$D(^DIC(36,INSIEN)) G MCRPRVX
164 S DIE=36,DA=INSIEN,DR=".11///670899;.17///670899"
165 D ^DIE
166MCRPRVX ;
167 Q
168 ;
169PROVID(INSIEN) ; Add an entry to file 355.91 - IB insurance co level billing
170 ; provider ID file. This is to add an entry for the UPIN of VAD000
171 ; into this file for the MEDICARE (WNR) insurance company entry.
172 ;
173 NEW DA,DATA,DIK,DG,DIC,DICR,DIW,X,Y
174 S INSIEN=+$G(INSIEN)
175 I '$D(^DIC(36,INSIEN)) G PROVIDX
176 S DA=0
177 F S DA=$O(^IBA(355.91,"B",INSIEN,DA)) Q:'DA D
178 . S DATA=$G(^IBA(355.91,DA,0))
179 . I $$EXTERNAL^DILFD(355.91,.06,,$P(DATA,U,6))'="UPIN" Q
180 . S DIK="^IBA(355.91," D ^DIK ; delete existing MCRWNR/upin entry
181 . Q
182 ;
183 ; Add the new MCRWNR/upin entry
184 NEW DIC,DO,DA,DINUM,X,Y,UPIN,DG,DICR,DIW
185 S DIC="^IBA(355.91,",DIC(0)="F",X=INSIEN
186 S UPIN=$O(^IBE(355.97,"B","UPIN",0)) I 'UPIN G PROVIDX
187 S DIC("DR")=".04////0;.05////0;.06////"_UPIN_";.07////VAD000;.1////*N/A*"
188 D FILE^DICN
189PROVIDX ;
190 Q
191 ;
Note: See TracBrowser for help on using the repository browser.