Author |
Message
|
wraymore |
Posted: Mon Mar 23, 2009 10:57 am Post subject: Mapping TDS to MRM-XML -- Resolved |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
WMB v6.0.0.8
I am utilizing the mapping node to map from a TDS source layout to a XML target layout. The target layout contains a one or more O segments with one or more R segments within each order. The TDS source has at least one O segment with 0 or more T segments per O segment. The only occurrence of 0 R segments is when the action code within the O segment has a value of "C". However I need to supply at least one result segment in the output.
Sample Order with Tests
O|234567^Name|N|||
R|001234^TName|||||
R|005678^TName|||||
MRM-XML
<orders>
<order>
<ordercode>234567</ordercode>
<actioncode>N</actioncode>
<results>
<result>
<code>001234</code>
<result>
<code>005678</code>
</result>
</results>
</order>
</orders>
Sample Cancel Order
O|234567^Name|C|||
expected MRM-XML
<orders>
<order>
<ordercode>234567></ordercode>
<actioncode>C</actioncode>
<results>
<result>
<code> </code>
</result>
</results>
</order>
</orders>
Can I utilize the mapping node to achieve the expected outcome for a cancelled order or will I need to add the empty result in a compute node?
Last edited by wraymore on Mon Mar 30, 2009 6:49 am; edited 3 times in total |
|
Back to top |
|
 |
MQEnthu |
Posted: Mon Mar 23, 2009 9:33 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
wraymore wrote: |
Can I utilize the mapping node to achieve the expected outcome for a cancelled order or will I need to add the empty result in a compute node? |
Yes, you can get the desired output...You can create the empty xml elements using mapping functions.
http://publib.boulder.ibm.com/infocenter/wmbhelp/v6r1m0/topic/com.ibm.etools.mft.doc/ar25650_.htm  _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
wraymore |
Posted: Tue Mar 24, 2009 1:17 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
Thanks for your reply. Could not quite figure out how to get the expected outcome. So I added a compute node after the mapping node that copied the entire message to output. Then Declared a Reference to variable at the point I needed to add the additional elements. Got the Cardinality of the element level order. Entered a While DO loop. Checked the order action code for 'C' if true, added the empty elements required by the xsd. incremented the index and exited when required. Send the message to a RCD node. to get the correct format. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Mar 24, 2009 9:46 pm Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Nice wheel you've invented there.
But if it rolls, use it!  _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
wraymore |
Posted: Fri Mar 27, 2009 11:36 am Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
I guess I overloaded the amount I could put in a posting. I tried to put the mxsd files in for the MRM TDS wired input and the MRM XML wired output.
When I ran this scenario:
H| ... |
P| ... |
...
O|234567^Name|N|||
R|001234^TName|||||
R|005678^TName|||||
O|890123^OName2|N|||
R|002345^TName3|||||
I was hoping to get this:
Code: |
<patient>....
<orders>
<order>
<ordercode>234567</ordercode>
<actioncode>N</actioncode>
<results>
<result>001234</result>
<result>005678</result>
</results>
</order>
<order>
<ordercode>234567</ordercode>
<actioncode>N</actioncode>
<results>
<result>002345</result>
</results>
</order>
</orders>
</patient>
|
However I got:
Code: |
<patient> ...
<orders>
<order>
<ordercode>234567</ordercode>
<actioncode>N</actioncode>
<results>
<result>001234</result>
<result>005678</result>
<result>002345</result>
</results>
</order>
<order>
<ordercode>234567</ordercode>
<actioncode>N</actioncode>
<results>
<result>001234</result>
<result>005678</result>
<result>002345</result>
</results>
</order>
</orders>
</patients>
|
What should the settings for the order (O) segments and result (R) segments be in both the TDS wire and the XML wire?
They are separate message sets because the output contains only a small extracting from the input.
I have tried setting the Top parent Complex Type to Composition sequence or unorderedSet with no effect.
I have tried adding Local groups at the Order and Result level and that just resulted in either one order without a result or one order with a result after mapping from the input to the output via a mapping node.
From Input mxsd
Code: |
HL7
H Min Occurs 1 Max Occurs 1
P Min Occurs 1 Max Occurs 1
...
O Min Occurs 1 Max Occurs -1
R Min Occurs 0 Max Occurs -1
...
|
From Output mxsd
Code: |
Message
type value 'O'
Patient Occurs 1 Max Occurs 1
....
Orders
Order Occurs 1 Max Occurs -1
Results
Result Min Occurs 0 Max Occurs -1
|
I hope this helps
Last edited by wraymore on Fri Mar 27, 2009 1:38 pm; edited 1 time in total |
|
Back to top |
|
 |
kimbert |
Posted: Fri Mar 27, 2009 12:30 pm Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Quote: |
I tried to put the mxsd files in for the MRM TDS wired input and the MRM XML wired output |
Please don't. What did you expect me to do with it? Pasting entire mxsd files wastes everybody else's time.
Instead, please describe your approach. In this case, I need to know the logical structure of the elements in your mxsd.
I could work it out by
- copying and pasting your 'expected' XML into my text editor
- running the XML beautifier tool
...but I don't see why I should have to. Please edit your post, and put [code] tags around the XML which you posted. It just makes life easier for the people who are providing the help. |
|
Back to top |
|
 |
wraymore |
Posted: Fri Mar 27, 2009 1:40 pm Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
I cleaned up my previous post. Hope this information helps, if not I can give it another try. |
|
Back to top |
|
 |
kimbert |
Posted: Sat Mar 28, 2009 4:09 am Post subject: |
|
|
 Jedi Council
Joined: 29 Jul 2003 Posts: 5542 Location: Southampton
|
Thanks - much nicer..
Your problem is not with the settings. The logical structure of your input message definition is wrong. I suggest the following approach:
- Forget about your output XML, and concentrate on getting the correct message tree from the input node. Best way to do that is to disconnect the debugger and put a Trace node after the input node
- Modify the logical structure and settings of your input message definition until you get the correct message tree. Take a User Trace to debug any problems with the parsing.
- Now write your mapping logic. Your output message definition looks OK, so this should go smoothly. |
|
Back to top |
|
 |
wraymore |
Posted: Mon Mar 30, 2009 6:46 am Post subject: |
|
|
Centurion
Joined: 16 Aug 2005 Posts: 114 Location: Burlington, NC USA
|
Thank You to kimbert for your help. Also thanks to chids for the TDS tutorial. With your help and a little uninterrupted time (4 hours Saturday), resolved the issues that I was encountering. The key was adding a Complex Type for the Orders/Results.
Input Message:
Code: |
H| ... |
P| ... |
...
O|234567^Name|N|||
R|001234^TName|||||
R|005678^TName|||||
O|890123^OName2|N|||
R|002345^TName3|||||
|
Corrected input message set:
Code: |
HL7
H Min Occurs 1 Max Occurs 1
P Min Occurs 1 Max Occurs 1
...
OrdersResults Min Occurs 1 Max Occurs -1
O Min Occurs 1 Max Occurs 1
R Min Occurs 0 Max Occurs -1
...
OrdersResults Type Definition
Data Element Separation: Tagged Delimited
Delimiter: <CR><LF>
|
When I finally understood what I was reading in the TDS tutorial and really looked at the example screen shots, things fell into place.
with a little for not digging a little deeper to begin with!! |
|
Back to top |
|
 |
|