<%@ include file="/includes.jsp"%>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
<script type="text/javascript">
function saveComments() {
	var comment  = document.getElementById('comments').value;
	var formName = document.getElementById("formName");
	var formValue=null;
	if(formName!=null){
		formValue = document.getElementById("formName").value;
	}
	var maxLen = 250;
	if(comment==null){
		alert("Comment cannot be blank");
		return false;
	}else{
	    var returnValue =trimAll(comment);
	    if(returnValue.length==0){
	    	alert("Comment cannot be blank");
			return false;
	    }
	}
	if(comment.length > maxLen){
		alert("Maximum 250 characters only.");
		return false;
	} else {	
		document.getElementById("actionRequired").value = "savecomments";
		preSubmit();
		document.getElementById("consultationNote").submit();
	}
}
function trimAll(sString){
	while (sString.substring(0,1) == ' '){
		sString = sString.substring(1, sString.length);
	}
	while (sString.substring(sString.length-1, sString.length) == ' '){
		sString = sString.substring(0,sString.length-1);
	}
	return sString;
} 
function send() {
	if(confirm('Please confirm that you want to send this message to the referrer')){
		if("true" == document.getElementById('roleSupportingStaff').value){
			chooseSeniors();
		}else{
			document.getElementById("actionRequired").value = "save";
			preSubmit();
			document.getElementById("consultationNote").submit();
		}
		
	}
}

</script>
<%-- Requirement #336(New Images don't get automatically fetched)--%>
<c:set var="readOnly" value="false"/>
<c:if test="${consultationNoteForm.view.note.locked eq true}">
	<c:set var="readOnly" value="true"/>
</c:if>

<div class="sectionSubPageTop">
<input type="hidden" value="false" id="unsaveButtonId" />
<div class="label">Blood Test Results</div>
<div>&nbsp;</div>
<div class="fieldSetLeftColumn1">Date of Document</div>
<div class="fieldSetRightColumn1"><span class="inputLabel1">
	<spring:bind path='value[DateOfDocument]'>
		<c:choose>
			<c:when test="${disabled or readOnly}">
			<input type="text" name="value[DateOfDocument]" size="0" id="DateOfDocument" class="form-control" readonly="readonly" value="<c:out value="${consultationNoteForm.view.note.values[  'DateOfDocument']}"/>" disabled="disabled" placeholder="dd/mm/yyyy"/>
		</c:when>
		<c:otherwise>
			<input type="text" name="value[DateOfDocument]" size="0" id="DateOfDocument" class="form-control" value="<c:out value="${consultationNoteForm.view.note.values[  'DateOfDocument']}"/>" 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='DateOfDocument_DateTrigger' /></span></div>
<div class="fieldSetLeftColumn1">Attach Blood Test Document</div>

<div class="fieldSetRightColumn1"><span class="inputLabel1">
<tiles:insertTemplate template="/emdt/tiles/fileContent.jsp">
	<tiles:putAttribute name="fieldName" value="UploadedReport" />
	<tiles:putAttribute name="fieldWidth" value="0" />
	<tiles:putAttribute name="parentPage" value="standard" />
	<tiles:putAttribute name="disabled" value="${readOnly}"/>
</tiles:insertTemplate> </span></div>
</div>

<div class="sectionSubPageLeft">

<div class="label">Blood Test Results</div>
<div>&nbsp;</div>
<div class="fieldSetLeftColumn">Haemoglobin</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[HaemoglobinValue]" size="20" id="HaemoglobinValue" /></span></div>
<div class="fieldSetLeftColumn">White Cell</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[WhiteCellValue]" size="20" id="WhiteCellValue" /></span></div>
<div class="fieldSetLeftColumn">Platelets</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[PlateletsValue]" size="20" id="PlateletsValue" /></span></div>
<div class="fieldSetLeftColumn">Urea</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[UreaValue]" size="20" id="UreaValue" /></span></div>
<div class="fieldSetLeftColumn">Creatinine</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[CreatinineValue]" size="20" id="CreatinineValue" /></span></div>
<div class="fieldSetLeftColumn">Sodium</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[SodiumValue]" size="20" id="SodiumValue" /></span></div>
<div class="fieldSetLeftColumn">Potassium</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[PotassiumValue]" size="20" id="PotassiumValue" /></span></div>
<div class="fieldSetLeftColumn"><b>eGFR</b> (mandatory)</div>
<div class="fieldSetRightColumn"><span class="inputLabel">
<smvc:input readonly="${readOnly}" path="value[eGFRValue]" size="20" id="eGFRValue" /></span></div>

</div>
<div class="sectionSubPageRight">
<div class="label">Blood Test Results</div>
<div>&nbsp;</div>
<div class="fieldSetLeftColumn">Bilirubin</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[BilirubinValue]" size="20" id="BilirubinValue" /></span></div>
<div class="fieldSetLeftColumn">Transaminase</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[TransaminaseValue]" size="20"
	id="TransaminaseValue" /></span></div>
<div class="fieldSetLeftColumn">Alk. Phosphatase</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[AlkPhosphataseValue]" size="20"
	id="AlkPhosphataseValue" /></span></div>
<div class="fieldSetLeftColumn">PTime</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[PTimeValue]" size="20" id="PTimeValue" /></span></div>
<div class="fieldSetLeftColumn">Albumin</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[AlbuminValue]" size="20" id="AlbuminValue" /></span></div>
<div class="fieldSetLeftColumn">CEA</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[CEAValue]" size="20" id="CEAValue" /></span></div>
<div class="fieldSetLeftColumn">CA19-9</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[CA19-9Value]" size="20" id="CA19-9Value" /></span></div>
<div class="fieldSetLeftColumn">Alpha Fetoprotein</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[AlphaFetoproteinValue]" size="20"
	id="AlphaFetoproteinValue" /></span></div>
<div class="fieldSetLeftColumn">CA125</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[CA125Value]" size="20" id="CA125Value" /></span></div>
<div class="fieldSetLeftColumn">Other Blood Test (name)</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[OtherName]" size="40" id="OtherName" /></span></div>
<div class="fieldSetLeftColumn">Other Blood Test (value)</div>
<div class="fieldSetRightColumn"><span class="inputLabel"><smvc:input readonly="${readOnly}"
	path="value[OtherValue]" size="20" id="OtherValue" /></span></div>
</div>

