Written by

Question David.Hamman · Jul 31, 2024

Assign action not working on HL7 production ruleset.

Does the assign action not work? Why doesn't MSH:7 get updated to the current DT?

Product version: IRIS 2024.1

Comments

Julian Matthews · Aug 1, 2024

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":

0
David.Hamman  Aug 1, 2024 to Julian Matthews

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.

0
Jeffrey Drumm  Aug 1, 2024 to David.Hamman

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)="" }
    }
}
}

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.

0
David.Hamman  Aug 5, 2024 to Jeffrey Drumm

Hey thanks Jeff. This will do the trick.

0