CUT-LEFT Function

Truncating a defined number of characters from a source string - counting from the left.

Purpose

For truncating a defined number of characters from a source string – counting from the left. If the source string’s length is less than the defined number to be cut, an empty string is returned. The source string can be a static string value or a reference to a data element.

Format

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

Example

The following config entry in am HL7DataTransformer handler cuts the first 4 digits (the year-portion) of the PID-7 field of an HL7 record, and keeps the remaining (month-day and time portion of the original date-time).

<Parameter>
  <!-- CUT-LEFT Example -->
  <Name>transformation-rule</Name>
  <Value>PID-7=>CUT-LEFT($$, "4")</Value>
</Parameter>
InputOutcome
PID|||||||200108071220||PID|||||||08071220||

Related

Nil.