651 lines
33 KiB
HTML
651 lines
33 KiB
HTML
{% extends "base.html" %}
|
|
{% load static %}
|
|
|
|
{% block title %}{{ clinical_note.title }} | Clinical Note Detail{% endblock %}
|
|
|
|
{% block css %}
|
|
<link href="{% static 'plugins/bootstrap-icons/font/bootstrap-icons.css' %}" rel="stylesheet" />
|
|
<style>
|
|
.note-badge {
|
|
font-size: 0.85rem;
|
|
padding: 0.35em 0.65em;
|
|
}
|
|
.note-header {
|
|
background: linear-gradient(45deg, var(--bs-indigo), var(--bs-purple));
|
|
color: white;
|
|
padding: 1.5rem;
|
|
border-radius: 0.5rem;
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.note-status-signed {
|
|
background-color: var(--bs-success);
|
|
color: white;
|
|
}
|
|
.note-status-draft {
|
|
background-color: var(--bs-warning);
|
|
color: white;
|
|
}
|
|
.note-status-amended {
|
|
background-color: var(--bs-info);
|
|
color: white;
|
|
}
|
|
.note-status-addendum {
|
|
background-color: var(--bs-purple);
|
|
color: white;
|
|
}
|
|
.note-type-progress {
|
|
background-color: var(--bs-primary);
|
|
color: white;
|
|
}
|
|
.note-type-admission {
|
|
background-color: var(--bs-danger);
|
|
color: white;
|
|
}
|
|
.note-type-discharge {
|
|
background-color: var(--bs-success);
|
|
color: white;
|
|
}
|
|
.note-type-procedure {
|
|
background-color: var(--bs-warning);
|
|
color: white;
|
|
}
|
|
.note-type-consultation {
|
|
background-color: var(--bs-info);
|
|
color: white;
|
|
}
|
|
.note-content {
|
|
background-color: rgba(var(--bs-light-rgb), 0.5);
|
|
padding: 1.5rem;
|
|
border-radius: 0.5rem;
|
|
margin-bottom: 1.5rem;
|
|
border: 1px solid var(--bs-gray-300);
|
|
}
|
|
.note-section {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.note-section-title {
|
|
font-weight: 600;
|
|
margin-bottom: 0.5rem;
|
|
color: var(--bs-primary);
|
|
}
|
|
.note-metadata {
|
|
background-color: rgba(var(--bs-light-rgb), 0.5);
|
|
padding: 1rem;
|
|
border-radius: 0.5rem;
|
|
margin-bottom: 1.5rem;
|
|
border: 1px solid var(--bs-gray-300);
|
|
}
|
|
.note-metadata-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
padding: 0.5rem 0;
|
|
border-bottom: 1px solid var(--bs-gray-200);
|
|
}
|
|
.note-metadata-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
.note-metadata-label {
|
|
font-weight: 600;
|
|
color: var(--bs-gray-700);
|
|
}
|
|
.note-metadata-value {
|
|
text-align: right;
|
|
}
|
|
.note-signature {
|
|
background-color: rgba(var(--bs-success-rgb), 0.1);
|
|
padding: 1rem;
|
|
border-radius: 0.5rem;
|
|
margin-top: 1.5rem;
|
|
border: 1px solid var(--bs-success);
|
|
}
|
|
.note-signature-title {
|
|
font-weight: 600;
|
|
color: var(--bs-success);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
.note-amendment {
|
|
background-color: rgba(var(--bs-info-rgb), 0.1);
|
|
padding: 1rem;
|
|
border-radius: 0.5rem;
|
|
margin-top: 1.5rem;
|
|
border: 1px solid var(--bs-info);
|
|
}
|
|
.note-amendment-title {
|
|
font-weight: 600;
|
|
color: var(--bs-info);
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
.related-item {
|
|
transition: all 0.2s;
|
|
}
|
|
.related-item:hover {
|
|
transform: translateY(-3px);
|
|
box-shadow: 0 4px 8px rgba(0,0,0,0.1);
|
|
}
|
|
.nav-tabs .nav-link.active {
|
|
font-weight: bold;
|
|
border-bottom: 3px solid var(--bs-primary);
|
|
}
|
|
</style>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<!-- begin breadcrumb -->
|
|
<ol class="breadcrumb float-xl-end">
|
|
<li class="breadcrumb-item"><a href="{% url 'dashboard' %}">Home</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'emr:dashboard' %}">EMR</a></li>
|
|
<li class="breadcrumb-item"><a href="{% url 'emr:clinical_note_list' %}">Clinical Notes</a></li>
|
|
<li class="breadcrumb-item active">{{ clinical_note.title }}</li>
|
|
</ol>
|
|
<!-- end breadcrumb -->
|
|
|
|
<!-- begin page-header -->
|
|
<h1 class="page-header">Clinical Note Detail <small>Comprehensive clinical documentation</small></h1>
|
|
<!-- end page-header -->
|
|
|
|
<!-- begin row -->
|
|
<div class="row">
|
|
<!-- begin col-12 -->
|
|
<div class="col-xl-12">
|
|
<!-- begin note header -->
|
|
<div class="note-header d-flex justify-content-between align-items-center">
|
|
<div>
|
|
<h2 class="mb-1">{{ clinical_note.title }}</h2>
|
|
<div class="d-flex align-items-center">
|
|
<span class="me-3">
|
|
<i class="bi bi-person-fill me-1"></i> {{ clinical_note.patient.get_full_name }}
|
|
</span>
|
|
<span class="me-3">
|
|
<i class="bi bi-calendar-event me-1"></i> {{ clinical_note.note_datetime|date:"F d, Y" }} at {{ clinical_note.note_datetime|time:"h:i A" }}
|
|
</span>
|
|
<span>
|
|
<i class="bi bi-person-badge me-1"></i> {{ clinical_note.author.get_full_name }}
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="d-flex">
|
|
<span class="badge note-status-{{ clinical_note.status|lower }} me-2">{{ clinical_note.get_status_display }}</span>
|
|
<span class="badge note-type-{{ clinical_note.note_type|lower }}">{{ clinical_note.get_note_type_display }}</span>
|
|
</div>
|
|
</div>
|
|
<!-- end note header -->
|
|
|
|
<!-- begin note content panel -->
|
|
<div class="panel panel-inverse">
|
|
<div class="panel-heading">
|
|
<h4 class="panel-title">Note Content</h4>
|
|
<div class="panel-heading-btn">
|
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-default" data-toggle="panel-expand"><i class="fa fa-expand"></i></a>
|
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-success" data-toggle="panel-reload"><i class="fa fa-redo"></i></a>
|
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-warning" data-toggle="panel-collapse"><i class="fa fa-minus"></i></a>
|
|
</div>
|
|
</div>
|
|
<div class="panel-body">
|
|
<div class="note-content">
|
|
{% if clinical_note.structured_content %}
|
|
{% for section in clinical_note.structured_content %}
|
|
<div class="note-section">
|
|
<div class="note-section-title">{{ section.title }}</div>
|
|
<div class="note-section-content">{{ section.content|linebreaks }}</div>
|
|
</div>
|
|
{% endfor %}
|
|
{% else %}
|
|
{{ clinical_note.content|linebreaks }}
|
|
{% endif %}
|
|
</div>
|
|
|
|
{% if clinical_note.status == 'SIGNED' %}
|
|
<div class="note-signature">
|
|
<div class="note-signature-title">
|
|
<i class="bi bi-check-circle-fill me-1"></i> Electronically Signed
|
|
</div>
|
|
<div>
|
|
<strong>{{ clinical_note.author.get_full_name }}</strong> ({{ clinical_note.author.get_role_display }})
|
|
<br>
|
|
<small>Signed on {{ clinical_note.signed_datetime|date:"F d, Y" }} at {{ clinical_note.signed_datetime|time:"h:i A" }}</small>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if clinical_note.status == 'AMENDED' %}
|
|
<div class="note-amendment">
|
|
<div class="note-amendment-title">
|
|
<i class="bi bi-pencil-fill me-1"></i> Amendment Information
|
|
</div>
|
|
<div>
|
|
<strong>Amended by:</strong> {{ clinical_note.amended_by.get_full_name }} ({{ clinical_note.amended_by.get_role_display }})
|
|
<br>
|
|
<strong>Amended on:</strong> {{ clinical_note.amended_datetime|date:"F d, Y" }} at {{ clinical_note.amended_datetime|time:"h:i A" }}
|
|
<br>
|
|
<strong>Amendment reason:</strong> {{ clinical_note.amendment_reason }}
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
|
|
{% if clinical_note.addendums.all %}
|
|
<div class="mt-4">
|
|
<h5 class="mb-3">Addendums</h5>
|
|
{% for addendum in clinical_note.addendums.all %}
|
|
<div class="note-amendment mb-3">
|
|
<div class="note-amendment-title">
|
|
<i class="bi bi-plus-circle-fill me-1"></i> Addendum - {{ addendum.created_at|date:"F d, Y" }}
|
|
</div>
|
|
<div>
|
|
<strong>Added by:</strong> {{ addendum.author.get_full_name }} ({{ addendum.author.get_role_display }})
|
|
<br>
|
|
<strong>Added on:</strong> {{ addendum.created_at|date:"F d, Y" }} at {{ addendum.created_at|time:"h:i A" }}
|
|
</div>
|
|
<div class="mt-2">
|
|
{{ addendum.content|linebreaks }}
|
|
</div>
|
|
</div>
|
|
{% endfor %}
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
<!-- end note content panel -->
|
|
|
|
<!-- begin note details panel -->
|
|
<div class="panel panel-inverse">
|
|
<div class="panel-heading">
|
|
<h4 class="panel-title">Note Details</h4>
|
|
<div class="panel-heading-btn">
|
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-default" data-toggle="panel-expand"><i class="fa fa-expand"></i></a>
|
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-success" data-toggle="panel-reload"><i class="fa fa-redo"></i></a>
|
|
<a href="javascript:;" class="btn btn-xs btn-icon btn-warning" data-toggle="panel-collapse"><i class="fa fa-minus"></i></a>
|
|
</div>
|
|
</div>
|
|
<div class="panel-body">
|
|
<!-- begin nav tabs -->
|
|
<ul class="nav nav-tabs" id="noteDetailsTabs" role="tablist">
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link active" id="metadata-tab" data-bs-toggle="tab" data-bs-target="#metadata" type="button" role="tab" aria-controls="metadata" aria-selected="true">Metadata</button>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link" id="related-tab" data-bs-toggle="tab" data-bs-target="#related" type="button" role="tab" aria-controls="related" aria-selected="false">Related Records</button>
|
|
</li>
|
|
<li class="nav-item" role="presentation">
|
|
<button class="nav-link" id="history-tab" data-bs-toggle="tab" data-bs-target="#history" type="button" role="tab" aria-controls="history" aria-selected="false">Version History</button>
|
|
</li>
|
|
</ul>
|
|
<!-- end nav tabs -->
|
|
|
|
<!-- begin tab content -->
|
|
<div class="tab-content" id="noteDetailsTabsContent">
|
|
<!-- Metadata Tab -->
|
|
<div class="tab-pane fade show active" id="metadata" role="tabpanel" aria-labelledby="metadata-tab">
|
|
<div class="p-3">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<div class="note-metadata">
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Note ID</div>
|
|
<div class="note-metadata-value">{{ clinical_note.note_id }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Patient</div>
|
|
<div class="note-metadata-value">{{ clinical_note.patient.get_full_name }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Author</div>
|
|
<div class="note-metadata-value">{{ clinical_note.author.get_full_name }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Note Type</div>
|
|
<div class="note-metadata-value">{{ clinical_note.get_note_type_display }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Status</div>
|
|
<div class="note-metadata-value">{{ clinical_note.get_status_display }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<div class="note-metadata">
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Created</div>
|
|
<div class="note-metadata-value">{{ clinical_note.created_at }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Last Updated</div>
|
|
<div class="note-metadata-value">{{ clinical_note.updated_at }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Note Date/Time</div>
|
|
<div class="note-metadata-value">{{ clinical_note.note_datetime }}</div>
|
|
</div>
|
|
{% if clinical_note.signed_datetime %}
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Signed Date/Time</div>
|
|
<div class="note-metadata-value">{{ clinical_note.signed_datetime }}</div>
|
|
</div>
|
|
{% endif %}
|
|
{% if clinical_note.amended_datetime %}
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Amended Date/Time</div>
|
|
<div class="note-metadata-value">{{ clinical_note.amended_datetime }}</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{% if clinical_note.related_encounter %}
|
|
<div class="row mt-3">
|
|
<div class="col-md-12">
|
|
<div class="note-metadata">
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Related Encounter</div>
|
|
<div class="note-metadata-value">
|
|
<a href="{% url 'emr:encounter_detail' clinical_note.related_encounter.id %}">
|
|
{{ clinical_note.related_encounter.encounter_type }} - {{ clinical_note.related_encounter.start_time|date:"M d, Y" }}
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Encounter Provider</div>
|
|
<div class="note-metadata-value">{{ clinical_note.related_encounter.provider.get_full_name }}</div>
|
|
</div>
|
|
<div class="note-metadata-item">
|
|
<div class="note-metadata-label">Encounter Location</div>
|
|
<div class="note-metadata-value">{{ clinical_note.related_encounter.location }}</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Related Records Tab -->
|
|
<div class="tab-pane fade" id="related" role="tabpanel" aria-labelledby="related-tab">
|
|
<div class="p-3">
|
|
<div class="row">
|
|
<div class="col-md-6">
|
|
<h5 class="mb-3">Related Problems</h5>
|
|
{% if clinical_note.related_problems.all %}
|
|
<div class="list-group">
|
|
{% for problem in clinical_note.related_problems.all %}
|
|
<a href="{% url 'emr:problem_detail' problem.id %}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center related-item">
|
|
{{ problem.problem_name }}
|
|
<span class="badge bg-{{ problem.status|lower }} rounded-pill">{{ problem.get_status_display }}</span>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-info">
|
|
<i class="fa fa-info-circle me-2"></i> No problems are associated with this note.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
|
|
<div class="col-md-6">
|
|
<h5 class="mb-3">Related Care Plans</h5>
|
|
{% if clinical_note.related_care_plans.all %}
|
|
<div class="list-group">
|
|
{% for care_plan in clinical_note.related_care_plans.all %}
|
|
<a href="{% url 'emr:care_plan_detail' care_plan.id %}" class="list-group-item list-group-item-action d-flex justify-content-between align-items-center related-item">
|
|
{{ care_plan.title }}
|
|
<span class="badge bg-{{ care_plan.status|lower }} rounded-pill">{{ care_plan.get_status_display }}</span>
|
|
</a>
|
|
{% endfor %}
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-info">
|
|
<i class="fa fa-info-circle me-2"></i> No care plans are associated with this note.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row mt-4">
|
|
<div class="col-md-12">
|
|
<h5 class="mb-3">Related Notes</h5>
|
|
{% if clinical_note.related_notes.all %}
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Title</th>
|
|
<th>Type</th>
|
|
<th>Date</th>
|
|
<th>Author</th>
|
|
<th>Status</th>
|
|
<th>Actions</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for note in clinical_note.related_notes.all %}
|
|
<tr>
|
|
<td>{{ note.title }}</td>
|
|
<td>{{ note.get_note_type_display }}</td>
|
|
<td>{{ note.note_datetime|date:"M d, Y" }}</td>
|
|
<td>{{ note.author.get_full_name }}</td>
|
|
<td>
|
|
<span class="badge note-status-{{ note.status|lower }}">{{ note.get_status_display }}</span>
|
|
</td>
|
|
<td>
|
|
<a href="{% url 'emr:clinical_note_detail' note.id %}" class="btn btn-sm btn-primary">View</a>
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-info">
|
|
<i class="fa fa-info-circle me-2"></i> No related notes found.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Version History Tab -->
|
|
<div class="tab-pane fade" id="history" role="tabpanel" aria-labelledby="history-tab">
|
|
<div class="p-3">
|
|
<h5 class="mb-3">Version History</h5>
|
|
{% if clinical_note.version_history %}
|
|
<div class="table-responsive">
|
|
<table class="table table-striped table-bordered">
|
|
<thead>
|
|
<tr>
|
|
<th>Version</th>
|
|
<th>Date</th>
|
|
<th>User</th>
|
|
<th>Action</th>
|
|
<th>Details</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for version in clinical_note.version_history %}
|
|
<tr>
|
|
<td>{{ version.version }}</td>
|
|
<td>{{ version.timestamp }}</td>
|
|
<td>{{ version.user }}</td>
|
|
<td>{{ version.action }}</td>
|
|
<td>{{ version.details }}</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% else %}
|
|
<div class="alert alert-info">
|
|
<i class="fa fa-info-circle me-2"></i> No version history available for this note.
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end tab content -->
|
|
</div>
|
|
</div>
|
|
<!-- end note details panel -->
|
|
|
|
<!-- begin action buttons -->
|
|
<div class="d-flex justify-content-between mt-3">
|
|
<div>
|
|
<a href="{% url 'emr:clinical_note_list' %}" class="btn btn-secondary me-2">
|
|
<i class="fa fa-arrow-left me-1"></i> Back to Notes
|
|
</a>
|
|
<a href="{% url 'emr:patient_detail' clinical_note.patient.id %}" class="btn btn-info">
|
|
<i class="fa fa-user me-1"></i> Patient Profile
|
|
</a>
|
|
</div>
|
|
<div>
|
|
{% if clinical_note.status == 'DRAFT' %}
|
|
<a href="#" class="btn btn-success me-2" data-bs-toggle="modal" data-bs-target="#signModal">
|
|
<i class="fa fa-signature me-1"></i> Sign Note
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if clinical_note.status == 'SIGNED' %}
|
|
<a href="#" class="btn btn-info me-2" data-bs-toggle="modal" data-bs-target="#amendModal">
|
|
<i class="fa fa-pencil-alt me-1"></i> Amend Note
|
|
</a>
|
|
<a href="#" class="btn btn-purple me-2" data-bs-toggle="modal" data-bs-target="#addendumModal">
|
|
<i class="fa fa-plus me-1"></i> Add Addendum
|
|
</a>
|
|
{% endif %}
|
|
|
|
{% if clinical_note.status == 'DRAFT' %}
|
|
<a href="{% url 'emr:clinical_note_update' clinical_note.id %}" class="btn btn-primary me-2">
|
|
<i class="fa fa-edit me-1"></i> Edit Note
|
|
</a>
|
|
<a href="{% url 'emr:clinical_note_delete' clinical_note.id %}" class="btn btn-danger">
|
|
<i class="fa fa-trash me-1"></i> Delete
|
|
</a>
|
|
{% endif %}
|
|
|
|
<a href="#" class="btn btn-default me-2" onclick="window.print();">
|
|
<i class="fa fa-print me-1"></i> Print
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<!-- end action buttons -->
|
|
</div>
|
|
<!-- end col-12 -->
|
|
</div>
|
|
<!-- end row -->
|
|
|
|
<!-- begin sign modal -->
|
|
<div class="modal fade" id="signModal" tabindex="-1" aria-labelledby="signModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="signModalLabel">Sign Clinical Note</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form action="{% url 'emr:clinical_note_sign' clinical_note.id %}" method="post">
|
|
{% csrf_token %}
|
|
<div class="modal-body">
|
|
<p>You are about to electronically sign this clinical note. This action cannot be undone.</p>
|
|
<p>By signing this note, you confirm that:</p>
|
|
<ul>
|
|
<li>You have reviewed the content and it is accurate to the best of your knowledge</li>
|
|
<li>You are the author of this note or authorized to sign on behalf of the author</li>
|
|
<li>This note will become part of the patient's permanent medical record</li>
|
|
</ul>
|
|
<div class="form-check mb-3">
|
|
<input class="form-check-input" type="checkbox" id="confirmSign" required>
|
|
<label class="form-check-label" for="confirmSign">
|
|
I confirm that I have reviewed this note and approve its content.
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn btn-success" id="signButton">Sign Note</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end sign modal -->
|
|
|
|
<!-- begin amend modal -->
|
|
<div class="modal fade" id="amendModal" tabindex="-1" aria-labelledby="amendModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="amendModalLabel">Amend Clinical Note</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form action="{% url 'emr:clinical_note_amend' clinical_note.id %}" method="post">
|
|
{% csrf_token %}
|
|
<div class="modal-body">
|
|
<p>You are about to amend this signed clinical note. This will create a new version of the note.</p>
|
|
<div class="mb-3">
|
|
<label for="amendment_reason" class="form-label">Amendment Reason</label>
|
|
<textarea class="form-control" id="amendment_reason" name="amendment_reason" rows="3" required></textarea>
|
|
<div class="form-text">Please provide a detailed reason for this amendment.</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn btn-info">Create Amendment</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end amend modal -->
|
|
|
|
<!-- begin addendum modal -->
|
|
<div class="modal fade" id="addendumModal" tabindex="-1" aria-labelledby="addendumModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="addendumModalLabel">Add Addendum</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<form action="{% url 'emr:clinical_note_addendum' clinical_note.id %}" method="post">
|
|
{% csrf_token %}
|
|
<div class="modal-body">
|
|
<p>You are about to add an addendum to this clinical note. The original note will remain unchanged.</p>
|
|
<div class="mb-3">
|
|
<label for="addendum_content" class="form-label">Addendum Content</label>
|
|
<textarea class="form-control" id="addendum_content" name="addendum_content" rows="5" required></textarea>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
|
<button type="submit" class="btn btn-purple">Add Addendum</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<!-- end addendum modal -->
|
|
{% endblock %}
|
|
|
|
{% block js %}
|
|
<script>
|
|
$(document).ready(function() {
|
|
// Initialize tooltips
|
|
$('[data-bs-toggle="tooltip"]').tooltip();
|
|
|
|
// Enable sign button only when confirmation checkbox is checked
|
|
$('#confirmSign').change(function() {
|
|
if ($(this).is(':checked')) {
|
|
$('#signButton').prop('disabled', false);
|
|
} else {
|
|
$('#signButton').prop('disabled', true);
|
|
}
|
|
});
|
|
|
|
// Handle HTMX events
|
|
document.body.addEventListener('htmx:afterSwap', function(evt) {
|
|
if (evt.detail.target.id === 'related-content') {
|
|
// Reinitialize any components in the related content container
|
|
}
|
|
});
|
|
});
|
|
</script>
|
|
{% endblock %}
|
|
|