{# pid_lookup_result.html #}

{% extends "base.html" %}

{% block content %}

    <h1>Lookup of patient identifiers (CONFIDENTIAL)</h1>

    {% if lookups %}

        <table>
            <tr>
                <th>{{ SECRET_MAP.TRID_FIELD }} (TRID)</th>
                <th>{{ SECRET_MAP.RID_FIELD }} (RID)</th>
                <th>{{ SECRET_MAP.MASTER_RID_FIELD }} (MRID)</th>
                <th>{{ SECRET_MAP.PID_FIELD }} (PID)</th>
                <th>{{ SECRET_MAP.MASTER_PID_FIELD }} (MPID)</th>
            </tr>
            {% for lookup in lookups %}
                <tr>
                    <td>{{ lookup.trid }}</td>
                    <td>{{ lookup.rid }}</td>
                    <td>{{ lookup.mrid }}</td>
                    <td><b>{{ lookup.pid }}</b></td>
                    <td><b>{{ lookup.mpid }}</b></td>
                </tr>
            {% endfor %}
        </table>

        <h2>Plain PID list</h2>
        <pre>{% for lookup in lookups %}{{ lookup.pid }}<br>{% endfor %}</pre>

        <h2>Plain MPID list</h2>
        <pre>{% for lookup in lookups %}{{ lookup.mpid }}<br>{% endfor %}</pre>

    {% else %}

        <div>None found.</div>

    {% endif %}

    <h2>Key</h2>
    {% include "pid_abbrev_explanation.html" %}

    <h2>Again?</h2>
    <div><a href="{% url 'pidlookup' %}">Look up more</a></div>

{% endblock %}
