{% extends 'base.html' %} {% load static %} {% block title %}Medication Reconciliation{% endblock %} {% block content %}

Medication Reconciliation

Compare and reconcile patient medications across care transitions

Patient Information

{% if patient %}

Name: {{ patient.first_name }} {{ patient.last_name }}

DOB: {{ patient.date_of_birth|date:"M d, Y" }}

MRN: {{ patient.patient_id }}

Age: {{ patient.age }}

Allergies: {{ patient.allergies|default:"None documented" }}

Weight: {{ patient.weight|default:"Not recorded" }} kg

Primary Care Provider: {{ patient.primary_care_provider|default:"Not assigned" }}

Insurance: {{ patient.primary_insurance|default:"Not provided" }}

{% else %}

No patient selected. Please select a patient to begin medication reconciliation.

{% endif %}
{% if patient %}

Reconciliation Status

{{ reconciliation.get_status_display|default:'Not Started' }}
{{ medication_sources|length }}
Medication Sources
{{ discrepancies|length }}
Discrepancies Found
{{ resolved_count }}
Resolved
{{ completion_percentage }}%
Complete
{% if reconciliation.started_at %}
{{ completion_percentage }}%
Started: {{ reconciliation.started_at|date:"M d, Y g:i A" }} {% if reconciliation.completed_at %} | Completed: {{ reconciliation.completed_at|date:"M d, Y g:i A" }} {% endif %}
{% endif %}

Medication Sources

{% for source in medication_sources %}
{{ source.name }}
{{ source.get_type_display }}

Date: {{ source.date|date:"M d, Y" }}
Provider: {{ source.provider|default:"Unknown" }}
Medications: {{ source.medication_count }}

{% empty %}

No medication sources found. Add sources to begin reconciliation.

{% endfor %}
{% if medication_sources %}

Medication Comparison

{% for source in medication_sources %} {% endfor %} {% for medication in compared_medications %} {% for source in medication_sources %} {% endfor %} {% empty %} {% endfor %}
Medication Strength Frequency Route{{ source.name }}Status Actions
{{ medication.name }} {% if medication.generic_name %}
{{ medication.generic_name }} {% endif %}
{{ medication.strength|default:"-" }} {{ medication.frequency|default:"-" }} {{ medication.route|default:"-" }} {% with medication.sources|get_item:source.id as source_med %} {% if source_med %} {% if source_med.different %}
Different {% endif %} {% else %} {% endif %} {% endwith %}
{{ medication.get_status_display }}
{% if medication.status == 'discrepancy' %} {% endif %}
No medications to compare. Add medication sources first.
{% endif %} {% if discrepancies %}

Discrepancies Requiring Attention

{% for discrepancy in discrepancies %} {% endfor %}
{% endif %}

Reconciliation Actions

Quick Actions
Completion Actions
{% if reconciliation.status != 'completed' %} {% endif %}
{% if discrepancies %} {% endif %}

Reconciliation History

{% for history in reconciliation_history %} {% empty %} {% endfor %}
Date Type Provider Status Sources Discrepancies Actions
{{ history.date|date:"M d, Y" }} {{ history.get_type_display }} {{ history.provider }} {{ history.get_status_display }} {{ history.source_count }} {{ history.discrepancy_count }}
{% if history.status == 'completed' %} {% endif %}
No previous reconciliations found
{% endif %}
{% endblock %} {% block js %} {% endblock %}