web stats
HOw to implement Dispatch Pattern based on incoming Message contents (X12 source)? - Page 3 - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #21  
Old 02-20-2014, 10:30 PM
dzilberman dzilberman is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Location: San Francisco, CA
Posts: 71
dzilberman is on a distinguished road
Angry Please explain about syntax for xml parsing with namespaces :)

Hi Eduardo,

Even though the attached modification works for attached incoming (shortened severely) SOAP message using just this code in source transformer

Code:
msg = SerializerFactory.getSerializer('EDI/X12').toXML(msg.*::Body.*::Process837.*::Input837.toString());
logger.info("Converted SOAP XML to X12 message:" + msg.toString());
for some reason source Transformed message shows up as this superlong one:

Quote:
[2014-02-20 23:16:30,490] INFO (transformer:?): Converted SOAP XML to X12 message:<?xml version="1.0" encoding="UTF-8"?><X12Transaction segmentDelimiter="W" elementDelimiter="*" subelementDelimiter="5"><ISA><ISA.01><ISA.01.1>00</ISA.01.1></ISA.01><ISA.02><ISA.02.1> </ISA.02.1></ISA.02><ISA.03><ISA.03.1>00</ISA.03.1></ISA.03><ISA.04><ISA.04.1> </ISA.04.1></ISA.04><ISA.05><ISA.05.1>ABCD1234</ISA.05.1></ISA.05><ISA.06><ISA.06.1></ISA.06.1><ISA.06.2>21301729 </ISA.06.2></ISA.06><ISA.07><ISA.07.1>20</ISA.07.1></ISA.07><ISA.08><ISA.08.1>013</ISA.08.1><ISA.08.2></ISA.08.2></ISA.08></ISA><CH00><CH00.01><CH00.01.1>100126</CH00.01.1></CH00.01><CH00.02><CH00.02.1>1731</CH00.02.1></CH00.02><CH00.03><CH00.03.1>U</CH00.03.1></CH00.03><CH00.04><CH00.04.1>00401</CH00.04.1></CH00.04><CH00.05><CH00.05.1>000000001</CH00.05.1></CH00.05><CH00.06><CH00.06.1>1</CH00.06.1></CH00.06><CH00.07><CH00.07.1>T</CH00.07.1></CH00.07><CH00.08><CH00.08.1>:~GS</CH00.08.1></CH00.08><CH00.09><CH00.09.1>HC</CH00.09.1></CH00.09><CH00.10><CH00.10.1></CH00.10.1><CH00.10.2>213017 29</CH00.10.2></CH00.10><CH00.11><CH00.11.1>013</CH00.11.1><CH00.11.2></CH00.11.2></CH00.11></CH00><CH00><CH00.01><CH00.01.1>20100126</CH00.01.1></CH00.01><CH00.02><CH00.02.1>0</CH00.02.1><CH00.02.2>31</CH00.02.2></CH00.02><CH00.03><CH00.03.1>1001</CH00.03.1></CH00.03><CH00.04><CH00.04.1>X</CH00.04.1></CH00.04><CH00.05><CH00.05.1>004010X097A1~ST</CH00.05.1></CH00.05></CH00></X12Transaction>
Where do other transformed elements come from? And why a very similar code:
Code:
msg = SerializerFactory.getSerializer('EDI/X12').toXML(msg.*::Body.*::Process270.*::Input270.toString());
logger.info('Converted XML message to EDI X12 format:' + msg.toString());
does not work for X12 270 attached message with similar XML structure???

many thanks,
Dan Z
Attached Files
File Type: xml ___Test WS Dispatcher Dan XML Cnverts.xml (27.5 KB, 3 views)
File Type: xml Test_837_Request.xml (545 Bytes, 4 views)
File Type: xml Tesia_270.xml (1.0 KB, 4 views)
Reply With Quote
  #22  
Old 02-21-2014, 06:39 AM
eduardoa eduardoa is offline
Mirth Employee
 
Join Date: Mar 2013
Location: Santa Fe Springs, California
Posts: 134
eduardoa is on a distinguished road
Default

Hi Dan,

I think the transformed message looks okay. I believe it fills in the blanks so you might see a lot of elements you didn't actually have in your message but were in between one that was filled out.

I just tried your code for the 270 message and that worked for me. I also tried it using your channel, what error are you seeing?
Reply With Quote
  #23  
Old 02-21-2014, 10:23 AM
dzilberman dzilberman is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Location: San Francisco, CA
Posts: 71
dzilberman is on a distinguished road
Default

Quote:
Originally Posted by eduardoa View Post
Hi Dan,

I think the transformed message looks okay. I believe it fills in the blanks so you might see a lot of elements you didn't actually have in your message but were in between one that was filled out.

I just tried your code for the 270 message and that worked for me. I also tried it using your channel, what error are you seeing?
Hi Eduardo,

With your explanation about all those "extra" elements that I see in the Transformed message (both for 837 and 270 actual format) I actually think that the Transformer code for SOAP XML ==> X12 formatted message works as:

Code:
msg = SerializerFactory.getSerializer('EDI/X12').toXML(msg.*::Body.*::Process270.*::Input270.toString());
The confusing part for me (among other Mirth hidden tricks was that we actually convert SOAP XML message - from XML to X12 format - but the function is .toXML(msg.*::...). But now it seems to work.

Would you please answer my question about ports for Web Service channel readers to listen on - can different channels listen on the same port (like 8088 etc) or every service has to be on a different one? Opening up ports in AWS environment where I have mirth deployed is tricky.

thanks again,
Dan Z
Reply With Quote
  #24  
Old 02-21-2014, 10:26 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 dzilberman View Post
Would you please answer my question about ports for Web Service channel readers to listen on - can different channels listen on the same port (like 8088 etc) or every service has to be on a different one? Opening up ports in AWS environment where I have mirth deployed is tricky.
Currently no, but that's on our roadmap: MIRTH-1624. You can certainly still simulate that though by using an HTTP Listener with some custom logic to determine what response to send back.
__________________
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.

Last edited by narupley; 04-07-2014 at 02:08 PM.
Reply With Quote
  #25  
Old 04-07-2014, 02:08 PM
dzilberman dzilberman is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Location: San Francisco, CA
Posts: 71
dzilberman is on a distinguished road
Exclamation How to properly format Data Input for Web Service reader input?

Hi folks,

An important follow-up question now that I got to deployment of my channels (in 3.0.1 for external Access (port forwarding from https://<long host name>:8088/TestEligibilityDispatcher?wsdl ==> https://dev.jakaricare.com/services/...ispatcher?wsdl)

When I test the channel form the Mirth client and pass in well formed SOAP message envelop w/o stripping namespaces like this:

Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:real="https://www.realtimeclaims.com/">
   <soap:Header/>
   <soap:Body>
      <real:Process270>
         <!--Optional:-->
         <real:Input270>
         ISA*00*          *00*          *12*ABCCOM         *01*999999999      *120117*1719*U*00400*000006768*0*P*>
		GS*HS*4405197800*999999999*20120117*1719*1421*X*004010VICS
		ST*270*1234
		BHT*0022*13*1*20010820*1330
		HL*1**20*1
		NM1*PR*2******PI*123456789
		HL*2*1*21*1
		NM1*1P*2******SV*987654321
		HL*3*2*22*0
		NM1*IL*1*DOE*JANE****MI*345678901
		EQ*30**FAM
		SE*10*1234
		GE*1*1421
		IEA*1*000006768
         </real:Input270>
       .......
      </real:Process270>
   </soap:Body>
</soap:Envelope>
my source coverts XML ==> X12 and works as expected.
However, when I pass the fragment above via "external" SOAP call generated by soapUI tool envelope:

Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.connectors.connect.mirth.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:acceptMessage>
         <!--Optional:-->
         <arg0>
          ISA*00*          *00*          *12*DEFCOM         *01*999999999      *120117*1719*U*00400*000006768*0*P*>
		GS*HS*4405197800*999999999*20120117*1719*1421*X*004010VICS
		ST*270*1234
		BHT*0022*13*1*20010820*1330
		HL*1**20*1
		NM1*PR*2******PI*123456789
		HL*2*1*21*1
		NM1*1P*2******SV*987654321
		HL*3*2*22*0
		NM1*IL*1*DOE*JANE****MI*345678901
		EQ*30**FAM
		SE*10*1234
		GE*1*1421
		IEA*1*000006768
         </arg0>
      </ws:acceptMessage>
   </soapenv:Body>
</soapenv:Envelope>
- I am getting "empty" response and the channel dashboard shows a parsing error.
Can someone please summarize how <arg0> data needs to be passed in if XML formatting is expected in general and SOAP envelope in particular? Also, if I dispatch the workflow to one of 3 channels, how can I specify a Response - I am seeing only option to select one Destination..

thanks!
Dan Z.
Attached Files
File Type: xml Tesia_270.xml (1.0 KB, 1 views)
File Type: xml Test Write Eligibility Works with Filter.xml (42.4 KB, 6 views)
Reply With Quote
  #26  
Old 04-08-2014, 12:59 PM
dzilberman dzilberman is offline
OBX.2 Kenobi
 
Join Date: Sep 2013
Location: San Francisco, CA
Posts: 71
dzilberman is on a distinguished road
Question Please summarize best practices for passing XML formatted input data via <arg0>...


Hi folks,

An important follow-up question now that I got to deployment of my channels in AWS and exposing WebServices to outside world (Mirth 3.0.1) by forwarding from https://<long host name>:8088/TestEligibilityDispatcher?wsdl ==> https://dev.jakaricare.com/services/...ispatcher?wsdl)

When I test the channel form the Mirth client and pass in well formed SOAP message envelop w/o stripping namespaces like this:

Code:
<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:real="https://www.realtimeclaims.com/">
   <soap:Header/>
   <soap:Body>
      <real:Process270>
         <!--Optional:-->
         <real:Input270>
         ISA*00*          *00*          *12*ABCCOM         *01*999999999      *120117*1719*U*00400*000006768*0*P*>
		GS*HS*4405197800*999999999*20120117*1719*1421*X*004010VICS
		ST*270*1234
		BHT*0022*13*1*20010820*1330
		HL*1**20*1
		NM1*PR*2******PI*123456789
		HL*2*1*21*1
		NM1*1P*2******SV*987654321
		HL*3*2*22*0
		NM1*IL*1*DOE*JANE****MI*345678901
		EQ*30**FAM
		SE*10*1234
		GE*1*1421
		IEA*1*000006768
         </real:Input270>
       .......
      </real:Process270>
   </soap:Body>
</soap:Envelope>
my source coverts XML (not stripped namespaces) ==> X12 and works as expected.
However, when I pass the same X12 fragment above via "external" SOAP call generated by soapUI tool envelope:

Code:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.connectors.connect.mirth.com/">
   <soapenv:Header/>
   <soapenv:Body>
      <ws:acceptMessage>
         <!--Optional:-->
         <arg0>
          ISA*00*          *00*          *12*DEFCOM         *01*999999999      *120117*1719*U*00400*000006768*0*P*>
		GS*HS*4405197800*999999999*20120117*1719*1421*X*004010VICS
		ST*270*1234
		BHT*0022*13*1*20010820*1330
		HL*1**20*1
		NM1*PR*2******PI*123456789
		HL*2*1*21*1
		NM1*1P*2******SV*987654321
		HL*3*2*22*0
		NM1*IL*1*DOE*JANE****MI*345678901
		EQ*30**FAM
		SE*10*1234
		GE*1*1421
		IEA*1*000006768
         </arg0>
      </ws:acceptMessage>
   </soapenv:Body>
</soapenv:Envelope>
- I am getting "empty" response and the channel dashboard shows a parsing error. I understand that I don't have the <real:Process270> and <real:Input270> XML nodes. Does it mean I have to add them "inside" the <arg0>...</arg0> argument node?

Can someone please summarize how <arg0> data needs to be passed in if specific XML formatting (with namespaces!) is expected in general and SOAP envelope in particular? Also, if I dispatch the workflow to one of 3 channels, how can I specify a Response - I am seeing only option to select one Destination..

thanks!
Dan Z.
Attached Files
File Type: xml Test Eligibility Dispatcher Backup.xml (28.5 KB, 5 views)
File Type: xml Tesia_270.xml (1.0 KB, 12 views)
Reply With Quote
Reply

Tags
dispatch pattern, x12

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 08:07 AM.


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