{% extends '@RxConnexion/Admin/global.html.twig' %}
{% block body %}
{#    <form method="GET" action="{{ path('dashboard_appointment_notice_preview') }}">
        <div class="large-5 columns">
            <div class="input-group">
                <label class="input-group-label">Branch</label>
                <select class="input-group-field" name="branch[]" multiple size="2">
                    <option value='All'>All</option>
                    {% for h in healthFacilities %}
                        <option value={{ h.id }} {{ h.id == branch ? 'selected' : '' }}>{{ h.description }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>
        </div>
        #}{#<div class="large-4 columns">
            <div class="input-group">
                <label class="input-group-label" style="width: 175px;">Encounter Type</label>
                <select class="input-group-field" name="chartType">
                    <option value='All'>All</option>
                    {% for h in chartTypes %}
                        <option value={{ h.id }} {{ h.id == chartType ? 'selected' : '' }}>{{ h.description }}</option>
                    {% endfor %}
                </select>
            </div>
        </div>#}{#
        <div class="large-7 columns">
            <button type="submit" class="button just-continue" value=""
                    data-message="Are you sure you want to save this information?"
            >Apply filter</button>
        </div>
    </form>#}
    <div class="large-12 columns">
        <h5 class="report-header">{{ page_title }}</h5>
    </div>
    <div class="large-12 columns">
        <table class="report-data" width="100%">
            <thead class="header">
            <tr>
                <th>Patient</th>
                <th>Letter Type</th>
                <th>Recipient</th>
                <th>Status</th>
            </tr>
            </thead>
            <tbody>
            {% for record in records %}
                <tr>
                    <td><a href="{{ path('patient_detail', {patient_id : record.ptId|base64Encode, tab:'l'}) }}" target="_blank">{{ record.patient }}</a></td>
                    <td>{{ record.letterType }}</td>
                    {% if record.referringProvider is not null %}
                        <td>{{ record.referringProvider }}</td>
                    {% elseif record.referringHealthFacility is not null %}
                        <td>{{ record.referringHealthFacility }}</td>
                    {% else %}
                        <td>{{ record.patientInsurance }}</td>
                    {% endif %}
                    <td>{{ record.status }}</td>
                </tr>
            {% endfor %}
            <tr>
                <td colspan="8">Total: {{ records|length|number_format(0, '.', ',') }}</td>
            </tr>
        </table>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
{% endblock %}