@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...
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
}
}