{% extends "remapp/base.html" %}

{% block navbar %}
            <li><a href="/openrem/ct">CT</a></li>
            <li><a href="/openrem/rf">Fluoroscopy</a></li>
            <li class="active"><a href="/openrem/mg">Mammography</a></li>
{% endblock %}


{% block mainblock %}		
<h1>Detail list of events</h1>

<ul>
    <li>Accession number: {{ general_study_module_attributes.accession_number }}</li>
    <li>Study date: {{ general_study_module_attributes.study_date }}</li>
    <li>Study time: {{ general_study_module_attributes.study_time }}</li>
    <li>Study description: {{ general_study_module_attributes.study_description }}</li>
    <li>Requested procedure: {{ general_study_module_attributes.requested_procedure_code_meaning }}</li>
    <li>Patient age: {{ general_study_module_attributes.patient_study_module_attributes_set.get.patient_age_decimal|floatformat:1 }}</li>
    <li>Hospital: {{ general_study_module_attributes.general_equipment_module_attributes_set.get.institution_name }}</li>
    <li>
        Scanner: 
        {{ general_study_module_attributes.general_equipment_module_attributes_set.get.manufacturer }} |
        {{ general_study_module_attributes.general_equipment_module_attributes_set.get.manufacturer_model_name }} |
        {{ general_study_module_attributes.general_equipment_module_attributes_set.get.station_name }}        
    </li>
    <li>Study UID: {{ general_study_module_attributes.study_instance_uid }}</li>
    <li>Test patient indicators? {{ general_study_module_attributes.patient_module_attributes_set.get.not_patient_indicator }}</li>
</ul>

<table class="table table-striped table-bordered">
    <th>Time</th>
    <th>Acquisition protocol</th>
    <th>View</th>
    <th>Compression thickness</th>
    <th>Target</th>
    <th>Filter</th>
    <th>kVp</th>
    <th>mA</th>
    <th>Exposure time</th>
    <th>ESD</th>
    <th>AGD (mGy)</th>
    {% for event in general_study_module_attributes.projection_xray_radiation_dose_set.get.irradiation_event_xray_data_set.all %}
    <tr>
        <td>{{ event.date_time_started|time:"H:i.s" }}</td>
        <td>{{ event.acquisition_protocol }}</td>
        <td>{{ event.image_view }}</td>
        <td>{{ event.irradiation_event_xray_mechanical_data_set.get.compression_thickness|floatformat:0  }}</td>
        <td>{{ event.irradiation_event_xray_source_data_set.get.anode_target_material }}</td>
        <td>{{ event.irradiation_event_xray_source_data_set.get.xray_filters_set.get.xray_filter_material }}</td>
        <td>{{ event.irradiation_event_xray_source_data_set.get.kvp_set.get.kvp|floatformat:0 }}</td>
        <td>{{ event.irradiation_event_xray_source_data_set.get.average_xray_tube_current|floatformat:0 }}</td>
        <td>{{ event.irradiation_event_xray_source_data_set.get.exposure_time|floatformat:0 }}</td>
        <td>{{ event.entrance_exposure_at_rp }}</td>
        <td>{{ event.irradiation_event_xray_source_data_set.get.average_glandular_dose }}</td>
    </tr>
    <tr>
        <td colspan = "11"><small> <strong>Exposure Control Mode Description:</strong>{{ event.comment }} </small></td>
    </tr>
    {% endfor %}
</table>



{% endblock %}	
