Announcement

Collapse
No announcement yet.

Message Generator Plugin - Can it create new messages?

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

  • Message Generator Plugin - Can it create new messages?

    I work for a company that has a paid Mirth Connect license.

    I've installed the Message Generator plugin and it's working properly, but I'm unable to get it to create new HL7 v2 messages.

    I went back and watched the Mirth Dev Q&A for when the plugin was released, but it doesn't seem like the plugin was designed to do what I'd like it to do.

    Before I move on to another solution, am I missing something? Is there a way to create a channel that uses this plugin to create new HL7 v2 messages that can be sent outbound via TCP/IP MLLP to a downstream system to populate it with sample data?

    Thanks!

  • #2
    Not that I am aware of, but this sounds like a great feature request!

    As you probably are aware, you could use the plugin to generate the message, copy the message, and then paste it into the appropriate channel. You could also generate a bunch of different message types, and save them to a flat file and send it from there at a later time.
    Best,

    Kirby

    Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

    Appliance Version 3.11.4
    Mirth Connect Version 3.8.0
    Java Version 1.6.0_45-b06
    Java (64 bit) Version 1.6.0_45-b06
    Java 7 (64 bit) Version 1.7.0_151-b15
    Java 8 (64 bit) Version 1.8.0_181-b13
    PostgreSQL Version 9.6.8

    Comment


    • #3
      I've looked for years to try and find a bulk HL7 message generator for testing. I can't find one. I actually started writing my own software a couple of times to do it but it's daunting and I don't have the time to finish the project.

      If anyone knows of something that works it would be really helpful!!

      PS: I made one for vaccine HL7 messages a couple years ago but it was never circulated outside of the environment I was in at the time. To create something to generate ANY HL7 message with all it's variations is completely overwhelming to me.

      Comment


      • #4
        Indeed, we do have that on our roadmap!

        In the meantime, you can technically do it in a JavaScript Reader. The generator unfortunately isn't yet built/refactored for dynamic classloaders, so you'll have to do a sort of workaround.

        Take everything from extensions/generator/lib and place it inside your custom-lib folder (optionally inside a subfolder like custom-lib/gen-lib if you wish for organization purposes). Then also put client-lib/swingx-core-1.6.2.jar in there.

        Next, you need to include those libraries on the overall server classpath, so edit mirth.properties, set "server.includecustomlib" to true, and restart MC.

        Then you'll want to launch the Administrator again, and open up the generator dialog. Set whatever properties you want:



        You can customize how many fields/components/subcomponents to include and what to generate for them to a great detail, even supply regular expressions for them:



        Once your done, hit Export and save the XML file somewhere. Put it somewhere on the server running MC so that a channel can access it.

        Then in a JavaScript Reader you can do this:

        Code:
        var generator = $gc('generator');
        if (generator == null) {
        	var xstream = new com.thoughtworks.xstream.XStream();
        	var properties = xstream.fromXML(FileUtil.read('/path/to/properties.xml'));
        	generator = new com.mirth.generator.model.Generator();
        	generator.setGeneratorProperties(properties);
        	$gc('generator', generator);
        }
        
        generator.generate(generator.getGeneratorProperties().getSelectedDataType());
        var list = new java.util.ArrayList();
        while (generator.hasNext()) {
        	list.add(generator.next());
        }
        
        return list;
        And there you go! Now your channel will automatically generate random fake messages to your generator specifications:

        Code:
        MSH|^~\&|||||19380702222617||ADT^A04|MSG0000000006|P|2.5
        EVN|A04|19400318171515||U
        PID|1||949107234~949107234||ORTIS^GEORGE^R|HUTCHINSON^JAMES^Q||A|GADDIS^VIOLET^N|||||||||822778712
        PV1|1|C||U||||||||||||||||||||||||xx
        PR1|1||||19330318220223||+28.
        IN1|1||xxTESTxx|||MERLETTE^ERIC^Y||||||||||MONDRAGON^ANTONIO^Z~SMUIN^ANDREW^Q||||||||||||||||xx||-||||||||||||||||||xxTESTxx
        
        MSH|^~\&|||||19810102141835||ADT^A04|MSG0000000007|P|2.5
        EVN|A04|19810512224407||||19890604234531
        PID|1||276922612||WEISSBERG^RICHARD^V|MCCUAN^LOYD^D~DOKER^ASHLEY^D||M|SOHNS^STEPHEN^L
        PV1|1|C|||||||||||||||||||||||19550414||||||||||19050401||||||xx
        PR1|1||||19481007234542|||||||||2
        IN1|1||xxTESTxx|||BRULE^LISA^N||||||||||OLEA^MICHAEL^D||||Y|||||||||||||||||||.0
        
        MSH|^~\&|||||19940513212643||ADT^A04|MSG0000000008|P|2.5
        EVN|A04|19441105134222
        PID|1||674106993||ROCHESTER^PATRICIA^C|NOCKET^RONALD^V~EDDY^ROBERT^W||U|SLONAKER^VICTORIA^D||||||||||488-75-0000||||||||||||||19360412153338
        PV1|1|C||||||||||xx||||||||xxTESTxx|||xx
        PR1|1||||19460529221236
        IN1|1||xxTESTxx|||RODRIGUEZ^SARAH^T||||||||||SCHULTHEIS^NELLIE^V~WILLILAMS^SYDNEY^F||||N
        
        ...
        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
          Originally posted by appsbyaaron View Post
          I've looked for years to try and find a bulk HL7 message generator for testing. I can't find one. I actually started writing my own software a couple of times to do it but it's daunting and I don't have the time to finish the project.

          If anyone knows of something that works it would be really helpful!!

          PS: I made one for vaccine HL7 messages a couple years ago but it was never circulated outside of the environment I was in at the time. To create something to generate ANY HL7 message with all it's variations is completely overwhelming to me.
          It is indeed overwhelming and quite complicated. We have such a solution available as a commercial extension in case you weren't aware:

          https://www.nextgen.com/Interoperabi...sage-generator
          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


          • #6
            I did a project once which would generate random ADT A04s, with MSH,PID,PV1,NK1, GT1 and IN1 segment. Completely different from one another.

            If you want to simulate such a thing you need few static arrays, size 10 for good effect like first Name, last name, street1,street2,city,Provider last name, first name etc.

            Then, you need Math.random() method that you can run over the indexes of each of these arrays and substitute in an HL7 message. For other thing like MRN, Policy ID, Date Of Birth you can generate randomly.

            Hope it helps!
            HL7v2.7 Certified Control Specialist!

            Comment


            • #7
              Originally posted by narupley View Post
              It is indeed overwhelming and quite complicated. We have such a solution available as a commercial extension in case you weren't aware:

              https://www.nextgen.com/Interoperabi...sage-generator
              Yes. I use this for creating template messages for quick drag and drop in my transformers. But with it you can't generate a file with 1999 unique messages. Or act as a server and send 1999 messages into mirth. But the plugin does work beautifully.

              Comment


              • #8
                Here is a screenshot of the my last attempt in Java. Just for funzies.
                Attached Files

                Comment


                • #9
                  FYI the generator actually does have the ability to generate X amount of unique messages and spit them out to disk somewhere, but right now those options aren't enabled in the UI. Technically speaking they can be set manually in the properties XML. But anyway these are definitely things that we want to improve and are on our roadmap.
                  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


                  • #10
                    Hi Nick, I know this is an old, old thread, but I was attempting to set this up on our instance as it would be very helpful.

                    Attached is the channel (3.7.1) that I'm using. I can see the getSelectedDataType(), but I'm getting an error when the generator.generate() method runs.

                    catch error output:
                    Code:
                    JavaException: org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: com.mirth.generator.model.GeneratorProperties
                    I followed the steps to add the generator to a custom-lib folder as well as the swingx jar (which I pulled from mirth connect fisheye since I didn't know where it lived on our appliance).

                    I'm not sure how the class cannot be found when I can specifically run the methods to get the getSelectedDataType from it, but not the generate method using it.

                    Alternatively, is there news of if this action is possible using an alternative method (you mentioned it was on the roadmap to update the message generator to allow this type of functionality).
                    Attached Files

                    Comment


                    • #11
                      Hi Akathol,

                      Did you get any success with generating multiple messages?
                      Secondly where does the messageGenExp1.xml reside? it seems that there is a property numberToGenerate that can be set which would provide x number of messages that could be sent from a folder to a channel.

                      Comment


                      • #12
                        Originally posted by akathol View Post
                        Hi Nick, I know this is an old, old thread, but I was attempting to set this up on our instance as it would be very helpful.

                        Attached is the channel (3.7.1) that I'm using. I can see the getSelectedDataType(), but I'm getting an error when the generator.generate() method runs.

                        catch error output:
                        Code:
                        JavaException: org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: com.mirth.generator.model.GeneratorProperties
                        I followed the steps to add the generator to a custom-lib folder as well as the swingx jar (which I pulled from mirth connect fisheye since I didn't know where it lived on our appliance).

                        I'm not sure how the class cannot be found when I can specifically run the methods to get the getSelectedDataType from it, but not the generate method using it.

                        Alternatively, is there news of if this action is possible using an alternative method (you mentioned it was on the roadmap to update the message generator to allow this type of functionality).
                        Hi Akathol,

                        I am getting the same java.lang.ClassNotFoundException error.
                        Did you find any solution for the issue?
                        If yes, Could you please provide us the same.

                        Comment


                        • #13
                          hi Nick,

                          After implementing all above step i'm getting same error
                          org.apache.commons.lang.SerializationException: java.lang.ClassNotFoundException: com.mirth.generator.model.GeneratorProperties
                          It seems to me generator.generate method is not exists anymore.

                          generator.generate(generator.getGeneratorPropertie s().getSelectedDataType());

                          Please advice.

                          Mirth version : 3.5.1
                          Last edited by surveshital; 04-06-2020, 04:04 PM.

                          Comment

                          Working...
                          X