{% set absUrl = app.request.getSchemeAndHttpHost() ~ app.request.baseUrl|replace({'/app_dev.php': ''}) %}
{#{% set customBody = referral.customBody|replace({'{{PATIENT-FIRSTNAME}}' :  referral.patient.firstName, '{{PATIENT-FULLNAME}}' : referral.patient.fullName, '{{PATIENT-GENDER}}' : referral.patient.gender == 'Male' ? 'he' : 'she', '{{PATIENT-GENDER2}}' : referral.patient.gender == 'Male' ? 'him' : 'her', '{{PATIENT-GENDER3}}' : referral.patient.gender == 'Male' ? 'his' : 'her', '{{PATIENT-GENDER4}}' : referral.patient.gender == 'Male' ? 'He' : 'She'}) %}#}
{% 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:15px;">
{% set rp = referral.referringProvider %}
{% set patient = referral.patient %}
{% set receiverFullName = referral.referringProvider.honorific ~ ' ' ~ referral.referringProvider.fullName|title %}
{% set patientFullName = referral.fullName %}
{% set patientFirstName = referral.firstName %}
{% set patientLastName = referral.lastName %}
<div style="width:766px; height: 1056px; padding:10px; margin: 0 auto; box-shadow:3px 1px 10px 1px;">
    <div style="background: url({{ app.request.getSchemeAndHttpHost() ~ asset('bundles/rxconnexion/admin/images/dsrcwater.png') }}); width:768px; height: 882px; position: relative; padding:0px; margin: 0 auto; box-shadow:3px 1px 10px 1px;">x
        <div style="width:100%; height: 100px; text-align: left; position: relative;">
            <div style="width: 40%; float: left;">
                <img src="{{ app.request.getSchemeAndHttpHost() ~ asset('bundles/rxconnexion/admin/images/dynamiclogo.jpg') }}" style="width: 100%;"/>
            </div>
            <div style="float: right; height: 100%; width: 60%;">
                <div style="float: left; width: 60%; height: 100%; text-align: right;">
                    <div style="width: 100%; height: 100%;">
                        <input type="checkbox" id="add" style="height: 15px; width:15px;"><label style="font-size: 13px;"><strong>Edmonton Fax : 780-757-1210</strong></label>
                        <br>
                        <input type="checkbox" id="add" style="height: 15px; width:15px;"><label style="font-size: 13px;"><strong>Sherwood Park Fax : 780-570-0046</strong></label>
                        <br>
                        <input type="checkbox" id="add" style="height: 15px; width:15px;"><label style="font-size: 13px;"><strong>Calgary North Fax : 403-220-0038</strong></label>
                        <br>
                        <input type="checkbox" id="add" style="height: 15px; width:15px;"><label style="font-size: 13px;"><strong>Calgary South Fax : 780-300-0640</strong></label>
                    </div>
                </div>
                <div style="float: right; width: 40%; height: 100%;">
                    <img src="{{ app.request.getSchemeAndHttpHost() ~ asset('bundles/rxconnexion/admin/images/bbc.JPG') }}" style="width: 100%; height: auto;"/>
                </div>
            </div>
        </div>
        <div style="width: 100%; height: auto; text-align:left;">
            <div style="background-color: #e6f1f6; width: 98%; padding: 7px; font-size: 18px;">ACKNOWLEDGEMENT OF REFERRAL</div>
            <hr style="margin-top: 5px; margin-bottom: 0; height: 4px; background-color: #0076a9; width: 100%;">
            <div style="margin-top:10px; height: 180px; width:100%; padding: 5px;">
                <h3>TO:</h3>
                <div style="width: 49%; height: 100%; float: left; box-sizing: border-box;">
                    <div style="width: 100%; height: 100%; border:3px solid #0076a9; border-radius: 20px; box-sizing: border-box; padding:10px;">
                        <!-- <table style="font-size: 18px;">
						<tr>
							<td style="width: 30%;">Attention</td>
							<td style="margin-bottom: 10px;">: {{ receiverFullName }}</td>
						</tr>
						<tr>
							<td style="width: 40%;">RE</td>
							<td>: {{ patientFullName }}</td>
						</tr>
						<tr>
							<td style="width: 40%;">Date</td>
							<td>: {{ 'now'|date('F j, Y') }}</td>
						</tr>
						<tr style="margin-bottom: 10px;">
							<td style="width: 30%;">Phone</td>
							<td style="margin-bottom: 10px;">: {{ receiverFax }}</td>
						</tr>
						<tr style="margin-bottom: 10px;">
							<td style="width: 30%;">Fax</td>
							<td style="margin-bottom: 10px;">: {{ receiverFax }}</td>
						</tr>
					</table> -->
                        <h3 style="margin-top:0; font-size: 18px;">Attention : {{ receiverFullName }}</h3>
                        <hr style="border: 1px solid transparent">
                        <h3 style="font-size: 18px;">Phone : {{ receiverFax }}</h3>
                        <hr style="border: 1px solid transparent">
                        <h3 style="font-size: 18px;">Fax : {{ receiverFax }}</h3>
                    </div>
                </div>
                <div style="width: 2%; height: 100%; float: left;"></div>
                <div style="width: 49%; height: 100%; float: right; box-sizing: border-box;">
                    <div style="width: 100%; height: 100%; box-sizing: border-box; padding:10px;">
                        <h3 style="margin-top: 0; font-size: 18px;"><strong>Date: </strong> {{ 'now'|date('F j, Y') }}</h3>
                        <h3 style="margin-top: 0; font-size: 18px;">PATIENT</h3>

                        <!-- <table>
						<tr>
							<td style="width: 60%;">Name</td>
							<td>: {{ userData.fullName }}</td>
						</tr>
						<tr>
							<td style="width: 60%;">No. of Pages (inc. cover)</td>
							<td>: 2</td>
						</tr>
						<tr>
							<td style="width: 60%;">CC</td>
							<td>:___________</td>
						</tr>
					</table> -->
                        <div style="width: 95%; padding: 10px; border:3px solid #0076a9; border-radius: 20px;">
                            <h3 style="margin-top:0; font-size: 15px;">Name: {{ patientFullName }} </h3>
                            <h3 style="margin-top: 0; font-size: 15px;">PHN: {{ referral.personalHealthNo|default('N/A') }}</h3>
                        </div>
                    </div>
                </div>
            </div>
            <div style="width:100%; height: 70px; margin-top: 80px; box-sizing: border-box; padding:20px; border:3px solid #0076a9; border-radius: 15px;">
                <div style="width: 100%; height: 100%;">
                    <input type="checkbox" id="urgent" style="height: 18px; width:18px;"><label style="font-size: 18px; margin-right:40px;"><strong>Urgent</strong></label>
                    <input type="checkbox" id="urgent" style="height: 18px; width:18px;"><label style="font-size: 18px; margin-right:40px;"><strong>For Review</strong></label>
                    <input type="checkbox" id="urgent" style="height: 18px; width:18px;"><label style="font-size: 18px; margin-right:40px;"><strong>Please Comment</strong></label>
                    <input type="checkbox" id="urgent" style="height: 18px; width:18px;"><label style="font-size: 18px; margin-right:40px;"><strong>Please Reply</strong></label>
                </div>
            </div>
            <div style="border-radius:20px; width: 100%; height: auto; margin-top:25px; border: 3px solid #0076a9; box-sizing: border-box; padding:20px;">
                <h3 style="font-size:20px;">Dear {{ receiverFullName }}.</h3>
                <h3 style="font-size:20px;">We have received your referral. We are currently doing our best to contact and book the patient for Home Sleep Apnea Testing (HSAT).</h3>
                <h3 style="font-size:20px;">We will be sending an Appointment Notice once the patient have been booked.</h3>			<br>
                <h3 style="font-size:20px;">Thank you!</h3>
                <!-- <p style="margin:0;">{{ userData.fullName }}</p>
			<p style="margin:0;">Dynamic Sleep Respiratory Care</p> -->
            </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>
    </div>
    <div style="width: 100%; text-align: center; margin-top: 100px;">
        <img src="{{ app.request.getSchemeAndHttpHost() ~ asset('bundles/rxconnexion/admin/images/dsrc-footer.jpg') }}" style="width: 65%; height: auto;"/>
    </div>
</div>
</body>
</html>