@Wilber Tang, Thanks to your example, I have resolved my problem.
I was developing in a transformation in Ensemble, and could successfully remove an invalid OBX segment with the line below:
<assign value='' property='target.{PIDgrpgrp(k1).ORCgrp(k2).OBXgrp(k3).OBX}' action='remove' key='k3' />
It is a bit confusing when it comes to ORCgrp for XML Path. I have tried this one and it works well for OBR segment. Probably you can apply the similar path to OBX iteration to get what you want.
...
...
}
}
If you need more references for this XMLPath, try this one which I found the most useful:
https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...
![Open Sesame!](https://community.intersystems.com/sites/default/files/badges/303371180-6de11138-f4e7-4113-b5cc-836269f07693.png)
![1,000 Points](https://community.intersystems.com/sites/default/files/badges/290121674-53216c4b-fe0c-44e7-9d75-2f24390135ed.png)
![Challenge Starter](https://community.intersystems.com/sites/default/files/badges/295959213-b83dd91a-663f-4f07-8e0e-e3287b7c2309.png)
![Popular writer](https://community.intersystems.com/sites/default/files/badges/poular_writer.png)
![DC Commenter](https://community.intersystems.com/sites/default/files/badges/dc_commenter_1.png)
![DC Problem Solver](https://community.intersystems.com/sites/default/files/badges/dc_problem_solver_1.png)
![InterSystems Researcher](https://community.intersystems.com/sites/default/files/badges/researcher.png)
Maybe you can try this Business opertion in Ensemble/HealthShare to a stored procedure in Cache.
BO:
Class User.TestSQLOperation Extends Ens.BusinessOperation
{
Parameter ADAPTER = "EnsLib.SQL.OutboundAdapter";
Property Adapter As EnsLib.SQL.OutboundAdapter;
Parameter INVOCATION = "Queue";
Method OnMessage(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status
{
set tSC = $$$OK
SET sql="{?=call api.SimpleSP(?,?)}"
set tSC=..Adapter.ExecuteProcedure(.rs,.out,sql,"oii",2,"Hello1")
quit tSC
}
XData MessageMap
{
<MapItems>
<MapItem MessageType="Ens.Request">
<Method>OnMessage</Method>
</MapItem>
</MapItems>
}
}
SP:
Class api.TestSQL [ Abstract ]
{
ClassMethod SimpleMethod(Id As %String, Name As %String) As %Status [ SqlName = SimpleSP, SqlProc ]
{
Set ^localData("Test")=$G(Id)_" "_$G(Name)
If $L(Id) {
Set ^localData(Id)=$G(Name)
}
Quit $$$OK
}
}