This function extracts the phrase before another phrase in a block of text. One use of this is to extract information from free text fields in the current or in a previous episode.
For example, suppose that we defined a Calculated Value Attribute to have name Hormone and formula
Report1 text before “(Hormone”
then Hormone would be evaluated from the value of the Report1 attribute as follows in the case fragment below:
01 Jun 03 20 Jun 03 02 Nov 03 Report1 657 (Hormone value detected) Report2 not detected (Total IgE) Hormone 657
Text before can also be used directly in a condition, for example, the following condition is true for the case above:
Report2 text before “(Total IGE)” is “not detected”
This function works as follows. The block of text is searched for the matching phrase. A marker is set where this phrase starts in the text. The text before the matching phrase is returned. If there is more than one line in the original block of text, the text from the start of the current line to the matching phrase is returned. If this search fails because the matching phrase was not found (or for any other reason), a blank (empty) string is returned.
The search for the matching text is not case sensitive, for example, the phrase “IGE” will match “IgE” as shown above.
See also: