Medication reconciliation is an important use case for clinical AI because medication records can change as patients move between healthcare settings.
A patient may have a pre-admission medication history, inpatient medication orders and a discharge prescription. These records may contain differences that are clinically justified, accidental or simply unresolved.
An AI system should help distinguish these possibilities.
The technical problem
A basic medication comparison system might identify differences between two lists:
previous_medications = { "Drug A": {"dose": "10 mg", "frequency": "daily"}, "Drug B": {"dose": "500 mg", "frequency": "twice daily"}, "Drug C": {"dose": "5 mg", "frequency": "daily"} } discharge_medications = { "Drug A": {"dose": "10 mg", "frequency": "daily"}, "Drug B": {"dose": "250 mg", "frequency": "twice daily"}, "Drug D": {"dose": "20 mg", "frequency": "daily"} } A simple comparison can identify that Drug C is missing, Drug B has a changed dose and Drug D is newly introduced.
However, these differences do not establish that an error occurred.
Drug C may have been intentionally discontinued. Drug B may have been adjusted following clinical assessment. Drug D may represent a newly initiated treatment.
The system therefore needs more than list comparison.
A context-aware architecture
A practical medication reconciliation pipeline should combine medication normalisation, record matching, temporal analysis and clinical context.
Medication normalisation helps recognise equivalent names and formulations. Record matching links prescriptions that refer to the same medication despite differences in naming or documentation.
Temporal analysis establishes when each prescription became active, changed or discontinued.
Clinical context helps interpret the significance of those changes, including documented reasons, diagnoses and relevant treatment decisions.
The system should produce an explainable discrepancy record rather than a simple error label.
For example:
discrepancy = { "medication": "Drug B", "previous_dose": "500 mg", "current_dose": "250 mg", "change_type": "dose_change", "change_time": "discharge", "documented_reason": None, "status": "requires_professional_review" } The absence of a documented reason does not prove that the change was inappropriate. It indicates that further verification may be necessary.
Evaluating the system
Evaluation should go beyond the number of discrepancies detected.
Important measures include precision and recall for clinically relevant discrepancies, false alert rates, time required for reconciliation, proportion of discrepancies resolved before discharge and the frequency of unintended medication discrepancies reaching patients.
Performance should also be assessed across different hospitals, patient populations and electronic health record systems.
Where agentic AI fits
An agentic system could retrieve medication records, prepare a reconciliation summary, identify unresolved issues and route them to an authorised professional.
It should not independently reinstate discontinued medication or alter a prescription simply because two records differ.
The distinction between detecting a discrepancy and authorising a treatment change is fundamental to safe clinical automation.
Final thought
Medication reconciliation is not merely a data-cleaning task. It is a clinical safety process that depends on accurate information, temporal context and professional judgement.
Healthcare AI can make that process more reliable when it is designed to understand why medication records change, not just detect that they have changed.
If you are developing clinical AI, medication safety or healthcare interoperability solutions, I would welcome a professional exchange on practical implementation.
