Mirth Community

Mirth Community (http://www.mirthcorp.com/community/forums/index.php)
-   Support (http://www.mirthcorp.com/community/forums/forumdisplay.php?f=6)
-   -   Mirth 3.4 TCP Listener - Response settings - NCPDP (http://www.mirthcorp.com/community/forums/showthread.php?t=216656)

neoxandres 11-14-2016 09:24 AM

Mirth 3.4 TCP Listener - Response settings - NCPDP
 
Hi!

I'm trying to setup a TCP mirth connection, where a socket client sends a NCPDP message to Mirth, Mirth processes the NCPDP message and responds a XML to the client in the same connection.

This is my configuration:

1. Summary Tab
http://f06315a4c56ba9edc332-efd91e28...ummary_tab.png

2. Source Tab
http://f06315a4c56ba9edc332-efd91e28...source_tab.png

3. Destinations Tab
http://f06315a4c56ba9edc332-efd91e28...ations_tab.png

4. The Client request (NCPDP Message) and response (NULL)
http://f06315a4c56ba9edc332-efd91e28...t_to_mirth.png

5. Mirth LOG Request
http://f06315a4c56ba9edc332-efd91e28...og_request.png

6. Mirth Log Response
http://f06315a4c56ba9edc332-efd91e28...g_response.png

I don't know how to setup Mirth to send me back the XML response to my socket client after Mirth processed the NCPDP. Can you please help me or give any way ?

amble 11-16-2016 12:57 AM

Should just be able to use 'edit response', change your data types and do some mapping?

Step 1: Edit Response
http://i.imgur.com/HEtwjws.jpg

Step 2: Edit data type and map templates
http://i.imgur.com/l4mT5sJ.jpg

narupley 11-16-2016 07:41 AM

You have the response set to Auto-generate, which right now is only implemented for the HL7 v2.x data type. Instead, yes you can use a response transformer to modify the response, create your own custom XML, whatever. Then in the source Response setting choose the destination you want to respond from.

Alternately you could also choose Postprocessor, and then build up a custom response that you return in the postprocessor script.

neoxandres 12-01-2016 12:41 AM

Get the complete processed message string in the Post-processor channel
 
I'm following the Narupley's suggestion

"Alternately you could also choose Postprocessor, and then build up a custom response that you return in the postprocessor script. "


This is the Post-processor screen:
https://c0574af466465e41acba-efd91e2...Connection.png

----------------

Now my custom socket is receiving the post-processor response string
https://c0574af466465e41acba-efd91e2...%20Firefox.png

----------------

Is a way to get the complete processed message string in the Post-processor channel?

1. MyCustomSocket send a NCPDP message to Mirth
2. Mirth receive this NCPDP message and convert it to XML
3. In the post-processor channel I need to return the processed XML string
4. Mirth return this "processed XML string" to my MyCustomSocket as response.

For testing purpose I'm returning a "The processed message string", but I need the complete XML response string instead.

narupley 12-01-2016 08:46 AM

Sure, try doing this:

Code:

return message.getConnectorMessages().get(0).getEncodedData();

neoxandres 12-01-2016 04:01 PM

Thank you!
 
Thanks. It works!


All times are GMT -8. The time now is 04:41 PM.

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