· Jan 28, 2020

Using $EXTRACT function in routing rule



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:


Could anyone assist with this?





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


Have I got the syntax correct?