<div class="content-detail-container" style="border:none!important; padding: 10px !important; border: none !important; background-color: #fafafa !important; margin-bottom: 10px !important;">
    <div class="row max-width-initial">
        <div class="large-12 columns">
            <div class="large-6 columns">
                <div class="patient-photo" style=" margin-right: 10px; width:110px; height: 110px; float: left; margin-bottom: 20%">
                    <img src="{{ patient.photowebpath is defined and patient.photowebpath is not empty ? patient.photowebpath : asset('bundles/rxconnexion/admin/images/main-menu-default-avatar.png') }}" style="margin: 0 auto; height: 100%;">
                </div>
                <div>
                    {% set redFlagColor = 0 %}
                    {% for redFlags in redFlag %}
                        {% if(redFlags.endDate == null) %}
                            {% set redFlagColor = 1 %}
                        {% endif %}
                    {% endfor %}
                    {% if redFlagColor == 1 %}
                        <h5 style="margin-bottom:0; color:red;"><strong>{{ patient.fullName }}</strong></h5>
                    {% else %}
                        <h5 style="margin-bottom:0; color:#2199e8;"><strong>{{ patient.fullName }}</strong></h5>
                    {% endif %}
                    <div class="page-detail"><span>{{ patient.address }}</span></div>
                    <div class="page-detail"><span>PHN: {{ patient.getPersonalHealthNo }}</span></div>
                    <div class="page-detail"><a href="javascript:void(0);">{{ patient.concatenatedMobileNo|default('N/A') }}</a></div>
                    <div class="page-detail"><a href="javascript:void(0);">{{ patient.concatenatedPhoneNo|default('N/A') }}</a></div>
                </div>
                {% for redFlags in redFlag %}
                    {% if(redFlags.endDate == null) %}
                        {% set redFlagColor = 1 %}
                        <strong>Red Flag Note: </strong> <h5 class="page-detail" style="color:red;">{{ redFlags.redFlagNote }}</h5>
                    {% endif %}
                {% endfor %}

            </div>
            <div class="large-5 columns">
                {% for branch in patient.getActivePatientHealthFacilityArray %}
                    {% if patientOverview.health_facility_id ==  branch.healthFacility.id %}
                        <div class="page-detail"><strong style="color: #c1a60d">{{ branch.healthFacility.description|default('N/A') }}</strong></div>
                    {% endif %}
                {% endfor %}
                <div class="page-detail"><strong style="color: #c1a60d">Attending Physician: </strong>
                    {% set prp = [] %}
                    {% for patientReferringProvider in patient.getPatientReferringProviders if patientReferringProvider.isDeleted != true and patientReferringProvider.getEndDateAsString == '' %}
                        {% set prp = prp|merge([patientReferringProvider.getReferringProvider.getFullName]) %}
                    {% endfor %}
                    {{ prp|join(', ')|default('N/A') }}
                </div>
                <div class="page-detail"><strong style="color: #c1a60d">Note: </strong>{{ patientReferringProviderNote.note|default('N/A') }}</div>
                <div class="page-detail"><strong style="color: #c1a60d">Affiliation: </strong>
                    {% set prhf = [] %}
                    {% for patientReferringHealthFacility in  patient.getPatientReferringHealthFacilities if patientReferringHealthFacility.isDeleted != true and patientReferringHealthFacility.getEndDateAsString == '' %}
                        {% set prhf = prhf|merge([patientReferringHealthFacility.getReferringHealthFacility.description]) %}
                    {% endfor %}
                    {{ prhf|join(', ')|default('N/A') }}
                </div>
            </div>

            <div class="large-1 columns">
                <div class="text-right">
                    {% if userData.type == 'Super Admin' or 'Admin Patient Update' in userData.accesses %}
                        <a class="href-new-action" href="{{ path('patient_form', {action: 'u', 'id': patient.idencoded, 'fd' : 'fd'}) }}" title="Update Patient"><i class="fa fa-edit"></i></a>
                    {% endif %}
                    {% if userData.type != 'Super Admin' and 'Admin Account User Reminder' in userData.accesses %}
                        <a class="href-add-reminder-action" style="color: black" href="javascript:void(0)" title="Add reminder"><i class="fa fa-bell"></i></a>
                    {% endif %}
                    {% if userData.type == 'Super Admin' or 'Admin Patient Export HL7' in userData.accesses %}
                        <a class="href-new-action href-export-to-hl7" href="javascript:void(0)" title="Export to HL7 Format"><i class="fa fa-file-code-o"></i></a>
                    {% endif %}
                </div>
            </div>
        </div>
    </div>
</div>