326 lines
16 KiB
HTML
326 lines
16 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Delete Vital Signs - EMR{% endblock %}
|
|
|
|
{% block content %}
|
|
<!-- BEGIN breadcrumb -->
|
|
<ol class="breadcrumb float-xl-end">
|
|
<li class="breadcrumb-item"><a href="{% url 'core:dashboard' %}">Dashboard</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'emr:dashboard' %}">EMR</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'emr:vital_signs_list' %}">Vital Signs</a></li>
|
|
<li class="breadcrumb-item active">Delete Confirmation</li>
|
|
</ol>
|
|
<!-- END breadcrumb -->
|
|
|
|
<!-- BEGIN page-header -->
|
|
<h1 class="page-header">
|
|
Delete Vital Signs
|
|
<small>Confirmation Required</small>
|
|
</h1>
|
|
<!-- END page-header -->
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-xl-8">
|
|
<!-- BEGIN panel -->
|
|
<div class="panel panel-inverse">
|
|
<div class="panel-heading">
|
|
<h4 class="panel-title">
|
|
<i class="fa fa-exclamation-triangle text-warning me-2"></i>
|
|
Confirm Vital Signs Deletion
|
|
</h4>
|
|
</div>
|
|
<div class="panel-body">
|
|
<!-- Warning Alert -->
|
|
<div class="alert alert-warning d-flex align-items-center mb-4">
|
|
<i class="fa fa-exclamation-triangle fa-2x me-3"></i>
|
|
<div>
|
|
<h6 class="alert-heading mb-1">Warning: Permanent Deletion</h6>
|
|
<p class="mb-0">You are about to permanently delete vital signs measurements. This action cannot be undone and may affect patient care documentation.</p>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Vital Signs Information -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<h6 class="mb-3">Vital Signs Details</h6>
|
|
<table class="table table-borderless">
|
|
<tr>
|
|
<td class="fw-bold" width="140">Patient:</td>
|
|
<td>
|
|
<a href="{% url 'patients:patient_detail' object.patient.pk %}" class="text-decoration-none">
|
|
{{ object.patient.get_full_name }}
|
|
</a>
|
|
<br><small class="text-muted">{{ object.patient.medical_record_number }}</small>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Measurement ID:</td>
|
|
<td><code>{{ object.measurement_id }}</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Date/Time:</td>
|
|
<td>{{ object.measured_datetime|date:"M d, Y H:i" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Measured By:</td>
|
|
<td>{{ object.measured_by.get_full_name }}</td>
|
|
</tr>
|
|
{% if object.verified_by %}
|
|
<tr>
|
|
<td class="fw-bold">Verified By:</td>
|
|
<td>{{ object.verified_by.get_full_name }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
</table>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6 class="mb-3">Measurements</h6>
|
|
<table class="table table-sm table-borderless">
|
|
{% if object.temperature %}
|
|
<tr>
|
|
<td class="fw-bold" width="120">Temperature:</td>
|
|
<td>{{ object.temperature }}°F ({{ object.get_temperature_method_display }})</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.blood_pressure %}
|
|
<tr>
|
|
<td class="fw-bold">Blood Pressure:</td>
|
|
<td>{{ object.blood_pressure }} mmHg</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.heart_rate %}
|
|
<tr>
|
|
<td class="fw-bold">Heart Rate:</td>
|
|
<td>{{ object.heart_rate }} bpm</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.respiratory_rate %}
|
|
<tr>
|
|
<td class="fw-bold">Respiratory Rate:</td>
|
|
<td>{{ object.respiratory_rate }} /min</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.oxygen_saturation %}
|
|
<tr>
|
|
<td class="fw-bold">Oxygen Saturation:</td>
|
|
<td>{{ object.oxygen_saturation }}% ({{ object.get_oxygen_delivery_display }})</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.pain_scale %}
|
|
<tr>
|
|
<td class="fw-bold">Pain Scale:</td>
|
|
<td>{{ object.pain_scale }}/10</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.weight %}
|
|
<tr>
|
|
<td class="fw-bold">Weight:</td>
|
|
<td>{{ object.weight }} lbs</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.height %}
|
|
<tr>
|
|
<td class="fw-bold">Height:</td>
|
|
<td>{{ object.height }} inches</td>
|
|
</tr>
|
|
{% endif %}
|
|
{% if object.bmi %}
|
|
<tr>
|
|
<td class="fw-bold">BMI:</td>
|
|
<td>{{ object.bmi }}</td>
|
|
</tr>
|
|
{% endif %}
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Impact Assessment -->
|
|
<div class="alert alert-info mb-4">
|
|
<h6 class="alert-heading">
|
|
<i class="fa fa-info-circle me-2"></i>Impact Assessment
|
|
</h6>
|
|
<ul class="mb-0">
|
|
<li><strong>Clinical Documentation:</strong> These vital signs will be permanently removed from the patient's medical record</li>
|
|
<li><strong>Trending Data:</strong> Removal may affect vital signs trending and analysis</li>
|
|
<li><strong>Quality Metrics:</strong> May impact quality reporting and compliance metrics</li>
|
|
{% if object.has_critical_values %}
|
|
<li><strong>Critical Values:</strong> <span class="text-warning">This measurement contains critical values that triggered alerts</span></li>
|
|
{% endif %}
|
|
{% if object.encounter %}
|
|
<li><strong>Encounter Documentation:</strong> Will affect the completeness of encounter {{ object.encounter.encounter_id }}</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Critical Values Warning -->
|
|
{% if object.has_critical_values %}
|
|
<div class="alert alert-danger mb-4">
|
|
<h6 class="alert-heading">
|
|
<i class="fa fa-exclamation-triangle me-2"></i>Critical Values Alert
|
|
</h6>
|
|
<p class="mb-2">This vital signs measurement contains critical values:</p>
|
|
<ul class="mb-0">
|
|
{% for critical in object.critical_values %}
|
|
<li>{{ critical }}</li>
|
|
{% endfor %}
|
|
</ul>
|
|
<p class="mt-2 mb-0"><strong>Deleting critical values may compromise patient safety documentation.</strong></p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Alternative Actions -->
|
|
<div class="card border-secondary mb-4">
|
|
<div class="card-header bg-light">
|
|
<h6 class="card-title mb-0">
|
|
<i class="fa fa-lightbulb me-2"></i>Alternative Actions
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text">Consider these alternatives instead of deletion:</p>
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<ul class="list-unstyled">
|
|
<li class="mb-2">
|
|
<i class="fa fa-edit text-primary me-2"></i>
|
|
<a href="{% url 'emr:vital_signs_update' object.pk %}" class="text-decoration-none">
|
|
Edit and correct the measurements
|
|
</a>
|
|
</li>
|
|
<li class="mb-2">
|
|
<i class="fa fa-comment text-info me-2"></i>
|
|
Add notes explaining any measurement issues
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<ul class="list-unstyled">
|
|
<li class="mb-2">
|
|
<i class="fa fa-plus text-success me-2"></i>
|
|
<a href="{% url 'emr:vital_signs_create' %}?encounter={{ object.encounter.pk }}" class="text-decoration-none">
|
|
Add corrected measurements
|
|
</a>
|
|
</li>
|
|
<li class="mb-2">
|
|
<i class="fa fa-flag text-warning me-2"></i>
|
|
Flag for quality review instead
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Confirmation Form -->
|
|
<form method="post" id="delete-form">
|
|
{% csrf_token %}
|
|
|
|
<div class="card border-danger">
|
|
<div class="card-header bg-danger text-white">
|
|
<h6 class="card-title mb-0">
|
|
<i class="fa fa-trash me-2"></i>Deletion Confirmation
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input" type="checkbox" id="confirm-understanding" required>
|
|
<label class="form-check-label" for="confirm-understanding">
|
|
I understand that this action will permanently delete the vital signs measurements and cannot be undone
|
|
</label>
|
|
</div>
|
|
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input" type="checkbox" id="confirm-impact" required>
|
|
<label class="form-check-label" for="confirm-impact">
|
|
I acknowledge the potential impact on patient care documentation and quality metrics
|
|
</label>
|
|
</div>
|
|
|
|
{% if object.has_critical_values %}
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input" type="checkbox" id="confirm-critical" required>
|
|
<label class="form-check-label" for="confirm-critical">
|
|
I acknowledge that this measurement contains critical values and understand the safety implications
|
|
</label>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Reason for Deletion <span class="text-danger">*</span></label>
|
|
<select class="form-select" name="deletion_reason" required>
|
|
<option value="">Select reason...</option>
|
|
<option value="DUPLICATE_ENTRY">Duplicate entry</option>
|
|
<option value="MEASUREMENT_ERROR">Measurement error</option>
|
|
<option value="WRONG_PATIENT">Wrong patient</option>
|
|
<option value="DEVICE_MALFUNCTION">Device malfunction</option>
|
|
<option value="DATA_ENTRY_ERROR">Data entry error</option>
|
|
<option value="QUALITY_ISSUE">Quality issue</option>
|
|
<option value="OTHER">Other</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label class="form-label">Additional Notes</label>
|
|
<textarea class="form-control" name="deletion_notes" rows="3"
|
|
placeholder="Provide additional details about why this deletion is necessary..."></textarea>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Action Buttons -->
|
|
<div class="d-flex justify-content-between mt-4">
|
|
<div>
|
|
<a href="{% url 'emr:vital_signs_detail' object.pk %}" class="btn btn-secondary">
|
|
<i class="fa fa-arrow-left me-2"></i>Cancel
|
|
</a>
|
|
<a href="{% url 'emr:vital_signs_update' object.pk %}" class="btn btn-primary ms-2">
|
|
<i class="fa fa-edit me-2"></i>Edit Instead
|
|
</a>
|
|
</div>
|
|
<button type="submit" class="btn btn-danger" id="delete-btn" disabled>
|
|
<i class="fa fa-trash me-2"></i>Permanently Delete Vital Signs
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
<!-- END panel -->
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
<script>
|
|
$(document).ready(function() {
|
|
// Enable/disable delete button based on checkboxes
|
|
function updateDeleteButton() {
|
|
var allChecked = true;
|
|
$('input[type="checkbox"][required]').each(function() {
|
|
if (!$(this).is(':checked')) {
|
|
allChecked = false;
|
|
return false;
|
|
}
|
|
});
|
|
|
|
var reasonSelected = $('select[name="deletion_reason"]').val() !== '';
|
|
|
|
$('#delete-btn').prop('disabled', !(allChecked && reasonSelected));
|
|
}
|
|
|
|
// Check on checkbox change
|
|
$('input[type="checkbox"], select[name="deletion_reason"]').on('change', updateDeleteButton);
|
|
|
|
// Form submission confirmation
|
|
$('#delete-form').on('submit', function(e) {
|
|
if (!confirm('Are you absolutely sure you want to permanently delete these vital signs? This action cannot be undone.')) {
|
|
e.preventDefault();
|
|
}
|
|
});
|
|
|
|
// Auto-focus on first checkbox
|
|
$('#confirm-understanding').focus();
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|