520 lines
27 KiB
HTML
520 lines
27 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}Delete Drug Interaction{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="d-flex align-items-center mb-3">
|
|
<div>
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="{% url 'pharmacy:dashboard' %}">Pharmacy</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'pharmacy:drug_interaction_list' %}">Drug Interactions</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'pharmacy:drug_interaction_detail' object.pk %}">{{ object.drug1.name }} + {{ object.drug2.name }}</a></li>
|
|
<li class="breadcrumb-item active">Delete</li>
|
|
</ol>
|
|
<h1 class="page-header mb-0">Delete Drug Interaction</h1>
|
|
</div>
|
|
<div class="ms-auto">
|
|
<a href="{% url 'pharmacy:drug_interaction_detail' object.pk %}" class="btn btn-secondary">
|
|
<i class="fas fa-arrow-left me-2"></i>Back to Interaction
|
|
</a>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row justify-content-center">
|
|
<div class="col-xl-8">
|
|
<div class="card">
|
|
<div class="card-header bg-danger text-white">
|
|
<h4 class="card-title mb-0">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
Confirm Drug Interaction Deletion
|
|
</h4>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-warning">
|
|
<h5 class="alert-heading">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
Are you sure you want to delete this drug interaction?
|
|
</h5>
|
|
<p class="mb-0">
|
|
This action cannot be undone. The drug interaction record and all associated data will be permanently removed from the system.
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Interaction Details -->
|
|
<div class="row mb-4">
|
|
<div class="col-md-6">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-pills me-2"></i>Primary Drug
|
|
</h6>
|
|
<div class="mb-2">
|
|
<strong>Name:</strong> {{ object.drug1.name }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Generic:</strong> {{ object.drug1.generic_name }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Brand:</strong> {{ object.drug1.brand_name|default:"N/A" }}
|
|
</div>
|
|
<div>
|
|
<strong>Class:</strong> {{ object.drug1.drug_class|default:"N/A" }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-pills me-2"></i>Interacting Drug
|
|
</h6>
|
|
<div class="mb-2">
|
|
<strong>Name:</strong> {{ object.drug2.name }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Generic:</strong> {{ object.drug2.generic_name }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Brand:</strong> {{ object.drug2.brand_name|default:"N/A" }}
|
|
</div>
|
|
<div>
|
|
<strong>Class:</strong> {{ object.drug2.drug_class|default:"N/A" }}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Interaction Information -->
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>Interaction Information
|
|
</h6>
|
|
<div class="row">
|
|
<div class="col-md-4">
|
|
<div class="mb-2">
|
|
<strong>Severity:</strong>
|
|
<span class="badge bg-{% if object.severity == 'minor' %}success{% elif object.severity == 'moderate' %}warning{% elif object.severity == 'major' %}danger{% elif object.severity == 'contraindicated' %}dark{% else %}secondary{% endif %}">
|
|
{{ object.get_severity_display }}
|
|
</span>
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Type:</strong> {{ object.get_interaction_type_display|default:"Not specified" }}
|
|
</div>
|
|
<div>
|
|
<strong>Onset:</strong> {{ object.get_onset_display|default:"Not specified" }}
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="mb-2">
|
|
<strong>Evidence Level:</strong> {{ object.get_evidence_level_display|default:"Not specified" }}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Frequency:</strong> {{ object.get_frequency_display|default:"Not specified" }}
|
|
</div>
|
|
<div>
|
|
<strong>Status:</strong>
|
|
<span class="badge bg-{% if object.is_active %}success{% else %}secondary{% endif %}">
|
|
{% if object.is_active %}Active{% else %}Inactive{% endif %}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="col-md-4">
|
|
<div class="mb-2">
|
|
<strong>Monitoring Required:</strong>
|
|
{% if object.requires_monitoring %}
|
|
<span class="badge bg-warning">Yes</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">No</span>
|
|
{% endif %}
|
|
</div>
|
|
<div class="mb-2">
|
|
<strong>Contraindicated:</strong>
|
|
{% if object.contraindicated %}
|
|
<span class="badge bg-danger">Yes</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">No</span>
|
|
{% endif %}
|
|
</div>
|
|
<div>
|
|
<strong>Dose Adjustment:</strong>
|
|
{% if object.dose_adjustment_required %}
|
|
<span class="badge bg-info">Required</span>
|
|
{% else %}
|
|
<span class="badge bg-secondary">Not Required</span>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Description and Management -->
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card bg-light">
|
|
<div class="card-body">
|
|
<h6 class="card-title">
|
|
<i class="fas fa-file-alt me-2"></i>Description and Management
|
|
</h6>
|
|
|
|
{% if object.description %}
|
|
<div class="mb-3">
|
|
<strong>Description:</strong>
|
|
<div class="alert alert-info mt-2">
|
|
{{ object.description }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if object.clinical_effects %}
|
|
<div class="mb-3">
|
|
<strong>Clinical Effects:</strong>
|
|
<div class="alert alert-warning mt-2">
|
|
{{ object.clinical_effects }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if object.management %}
|
|
<div class="mb-3">
|
|
<strong>Management:</strong>
|
|
<div class="alert alert-success mt-2">
|
|
{{ object.management }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if object.references %}
|
|
<div>
|
|
<strong>References:</strong>
|
|
<div class="alert alert-secondary mt-2">
|
|
{{ object.references }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Impact Warning -->
|
|
{% if object.severity in 'major,contraindicated' %}
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card border-danger">
|
|
<div class="card-header bg-danger text-white">
|
|
<h6 class="card-title mb-0">
|
|
<i class="fas fa-exclamation-triangle me-2"></i>
|
|
Critical Interaction Warning
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-danger">
|
|
<strong>Warning:</strong> This is a {{ object.get_severity_display|lower }} drug interaction.
|
|
Deleting this record may impact patient safety by removing important clinical decision support.
|
|
</div>
|
|
|
|
{% if object.contraindicated %}
|
|
<div class="alert alert-warning">
|
|
<strong>Contraindicated Interaction:</strong> This interaction is marked as contraindicated,
|
|
meaning these drugs should not be used together. Removing this record may allow
|
|
dangerous drug combinations to be prescribed.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Usage Statistics -->
|
|
{% if interaction_usage_stats %}
|
|
<div class="row mb-4">
|
|
<div class="col-12">
|
|
<div class="card border-info">
|
|
<div class="card-header bg-info text-white">
|
|
<h6 class="card-title mb-0">
|
|
<i class="fas fa-chart-bar me-2"></i>
|
|
Usage Statistics
|
|
</h6>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-info">
|
|
<strong>System Impact:</strong> This interaction has been flagged {{ interaction_usage_stats.alert_count|default:0 }} time(s)
|
|
in the past 30 days and affects {{ interaction_usage_stats.affected_prescriptions|default:0 }} active prescription(s).
|
|
</div>
|
|
|
|
{% if interaction_usage_stats.recent_alerts %}
|
|
<div class="alert alert-warning">
|
|
<strong>Recent Activity:</strong> This interaction was last flagged {{ interaction_usage_stats.last_alert_date|date:"M d, Y" }}.
|
|
Deleting it may affect ongoing clinical decision support.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<!-- Deletion Form -->
|
|
<form method="post">
|
|
{% csrf_token %}
|
|
|
|
<div class="mb-3">
|
|
<label for="deletion_reason" class="form-label">
|
|
<strong>Reason for Deletion *</strong>
|
|
</label>
|
|
<select class="form-select" id="deletion_reason" name="deletion_reason" required>
|
|
<option value="">Select a reason</option>
|
|
<option value="duplicate_entry">Duplicate Entry</option>
|
|
<option value="incorrect_information">Incorrect Information</option>
|
|
<option value="outdated_data">Outdated Data</option>
|
|
<option value="evidence_disproven">Evidence Disproven</option>
|
|
<option value="drug_discontinued">Drug Discontinued</option>
|
|
<option value="system_cleanup">System Cleanup</option>
|
|
<option value="regulatory_change">Regulatory Change</option>
|
|
<option value="clinical_review">Clinical Review Decision</option>
|
|
<option value="other">Other</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div class="mb-3">
|
|
<label for="deletion_notes" class="form-label">
|
|
<strong>Additional Notes</strong>
|
|
</label>
|
|
<textarea class="form-control"
|
|
id="deletion_notes"
|
|
name="deletion_notes"
|
|
rows="3"
|
|
placeholder="Provide additional details about why this interaction is being deleted..."></textarea>
|
|
<div class="form-text">
|
|
These notes will be recorded for audit purposes and clinical review.
|
|
</div>
|
|
</div>
|
|
|
|
{% if object.severity in 'major,contraindicated' %}
|
|
<div class="mb-3">
|
|
<label for="clinical_approval" class="form-label">
|
|
<strong>Clinical Approval *</strong>
|
|
</label>
|
|
<select class="form-select" id="clinical_approval" name="clinical_approval" required>
|
|
<option value="">Select approval status</option>
|
|
<option value="pharmacist_approved">Pharmacist Approved</option>
|
|
<option value="physician_approved">Physician Approved</option>
|
|
<option value="committee_approved">Pharmacy Committee Approved</option>
|
|
<option value="emergency_deletion">Emergency Deletion</option>
|
|
</select>
|
|
<div class="form-text">
|
|
Critical interactions require clinical approval for deletion.
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input"
|
|
type="checkbox"
|
|
id="confirm_deletion"
|
|
name="confirm_deletion"
|
|
required>
|
|
<label class="form-check-label" for="confirm_deletion">
|
|
I understand that this action cannot be undone and confirm the deletion of this drug interaction.
|
|
</label>
|
|
</div>
|
|
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input"
|
|
type="checkbox"
|
|
id="notify_pharmacy"
|
|
name="notify_pharmacy">
|
|
<label class="form-check-label" for="notify_pharmacy">
|
|
Notify pharmacy staff about this interaction deletion.
|
|
</label>
|
|
</div>
|
|
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input"
|
|
type="checkbox"
|
|
id="update_prescriptions"
|
|
name="update_prescriptions">
|
|
<label class="form-check-label" for="update_prescriptions">
|
|
Review and update affected prescriptions and alerts.
|
|
</label>
|
|
</div>
|
|
|
|
{% if object.severity in 'major,contraindicated' %}
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input"
|
|
type="checkbox"
|
|
id="clinical_review"
|
|
name="clinical_review">
|
|
<label class="form-check-label" for="clinical_review">
|
|
Trigger clinical review for all patients currently on both medications.
|
|
</label>
|
|
</div>
|
|
{% endif %}
|
|
|
|
<div class="alert alert-info">
|
|
<h6 class="alert-heading">
|
|
<i class="fas fa-info-circle me-2"></i>What happens when you delete this interaction?
|
|
</h6>
|
|
<ul class="mb-0">
|
|
<li>The drug interaction record will be permanently removed from the system</li>
|
|
<li>Clinical decision support alerts for this combination will be disabled</li>
|
|
<li>Prescribers will no longer receive warnings about this drug combination</li>
|
|
<li>Historical interaction data and alerts will be archived</li>
|
|
<li>This action will be logged in the audit trail</li>
|
|
<li>Pharmacy staff may need to manually review affected prescriptions</li>
|
|
{% if object.severity in 'major,contraindicated' %}
|
|
<li>Critical interaction removal may require additional clinical oversight</li>
|
|
<li>Patient safety protocols may need to be updated</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
|
|
<div class="d-flex justify-content-between">
|
|
<a href="{% url 'pharmacy:drug_interaction_detail' object.pk %}" class="btn btn-secondary">
|
|
<i class="fas fa-times me-2"></i>Cancel
|
|
</a>
|
|
<button type="submit" class="btn btn-danger" onclick="return confirmDeletion()">
|
|
<i class="fas fa-trash me-2"></i>Delete Interaction
|
|
</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Safety Guidelines -->
|
|
<div class="card mt-4">
|
|
<div class="card-header bg-warning text-dark">
|
|
<h5 class="card-title mb-0">
|
|
<i class="fas fa-shield-alt me-2"></i>
|
|
Patient Safety Guidelines
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="alert alert-warning">
|
|
<strong>Important:</strong> Drug interaction databases are critical for patient safety.
|
|
Before deleting any interaction, ensure that:
|
|
</div>
|
|
|
|
<ul class="list-group list-group-flush">
|
|
<li class="list-group-item">
|
|
<i class="fas fa-check text-success me-2"></i>
|
|
The interaction information is verified as incorrect or outdated
|
|
</li>
|
|
<li class="list-group-item">
|
|
<i class="fas fa-check text-success me-2"></i>
|
|
Alternative clinical decision support measures are in place if needed
|
|
</li>
|
|
<li class="list-group-item">
|
|
<i class="fas fa-check text-success me-2"></i>
|
|
Affected prescriptions and patients have been reviewed
|
|
</li>
|
|
<li class="list-group-item">
|
|
<i class="fas fa-check text-success me-2"></i>
|
|
Pharmacy and clinical staff have been notified of the change
|
|
</li>
|
|
<li class="list-group-item">
|
|
<i class="fas fa-check text-success me-2"></i>
|
|
Documentation and audit trail requirements are met
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Related Information -->
|
|
<div class="card mt-4">
|
|
<div class="card-header">
|
|
<h5 class="card-title">
|
|
<i class="fas fa-link me-2"></i>
|
|
Related Information
|
|
</h5>
|
|
</div>
|
|
<div class="card-body">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h6>Interaction Details</h6>
|
|
<ul class="list-unstyled">
|
|
<li><strong>Interaction ID:</strong> {{ object.pk }}</li>
|
|
<li><strong>Created:</strong> {{ object.created_at|date:"M d, Y g:i A" }}</li>
|
|
<li><strong>Last Updated:</strong> {{ object.updated_at|date:"M d, Y g:i A" }}</li>
|
|
<li><strong>Created By:</strong> {{ object.created_by.get_full_name|default:"System" }}</li>
|
|
</ul>
|
|
</div>
|
|
<div class="col-md-6">
|
|
<h6>System Information</h6>
|
|
<ul class="list-unstyled">
|
|
<li><strong>Drug 1 ID:</strong> {{ object.drug1.pk }}</li>
|
|
<li><strong>Drug 2 ID:</strong> {{ object.drug2.pk }}</li>
|
|
<li><strong>Active Status:</strong> {{ object.is_active|yesno:"Yes,No" }}</li>
|
|
<li><strong>Version:</strong> {{ object.version|default:"1.0" }}</li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function confirmDeletion() {
|
|
const reason = document.getElementById('deletion_reason').value;
|
|
const confirmed = document.getElementById('confirm_deletion').checked;
|
|
|
|
if (!reason) {
|
|
alert('Please select a reason for deletion.');
|
|
return false;
|
|
}
|
|
|
|
if (!confirmed) {
|
|
alert('Please confirm that you understand this action cannot be undone.');
|
|
return false;
|
|
}
|
|
|
|
{% if object.severity in 'major,contraindicated' %}
|
|
const clinicalApproval = document.getElementById('clinical_approval').value;
|
|
if (!clinicalApproval) {
|
|
alert('Clinical approval is required for deleting critical interactions.');
|
|
return false;
|
|
}
|
|
{% endif %}
|
|
|
|
const drug1Name = "{{ object.drug1.name }}";
|
|
const drug2Name = "{{ object.drug2.name }}";
|
|
const severity = "{{ object.get_severity_display }}";
|
|
|
|
const message = `Are you absolutely sure you want to delete this drug interaction?\n\nDrugs: ${drug1Name} + ${drug2Name}\nSeverity: ${severity}\n\nThis action cannot be undone and may affect patient safety by removing clinical decision support.`;
|
|
|
|
return confirm(message);
|
|
}
|
|
|
|
document.addEventListener('DOMContentLoaded', function() {
|
|
// Auto-focus on deletion reason
|
|
document.getElementById('deletion_reason').focus();
|
|
|
|
// Show/hide additional notes based on reason
|
|
const reasonSelect = document.getElementById('deletion_reason');
|
|
const notesTextarea = document.getElementById('deletion_notes');
|
|
|
|
reasonSelect.addEventListener('change', function() {
|
|
if (this.value === 'other') {
|
|
notesTextarea.required = true;
|
|
notesTextarea.placeholder = 'Please specify the reason for deletion...';
|
|
} else {
|
|
notesTextarea.required = false;
|
|
notesTextarea.placeholder = 'Provide additional details about why this interaction is being deleted...';
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|