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
<cfset ArrayMsg = ListToArray(msg, CHR(13), true, false)>
<cfloop from="1" to="#ArrayLen(ArrayMsg)#" index="i">
<cfset HL7MsgName = Mid(ArrayMsg[i], 1, 4)>
<cfset HL7MsgSeg = ListToArray(Mid(ArrayMsg[i], 6, Len(ArrayMsg)), "|", true, false)>
<cfdump var="#HL7MsgSeg#" label="#HL7MsgName# Segment">
<form action="index.cfm" method="post">
Paste HL7 message:<br>
<textarea name="msg" style="width:100%; height:50px;"></textarea><br>
<input type="Submit" name="btnSubmit" value="View">
The outcome will be as follow
If you found any bugs, please leave message as comment.