As Luis has stated, this doesn't allow you to make direct changes to the message. However, you can use this to set a variable that can then be referenced within a transformation. The Property variable can only be "RuleActionUserData"
To use this in an action:
And then within the DTL, you can reference "aux.RuleActionUserData":
Gotcha. So creating a new transform for every ADT type going to each vendor is what I was trying to avoid if I only need to update one HL7 field... seems clunky.
Or you could write a custom Business Process to do it. Here's an example with inadequate error processing (😉) that should give you some ideas:
/// Business Process to Modify the MSH:7 fieldClass HICG.Sample.SetMSHDate Extends Ens.BusinessProcess [ ClassType = persistent ]
{
/// Downstream processes or operations to send messages toProperty TargetConfigNames As%String(MAXLEN = 1000);Parameter SETTINGS = "TargetConfigNames:Basic:selector?multiSelect=1&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}";/// Clone, modify and send the message downstream
Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As%Status
{
Set tClone = pRequest.%ConstructClone()
Set tCurDtTm = ##class(Ens.Rule.FunctionSet).CurrentDateTime("%Y%m%d%H%M%S")
Do tClone.SetValueAt(tCurDtTm,"MSH:7")
Do tClone.%Save()
For i=1:1:$LENGTH(..TargetConfigNames,",")
{
Set tSC = ..SendRequestAsync($PIECE(..TargetConfigNames,",",i),tClone,0)
Return:$$$ISERR(tSC) tSC
}
Return$$$OK
}
/// Return an array of connections for drawing lines on the config diagramClassMethod OnGetConnections(Output pArray As%String, pItem As Ens.Config.Item)
{
Do##super(.pArray,pItem)
If pItem.GetModifiedSetting("TargetConfigNames",.tValue) {
For i=1:1:$LENGTH(tValue,",") { Set tOne=$ZSTRIP($P(tValue,",",i),"<>W") Continue:""=tOne Set pArray(tOne)="" }
}
}
}
ObjectScript
ObjectScript
The reason you need to clone the inbound message is that Start-of-Session messages are immutable. You must clone them, modify the clone and send it.
Description of assign action from the official documentation:
https://docs.intersystems.com/irisforhealthlatest/csp/docbook/DocBook.UI...
This means that assign only works in the context of a business process, you can't modify the original message received.
Hi David.
As Luis has stated, this doesn't allow you to make direct changes to the message. However, you can use this to set a variable that can then be referenced within a transformation. The Property variable can only be "RuleActionUserData"
To use this in an action:
And then within the DTL, you can reference "aux.RuleActionUserData":
Gotcha. So creating a new transform for every ADT type going to each vendor is what I was trying to avoid if I only need to update one HL7 field... seems clunky.
Or you could write a custom Business Process to do it. Here's an example with inadequate error processing (😉) that should give you some ideas:
/// Business Process to Modify the MSH:7 field Class HICG.Sample.SetMSHDate Extends Ens.BusinessProcess [ ClassType = persistent ] { /// Downstream processes or operations to send messages to Property TargetConfigNames As %String(MAXLEN = 1000); Parameter SETTINGS = "TargetConfigNames:Basic:selector?multiSelect=1&context={Ens.ContextSearch/ProductionItems?targets=1&productionName=@productionId}"; /// Clone, modify and send the message downstream Method OnRequest(pRequest As Ens.Request, Output pResponse As Ens.Response) As %Status { Set tClone = pRequest.%ConstructClone() Set tCurDtTm = ##class(Ens.Rule.FunctionSet).CurrentDateTime("%Y%m%d%H%M%S") Do tClone.SetValueAt(tCurDtTm,"MSH:7") Do tClone.%Save() For i=1:1:$LENGTH(..TargetConfigNames,",") { Set tSC = ..SendRequestAsync($PIECE(..TargetConfigNames,",",i),tClone,0) Return:$$$ISERR(tSC) tSC } Return $$$OK } /// Return an array of connections for drawing lines on the config diagram ClassMethod OnGetConnections(Output pArray As %String, pItem As Ens.Config.Item) { Do ##super(.pArray,pItem) If pItem.GetModifiedSetting("TargetConfigNames",.tValue) { For i=1:1:$LENGTH(tValue,",") { Set tOne=$ZSTRIP($P(tValue,",",i),"<>W") Continue:""=tOne Set pArray(tOne)="" } } } }
The reason you need to clone the inbound message is that Start-of-Session messages are immutable. You must clone them, modify the clone and send it.
Hey thanks Jeff. This will do the trick.