{% extends "base.html" %} {% load i18n static patient_tags %} {% block title %}{% trans "Clinical Note" %} - {{ block.super }}{% endblock %} {% block content %}

{% trans "Clinical Note" %}

{{ note.title }}
{% if note.is_locked %} {% trans "Locked" %} {% else %} {% trans "Unlocked" %} {% endif %}
{{ note.content|safe }}
{% if note.addenda.exists %}
{% trans "Addenda" %}
{% for addendum in note.addenda.all %}
{% trans "Addendum" %} #{{ forloop.counter }} {{ addendum.created_at|date:"Y-m-d H:i" }}
{{ addendum.content|safe }}
{{ addendum.created_by.get_full_name }}
{% endfor %}
{% endif %} {% if note.is_locked and perms.documents.can_add_addendum %}
{% trans "Add Addendum" %}
{% csrf_token %}
{% trans "Addenda are used to add information to locked notes without modifying the original content." %}
{% endif %}
{% trans "Note Information" %}
{% trans "Patient" %}:
{% patient_name note.patient %}
{% trans "Category" %}:
{{ note.get_category_display }}
{% if note.encounter %}
{% trans "Encounter" %}:
{{ note.encounter.encounter_date|date:"Y-m-d" }}
{% endif %}
{% trans "Template" %}:
{{ note.template.name|default:"-" }}
{% trans "Status" %}:
{% if note.is_locked %} {% trans "Locked" %} {% else %} {% trans "Unlocked" %} {% endif %}
{% if note.locked_at %}
{% trans "Locked At" %}:
{{ note.locked_at|date:"Y-m-d H:i" }}
{% trans "Locked By" %}:
{{ note.locked_by.get_full_name }}
{% endif %}
{% if perms.documents.can_lock_note %}
{% trans "Note Actions" %}
{% if note.is_locked %}
{% csrf_token %} {% trans "Unlocking will allow editing of the note content." %}
{% else %}
{% csrf_token %} {% trans "Locking will prevent further editing. Only addenda can be added." %}
{% endif %}
{% endif %}
{% trans "Audit Trail" %}
{% if note.audit_logs.exists %}
{% for log in note.audit_logs.all|slice:":10" %}
{{ log.get_action_display }} {{ log.timestamp|date:"Y-m-d H:i" }}
{{ log.user.get_full_name }} {% if log.changes %}
{{ log.changes }}
{% endif %}
{% endfor %}
{% else %}

{% trans "No audit logs available." %}

{% endif %}
{% endblock %} {% block css %} {% endblock %}