Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Change characters in Segment

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

  • Change characters in Segment

    I appologize for my ignorance in this area as I am not a programer. I have been tasked to work with Mirth to get some old studies from our RIS integrated into our new PACS system.

    The issue is in the beginning it the data in the RIS was conatined in two different entities. Just sending from the RIS to the PACS there could be duplicate visit numbers. When are changing the initial string in the visit number to reflect the old entity however, I can't figure out how to do that in Mirth.

    The segment is OBR|1|MG20050607-0010|29773GHH|MAM.SCREEN^MAMMOGRAPHY and I have tried to replace the -0 with a -2. Very simple but I can't get the syntax correct. I have looked at a lot of posts as well as other sites for the correct java syntax but all in vain. If you could direct me to an area to search through or send an example I'd be very appreciative.

    I can capture the LLP send to a file and build a watcher the runs a text editor to do this but that is not very clean.

    Thanks, Will

  • #2
    Re:Change characters in Segment

    at the preprocessor:

    message=message.replaceAll("-0","-2");

    return message;

    Comment


    • #3
      Re:Change characters in Segment

      Thank you very much. I had tried that previously and tried again. It seems to just delete the file ( as I instruct it to after reading ) but never shows a received or sent. Currently testing as file reader and file sender. I decided to change the replaceAll with just replace and that seemed to work. I am using ver 1.6.1.2750. The only thing I was nervous about is if the would ever be another -0 so was also trying to figure a way to restict it to that OBR. But this is good. Thanks again, Will

      Comment


      • #4
        Re:Change characters in Segment

        Well, your can try to test a more adjusted regular expression.

        Comment


        • #5
          Re:Change characters in Segment

          You can create a transformer step that does the replacement ONLY on the OBR field. First paste your message into the transformer pane and then create a Javascript step. Navigate the message tree and find the "MG20040607-0010" value. Drag this over to the JS window and now you can work against that field. I imagine the code would look SOMETHING like this:

          Code:
          var obr21 = msg['OBR']['OBR.2']['OBR.2.1'].toString(); //assign the obr21 value to a variable
          obr21 = obr21.replace("-0","-2"«»); //perform replacement on variable
          msg['OBR']['OBR.2']['OBR.2.1'] = obr21; //place the new value back into the message
          Chris Lang

          Comment


          • #6
            Re:Change characters in Segment

            Thank you. With all of this I can build on for this project, as well as understand more of the posts that are in these forums.

            Thanks for all the help. ~W

            Comment


            • #7
              Re:Change characters in Segment

              I'm trying to do something very similar..

              how do you create a javascript step?

              when i create a transformer, I don't see any place where I can enter JavaScript ..

              could somebody please enlighten me?

              --Jason

              Comment


              • #8
                Re:Change characters in Segment

                You can change the tyoe of the transformer by using the combo box displayed in the line wiht the description of the new step

                Comment


                • #9
                  Re:Change characters in Segment

                  You can change the tyoe of the transformer by using the combo box displayed in the line wiht the description of the new step

                  Comment


                  • #10
                    Re:Change characters in Segment

                    Curious, Can you skip the need for variable and go with only 1 line?

                    msg['OBR']['OBR.2']['OBR.2.1'] = msg['OBR']['OBR.2']['OBR.2.1'].replace("-0","-2"); //perform replacement on variable

                    Also, in the case of OBX segments, there may be multiple OBR segments so wouldn't he need a For..Each loop to deal with multiple OBR's per message?
                    Mike Caldwell
                    Alliance HealthCare - GE VAR
                    Rocklin, CA
                    Centricity PM/EMR Support - Developer - Network Engineer

                    Comment


                    • #11
                      Re:Change characters in Segment

                      one last question.. :-)

                      I understand how the Javascript replace function works, but how do I use it as a variable in my destination database writer?
                      I know how to add the un- modified segment, - I just need to know how to use the newly modified segment.

                      Thanks,

                      --Jason

                      Comment


                      • #12
                        Re:Change characters in Segment

                        never mind.. I now see how stupid my question was.. I should either create that step first or move it on up the list.. *heh heh*

                        I would just like to say how great I think Mirth is, its helped me out tremendously in the last couple of weeks.

                        Thank you for a great tool!

                        Comment

                        Working...
                        X