The following table lists the statements available in the HL7 Message Modifier filter.

Statement

Description

Action

An action statement (referred to as an 'action') is usually the consequence of a condition being true. The simplest valid rule, however, is one containing a single action. It typically modifies the value of a field or property.

If

A conditional statement (referred to as a 'condition') that if true leads to the filter executing any consequential statements.

Otherwise

A consequential conditional statement that is an alternative to the conditional statement preceding it.

Otherwise If

A consequential conditional statement that is an alternative to the conditional statement preceding it and if true leads to the filter executing any associated statements.

Actions

Statements known as actions take three arguments. They perform an operation on a target operand using an auxiliary operand (for example, a message field).

Actions can only be applied to the selected segment (although they may reference other conditions, for example, when concatenating).

Target Operand

Operator

Auxiliary Operand

Description

Field

(Set) To Value

Value.

Sets the field to the user-selected value.

 

(Set) To Property

Property name.

Sets the field to the user-selected property.

 

(Set) To Rhapsody Variable

Rhapsody variable name.

Sets the field to a user-selected Rhapsody variable.

 

(Set) To Uppercase

 

Converts the characters in the field to uppercase.

 

(Set) To Lowercase

 

Converts the characters in the field to lowercase.

 

(Set) By Concatenating

List of values to be concatenated and separator.

Sets the field to user-selected values concatenated using a specified separator between each value.

 

(Set) To Copy From Field

Field name.

Copies a value from another user-selected field in any segment to the field.

 

(Set) To Remove Characters

List of characters to be removed.

Removes user-selected characters from the field.

 

(Set) To Remove Leading Characters

List of characters to be removed.

Removes the leading characters from the field.

 

(Set) To Remove Trailing Characters

List of characters to be removed.

Removes the trailing characters from the field.

 

(Set) By Inserting Date/Time

The date-time precision and offset.

Sets the field to the current date-time.

 

(Set) To Use JavaScript

JavaScript function.

Enables JavaScript mode to construct complex action statements.

 

(Set) Using a Lookup Table

Lookup table.

Sets the field to a value in a lookup table.

 

Clear

 

Clears the field.

Segment

Delete

 

Deletes the current segment from the message. No other statements can be added to the segment as it is to be deleted.

An error is raised if you attempt to delete a segment which is already marked for change.

If you delete one instance of a repeating segment, all instances are deleted.

Property

(Set) To Field

Field name.

Sets the property to the value in a field.

When executing a rule (which is a series of statements), the filter effectively modifies fields in an input message segment simultaneously rather than in the order the statements have been added to the rule by the user.

You cannot use two or more standard actions to modify the same field. Use a JavaScript function instead.

When you change a value in a field, the filter applies the change to every repeating instance of the segment that field is in.

Conditions

Three types of statements are known as conditions: If, Otherwise and Otherwise If.

If Condition

An If condition is composed of one or more conditional expressions and one or more consequential statements.

A conditional expression takes three arguments: target operand, conditional operator and object operand. For every conditional expression, the If condition compares a subject operand with an object operand based upon a conditional operator and if the expression is true, it executes the consequential statement or statements.

Consequential statements are not mandatory. The filter allows empty conditional statements, in other words conditions with no consequences, but such statements have no effect on a message.

Conditions can reference outside the current segment, for example, a condition under segment OBX can check if a field in PID.3 is equal to "John Doe".

The HL7 Message Modifier filter allows you to construct complex conditional statements using JavaScript Functions.

Subject Operand

The If condition can take one of the following subject operands:

Subject Operand

Description

Field

A value representing an HL7 field, for example, PID.29.1.1.

Literal

A literal value, for example, 3, MED.

Property

A message property (internal to Rhapsody) that is meta-data attached to a message.

Variable

A Rhapsody variable that is available to a message.

JavaScript

Enables JavaScript mode to construct complex conditional statements.

Not a true subject operand.

Conditional Operator

The If condition can take one of the following conditional operators.

Operator

Associated Boolean Operator

Equals

Or

Does Not Equal

And

Contains

Or

Does not Contain

And

Starts With

Or

Does Not Start With

And

Ends With

Or

Does Not End With

And

Expressions within conditions are concatenated using the boolean operators 'And' and 'Or' depending on the type of conditional operator selected.

Any number of expressions can be concatenated, but using mixed operators is not permitted. To create complex expressions, use JavaScript Functions.

Object Operand

The If condition can take one of the following object operands:

Object Operand

Description

Field

A value representing an HL7 field, for example, PID.28.1.

Literal

A literal value, for example, a, 1902.

Property

A message property (internal to Rhapsody) that is meta-data attached to a message.

Variable

A Rhapsody variable that is available to a message.

Otherwise Condition

An Otherwise condition is strictly a consequential statement and executes one or more of its own consequential statements if and only if the condition it follows is false.

Otherwise If Condition

An Otherwise If condition is strictly a consequential statement and executes one or more of its own consequential statements if and only if the condition it follows is false and its expressions evaluate to true. In all other respects, it is identical to the If condition.

Nested Conditions

Conditional statements can also be added to other conditional statements as child statements, which are called nested conditions.

The maximum level of depth permitted for nested conditions is two. In other words, you cannot add a condition to a (newly) created nested condition.

Special Operators and Operands

Special Operators

Operator

Description

Is Empty

Formed by using Is Equals and leaving the value field blank.

Is Not Empty

Formed by using Does Not Equal and leaving the value field blank.

Special Object Operands

Value

Description

Null

Entered as "" in the value field.