<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<style>
<%@ include file="styles.css"%>
</style>

<tiles:importAttribute />
<c:set var="readOnly" value="false"/>
<c:if test="${consultationNoteForm.view.note.locked eq true}">
	<c:set var="readOnly" value="true"/>
</c:if>
<webapp:namedListByFormDefinition formDefinition="${consultationNoteForm.view.form}" id="namedListMap" filterName="${requestScope.ATT_FilterdCode}" filterHospCode="${emdt.currentUser.hospital.hospitalCode}"/>
<c:set var="namedListMap" value="${namedListMap}" scope="request"/>

<webapp:namedList id="nl_YesNo" domain="EMDT" name="YesNo" nlFromFormDefinition="${namedListMap['EMDT']['YesNo']}" />
<webapp:namedList id="nl_SexCode" domain="EMDT" name="SexCode"  nlFromFormDefinition="${namedListMap['EMDT']['SexCode']}" />
<webapp:namedList id="nl_TAF_Last_Tmnt" domain="EMDT" name="TAF_Last_Tmnt"  nlFromFormDefinition="${namedListMap['EMDT']['TAF_Last_Tmnt']}" />
<webapp:namedList id="nl_TAF_green_red" domain="EMDT" name="TAF_green_red" nlFromFormDefinition="${namedListMap['EMDT']['TAF_green_red']}"  />
<webapp:namedList id="nl_TAF_green_amber_red" domain="EMDT" name="TAF_green_amber_red" nlFromFormDefinition="${namedListMap['EMDT']['TAF_green_amber_red']}"  />

<div class="container">
	<input type="hidden" value="false" id="unsaveButtonId">
	<div class="sectionSubPageTop">
	
		<h2>Triage Assessment</h2>
		<div class="fieldSet2Column" style="text-align: left;">
			<p>This triage tool is based on the <b>UKONS (Oncology Nursing Society) 24 Hour Helpline, Rapid Assessment and Access Tool Kit</b> and incorporates World Health Organisation Toxicity Assessment Criteria and the National Cancer Institute Common Terminology Criteria for Adverse Events Version 4.0 Published: May 28, 2009 (v4.03: June 14, 2010).</p>
			<p>For further details of the grading system please refer to the guidance notes through following the link below.</p>
			
		</div>
		<div class="fieldSet2Column">
			<span class="inputLabel"><a href="../emdt/tiles/forms/ChemoG1/TriageAssessment/Triage%20Toolkit%20UKons%20Nov%202016.pdf" target="_blank">Instructions for Triage Assessment
					<img src="../emdt/images/16x16/pdf.gif" title="Click to open instructions" alt="PDF" />
			</a></span>
		</div>
		<div class="fieldSet2Column">
			<hr />
		</div>

		<div>
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Patient Treatment Stage:</span>
			</div>
			<div class="fieldSetRightColumn">
				<span class="inputControl"> 
					<webapp:namedList id="nl_Chemo_Patient_Treatment_Stage" domain="EMDT" name="Chemo_Patient_Treatment_Stage" /> 
					<c:forEach var="pair" items="${nl_Chemo_Patient_Treatment_Stage.pairIterator}" varStatus="radioCount">
						<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFP1PatStage]" value="${pair.first}" id="TAFP1PatStage${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	 
					</c:forEach>
				</span>
			</div>
		</div>		

		<div class="fieldSet2Column">
			<!-- spacer to fix layout -->
		</div>

		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Cycle nbr:</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<webapp:namedListSpring path='value[TAFP1PatCycle]'  id="TAFP1PatCycle" disabled="${readOnly}" domain="EMDT" name="Chemo_Cycle_Nbr"
					currentValue="${consultationNoteForm.value['TAFP1PatCycle']}" nlFromFormDefinition="${namedListMap['EMDT']['Chemo_Cycle_Nbr']}"/>
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Day nbr:</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<webapp:namedListSpring path='value[TAFP1PatDay]'  id="TAFP1PatDay" disabled="${readOnly}" domain="EMDT" name="Chemo_Day_Nbr"
					currentValue="${consultationNoteForm.value['TAFP1PatDay']}" nlFromFormDefinition="${namedListMap['EMDT']['Chemo_Day_Nbr']}"/>
		
			</span>
		</div>
	
		<div class="fieldSet2Column">
			<!-- spacer to fix layout -->
		</div>

		<h2>Patient Details</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Patient Name</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:input disabled="false" path="value[TAF1PatientName]" size="" id="TAF1PatientName" readonly="${readOnly}" /></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">DOB</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<spring:bind path='value[TAF2PatientDOB]'>
					<c:choose>
						<c:when test="${disabled or readOnly}">
							<input type="text" name="value[TAF2PatientDOB]" size="0" id="TAF2PatientDOB" class="form-control" readonly="readonly" value="<c:out value="${consultationNoteForm.view.note.getValue('TAF2PatientDOB').code}"/>" disabled="disabled" placeholder="dd/mm/yyyy"/>
						</c:when>
						<c:otherwise>
							<input type="text" name="value[TAF2PatientDOB]" size="0" id="TAF2PatientDOB" class="form-control" value="<c:out value="${consultationNoteForm.view.note.getValue('TAF2PatientDOB').code}"/>" placeholder="dd/mm/yyyy"/>
						</c:otherwise>
					</c:choose>
				</spring:bind>
				&nbsp; <img title="Click to choose date" style="cursor: pointer;" src="../images/16x16/date.png" id="TAF2PatientDOB_DateTrigger" />
				</span>
		</div>
		<h2>Patient History</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Diagnosis</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:textarea path="value[TAF3Diagnosis]" cols="40" rows="4" id="TAF3Diagnosis" readonly="${readOnly}" /></span>
		</div>
		
		<div>
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Gender</span>
			</div>
			<div class="fieldSetRightColumn">
				<span class="inputControl">  
					<c:forEach var="pair" items="${nl_SexCode.pairIterator}" varStatus="radioCount">
						<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAF4Gender]" value="${pair.first}" id="TAF4Gender${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	 
					</c:forEach></span>
			</div>
		</div>
		<div class="fieldSet2Column">
			<!-- spacer to fix layout -->
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Consultant</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<c:set var="tempOptionsMapDomain" value="${consultationNoteForm.view.form.getField('TAF5Consultant').optionsMapDomain}"/>
				<c:set var="tempOptionsMapName" value="${consultationNoteForm.view.form.getField('TAF5Consultant').optionsMapName}"/>
				<webapp:namedListSpring path='value[TAF5Consultant]'  id="TAF5Consultant" disabled="${readOnly}" domain="${tempOptionsMapDomain}" name="${tempOptionsMapName}"
					currentValue="${consultationNoteForm.value['TAF5Consultant']}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
			</span>
		</div>
	</div>
	<div class="sectionSubPageTop">
		
		<h2>Enquiry Details</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Enquiry Date</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<spring:bind path='value[TAF6EnquiryDate]'>
					<c:choose>
						<c:when test="${disabled or readOnly}">
							<input type="text" name="value[TAF6EnquiryDate]" size="0" id="TAF6EnquiryDate" class="form-control" readonly="readonly" value="<c:out value="${consultationNoteForm.view.note.getValue('TAF6EnquiryDate').code}"/>" disabled="disabled" placeholder="dd/mm/yyyy"/>
						</c:when>
						<c:otherwise>
							<input type="text" name="value[TAF6EnquiryDate]" size="0" id="TAF6EnquiryDate" class="form-control" value="<c:out value="${consultationNoteForm.view.note.getValue('TAF6EnquiryDate').code}"/>" placeholder="dd/mm/yyyy"/>
						</c:otherwise>
					</c:choose>
				</spring:bind>
				&nbsp; <img title="Click to choose date" style="cursor: pointer;"
						src="../images/16x16/date.png" id="TAF6EnquiryDate_DateTrigger" />
				</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Enquiry Time</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<spring:bind path='value[TAF7EnquiryTime]'>
					<c:choose>
						<c:when test="${disabled or readOnly}">
							<input type="text" name="value[TAF7EnquiryTime]" size="0" id="TAF7EnquiryTime" class="form-control" readonly="readonly" value="<c:out value="${consultationNoteForm.view.note.getValue('TAF7EnquiryTime').code}"/>" disabled="disabled" placeholder="hh:mm"/>
						</c:when>
						<c:otherwise>
							<input type="text" name="value[TAF7EnquiryTime]" size="0" id="TAF7EnquiryTime" class="form-control" value="<c:out value="${consultationNoteForm.view.note.getValue('TAF7EnquiryTime').code}"/>" placeholder="hh:mm"/>
						</c:otherwise>
					</c:choose>
				</spring:bind>
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Who is calling?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:input disabled="false" path="value[TAF8WhoIsCalling]" size="" id="TAF8WhoIsCalling" readonly="${readOnly}" /></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Contact No.</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:input disabled="false" path="value[TAF9ContactNo]" size="" id="TAF9ContactNo" readonly="${readOnly}" /></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Drop in?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<c:forEach var="pair" items="${nl_YesNo.pairIterator}" varStatus="radioCount">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAF10DropIn]" value="${pair.first}" id="TAF10DropIn${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	 
				</c:forEach></span>
		</div>
	</div>
	<div class="sectionSubPageTop">
		<h2>Reason for Call</h2>
		<div class="fieldSet2Column">
			<span class="inputLabel">Reason for call (in patients own words)</span>
		</div>
		<div class="fieldSet2Column">
			<span class="inputControl"> <smvc:textarea path="value[TAF11ReasonForCall]" cols="80" rows="5" id="TAF11ReasonForCall" readonly="${readOnly}" /></span>
		</div>
	</div>
	<div class="sectionSubPageTop">
		<h2>Active Treatment Details</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Is the patient on active treatment?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<c:set var="tempOptionsMapDomain" value="EMDT"/>
				<c:set var="tempOptionsMapName" value="TAF_Active_Tmnt"/>
				<webapp:namedList id="nl" domain="${tempOptionsMapDomain }" name="${tempOptionsMapName}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
				<c:forEach var="pair" items="${nl.pairIterator}"  varStatus="checkboxCount">
					<smvc:checkbox disabled="${readOnly}" path="multiValue[TAF12ActiveTmnt]" value="${pair.first}" id="TAF12ActiveTmnt${checkboxCount.count}" /> <c:out value="${pair.second}"/>&nbsp;		</c:forEach></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">State Regimen</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:input disabled="false" path="value[TAF13StateRegimen]" size="" id="TAF13StateRegimen" readonly="${readOnly}" /></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Are they part of a clinical trial?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<c:forEach var="pair" items="${nl_YesNo.pairIterator}" varStatus="radioCount">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAF14ClinTrial]" value="${pair.first}" id="TAF14ClinTrial${radioCount}"/> <c:out value="${pair.second}"/>&nbsp;
				</c:forEach></span>
		</div>
		<div class="fieldSet2Column">
			<!-- spacer to fix layout -->
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">When did the patient last receive treatment?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<c:forEach var="pair" items="${nl_TAF_Last_Tmnt.pairIterator}" varStatus="radioCount">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAF15LastTmnt]" value="${pair.first}" id="TAF15LastTmnt${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	 
				</c:forEach></span>
		</div>
		<div class="fieldSet2Column">
			<!-- spacer to fix layout -->
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">What is the patient's temperature? </span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"><smvc:input disabled="false" path="value[TAF16PatientTemp]" size="4" id="TAF16PatientTemp" readonly="${readOnly}" cssStyle="width: auto;" /> &deg; C
				(please note that hypothermia is a significant indicator of sepsis)</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Does the patient have a central line?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <c:forEach var="pair" items="${nl_YesNo.pairIterator}" varStatus="radioCount">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAF17CentralLine]" value="${pair.first}" id="TAF17CentralLine${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	 
				</c:forEach></span>
		</div>
	</div>
	<div class="sectionSubPageTop">
		<div class="fieldSet2Column">
			<!-- spacer -->
		</div>

		<%-- define lists to be used repeatedly below --%>
		
		<div class="sym_container clearfix">
			<div class="sym_left_col">
				<b>Symptom</b>
			</div>
			<div class="sym_mid_col">
				<b>Severity</b>
			</div>
			<div class="sym_right_col">
				<b>Comment</b>
			</div>
		</div>

		<div class="sym_container clearfix">
			<div class="sym_left_col">
				<span class="sym_label">Fever (and receiving chemo)</span>
			</div>
			<div class="sym_mid_col">
				<c:forEach var="pair" items="${nl_TAF_green_red.pairIterator}" varStatus="radioCount">
					<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
						<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFFeverChemo]" value="${pair.first}" id="TAFFeverChemo${radioCount.count}"/>
						
					</div>
				</c:forEach>
				<div class="grade g_red">
					<!-- additional radio for spacer -->
					<input type="radio" style="visibility: hidden;" />
				</div>
			</div>
			<div class="sym_right_col">
				<smvc:input disabled="false" path="value[TAFCmtFeverChemo]" size="75" id="TAFCmtFeverChemo" readonly="${readOnly}" />
			</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Chest Pain</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFChest]" value="${pair.first}" id="TAFChest${radioCount.count}"/>
					
				</div>
			</c:forEach>
			<div class="grade g_red">
				<!-- additional radio for spacer -->
				<input type="radio" style="visibility: hidden;" />
			</div>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtChest]" size="75" id="TAFCmtChest" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Performance Status</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFPerfStat]" value="${pair.first}" id="TAFPerfStat${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtPerf]" size="75" id="TAFCmtPerf" readonly="${readOnly}" />
		</div>
		</div>	
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Nausea</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFNausea]" value="${pair.first}" id="TAFNausea${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtNaus]" size="75" id="TAFCmtNaus" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Vomiting</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFVomiting]" value="${pair.first}" id="TAFVomiting${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtVom]" size="75" id="TAFCmtVom" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Oral / stomatitis</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFOralStom]" value="${pair.first}" id="TAFOralStom${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtOralStom]" size="75" id="TAFCmtOralStom" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Diarrhoea</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFDiarrhoea]" value="${pair.first}" id="TAFDiarrhoea${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtDiar]" size="75" id="TAFCmtDiar" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Constipation</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFConstipation]" value="${pair.first}" id="TAFConstipation${radioCount.count}"/>  
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtCons]" size="75" id="TAFCmtCons" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Fever (not receiving chemo)</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFFeverNoChemo]" value="${pair.first}" id="TAFFeverNoChemo${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtFeverNoChemo]" size="75" id="TAFCmtFeverNoChemo" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Infection</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFInfection]" value="${pair.first}" id="TAFInfection${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtInfection]" size="75" id="TAFCmtInfection" readonly="${readOnly}" />
		</div>
		</div>		

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Palmar - plantar syndrome</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFPalmar]" value="${pair.first}" id="TAFPalmar${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtPalmar]" size="75" id="TAFCmtPalmar" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Fatigue</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFFatigue]" value="${pair.first}" id="TAFFatigue${radioCount.count}"/>  
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtFatig]" size="75" id="TAFCmtFatig" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Anorexia</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFAnorexia]" value="${pair.first}" id="TAFAnorexia${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtAnor]" size="75" id="TAFCmtAnor" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Dyspnoea / shortness of breath</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFDyspnoea]" value="${pair.first}" id="TAFDyspnoea${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtDysp]" size="75" id="TAFCmtDysp" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Rash</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFRash]" value="${pair.first}" id="TAFRash${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtRash]" size="75" id="TAFCmtRash" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Neurosensory / motor</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFNeuro]" value="${pair.first}" id="TAFNeuro${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtNeur]" size="75" id="TAFCmtNeur" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Bleeding</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFBleeding]" value="${pair.first}" id="TAFBleeding${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtBleed]" size="75" id="TAFCmtBleed" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Pain</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFPain]" value="${pair.first}" id="TAFPain${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtPain]" size="75" id="TAFCmtPain" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Bruising</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFBruising]" value="${pair.first}" id="TAFBruising${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtBruising]" size="75" id="TAFCmtBruising" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Extravasation</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFExtravasation]" value="${pair.first}" id="TAFExtravasation${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtExtravasation]" size="75" id="TAFCmtExtravasation" readonly="${readOnly}" />
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Urinary disorder</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFUrin]" value="${pair.first}" id="TAFUrin${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtUrin]" size="75" id="TAFCmtUrin" readonly="${readOnly}" />	
		</div>
		</div>

		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Ocular/Eye problems</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFEye]" value="${pair.first}" id="TAFEye${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtEye]" size="75" id="TAFCmtEye" readonly="${readOnly}" />
		</div>
		</div>


		<div class="sym_container clearfix">
		<div class="sym_left_col">
			<span class="sym_label">Other (please state)</span>
		</div>
		<div class="sym_mid_col">
			<c:forEach var="pair" items="${nl_TAF_green_amber_red.pairIterator}" varStatus="radioCount">
				<div class="grade g_<c:out value="${pair.second}"/>" title="<c:out value="${pair.second}"/>">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAFOther]" value="${pair.first}" id="TAFOther${radioCount.count}"/>
					
				</div>
			</c:forEach>
		</div>
		<div class="sym_right_col">
			<smvc:input disabled="false" path="value[TAFCmtOther]" size="75" id="TAFCmtOther" readonly="${readOnly}" />
		</div>
		</div>
		
		<div class="sym_left_col">
			<span class="sym_label">State other symptom</span>
		</div>
		<div class="sym_mid_col">
			<smvc:input disabled="false" path="value[TAFOtherSymptom]" id="TAFOtherSymptom" readonly="${readOnly}" />
		</div>
		
		<div class="fieldSet2Column">	
			<div id="assessmentGradingDiv"></div>	
			<smvc:hidden disabled="false" path="value[TAFAssessmentGrading]" id="TAFAssessmentGrading"  />
		</div>

		
	</div>



	<div class="sectionSubPageTop">
		<h2>Medical History / Medication</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Significant Medical History/Medication</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:textarea path="value[TAF18SigMedHistory]" cols="40" rows="" id="TAF18SigMedHistory" readonly="${readOnly}" /></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Action Taken</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:textarea path="value[TAF19ActionTaken]" cols="40" rows="" id="TAF19ActionTaken" readonly="${readOnly}" /></span>
		</div>
	</div>
	<div class="sectionSubPageTop">
		<h2>Triage Practitioner</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Triage Practitioner Name</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<c:set var="tempOptionsMapDomain" value="${consultationNoteForm.view.form.getField('TAF20TriagePractioner').optionsMapDomain}"/>
				<c:set var="tempOptionsMapName" value="${consultationNoteForm.view.form.getField('TAF20TriagePractioner').optionsMapName}"/>
				<webapp:namedListSpring path='value[TAF20TriagePractioner]'  id="TAF20TriagePractioner" disabled="${readOnly}" domain="${tempOptionsMapDomain}" name="${tempOptionsMapName}"
					currentValue="${consultationNoteForm.value['TAF20TriagePractioner']}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Designation</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<c:set var="tempOptionsMapDomain" value="${consultationNoteForm.view.form.getField('TAF21TriagePractDesig').optionsMapDomain}"/>
				<c:set var="tempOptionsMapName" value="${consultationNoteForm.view.form.getField('TAF21TriagePractDesig').optionsMapName}"/>
				<webapp:namedListSpring path='value[TAF21TriagePractDesig]'  id="TAF21TriagePractDesig" disabled="${readOnly}" domain="${tempOptionsMapDomain}" name="${tempOptionsMapName}"
					currentValue="${consultationNoteForm.value['TAF21TriagePractDesig']}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Date</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<spring:bind path='value[TAF22TriagePractDate]'>
					<c:choose>
						<c:when test="${disabled or readOnly}">
							<input type="text" name="value[TAF22TriagePractDate]" size="0" id="TAF22TriagePractDate" class="form-control" readonly="readonly" value="${consultationNoteForm.view.note.getValue('TAF22TriagePractDate').code}"/>" disabled="disabled" placeholder="dd/mm/yyyy"/>
						</c:when>
						<c:otherwise>
							<input type="text" name="value[TAF22TriagePractDate]" size="0" id="TAF22TriagePractDate" class="form-control" value="${consultationNoteForm.view.note.getValue('TAF22TriagePractDate').code}" placeholder="dd/mm/yyyy"/>
						</c:otherwise>
					</c:choose>
				</spring:bind>
				&nbsp; <img title="Click to choose date" style="cursor: pointer;" src="../images/16x16/date.png" id="TAF22TriagePractDate_DateTrigger" />
				</span>
		</div>
	</div>
	<div class="sectionSubPageTop">
		<h2>Follow up Action</h2>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Follow up Action Taken</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <smvc:textarea path="value[TAF23FollowActionTaken]" cols="40" rows="5" id="TAF23FollowActionTaken" readonly="${readOnly}" /></span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Consultant team contacted?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
			<c:forEach var="pair" items="${nl_YesNo.pairIterator}" varStatus="radioCount">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[TAF24ConsTeamCont]" value="${pair.first}" id="TAF24ConsTeamCont${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	 
				</c:forEach></span>
		</div>
		<div class="fieldSet2Column">
			<!-- spacer to fix layout -->
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Date contacted</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<spring:bind path='value[TAF25FUpDateContacted]'>
					<c:choose>
						<c:when test="${disabled or readOnly}">
							<input type="text" name="value[TAF25FUpDateContacted]" size="0" id="TAF25FUpDateContacted" class="form-control" readonly="readonly" value="${consultationNoteForm.view.note.getValue('TAF25FUpDateContacted').code}"/>" disabled="disabled" placeholder="dd/mm/yyyy"/>
						</c:when>
						<c:otherwise>
							<input type="text" name="value[TAF25FUpDateContacted]" size="0" id="TAF25FUpDateContacted" class="form-control" value="${consultationNoteForm.view.note.getValue('TAF25FUpDateContacted').code}" placeholder="dd/mm/yyyy"/>
						</c:otherwise>
					</c:choose>
				</spring:bind>
					&nbsp; <img title="Click to choose date" style="cursor: pointer;" src="../images/16x16/date.png" id="TAF25FUpDateContacted_DateTrigger" />
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Follow up Name</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<c:set var="tempOptionsMapDomain" value="${consultationNoteForm.view.form.getField('TAF26FUpName').optionsMapDomain}"/>
				<c:set var="tempOptionsMapName" value="${consultationNoteForm.view.form.getField('TAF26FUpName').optionsMapName}"/>
				<webapp:namedListSpring path='value[TAF26FUpName]'  id="TAF26FUpName" disabled="${readOnly}" domain="${tempOptionsMapDomain}" name="${tempOptionsMapName}"
					currentValue="${consultationNoteForm.value['TAF26FUpName']}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Designation</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl">
				<c:set var="tempOptionsMapDomain" value="${consultationNoteForm.view.form.getField('TAF27FUpDesig').optionsMapDomain}"/>
				<c:set var="tempOptionsMapName" value="${consultationNoteForm.view.form.getField('TAF27FUpDesig').optionsMapName}"/>
				<webapp:namedListSpring path='value[TAF27FUpDesig]'  id="TAF27FUpDesig" disabled="${readOnly}" domain="${tempOptionsMapDomain}" name="${tempOptionsMapName}"
					currentValue="${consultationNoteForm.value['TAF27FUpDesig']}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
			</span>
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Date</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<spring:bind path='value[TAF28FUpDate]'>
					<c:choose>
						<c:when test="${disabled or readOnly}">
							<input type="text" name="value[TAF28FUpDate]" size="0" id="TAF28FUpDate" class="form-control" readonly="readonly" value="${consultationNoteForm.view.note.getValue('TAF28FUpDate').code}"/>" disabled="disabled" placeholder="dd/mm/yyyy"/>
						</c:when>
						<c:otherwise>
							<input type="text" name="value[TAF28FUpDate]" size="0" id="TAF28FUpDate" class="form-control" value="${consultationNoteForm.view.note.getValue('TAF28FUpDate').code}" placeholder="dd/mm/yyyy"/>
						</c:otherwise>
					</c:choose>
				</spring:bind>
				&nbsp; <img title="Click to choose date" style="cursor: pointer;" src="../images/16x16/date.png" id="TAF28FUpDate_DateTrigger" />
			</span>
		</div>
		
		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Last updated by:</span>
			</div>
			<div class="fieldSetRightColumn">
				<span class="inputControl"><c:out value="${consultationNoteForm.view.note.modifiedByUser.name}"/></span>
			</div>
		</div>
		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Last updated:</span>
			</div>
			<div class="fieldSetRightColumn">
				<span class="inputControl"><fmt:formatDate value="${consultationNoteForm.view.note.modifiedDate}" pattern="dd MMM yyyy HH:mm" /></span>
			</div>
		</div>
		
	</div>
</div>

<script type="text/javascript">

 
 // Enhance active treatment checkbox behaviour so we don't get contradictions between 'No' and other selections
 $('#TAF12ActiveTmnt0').click ( function ()	{
	 if ( $('#TAF12ActiveTmnt0').prop("checked"))	{
		 $('#TAF12ActiveTmnt1').prop("checked", false);
		 $('#TAF12ActiveTmnt2').prop("checked", false);
		 $('#TAF12ActiveTmnt3').prop("checked", false);
		 $('#TAF12ActiveTmnt4').prop("checked", false);
	 }
	 
 });
 $('#TAF12ActiveTmnt1').click ( function ()	{
		 if ( $('#TAF12ActiveTmnt1').prop("checked"))	{
			 $('#TAF12ActiveTmnt0').prop("checked", false);
		 }
 });
 $('#TAF12ActiveTmnt2').click ( function ()	{
	 if ( $('#TAF12ActiveTmnt2').prop("checked"))	{
		 $('#TAF12ActiveTmnt0').prop("checked", false);
	 }
});
$('#TAF12ActiveTmnt3').click ( function ()	{
	 if ( $('#TAF12ActiveTmnt3').prop("checked"))	{
		 $('#TAF12ActiveTmnt0').prop("checked", false);
	 }
});
$('#TAF12ActiveTmnt4').click ( function ()	{
	 if ( $('#TAF12ActiveTmnt4').prop("checked"))	{
		 $('#TAF12ActiveTmnt0').prop("checked", false);
	 }
});

var numred = '';
var numamber = '';
var numgreen = '';

// Assess symptoms and other patient information and calculate assessment grading, update message text and style on page accordingly
function assessSymptoms ()	{
	numred = 0;
	numgreen = 0;
	numamber = 0;
	
	$('.grade > input[type=radio]:checked').each(function ()	{
		
			if (this.value == 0)
				numgreen++;
			if (this.value == 1)
				numamber++;
			if (this.value == 2)
				numred++;
	});
	
	
	// If temperature is specified, check if patient has hypothermia
	 var temp = $('#TAF16PatientTemp').val();
	 var hypothermia = false;
	 var warningTemp = 35.0;		// Hypothermia less than this temp, according to Wikipedia
	 if (temp != '' &&  ( ! isNaN(temp)) && temp <= warningTemp)	{
		 hypothermia = true;
	 }
	 
	 // If patient has a central line, it's red
	 var hasCentralLine = false;
	 if ( $('#TAF17CentralLine0').prop('checked') )
		 hasCentralLine = true;
	 
	 // If patient ereceiving treatment recently, it's a red
	 var recentTreatment = false;
	 if ( $('#TAF15LastTmnt0').prop('checked') || $('#TAF15LastTmnt1').prop('checked') )
		 recentTreatment = true;
	 
	 // Determine assessment grading
	 if (numred > 0 || hypothermia || hasCentralLine || recentTreatment || ( numred == 0 && numamber >= 2))	{
		 // red alert
		 $('#TAFAssessmentGrading').val('Triage Assessment: Red: Urgent Assessment and Review');
		 $('#assessmentGradingDiv').text('Triage Assessment: Red: Urgent Assessment and Review');
		 $('#assessmentGradingDiv').removeClass('triage_green triage_amber').addClass('triage_red');
	 } else if (numamber == 1)	{
		 // amber alert
		 $('#TAFAssessmentGrading').val('Triage Assessment: Amber: Follow up Review');
		 $('#assessmentGradingDiv').text('Triage Assessment: Amber: Follow up Review');
		 $('#assessmentGradingDiv').removeClass('triage_green triage_red').addClass('triage_amber');
	 } else	{
		 // green
		 $('#TAFAssessmentGrading').val('Triage Assessment: Green: Advise');
		 $('#assessmentGradingDiv').text('Triage Assessment: Green: Advise');
		 $('#assessmentGradingDiv').removeClass('triage_red triage_amber').addClass('triage_green');
	 }
	 
}

$('[id^=TAF15LastTmnt]').click (function () 	{
	assessSymptoms();
});

$('#TAF17CentralLine0').click( function()	{
	assessSymptoms();
});

$('#TAF17CentralLine1').click( function()	{
	assessSymptoms();
});
// if temp changes, check for hypothermia
$('#TAF16PatientTemp').change( function()	{
	assessSymptoms();
});

//calculate triage grading when any of the symptoms radios are clicked
$('.grade > input:radio').click( function() {
	assessSymptoms();
});

//calculate assessment grading when page initially loads
$( document ).ready(function() {
	assessSymptoms();
});

</script>