{% set absUrl = app.request.getSchemeAndHttpHost() ~ app.request.baseUrl|replace({'/app_dev.php': ''}) %}
{% set userData = app.session.get('userData') %}
<!DOCTYPE html>
<html class="no-js" lang="en" dir="ltr">
<head>
    <meta charset="utf-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DSRC Letter</title>
</head>
<body style="font-family:'Arial'; font-size:16px;">
<div style="width:768px; position: relative; padding:0px; margin: 0 auto; box-shadow:3px 1px 10px 1px;">
    <h2 style="text-align: center; margin-top:35px; padding-right: 40px;">Fax Cover Sheet</h2>
    <div style="margin-top:12px; height: 150px; width:100%;">

        {% set attn = '' %}
        {% if faxingOption.referringHealthFacility is not null or faxingOption.referringHealthFacility != '' %}
            {% set attn = faxingOption.referringHealthFacility.description %}
        {% elseif faxingOption.referringProvider is not null or faxingOption.referringProvider != '' %}
            {% set attn = 'Dr. '~faxingOption.referringProvider.fullName %}
        {% else %}
            {% set attn = faxingOption.insurance.description %}
        {% endif %}

        <div style="width: 50%; height: 150px; float: left; box-sizing: border-box; padding-right: 5px;">
            <p style="margin-bottom: 5px;">TO:</p>
            <div style="width: 100%; height: 100%; border:1px solid #000; box-sizing: border-box; padding:10px;">
                <table>
                    <tr>
                        <td style="width: 15%;">ATTN</td>
                        <td style="width: 2%;">:</td>
                        <td style="width: 83%;">{{ attn }}</td>
                    </tr>
                    <tr>
                        <td style="width: 15%;">RE</td>
                        <td style="width: 2%;">:</td>
                        <td style="width: 83%;">{{ faxingOption.patient.fullName|default('') }}</td>
                    </tr>
                    <tr>
                        <td style="width: 15%;">Date</td>
                        <td style="width: 2%;">:</td>
                        <td style="width: 83%;">{{ faxingOption.createdAt|date('m/d/Y') }}</td>
                    </tr>
                    <tr>
                        <td style="width: 15%;">Phone</td>
                        <td style="width: 2%;">:</td>
                        <td style="width: 83%;">{{ faxingOption.referringHealthFacility ? faxingOption.referringHealthFacility.phoneNo : ''  }}</td>
                    </tr>
                    <tr>
                        <td style="width: 15%;">Fax</td>
                        <td style="width: 2%;">:</td>
                        <td style="width: 83%;">{{ faxingOption.faxNo|default('') }}</td>
                    </tr>
                </table>
            </div>
        </div>
        <div style="width: 50%; height: 150px; float: right; box-sizing: border-box; padding-left: 5px;">
            <p style="margin-bottom: 5px;">FROM:</p>
            <div style="width: 100%; height: 100%; border:1px solid #000; box-sizing: border-box; padding:10px;">
                <table>
                    <tr>
                        <td style="width: 40%;">Name</td>
                        <td style="width: 60%;"> {{ userData.fullName }}</td>
                    </tr>
                    <tr>
                        <td style="width: 40%;">Pages</td>
                        {#<td style="width: 60%;">: {{ patientLetter.page != '' or patientLetter.page is not null ? patientLetter.page : '2' }}</td>#}
                        <td style="width: 60%;">: {{ faxingOption.page|default('') }}</td>
                    </tr>
                </table>
            </div>
        </div>
    </div>
    {% set faxCoverSelection = faxingOption.faxCoverSelection|split(',') %}
    <div style="width:100%; height: 70px; margin-top: 56px; box-sizing: border-box; padding:20px; border:1px solid #000;">
        <div style="width: 100%; height: 100%;">
            <input type="checkbox" id="urgent" style="height: 18px; width:18px;" {{ 1 in faxCoverSelection ? 'checked' : '' }}><label style="font-size: 18px; margin-right:40px;"><strong>Urgent</strong></label>
            <input type="checkbox" id="urgent" style="height: 18px; width:18px;" {{ 2 in faxCoverSelection ? 'checked' : '' }}><label style="font-size: 18px; margin-right:40px;"><strong>For Review</strong></label>
            <input type="checkbox" id="urgent" style="height: 18px; width:18px;" {{ 3 in faxCoverSelection ? 'checked' : '' }}><label style="font-size: 18px; margin-right:40px;"><strong>Please Comment</strong></label>
            <input type="checkbox" id="urgent" style="height: 18px; width:18px;" {{ 4 in faxCoverSelection ? 'checked' : '' }}><label style="font-size: 18px; margin-right:40px;"><strong>Please Reply</strong></label>
        </div>
    </div>
    <div style="width: 100%; height: 500px; margin-top:11px; border: 1px solid #000; box-sizing: border-box; padding:20px;">
        {{ faxingOption.customBody|raw }}
    </div>
    <p style="font-size: 10px;">"This Facsimile transmission contains information which is confidential and/or privileged. This information is intended for use only by the addressee indicated above. If you are not the intended recipient, please be advised that any disclosure, copying, distribution or use of the contents of this information is stricly prohibited, and that any misdirected or improperly received information must be returned to this company immediately. Your cooperation in phoning us of erroneous receipt is requested."</p>
    <!-- <div style="height: 300px; position: relative;"></div>
    <div style="width: 100%; height: 60px; color:#717171; position: fixed;">
        <div style="width:20%; float: left; font-size: 12px;">
            <p style="margin:0;"><strong>EDMONTON NORTH</strong></p>
            <p style="margin:0;">Mira Health Clinic</p>
            <p style="margin:0;">Unit 108, 1190-111 Ave.</p>
            <p style="margin:0;">Edmonton, Alberta</p>
            <p style="margin:0;">T5G 3G6</p>
        </div>
        <div style="width:20%; float: left; font-size: 12px;">
            <p style="margin:0;"><strong>EDMONTON SOUTH</strong></p>
            <p style="margin:0;">Millwoods</p>
            <p style="margin:0;">6570 28 Ave NW</p>
            <p style="margin:0;">Edmonton, Alberta</p>
            <p style="margin:0;">T6L 6N3</p>
        </div>
        <div style="width:19%; float: left; font-size: 12px;">
            <p style="margin:0;"><strong>CALGARY NORTH</strong></p>
            <p style="margin:0;">Bldg. 107, 12 Ave. NW</p>
            <p style="margin:0;">Calgary, Alberta</p>
            <p style="margin:0;">T2M 0C4</p>
        </div>
        <div style="width:19%; float: left; font-size: 12px;">
            <p style="margin:0;"><strong>CALGARY SOUTH</strong></p>
            <p style="margin:0;">#44, 6130-1A Street</p>
            <p style="margin:0;">Calgary, Alberta</p>
            <p style="margin:0;">T2H 0G3</p>
        </div>
        <div style="width:22%; float: left; font-size: 12px;">
            <p style="margin:0;"><strong>SHERWOOD PARK</strong></p>
            <p style="margin:0;">Unit 168, 150 Chippewa Road</p>
            <p style="margin:0;">Sherwood Park, Alberta</p>
            <p style="margin:0;">T8A 6A</p>
        </div>
    </div> -->
</div>