{% extends "layouts/base.html" %} {% load i18n static %} {% block title %}{% trans "HIS Logs" %} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

{% trans "HIS Logs" %}

{% trans "View all HIS requests and responses" %}

{% if user.is_superuser or user.is_px_admin %}
{% csrf_token %}
{% endif %}
{{ stats.total }}
{% trans "Total Requests" %}
{{ stats.success }}
{% trans "Success" %}
{{ stats.failed }}
{% trans "Failed" %}
{{ stats.partial }}
{% trans "Partial" %}
{{ stats.success_rate }}%
{% trans "Success Rate" %}
{{ stats.avg_processing_time }}ms
{% trans "Avg. Process Time" %}
{% trans "By Channel" %}
📱 {% trans "SMS" %}: {{ stats.channels.sms }} 🏥 {% trans "HIS Events" %}: {{ stats.channels.his_event }}
{% trans "By Status" %}
{% for stat in status_stats %} {{ stat.status|title }}: {{ stat.count }} {% endfor %}
{% trans "By Hospital" %}
{% for stat in hospital_stats|slice:":3" %} {{ stat.hospital_code }}: {{ stat.count }} {% endfor %}
{% for log in logs %} {% empty %} {% endfor %}
{% trans "ID" %} {% trans "Timestamp" %} {% trans "Channel" %} {% trans "Status" %} {% trans "Summary" %} {% trans "Details" %} {% trans "Process Time" %}
{{ log.request_id }} {{ log.timestamp|date:"Y-m-d H:i:s" }} {% if log.channel == 'email' %}📧 {% trans "Email" %} {% elif log.channel == 'sms' %}📱 {% trans "SMS" %} {% else %}🏥 {% trans "HIS Event" %}{% endif %} {{ log.get_status_display_with_icon }} {{ log.get_summary }} {% if log.patient_id %}
MRN: {{ log.patient_id }} {% endif %} {% if log.journey_id %}
Journey: {{ log.journey_id }} {% endif %} {% if log.survey_id %}
Survey: {{ log.survey_id }} {% endif %}
{% if log.message_preview %}
{{ log.message_preview|truncatechars:100 }}
{% elif log.subject %}
{{ log.subject|truncatechars:50 }}
{% elif log.event_type %}
{{ log.event_type }}
{% endif %}
{% if log.processing_time_ms %} {{ log.processing_time_ms }}ms {% else %} - {% endif %}

{% trans "No HIS logs found." %}

{% if page_obj.has_other_pages %} {% endif %}
{% endblock %}