Question
· Jan 28, 2020

Using $EXTRACT function in routing rule

Hi,

 

I'm attempting to use the $EXTRACT function in my routing rule but I'm seeing 'Expression Parsing' error messages when trying to save the rule.

I want to check the last character of a post code by using the following code:

$EXTRACT(HL7.{PID:PatientAddress(1).ziporpostalcode},*)="Z"

Could anyone assist with this?

 

Thanks, 

 

Martin

Discussion (4)2
Log in or sign up to continue

Thanks Enrico, 

I've written the custom function...

ClassMethod PostCodeLastCharacter(PID11 As %String)
{
Set ReturnValue = 0

if ($EXTRACT(PID11,*) = "Z")

{set ReturnValue = 1 }

Quit ReturnValue

}

I've added a trace to my rule which returns the relevant 1 or 0 (depending on the post code). However, my rule condition which references the function doesn't trigger an message...

PostCodeLastCharacter(HL7.{PID:11(1).5}=1)

Have I got the syntax correct?