templates/cases/index.html.twig line 1

Open in your IDE?
  1. {% extends 'base.html.twig' %}
  2. {% block title %}{{ title }}{% endblock %}
  3. {% block content %}
  4. <div class="kt-subheader kt-grid__item"></div>
  5. <div class="kt-container kt-grid__item kt-grid__item--fluid">
  6.     <div class="kt-portlet kt-portlet--mobile">
  7.         <div class="kt-portlet__head kt-portlet__head--lg">
  8.             <div class="kt-portlet__head-label">
  9.                 <h3 class="kt-portlet__head-title">
  10.                     {% if is_granted('ROLE_RECEP') %}
  11.                         {{ title }} for {{ 'now'|date('d/m/Y') }}
  12.                     {% else %}
  13.                         {{ title }}
  14.                     {% endif %}
  15.                 </h3>
  16.             </div>
  17.             <div class="kt-portlet__head-toolbar">
  18.                 <div class="kt-portlet__head-wrapper">
  19.                     <a href="{{ path('case_new') }}" class="btn btn-brand btn-bold mr-2" role="button">New Case</a>
  20.                     {% if is_granted('ROLE_DOC') or is_granted('ROLE_DENT') %}
  21.                         <a href="{{ path('ward_bed_missed_schedules') }}" class="btn btn-default btn-bold" role="button">Missed Schedules of Ward</a>
  22.                     {% endif %}
  23.                 </div>
  24.             </div>
  25.         </div>
  26.         <div class="kt-portlet__body">
  27.             {% include 'parts/flash.html.twig' %}
  28.             {% if app.request.attributes.get('_route') in ['case_index', 'case_summary'] %}
  29.                 <form class="kt-form kt-margin-b-10">
  30.                     <div class="form-group row">
  31.                         <label class="form-label kt-padding-t-10 col-lg-1">Search Filters</label>
  32.                         <div class="col-lg-3">
  33.                             <div class="input-group" id="from-to-dates">
  34.                                 <input type="text" name="range" value="{{ app.request.get('range') }}" class="form-control"
  35.                                     readonly placeholder="Select Date Range">
  36.                                 <div class="input-group-append">
  37.                                     <span class="input-group-text"><i class="la la-calendar-check-o"></i></span>
  38.                                 </div>
  39.                             </div>
  40.                         </div>
  41.                         <div class="col-lg-3">
  42.                             <button class="btn btn-brand btn-bold">Submit</button>
  43.                             <a href="{{ path('case_index') }}" class="btn btn-clean btn-bold ml-2">Reset</a>
  44.                         </div>
  45.                     </div>
  46.                 </form>
  47.             {% endif %}
  48.             <table class="table table-striped table-bordered table-hover">
  49.                 <thead>
  50.                     <tr>
  51.                         <th width="5%">Sr. No.</th>
  52.                         <th>Case ID</th>
  53.                         <th>Patient</th>
  54.                         <th>ABHA Number</th>
  55.                         <th>Address &amp; Contact</th>
  56.                         <th>Category</th>
  57.                         <th>Doctor</th>
  58.                         <th>Type</th>
  59.                         <th>Status</th>
  60.                         <th>Date</th>
  61.                         <th class="text-center">Actions</th>
  62.                     </tr>
  63.                 </thead>
  64.                 <tbody>
  65.                     {% for case in cases %}
  66.                         <tr>
  67.                             <td class="text-right">{{ loop.index }}</td>
  68.                             <td>
  69.                                 {% if case.isWard %}
  70.                                 <span class="kt-badge kt-badge--warning kt-badge--md btn mr-2 font-weight-bold"
  71.                                     data-toggle="kt-tooltip" title="In Ward">W</span>
  72.                                 {% endif %}
  73.                                 {{ case.mrdId }}
  74.                             </td>
  75.                             <td>{{ case.patient }}</td>
  76.                             <td>{{ case.patient.healthIdNumber ? case.patient.healthIdNumber : '&mdash;'  }}</td>
  77.                             <td>{{ case.patient.address }} &mdash; {{ case.patient.mobile }}</td>
  78.                             <td>{{ case.patientCategory }}</td>
  79.                             <td>{{ case.doctor }}</td>
  80.                             <td>
  81.                                 {% if case.isReferral %}
  82.                                     {% if case.hasOpinion %}
  83.                                         {% if app.user.id == case.doctor.id %}
  84.                                             Referred Out
  85.                                         {% else %}
  86.                                             Referred In
  87.                                         {% endif %}
  88.                                     {% else %}
  89.                                         {% if app.user.id == case.doctor.id %}
  90.                                             Transferred Out
  91.                                         {% else %}
  92.                                             Transferred In
  93.                                         {% endif %}
  94.                                     {% endif %}
  95.                                 {% else %}
  96.                                     Regular
  97.                                 {% endif %}
  98.                             </td>
  99.                             <td class="text-nowrap">{{ case.isClosed ? 'Closed' : 'Follow-up' }}</td>
  100.                             <td class="text-right text-nowrap">{{ case.createdAt|date('d/m/Y g:i a') }}</td>
  101.                             <td class="text-center">
  102.                                 <div class="dropdown">
  103.                                     <a href="#" class="btn btn-sm btn-clean btn-icon btn-icon-md" data-toggle="dropdown"
  104.                                         aria-expanded="true">
  105.                                         <i class="la la-ellipsis-h"></i>
  106.                                     </a>
  107.                                     <div class="dropdown-menu dropdown-menu-right">
  108.                                         <a class="dropdown-item"
  109.                                             href="{{ path('case_show', {'id': case.id| nzo_encrypt}) }}">
  110.                                             <i class="fa fas fa-eye"></i>View Details
  111.                                         </a>
  112.                                         {% if (case.patient.healthAddress) %}
  113.                                             <a class="dropdown-item"
  114.                                                 href="{{ path('data_link_fetch', {'id': case.id| nzo_encrypt}) }}">
  115.                                                 <i class="fa fas fa-link"></i>Link Health Record
  116.                                             </a>
  117.                                         {% else %}
  118.                                             <a class="dropdown-item abha_click" href="javascript:void(0);"
  119.                                                 data-counter="{{ case.id| nzo_encrypt}}"
  120.                                                 data="{{ path('abha_link_case', {'id': case.id| nzo_encrypt}) }}">
  121.                                                 <i class="fa fas fa-link"></i>Link Health Record
  122.                                             </a>
  123.                                         {% endif %}
  124.                                         <a class="dropdown-item"
  125.                                             href="{{ path('patient_notify', {'id': case.id| nzo_encrypt}) }}">
  126.                                             <i class="fa fas fa-sms"></i>SMS Notify
  127.                                         </a>
  128.                                         {% if (is_granted('ROLE_DOC') or is_granted('ROLE_CHO') or is_granted('ROLE_DENT'))
  129.                                             and not case.isClosed and not (case.isReferral and app.user.id == case.doctor.id and
  130.                                             not case.hasOpinion) %}
  131.                                                 <a class="dropdown-item"
  132.                                                     href="{{ path('case_edit', {'id': case.id| nzo_encrypt}) }}">
  133.                                                     <i class="fa far fa-stethoscope"></i>Diagnose
  134.                                                 </a>
  135.                                             {% if case.isWard %}
  136.                                                 <a class="dropdown-item"
  137.                                                     href="{{ path('ward_bed_manage', {'id': case.id| nzo_encrypt}) }}">
  138.                                                     <i class="fa far fa-procedures"></i>Ward Management
  139.                                                 </a>
  140.                                             {% endif %}
  141.                                         {% endif %}
  142.                                         {% if (is_granted('ROLE_DOC') or is_granted('ROLE_CHO') or is_granted('ROLE_RECEP')
  143.                                         or is_granted('ROLE_DENT')) and case.isClosed and not case.isReopened and
  144.                                         case.patient.isAlive %}
  145.                                             <a class="dropdown-item"
  146.                                                 href="{{ path('case_reopen', {'id': case.id | nzo_encrypt}) }}">
  147.                                                 <i class="fa far fa-edit"></i>Re-open
  148.                                             </a>
  149.                                         {% endif %}
  150.                                         {% if is_granted('ROLE_HOSP_ADMIN') %}
  151.                                             <a class="dropdown-item"
  152.                                                 href="{{ path('case_delete', {'id': case.id | nzo_encrypt}) }}"
  153.                                                 onclick="return confirm('Are you sure?');">
  154.                                                 <i class="fa far fa-trash kt-font-danger"></i>Delete
  155.                                             </a>
  156.                                         {% endif %}
  157.                                         {% if is_granted('ROLE_DOC') and case.patientCategory == 'New born child case' and
  158.                                         case.isBirthCertGen %}
  159.                                             <a class="dropdown-item"
  160.                                                 href="{{ path('birth_certificate_show', {'case_id': case.id | nzo_encrypt}) }}">
  161.                                                 <i class="fa fas fa-file-contract"></i>View Birth Certificate
  162.                                             </a>
  163.                                         {% endif %}
  164.                                         {% if is_granted('ROLE_DOC') and case.patientCategory == 'Medicolegal case' %}
  165.                                             <a class="dropdown-item"
  166.                                                 href="{{ path('case_mlc_info_letter', {'id': case.id | nzo_encrypt}) }}"
  167.                                                 target="_blank">
  168.                                                 <i class="fa fas fa-file-contract"></i>Print MLC Information Letter
  169.                                             </a>
  170.                                             <a class="dropdown-item"
  171.                                                 href="{{ path('medico_add_injury_detail', {'case_id': case.id | nzo_encrypt}) }}">
  172.                                                 <i class="fa fas fa-file-contract"></i>Add Injury Details
  173.                                             </a>
  174.                                             <a class="dropdown-item"
  175.                                                 href="{{ path('medico_view_injury_detail', {'case_id': case.id | nzo_encrypt}) }}">
  176.                                                 <i class="fa fas fa-file-contract"></i>View Injury Details
  177.                                             </a>
  178.                                             {% if case.isPmDone %}
  179.                                                 <a class="dropdown-item"
  180.                                                     href="{{ path('medico_view_pm_report', {'case_id': case.id | nzo_encrypt, 'type': 'view'}) }}">
  181.                                                     <i class="fa fas fa-file-contract"></i>View Post-mortem Report
  182.                                                 </a>
  183.                                             {% else %}
  184.                                                 <a class="dropdown-item"
  185.                                                     href="{{ path('medico_add_pm_report', {'case_id': case.id | nzo_encrypt}) }}">
  186.                                                     <i class="fa fas fa-file-contract"></i>Add Post-mortem Report
  187.                                                 </a>
  188.                                             {% endif %}
  189.                                         {% endif %}
  190.                                         {% if case.closureReason == 'Death of patient' %}
  191.                                             {% if case.isDeathCertGen %}
  192.                                                 <a class="dropdown-item"
  193.                                                     href="{{ path('death_certificate_show', {'case_id': case.id | nzo_encrypt}) }}">
  194.                                                     <i class="fa fas fa-file-contract"></i>View Death Certificate
  195.                                                 </a>
  196.                                             {% else %}
  197.                                                 <a class="dropdown-item"
  198.                                                     href="{{ path('death_certificate_new', {'case_id': case.id | nzo_encrypt}) }}">
  199.                                                     <i class="fa fas fa-file-contract"></i>Add Death Certificate
  200.                                                 </a>
  201.                                             {% endif %}
  202.                                         {% endif %}
  203.                                     </div>
  204.                                 </div>
  205.                             </td>
  206.                         </tr>
  207.                     {% else %}
  208.                         <tr>
  209.                             <td colspan="10" class="text-center">No records found</td>
  210.                         </tr>
  211.                     {% endfor %}
  212.                 </tbody>
  213.             </table>
  214.             {{ include('parts/pagination.html.twig', {'lastPage': last_page}) }}
  215.         </div>
  216.     </div>
  217. </div>
  218. <form action="{{ path('abha_card') }}" id="new-abha" method="POST">
  219.     <input type="hidden" name="type" id="abha_val" value>
  220.     <input type="hidden" name="case_id" id="case_id" value>
  221. </form>
  222. {% endblock %}
  223. {% block scripts %}
  224. {{ parent() }}
  225. {% if app.request.attributes.get('_route') in ['case_index', 'case_summary'] %}
  226.     <script src="{{ asset('assets/js/admin_reports_filter.js') }}"></script>
  227.     <script>
  228.         $('.abha_click').on('click', function () {
  229.             var url = $(this).attr('data');
  230.             var case_id = $(this).attr('data-counter');
  231.             Swal.fire({
  232.                 title: 'Do you have ABHA?',
  233.                 type: 'warning',
  234.                 allowOutsideClick: false,
  235.                 showCancelButton: true,
  236.                 confirmButtonColor: '#189f9f',
  237.                 cancelButtonColor: '#d33',
  238.                 confirmButtonText: 'Yes',
  239.                 cancelButtonText: 'No',
  240.             }).then((result) => { //Yes
  241.                 if (result.value) {
  242.                     Swal.fire({
  243.                         title: 'Do you want verify your ABHA?',
  244.                         type: 'warning',
  245.                         allowOutsideClick: false,
  246.                         showCancelButton: true,
  247.                         confirmButtonColor: '#189f9f',
  248.                         cancelButtonColor: '#d33',
  249.                         confirmButtonText: 'Yes',
  250.                         cancelButtonText: 'No',
  251.                     }).then((result) => {
  252.                         if (result.value) { //yes
  253.                             //Todo : abha link page route define
  254.                             window.location = url;
  255.                         } else { //no
  256.                             //Todo : new patient reg link
  257.                             swal.close();
  258.                         }
  259.                     });
  260.                 } else { //No
  261.                     Swal.fire({
  262.                         title: 'Do you want to create ABHA?',
  263.                         type: 'warning',
  264.                         confirmButtonColor: '#189f9f',
  265.                         cancelButtonColor: '#d33',
  266.                         showCancelButton: true,
  267.                         allowOutsideClick: false,
  268.                         confirmButtonText: 'Yes',
  269.                         cancelButtonText: 'No',
  270.                         reverseButtons: false
  271.                     }).then((result) => {
  272.                         if (result.value) {
  273.                             $('#case_id').val(case_id);
  274.                             $('#abha_val').val('case_diagnose');
  275.                             $('#new-abha').submit();
  276.                             //window.location.href = "{{ path('abha_card') }}";
  277.                         } else {
  278.                             swal.close();
  279.                             //window.location.href = "{{ path('case_index') }}";
  280.                         }
  281.                     })
  282.                 }
  283.             })
  284.         });
  285.     </script>
  286. {% endif %}
  287. {% endblock %}