<< Click to Display Table of Contents >> Navigation: Transforming HL7 Messages > Macros Reference |
UltraPort HL7 Notepad
HL7 Transformation Macros Reference
Adding Transformation Macros is quite simple
Macro: StaticValue(strValue)
Parameters: 1
Parameter 1: strValue [String]
Instructions: Replaces the component value with the value passed in parameter 1 [strValue]
Macro: DefaultValue(strValue)
Parameters: 1
Parameter 1: strValue [String]
Instructions: Replaces the component value with the value passed in parameter 1 [strValue] ONLY if the component value is empty.
Macro: Blank()
Parameters: 0
Instructions: Clears the component value.
Macro: CopyFrom(intComponentNumber)
Parameters: 1
Parameter 1: intComponentNumber [Numeric]
Instructions: Replaces the selected component data with the value in #intComponentNumber. All actions are within the selected HL7 field.
Macro: CopyFromField(intFieldNumber, intComponentNumber)
Parameters: 2
Parameter 1: intFieldNumber [Numeric]
Parameter 2: intComponentNumber [Numeric]
Instructions: Replaces the selected component data with the component data in field #intFieldNumber, component #intComponent. All actions are within the selected HL7 segment.
Macro: CopyTo(intComponentNumber)
Parameters: 1
Parameter 1: intComponentNumber [Numeric]
Instructions: Replaces the component data in component #intComponentNumber with the value in the selected component. All actions are within the selected HL7 field.
Macro: CopyToIfEmpty(intComponentNumber)
Parameters: 1
Parameter 1: intComponentNumber [Numeric]
Instructions: Replaces the component data in #intComponentNumber with the value in the selected component ONLY if component #intComponent is empty.All actions are within the selected HL7 field.
Macro: CopyToField(intFieldNumber, intComponentNumber)
Parameters: 2
Parameter 1: intFieldNumber [Numeric]
Parameter 2: intComponentNumber [Numeric]
Instructions: Replaces the component data in field #intFieldNumber, component #intComponent with the value in the selected component. All actions are within the selected HL7 segment.
Macro: CopyTOFieldIfEmpty(intFieldNumber, intComponentNumber)
Parameters: 2
Parameter 1: intFieldNumber [Numeric]
Parameter 2: intComponentNumber [Numeric]
Instructions: Replaces the component data in field #intFieldNumber, component #intComponent with the value in the selected component ONLY if the target field/component is empty. All actions are within the selected HL7 segment.
Macro: DateStamp()
Parameters: 0
Instructions: Replaces the value with the current system date (yyyymmdd)
Macro: DateTimeStamp1()
Parameters: 0
Instructions: Replaces the value with the current system date and time to the minute (yyyymmddhhmm)
Macro: DateTimeStamp2()
Parameters: 0
Instructions: Replaces the value with the current system date and time to the second (yyyymmddhhmmss)
Macro: GUID()
Parameters: 0
Instructions: Replaces the value with a system-generated GUID (Globally Unique Identifier)
Macro: HL7MessageControlID()
Parameters: 0
Instructions: Replaces the value with a system-generated HL7 compliant Message Control ID (MSH 10.1)
Macro: HL7Null()
Parameters: 0
Instructions: Replaces the component value with an HL7 explicit NULL ("").
Macro: HL7TableLookUp1(intTableID, strTableCodeKey, [optional] strDefaultIfNotFound)
Parameters: 3
Parameter 1: intTableID [Numeric]
Parameter 2: strTableCodeKey [String]
Parameter 3: [Optional] strDefaultIfNotFound [String]
Instructions: Replaces the component data with the return value of a table lookup into the internal HL7 table with id # [intTableID]. It will look up the coded value [strTableCodeKey]. If passed, the optional 3rd parameter [strDefaultIfNotFound] will be returned if coded value [strTableCodeKey] is not found in the table.
Macro: HL7TableLookUp2(intTableID, strTableCodeKey, intComponentToReplace, [optional] strDefaultIfNotFound)
Parameters: 4
Parameter 1: intTableID [Numeric]
Parameter 2: strTableCodeKey [String]
Parameter 3: intComponentToReplace [Numeric]
Parameter 4: [Optional] strDefaultIfNotFound [String]
Instructions: Like HL7TableLookup1 this method replaces the component data with the return value of a table lookup into the internal HL7 table with id # [intTableID]. It will look up the coded value [strTableCodeKey]. Parameter 3 [intComponentToReplace] will indicate a different component within the same HL7 field which will be updated. If passed, the optional 4th parameter [strDefaultIfNotFound] will be returned if coded value [strTableCodeKey] is not found in the table.
Macro: HL7TableLookUp3(intTableID, [optional] strDefaultIfNotFound)
Parameters: 2
Parameter 1: intTableID [Numeric]
Parameter 2: [Optional] strDefaultIfNotFound [String]
Instructions: Replaces the component data with the return value of a table lookup into the internal HL7 table with id # [intTableID]. It will look up the coded value (the original value in the selected component). If passed, the optional 2nd parameter [strDefaultIfNotFound] will be returned if coded value is not found in the table. If 2nd parameter is not passed and the coded value is not found in the table then the value of the component is not changed.
Macro: HL7TableLookUp4(intTableID, intComponentToReplace, [optional] strDefaultIfNotFound)
Parameters: 3
Parameter 1: intTableID [Numeric]
Parameter 2: intComponentToReplace [Numeric]
Parameter 3: [Optional] strDefaultIfNotFound [String]
Instructions: Like HL7TableLookup3 this replaces the component data with the return value of a table lookup into the internal HL7 table with id # [intTableID]. It will look up the coded value (the original value in the selected component) and replaces the component value in another component within the same HL7 Field indicated in parameter #2 [intComponentToReplace]. If passed, the optional 3rd parameter [strDefaultIfNotFound] will be returned if coded value is not found in the table. If 3rd parameter is not passed and the coded value is not found in the table then the value of the target component will be changed to the value of the selected component.
Macro: PadLeft([Source Data],intNumberOfCharacters, strPadCharacter)
Parameters: 2
Parameter 1: intNumberOfCharacters [Numeric]
Parameter 2: strPadCharacter [String]
Instructions: Increases the length of the component value to [intNumberOfCharacters] characters in length by padding to the left with [strPadCharacter]. If the original value is equal to or greater than [intNumberOfCharacters] characters in length it will be left unchanged.
Macro: PadRight([Source Data],intNumberOfCharacters, strPadCharacter)
Parameters: 2
Parameter 1: intNumberOfCharacters [Numeric]
Parameter 2: strPadCharacter [String]
Instructions: Increases the length of the component value to [intNumberOfCharacters] characters in length by padding to the right with [strPadCharacter]. If the original value is equal to or greater than [intNumberOfCharacters] characters in length it will be left unchanged.
Macro: Prefix(strPrefix)
Parameters: 1
Parameter 1: strPrefix [String]
Instructions: Adds the value passed in parameter 1 [strPrefix] to the beginning of the component value
Macro: RandomStreetAddress()
Parameters: 0
Instructions: Replaces the value with a random 4 digit street number and a random street name from an internal database with over 2000 unique street names
Macro: RandomCityName()
Parameters: 0
Instructions: Replaces the value with a random city name from an internal database of over 1000 city names
Macro: RandomState()
Parameters: 0
Instructions: Replaces the value with a random U.S. State abbreviation from an internal database
Macro: RandomStreetName()
Parameters: 0
Instructions: Replaces the value with a random street name from an internal database with over 2000 unique street names
Macro: RandomFemaleFirstName()
Parameters: 0
Instructions: Replaces the value with a random FEMALE first name from an internal database of over 800 unique values
Macro: RandomFirstName()
Parameters: 0
Instructions: Replaces the value with a random first name from an internal database of over 1000 unique values
Macro: RandomLastName()
Parameters: 0
Instructions: Replaces the value with a random last name (surname) from an internal database of over 1000 unique values
Macro: RandomMaleFirstName()
Parameters: 0
Instructions: Replaces the value with a random MALE first name from an internal database of over 800 unique values
Macro: RandomNumber(intNumberOfDigits)
Parameters: 1
Parameter 1: intNumberOfDigits [String]
Instructions: Replaces the value with a randomly generated number which is intNumberOfDigits digits in length
Macro: RandomPastDate()
Parameters: 0
Instructions: Replaces the value with a random date from the past (1 day to 75 years formatted yyyymmdd
Macro: RandomPastDateTime(intMinimumDays, intMaximumDays)
Parameters: 2
Parameter 1: intMinimumDays [Numeric]
Parameter 2: intMaximumDays [Numeric]
Instructions: Replaces the value with a random datetime from the range [intMinimumDays] to [intMaximumDays] in the past formatted yyyymmddhhmm
Macro: RandomAge(intMinimumYears, intMaximumYears)
Parameters: 2
Parameter 1: intMinimumYears [Numeric]
Parameter 2: intMaximumYears [Numeric]
Instructions: Replaces the value with a random date from the past which (if evaluated as a date of birth) would result in the person's age being between [intMinimumYearss] to [intMaximumYears] old (formatted yyyymmdd)
Macro: RandomSelection(CommaDelimitedList)
Parameters: 1
Parameter 1: CommaDelimitedList [String]
Instructions: Replaces the component value with a random selection from the item list in parameter 1 [CommaDelimitedList] which must be a comma delimited list of items (Example: Lab1, Lab2, Lab3).
Macro: RandomSSN()
Parameters: 0
Instructions: Replaces the value with a randomly generated 9 digit number formatted as USA social security number 'nnn-nn-nnnn'
Macro: RandomString(intNumberOfCharacters)
Parameters: 1
Parameter 1: intNumberOfCharacters [Numeric]
Instructions: Replaces the value with a randomly generated alphabetical value (Upper Case) which is [intNumberOfCharacters] characters in length
Macro: RandomTelephone()
Parameters: 0
Instructions: Replaces the value with a randomly generated 10 digit number formatted as USA telephone number '(nnn) nn-nnnn'
Macro: Scrub(strScrubValue)
Parameters: 1
Parameter 1: strScrubValue [String]
Instructions: Removes ALL instances of the value passed in parameter 1 [strScrubValue] from the component data. NOTE: Parameter 1 is NOT case-sensitive. Example: If parameter 1 is ABC then the component value ABCDEF would be changed to DEF, component value AbCdEf would be changed to dEf.
Macro: SubString([Source Data],intStartingPosition, [optional] intNumberOfCharacters)
Parameters: 2
Parameter 1: intStartingPosition [Numeric]
Parameter 2: [Optional] intNumberOfCharacters [Numeric]
Instructions: Replaces the component value with a substring beginning at position [intStartingPosition] and extending to position [intNumberOfCharacters]. If the optional second parameter [intNumberOfCharacters] is omitted then the entire value from position [intStartingPosition] is returned.
Macro: Suffix(strSuffix)
Parameters: 1
Parameter 1: strSuffix [String]
Instructions: Adds the value passed in parameter 1 [strSuffix] to the end of the component value
Macro: SwapComponent(intComponentNumber)
Parameters: 1
Parameter 1: intComponentNumber [Numeric]
Instructions: Swaps the component data in component #intComponentNumber with the value in the selected component. All actions are within the selected HL7 field.