Question
· Sep 23, 2020

Using NOTIN and Lookup in the method

Any syntax help, i want to check different msg types and then reach out to the value in that particular segment. Here is example, i want to get SSNNumber from a method. Trying to use NOTIN, and Lookup

Class Training.RulesFunctionSet Extends Ens.Rule.FunctionSet

{

ClassMethod getEmiratesId(pHL7 As EnsLib.HL7.Message) As %String
{
SET msgType = pHL7.GetValueAt("MSH:MessageType.TriggerEvent")
 

IF msgType NotIn "A39,A40,O01,O11,O09,R01" {
return pHL7.GetValueAt("PID:SSNNumberPatient")}

IF msgType In "A39,A40" {
 return pHL7.GetValueAt("PIDgrp(1).PID:SSNNumberPatient")}
 
IF msgType In Lookup("AllowsMsgTypes",HL7.{MSH:SendingFacility.NamespaceID},,) {
 return pHL7.GetValueAt("PIDgrpgrp(1).PIDgrp.PID:SSNNumberPatient")}
}
}

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