{% extends 'base.html' %} {% load static %} {% block title %}Operative Note - {{ note.patient.get_full_name }}{% endblock %} {% block css %} {% endblock %} {% block content %}

Operative Note

PDF {# {% if note.status == 'draft' or note.status == 'pending' %}#} {# #} {# Edit#} {# #} {# {% endif %}#}

{{ note.patient.get_full_name }}

Patient ID: {{ note.patient.patient_id }}
Date of Birth: {{ note.patient.date_of_birth|date:"M d, Y" }}
Gender: {{ note.patient.get_gender_display }}
Surgery Date: {{ note.surgery_date|date:"M d, Y H:i" }}
Operating Room: {{ note.operating_room.name }}
Case Number: {{ note.case_number }}
{% if note.status == 'draft' %} Draft {% elif note.status == 'pending' %} Pending Signature {% elif note.status == 'signed' %} Signed {% elif note.status == 'amended' %} Amended {% endif %}
{% if note.urgency == 'emergency' %}
Emergency
{% elif note.urgency == 'urgent' %}
Urgent
{% endif %}
Procedure Information
Primary Procedure
{{ note.procedure_name }}
Procedure Code
{{ note.procedure_code }}
Laterality
{{ note.get_laterality_display|default:"Not specified" }}
Approach
{{ note.get_approach_display|default:"Not specified" }}
{% if note.secondary_procedures %}
Secondary Procedures:

{{ note.secondary_procedures }}

{% endif %}
Surgical Team
Primary Surgeon
{{ note.primary_surgeon.get_full_name }}
{% if note.assistant_surgeon %}
Assistant Surgeon
{{ note.assistant_surgeon.get_full_name }}
{% endif %} {% if note.anesthesiologist %}
Anesthesiologist
{{ note.anesthesiologist.get_full_name }}
{% endif %} {% if note.scrub_nurse %}
Scrub Nurse
{{ note.scrub_nurse.get_full_name }}
{% endif %}
{% if note.other_team_members %}
Other Team Members:

{{ note.other_team_members }}

{% endif %}
Timing Information
Surgery Start Time
{{ note.surgery_start_time|date:"H:i" }}
{% if note.surgery_end_time %}
Surgery End Time
{{ note.surgery_end_time|date:"H:i" }}
Total Duration
{{ note.surgery_duration }} minutes
{% endif %} {% if note.anesthesia_start_time %}
Anesthesia Start
{{ note.anesthesia_start_time|date:"H:i" }}
{% endif %}
Clinical Information
{% if note.preoperative_diagnosis %}
Preoperative Diagnosis:

{{ note.preoperative_diagnosis }}

{% endif %} {% if note.postoperative_diagnosis %}
Postoperative Diagnosis:

{{ note.postoperative_diagnosis }}

{% endif %} {% if note.indications %}
Indications for Surgery:

{{ note.indications }}

{% endif %}
{% if note.anesthesia_type %}
Anesthesia Information
Anesthesia Type
{{ note.get_anesthesia_type_display }}
{% if note.asa_classification %}
ASA Classification
{{ note.asa_classification }}
{% endif %}
{% if note.anesthesia_notes %}
Anesthesia Notes:

{{ note.anesthesia_notes }}

{% endif %}
{% endif %}
Operative Technique
{% if note.operative_technique %}
Technique Description:
{{ note.operative_technique }}
{% endif %} {% if note.findings %}
Operative Findings:
{{ note.findings }}
{% endif %} {% if note.specimens %}
Specimens Sent:

{{ note.specimens }}

{% endif %}
{% if note.complications %}
Complications
Complications Noted:

{{ note.complications }}

{% endif %}
Postoperative Care
{% if note.postoperative_instructions %}
Postoperative Instructions:
{{ note.postoperative_instructions }}
{% endif %} {% if note.estimated_blood_loss %}
Estimated Blood Loss
{{ note.estimated_blood_loss }} mL
{% if note.fluid_replacement %}
Fluid Replacement
{{ note.fluid_replacement }}
{% endif %}
{% endif %} {% if note.disposition %}
Patient Disposition:

{{ note.disposition }}

{% endif %}
Electronic Signature
{% if note.status == 'signed' %}
Signed by: {{ note.primary_surgeon.get_full_name }}
Date & Time: {{ note.signed_at|date:"M d, Y H:i" }}
Digital Signature: {{ note.signature_hash }}
{% elif note.status == 'pending' %}

This operative note is pending electronic signature by the primary surgeon.

{% if note.primary_surgeon == request.user %} {% endif %} {% else %}

This operative note is in draft status and has not been submitted for signature.

{% endif %}
{% if note.status == 'signed' %}
Electronically Signed
{% elif note.status == 'pending' %}
Pending Signature
{% else %}
Draft
{% endif %}
{% if note.amendments.exists %}
Amendment History
{% for amendment in note.amendments.all %}
Amendment {{ forloop.counter }}
{{ amendment.created_at|date:"M d, Y H:i" }} by {{ amendment.created_by.get_full_name }}
Reason: {{ amendment.reason }}
{% if amendment.changes %}
Changes: {{ amendment.changes }}
{% endif %}
{% endfor %}
{% endif %}
{% endblock %} {% block js %} {% endblock %}