In these days, I feel like myself to write simple HL7 segment view for myself. Because we need to check manually HL7 message text file with HL7 documentation whether the formation of our HL7 message file is correct or not. Another one is we gotta check the whether correct information is added into the correct segment sequence or not. That's why I need to write viewer program for saving our time to check like that.
Here is the code for HL7 message viewer
2 <cfset ArrayMsg = ListToArray(msg, CHR(13), true, false)>
3 <table>
4 <tr>
5 <cfloop from="1" to="#ArrayLen(ArrayMsg)#" index="i">
6 <cfset HL7MsgName = Mid(ArrayMsg[i], 1, 4)>
7 <cfset HL7MsgSeg = ListToArray(Mid(ArrayMsg[i], 6, Len(ArrayMsg[3])), "|", true, false)>
8 <td valign="top">
9 <cfdump var="#HL7MsgSeg#" label="#HL7MsgName# Segment">
10 </td>
11 </cfloop>
12 </tr>
13 </table>
14</cfif>
15
16<form action="index.cfm" method="post">
17 Paste HL7 message:<br>
18 <textarea name="msg" style="width:100%; height:50px;"></textarea><br>
19 <input type="Submit" name="btnSubmit" value="View">
20</form>
The outcome will be as follow

If you found any bugs, please leave message as comment.

Android
Top of Page