Greetings,
We do 270 Eligibility posts from our Epic system to a couple of payers who can respond with just about anything that is non-X12 including XML, HTML, plain text. In our TPS IB reply UPOC for the threads we have a TCL procedure (called by a top level TCL procedure in this context that passes the Reply message handle and in our case the Sent message handle from the OBMSGID key) that checks to see if we did receive an X12 type response else treat it as an exception. For us we create a dummy X12 message and pass it on. You could just error it out. Here is the snippet that we use to determine if this is an X12 response: (yes: to the purists out there this was developed BEFORE the movement to use the TCL string command – my apologies to the STRING acolytes): – note: there is an ELSE to match the topmost IF test here:
if {[string equal ISA [csubstr $response 0 3]]} {
set seps [ 270_get_X12_seps $response ]
set segterm [lindex $seps 0]
set elemsep [lindex $seps 1]
set segments [split $response $segterm]
set ta1_idx [lsearch -regexp $segments “^TA1*”] ;#may have ISA errors
set st_idx [lsearch -regexp $segments “^ST*”]
set st_segment [lindex $segments $st_idx]
set st_tran [lindex [split $st_segment $elemsep] 1]
set 271_code {} ;#default value for code 80 checks
# Check if we have TA1, 997 errors or 271 with errors or pristine 271.
if {$ta1_idx > -1} {
set 271_code 42
set 271_message [270_create_cannot_process_message $sentmsg $271_code]
set errmsg “TA1 Interchange Reject Received ($context)”
# Override the email recipient for TA1 to EDI expert.
#set towhom “john.moriarty@allina.com” ;#override
# Send a Remedy page to Bridges on Call Support to investigate.
if { ! [info exists auto_page_already_sent_array(ta1)] || ! $auto_page_already_sent_array(ta1)} {
SM_AutoPage::auto_page ta1 $270_receiver_id
set auto_page_already_sent_array(ta1) 1
270_mail_messages $sentmsg $response $towhom $errmsg TA1
}
} elseif {[string equal 997 $st_tran]} {
[lots more code then this ELSE to the topmost IF test]
} else {
# Other errors (no ISA envelope) – got a webpage for HIPPA errors (rare) or badly
# Malformed headers, or timeout (most likely response).
# Send all protocol errors but only first webpage error.
# Note: webpage only received by Clear Connect not needed as of 6/30/2010.
# Vendor has been replaced by Availity.
# We retain the logic but bypass for Availity vendor.
# Perform the non-ISA type responses and auto-page/requeue if necessary.
# Note: email tag variable is created for the exceptions (HIPAA, Timeout, whatever).
# Note: use State 16 sent message to build segment list and get segment terminator.
[YOUR LOGIC HERE – kill reply or do an email or error database]
Let me know if you would like this TCL procedure – huge (about 35K characters with subroutines and namespaces – did not want to overwhelm you with irrelevant logic).
I hope this proves useful.