web stats
I want to handle random message types - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-23-2009, 06:55 AM
chronofish chronofish is offline
Mirth Newb
 
Join Date: Mar 2008
Posts: 25
chronofish
Default I want to handle random message types

After sending HL7 records from Mirth to one of our providers, the provider does some basic validation and then sends us a confirmation file. That file IS not XML or any other format that is recognized by Mirth.

It is actually a single line space-separated file, and it resides on an SFTP server.

What I would like to do is read this file, check the date, and send an alert if the date is old (i.e. not today).

The logic and coding I know how to handle.

What I don't know how to handle is getting the message into a channel without the connector complaining about the file type and erroring out.

I've been surprised by Mirth's lack of ability to handle loosely-structured data (space / comma separated) - Thus far this is my only real complaint about the system - I would have thought that "other" (as in no validation) would have been easier for the Mirth programmers to implement than say the XML/HL7/NCPDP/EDI/X12 etc....

What are the common work-a-rounds for this? I don't have control over the data structure or the location. (I suppose I could write a small wrapper outside of Mirth, but I would prefer to keep it all together).

-CF
Reply With Quote
  #2  
Old 02-23-2009, 07:08 AM
quimicefa quimicefa is offline
Mirth Guru
 
Join Date: Dec 2007
Location: Barcelona
Posts: 235
quimicefa is on a distinguished road
Default Re:I want to handle random message types

AFAIK, Mirth 1.8.X can handle CSV datafiles.

You can perform the same by coding a bit in the preprocessor step. i.e, let have a File containing a string. The string has some fields separed by a space char.

Code:
var field_1=message.substring(0,message.toString().indexOf(' '));
var msg = "<?xml version="1.0" encoding="utf-8"?><msg>
<field_1>" + field_1 + "</field_1><field_2></field_2></msg>";
return msg;


So, in the preprocessor you are handling the raw string and forging a XML message. Then, you can define the whole channel to process XML messages.

Hope that helps.
Reply With Quote
  #3  
Old 02-23-2009, 07:44 AM
chronofish chronofish is offline
Mirth Newb
 
Join Date: Mar 2008
Posts: 25
chronofish
Default Re:I want to handle random message types

Thanks for the quick response.

I'm confused by the "preprocessor" - is that new in 1.8? I'm running on 1.7 (Mirth Appliance).

Thanks again,

CF
Reply With Quote
  #4  
Old 02-23-2009, 07:46 AM
quimicefa quimicefa is offline
Mirth Guru
 
Join Date: Dec 2007
Location: Barcelona
Posts: 235
quimicefa is on a distinguished road
Default Re:I want to handle random message types

No, I think that is implemented at least from 1.6.X versions
Reply With Quote
  #5  
Old 02-23-2009, 07:52 AM
chronofish chronofish is offline
Mirth Newb
 
Join Date: Mar 2008
Posts: 25
chronofish
Default Re:I want to handle random message types

How do I get to the pre-processor?

I assume this is different than the Source Transformer. I apologize for my ignorance - but I don't see it reference in the WIKI at all and I've not seen anything in the interface that talks about a Pre-processor.

Thanks again
Reply With Quote
  #6  
Old 02-23-2009, 07:53 AM
chronofish chronofish is offline
Mirth Newb
 
Join Date: Mar 2008
Posts: 25
chronofish
Default Re:I want to handle random message types

Ahh.. Found it...

Wish I had know about this earlier LOL.

Thanks so much!
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
seeming random lockup on file read 1.8. phc Support 3 02-19-2009 01:23 PM
How to Handle Complex Mapping cwesty Support 3 01-08-2009 10:47 AM
creating channels for various types of HL7 message shifting_18 Support 2 05-07-2007 05:29 PM
Can one transformer apply to all message types? jbartels Support 2 04-20-2007 12:57 PM
How to filter and process different message types? tintinn Support 2 09-24-2006 09:51 PM


All times are GMT -8. The time now is 01:24 PM.


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