Question
· Jul 15

working with ENSLIB.HL7.Message in a custom function

In a HL7 Business Rule, I want to create a custom function that works on an HL7 message object (ENSLIB.HL7.Message).  I extended the Ens.Rule.FunctionSet class, and have a class method that accept a ENSLIB.HL7.Message obj -

ClassMethod myfunction(msg As EnsLib.HL7.Message) As %Boolean,  so I can call   myfunction(HL7)  in the rule's condition

The problem is, it seems that I can only use absolute property paths such as msg.GetValueAt("1:9.2") but not a path containing HL7 segment name,  for example as in msg.GetValueAt("MSH:9.2").  This is a huge limitation.

Is there anyway to use the HL7 vdoc property path with segment names in it in my custom function?

Thank you

Wil

Product version: IRIS 2024.1
Discussion (2)2
Log in or sign up to continue

I wrote a quick classmethod in my custom FunctionSet class to test your observation and found that I can use the full mnemonic property path name, for example:

ClassMethod GetControlID(pMsg As EnsLib.HL7.Message) As %String
{
    // Also works with "MSH:10"
    Return pMsg.GetValueAt("MSH:MessageControlID")
}

Example from a rule (I used Document, but HL7 also works):

And the resulting trace from the Visual Trace:

I'm thinking that your inbound messages might not have the DocCategory (ex. "2.3.1") and DocName (ex. "ADT_A01") properties set ... ?