<%@ 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"/>

<input type="hidden" value="false" id="unsaveButtonId">

<div class="container">
	<div class="sectionSubPageTop">
		<h2>Assessment Milestones</h2>
		<div class="fieldSet2Column" style="text-align: left;">
			<span class="inputLabel">Patient's baseline toxicity and performance status are recorded accurately.<br/>
			The patient toxicity assessment needs to be completed prior to each chemotherapy cycle.</span>
		</div>
		<div class="fieldSet2Column" style="text-align: left;">
			<p>This toxicity assessment form 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/ChemoF4NN/Guidance%20notes%20for%20patient%20toxicity%20assessment%20Nov%202016.pdf" target="_blank">Instructions for Toxicity Assessment
					<img src="../emdt/images/16x16/pdf.gif" title="Click to open instructions" alt="PDF" />
			</a></span>
		</div>
		<div class="fieldSet2Column">
			<hr />
		</div>
		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Patient Treatment Stage:</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
			<c:set var="tempOptionsMapDomain" value="EMDT"/>
			<c:set var="tempOptionsMapName" value="Chemo_Patient_Treatment_Stage"/>
			<webapp:namedList id="nl" domain="${tempOptionsMapDomain }" name="${tempOptionsMapName}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
				<c:forEach var="pair" items="${nl.pairIterator}" varStatus="radioCount">
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1PatStage]" value="${pair.first}" id="CF4NP1PatStage${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;
				</c:forEach>
			</span>
		</div>

		<div class="fieldSet2Column"></div>

		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Cycle nbr:</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<webapp:namedListSpring path='value[CF4NP1PatCycle]'  id="CF4NP1PatCycle" disabled="${readOnly}" domain="EMDT" name="Chemo_Cycle_Nbr"
					currentValue="${consultationNoteForm.value['CF4NP1PatCycle']}" 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[CF4NP1PatDay]'  id="CF4NP1PatDay" disabled="${readOnly}" domain="${'EMDT'}" name="${'Chemo_Day_Nbr'}"
					currentValue="${consultationNoteForm.value['CF4NP1PatDay']}" nlFromFormDefinition="${namedListMap['EMDT']['Chemo_Day_Nbr']}"/>
			</span>
		</div>
	</div>



	<div class="sectionSubPageTop">
		<h2>Toxicity Assessment</h2>
		<c:set var="tempOptionsMapDomain" value="EMDT"/>
		<c:set var="tempOptionsMapName" value="Chemo_ECOG_Status"/>
		<webapp:namedList id="nl_Chemo_ECOG_Status" domain="${tempOptionsMapDomain }" name="${tempOptionsMapName}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
		<c:set var="tempOptionsMapName" value="YesNo"/>
		<webapp:namedList id="nl_YesNo" domain="${tempOptionsMapDomain }" name="${tempOptionsMapName}" nlFromFormDefinition="${namedListMap[tempOptionsMapDomain][tempOptionsMapName]}"/>
		
		<table id="toxicity_table">
			<tr>
				<th>Toxicity</th>
				<th>Grade</th>
				<th>Comment</th>
			</tr>
		</table>

		<div class="tox_left_col">
			
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<div class="gh">0</div><div class="gh">1</div><div class="gh">2</div><div class="gh">3</div><div class="gh">4</div>
			</div>
		</div>
		<div class="tox_right_col">
		</div>

		<div class="tox_left_col">
			<span class="tox_label">Performance status:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1PerfStat]" value="${pair.first}" id="CF4NP1PerfStat${radioCount.count}" title="Grade ${pair.second}" /><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtPerf]" size="75" id="CF4NP1CmtPerf" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Nausea:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Nausea]" value="${pair.first}" id="CF4NP1Nausea${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtNaus]" size="75" id="CF4NP1CmtNaus" readonly="${readOnly}" />
		</div>

		<div class="tox_left_col">
			<span class="tox_label">Vomiting:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Vomit]" value="${pair.first}" id="CF4NP1Vomit${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtVom]" size="75" id="CF4NP1CmtVom" readonly="${readOnly}" />
		</div>

		<div class="tox_left_col">
			<span class="tox_label">Mucositis / stomatitis:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Muco]" value="${pair.first}" id="CF4NP1Muco${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtMuco]" size="75" id="CF4NP1CmtMuco" readonly="${readOnly}" />
		</div>

		<div class="tox_left_col">
			<span class="tox_label">Diarrhoea:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Diar]" value="${pair.first}" id="CF4NP1Diar${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtDiar]" size="75" id="CF4NP1CmtDiar" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Constipation:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Const]" value="${pair.first}" id="CF4NP1Const${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtCons]" size="75" id="CF4NP1CmtCons" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Fever/Pyrexia/Infection:</span>
		</div>
		<div class="tox_mid_col">
			<div class="grrrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Fever]" value="${pair.first}" id="CF4NP1Fever${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtFever]" size="75" id="CF4NP1CmtFever" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">PPE:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1PPE]" value="${pair.first}" id="CF4NP1PPE${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtPPE]" size="75" id="CF4NP1CmtPPE" readonly="${readOnly}" />
		</div>



		<div class="tox_left_col">
			<span class="tox_label">Fatigue:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Fatig]" value="${pair.first}" id="CF4NP1Fatig${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtFatig]" size="75" id="CF4NP1CmtFatig" readonly="${readOnly}" />
		</div>



		<div class="tox_left_col">
			<span class="tox_label">Pain:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Pain]" value="${pair.first}" id="CF4NP1Pain${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtPain]" size="75" id="CF4NP1CmtPain" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Anorexia:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
					<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Anor]" value="${pair.first}" id="CF4NP1Anor${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtAnor]" size="75" id="CF4NP1CmtAnor" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Dyspnoea:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Dyps]" value="${pair.first}" id="CF4NP1Dyps${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtDysp]" size="75" id="CF4NP1CmtDysp" readonly="${readOnly}" />
		</div>



		<div class="tox_left_col">
			<span class="tox_label">Alopecia:</span>
		</div>
		<div class="tox_mid_col">
			<div class="ggyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Alop]" value="${pair.first}" id="CF4NP1Alop${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtAlop]" size="75" id="CF4NP1CmtAlop" readonly="${readOnly}" />
		</div>



		<div class="tox_left_col">
			<span class="tox_label">Rash:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Rash]" value="${pair.first}" id="CF4NP1Rash${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtRash]" size="75" id="CF4NP1CmtRash" readonly="${readOnly}" />
		</div>



		<div class="tox_left_col">
			<span class="tox_label">Chest pain:</span>
		</div>
		<div class="tox_mid_col">
			<div class="grrrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Chest]" value="${pair.first}" id="CF4NP1Chest${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtChest]" size="75" id="CF4NP1CmtChest" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Neuropathy:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyrrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Neuro]" value="${pair.first}" id="CF4NP1Neuro${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtNeur]" size="75" id="CF4NP1CmtNeur" readonly="${readOnly}" />
		</div>



		<div class="tox_left_col">
			<span class="tox_label">Bleeding or bruising:</span>
		</div>
		<div class="tox_mid_col">
			<div class="grrrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Bleed]" value="${pair.first}" id="CF4NP1Bleed${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtBleed]" size="75" id="CF4NP1CmtBleed" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Urinary disorder:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyyrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Urin]" value="${pair.first}" id="CF4NP1Urin${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtUrin]" size="75" id="CF4NP1CmtUrin" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Ocular/Eye problems:</span>
		</div>
		<div class="tox_mid_col">
			<div class="gyrrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1Eye]" value="${pair.first}" id="CF4NP1Eye${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtEye]" size="75" id="CF4NP1CmtEye" readonly="${readOnly}" />
		</div>


		<div class="tox_left_col">
			<span class="tox_label">Other:</span>
		</div>
		<div class="tox_mid_col">
			<div class="grrrr">
				<c:forEach var="pair" items="${nl_Chemo_ECOG_Status.pairIterator}" varStatus="radioCount"><div class="grade g<c:out value="${pair.second}"/>" title="Grade ${pair.second}"><smvc:radiobutton disabled="${readOnly}" path="multiValue[CFP1Other]" value="${pair.first}" id="CFP1Other${radioCount.count}" title="Grade ${pair.second}"/><c:out value="${pair.second}"/></div></c:forEach>
			</div>
		</div>
		<div class="tox_right_col">
			<smvc:input disabled="false" path="value[CF4NP1CmtOther]" size="75" id="CF4NP1CmtOther" readonly="${readOnly}" />
		</div>

	<div class="fieldSet2Column">
		Assessment Grading: <div id="assessmentGrading"></div>	<smvc:hidden disabled="false" path="value[CF4NP1AssessmentGrading]" id="CF4NP1AssessmentGrading" />
	</div>

	</div>


	<div class="sectionSubPageTop">
		<h2>Other Information</h2>

		<div class="fieldSet2Column">
			<hr />
		</div>


		<div class="fieldSetLeftColumn">
			<span class="inputLabel">Has the patient been admitted to hospital or been seen by a GP since treatment was prescribed?</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> 
				<c:forEach var="pair" items="${nl_YesNo.pairIterator}" varStatus="radioCount">		
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1PatAdm]" value="${pair.first}" id="CF4NP1PatAdm${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;	
				</c:forEach></span>
		</div>
		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Reason:</span>
			</div>
			<div class="fieldSetRightColumn">
				<span class="inputControl"> <smvc:textarea path="value[CF4NP1PatAdmReas]" cols="50" rows="" id="CF4NP1PatAdmReas" readonly="${readOnly}" /></span>
			</div>
		</div>
		<div class="fieldSet2Column">
		</div>

		<div class="fieldSet2Column">
			<hr />
		</div>

		<div class="fieldSetLeftColumn">
			<span class="inputLabelAbove">Relevant tumour marker taken:</span>
		</div>
		<div class="fieldSetRightColumn">
			<span class="inputControl"> <c:forEach var="pair" items="${nl_YesNo.pairIterator}" varStatus="radioCount">	
					<smvc:radiobutton disabled="${readOnly}" path="multiValue[CF4NP1RelTumMk]" value="${pair.first}" id="CF4NP1RelTumMk${radioCount.count}"/> <c:out value="${pair.second}"/>&nbsp;
				</c:forEach></span>
		</div>
		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Detail:</span>
			</div>
			<div class="fieldSetLeftColumn">
				<span class="inputControl"> <smvc:textarea path="value[CF4NP1RelTumDtl]" cols="50" rows="" id="CF4NP1RelTumDtl" readonly="${readOnly}" /></span>
			</div>
		</div>
		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Allergies:</span>
			</div>
			<div class="fieldSetLeftColumn">
				<span class="inputControl"> <smvc:textarea path="value[CF4NP1Allergy]" cols="50" rows="" id="CF4NP1Allergy" readonly="${readOnly}" /></span>
			</div>
		</div>

		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Additional Information:</span>
			</div>
			<div class="fieldSetLeftColumn">
				<span class="inputControl"> <smvc:textarea path="value[CF4NAddInf]" cols="50" rows="" id="CF4NAddInf" readonly="${readOnly}" /></span>
			</div>
		</div>
		
		<div class="fieldSet2Column">
			<div class="fieldSetLeftColumn">
				<span class="inputLabel">Last updated by:</span>
			</div>
			<div class="fieldSetLeftColumn">
				<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="fieldSetLeftColumn">
				<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">

/*
Assessment Grading: Calculated as follows
Red [Must be seen and reviewed by senior medical staff prior to treatment] = Patients flagging up 2x Ambers (or more) equates to a RED. As does any red outcome.
Amber [Review by senior nurse / medical staff]= 1x Amber AND / OR Patient has been seen by GP / admitted to hospital (Yes)
Green [Proceed with treatment] = All green AND No to Patient has been seen by GP

 */


 // Names of radio buttons which are coloured in sequence 0=green, 1=green, 2=yellow, 3=red, 4=red etc
var ggyrr_field_names = ["CF4NP1PerfStat", "CF4NP1Nausea", "CF4NP1Vomit", "CF4NP1Const", "CF4NP1Fatig", "CF4NP1Pain", "CF4NP1Anor", "CF4NP1Dyps", "CF4NP1Alop"];
var gyyrr_field_names = ["CF4NP1Muco", "CF4NP1Diar", "CF4NP1PPE", "CF4NP1Rash", "CF4NP1Urin"];
var grrrr_field_names = ["CF4NP1Fever", "CF4NP1Chest", "CF4NP1Bleed", "CFP1Other"];
var gyrrr_field_names = ["CF4NP1Neuro", "CF4NP1Eye"];

// Determine colour of a radio button from its name and numeric value
//   returns: colour name as string, e.g. 'red', 'green', 'amber', or 'unknown' as an error case.
//
function get_colour (name, value)	{
	
	// do the easy short cuts first, since all 0 is green and all 3 or 4 is red
	if (value == 0)
		return 'green';
	
	if (value == 3 || value == 4)
		return 'red';

	// all radios in this sequence are red apart from value 0
	for (i = 0; i < grrrr_field_names.length; i++)	{
		if (name.indexOf(grrrr_field_names[i]) != -1)	{
			return 'red';
		}
	}

	for (i = 0; i < gyrrr_field_names.length; i++)	{
		if (name.indexOf(gyrrr_field_names[i]) != -1)	{
			if (value == 2)		{
				return 'red';
			}
			return 'amber';
		}
	}
		
	if (value == 2)		{
		return 'amber';
	}
	
	// only 1 to distinguish now

	for (i = 0; i < ggyrr_field_names.length; i++)	{
		if (name.indexOf(ggyrr_field_names[i]) != -1)	
			return 'green';
	}
	for (i = 0; i < gyyrr_field_names.length; i++)	{
		if (name.indexOf(gyyrr_field_names[i]) != -1)	
		return 'amber';
	}
	
	return 'unknown';
}

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

// calculate assessment grading when any of the toxicity radios are clicked
$('.grade > input:radio').click( function() {
	setAssessmentGrading();
});
// calculate assessment grading when the 'patient admitted to hospital or seen gp' radio is clicked
$('#CF4NP1PatAdm0').click( function()	{
	setAssessmentGrading();
});
$('#CF4NP1PatAdm1').click( function()	{
	setAssessmentGrading();
});

// calculate assessment grading when page initially loads
$( document ).ready(function() {
	setAssessmentGrading();
});
//
// Calculate and dislay the assessment grading.
// Based on number of colours selected and state of 'patient admitted to hospital' radio button, determine appropriate warning message and display it in a DIV and a hidden field.
//
function setAssessmentGrading ()	{	
	var colour = '';
	numred = 0;
	numgreen = 0;
	numamber = 0;
	
	$('.grade > input[type=radio]:checked').each(function ()	{
			colour = get_colour(this.name, this.value);
			if (colour == 'red')
				numred++;
			if (colour == 'green')
				numgreen++;
			if (colour == 'amber')
				numamber++;
	});

	if (numred > 0 || numamber >= 2)	{
		// red alert
		$('#CF4NP1AssessmentGrading').val('Red: Must be seen and reviewed by senior medical staff prior to treatment');
		$('#assessmentGrading').text('Red: Must be seen and reviewed by senior medical staff prior to treatment');
		$('#assessmentGrading').css('color', 'red');
	}
	else if (numamber == 1 || $('#CF4NP1PatAdm0').prop("checked") == true) 	{
		$('#CF4NP1AssessmentGrading').val( 'Amber: Review by senior nurse / medical staff');
		$('#assessmentGrading').text( 'Amber: Review by senior nurse / medical staff');
		$('#assessmentGrading').css('color', 'orange');
	}
	else if (numamber == 0 && numred == 0 && $('#CF4NP1PatAdm0').prop("checked") != true && numgreen > 0)	{
		$('#CF4NP1AssessmentGrading').val ( 'Green: Proceed with treatment' );
		$('#assessmentGrading').text ( 'Green: Proceed with treatment' );
		$('#assessmentGrading').css('color', 'green');
	}
}
 
</script>