<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 = redFlag.color|default('#2199e8') %}
                    {% if redFlag is not empty %}
                        {% if redFlag.is_green_flag == 1 %}
                            {% set redFlagColor = 'green' %}
                        {% elseif redFlag.is_yellow_flag == 1 %}
                            {% set redFlagColor = 'yellow' %}
                        {% elseif redFlag.is_blue_flag == 1 %}
                            {% set redFlagColor = 'blue' %}
                        {% elseif redFlag.is_red_flag == 1 %}
                            {% set redFlagColor = 'red' %}
                        {% else %}
                            {% set redFlagColor = '#2199e8' %}
                        {% endif %}
                    {% endif %}
                    {% set redFlagColor = redFlag.color|default('#2199e8') %}

                    <h5 style="margin-bottom:0; color:{{ redFlagColor ? redFlagColor : '' }};"><strong>{{ patient.fullName }}</strong></h5>
                    <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>
            </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>
                {% if redFlag is not empty %}
                    <div style="margin-top: 30px;">
                        <strong>Flag Note: </strong> <h5 class="page-detail" style="color:{{ redFlagColor }};">{{ redFlag.redFlagNote }}</h5>
                    </div>
                {% endif %}
            </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>