{% extends "base.html" %}

{% block title %}
Long image follow-up
{% endblock %}

{% block content %}
    <h2>Long image follow-up</h2>
    <table>
    <thead>
          <tr>
              <th>No.</th>
              <th>姓名</th>
              <th>病歷號</th>
              <th>性別</th>
              <th>生日</th>
              <th>地址</th>
              <th>診斷</th>
              <th>身份證號</th>
              <th>追蹤日數</th>
              <th>治療日期</th>
              <th>追蹤日期</th>
              <!-- <th>Memo</th> -->
              <th>最後輸入</th>
              <th>測量</th>
              <!-- <th>Print</th> -->
          </td>
    </thead>
    <tbody>
        {% for patient, days, tdate, idate, vdate in results %}
        <tr>
            <td>{{ forloop.counter }}</td>
            <td><a href='/patient/detail/{{patient.id}}/'>{{ patient.name }}</a></td>
            <td>{{ patient.medical_records }}</td>
            <td>{{ patient.get_gender_display }}</td>
            <td>{{ patient.birthday }}</td>
            <td>{{ patient.address }}</td>
            <td>
              {% for treatment in patient.treatment_set.all %}
                {{ treatment.icd9 }}<br/>
              {% endfor %}
            </td>
            <td>{{ patient.id_cards }}</td>
            <td>{{ days }}</td>
            <td>{{ tdate }}</td>
            {% ifequal idate vdate %}
              <td>{{ idate }}</td>
            {% else %}
              <td><em></>{{ idate }}</em></td>
            {% endifequal %}
            <td>{{ vdate }}</td>
            <!-- <td>
              {{ patient.memo }}
              {% if patient.dead %}
              <em>{{patient.dead}}�{�</em>
              {% endif %}
            </td>
 -->
            <td><a href='/followup/new_volume/{{patient.id}}/?tdate={{tdate}}&idate={{idate}}'><img 
              src="http://ck.ntuh.net/site_media/open_icon_library-full/icons/png/24x24/actions/measure.png" 
              alt="Measure" border=0 title="Measure"/></a></td>
              
            <!-- <td>{{form.dead}}</td> -->
       </tr>
        {% endfor %}
    </tbody>
    </table>
{% endblock %}