{% extends "base.html" %} {% set active_nav = "trfs" %} {% block title %}TRF {{ order.order_number }} - LSMC Atlas{% endblock %} {% block content %} {% if user is defined and user.can_write %}

Change TRF Status

{% endif %}

Patients

{% if patients %}
{% for p in patients %} {% endfor %}
Name Roles DOB MRN Sex
{{ p.name }} {{ p.roles|join(', ') }} {{ p.date_of_birth or "—" }} {{ p.mrn or "—" }} {% if p.sex == 'F' %}Female{% elif p.sex == 'M' %}Male{% elif p.sex == 'O' or p.sex == 'Other' %}Other{% elif p.sex == 'U' or p.sex == 'Unknown' %}Unknown{% else %}{{ p.sex or "—" }}{% endif %} View
{% elif patient %}
Name
{{ patient.first_name }} {{ patient.last_name }}
Date of Birth
{{ patient.date_of_birth }}
MRN
{{ patient.mrn or "—" }}
Biologic Sex
{% if patient.sex == 'F' %}Female{% elif patient.sex == 'M' %}Male{% elif patient.sex == 'O' or patient.sex == 'Other' %}Other{% elif patient.sex == 'U' or patient.sex == 'Unknown' %}Unknown{% else %}{{ patient.sex or "—" }}{% endif %}
{% else %}

No patients linked yet

{% endif %}

Tests Ordered

{% for test_order in test_orders %}
Test EUID
{{ test_order.fulfillment_routes[0].fulfillment_route_name if test_order.fulfillment_routes else "Pending" }} {% if test_order.priority == 'STAT' %} STAT {% endif %}
{% if user is defined and user.can_write %}
{% else %} {{ test_order.status_display }} {% endif %}
Tests: {% for assay in test_order.fulfillment_routes %} {{ assay.fulfillment_route_code }}{% if not loop.last %}, {% endif %} {% endfor %}
Specimen: {{ test_order.specimen_type or "—" }}
{% if test_order.clinical_notes %}
Notes: {{ test_order.clinical_notes }}
{% endif %}
{% endfor %}
{% if user is defined and user.is_internal %} {% endif %} {% if assay_runs %}

Test Status

{% if user is defined and user.is_internal %} {% endif %} {% for ar in assay_runs %} {% if user is defined and user.is_internal %} {% endif %} {% endfor %}
Test Status Accession ID Notes Last UpdatedActions
{{ ar.fulfillment_route_code }} {{ ar.status }} {% if ar.qc_hold_reason %}
QC: {{ ar.qc_hold_reason }} {% endif %}
{{ ar.accession_id or "—" }} {{ ar.note or "—" }} {{ ar.updated_at or "—" }} {% if not ar.is_terminal and ar.next_transitions %}
{% for next_state in ar.next_transitions %} {% if next_state == 'QC_HOLD' %} {% elif next_state == 'RESULTED' and ar.status == 'QC_HOLD' %} {% elif next_state == 'CANCELLED' %}
{% elif next_state == 'FAILED' %}
{% else %}
{% endif %} {% endfor %}
{% elif ar.is_terminal %} ⬛ Terminal {% endif %}
{% endif %}

TRF Details

Ordering Clinician
{{ clinician.first_name }} {{ clinician.last_name }}{% if clinician.credentials %}, {{ clinician.credentials }}{% endif %}
TRF Type
{{ order.order_type if order.order_type else "—" }}
Organization
{{ organization.name }}
{% if order.clinical_notes %}
Notes
{{ order.clinical_notes }}
{% endif %}
{% endblock %}