<!-- start nationalMDTFormMenu.jsp GREEN buttons top tow -->
<%@ include file="/includes.jsp"%>
<div class="menuButtonRect green"><a href="../nationalMDT/patientHistoryActions.form">Patient&nbsp;History</a></div>
<!--
<c:if test="${emdt.currentMeeting ne null}">
	<div class="menuButtonRect pink">
		<a href="../meetings/resumeMeeting.form">Resume Current Meeting</a>
	</div>
</c:if>
-->
<sec:authorize access="hasRole('NMDM_SUBMITTER')">
	<div class="menuButtonRect green">
		<a href="../nationalMDT/nmdmReferralssummary.form"> Submit Patient<br/>to National MDM </a>
	</div>
</sec:authorize>

<sec:authorize access="hasRole('NMDT_COORD')">
	<div class="menuButtonRect green"> <a href="../nationalMDT/addCurrentPatientToNextMeeting.form?task=selectNextMeeting">Add To Meeting<br/></a></div>
</sec:authorize>



<c:choose>
	<c:when test="${filterForm.name ne null }"><c:set var="nameOfForm" value="${filterForm.name}"></c:set></c:when>
	<c:otherwise><c:if test="${consultationNoteForm ne null}"><c:set var="nameOfForm" value="${consultationNoteForm.view.formName}"></c:set></c:if></c:otherwise>
</c:choose>
<c:if test="${referralPatientDto.currentCareSpell.referralDetails.referralsDefinition ne null || emdt.currentCareSpell.referralDetails.referralsDefinition ne null}">
	<c:choose>
		<c:when test="${referralPatientDto.referralsDefinition ne null}">
			<c:set var="referralsDefinition" value="${referralPatientDto.currentCareSpell.referralDetails.referralsDefinition}" scope="request"></c:set>
		</c:when>
		<c:otherwise>
			<c:set var="referralsDefinition" value="${emdt.currentCareSpell.referralDetails.referralsDefinition}" scope="request"></c:set>
			
		</c:otherwise>
	</c:choose>
	<c:set var="currentCareSpell" value="${emdt.currentCareSpell}" scope="session"></c:set>
</c:if>

<c:if test="${referralsDefinition ne null}">
	<c:set var="groupBy" value="" scope="request" ></c:set>
	<c:if test="${nameOfForm !=null or nameOfForm ne ''}">
		<c:forEach var="formSummaryMapOrder"
			items="${referralsDefinition.formSummaryMapOrder}">
			<c:if test="${formSummaryMapOrder.formOrSummaryName eq nameOfForm and formSummaryMapOrder.groupName!='Top Level' }">
				<c:set var="groupBy" value="${formSummaryMapOrder.groupName}" scope="request"></c:set>
			</c:if>
		</c:forEach>
	</c:if>
	<c:if test="${nameOfForm !=null or nameOfForm ne '' }">
		<c:forEach var="formSummaryMapOrder"
			items="${referralsDefinition.formSummaryMapOrder}">
			<c:if test="${formSummaryMapOrder.formOrSummaryName eq summaryName and formSummaryMapOrder.groupName=='Top Level' }">
				<c:set var="groupBy" value="" scope="request"></c:set>
			</c:if>
		</c:forEach>
	</c:if>
			<div class="menuHolder">
					<div
						<c:choose>
					 		<c:when test="${ summaryName eq null and ((null eq nameOfForm) or  ('' eq nameOfForm)) and addToMeeting ne true }">class="menuButtonSquare selected"</c:when>
							<c:otherwise>class="menuButtonSquare blue"</c:otherwise>
						</c:choose>
					>
						<a href="../nationalMDT/viewPatient.form">Patient<br /> Details</a>
					</div>
				<tiles:insertTemplate template ="forms/groupFormsMenu.jsp"/>
			</div>
</c:if>
<!-- end nationalMDTFormMenu.jsp -->