<%@ taglib uri="/tags/struts-bean-el" prefix="bean-el" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html-el" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib uri="/tags/jstl/xml" prefix="x" %>
<%@ taglib uri="/tags/esr-core" prefix="esrcore" %>
<%@ taglib uri="/tags/fw" prefix="fw" %>

<c:set var="xml" value="${xmlFormattedMessage}" />

<table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShell" role="presentation">
<tr>
<td>
 <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTable" role="presentation">
  <tr>
   <td>
    <table width="100%" border="0" cellpadding="0" cellspacing="0" class="moduleShellTableHead" role="presentation">
     <tr> 
        <td class="moduleBlueBox"><img alt=""  src="../images/spacer.gif" width="28" height="23"/></td>
		<td nowrap style="padding-left: 7"> <c:out value="${selectedMessage.type.code}"/>: <c:out value="${selectedMessage.type.description}"/></td>
		<td>&nbsp;</td>
		<td width="100%"><img alt=""  src="../images/spacer.gif"/></td>
		<td nowrap class="moduleBlueLink" style="padding: 1 8 1 8">
		   <%  			
			java.util.HashMap params = new java.util.HashMap();
			String selectedSiteId = (String)request.getAttribute(gov.va.med.esr.ui.message.action.MessageConstants.SELECTED_SITE_ID);
			if(selectedSiteId != null && selectedSiteId.length() > 0) params.put("selectedSiteId",selectedSiteId);
			pageContext.setAttribute("parameters",params);
		    %>  
		    <fw:link action="/hl7Message.do?methodName=chooseDisplayMessages" name="parameters"><bean-el:message key="link.name.backToMessageList"/></fw:link>
		</td>
        	<td><img alt=""  src="../images/spacer.gif" width="5"/></td>				
	</tr>
    </table>
   </td>
  </tr>
 
 <tr> 
  <td>
   <table width="100%" cellpadding="0" cellspacing="0" border="0" class="moduleShellTableBody" role="presentation">
	<tr><td>&nbsp;</td><tr></tr>
	<tr>     
		<td witdth="5%">&nbsp;</td> 
      		<td align="center">				
			<c:import var="xslt" url="/facility/esr_transform.xsl" />
			<c:catch var="parseException">
				<x:transform xml="${xml}" xslt="${xslt}" />
			</c:catch>
			<c:if test="${parseException!=null}">
				<br></br>Invalid XML Message<br></br><c:out value="${xml}"/>
			</c:if>
	  	</td>
	  	<td witdth="5%">&nbsp;</td> 
    </tr>	
   </table>
  </td>
 </tr>
</table>
