{% extends "base.html" %} {% block content %}

{{ title }}

Add Patient {# Check if the 'patients_with_status' list has items #} {% if patients_with_status|length > 0 %}
{# 1. Loop over the correct variable: 'patients_with_status' #} {% for item in patients_with_status %}
{# 2. Use a different link depending on completion status #} {% if item.is_complete %}
Patient {{ item.record.meta.uuid[:8] }}
{% else %} {# This link lets the user resume an incomplete consultation #}
Patient {{ item.record.meta.uuid[:8] }}
{% endif %}

{# 3. Access patient data via 'item.record' #} {% if item.record.patient.gender %} {{ item.record.patient.gender }} {% endif %} {% if item.record.patient.age %} {{ item.record.patient.age }} years {% endif %}

{% endfor %}
{% else %} {# 4. Add a helpful message when there are no patients #} {% endif %} {% endblock %}