{% extends "base.html" %} {% load static %} {% block title %}Specimen Details - {{ object.specimen_id }}{% endblock %} {% block content %}

Specimen Details - {{ object.specimen_id }}

Specimen Information

{{ object.get_status_display }}
Specimen ID: {{ object.specimen_id }}
Patient: {{ object.patient.get_full_name }}
MRN: {{ object.patient.medical_record_number }}
Type: {{ object.get_specimen_type_display }}
Collection Date: {{ object.collection_date|date:"M d, Y g:i A" }}
Collected By: {{ object.collected_by.get_full_name }}
Collection Site: {{ object.collection_site|default:"Not specified" }}
Volume: {{ object.volume|default:"Not specified" }}
Container: {{ object.container_type|default:"Standard" }}
Priority: {{ object.get_priority_display }}
{% if object.collection_notes %}
Collection Notes:
{{ object.collection_notes }}
{% endif %}

Associated Tests

{% if associated_tests %}
{% for test in associated_tests %} {% endfor %}
Test Name Code Status Ordered Date Result Actions
{{ test.test.name }}
{{ test.test.category }}
{{ test.test.code }} {{ test.get_status_display }} {{ test.ordered_date|date:"M d, Y" }} {% if test.result %} {{ test.result.result_value }} {{ test.result.unit|default:"" }} {% if test.result.abnormal_flag %} {{ test.result.get_abnormal_flag_display }} {% endif %} {% else %} Pending {% endif %}
{% if test.result %} {% endif %}
{% else %}
No Tests Associated

No tests have been ordered for this specimen yet.

{% endif %}

Tracking History

{% if tracking_history %}
{% for event in tracking_history %}
{{ event.get_status_display }}
{{ event.timestamp|date:"M d, Y g:i A" }}

{{ event.description|default:"Status updated" }}

By: {{ event.user.get_full_name|default:"System" }} {% if event.location %}
Location: {{ event.location }}
{% endif %}
{% endfor %}
{% else %}
No Tracking History

No tracking events recorded for this specimen.

{% endif %}
Quick Actions
Patient Information
Name: {{ object.patient.get_full_name }}
DOB: {{ object.patient.date_of_birth|date:"M d, Y" }}
Age: {{ object.patient.age }} years
Gender: {{ object.patient.get_gender_display }}
MRN: {{ object.patient.medical_record_number }}
View Patient
Collection Details
Collection Method: {{ object.collection_method|default:"Standard" }}
Fasting Status: {% if object.fasting_status %} Fasting {% else %} Non-fasting {% endif %}
Temperature: {{ object.storage_temperature|default:"Room temp" }}
Condition: {{ object.condition|default:"Good" }}
{% if object.expiry_date %}
Expires: {{ object.expiry_date|date:"M d, Y" }} {% if object.days_until_expiry <= 1 %} Expires Soon {% elif object.days_until_expiry <= 3 %} Expiring {% endif %}
{% endif %}
{% if object.quality_issues %}
Quality Issues
{% for issue in object.quality_issues %}
{{ issue.issue_type }}: {{ issue.description }}
Reported: {{ issue.reported_date|date:"M d, Y g:i A" }}
{% endfor %}
{% endif %}
System Information
Specimen ID: {{ object.pk }}
Created: {{ object.created_at|date:"M d, Y g:i A" }}
Last Updated: {{ object.updated_at|date:"M d, Y g:i A" }}
Barcode: {{ object.barcode|default:"Not assigned" }}
Location: {{ object.current_location|default:"Lab" }}
{% endblock %}