web stats
Message Generator Plugin - Can it create new messages? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2016, 05:49 PM
ChrisYetter-MEDSEEK ChrisYetter-MEDSEEK is offline
What's HL7?
 
Join Date: Feb 2014
Posts: 1
ChrisYetter-MEDSEEK is on a distinguished road
Default 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!
Reply With Quote
  #2  
Old 12-13-2016, 11:58 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 556
kirbykn2 is on a distinguished road
Default

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.
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
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_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #3  
Old 12-14-2016, 05:27 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

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.
Reply With Quote
  #4  
Old 12-14-2016, 06:54 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

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.
Reply With Quote
  #5  
Old 12-14-2016, 06:56 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

Quote:
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.
Reply With Quote
  #6  
Old 12-14-2016, 07:42 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

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!
Reply With Quote
  #7  
Old 12-14-2016, 09:12 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

Quote:
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.
Reply With Quote
  #8  
Old 12-14-2016, 09:19 AM
appsbyaaron's Avatar
appsbyaaron appsbyaaron is offline
Mirth Guru
 
Join Date: Nov 2011
Location: Florida, USA
Posts: 377
appsbyaaron is on a distinguished road
Default

Here is a screenshot of the my last attempt in Java. Just for funzies.
Attached Images
File Type: png example.png (145.2 KB, 19 views)
Reply With Quote
  #9  
Old 12-14-2016, 09:37 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,099
narupley is on a distinguished road
Default

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.
Reply With Quote
  #10  
Old 04-19-2019, 02:28 PM
akathol akathol is offline
Mirth Newb
 
Join Date: Sep 2014
Location: OR, USA
Posts: 10
akathol is on a distinguished road
Default

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 Images
File Type: jpg loaded custom-lib.JPG (146.3 KB, 2 views)
Attached Files
File Type: xml MNX - Create Dummy HL7.xml (10.1 KB, 0 views)
File Type: xml messageGenExp1.xml (67.7 KB, 2 views)
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 12:22 AM.


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