<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>PDF Header</title>
</head>
<body style="font-family:'Arial'; font-size:18px;">
{% set schedule = anf.schedule %}
{% set patient = anf.patient %}
{% set patientInsurance = patient.activePatientInsurance %}
{% if 'Referring Affiliate' == anf.affiliateType %}
	{% set rhf = anf.patientReferringHealthFacility.referringHealthFacility %}
	{% set attn = rhf.description %}
	{% set phoneNo = rhf.phoneNo %}
	{% set faxNo = rhf.faxNo %}
	{% set notes = '' %}
{% elseif 'Referring Physician' == anf.affiliateType %}
	{% set rp = anf.patientReferringProvider.referringProvider %}
	{% set attn = rp.honorific ~ ' ' ~ rp.fullName|title %}
	{% if rp.phoneNo != '' or rp.phoneNo is not null %}
		{% set phoneNo = rp.phoneNo %}
	{% else %}
		{% set phoneNo = '' %}
		{% for prhf in patient.patientReferringHealthFacilities %}
			{% for rhfp in rp.referringHealthFacilityProviders %}
				{% if prhf.referringHealthFacility.id == rhfp.referringHealthFacility.id %}
					{% set phoneNo = prhf.referringHealthFacility.phoneNo %}
				{% endif %}
			{% endfor %}
		{% endfor %}
	{% endif %}
	{% if rp.faxNo != '' or rp.faxNo is not null %}
		{% set faxNo = rp.faxNo %}
	{% else %}
		{% set faxNo = '' %}
		{% for prhf in patient.patientReferringHealthFacilities %}
			{% for rhfp in rp.referringHealthFacilityProviders %}
				{% if prhf.referringHealthFacility.id == rhfp.referringHealthFacility.id %}
					{% set faxNo = prhf.referringHealthFacility.faxNo %}
				{% endif %}
			{% endfor %}
		{% endfor %}
	{% endif %}
	{% set notes = rp.note %}
{% else %}
	{% set ins = anf.patientInsurance.insurance %}
	{% set attn = ins.description %}
	{% set phoneNo = ins.phoneNo %}
	{% set faxNo = ins.faxNo %}
	{% set notes = '' %}
{% endif %}
<div style=" height: 40px; width:768px; position: absolute; padding:0px; box-shadow:3px 1px 10px 1px; margin-left: 30px;">
	<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;">
				{% set faxBranchSelection = [] %}
				<div style="width: 100%; height: 100%;">
					<input type="checkbox" id="add" style="height: 15px; width:15px;" {{ patient.healthFacility.description|default('') in ['QSC EDM Mira', 'DSRC EDM Mira'] or 1 in faxBranchSelection ? 'checked' : '' }}><label style="font-size: 13px;"><strong style="margin-right: 20px;">Edmonton North Fax : 780-757-1210</strong></label>
					<br>
					<input type="checkbox" id="add" style="height: 15px; width:15px;" {{ patient.healthFacility.description|default('') in ['QSC EDM South', 'DSRC EDM South', 'AMS EDM South'] or 2 in faxBranchSelection ? 'checked' : '' }}><label style="font-size: 13px;"><strong style="margin-right: 18px;">Edmonton South Fax : 780-757-1491</strong></label>
					{#<br>#}
					{#<input type="checkbox" id="add" style="height: 15px; width:15px;" {{ patient.healthFacility.description|default('') in ['QSC Sherwood Park', 'DSRC Sherwood Park'] or 3 in faxBranchSelection ? 'checked' : '' }}><label style="font-size: 13px;"><strong style="margin-right: 19px;">Sherwood Park Fax &ensp;: 780-570-0046</strong></label>#}
					<br>
					<input type="checkbox" id="add" style="height: 15px; width:15px;" {{ patient.healthFacility.description|default('') == 'DSRC Calgary North' or 4 in faxBranchSelection ? 'checked' : '' }}><label style="font-size: 13px;"><strong style="margin-right: 20px;">Calgary North Fax&ensp;&emsp;: 403-220-0038</strong></label>
					<br>
					<input type="checkbox" id="add" style="height: 15px; width:15px;" {{ patient.healthFacility.description|default('') == 'DSRC Calgary South' or 5 in faxBranchSelection ? 'checked' : '' }}><label style="font-size: 13px;"><strong style="margin-right: 21px;">Calgary South Fax&ensp;&emsp;: 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>
</body>
</html>