IMPAX 6.5.1 Server Knowledge Base home > Configuring IMPAX Server with Administration Tools > Source Manager > Customizing field mappings to extract information from images > List of field mapping grammar functions
This function returns the substring within the input text string defined by the offset and length parameters.
Parameters
input—Specifies the input text string that the substring is extracted from.
offset—An integer defining the starting byte of the substring. The offset count is zero based; that is, the first byte in the input string has an offset of zero.
length—An integer that defines the required length of the substring.
pad—If the pad parameter is supplied, it is a string defining the padding character; if the parameter is not supplied, the default padding character is the space ' '.
Remarks
The input text string can be another field mapping grammar function.
If the number of characters available in the input string starting at the offset position is fewer than the number defined by the length parameter, then the substring returned by this function is left-padded (that is, the string text is right-justified) with padding characters.
Examples
A string that includes the patient ID (1234), patient name (TEST^PATIENT), and study start date (2002Jan24) concatenated together as a single string using no separator character.
| Element to extract | Expression | Text extracted |
|---|---|---|
| Patient ID | sub( '1234TEST^PATIENT2002Jan24', 0, 4 ) | 1234 |
| Patient name | sub( '1234TEST^PATIENT2002Jan24', 4, 12 ) | TEST^PATIENT |
| Study start date | sub( '1234TEST^PATIENT2002Jan24', 16, 9 ) | 2002Jan24 |
See also
Parsing out multiple values stored in one element without separators
Topic number: 9017 Applies to: IMPAX 6.5.1 Server Knowledge Base |