{% extends 'base.html.twig' %}
{% block title %}Laboratory Tests{% 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">Laboratory Tests</h3>
</div>
<div class="kt-portlet__head-toolbar">
<div class="kt-portlet__head-wrapper">
<a href="{{ path('dashboard') }}" class="btn btn-clean btn-icon-sm"><i
class="la la-long-arrow-left"></i>Back</a>
</div>
</div>
</div>
<div class="kt-portlet__body">
{% include 'parts/tests_topnav.html.twig' %}
<div class="tab-content">
<div class="tab-pane active" id="pending_tests" role="tabpanel">
{% include 'parts/flash.html.twig' %}
<table class="table table-striped table-bordered">
<thead>
<tr>
<th width="5%">Sr. No.</th>
<th>Case ID</th>
<th>Patient Name</th>
<th>Doctor</th>
<th width="15%">Date & Time</th>
<th width="5%" class="text-center">Actions</th>
</tr>
</thead>
<tbody>
{% for case in cases %}
<tr>
<td class="text-right">{{ loop.index }}</td>
<td>
{% if case.labTestStatus == 'Completed' %}
<span class="kt-badge kt-badge--success kt-badge--md mr-2 btn font-weight-bold"
data-toggle="kt-tooltip" title="Completed">C</span>
{% elseif case.labTestStatus == 'Sample taken' %}
<span
class="kt-badge kt-badge--outline kt-badge--outline-2x kt-badge--warning kt-badge--md mr-2 btn font-weight-bold"
data-toggle="kt-tooltip" title="Sample Taken">S</span>
{% else %}
<span class="kt-badge kt-badge--warning kt-badge--md mr-2 btn font-weight-bold"
data-toggle="kt-tooltip" title="Pending">P</span>
{% endif %}
{{ case.mrdId }}
</td>
<td>{{ case.patient }}</td>
<td>{{ case.doctor }}</td>
<td class="text-right">{{ case.createdAt|date('d/m/Y h: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">
{% if case.labTestStatus == 'Pending' or not case.labTestStatus %}
<a href="{{ path('case_lab_add_sample', {'id': case.id | nzo_encrypt}) }}"
class="dropdown-item">
<i class="fa far fa-vial"></i>Add Sample
</a>
{% elseif case.labTestStatus == 'Sample taken' %}
<a href="{{ path('case_lab_add_result', {'id': case.id | nzo_encrypt}) }}"
class="dropdown-item">
<i class="fa far fa-file-alt"></i>Add Report
</a>
{% elseif case.labTestStatus == 'Completed' %}
<a href="{{ path('case_lab_print', {'id': case.id | nzo_encrypt}) }}"
class="dropdown-item" target="_blank">
<i class="fa far fa-print fa-2x"></i>Print
</a>
<a href="{{ path('lab_consent', {'id': case.id | nzo_encrypt}) }}"
class="dropdown-item"
target="_blank">
<i class="fa fa-history"></i>Other Hospital History
</a>
{% endif %}
{% if case.patient.healthAddress == '' and case.labTestStatus != 'Rejected' %}
<a href="javascript:void(0);"
onclick="CreateABHA('{{case.id | nzo_encrypt}}')"
class="dropdown-item AbhaPop"><i class="fa fa-id-card"
aria-hidden="true"></i> Create ABHA Card
</a>
{% elseif case.labTestStatus == 'Completed' %}
{#<a href="{{ path('abha_link') }}" class="dropdown-item" target="_blank">
<i class="fa fa-link"></i>Link Health Record
</a>#}
{% endif %}
</div>
</div>
</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
{{ include('parts/pagination.html.twig', {'lastPage': last_page}) }}
</div>
</div>
</div>
</div>
</div>
<form action="{{ path('abha_link') }}" id="link-abha" method="POST">
<input type="hidden" name="type" id="abha_link_val" value>
<input type="hidden" name="abha_details" id="abha_details" value="">
</form>
<form action="{{ path('abha_card') }}" id="new-abha" method="POST">
<input type="hidden" name="case_id" id="caseId" value="">
<input type="hidden" name="type" id="redirect" value="">
</form>
{% endblock %}
{% block scripts %}
{{ parent() }}
<script>
function CreateABHA(id) {
Swal.fire({
title: 'Do you have ABHA?',
type: 'warning',
allowOutsideClick: false,
showCancelButton: true,
confirmButtonColor: '#189f9f',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes',
cancelButtonText: 'No',
}).then((result) => {
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
$('#abha_link_val').val('reg');
$('#link-abha').submit();
} else { //no
//Todo : new patient reg link
//window.location.href = "{{ path('patient_new') }}";
}
});
} else {
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) {
$('#caseId').val(id);
$('#redirect').val('case_lab_test');
$('#new-abha').submit();
} else {
//window.location.href = "{{ path('patient_new') }}";
}
})
}
})
}
</script>
{% endblock %}