<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<script type="text/javascript">
	function searchPatient(event) {
		if (event.keyCode == 13) {
			document.getElementById(patientInMeeting);
		}
	}
</script>
<table  width="100%">
<tr><td>
<c:if test="${requestScope.errorMsg ne null}">
	<div class="error"><img
		src="../images/16x16/error_white_bg.png" alt="e" /><c:out value="${requestScope.errorMsg}"/></div>
	<br />
</c:if>
</td></tr>

<tr><td>
<form id="patientInClinic" action="patientInClinic.form" method="post">
<input type="hidden" name="action" id="action" value="SEARCH"></input>

<tags:dialogBox title="Patients in Clinic">
	<div class="rowDivFirst">&nbsp;</div>
	
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Consultant Forename</div>
		<div class="fieldSetColumnSecond">
			<input type="text" name="consultantForename" value="<c:out value="${consultantForename}"/>">
		</div>
		<div class="fieldSetColumnFirst">Consultant Surname</div>
		<div class="fieldSetColumnFourth">
			<input type="text" name="consultantSurname" value="<c:out value="${consultantSurname}"/>">		
		</div>
	</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Hospital</div>
		<div class="fieldSetColumnSecond">
			<select name="hospital" >
				<option value=""></option>
				<c:forEach var="hosp" items="${webapp.hospMap}">
					<option value="<c:out value="${webapp.hospCodeIdMap[hosp.key]}"/>" <c:if test="${hosp.hospitalCode eq hospital}"> selected="selected"</c:if>><c:out value="${hosp.value}"/></option>
				</c:forEach>
			</select>		
		</div>
		<div class="fieldSetColumnFirst">Clinic Type</div>
		<div class="fieldSetColumnFourth">
				<webapp:selectAndEditList includeEmpty="true" path="speciality" domain="EMDT" list="speciality" currentValue="${speciality}"/>
		</div>
	</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Patient Forename</div>
		<div class="fieldSetColumnSecond">
			<input type="text" name="patientForename" value="<c:out value="${patientForename}"/>">
		</div>
		<div class="fieldSetColumnFirst">Patient Surname</div>
		<div class="fieldSetColumnFourth">
			<input type="text" name="patientSurname" value="<c:out value="${patientSurname}"/>">		
		</div>
	</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnFirst">&nbsp;&nbsp;Hospital number</div>
		<div class="fieldSetColumnFourth">
			<input type="text" name="hospitalnumber" value="<c:out value="${hospitalnumber}"/>">
		</div>
		<div style="width:40%;">&nbsp;</div>
	</div>
	<div class="rowDivFirst">
		<div class="fieldSetColumnSecond">&nbsp;&nbsp;Last appointment between</div>
		<div class="fieldSetColumnSecond">
			<input type="text" name="startDate" id="startDate" title="Enter date of meeting in dd/mm/yyyy format, or leave blank to search for any meeting date" value="<c:out value="${startDate}"/>"  placeholder="dd/mm/yyyy" >
			<img title='Click to choose date' style='cursor: pointer'
				src='../images/16x16/date.png' id='startDate_DateTrigger' />
		</div>
		<div class="fieldSetColumnSecond">
			<input type="text" name="endDate"  id="endDate" title="Enter date of meeting in dd/mm/yyyy format, or leave blank to search for any meeting date" value="<c:out value="${endDate}"/>"  placeholder="dd/mm/yyyy" >
			<img title='Click to choose date' style='cursor: pointer'
				src='../images/16x16/date.png' id='endDate_DateTrigger' />
		</div>
	</div>
	<div class="rowDivFirst">&nbsp;</div>
</tags:dialogBox>

<div class="containerMedium">
	<div class="floatRight">
		 <input type="submit" value="Search" onclick="document.getElementById('patientInClinic').submit();" />
	</div>
</div>
</form></td></tr></table>
