Announcement

Collapse
No announcement yet.

EDI X12 837 File Parse Error Mirth Connect 3.0

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

  • EDI X12 837 File Parse Error Mirth Connect 3.0

    Hi,

    I am trying to convert an 837 file to a CSV formatted file. I put my inbound as EDI/x12 and outbound as Delimited text. I haven't written any code in the Transformer yet. Just wanted to test if an 837 is parsed properly. When I send my 837 message for processing I get the following error.

    The content of elements must consist of well-formed character data or markup.

    I am attaching my 837 file. Could you guys send me a valid 837 if something is wrong with my sample file?

    Thanks
    brao
    Attached Files
    Last edited by kbrao826; 01-20-2014, 02:57 AM. Reason: forgot attachment

  • #2
    The issue is that you have an error in your channel configuration. If you want to transform an X12 message into delimited text, you actually need to do the transformation in your transformer.
    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
      Hi Narupley,

      Thanks for the response. I know that I need to write the transformation code in the transformer. But I was just trying to parse the EDI file and it is giving me an error. In the transformer I just hard coded the temp value just to see if my 837 file is getting validated. But Mirth is erroring out.

      I did this through delimited text input and delimited text output. I handled the code in the transformer using Javascript. I was able to convert 837 to CSV. But I am not validating the 837 messaging by using delimited text as input .

      Comment


      • #4
        Originally posted by kbrao826 View Post
        Hi Narupley,

        Thanks for the response. I know that I need to write the transformation code in the transformer. But I was just trying to parse the EDI file and it is giving me an error. In the transformer I just hard coded the temp value just to see if my 837 file is getting validated. But Mirth is erroring out.

        I did this through delimited text input and delimited text output. I handled the code in the transformer using Javascript. I was able to convert 837 to CSV. But I am not validating the 837 messaging by using delimited text as input .
        Can you post your channel? I'm confused as to how exactly your channel is set up.

        Try this. Create a completely new channel and change all data types to EDI/X12. Then edit the source transformer, and add a blank JavaScript step. Deploy the channel and send a message through. You'll be able to see the serialized XML in the transformed data section.
        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
          Processing 837 files using Mirth

          We are planning/trying to use Mirth Connect to process 837P or 837I files. I know that Mirth only supports X12 and doesn't support processing 837 directly and doesn't have a mapping tool.

          The questions I have are
          1. Has anyone did process the 837 files using mirth?
          2. Has someone done this earlier and can you help us?
          3. What is the approach?
          4. 837 files can have regular or custom segments and have looping.
          5. We are going to receive the 837 files on a ftp location and be able to process and load to a flat table in oracle?

          thanks for your help.

          Comment


          • #6
            I'm surprised that no has been willing to post a sample channel for this. It seems to be in demand right now.

            I've been able to (with MIRTH Support) create a source transformer that parses the 837 file into nice XML segments. This code will break the entire file into "chunks" of HLs. ie a chuck for the HL 20, HL 22 and so forth.


            // Create XML to makes things easier
            var claims = <claims></claims>;
            var sub_section = null;
            var first_hl = msg['HL'][0].childIndex();

            for(i=first_hl; i<msg.children().length(); i++){

            var claim_child_name = msg.child(i).name().toString();

            if(claim_child_name == "HL")
            {
            //then you have a new claim
            if(i!=first_hl){
            claim.appendChild(sub_section);
            claims.appendChild(claim);
            }
            var claim = <claim></claim>;
            sub_section = claim;
            }

            //The rest are sub sections of HL
            else if(claim_child_name == "SBR")
            {
            if(sub_section!=claim){
            claim.appendChild(sub_section);
            }
            sub_section = <SBR></SBR>;
            }

            else if(claim_child_name == "NM1")
            {
            if(sub_section!=claim){
            claim.appendChild(sub_section);
            }
            sub_section = <NM1></NM1>;
            }
            else if(claim_child_name == "LX")
            {
            if(sub_section!=claim){
            claim.appendChild(sub_section);
            }
            sub_section = <LX></LX>;
            }

            if(sub_section == null)
            {
            //Then there's a subsection that's
            //not SBR, NM1, or LX
            claim.appendChild(msg.child(i));
            }
            else
            {
            sub_section.appendChild(msg.child(i));
            }
            }

            claim.appendChild(sub_section);
            claims.appendChild(claim);
            channelMap.put("claims", claims);

            for(h=0; h<claims.children().length(); h++){

            //Create a blank HL7 XML
            var HL7_message = <HL7Message></HL7Message>;
            //Append an MSH segment to the HL7 XML
            HL7_message.appendChild(new XML(SerializerFactory.getSerializer('HL7V2').toXML ('MSH|^~\&|company|company|company|company|'+dateS tring+'||ADT^A01||P|2.5|')));

            var h20 = <h20/>;
            try{h20['h20.1']['h20.1.1'] = claims['claim'][claimsCount]['NM1'][0]['NM1'][1]['NM1.01']['NM1.01.1'].toString();}catch(err){h20['h20.1']['h20.1.1'] = '';}

            try{h20['h20.1']['h20.1.1'] = claims['claim'][claimsCount]['HL']['HL.01']['HL.01.1'].toString(); }catch(err){h20['h20.1']['h20.1.1'] = '';}
            try{h20['h20.2']['h20.2.1'] = claims['claim'][claimsCount]['HL']['HL.02']['HL.02.1'].toString(); }catch(err){h20['h20.2']['h20.2.1'] = '';}
            try{h20['h20.3']['h20.3.1'] = claims['claim'][claimsCount]['HL']['HL.03']['HL.03.1'].toString(); }catch(err){h20['h20.3']['h20.3.1'] = '';}
            try{h20['h20.4']['h20.4.1'] = claims['claim'][claimsCount]['HL']['HL.04']['HL.04.1'].toString(); }catch(err){h20['h20.4']['h20.4.1'] = '';}
            try{h20['h20.5']['h20.5.1'] = claims['claim'][claimsCount]['NM1'][0]['NM1'][1]['NM1.01']['NM1.01.1'].toString(); }catch(err){h20['h20.5']['h20.5.1'] = '';}
            try{h20['h20.6']['h20.6.1'] = claims['claim'][claimsCount]['NM1'][0]['N3']['N3.01']['N3.01.1'].toString(); }catch(err){h20['h20.6']['h20.6.1'] = '';}
            try{h20['h20.7']['h20.7.1'] = claims['claim'][claimsCount]['NM1'][0]['N4']['N4.01']['N4.01.1'].toString(); }catch(err){h20['h20.7']['h20.7.1'] = '';}
            try{h20['h20.7']['h20.7.2'] = claims['claim'][claimsCount]['NM1'][0]['N4']['N4.02']['N4.02.1'].toString(); }catch(err){h20['h20.7']['h20.7.2'] = '';}
            try{h20['h20.7']['h20.7.3'] = claims['claim'][claimsCount]['NM1'][0]['N4']['N4.03']['N4.03.1'].toString(); }catch(err){h20['h20.7']['h20.7.3'] = '';}
            try{h20['h20.8']['h20.8.1'] = claims['claim'][claimsCount]['NM1'][0]['REF']['REF.01']['REF.01.1'].toString(); }catch(err){h20['h20.8']['h20.8.1'] = '';}
            try{h20['h20.9']['h20.9.1'] = claims['claim'][claimsCount]['NM1'][0]['REF']['REF.02']['REF.02.1'].toString(); }catch(err){h20['h20.9']['h20.9.1'] = '';}
            try{h20['h20.10']['h20.10.1'] = claims['claim'][claimsCount]['NM1'][1]['N3']['N3.01']['N3.01.1'].toString(); }catch(err){h20['h20.10']['h20.10.1'] = '';}
            try{h20['h20.11']['h20.11.1'] = claims['claim'][claimsCount]['NM1'][1]['N4']['N4.01']['N4.01.1'].toString(); }catch(err){h20['h20.11']['h20.11.1'] = '';}
            try{h20['h20.11']['h20.11.2'] = claims['claim'][claimsCount]['NM1'][1]['N4']['N4.02']['N4.02.1'].toString(); }catch(err){h20['h20.11']['h20.11.2'] = '';}
            try{h20['h20.11']['h20.11.3'] = claims['claim'][claimsCount]['NM1'][1]['N4']['N4.03']['N4.03.1'].toString(); }catch(err){h20['h20.11']['h20.11.3'] = '';}
            HL7_message.appendChild(h20);

            router.routeMessage("HL7_file_creation", SerializerFactory.getSerializer('HL7V2').fromXML(H L7_message));

            }

            }

            Comment


            • #7
              This will create an XML record for each whole 837 message. For my project I am reading many messages in a file.

              var claims = <claims></claims>;
              var claim = <claim></claim>;
              var first_ISA = msg['ISA'][0].childIndex();

              for(i=first_ISA; i<msg.children().length(); i++){

              if(i!=first_ISA && msg.child(i).name().toString() == "ISA")
              {
              //then you have a new claim
              claims.appendChild(claim);
              claim = <claim></claim>;
              }

              claim.appendChild(msg.child(i));
              }

              claims.appendChild(claim);
              channelMap.put("claims", claims);

              Comment


              • #8
                Hello,

                Has anyone here transformed ANSI X12 837i files 4010 version into 5010 version? That is my objective short term. Longer term I would like to take .CSV billing file and create ANSI 837i 5010 claims from it. I have not seen any postings on this topic specifically, but it sounds like Mirth would be a great tool for this. I am not sure Mirth supports X12 5010, but it may be similar enough to 4010 they are interchangeable. Any references or links would be greatly appreciated. First task is to drop the ANSI 4010 837 using X12 data typing and see if I can get a message tree to publish.
                Thanks
                Last edited by tpkinc; 06-02-2015, 12:08 PM.

                Comment


                • #9
                  Originally posted by tpkinc View Post
                  Hello,

                  First task is to drop the ANSI 4010 837 using X12 data typing and see if I can get a message tree to publish.
                  Thanks
                  Post falling on deaf ears, but here is a update in case some poor soul is in same boat as me. I had little trouble getting off the dime pasting a 4010 837i file in as Import Template leaving Output template blank. I have found Outbound templates to be too literal and more trouble than they are worth. I was able to get a modified 4010 to publish without doing anything fancy. I built a transformer adding extra fields like Country Code, PER email address to select segments, removed phased out segments, etc. Because my files are a predictable with one Pay to Provider Name I was able to subtract the SE segment counter by the number of segments I deleted.

                  A concern I have will be if I need to insert segments like the new Insurance Plan information. I don't have that info in my 4010 source file or CSV. I am using no Database and am just transforming source to destination. I suppose I could preload insurance plan information into an array from a spreadsheet in global template, and call it as a function to create these new segments. That could get tricky for me being new to javascript.

                  This has been fun brainstorming with myself . I am surprise more peeps aren't scrambling like me to find solutions for their legacy customers on 4010. Where is everyone?

                  Comment


                  • #10
                    Ncpdp d.0

                    I am having same issue with 5010 , can some one please help here .

                    Comment


                    • #11
                      I can help you

                      Hi Charan, your question is very short, can u explain ur question i can help you

                      Mirth Interface Engineer
                      AWS DevOps

                      Comment


                      • #12
                        I am looking to go the other way around. I need to put data from a DB into an 837 file. Does anyone have anything they can share that will help my journey?

                        Comment


                        • #13
                          EDI X12 837 file parse

                          I am having the same trouble! Anyone got an example channel they can share?
                          [email protected]
                          617-872-2471

                          Comment

                          Working...
                          X