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

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

initial load of WorldVistAEHR

File size: 7.3 KB
Line 
1IBCIUT4 ;DSI/SLM - MISC UTILITIES ;29-JAN-2001
2 ;;2.0;INTEGRATED BILLING;**161,226,348**;21-MAR-94;Build 5
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 Q
6COMERR ;create msg for comm error
7 NEW L,L1,MGROUP,TEXT,IBCISMG,IBCIERR
8 I '$D(IBCICLNP) S IBCICLNP=$P(^DGCR(399,IBIFN,0),U)
9 S MGROUP=$P(^IBE(350.9,1,50),U,4),MGROUP=$P(^XMB(3.8,MGROUP,0),U),L1=1
10 S IBCIERR=$$P1(PROBLEM)
11 D SNTMSG
12 S TEXT(L1)=" ** CLAIMSMANAGER COMMUNICATIONS ERROR **",L1=L1+1
13 S TEXT(L1)=" ",L1=L1+1
14 S TEXT(L1)="While attempting to send claim # "_IBCICLNP_", Error Code # "_$P(IBCIERR,U,1),L1=L1+1
15 S TEXT(L1)="was generated.",L1=L1+1
16 S TEXT(L1)=" ",L1=L1+1
17 S TEXT(L1)="User attempted "_IBCISMG,L1=L1+1
18 S TEXT(L1)=" ",L1=L1+1
19 S TEXT(L1)="Error Description:",L1=L1+1
20 S TEXT(L1)=" ",L1=L1+1
21 S TEXT(L1)=$P(IBCIERR,U,2),L1=L1+1
22 S TEXT(L1)=" ",L1=L1+1
23 I $P(IBCIERR,U,3)'="" D
24 . S TEXT(L1)="ClaimsManager Error Message:",L1=L1+1
25 . S TEXT(L1)=" ",L1=L1+1
26 . S TEXT(L1)=$P($P(IBCIERR,U,3)," - ",1),L1=L1+1
27 . S TEXT(L1)=$P($P(IBCIERR,U,3,99)," - ",2,99),L1=L1+1
28 . S TEXT(L1)=" ",L1=L1+1
29 . Q
30 ;
31 ; esg - 10/29/01 - Direct the reader to the Clear CM Results Queue
32 ; option if the problem does not go away.
33 ;
34 I PROBLEM=99 S TEXT(L1)="Please correct the problem and send again.",L1=L1+1
35 E D
36 . S TEXT(L1)="If this problem persists, then please try running the",L1=L1+1
37 . S TEXT(L1)="option to clear out the ClaimsManager results queue.",L1=L1+1
38 . S TEXT(L1)="This option name is IBCI CLEAR CLAIMSMANAGER QUEUE.",L1=L1+1
39 . Q
40 S TEXT(L1)=" ",L1=L1+1
41 S TEXT(L1)="Bill Sent By: "_$P(^VA(200,DUZ,0),U)
42 S XMSUB="ClaimsManager Communications Error sending "_IBCICLNP
43 S XMDUZ="ClaimsManager Interface",XMTEXT="TEXT(",XMY("G."_MGROUP)=""
44 D ^XMD
45 K XMSUB,XMDUZ,XMTEXT,TEXT
46 Q
47GENERR(IBIFN,IBCIETP) ;create msg for general error
48 Q:IBCISNT'=2
49 NEW L,L1,L2,L3,MGROUP,TEXT,XMTEXT,XMY,XMSUB,XMDUZ,USER,IBCISMG,IBCIE1
50 I '$D(IBCICLNP) S IBCICLNP=$P(^DGCR(399,IBIFN,0),U)
51 S MGROUP=$P(^IBE(350.9,1,50),U,3),MGROUP=$P(^XMB(3.8,MGROUP,0),U),L1=1
52 D SNTMSG
53 S TEXT(L1)="User attempted "_IBCISMG,L1=L1+1
54 S TEXT(L1)=" ",L1=L1+1
55 ;pull error msg from 351.9 based on mnemonic (IBCIETP) error type
56 S IBCIE1=0 F S IBCIE1=$O(^IBA(351.9,IBIFN,1,"B",IBCIETP,IBCIE1)) Q:'IBCIE1 D
57 .S TEXT(L1)="Line Item: "_+$P(^IBA(351.9,IBIFN,1,IBCIE1,0),U,2),L1=L1+1
58 .S TEXT(L1)="Error Mnemonic: "_$P(^IBA(351.9,IBIFN,1,IBCIE1,0),U),L1=L1+1
59 .S TEXT(L1)="Error Level: "_$P(^IBA(351.9,IBIFN,1,IBCIE1,0),"~",2),L1=L1+1
60 .S TEXT(L1)=" ",L1=L1+1
61 .S TEXT(L1)="Error Message:",L1=L1+1
62 .S L2=0 F S L2=$O(^IBA(351.9,IBIFN,1,IBCIE1,L2)) Q:'L2 D
63 ..S L3=0 F S L3=$O(^IBA(351.9,IBIFN,1,IBCIE1,L2,L3)) Q:'L3 D
64 ...S TEXT(L1)=^IBA(351.9,IBIFN,1,IBCIE1,L2,L3,0),L1=L1+1
65 .S TEXT(L1)=" ",L1=L1+1
66 S TEXT(L1)=" ",XMTEXT="TEXT("
67 S XMY(DUZ)="",XMY("G."_MGROUP)=""
68 ;
69 ; Additionally, send this MailMan message to the biller, the
70 ; assigned to person, the person who last edited this bill, and
71 ; the person who last sent it to ClaimsManager.
72 ; esg - 9/5/01 & 9/27/01
73 ;
74 S USER=+$$BILLER^IBCIUT5(IBIFN) I USER S XMY(USER)=""
75 S USER=+$P($G(^IBA(351.9,IBIFN,0)),U,12) I USER S XMY(USER)=""
76 S USER=+$P($G(^IBA(351.9,IBIFN,0)),U,9) I USER S XMY(USER)=""
77 S USER=+$P($G(^IBA(351.9,IBIFN,0)),U,5) I USER S XMY(USER)=""
78 ;
79 S XMSUB="ClaimsManager Claim "_IBCICLNP_" Returned with Errors"
80 S XMDUZ="ClaimsManager Interface"
81 D ^XMD
82 Q
83SNTMSG ;determine what user was doing for message
84 ;
85 I IBCISNT=1 S IBCISMG="a Normal Send after Editing."
86 I IBCISNT=2 S IBCISMG="a Normal Send from the Multiple Send Option."
87 I IBCISNT=3 S IBCISMG="a Test Send from the Edit Screens."
88 I IBCISNT=4 S IBCISMG="to Cancel the Claim."
89 I IBCISNT=5 S IBCISMG="to Override the Errors."
90 I IBCISNT=6 S IBCISMG="to Send an Authorized Claim from the Multiple Send Option."
91 I IBCISNT=7 S IBCISMG="to delete the lines on this bill which is no longer a CMS-1500."
92 Q
93 ;
94 ;TCK CALL check text for ClaimsManager delimiters and strip if found
95 ;Input variable
96 ; x
97TCK() ;check text for characters used as delimiters and strip them out
98 Q:$G(X)="" S X=$TR(X,$C(28,29,30)_"'%")
99 Q
100CCK() ;check codes for decimal points and strip them out
101 Q:$G(X)="" S X=$TR(X,".")
102 Q
103Z1AR ;converts ibciz array to ibciz1 array and import into error field
104 Q:'$D(IBCIZ) K IBCIZ1
105 S ERNUM=0 F S ERNUM=$O(IBCIZ("RL",ERNUM)) Q:'ERNUM D
106 .I $P(IBCIZ("RL",ERNUM,0),U,2)="" Q
107 .S IBCIZ1(ERNUM,0)=$P(IBCIZ("RL",ERNUM,0),U,2)_U_$P(IBCIZ("RL",ERNUM,0),U)_U_$P(IBCIZ("RL",ERNUM,0),U,3,999)
108 .S LINE=0 F S LINE=$O(IBCIZ("RL",ERNUM,"E",LINE)) Q:'LINE D
109 ..S IBCIZ1(ERNUM,LINE)=IBCIZ("RL",ERNUM,"E",LINE)
110 I IBCISNT>2 G Z1Q
111 I $P($G(^IBA(351.9,IBIFN,1,0)),U,4) D DELER
112 S IBCIN1=0 F S IBCIN1=$O(IBCIZ1(IBCIN1)) Q:'IBCIN1 D ADDSUB1
113Z1Q K DIC,DIE,DA,L1,LINE,ERDT,IBCIN1,ERNUM
114 Q
115PROC() ;convert procedure code
116 Q:$G(X)="" N DA,GNODE
117 S DA=$P(X,";"),GNODE="^"_$P(X,";",2)_DA_",0)",X=$P(@GNODE,U)
118 Q
119ADDSUB1 ;create the subfile for errors and add data
120 S DIC="^IBA(351.9,"_IBIFN_",1,",DA(1)=IBIFN,DIC(0)="LMN"
121 S X=$P(IBCIZ1(IBCIN1,0),U) D FILE^DICN Q:Y<1 S DA=+Y
122 S ERDT=$P(IBCIZ1(IBCIN1,0),U,2,999),ERDT=$TR(ERDT,"^","~")
123 S DIE=DIC,DR=".02////"_ERDT D ^DIE
124 S L1=0 F S L1=$O(IBCIZ1(IBCIN1,L1)) Q:'L1 D
125 .S IBCIZ1(IBCIN1,L1)=$TR(IBCIZ1(IBCIN1,L1),";",",")
126 .S DR=".03///+"_IBCIZ1(IBCIN1,L1) D ^DIE
127 Q
128DELER ;delete the error information in 351.9
129 Q:'IBIFN
130 Q:'$P($G(^IBA(351.9,IBIFN,1,0)),U,4)
131 S DIK="^IBA(351.9,"_IBIFN_",1,",DA(1)=IBIFN
132 S DA=0 F S DA=$O(^IBA(351.9,IBIFN,1,DA)) Q:'DA D ^DIK
133 K DIK,DA
134 Q
135DELTI ;delete temporary information in 351.9
136 N IBCIX4,TMPDATA,NODE
137 S DIE="^IBA(351.9,"_IBIFN_",5,"
138 F IBCIX4=$P($G(^IBA(351.9,IBIFN,5,0)),U,4):-1:1 S DA=IBCIX4 D
139 .S DA(1)=IBIFN,DR=".01////@" D ^DIE
140 K DIE,DR,DA
141 I $D(^IBA(351.9,IBIFN,4)) D
142 .S DIE="^IBA(351.9,",DA=IBIFN
143 .S DR="4.01////@;4.02////@;4.03////@;4.04////@" D ^DIE
144 K DIE,DR,DA
145 I $D(^IBA(351.9,IBIFN,3)) D
146 .S DIE="^IBA(351.9,",DA=IBIFN
147 .S DR="3.01////@;3.02////@;3.03////@;3.04////@;3.05////@;3.06////@;"
148 .S DR=DR_"3.07////@;3.08////@;3.09////@;3.1////@;3.11////@;3.12////@"
149 .D ^DIE K DIE,DR,DA
150 F NODE=3,4,5 S TMPDATA="^IBA(351.9,IBIFN,NODE)" K @TMPDATA
151 Q
152 ;
153DCOM(IBIFN) ;delete whatever's in the comment field in 351.9
154 S DIE="^IBA(351.9,",DA=IBIFN,DR="2.01///@;.13///@;.14///@"
155 D ^DIE K DIE,DA,DR
156 Q
157 ;
158P1(PROBLEM) ;comm error handling with problem variable
159 ;Input variable
160 ; PROBLEM
161 ;Returns
162 ; error code^error desc^msg returned from ClaimsManager
163 N IBCIY,IBCICODE,IBCIDESC,IBCIMSG S IBCICODE=PROBLEM
164 I IBCICODE=1 S IBCIDESC="TCP/IP time-out during 1st read." D
165 .S IBCIMSG=$G(IBCIZ)_" - "_$G(IBCIZ(1,1))
166 I IBCICODE=2 S IBCIDESC="Local Symbol Size Storage Problems during 1st read."
167 I IBCICODE=3 S IBCIDESC="1st read was NOT a ClaimsManager ACK message." D
168 .S IBCIMSG=$G(IBCIZ)_" - "_$G(IBCIZ(1,1))
169 I IBCICODE=4 S IBCIDESC="TCP/IP Time-out during 2nd read." D
170 .S IBCIMSG=$G(IBCIZ)_" - "_$G(IBCIZ(1,1))
171 I IBCICODE=5 S IBCIDESC="Local Symbol Size Storage Problems during 2nd read."
172 I IBCICODE=6 S IBCIDESC="2nd read was NOT a RESULTREC message type." D
173 .S IBCIMSG=$G(IBCIZ)_" - "_$G(IBCIZ(1,1))
174 I IBCICODE=7 S IBCIDESC="Fatal System Error",IBCIMSG=$G(IBCIZ)_" - "_$G(IBCIZ(1,1)) ; ib*226
175 I IBCICODE=99 S IBCIDESC="Unable to Open Port." D
176 .S IBCIMSG="Please restart the Ingenix Event Manager services."
177 I "^1^2^3^4^5^6^7^99^"'[IBCICODE S IBCIDESC="Unknown Error Type."
178 S IBCIY=IBCICODE_"^"_IBCIDESC_"^"_$G(IBCIMSG)
179 Q IBCIY
180 ;
Note: See TracBrowser for help on using the repository browser.