KEEP-RIGHT Function

Truncating, or padding spaces to, a source string to a defined length - counting from the right.

Purpose

For truncating, or padding spaces to, a source string to a defined length – counting from the right. The source string can be a static string value or a reference to a data element.

Format

KEEP-RIGHT (source-value, targeted-length)

Example

The following config entry in am HL7DataTransformer handler assigns the last 4 digits (the time-portion) of the PID-7 field of an HL7 record to variable %1.

<Parameter>
  <!-- KEEP-RIGHT Example -->
  <Name>transformation-rule</Name>
  <Value>%1=>KEEP-RIGHT($PID-7, "4")</Value>
</Parameter>
InputOutcome
PID|||||||200108071220||%1=”1220″

Related

Nil.