{% extends "ui/base.html" %} {% block title %}Record {{ audit.record.record_id }} · Health-DeID{% endblock %} {% block content %} {% set final = audit.renderings|selectattr('kind', 'equalto', 'final')|selectattr('is_stale', 'equalto', 0)|list|last %} {% set draft = audit.renderings|selectattr('kind', 'equalto', 'draft')|selectattr('is_stale', 'equalto', 0)|list|last %} {% set output = final or draft %}
{% set color = {'ready': 'success', 'awaiting_review': 'warning', 'failed': 'danger', 'excluded': 'secondary', 'reviewed': 'info'}.get(audit.record.status, 'primary') %}

Record {{ position }} of {{ total }} {{ audit.record.status|replace('_', ' ') }}

{{ audit.record.record_id }} · Entity ID: {{ audit.record.entity_id }} · Source row {{ audit.record.source_index + 1 }}

{% if audit.record.status == 'awaiting_review' %} Review record {% endif %}
{% if audit.metadata %}

{% for name, value in audit.metadata.items() %}
{{ name }}
{{ value }}
{% endfor %}
{% endif %}

Source text

{{ audit.record.normalized_text or '—' }}

{{ 'Final de-identified text' if final else 'Draft de-identified text' }}

{{ output.rendered_text if output else 'Not generated yet.' }}
{% if audit.source_structured_fields %}

Source structured fields

{{ audit.source_structured_fields|tojson(indent=2) }}

Final de-identified structured fields

{% if audit.final_structured_fields is not none %}{{ audit.final_structured_fields|tojson(indent=2) }}{% else %}Not generated yet.{% endif %}
{% endif %}

PHI findings

{% for finding in audit.findings %} {% else %} {% endfor %}
Source Category Text Offsets Status
{{ finding.source_kind }} {{ finding.canonical_category|replace('_', ' ') }} {{ finding.exact_text }} {{ finding.start_char }}–{{ finding.end_char }} {{ 'Active' if finding.is_eligible else 'Inactive' }}
No PHI findings.

Validation findings

{% for finding in audit.validation_findings %}
{{ finding.canonical_category|replace('_', ' ') }} {% if finding.ignored_by_policy %} Configured to retain {% endif %}
{{ finding.rationale }}
{% else %}
No validation findings.
{% endfor %}
{% if audit.review_decisions %}

Review history

{% for decision in audit.review_decisions %} {% endfor %}
Decision Reviewer Time Recorded Note
{{ decision.disposition|replace('_', ' ') }} {{ decision.reviewer_id }} {{ decision.review_seconds|duration }} {{ decision.record_comment or '—' }}
{% endif %}

Text transformations

{% for rendering in audit.renderings %}
{{ 'Draft de-identification' if rendering.kind == 'draft' else 'Final de-identification' }} · plan {{ rendering.plan_revision }} {% if rendering.is_stale %}· superseded{% endif %}
{{ rendering.rendered_text }}
{% else %}

No generated text yet.

{% endfor %}

Structured-field transformations

{% if audit.structured_transform_events or audit.review_structured_events %}
{% for event in audit.structured_transform_events %} {% endfor %} {% for event in audit.review_structured_events %} {% endfor %}
Source Field Category Original Replacement
{{ 'Draft' if event.purpose == 'draft' else 'Final' }} plan {{ event.plan_revision }} {{ event.column_name }} {{ event.canonical_category|replace('_', ' ') }} {{ event.original_value }} {{ event.replacement_value }}
Human review {{ event.column_name }} {{ event.category|replace('_', ' ') }} {{ event.original_value }} {{ event.replacement_value }}
{% else %}

No structured-field transformations.

{% endif %}
{% if audit.record.status == 'failed' %}

Retry failed work

Reset this record’s earliest retryable stage and downstream work.

{% endif %} {% endblock %}