243 lines
12 KiB
HTML
243 lines
12 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Delete Imaging Study - {{ object.study_id }}{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex align-items-center mb-3">
|
|
<div>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{% url 'radiology:dashboard' %}">Radiology</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'radiology:imaging_study_list' %}">Imaging Studies</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'radiology:imaging_study_detail' object.pk %}">{{ object.study_id }}</a></li>
|
|
<li class="breadcrumb-item active">Delete</li>
|
|
</ol>
|
|
<h1 class="page-header mb-0">Delete Imaging Study</h1>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-xl-8">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4 class="card-title">
|
|
<i class="fas fa-exclamation-triangle text-danger me-2"></i>
|
|
Confirm Deletion
|
|
</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-danger">
|
|
<h5><i class="fas fa-exclamation-triangle me-2"></i>Warning</h5>
|
|
<p class="mb-0">You are about to permanently delete this imaging study. This action cannot be undone and will affect:</p>
|
|
</div>
|
|
|
|
<!-- Study Information -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<h6 class="text-muted mb-2">Study Information</h6>
|
|
<table class="table table-sm">
|
|
<tr>
|
|
<td class="fw-bold">Study ID:</td>
|
|
<td>{{ object.study_id }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Patient:</td>
|
|
<td>{{ object.patient.get_full_name }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Study Type:</td>
|
|
<td>{{ object.get_study_type_display }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Study Date:</td>
|
|
<td>{{ object.study_date|date:"M d, Y" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Status:</td>
|
|
<td>
|
|
<span class="badge bg-{% if object.status == 'completed' %}success{% elif object.status == 'in_progress' %}warning{% elif object.status == 'cancelled' %}danger{% else %}secondary{% endif %}">
|
|
{{ object.get_status_display }}
|
|
</span>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6 class="text-muted mb-2">Technical Details</h6>
|
|
<table class="table table-sm">
|
|
<tr>
|
|
<td class="fw-bold">Modality:</td>
|
|
<td>{{ object.modality }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Equipment:</td>
|
|
<td>{{ object.equipment|default:"Not specified" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Technologist:</td>
|
|
<td>{{ object.technologist|default:"Not assigned" }}</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="fw-bold">Images Count:</td>
|
|
<td>{{ object.images_count|default:0 }}</td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Impact Assessment -->
|
|
<div class="alert alert-warning">
|
|
<h6><i class="fas fa-info-circle me-2"></i>Deletion Impact</h6>
|
|
<ul class="mb-0">
|
|
<li><strong>DICOM Images:</strong> All associated DICOM images will be permanently deleted</li>
|
|
<li><strong>Reports:</strong> Any radiology reports linked to this study will be orphaned</li>
|
|
<li><strong>Billing:</strong> Billing records may be affected if charges are linked to this study</li>
|
|
<li><strong>Audit Trail:</strong> Deletion will be logged for compliance purposes</li>
|
|
<li><strong>Patient History:</strong> This study will be removed from patient's imaging history</li>
|
|
</ul>
|
|
</div>
|
|
|
|
<!-- Special Warnings -->
|
|
{% if object.status == 'completed' %}
|
|
<div class="alert alert-danger">
|
|
<h6><i class="fas fa-shield-alt me-2"></i>Completed Study Warning</h6>
|
|
<p class="mb-0">This is a completed study with potential clinical significance. Consider archiving instead of deletion to maintain patient care continuity.</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if object.images_count > 0 %}
|
|
<div class="alert alert-info">
|
|
<h6><i class="fas fa-images me-2"></i>DICOM Images</h6>
|
|
<p class="mb-0">This study contains {{ object.images_count }} DICOM images that will be permanently deleted. Ensure proper backup procedures have been followed.</p>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Alternative Actions -->
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">Alternative Actions</h6>
|
|
<p class="card-text">Consider these alternatives to deletion:</p>
|
|
<div class="btn-group-vertical w-100" role="group">
|
|
<a href="{% url 'radiology:imaging_study_detail' object.pk %}" class="btn btn-outline-primary btn-sm">
|
|
<i class="fas fa-edit me-2"></i>Edit Study Information
|
|
</a>
|
|
<button type="button" class="btn btn-outline-warning btn-sm" onclick="archiveStudy()">
|
|
<i class="fas fa-archive me-2"></i>Archive Study (Recommended)
|
|
</button>
|
|
<button type="button" class="btn btn-outline-info btn-sm" onclick="transferStudy()">
|
|
<i class="fas fa-exchange-alt me-2"></i>Transfer to Archive System
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-xl-4">
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4 class="card-title">Deletion Confirmation</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
|
|
<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">Duplicate Study</option>
|
|
<option value="error">Study Error</option>
|
|
<option value="patient_request">Patient Request</option>
|
|
<option value="data_quality">Poor Data Quality</option>
|
|
<option value="administrative">Administrative</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 context for this deletion..."></textarea>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="confirmBackup" required>
|
|
<label class="form-check-label" for="confirmBackup">
|
|
I confirm that proper backup procedures have been followed
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<div class="form-check">
|
|
<input class="form-check-input" type="checkbox" id="confirmUnderstand" required>
|
|
<label class="form-check-label" for="confirmUnderstand">
|
|
I understand this action cannot be undone
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="d-grid gap-2">
|
|
<button type="submit" class="btn btn-danger" id="deleteBtn" disabled>
|
|
<i class="fas fa-trash me-2"></i>Delete Imaging Study
|
|
</button>
|
|
<a href="{% url 'radiology:imaging_study_detail' object.pk %}" class="btn btn-secondary">
|
|
<i class="fas fa-times me-2"></i>Cancel
|
|
</a>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Contact Information -->
|
|
<div class="card">
|
|
<div class="card-header">
|
|
<h4 class="card-title">Need Help?</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<p class="card-text">If you're unsure about deleting this study, contact:</p>
|
|
<ul class="list-unstyled">
|
|
<li><i class="fas fa-user-md me-2"></i><strong>Radiology Manager:</strong> ext. 2150</li>
|
|
<li><i class="fas fa-cog me-2"></i><strong>IT Support:</strong> ext. 3000</li>
|
|
<li><i class="fas fa-shield-alt me-2"></i><strong>Compliance:</strong> ext. 2200</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
const confirmBackup = document.getElementById('confirmBackup');
|
|
const confirmUnderstand = document.getElementById('confirmUnderstand');
|
|
const deleteBtn = document.getElementById('deleteBtn');
|
|
const reasonSelect = document.querySelector('select[name="deletion_reason"]');
|
|
|
|
function updateDeleteButton() {
|
|
deleteBtn.disabled = !(confirmBackup.checked && confirmUnderstand.checked && reasonSelect.value);
|
|
}
|
|
|
|
confirmBackup.addEventListener('change', updateDeleteButton);
|
|
confirmUnderstand.addEventListener('change', updateDeleteButton);
|
|
reasonSelect.addEventListener('change', updateDeleteButton);
|
|
});
|
|
|
|
function archiveStudy() {
|
|
if (confirm('Archive this study instead of deleting it?')) {
|
|
// Implement archive functionality
|
|
window.location.href = '{% url "radiology:imaging_study_detail" object.pk %}?action=archive';
|
|
}
|
|
}
|
|
|
|
function transferStudy() {
|
|
if (confirm('Transfer this study to the archive system?')) {
|
|
// Implement transfer functionality
|
|
window.location.href = '{% url "radiology:imaging_study_detail" object.pk %}?action=transfer';
|
|
}
|
|
}
|
|
</script>
|
|
{% endblock %}
|
|
|