After working with InterSystems I was able to find what I was looking for by using the Matches function. The pattern I'm using is "1.N".

Shouldn't IsValidNumber appear as an option in the drop down list of the Expression Editor?

I was able to find what I needed.   Set MSGX=##Class(EnsLib.HL7.Message).%OpenId(xxxxxxx)   works

Yes. Testing in terminal. BHS 18e1>w ##class(BHS.Custom.CustomFunctionSets).CheckMrnDup("PID|1||09877^^^^BHSMRN~uytreeqw^^^^CKS|","CKS") set tPid3Cnt = pMsg.GetValueAt("PID:3(1).1") ^ zCheckMrnDup+1^BHS.Custom.CustomFunctionSets.3 BHS 20e1>

Unfortunately no.  Not all patients will have every identifier.  Almost all will have the BHSMRN identifier , but not all will have a FHMRN or CKS.    The goal is to check every outbound A40 to see if the CKS is different in the two segments.  If they are we write them to a file.  If not, we move to the next.

Again, I just want to compare this identifier; uiytr5678A06^^^^CKS.   This rule, HL7.{PID:3.1}=HL7.{MRG:3.1}would compare every identifier.

Looking for a way to read a repeatable field using a Lookup table. 

Looking for a way to read a repeatable field for a specific value when using an Intersect Lookup table.