{% extends 'base.html' %} {% load static %} {% block title %}Blood Unit Details - {{ blood_unit.unit_number }}{% endblock %} {% block extra_css %} {% endblock %} {% block content %}

Blood Unit Details {{ blood_unit.unit_number }}

Unit Information

{{ blood_unit.get_status_display }}

{{ blood_unit.unit_number }}

{{ blood_unit.component.get_name_display }}

Blood Group: {{ blood_unit.blood_group.display_name }}
Component: {{ blood_unit.component.get_name_display }}
Volume: {{ blood_unit.volume_ml }} ml
Collection Date: {{ blood_unit.collection_date|date:"M d, Y H:i" }}
Expiry Date: {{ blood_unit.expiry_date|date:"M d, Y" }} {% if blood_unit.days_to_expiry <= 3 and blood_unit.status == 'available' %}
{{ blood_unit.days_to_expiry }} days left {% elif blood_unit.is_expired %}
Expired {% endif %}
Location: {{ blood_unit.location }}
Bag Type: {{ blood_unit.bag_type }}
Anticoagulant: {{ blood_unit.anticoagulant }}
Collection Site: {{ blood_unit.collection_site }}
Collected By: {{ blood_unit.collected_by.get_full_name }}
{% if blood_unit.notes %}
Notes

{{ blood_unit.notes }}

{% endif %}

Donor Information

Donor ID: {{ blood_unit.donor.donor_id }}
Name: {{ blood_unit.donor.full_name }}
Age: {{ blood_unit.donor.age }} years
Gender: {{ blood_unit.donor.get_gender_display }}
Phone: {{ blood_unit.donor.phone }}
Total Donations: {{ blood_unit.donor.total_donations }}

Unit Status Timeline

Blood Collected

{{ blood_unit.collection_date|date:"M d, Y H:i" }}
Blood unit collected from donor {{ blood_unit.donor.full_name }}

{% if tests %}
Testing Phase

{{ tests.first.test_date|date:"M d, Y H:i" }}
Laboratory testing initiated

{% endif %} {% if blood_unit.status == 'quarantine' %}
Quarantine

Unit placed in quarantine pending test results

{% endif %} {% if blood_unit.status == 'available' %}
Available for Use

Unit cleared for transfusion and available in inventory

{% endif %} {% if blood_unit.status == 'issued' %}
Issued

Unit issued for patient transfusion

{% endif %} {% if blood_unit.status == 'transfused' %}
Transfused

Unit successfully transfused to patient

{% endif %} {% if blood_unit.status == 'expired' or blood_unit.status == 'discarded' %}
{{ blood_unit.get_status_display }}

Unit removed from inventory

{% endif %}

Test Results

{% if blood_unit.status in 'collected,testing,quarantine' %} Add Test Result {% endif %}
{% if tests %}
{% for test in tests %} {% endfor %}
Test Type Result Test Date Tested By Equipment Verified
{{ test.get_test_type_display }} {% if test.result == 'positive' %} {{ test.get_result_display }} {% elif test.result == 'negative' %} {{ test.get_result_display }} {% elif test.result == 'indeterminate' %} {{ test.get_result_display }} {% else %} {{ test.get_result_display }} {% endif %} {{ test.test_date|date:"M d, Y H:i" }} {{ test.tested_by.get_full_name }} {{ test.equipment_used|default:"-" }} {% if test.verified_by %} {{ test.verified_by.get_full_name }}
{{ test.verified_at|date:"M d, Y H:i" }} {% else %} Pending {% endif %}
{% else %}
No Test Results

No laboratory tests have been performed on this unit yet.

{% if blood_unit.status in 'collected,testing,quarantine' %} Add First Test {% endif %}
{% endif %}

Crossmatch Results

{% if blood_unit.status == 'available' %} {% endif %}
{% if crossmatches %}
{% for crossmatch in crossmatches %} {% endfor %}
Patient Test Type Compatibility Test Date Tested By Verified
{{ crossmatch.recipient.full_name }}
{{ crossmatch.recipient.patient_id }}
{{ crossmatch.get_test_type_display }} {% if crossmatch.compatibility == 'compatible' %} {{ crossmatch.get_compatibility_display }} {% elif crossmatch.compatibility == 'incompatible' %} {{ crossmatch.get_compatibility_display }} {% else %} {{ crossmatch.get_compatibility_display }} {% endif %} {{ crossmatch.test_date|date:"M d, Y H:i" }} {{ crossmatch.tested_by.get_full_name }} {% if crossmatch.verified_by %} Verified {% else %} Pending {% endif %}
{% else %}
No Crossmatch Results

No crossmatch tests have been performed for this unit.

{% endif %}
Back to Units
{% if blood_unit.status in 'collected,testing,quarantine' %} Add Test {% endif %} {% if blood_unit.status == 'available' %} {% endif %}
{% endblock %} {% block extra_js %} {% endblock %}