<%@ include file="/includes.jsp"%>
<br />
<table>
	<tr>
		<td width=10%><tiles:insertTemplate template="/meetings/tiles/menu.jsp" flush="true" /></td>
		<td valign="top" width=80% align="center"><br/><s:form
			action="/referrals/updatePatientDiscussion">
			<table width="400">
				<tr>
					<td><tags:dialogBox title="Patient Discussion">
						<table width="100%">
							<tr>
								<td width="1" style="width: 1px;">Discussed</td>
								<td><html:radio property="item.discussed" value="true" />Yes&nbsp;
								<html:radio property="item.discussed" value="false" />No</td>
							</tr>
							<tr>
								<td>Reason if not discussed</td>
								<td><html:text property="item.reasonNotDiscussed" /></td>
							</tr>
							<tr>
								<td>Follow up date</td>
								<td><webapp:date property="followUpDate"
									styleId="followUpDate" /></td>
							</tr>
							<tr>
								<td>Discussion Form</td>
								<td><html:select property="item.formDefId">
									<html:option value=""></html:option>
									<c:forEach var="group" items="${emdt.formDomain.children}">
										<optgroup label="<c:out value="${group.label }"/>">
											<c:forEach var="form" items="${group.children}">
												<html:option value="<c:out value="${form.id }"/>"><c:out value="${form.label }"/></html:option>
											</c:forEach>
										</optgroup>
									</c:forEach>
								</html:select></td>
							</tr>
							<tr>
								<td>Meeting Type</td>
								<td><webapp:selectFromList property="item.type"
									domain="EMDT" list="MeetingItemType" includeEmpty="true" /></td>
							</tr>
							<tr>
								<td colspan="2">Notes</td>
							</tr>
							<tr>
								<td colspan="2"><html:textarea rows="5" cols="70"
									property="item.notes" /></td>
							</tr>
							<tr>
								<td colspan="2"><br />
								</td>
							</tr>
							<tr>
								<td colspan="2"><tags:table title="Attendees">
									<table class="table">
										<tr>
											<th>Name</th>
											<th>Reviewed&nbsp;and&nbsp;agreed?</th>
											<th>Comments</th>
										</tr>
										<c:forEach var="attendee"
											items="${emdt.currentMeeting.attendees}">
											<tr>
												<td style="font-weight: bold;"><c:out value="${attendee.name }"/></td>
												<td align="center"><html:select
													property="approvalAgreed(<c:out value="${attendee.id }"/>)">
													<html:option value=""></html:option>
													<html:option value="true">Yes</html:option>
													<html:option value="false">No</html:option>
												</html:select></td>
												<td><html:textarea rows="4" cols="30"
													property="approvalComment(<c:out value="${attendee.id }"/>)" /></td>
											</tr>
										</c:forEach>
										<c:set var="attendees" value="${emdt.currentMeeting.attendees}"/>"/>
										<c:if test="${empty attendees}">
											<tr>
												<td colspan="3">There are no meeting attendees.</td>
											</tr>
										</c:if>
									</table>
								</tags:table></td>
							</tr>
						</table>
					</tags:dialogBox></td>
				</tr>
			</table>
			<br />
			<html:submit value="Save" />
		</s:form></td>
		<td width=10%></td>
	</tr>
</table>