{% extends '@RxConnexion/Admin/content.html.twig' %}
{% block content %}
    <div id="flash-messages-container">
    </div>
    <div class="row max-width-initial">
        <div class="small-12 columns">
            <nav aria-label="You are here:" role="navigation">
                <ul class="breadcrumbs">
                    <li><a href="{{ path('referring_health_facility') }}">Referring Physician List</a></li>
                    <li>
                        <span class="show-for-sr">Current: </span> Referring Physician Details
                    </li>
                </ul>
            </nav>
            {% include '@RxConnexion/ReferringHealthFacility/overview.html.twig' with {referringHealthFacility: referringHealthFacility} %}
            <br/>
            <div class="content-container has-loading">
                <div class="content-container-content hide">
                    <ul class="tabs custom-tabs" data-tabs id="referring-health-facility-tabs">
                        <li class="tabs-title {{ tab is null or tab is empty or tab == 'ch' ? 'is-active' : '' }}" data-dt-id="referringHealthFacilityChart-datalist"><a href="#panel-chart-type" aria-selected="true">Encounter</a></li>
                        <li class="tabs-title {{ tab == 'ap' ? 'is-active' : '' }}"  data-dt-id="referringHealthFacility-schedule-datalist"><a href="#panel-appointment" aria-selected="true">Appointment(s)</a></li>
                        <li class="tabs-title {{ tab == 'f' ? 'is-active' : '' }}"  data-dt-id="file-datalist"><a href="#panel-files" aria-selected="true">File(s)</a></li>
                        <li class="tabs-title {{ tab == 'n' ? 'is-active' : '' }}"  data-dt-id="panel-notes"><a href="#panel-notes" aria-selected="true">Note(s)</a></li>
                        <li class="tabs-title {{ tab == 'm' ? 'is-active' : '' }}"  data-dt-id="referringProviders-datalist"><a href="#panel-referring-medical-facilities" aria-selected="true">Referring Physician(s)</a></li>
                        {% if userData.type == 'Super Admin' or 'Admin Sales Agent Detail Referring Health Facility' in userData.accesses %}
                            {#<li class="tabs-title"><a href="#panel-sales-agent" aria-selected="true">Agent</a></li>#}
                        {% endif %}
                        {#<li class="tabs-title {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}"><a href="#panel-referring-medical-facilities" aria-selected="true">Referring Affiliate</a></li>#}
                    </ul>
                    <div class="tabs-content custom-tabs-content" data-tabs-content="referring-health-facility-tabs">
                        <div class="tabs-panel {{ tab is null or tab is empty or tab == 'ch' ? 'is-active' : '' }}" id="panel-chart-type">
                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Referring Health Facility Chart New' in userData.accesses %}
                                    <a class="href-new-action" href="{{ path('referring_health_facility_chart_form', {referring_health_facility_id: referringHealthFacility_id}) }}" >Add Encounter</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="referringHealthFacilityChart-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Branch</th>
                                    <th>Encounter ID</th>
                                    <th>Encounter Type</th>
                                    <th>Encounter Date</th>
                                    <th>Marketing Staff</th>
                                    <th>Status</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                        <div class="tabs-panel {{ tab == 'ap' ? 'is-active' : '' }}" id="panel-appointment">
                            <div>
                                {% if userData.type == 'Super Admin' or 'Admin Referring Health Facility Schedule New' in userData.accesses %}
                                    <label class="text-right"><a href="{{ path('referring_health_facility_schedule_form', {referring_health_facility_id: referringHealthFacility_id}) }}" class="href-new-action">New Appointment</a></label>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="referringHealthFacility-schedule-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Schedule ID</th>
                                    <th>Branch</th>
                                    <th>Appointment Date</th>
                                    <th>Marketing Staff</th>
                                    <th>Encounter Type</th>
                                    <th>Start Time</th>
                                    <th>End Time</th>
                                    <th>Status</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                            {#<br/>#}
                            {#<h5 class="subheader">Appointment Notices</h5>#}
                            {#<table class="display responsive" id="appointmentNoticeFax-datalist" width="100%">#}
                                {#<thead>#}
                                {#<tr>#}
                                    {#<th>Date/Time</th>#}
                                    {#<th>Schedule ID</th>#}
                                    {#<th>Type</th>#}
                                    {#<th>Name</th>#}
                                    {#<th>Action</th>#}
                                {#</tr>#}
                                {#</thead>#}
                                {#<tbody></tbody>#}
                            {#</table>#}
                        </div>
                        <div class="tabs-panel {{ tab == 'f' ? 'is-active' : '' }}" id="panel-files">
                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Referring Health Facility File New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-referring-health-facility-file-form href-new-action" data-action="n" data-id="0">New File</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="file-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Date</th>
                                    <th>User</th>
                                    <th>Description</th>
                                    <th>Type</th>
                                    <th>Notes</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                        <div class="tabs-panel {{ tab == 'n' ? 'is-active' : '' }}" id="panel-notes">
                            <ul class="tabs custom-tabs" data-tabs id="referring-health-facility-note-tabs">
                                {% if userData.type == 'Super Admin' or 'Admin Patient All Note' in userData.accesses %}
                                    <li class="tabs-title {{ tab2 is null or tab2 is empty or tab2 == 'on' ? 'is-active' : '' }}" data-dt-id="referringHealthFacility-note-datalist"><a href="#panel-note-old" aria-selected="true">All</a></li>
                                {% endif %}
                            </ul>
                            <div class="tabs-content custom-tabs-content" data-tabs-content="referring-health-facility-note-tabs">
                                <div class="tabs-panel {{ tab2 is null or tab2 is empty or tab2 == 'on' ? 'is-active' : '' }}" id="panel-note-old">
                                    <div class="text-right">
                                        {% if userData.type == 'Super Admin' or 'Admin Referring Health Facility Note New' in userData.accesses %}
                                            <a href="javascript:void(0)" class="href-referring-health-facility-note-form href-new-action" data-action="n" data-type="" data-id="0">New Notes</a>
                                        {% endif %}
                                    </div>
                                    <table class="display responsive" id="referringHealthFacility-note-datalist" width="100%">
                                        <thead>
                                        <tr>
                                            <th>Type</th>
                                            <th>Created</th>
                                            <th>Created By</th>
                                            <th>Note</th>
                                            <th>Action</th>
                                        </tr>
                                        </thead>
                                        <tbody></tbody>
                                    </table>
                                </div>

                            </div>
                        </div>
                        <div class="tabs-panel {{ tab == 'm' ? 'is-active' : '' }}" id="panel-referring-medical-facilities">
                            <div class="text-right">
                                {% if userData.type == 'Super Admin' or 'Admin Referring Health Facility Provider New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-referring-provider-form href-new-action" data-action="n" data-id="0">Add Referring Physician</a>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="referringProviders-datalist" width="100%">
                                <thead>
                                <tr>
                                    <th>Full Name</th>
                                    <th>Address</th>
                                    <th>Phone No(s).</th>
                                    <th>Mobile No(s).</th>
                                    <th>Email(s)</th>
                                    <th>Start Date</th>
                                    <th>End Date</th>
                                    <th>Action</th>
                                </tr>
                                </thead>
                                <tbody></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="reveal large" id="modal"  data-reveal>
        <div id="modal-content"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="reveal small" id="modal-small" style="top: -12% !important;" data-reveal>
        <div id="modal-content-small"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    <div class="reveal full" id="modal-full" data-reveal>
        <div id="modal-content-full"></div>
        <button class="close-button" data-close aria-label="Close modal" type="button">
            <span aria-hidden="true">&times;</span>
        </button>
    </div>
    {% include '@RxConnexion/Admin/js.html.twig' %}
    <script language="javascript">
        //<![CDATA[
        referringHealthFacility_detail.settings.referringHealthFacility_id = '{{ referringHealthFacility_id }}';
        referringHealthFacility_detail.settings.referringMedicalFacilities_ajaxUrl = '{{ path('referring_health_facility_provider_ajax_list') }}';
        referringHealthFacility_detail.settings.referringMedicalFacilities_formUrl = '{{ path('referring_health_facility_provider_form', {referringHealthFacility_id:referringHealthFacility_id}) }}';
        referringHealthFacility_detail.settings.referringMedicalFacilities_formActionUrl = '{{ path('referring_health_facility_provider_save') }}';
        referringHealthFacility_detail.settings.referringSalesAgent_ajaxUrl = '{{ path('referring_health_facility_sales_agent_ajax_list') }}';
        referringHealthFacility_detail.settings.referringSalesAgent_formUrl = '{{ path('referring_health_facility_sales_agent_form', {referringHealthFacility_id:referringHealthFacility_id}) }}';
        referringHealthFacility_detail.settings.referringSalesAgent_formActionUrl = '{{ path('referring_health_facility_sales_agent_save') }}';
        referringHealthFacility_detail.settings.referringHealthFacilityChart_ajaxUrl = '{{ path('referring_health_facility_chart_ajax_list') }}';
        referringHealthFacility_detail.settings.file_ajaxUrl = '{{ path('referring_health_facility_file_ajax_list') }}';
        referringHealthFacility_detail.settings.schedule_ajaxUrl= '{{ path('referring_health_facility_schedule_ajax_list') }}' ;
        referringHealthFacility_detail.settings.file_formUrl = '{{ path('referring_health_facility_file_form', {referring_health_facility_id:referringHealthFacility_id}) }}';
        referringHealthFacility_detail.settings.file_formActionUrl = '{{ path('referring_health_facility_file_save') }}';
        referringHealthFacility_detail.settings.note_ajaxUrl= '{{ path('referring_health_facility_note_ajax_list') }}' ;
        referringHealthFacility_detail.settings.note_clinical_ajaxUrl= '{{ path('referring_health_facility_note_clinical_ajax_list') }}' ;
        referringHealthFacility_detail.settings.note_billing_ajaxUrl= '{{ path('referring_health_facility_note_billing_ajax_list') }}' ;
        referringHealthFacility_detail.settings.note_appointment_ajaxUrl= '{{ path('referring_health_facility_note_appointment_ajax_list') }}' ;
        referringHealthFacility_detail.settings.note_specialist_ajaxUrl= '{{ path('referring_health_facility_note_specialist_ajax_list') }}' ;
        referringHealthFacility_detail.settings.note_letter_ajaxUrl= '{{ path('referring_health_facility_note_letter_ajax_list') }}' ;
        referringHealthFacility_detail.settings.referringHealthFacility_note_formUrl= '{{ path('referring_health_facility_note_form', {referring_health_facility_id : referringHealthFacility_id}) }}' ;
        referringHealthFacility_detail.settings.referringHealthFacility_note_formActionUrl= '{{ path('referring_health_facility_note_save') }}' ;
        referringHealthFacility_detail.settings.note_template_autocomplete_url = '{{ path('note_template_autocomplete') }}';
        referringHealthFacility_detail.settings.note_template_data_url = '{{ path('note_template_data') }}';
        jQ(document).ready(referringHealthFacility_detail.init);
        //]]>
    </script>
{% endblock %}