Announcement

Collapse
No announcement yet.

Empty query results causing StringIndexOutOfBoundsException

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    This could be due to one of many different things; post your channel so that the people here can help troubleshoot.
    Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

    Nicholas Rupley
    Work: 949-237-6069
    Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


    - How do I foo?
    - You just bar.

    Comment


    • #3
      Here is the channel, thx for the review
      Attached Files

      Comment


      • #4
        Originally posted by psanders View Post
        Here is the channel, thx for the review
        Works fine for me; can you post a sample inbound message?
        Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

        Nicholas Rupley
        Work: 949-237-6069
        Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


        - How do I foo?
        - You just bar.

        Comment


        • #5
          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.
          Last edited by psanders; 11-02-2012, 01:25 PM.

          Comment


          • #6
            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?
            Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

            Nicholas Rupley
            Work: 949-237-6069
            Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


            - How do I foo?
            - You just bar.

            Comment


            • #7
              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.

              Comment

              Working...
              X