Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

FunctionUse
?Use this to evaluation the truth of an expression and return a value. The syntax is: condition? true expression : false expression. If the condition evaluates to "true," the true expression is returned, otherwise the false expression is returned. The specified condition must evaluate to a Boolean value. Example: MSH-3='ADM' ? 'HIS' : 'RIS' means that if the MSH-3 segment is ADM (true), the value returned will be 'RIS'; otherwise, the value returned will be 'RIS'
??This function returns expression 2 if expression 1 is null; otherwise, it returns expression 1. The syntax is: expression1 ?? expression2. Both expressions must evaluate to string values. Example: OBR-2 ?? OBR-3 ?? 'UNKNOWN' will return "unknown" if OBR-2 and OBR 3 evaluate to null.
AppendSegment(segmentName)This function allows you to append a segment with the given segment name to the end of a message. The syntax is: AppendSegment(segmentName). Example: AppendSegment(OBR-2) will append the contents of the OBR-2 segment to the end of the message.
Coalesce(expression1,expression2,...,expressionN)This function returns the first value from the list of expressions. One to N expressions can be included. The syntax is: Coalesce(expression1, expression2,...,expressionN). Example: Coalesce(OBR-2,OBR-3,'UNKNOWN') will return UNKNOWN if OBR-2 and OBR-3 are empty.
Escape(expression)This function encodes a string or expression with the HL7 Escape characters of the message. The syntax is: Escape(expression) Example: Escape(MSH-2) will return "\S\\R\\E\\T\".
FilterString(expression,allowedCharacters)This function returns a string containing only those characters specified in allowedCharaters. For example, the source system may provide a value in a field with extra characters; you can use this function to strip out only the characters in the string you are interested in. The syntax is: FilterString(expression,allowedCharacters). The expression must evaluate to a string; allowedCharacters specifies what will be passed through the filter. Example: FilterString(AA00BB12345,12345) will return the string "12345".
GetDate(format='yyyyMMddhhmmss') This function will return the current date, as specified by the server machine, in the specified date format. The syntax is: GetDate(format="XX"). The default format is yyyyMMddhhmmss (year, month day, hour, minute, second), but you can set whatever format you desire. Example: Using GetDate(format=yyyyMMdd) will return the date July 25, 2015 as "20140725".
If(condition,trueExpression,falseExpression) 
In(expression,string1,string2,...,stringN) 
IndexOf(expression,string) 
InTable("InTableName") 
Left(expression,string) 
Len(expression) 
LTrim(expression) 
LTrim(expression,string) 
Remove(expression,string1, string2,...,stringN) 
Replace(expression,string,string) 
Right(expression,string) 
RTrim(expression) 
RTrim(expression,string) 
Split(expression,charArray,index) 
SubString(expression,offset,length) 
Trim(expression) 
Trim(expression,string) 
UnEscape(expression 

...