The ##HL7## Tag

<< Click to Display Table of Contents >>

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

The ##HL7## Tag

The ##HL7....## Tag

 

The ##HL7...## tags are for inserting specific values from your HL7 messages into your Templates. In HTML terms you can think of them like any single function closed HTML tag (like <br /> or <img src="image" />).

 

Examples:

 

##HL7## Inserts the entire HL7 message into the document. NOTE: You may want to apply a "no-wrap" style before doing this.

##HL7.MSH## Inserts the entire MSH segment into the document.

##HL7.MSH.9## Inserts the entire raw value MSH segment Field #9 into the document. NOTE: ##HL7.MSH.9.0## is identical.

##HL7.MSH.10.1## Inserts the value of MSH segment Field #10 Component #1 (The Message Control ID) into the document.

##HL7.MSH.7.1.datetime## Inserts the value of MSH segment Field #7 Component #1 (The Message Date) into the document and attempts to format the value as a date and time (See the Tag Attribute Reference for a list of special formatting values you can use).

 

hmtoggle_plus1Accessing Repeating Fields and Sub-Components

 

Common Examples You Might Use:

 

Patient Name: ##HL7.PID.5.2## ##HL7.PID.5.3## ##HL7.PID.5.1##

If field 5 of the PID segment is |Smth^John^J| would render as shown below

Patient Name: John J Smith

 

OR with a formatting option

 

Patient DOB: ##HL7.PID.7.1.date##

If field 7 of the PID segment (date of birth) is |19581225000000-07:00^| it would render as shown below on a computer using standard USA regional date settings

Patient DOB: 12/25/1958

(see the Formatting Reference for more special formatting abilities like the .date modifier)

 

OR with a Default value option.

You can place any value you wish to show up in your document IF the HL7 value is blank by adding the value preceded by a question mark (?) to the end of the HL7 tag as shown below

 

Patient SSN: ##HL7.PID.19.1.?Unknown##

If field 19 of the PID segment (social security number) is empty || it would render as shown below

Patient SSN: Unknown

 

IMPORTANT: Using the default value shorthand (like ?Unknown above) will only work IF the HL7 segment exists in the HL7 message. If the segment does not exist then the shorthand tag will always evaluate to blank. See below.

 

Insured's SSN: ##HL7.IN2.2.1.?Unknown##

If the HL7 message contains an IN2 segment and field 2 component 1 was not blank (IN2||999-55-8888|) it would render as shown below

Insured's SSN: 999-55-8888

If the HL7 message contains an IN2 segment and it was blank it would render like so

Insured's SSN: Unknown

If the HL7 message does not contain an IN2 segment at all it would render like so

Insured's SSN: