{# The patient-facing immunization card (the "Print / View Card" button). Restyled to match cases/reports/immunization_print.html.twig, which in turn follows the prescription / OP-consultation letterhead — the card a parent carries home and the document that reaches their PHR should look like the same hospital produced them. Unlike the ABDM report this page is printed by the BROWSER, not Dompdf, so it loads the hospital logo over a normal asset() URL (the pattern used by case_radiology/print.html.twig) instead of an inline data: URI, and there is no QR block — this sheet is not an ABDM care-context document. It is standalone rather than extending base_print.html.twig because that base pulls in the admin theme's stylesheets, which fight the letterhead layout. #} {% set theme = { primary: '#5867dd', onPrimary: '#ffffff', text: '#2f3033', label: '#6c7293', gray100: '#f5f8fa', tint: '#eef0fc', border: '#dcdff0', muted: '#9aa0b9', given: '#0abb87', due: '#ffb822', overdue: '#fd397a', } %} {# The hospital that holds the record, not the one the viewer happens to belong to — PatientVoter already scopes these to the same place, but patient.hospital is the truthful source and is never null (app.user.hospital is, for an admin). #} {% set hospital = patient.hospital ?: app.user.hospital %} {% set hospitalAddress = [hospital.address, hospital.village, hospital.taluka, hospital.district]|filter(part => part)|join(', ') %} Immunization Card - {{ patient.name }} {# ---------- letterhead ---------- #} {% if hospital.immunizationHeaderPath %} {# Full hospital-supplied banner (same asset as the immunization record's ABDM print) - replaces the generated name/contact block entirely. #}
{{ hospital }}
IMMUNIZATION CARD
{% else %} {% if hospital.logoPath %} {% endif %}
{{ hospital }}
{{ hospital }}
IMMUNIZATION CARD
{{ hospitalAddress }}{% if hospital.pincode %} - {{ hospital.pincode }}{% endif %}
{% if hospital.phone %}
Ph: {{ hospital.phone }}
{% endif %} {% if hospital.email %}
{{ hospital.email }}
{% endif %} {% if hospital.hipId %}
HFR ID: {{ hospital.hipId|trim }}
{% endif %}
{% endif %}
{# ---------- patient details ---------- #}
Patient Information
{% if patient.address %} {% endif %}
Patient Name {{ patient.name|title }} Date of Birth {{ patient.dob ? patient.dob|date('d-M-Y') : '—' }}
Age / Gender {{ patient.age ?: '—' }} / {{ patient.gender ?: '—' }} UHID {{ patient.uhId ?: '—' }}
Contact {{ patient.mobile ?: '—' }} ABHA Address {{ patient.healthAddress ?: '—' }}
Address {{ patient.address|title }}{% if patient.pincode %} - {{ patient.pincode }}{% endif %}
{% if summary.completedCount > 0 %} {# ---------- at-a-glance count ---------- #}
{{ summary.completedCount }}
Given
{% endif %} {# ---------- vaccines administered ---------- #} {# Only completed doses are listed here — this card shows what was actually given, not the full due/overdue/upcoming schedule. #}
Vaccines Administered
{% if summary.completedCount == 0 %}
No vaccines have been administered yet.
{% else %} {% for visit in summary.visits %} {% set completedRows = visit.rows|filter(row => row.status == 'completed') %} {% if completedRows is not empty %} {% for row in completedRows %} {% if loop.first %} {% endif %} {% endfor %} {% endif %} {% endfor %}
Age / Visit Vaccine Given Date Source
{{ visit.visitName }}
{{ row.displayLabel ?: row.vaccineName }}
{% if row.note %}
{{ row.note }}
{% endif %}
{{ row.administeredAt ? row.administeredAt|date('d-M-Y') : '—' }} {{ row.administrationSource ?: '—' }}
{% endif %}
{# ---------- signature ---------- #}
Parent / Guardian acknowledgement
Issued by {{ hospital }}
{{ "now"|date('d-M-Y g:i A') }}
Immunization card for {{ patient.name|title }} (UHID {{ patient.uhId }}) | Generated: {{ "now"|date('Y-m-d\\TH:i:sP') }}
Bring this card to every visit. Dates shown are based on the date of birth recorded at this hospital.