{% 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_provider') }}">Referring Physician List</a></li>
                    <li>
                        <span class="show-for-sr">Current: </span> Referring Physician Details
                    </li>
                </ul>
            </nav>
            {% include '@RxConnexion/ReferringProvider/overview.html.twig' with {referringProvider: referringProvider} %}
            <br/>
            <div class="content-container has-loading">
                <div class="content-container-content hide">
                    <ul class="tabs custom-tabs" data-tabs id="referring-provider-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="referringProvider-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 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-provider-tabs">
                        {#<div class="tabs-panel {{ tab is null or tab is empty or tab == 'm' ? 'is-active' : '' }}" id="panel-referring-medical-facilities">#}
                            {#<div class="text-right">#}
                                {#{% if userData.type == 'Super Admin' or 'Admin Referring Provider Referring Health Facility New' in userData.accesses %}#}
                                    {#<a href="javascript:void(0)" class="href-referring-medical-facility-form href-new-action" data-action="n" data-id="0">Add Referring Affiliate</a>#}
                                {#{% endif %}#}
                            {#</div>#}
                            {#<table class="display responsive" id="referringMedicalFacilities-datalist" width="100%">#}
                                {#<thead>#}
                                {#<tr>#}
                                    {#<th>Company</th>#}
                                    {#<th>Branch</th>#}
                                    {#<th>Description</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 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 Provider Chart New' in userData.accesses %}
                                    <a class="href-new-action" href="{{ path('referring_provider_chart_form', {referring_provider_id: referringProvider_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 Provider Schedule New' in userData.accesses %}
                                    <label class="text-right"><a href="{{ path('referring_provider_schedule_form', {referring_provider_id: referringProvider_id}) }}" class="href-new-action">New Appointment</a></label>
                                {% endif %}
                            </div>
                            <table class="display responsive" id="referringProvider-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 Provider File New' in userData.accesses %}
                                    <a href="javascript:void(0)" class="href-referring-provider-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-provider-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="referringProvider-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-provider-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 Provider Note New' in userData.accesses %}
                                            <a href="javascript:void(0)" class="href-referring-provider-note-form href-new-action" data-action="n" data-type="" data-id="0">New Notes</a>
                                        {% endif %}
                                    </div>
                                    <table class="display responsive" id="referringProvider-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>
                </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[
        referringProvider_detail.settings.referringProvider_id = '{{ referringProvider_id }}';
        {#referringProvider_detail.settings.referringMedicalFacilities_ajaxUrl = '{{ path('referring_provider_health_facilities_ajax_list') }}';#}
        {#referringProvider_detail.settings.referringMedicalFacilities_formUrl = '{{ path('referring_provider_health_facilities_form', {referringProvider_id:referringProvider_id}) }}';#}
        {#referringProvider_detail.settings.referringMedicalFacilities_formActionUrl = '{{ path('referring_provider_health_facilities_save') }}';        #}
        referringProvider_detail.settings.referringProviderChart_ajaxUrl = '{{ path('referring_provider_chart_ajax_list') }}';
        referringProvider_detail.settings.referringMedicalFacilities_ajaxUrl = '{{ path('referring_provider_health_facilities_ajax_list') }}';
        referringProvider_detail.settings.referringMedicalFacilities_formUrl = '{{ path('referring_provider_health_facilities_form', {referringProvider_id:referringProvider_id}) }}';
        referringProvider_detail.settings.referringMedicalFacilities_formActionUrl = '{{ path('referring_provider_health_facilities_save') }}';
        referringProvider_detail.settings.file_ajaxUrl = '{{ path('referring_provider_file_ajax_list') }}';
        referringProvider_detail.settings.schedule_ajaxUrl= '{{ path('referring_provider_schedule_ajax_list') }}' ;
        referringProvider_detail.settings.file_formUrl = '{{ path('referring_provider_file_form', {referring_provider_id:referringProvider_id}) }}';
        referringProvider_detail.settings.file_formActionUrl = '{{ path('referring_provider_file_save') }}';
        referringProvider_detail.settings.note_ajaxUrl= '{{ path('referring_provider_note_ajax_list') }}' ;
        referringProvider_detail.settings.note_clinical_ajaxUrl= '{{ path('referring_provider_note_clinical_ajax_list') }}' ;
        referringProvider_detail.settings.note_billing_ajaxUrl= '{{ path('referring_provider_note_billing_ajax_list') }}' ;
        referringProvider_detail.settings.note_appointment_ajaxUrl= '{{ path('referring_provider_note_appointment_ajax_list') }}' ;
        referringProvider_detail.settings.note_specialist_ajaxUrl= '{{ path('referring_provider_note_specialist_ajax_list') }}' ;
        referringProvider_detail.settings.note_letter_ajaxUrl= '{{ path('referring_provider_note_letter_ajax_list') }}' ;
        referringProvider_detail.settings.referringProvider_note_formUrl= '{{ path('referring_provider_note_form', {referring_provider_id : referringProvider_id}) }}' ;
        referringProvider_detail.settings.referringProvider_note_formActionUrl= '{{ path('referring_provider_note_save') }}' ;
        jQ(document).ready(referringProvider_detail.init);
        //]]>
    </script>
{% endblock %}