<foreach> Multiple OBX Segments

40 views
Skip to first unread message

JamesG

unread,
May 10, 2012, 8:33:40 AM5/10/12
to Ensemble-in...@googlegroups.com
Hi,

I am trying to use sub-transformation (OBX) in ORM^O01 message transformation. <Foreach> does not seems to be working. Here is the code from DTL. Any inputs are much appreciated. 

<foreach property='source.{ORCgrp(1).OBRgrp.OBXgrp(1).OBX}' key='k1'>
<subtransform class='GH.LabORMSubTransformOBX' targetObj='target.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}' sourceObj='source.{ORCgrp(1).OBRgrp.OBXgrp(1).OBX(k1)}'/>
</foreach>

Thanks, 
James

David Blake

unread,
May 10, 2012, 8:51:50 AM5/10/12
to ensemble-in...@googlegroups.com

Hi James

 

The structure of your source segment path is not correct for an ORM^O01. It looks good for your target.

 

If the source is an ORM^O01 I think it should look like this…

 

<foreach property='source.{ORCgrp(1).OBRuniongrp.OBX()}' key='k1'>

<subtransform class='GH.LabORMSubTransformOBX' targetObj='target.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}' sourceObj='source.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}'/>

</foreach>

 

Perhaps I’m missing something though.

 

Note that this will only look at the first ORCgrp. If you want everything then you will need to nest you foreach inside an ORCgrp foreach.

 

Regards

 

Dave

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/Ensemble-in-Healthcare?hl=en

JamesG

unread,
May 15, 2012, 12:07:01 PM5/15/12
to Ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Hi Dave,

Thanks for your response. Actually my message structures are different for source and target.

source .{ORCgrp(1).OBRgrp.OBXgrp.OBX()} and  target.{OBX()}

I would like to use sub-transformation(OBX) on each of OBX segment.  Please guide me in using the correct <foreach> code.

Regards,

James



On Thursday, 10 May 2012 13:51:50 UTC+1, ISC Dave wrote:

Hi James

 

The structure of your source segment path is not correct for an ORM^O01. It looks good for your target.

 

If the source is an ORM^O01 I think it should look like this…

 

<foreach property='source.{ORCgrp(1).OBRuniongrp.OBX()}' key='k1'>

<subtransform class='GH.LabORMSubTransformOBX' targetObj='target.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}' sourceObj='source.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}'/>

</foreach>

 

Perhaps I’m missing something though.

 

Note that this will only look at the first ORCgrp. If you want everything then you will need to nest you foreach inside an ORCgrp foreach.

 

Regards

 

Dave

 

From: ensemble-in-healthcare@googlegroups.com [mailto:ensemble-in-healt...@googlegroups.com] On Behalf Of JamesG
Sent: 10 May 2012 13:34
To: Ensemble-in-Healthcare@googlegroups.com
Subject: [InterSystems-EnsHlth] <foreach> Multiple OBX Segments

 

Hi,

 

I am trying to use sub-transformation (OBX) in ORM^O01 message transformation. <Foreach> does not seems to be working. Here is the code from DTL. Any inputs are much appreciated. 

 

<foreach property='source.{ORCgrp(1).OBRgrp.OBXgrp(1).OBX}' key='k1'>

<subtransform class='GH.LabORMSubTransformOBX' targetObj='target.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}' sourceObj='source.{ORCgrp(1).OBRgrp.OBXgrp(1).OBX(k1)}'/>

</foreach>

 

Thanks, 

James

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.

To post to this group, send email to Ensemble-in-Healthcare@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsub...@googlegroups.com

Gary Fail

unread,
May 15, 2012, 12:24:23 PM5/15/12
to ensemble-in...@googlegroups.com

Is it not the fact that it needs to repeat at the obx group level and not the obx segment itself?

To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com

JamesG

unread,
May 15, 2012, 12:32:33 PM5/15/12
to Ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Hi Gary,

I understand that key has to be defined at OBXGroup but when I select OBXGroup and select for each, I see the attached message..

Regards,

James

To unsubscribe from this group, send email to Ensemble-in-Healthcare-unsubscri...@googlegroups.com

Marc Lang

unread,
May 15, 2012, 12:37:16 PM5/15/12
to ensemble-in...@googlegroups.com
The OBXgrp doesnt appear to be a repeating (collection) property - a collection is indicated by it having brackets.
Apply the foreach to the "OBX" beneath it instead

To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com

Gary Fail

unread,
May 15, 2012, 12:40:19 PM5/15/12
to ensemble-in...@googlegroups.com

Ok unfortunately I am not at work at the moment otherwise I would have looked at our code as we have done this many times. I would try testing by creating a variable and increment that in the loop and output it somewhere in your msh for example then you van tell if your looping is working, if that count is fine then it will be an issue with your source or Target or the actual subtransform

To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com

David Blake

unread,
May 15, 2012, 12:57:53 PM5/15/12
to ensemble-in...@googlegroups.com

Hi James

 

Open a WRC issue for this. It will only take a few minutes to solve if all the information is present, source, target etc.

 

Best regards

 

Dave

 

From: ensemble-in...@googlegroups.com [mailto:ensemble-in...@googlegroups.com] On Behalf Of JamesG
Sent: 15 May 2012 17:07
To: Ensemble-in...@googlegroups.com
Cc: ensemble-in...@googlegroups.com
Subject: Re: [InterSystems-EnsHlth] <foreach> Multiple OBX Segments

 

Hi Dave,

 

Thanks for your response. Actually my message structures are different for source and target.

 

source .{ORCgrp(1).OBRgrp.OBXgrp.OBX()} and  target.{OBX()}

I would like to use sub-transformation(OBX) on each of OBX segment.  Please guide me in using the correct <foreach> code.

Regards,

James

 


On Thursday, 10 May 2012 13:51:50 UTC+1, ISC Dave wrote:

Hi James

 

The structure of your source segment path is not correct for an ORM^O01. It looks good for your target.

 

If the source is an ORM^O01 I think it should look like this…

 

<foreach property='source.{ORCgrp(1).OBRuniongrp.OBX()}' key='k1'>

<subtransform class='GH.LabORMSubTransformOBX' targetObj='target.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}' sourceObj='source.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}'/>

</foreach>

 

Perhaps I’m missing something though.

 

Note that this will only look at the first ORCgrp. If you want everything then you will need to nest you foreach inside an ORCgrp foreach.

 

Regards

 

Dave

 

From: ensemble-in...@googlegroups.com [mailto:ensemble-in...@googlegroups.com] On Behalf Of JamesG
Sent: 10 May 2012 13:34
To: Ensemble-in...@googlegroups.com
Subject: [InterSystems-EnsHlth] <foreach> Multiple OBX Segments

 

Hi,

 

I am trying to use sub-transformation (OBX) in ORM^O01 message transformation. <Foreach> does not seems to be working. Here is the code from DTL. Any inputs are much appreciated. 

 

<foreach property='source.{ORCgrp(1).OBRgrp.OBXgrp(1).OBX}' key='k1'>

<subtransform class='GH.LabORMSubTransformOBX' targetObj='target.{ORCgrp(1).OBRuniongrp.OBXgrp(1).OBX(k1)}' sourceObj='source.{ORCgrp(1).OBRgrp.OBXgrp(1).OBX(k1)}'/>

</foreach>

 

Thanks, 

James

--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.

To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com

--

You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.

To post to this group, send email to Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to Ensemble-in-Healt...@googlegroups.com

JamesG

unread,
May 16, 2012, 9:51:36 AM5/16/12
to Ensemble-in...@googlegroups.com, ensemble-in...@googlegroups.com
Hi Marc,

Thanks for your response. As highlighted by you, I used for each on OBX and got the code following code working 

<foreach property='source.{ORCgrp(k1).OBRgrp.OBXgrp.OBX()}' key='k2'>
<subtransform sourceObj='source.{ORCgrp(k1).OBRgrp.OBXgrp.OBX(k2)}' targetObj='target.{OBX(k2)}' class='GH.CToLabORMSubTransformOBX'/>
</foreach>


Regards,
James
Reply all
Reply to author
Forward
0 new messages