{% extends 'base.html.twig' %}
{% block title %}Case details of {{ case.mrdId }}{% 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">Case details of {{ case.mrdId }}</h3>
</div>
<div class="kt-portlet__head-toolbar">
<div class="kt-portlet__head-wrapper">
<a href="{{ path('case_index') }}" class="btn btn-clean btn-icon-sm"><i class="la la-long-arrow-left"></i>Back</a>
{% if is_granted('ROLE_DOC') or is_granted('ROLE_CHO') %}
<button type="button" class="btn btn-brand btn-bold ml-2" data-toggle="modal" data-target="#case-history-modal">History</button>
<a href="{{ path('consent', {'id': case.id | nzo_encrypt}) }}" class="btn btn-brand btn-bold ml-2" target="_blank">Other Hospital History</a>
{% endif %}
</div>
</div>
</div>
<div class="kt-portlet__body">
<div class="accordion accordion-toggle-arrow" id="case-details">
<div class="card">
<div class="card-header" id="patient-info-header">
<div class="card-title" data-toggle="collapse" data-target="#patient-info" aria-expanded="true" aria-controls="patient-info">
<i class="fa fa-user-injured fa-2x"></i>Patient Information
</div>
</div>
<div id="patient-info" class="collapse show" aria-labelledby="patient-info-label" data-parent="#case-details">
<div class="card-body">
{{ render(controller('App\\Controller\\PatientController::personalInfo',{'id': case.patient.id })) }}
</div>
</div>
</div>
<div class="card">
<div class="card-header" id="doctor-info-header">
<div class="card-title collapsed" data-toggle="collapse" data-target="#doctor-info" aria-expanded="true" aria-controls="doctor-info">
<i class="fa fa-stethoscope fa-2x"></i>Clinical Examination and History
</div>
</div>
<div id="doctor-info" class="collapse" aria-labelledby="doctor-info-label" data-parent="#case-details">
<div class="card-body">
<div class="row col-12">
<dl class="row">
<dt class="col-4 pb-4">Patient Category</dt>
<dd class="col-8 pb-4">{{ case.patientCategory }}</dd>
<dt class="col-4 pb-4">Family History</dt>
<dd class="col-8 pb-4">
{{ case.familyHistory ? case.familyHistory : '—' }}
</dd>
<dt class="col-4 pb-4">Current Disease History</dt>
<dd class="col-8 pb-4">
{{ case.currentDiseaseHistory ? case.currentDiseaseHistory : '—' }}
</dd>
<dt class="col-4 pb-4">Medical History</dt>
<dd class="col-8 pb-4">
{{ case.medicalHistory ? case.medicalHistory : '—' }}
</dd>
<dt class="col-4 pb-4">Medicine History</dt>
<dd class="col-8 pb-4">
{{ case.medicineHistory ? case.medicineHistory : '—' }}
</dd>
<dt class="col-4 pb-4">Disease Category</dt>
<dd class="col-8">
{{ case.diseaseCategory ? case.diseaseCategory : '—' }}
</dd>
<dt class="col-4 pb-4">Symptoms</dt>
<dd class="col-8 pb-4">
{{ symptoms|raw }}
</dd>
<dt class="col-4 pb-4">Clinical Patterns</dt>
<dd class="col-8 pb-4">
{{ clinical_patterns|raw }}
</dd>
<dt class="col-4 pb-4">General Examinations</dt>
<dd class="col-8 pb-4">
{{ provisional_examinations|raw }}
</dd>
<dt class="col-4 pb-4">Local Examination</dt>
<dd class="col-8 pb-4">
{{ case.localExamination ? case.localExamination : '—' }}
</dd>
<dt class="col-4 pb-4">Provisional Diagnosis</dt>
<dd class="col-8 pb-4">
{{ provisional_diagnosis|raw }}
</dd>
<dt class="col-4 pb-4">Major Cause group as per ICD 10</dt>
<dd class="col-8 pb-4">
{{ case.icd10CauseGroup ? case.icd10CauseGroup : '—' }}
</dd>
<dt class="col-4 pb-4">Major Sub Cause group as per ICD 10</dt>
<dd class="col-8 pb-4">
{{ case.icd10CauseSubGroup ? case.icd10CauseSubGroup : '—' }}
</dd>
<dt class="col-4 pb-4">Observation</dt>
<dd class="col-8 pb-4">
<dl class="row">
{% if case.temparature %}
<dt class="col-2">Temparature</dt>
<dd class="col-10">
{{ case.temparature }} °F
</dd>
{% endif %}
{% if case.cns %}
<dt class="col-2">CNS</dt>
<dd class="col-10">
{{ case.cns }}
</dd>
{% endif %}
{% if case.endrocine %}
<dt class="col-2">Endrocine</dt>
<dd class="col-10">
{{ case.endrocine }}
</dd>
{% endif %}
{% if case.excretory %}
<dt class="col-2">Excretory</dt>
<dd class="col-10">
{{ case.excretory }}
</dd>
{% endif %}
{% if case.pulse %}
<dt class="col-2">Pulse</dt>
<dd class="col-10">
{{ case.pulse ~ ' /min' }}
</dd>
{% endif %}
{% if case.bpUpper and case.bpLower %}
<dt class="col-2">BP</dt>
<dd class="col-10">
Systolic: {{ case.bpUpper }}, Diastolic: {{ case.bpLower }}
</dd>
{% endif %}
{% if case.respiration %}
<dt class="col-2">Respiration</dt>
<dd class="col-10">
{{ case.respiration ~ ' /min' }}
</dd>
{% endif %}
{% if case.auscultation %}
<dt class="col-2">Auscultation</dt>
<dd class="col-10">
{{ case.auscultation }}
</dd>
{% endif %}
</dl>
</dd>
<dt class="col-4 pb-4">Confirmed Diagnosis as per ICD 10</dt>
<dd class="col-8 pb-4">
{{ case.icd10Disease ? case.icd10Disease : '—'}}
</dd>
<dt class="col-4 pb-4">Other Confirmed Diagnosis</dt>
<dd class="col-8 pb-4">
{{ case.confirmedDiagnosis ? case.confirmedDiagnosis : '—' }}
</dd>
<dt class="col-4 pb-4">Non-communicable Diseases</dt>
<dd class="col-8 pb-4">
{{ ncds|raw }}
</dd>
<dt class="col-4 pb-4">Laboratory Tests required</dt>
<dd class="col-8 pb-4">
{{ case.isLab ? 'Yes' : 'No' }}
</dd>
<dt class="col-4 pb-4">Medicines required</dt>
<dd class="col-8 pb-4">
{{ case.isMedicine ? 'Yes' : 'No' }}
</dd>
<dt class="col-4 pb-4">Admitted in Ward</dt>
<dd class="col-8 pb-4">
{{ case.isWard ? 'Yes' : 'No' }}
</dd>
<dt class="col-4">Status</dt>
<dd class="col-8">
{{ case.isClosed ? 'Closed' : 'Follow-up' }}
</dd>
</dl>
</div>
</div>
</div>
</div>
{% if case.isOpinion %}
<div class="card">
<div class="card-header" id="expert-opinion-header">
<div class="card-title collapsed" data-toggle="collapse" data-target="#expert-opinion" aria-expanded="true" aria-controls="expert-opinion">
<i class="flaticon2-layers-1 fa-2x"></i>Expert Opinions
</div>
</div>
<div id="expert-opinion" class="collapse" aria-labelledby="expert-opinion-label" data-parent="#case-details">
<div class="card-body p-4">
<h5>Expert Opinions</h5>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th width="2%" class="text-nowrap">Sr. No.</th>
<th width="8%">Date</th>
<th class="text-nowrap">Expert Doctor</th>
<th>Department</th>
<th>Hosiptal</th>
<th width="50%">Expert Opinion</th>
</tr>
</thead>
<tbody>
{% for opinion in opinions %}
<tr>
<td class="text-right">{{ loop.index }}</td>
<td class="text-right">{{ opinion.updated_at|date('d/m/Y') }}</td>
<td>{{ opinion.doctor }}</td>
<td>{{ opinion.department }}</td>
<td>{{ opinion.hospital }}</td>
<td>{{ opinion.expert_opinion|raw }}</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
{% if case.isReferral %}
<div class="card">
<div class="card-header" id="referrals-header">
<div class="card-title collapsed" data-toggle="collapse" data-target="#referrals" aria-expanded="true" aria-controls="referrals">
<i class="flaticon2-layers-1 fa-2x"></i>Referrals
</div>
</div>
<div id="referrals" class="collapse" aria-labelledby="referrals-label" data-parent="#case-details">
<div class="card-body p-4">
<h5>Referrals</h5>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th width="2%" class="text-nowrap">Sr. No.</th>
<th width="8%">Date</th>
<th>Doctor</th>
<th>Hosiptal</th>
<th>Purpose</th>
<th width="15%">Actions</th>
</tr>
</thead>
<tbody>
{% for referral in referrals %}
<tr>
<td class="text-right">{{ loop.index }}</td>
<td class="text-right">{{ referral.updated_at|date('d/m/Y') }}</td>
<td>{{ referral.doctor }}</td>
<td>{{ referral.hospital }}</td>
<td>{{ referral.notes }}</td>
<td class="text-center">
<a href="{{ path('case_print_ref_letter', {'id': referral.id | nzo_encrypt }) }}" class="actions mr-2" target="_blank" data-toggle="kt-tooltip" title="Print Referral Letter">
<i class="fa fas fa-print fa-2x"></i>
</a>
<a href="{{ path('case_pdf_ref_letter', {'id': referral.id | nzo_encrypt}) }}" class="actions mr-2" data-toggle="kt-tooltip" title="Download Referral Letter" download>
<i class="fas fa-download fa-2x"></i>
</a>
<a href="#" class="actions mr-2" data-toggle="kt-tooltip" title="Send Referral Letter by Email">
<i class="fa fas fa-envelope fa-2x"></i>
</a>
<a href="#" class="actions" data-toggle="kt-tooltip" title="Send Referral Letter by WhatsApp">
<i class="fab fa-whatsapp-square fa-2x"></i>
</a>
</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endif %}
{% if case.isLab %}
<div class="card">
<div class="card-header" id="lab-info-header">
<div class="card-title collapsed" data-toggle="collapse" data-target="#lab-info" aria-expanded="false" aria-controls="lab-info">
<i class="fa fa-microscope fa-2x"></i>Diagnostics
</div>
</div>
<div id="lab-info" class="collapse" aria-labelledby="lab-info-label" data-parent="#case-details">
<div class="card-body p-4">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th class="text-nowrap">Test Name</th>
<th>Method</th>
<th class="text-nowrap">Normal Range</th>
<th class="text-nowrap">Sample Number</th>
<th width="400">Result</th>
{% if is_granted('ROLE_DOC') %}
<th>Actions</th>
{% endif %}
</tr>
</thead>
<tbody>
{% for test in case_tests %}
<tr>
<td>{{ test.name }}</td>
<td>{{ test.method ? test.method : '—' }}</td>
<td>{{ test.normal_range ? test.normal_range : '—' }}</td>
<td class="text-right">{{ test.number ? test.number : '—' }}</td>
<td>{{ test.result|raw }}</td>
{% if is_granted('ROLE_DOC') %}
<td class="text-center">
{% if test.is_general == 1 %}
{% if test.file_url %}
<a href="{{ asset('uploads/radiology/report-' ~ case.id ~ '/' ~ test.file_url) }}" download class="btn btn-primary" role="button">
Downaload Report
</a>
{% else %}
—
{% endif %}
{% else %}
{% if test.result %}
<a href="{{ path('case_lab_print', { id: case.id | nzo_encrypt }) }}" target="_blank" class="btn btn-primary" role="button">
Print
</a>
{% else %}
—
{% endif %}
{% endif %}
</td>
{% endif %}
</tr>
{% else %}
<tr>
<td colspan="{{ is_granted('ROLE_DOC') ? '6' : '5' }}" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endif %}
{% if case.isMedicine %}
<div class="card">
<div class="card-header" id="medicine-info-header">
<div class="card-title collapsed" data-toggle="collapse" data-target="#medicine-info" aria-expanded="false" aria-controls="medicine-info">
<i class="fa fa-prescription fa-2x"></i>Prescription
</div>
</div>
<div id="medicine-info" class="collapse" aria-labelledby="medicine-info-label" data-parent="#case-details">
<div class="card-body p-4">
<dl>
<dt>Confirmed Diagnosis</dt>
<dd>
{{ case.icd10Disease ? case.icd10Disease : '—' }}
</dd>
<dt>Supportive Advice</dt>
<dd>
{{ case.icd10Disease ? case.icd10Disease.supportiveAdvice : '—' }}
</dd>
<dt>Pharmaceutical Treatment</dt>
<dd>
{{ case.icd10Disease ? case.icd10Disease.pharmaTreatment : '—' }}
</dd>
</dl>
<hr>
<h5>Prescribed Medicines</h5>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Medicine</th>
<th>Dose</th>
<th width="300">Freqency</th>
<th>Days</th>
<th>Patient Notes</th>
</tr>
</thead>
<tbody>
{% for medicine in case_medicines %}
<tr>
<td>{{ medicine.medicine_type }}</td>
<td>
{% if medicine.is_referral %}
<span class="kt-badge kt-badge--primary kt-badge--lg mr-2 btn font-weight-bold" data-toggle="kt-tooltip" title="Referred">R</span>
{% endif %}
{% if medicine.is_opinion %}
<span class="kt-badge kt-badge--primary kt-badge--lg mr-2 btn font-weight-bold" data-toggle="kt-tooltip" title="Expert Opinion">E</span>
{% endif %}
{{ medicine.name }}
</td>
<td>{{ medicine.dose }}</td>
<td>{{ medicine.frequency }}</td>
<td>{{ medicine.num_days }}</td>
<td>{{ medicine.notes ? medicine.notes : '—' }}</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<dl>
<dt>General Notes for Patient</dt>
<dd>{{ case.pharmacyPatientNotes ? case.pharmacyPatientNotes : '—' }}</dd>
<dt>General Notes for Pharmacy Staff</dt>
<dd>{{ case.pharmacyStaffNotes ? case.pharmacyStaffNotes : '—'}}</dd>
</dl>
</div>
</div>
</div>
{% endif %}
{% if case.isWard %}
<div class="card">
<div class="card-header" id="ward-medicine-info-header">
<div class="card-title collapsed" data-toggle="collapse" data-target="#ward-medicine-info" aria-expanded="false" aria-controls="ward-medicine-info">
<i class="fa fa-procedures fa-2x"></i>Medicine in Ward
</div>
</div>
<div id="ward-medicine-info" class="collapse" aria-labelledby="ward-medicine-info-label" data-parent="#case-details">
<div class="card-body p-4">
<dl class="row">
<dt class="col-1">Ward Type</dt>
<dd class="col-3">{{ ward_type }}</dd>
<dt class="col-1">Bed No.</dt>
<dd class="col-3">{{ ward_bed_num }}</dd>
</dl>
<hr>
<h5>Prescribed Medicines for Ward</h5>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>Type</th>
<th>Medicine</th>
<th>Dose</th>
<th width="300">Freqency</th>
<th>Days</th>
<th>Staff Notes</th>
</tr>
</thead>
<tbody>
{% for medicine in case_ward_medicines %}
<tr>
<td>{{ medicine.medicine_type }}</td>
<td>
{% if medicine.is_emergency %}
<span class="kt-badge kt-badge--danger kt-badge--md mr-2 btn font-weight-bold" data-toggle="kt-tooltip" title="Emergency Medicine">E</span>
{% endif %}
{{ medicine.name }}
</td>
<td>{{ medicine.dose }}</td>
<td>{{ medicine.frequency }}</td>
<td>{{ medicine.num_days }}</td>
<td>{{ medicine.notes }}</td>
</tr>
{% else %}
<tr>
<td colspan="6" class="text-center">No records found</td>
</tr>
{% endfor %}
</tbody>
</table>
<dl>
<dt>General Notes for Ward Staff</dt>
<dd>{{ case.wardStaffNotes ? case.wardStaffNotes : '—' }}</dd>
<dt>Discharge Notes</dt>
<dd>{{ discharge_note ? discharge_note : '—'}}</dd>
</dl>
</div>
</div>
</div>
{% endif %}
</div>
{% include 'cases/_case_history.html.twig' %}
</div>
</div>
</div>
{% endblock %}