<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
<script Language="JavaScript"><!--
function FrontPage_Form1_Validator(theForm)
{

  if (theForm.ChartNo.value == "")
  {
    alert("請在 \"ChartNo\" 欄位輸入一數值。");
    theForm.ChartNo.focus();
    return (false);
  }

  if (theForm.ChartNo.value.length < 6)
  {
    alert("在 \"ChartNo\" 欄位，至少請輸入 6 的字元。");
    theForm.ChartNo.focus();
    return (false);
  }

  if (theForm.ChartNo.value.length > 7)
  {
    alert("在 \"ChartNo\" 欄位，最多請輸入 7 的字元。");
    theForm.ChartNo.focus();
    return (false);
  }
  return (true);
}
//--></script>
<html>
<head>

<script type="text/javascript" src="/site_media/js/date.js"></script>
<script type="text/javascript">
function days_between(date1, date2) {

    date1 = Date.parse(date1);
    date2 = Date.parse(date2);

    // The number of milliseconds in one day
    var ONE_DAY = 1000 * 60 * 60 * 24

    // Convert both dates to milliseconds
    var date1_ms = date1.getTime()
    var date2_ms = date2.getTime()

    // Calculate the difference in milliseconds
    var difference_ms = Math.abs(date1_ms - date2_ms)

    // Convert back to days and return
    return Math.round(difference_ms/ONE_DAY)

}
</script>
<title>電腦刀影像導引立體定位放射手術摘要</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" fprolloverstyle="">		A:hover {
			color: red;
		}
</style>
</head>

<body>
<div id="PrintButton"  style="position: absolute; left:0in; top:0in; width:120px; height: 50px; z-index: 20">
    <button id=BUTTON1 language=JavaScript name="b_print" onclick="doprint();" style="HEIGHT:25px; WIDTH:140px; background-color:#D0E8FF;">
        <font size="2" color="#ff0000">列 印 記 錄 摘 要</font>
    </button>
</div>

<center>
  <table width="563" height="0" border="0" cellpadding="0" cellspacing="0" id="tbl" name="tbl" >
  <tr>
  <td width="563" height="0" align="center"><font size="4" face="標楷體" color="#003366">
      國 立 台 灣 大 學 醫 學 院 附 設 醫 院</font></td>
  </tr>
  <tr>
  <td width="563" height="0" align="center"><font size="3" face="標楷體" color="#003366">National Taiwan University Hospital</font></td>
  </tr>
  <tr>
  <td width="563" height="40" align="center">
  <font size="5" face="標楷體" color="#003366">電腦刀影像導引立體定位放射手術摘要</font></td>
  </tr>
  </table>
</center>

<center>
<table name="tbl" id="tbl" border="0" cellpadding="0" cellspacing="0" width="660">
	    <tr>
	        <td width="12%" height="20"><font size="3" >病歷號:</font></td>
    	    <td width="21%" height="20"><font size="3" >{{patient.medical_records}}</font></td>
	        <td width="8%"  height="20"><font size="3" >姓名:</font></td>
	        <td width="22%" height="20"><font size="3" >{{patient.name}}</font></td>
		    <td width="8%"  height="20"><font size="3" >床號:</font></td>
		    <td width="18%" height="20"><font size="3" ></font></td>
		    <td width="3%"  height="20"><font size="2" >&nbsp;</font></td>
            <td width="2%"  height="20"><font size="3" >&nbsp;</font></td>
		    <td width="6%"  height="20"><font size="2" >&nbsp;</font></td>
        </tr>
</table>

  <div id="Layer1" style="position:absolute; top:750px; width:12px; height:160px; z-index:21; left: 0px;">
    <p><font size="1" face="標楷體">民國95年5月26日病歷委員會修正通過</font></p>
</div>

  <!--<div id="Layer1" style="position:absolute; left:610px; top:990px; width:80px; height:22px; z-index:23"><font size="2">
    MR09-19-6</font></div>

    662
-->


  <table width="650" height="740" border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" id="outside" name="outside">
    <tr>

      <td height="42" colspan="3" valign="top"><font size="3" >性別:
        {{patient.get_gender_display}}
        </font></td>

      <td colspan="3" valign="top"><font size="3" >出生日期:<br>
        {{patient.birthday}}</font></td>

      <td colspan="3" valign="top"><font size="3" >電話:
        {{patient.phone}}</font></p></td>
          </tr>

{% for treatment in treatments %}

<tr align="center">

      <td colspan="3" bgcolor="#FF0000">療程</td>
    		<td colspan="6" bgcolor="#FF0000" >

				<font size="5">{{forloop.counter}}</font>
			 　</td>
</tr>

<tr bgColor="#a5a5a5" align="center">

      <td colspan="3" bgcolor="#F8F0E0"><font color="#800000">ICD9診斷</font></td>
			<td colspan="3" bgcolor="#F8F0E0"><font color="#800000">其他診斷</font></td>
			<td colspan="3" bgcolor="#F8F0E0"><font color="#800000">備註</font></td>
</tr>

<tr align="center">
			<td colspan="3" align="left">{{treatment.icd9|default:"　"}}</td>
			<td colspan="3" align="left">{{treatment.other_diagnosis|default:"　"}}</td>
			<td colspan="3" align="left">{{treatment.memo|default:"　"}}</td>
</tr>

<tr align="center">

      <td colspan="2" bgcolor="#F8F0E0"><font color="#800000">開始<br>日期</font></td>
						<td bgcolor="#F8F0E0"><font color="#800000">結束<br>日期</font></td>
						<td bgcolor="#F8F0E0"><font color="#800000">療程<br>日數</font></td>
						<td colspan="2" bgcolor="#F8F0E0"><font color="#800000">主治<br>醫師</font></td>
						<td bgcolor="#F8F0E0"><font color="#800000">完成<br>治療</font></td>
						<td colspan="2" bgcolor="#F8F0E0"><font color="#800000">併發症</font></td>
</tr>

<tr align="center">
						<td colspan="2" >{{treatment.date_started}}</td>
						<td>{{treatment.date_completed}}</td>
						<td><script type="text/javascript">document.write(1+days_between('{{treatment.date_completed}}','{{treatment.date_started}}'));</script></td>
						<td colspan="2" >{%if treatment.surgeon%}{{treatment.surgeon}}/{%endif%}{{treatment.oncologist}}</td>
						<td>{{treatment.input}}</td>
						<td colspan="2" >
						{{treatment.complications|default:"　"}}</td>
</tr>

<tr align="center">
							<td bgcolor="#F8F0E0" width="8%"><font color="#800000">部位</font></td>
							<td bgcolor="#F8F0E0" width="8%"><font color="#800000">方式</font></td>
							<td bgcolor="#F8F0E0" width="14%"><font color="#800000">放射<br>能量</font></td>
							<td bgcolor="#F8F0E0" width="7%"><font color="#800000">治療<br>次數</font></td>
							<td bgcolor="#F8F0E0" width="10%"><font color="#800000">總劑量</font></td>
							<td bgcolor="#F8F0E0" width="14%"><font color="#800000">開始<br>日期</font></td>
							<td bgcolor="#F8F0E0" width="12%"><font color="#800000">結束<br>日期</font></td>
							<td bgcolor="#F8F0E0" width="7%"><font color="#800000">療程<br>日數</font></td>
							<td bgcolor="#F8F0E0" width="17%"><font color="#800000">備註</font></td>
</tr>

{% for lesion in treatment.lesion_set.all %}

<tr align="center">
							<td>{{lesion.sub_location.target_location}}-{{lesion.sub_location}}</td>
							<td>CyberKnife</td>
							<td>6MV光子</td>
							<td>{{lesion.fractions}}</td>
							<td>{{lesion.dose}} at {{lesion.iso_dose_curve}}%</td>
							<td>{{lesion.start_date}}</td>
							<td>{{lesion.end_date}}</td>
							<td><script type="text/javascript">document.write(1+days_between('{{lesion.end_date}}','{{lesion.start_date}}'));</script></td>
							<td align="left">{{lesion.memo|default:"　"}}</td>
</tr>

{% endfor %}

<!--<div id="Foot1">
<tbody>
<tr align="center">

							<td>部位 (二)</td>
							<td colspan="8" align="left"></td>


</tr>
</tbody>
</div>-->

{% endfor %}

</table>


</center>

<!--
<div id="Foot">
<br>
<center>
<hr><br><br>
<font size="1">系統分析設計：資訊室    吳立婷    分機：1096<br>最後更新日期：2006/2/10</font><br>
</center>
</div>
</body>
-->

</html>
<script language="JavaScript">
function doprint() {
	// 列印前先將 "列印"按鈕 hide 起來
	//PrintButton.style.display='none';
	//QueryChartNo.style.display='none';
	//RTInsert.style.display='none';
	//Foot.style.display='none';
	var odiv = document.getElementsByTagName("div")
	for(i=0; i < odiv.length; i++){
		//alert(odiv.length);
		//alert(odiv[i].id);
		if( odiv[i].id != "" )
		odiv[i].style.display='none';
	}
	window.print();
	// 列印完之後再將 "列印"按鈕 show 出來
//	QueryChartNo.style.display='inline';
//	PrintButton.style.display='inline';
//	RTInsert.style.display='inline';
//	Foot.style.display='inline';
//	for(i=0; i < odiv.length; i++)
//		odiv[i].style.display='inline';
}
</script>

