<< Click to Display Table of Contents >> Navigation: Designing Templates > Template HTML > HL7 Tag Shorthand > The ##HL7## Tag > Formatting Attribute Reference |
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.
Create simple XML look-up tables in your Template HTML by following a few simple rules.
•Node and Attribute names must be lower case •The XML must consist only of a root node named "hl7table" with child nodes named "item". •The root node MUST contain an id attribute with a numeric value between 1 and 50. •The root node CAN contain a default attribute with any value you like. •All other root node attributes are ignored. In the example below the description attribute is solely for reference. •All of the item child nodes MUST contain a code attribute AND a value attribute and neither can be blank.
<!-- We build a simple XML Table anywhere in our HTML document-->
<!-- Then you can reference the table --> <!-- using a ##HL7 tag --> <span class="bold10">Gender: </span> <span class="data10">##HL7.PID.8.1.Table1##</span>
IMPORTANT: If you provide a non-blank default value that value will ALWAYS be placed in the document IF the look-up fails to match. If you want to just "pass-thru" the raw field value if there is no matching code then either omit the default attribute or set it to "". Consider this example:
<hl7table id="1" default="Not Female" description="Gender table for PID.8.1">
<span class="bold10">Gender: </span> <span class="data10">##HL7.PID.8.1.Table1##</span>
In the above example ANY value in PID.8.1 other than F (or f since the look-up itself is NOT case-sensitive) would be displayed as "Not Female". Omitting the default attribute (or setting it to "") would just allow the unmatched value in PID.8.1 to pass-thru and be displayed. So if PID.8.1 == "F" it would be displayed as Female and "M" would be displayed as M as shown below.
<hl7table id="1" description="Gender table for PID.8.1">
<span class="bold10">Gender: </span> <span class="data10">##HL7.PID.8.1.Table1##</span>
|
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)
HTML Snippet:
<b>Patient Name: </b>##HL7.PID.5.1##, ##HL7.PID.5.2## ##HL7.PID.5.3##<br />
Rendered HTML Snippet Executed on 09 September 2015:
Patient Name: Eriksson, Elizabeth M HL7 Message Date: 11/11/2003 (Raw Value) 20031111163831+0000 DOB: 8/24/1976 (Raw Value) 19760824 Age Today: 39 Age Today (YMD) 39 years 9 days Age On Message Date: 27 Age On Message Date: (YMD) 27 years 2 months 18 days
|
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 ( ). 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