{% extends 'base.html.twig' %}
{% block title %}{{ title }}{% endblock %}
{% block content %}
<div class="kt-subheader kt-grid__item"></div>
<div class="kt-container kt-grid__item kt-grid__item--fluid">
<div class="kt-portlet kt-portlet--mobile">
<div class="kt-portlet__head kt-portlet__head--lg">
<div class="kt-portlet__head-label">
<h3 class="kt-portlet__head-title">
{% if is_granted('ROLE_RECEP') %}
{{ title }} for {{ 'now'|date('d/m/Y') }}
{% else %}
{{ title }}
{% endif %}
</h3>
</div>
<div class="kt-portlet__head-toolbar">
<div class="kt-portlet__head-wrapper">
<a href="{{ path('case_new') }}" class="btn btn-brand btn-bold mr-2" role="button">New Case</a>
{% if is_granted('ROLE_DOC') or is_granted('ROLE_DENT') %}
<a href="{{ path('ward_bed_missed_schedules') }}" class="btn btn-default btn-bold" role="button">Missed Schedules of Ward</a>
{% endif %}
</div>
</div>
</div>
<div class="kt-portlet__body">
{% include 'parts/flash.html.twig' %}
{% if app.request.attributes.get('_route') in ['case_index', 'case_summary'] %}
<form class="kt-form kt-margin-b-10">
<div class="form-group row">
<label class="form-label kt-padding-t-10 col-lg-1">Search Filters</label>
<div class="col-lg-3">
<div class="input-group" id="from-to-dates">
<input type="text" name="range" value="{{ app.request.get('range') }}" class="form-control"
readonly placeholder="Select Date Range">
<div class="input-group-append">
<span class="input-group-text"><i class="la la-calendar-check-o"></i></span>
</div>
</div>
</div>
<div class="col-lg-3">
<button class="btn btn-brand btn-bold">Submit</button>
<a href="{{ path('case_index') }}" class="btn btn-clean btn-bold ml-2">Reset</a>
</div>
</div>
</form>
{% endif %}
<table class="table table-striped table-bordered table-hover">
<thead>
<tr>
<th width="5%">Sr. No.</th>
<th>Case ID</th>
<th>Patient</th>
<th>ABHA Number</th>
<th>Address & Contact</th>
<th>Category</th>
<th>Doctor</th>
<th>Type</th>
<th>Status</th>
<th>Date</th>
<th class="text-center">Actions</th>
</tr>
</thead>
<tbody>
{% for case in cases %}
<tr>
<td class="text-right">{{ loop.index }}</td>
<td>
{% if case.isWard %}
<span class="kt-badge kt-badge--warning kt-badge--md btn mr-2 font-weight-bold"
data-toggle="kt-tooltip" title="In Ward">W</span>
{% endif %}
{{ case.mrdId }}
</td>
<td>{{ case.patient }}</td>
<td>{{ case.patient.healthIdNumber ? case.patient.healthIdNumber : '—' }}</td>
<td>{{ case.patient.address }} — {{ case.patient.mobile }}</td>
<td>{{ case.patientCategory }}</td>
<td>{{ case.doctor }}</td>
<td>
{% if case.isReferral %}
{% if case.hasOpinion %}
{% if app.user.id == case.doctor.id %}
Referred Out
{% else %}
Referred In
{% endif %}
{% else %}
{% if app.user.id == case.doctor.id %}
Transferred Out
{% else %}
Transferred In
{% endif %}
{% endif %}
{% else %}
Regular
{% endif %}
</td>
<td class="text-nowrap">{{ case.isClosed ? 'Closed' : 'Follow-up' }}</td>
<td class="text-right text-nowrap">{{ case.createdAt|date('d/m/Y g:i a') }}</td>
<td class="text-center">
<div class="dropdown">
<a href="#" class="btn btn-sm btn-clean btn-icon btn-icon-md" data-toggle="dropdown"
aria-expanded="true">
<i class="la la-ellipsis-h"></i>
</a>
<div class="dropdown-menu dropdown-menu-right">
<a class="dropdown-item"
href="{{ path('case_show', {'id': case.id| nzo_encrypt}) }}">
<i class="fa fas fa-eye"></i>View Details
</a>
{% if (case.patient.healthAddress) %}
<a class="dropdown-item"
href="{{ path('data_link_fetch', {'id': case.id| nzo_encrypt}) }}">
<i class="fa fas fa-link"></i>Link Health Record
</a>
{% else %}
<a class="dropdown-item abha_click" href="javascript:void(0);"
data-counter="{{ case.id| nzo_encrypt}}"
data="{{ path('abha_link_case', {'id': case.id| nzo_encrypt}) }}">
<i class="fa fas fa-link"></i>Link Health Record
</a>
{% endif %}
<a class="dropdown-item"
href="{{ path('patient_notify', {'id': case.id| nzo_encrypt}) }}">
<i class="fa fas fa-sms"></i>SMS Notify
</a>
{% if (is_granted('ROLE_DOC') or is_granted('ROLE_CHO') or is_granted('ROLE_DENT'))
and not case.isClosed and not (case.isReferral and app.user.id == case.doctor.id and
not case.hasOpinion) %}
<a class="dropdown-item"
href="{{ path('case_edit', {'id': case.id| nzo_encrypt}) }}">
<i class="fa far fa-stethoscope"></i>Diagnose
</a>
{% if case.isWard %}
<a class="dropdown-item"
href="{{ path('ward_bed_manage', {'id': case.id| nzo_encrypt}) }}">
<i class="fa far fa-procedures"></i>Ward Management
</a>
{% endif %}
{% endif %}
{% if (is_granted('ROLE_DOC') or is_granted('ROLE_CHO') or is_granted('ROLE_RECEP')
or is_granted('ROLE_DENT')) and case.isClosed and not case.isReopened and
case.patient.isAlive %}
<a class="dropdown-item"
href="{{ path('case_reopen', {'id': case.id | nzo_encrypt}) }}">
<i class="fa far fa-edit"></i>Re-open
</a>
{% endif %}
{% if is_granted('ROLE_HOSP_ADMIN') %}
<a class="dropdown-item"
href="{{ path('case_delete', {'id': case.id | nzo_encrypt}) }}"
onclick="return confirm('Are you sure?');">
<i class="fa far fa-trash kt-font-danger"></i>Delete
</a>
{% endif %}
{% if is_granted('ROLE_DOC') and case.patientCategory == 'New born child case' and
case.isBirthCertGen %}
<a class="dropdown-item"
href="{{ path('birth_certificate_show', {'case_id': case.id | nzo_encrypt}) }}">
<i class="fa fas fa-file-contract"></i>View Birth Certificate
</a>
{% endif %}
{% if is_granted('ROLE_DOC') and case.patientCategory == 'Medicolegal case' %}
<a class="dropdown-item"
href="{{ path('case_mlc_info_letter', {'id': case.id | nzo_encrypt}) }}"
target="_blank">
<i class="fa fas fa-file-contract"></i>Print MLC Information Letter
</a>
<a class="dropdown-item"
href="{{ path('medico_add_injury_detail', {'case_id': case.id | nzo_encrypt}) }}">
<i class="fa fas fa-file-contract"></i>Add Injury Details
</a>
<a class="dropdown-item"
href="{{ path('medico_view_injury_detail', {'case_id': case.id | nzo_encrypt}) }}">
<i class="fa fas fa-file-contract"></i>View Injury Details
</a>
{% if case.isPmDone %}
<a class="dropdown-item"
href="{{ path('medico_view_pm_report', {'case_id': case.id | nzo_encrypt, 'type': 'view'}) }}">
<i class="fa fas fa-file-contract"></i>View Post-mortem Report
</a>
{% else %}
<a class="dropdown-item"
href="{{ path('medico_add_pm_report', {'case_id': case.id | nzo_encrypt}) }}">
<i class="fa fas fa-file-contract"></i>Add Post-mortem Report
</a>
{% endif %}
{% endif %}
{% if case.closureReason == 'Death of patient' %}
{% if case.isDeathCertGen %}
<a class="dropdown-item"
href="{{ path('death_certificate_show', {'case_id': case.id | nzo_encrypt}) }}">
<i class="fa fas fa-file-contract"></i>View Death Certificate
</a>
{% else %}
<a class="dropdown-item"
href="{{ path('death_certificate_new', {'case_id': case.id | nzo_encrypt}) }}">
<i class="fa fas fa-file-contract"></i>Add Death Certificate
</a>
{% endif %}
{% endif %}
</div>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="10" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ include('parts/pagination.html.twig', {'lastPage': last_page}) }}
</div>
</div>
</div>
<form action="{{ path('abha_card') }}" id="new-abha" method="POST">
<input type="hidden" name="type" id="abha_val" value>
<input type="hidden" name="case_id" id="case_id" value>
</form>
{% endblock %}
{% block scripts %}
{{ parent() }}
{% if app.request.attributes.get('_route') in ['case_index', 'case_summary'] %}
<script src="{{ asset('assets/js/admin_reports_filter.js') }}"></script>
<script>
$('.abha_click').on('click', function () {
var url = $(this).attr('data');
var case_id = $(this).attr('data-counter');
Swal.fire({
title: 'Do you have ABHA?',
type: 'warning',
allowOutsideClick: false,
showCancelButton: true,
confirmButtonColor: '#189f9f',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes',
cancelButtonText: 'No',
}).then((result) => { //Yes
if (result.value) {
Swal.fire({
title: 'Do you want verify your ABHA?',
type: 'warning',
allowOutsideClick: false,
showCancelButton: true,
confirmButtonColor: '#189f9f',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes',
cancelButtonText: 'No',
}).then((result) => {
if (result.value) { //yes
//Todo : abha link page route define
window.location = url;
} else { //no
//Todo : new patient reg link
swal.close();
}
});
} else { //No
Swal.fire({
title: 'Do you want to create ABHA?',
type: 'warning',
confirmButtonColor: '#189f9f',
cancelButtonColor: '#d33',
showCancelButton: true,
allowOutsideClick: false,
confirmButtonText: 'Yes',
cancelButtonText: 'No',
reverseButtons: false
}).then((result) => {
if (result.value) {
$('#case_id').val(case_id);
$('#abha_val').val('case_diagnose');
$('#new-abha').submit();
//window.location.href = "{{ path('abha_card') }}";
} else {
swal.close();
//window.location.href = "{{ path('case_index') }}";
}
})
}
})
});
</script>
{% endif %}
{% endblock %}