Formatting Attribute Reference

<< Click to Display Table of Contents >>

Navigation:  Designing Templates > Template HTML > HL7 Tag Shorthand > The ##HL7## Tag >

Formatting Attribute Reference

HTMLSourceB128

 

When inserting a ##HL7...## tag into a document you can add several modifying attributes which can affect the display or behavior. See the Reference tables below for more information about how to use them.

 

When adding a formatting attribute it is NOT case-sensitive. If the formatting attribute fails when the HTML is compiled (like trying to evaluate "Smith" as a Date) then the raw HL7 data value is used instead.

 

Final note. We are always looking for feedback on how we can make this product better. If you have an idea or request for a particular formatting option then please let us know by contacting HermeTech.

 

TABLE[1-50]

 

Description: Create simple lookup tables in your HTML documents. The formatting attribute consists of the word TABLE (not case sensitive) followed by a whole number between 1 and 50. It evaluates the HL7 field value and IF the document contains a XML Table with the "id" attribute = [numeric value] it will evaluate the value of the HL7 field value against that table and return either:

1) A translated value from the table XML

2) A "Default" value provided in the table XML

3) The untranslated value in the field if no translation exists in the table AND no "Default" value is provided.

Minimum Versions - Notepad Version 4.1 or higher. Postmaster Version 4.1 or higher.

 

hmtoggle_plus1Table Example

 

 

ELLIPSIS[1-50]

Example: ##HL7.PID.5.1.Ellipsis13##

Description: The formatting attribute consists of the word ELLIPSIS (not case sensitive) followed by a whole number between 1 and 50. It evaluates the HL7 field value and IF the length of the field EXCEEDS the [numeric value] in the attribute it is truncated to [numeric value] characters AND 3 periods (...).

Input Value: Dangerfield-Smythe Display Value: Dangerfield-S...

Minimum Versions - Notepad Version 4.1 or higher. Postmaster Version 4.1 or higher.

 

LEFTMOST[1-50]

Example: ##HL7.MSH.10.1.LeftMost5##

Description: The formatting attribute consists of the word LEFTMOST (not case sensitive) followed by a whole number between 1 and 50. It evaluates the HL7 field value and will trim the value to <numeric value> characters.

Input Value: 123456789

Display Value: 12345.

Minimum Versions - Notepad Version 4.1 or higher. Postmaster Version 4.1 or higher.

 

RIGHTMOST[1-50]

Example: ##HL7.MSH.10.1.RightMost5##

Description: The formatting attribute consists of the word RIGHTMOST (not case sensitive) followed by a whole number between 1 and 50. It evaluates the HL7 field value and will show only the last <numeric value> characters.

Input Value: 123456789

Display Value: 56789.

Minimum Versions - Notepad Version 4.1 or higher. Postmaster Version 4.1 or higher.

 

STARTFROM[1-50]

Example: ##HL7.MSH.10.1.StartFrom4##

Description: The formatting attribute consists of the word STARTFROM (not case sensitive) followed by a whole number between 1 and 50. It evaluates the HL7 field value and will show only the characters ON or AFTER <numeric value>.

Input Value: 123456789

Display Value: 456789.

Minimum Versions - Notepad Version 4.1 or higher. Postmaster Version 4.1 or higher.

 

 

DATETIME

Example: ##HL7.MSH.7.1.datetime##

Description: Evaluates the HL7 field value and attempts to convert it into date time display value using the 'Short Date' and 'Short Time' formats of the operating system's regional settings.

Input Value: 20031111163831+0000 Display Value: 11/11/2003 4:38 PM

 

DATE

Example: ##HL7.MSH.7.1.date##

Description: Evaluates the HL7 field value and attempts to convert it into date display value using the 'Short Date' format of the operating system's regional settings.

Input Value: 20031111163831+0000 Display Value: 11/11/2003

 

LONGDATE

Example: ##HL7.MSH.7.1.LongDate##

Description: Evaluates the HL7 field value and attempts to convert it into date display value using the 'Long Date' format of the operating system's regional settings.

Input Value: 20031111163831+0000 Display Value: Tuesday, November 11, 2003

 

AGE1

Example: ##HL7.PID.7.1.age1##

Description: Evaluates the HL7 field value and attempts to convert it into a date. It then uses that date value to calculate an age in years AS OF THE CURRENT SYSTEM DATE.

Input Value Today's Date Example: November 5th 2015

Input Value PID 7.1 (Patient DOB): 19931101

Input Value MSH 7.1: 20031111163831+0000

Display Value: 22 Important Note: In this example the HL7 message is from November 2003 we are calculating the patient's age. When the HL7 message was created the patient was 10 years old, today they are 22. It's up to you to determine the correct formatting attribute to use. (See Example Code Below)

 

AGE2

Example: ##HL7.PID.7.1.age2##

Description: Evaluates the HL7 field value and attempts to convert it into a date. It then uses that date value to calculate an age in years AS OF THE DATE VALUE IN THE MSH 7.1 (HL7 Message Date).

Input Value PID 7.1 (Patient DOB): 19931101

Input Value MSH 7.1: 20031111163831+0000

Display Value: 10  (See Example Code Below)

 

AGE1YMD

Example: ##HL7.PID.7.1.age1ymd##

Description: Evaluates the HL7 field value and attempts to convert it into a date. It then uses that date value to calculate an age the same as AGE2. That age is then displayed as a string value showing the total years months days.

Input Value Today's Date Example: November 5th 2015

Input Value PID 7.1 (Patient DOB): 19931101

Input Value MSH 7.1: 20031111163831+0000

Display Value: 22 yrs 4 days (See Example Code Below)

 

AGE2YMD

Example: ##HL7.PID.7.1.age2ymd##

Description: Evaluates the HL7 field value and attempts to convert it into a date. It then uses that date value to calculate an age the same as AGE1. That age is then displayed as a string value showing the total years months days.

Input Value PID 7.1 (Patient DOB): 19931101

Input Value MSH 7.1: 20031111163831+0000

Display Value: 10 yrs 10 days (See Example Code Below)

 

Click to expandExample HL7 Template HTML Code for AGE1, AGE2, AGE1YMD and AGE2YMD

 

UPPERCASE, TOUPPER, UPPER

Example: ##HL7.MSH.5.1.uppercase## or ##HL7.MSH.5.1.upper## or ##HL7.MSH.5.1.toupper##

Description: Evaluates the HL7 field value converts it into upper case (All Caps).

Input Value: Smith Display Value: SMITH

 

LOWERCASE, TOLOWER, LOWER

Example: ##HL7.MSH.5.1.lowercase## or ##HL7.MSH.5.1.lower## or ##HL7.MSH.5.1.tolower##

Description: Evaluates the HL7 field value converts it into upper case (All Caps).

Input Value: SMITH Display Value: smith

 

 

RAW

Example: ##HL7.PID.5.raw##

Description: Performs no formatting on the value at all. Useful for displaying an entire HL7 field leaving the component delimiters visible.

Input Value: |Smith^John^J| Display Value: Smith^John^J

 

ESCAPE

Example: ##HL7.OBR.44.2.Escape.##

Description: Applies the basic HL7 standard "Escape" rules to the value.

Input Value: Chest PA \T\ Lat Display Value: Chest PA & Lat

 

EMBEDDED TEXT REPORTS

 

TEXTREPORT1

Example: ##HL7.OBX.5.TextReport1##

Description: For handling embedded text reports in HL7 messages. All spaces are converted to HTML non-breakable spaces (&nbsp;). It assumes that the HL7 repeating field delimiter (~) is embedded in the value and should be replaced with "newlines" (<br/> tags), and then it applies the basic HL7 standard "Escape" rules.

Input Value: |Line 1~~Line 3~  Line 4|

Display Value:

 

Line 1

 

Line 3

 Line 4

 

TEXTREPORT2

Example: ##HL7.OBX.5.TextReport2##

Description: Works identically to TEXTREPORT1 but is optimized for multi-line embedded reports.

 

See Also: Consolidation and Compression

 

 

 

 

The "Default Value" Attribute (.?value)

Example: ##HL7.PID.7.1.Date.?Unknown##

Description: You can add the optional default value attribute to your ##HL7## tags. If the HL7 Value is blank then the value after the ? is displayed.

Input Value: {blank} Display Value: Unknown

 

 

For additional formatting and special handling see: Handling Embedded Binary Data