Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Empty query results causing StringIndexOutOfBoundsException (http://www.mirthcorp.com/community/forums/showthread.php?t=7904)

psanders 11-02-2012 07:11 AM

Empty query results causing StringIndexOutOfBoundsException
 
I getting the error below in the transform step of my channel:

"StringIndexOutOfBoundsException: String index out of range"

is this due to the fact that some elements in the xml string returned from a query are empty?

The source on my channel is a database reader connecting to Oracle. I'm writing an HL7 file to the local drive. I have transform steps on all the xml elements to an HL7 field. But I suspect the error is due to having empty elements. I won't always have data returned in every field.

My question is how to handle that scenario? I still get the file created in my "error" directory, it just doesn't create it in the "out" directory.

Thanks

narupley 11-02-2012 08:30 AM

This could be due to one of many different things; post your channel so that the people here can help troubleshoot.

psanders 11-02-2012 09:21 AM

1 Attachment(s)
Here is the channel, thx for the review

narupley 11-02-2012 09:46 AM

Quote:

Originally Posted by psanders (Post 28873)
Here is the channel, thx for the review

Works fine for me; can you post a sample inbound message?

psanders 11-02-2012 01:23 PM

Here is an example of an incomplete result message taken from the raw message tab in the channel messages:

<result>
<prov_epic_internal_id>40</prov_epic_internal_id>
<prov_refferal_source_type>INTERNAL</prov_refferal_source_type>
<prov_zip>84124</prov_zip>
<prov_family>xxxxxx</prov_family>
<prov_division>PEDIATRIC NEUROLOGY</prov_division>
<prov_address>1151 E 3900 S</prov_address>
<prov_given>xxxxxx</prov_given>
<prov_city>SALT LAKE CITY</prov_city>
<prov_degree>MD</prov_degree>
<prov_md_email/>
<prov_middle>L</prov_middle>
<prov_state>UT</prov_state>
<prov_dept>PEDIATRICS</prov_dept>
<update_date>20121002</update_date>
<prov_phone/>
</result>

Here is a complete message example:

<result>
<prov_epic_internal_id>45</prov_epic_internal_id>
<prov_refferal_source_type>INTERNAL</prov_refferal_source_type>
<prov_zip>84111</prov_zip>
<prov_family>xxxxxx</prov_family>
<prov_division>DERMATOLOGY</prov_division>
<prov_address>324 10TH AVE STE 224</prov_address>
<prov_given>C</prov_given>
<prov_city>SALT LAKE CITY</prov_city>
<prov_degree>MD</prov_degree>
<prov_md_email>xxxxxxxxxxx</prov_md_email>
<prov_middle>DAVID</prov_middle>
<prov_state>UT</prov_state>
<prov_dept>DERMATOLOGY</prov_dept>
<update_date>20121002</update_date>
<prov_phone>801-581-xxxx</prov_phone>
</result>

Notice that the xml tags are different on the two fields missing data. That's what I'm guessing the problem to be.

narupley 11-02-2012 02:36 PM

Hm, again that works perfectly fine for me. I wouldn't expect an error to occur because of blank fields. For example, this mapping:

Code:

msg['prov_md_email'].toString()
If the "prov_md_email" node in the inbound message is blank, the above mapping will just evaluate to an empty string, and that's what'll get placed in SFT.15.1. So, there's no reason that the transformer should fail, that I can see. There's most likely something else happening on your specific Mirth Connect instance that's causing those errors. Can you post the entire error message?

psanders 11-05-2012 12:55 PM

Thx narupley, I found the problem. Your right the error isn't because of blank fields, I found a logic error in the deployment of two channels that was causing it. Essentially, another channel was also looking for the file extension and grabbing a half empty file.


All times are GMT -8. The time now is 04:25 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation