{%- set spec_text = (r.specificity or '') | replace('>', '>') -%}
{%- if 'Weak (MFI' in spec_text -%}
{%- set parts = spec_text.split('Weak (MFI', 1) -%}
{{ parts[0]|trim }}
Weak (MFI{{ parts[1] }}
{%- else -%}
{{ spec_text or '(-)' }}
{%- endif -%}
{% endfor %}
{% for comp_label, comp_id, comp_dates, comp_antigens in [
('DSA Class I', 'chart1', comparison_class1.dates if comparison_class1 else [], comparison_class1.antigens if comparison_class1 else []),
('DSA Class II', 'chart2', comparison_class2.dates if comparison_class2 else [], comparison_class2.antigens if comparison_class2 else [])
] %}
{% if comp_dates and comp_dates | length >= 2 %}