GSoC 2017 - Patient Matching 2.0 - Final Presentation

Patient Matching 2.0

Primary Mentor - @burke Backup Mentor - @sgrannis

I would like to divide my whole project into two parts for the better understanding.

1. Incremental Patient Matching 2. Merging Patients & Excluding non-matching Patients from the Patient-Matching Report

According to my GSoC project my primary goal was number 1 whereas the secondary goal was number 2. I have completed both of them successfully. Allow me to give a description about these two parts.

Incremental Patient Matching

To give a little introduction on what incremental patient matching is, it is a method of identifying duplicate patients very efficiently. In a real world scenario, the requirement would be to match thousands of patients with each other. Once this matching process continues it would be very time consuming since all of the patients are compared with each of them regardless of the fact that two or three new patients are added/updated. Incremental patient matching is used as a suggestion to save time.

Before showing how this has been done, I want to highlight few things related to this scenario.

  • By default the checkbox Incremental Match is checked. User can perform a patient match as an incremental or as a normal patient match where all the patients are compared with each of them.
  • A single report per a strategy. The report will be named as incremental-report-[strategy-name]
  • To perform an incremental patient match it is necessary to have an already generated report for that particular strategy. otherwise module will compare every patient to all the others.
  • Incremental patient matching will be performed only if a single strategy is selected.

Here is how the report generating user interface looks like after the changes

How this Works?

Run a report with the configuration name “test1”

A report will be created adding the incremental-report text to the configuration name.

This is how it looks like when a patient match is performed at the first time

Add a patient which shows a match with an existing record

Run the report again (Incremental patient matching)

The same incremental-report-test1 report will be updated.

New patient is added which do not exhibit any matching property with existing records

Then there will be no changes in the report.

Add another patient

Report will be updated as the following image

Update an existing patient in a way that it will show matching properties with existing records

The updated patient will be added to the same group in the report.

Update an existing paitient in the patient-matching report in a way that it will no longer exhibit matching properties

Here is a new report

I am going to do two operations. Update patient IDs 9 and 53. After running the report again as an incremental patient matching the report will be as following

The group 1 has been updated and you can see that patient 9 is missing. The whole group 2 has been removed. After the patient 53 is updated it is pointless to have a single patient record in the report.

NOTE : Every changes happen to the same patient matching report

Merging Patients & Excluding Non-Matching Patients

After doing the changes to the report this is how it looks like.

There are two buttons, one is for merge patients and the other one is to exclude non-matching patients. Initially both the buttons are disabled and they will enabled once you select at least two patients from a group.

Merging Patients Suppose that patients 41 and 46 refer to the same person and 39 and 53 refer to the same person. If so, I will perform merging operation with them. (Should have to perform in two steps first merge 41 and 46 then 39 and 53) After performing that the report will looks like as follows

By re-running the report it will not generate those groups 2 and 3 again.

Excluding Non-Matching Patients

Let us do few things,

Suppose that patients 53 and 39 are referred to two different people. Then you can easily instruct the module that

these two records do not represent a single patient so don’t consider these two as a match when generating the report again.

After excluding those two and if the report is regenerated you can see that the whole group of patients 37, 39, and 53 has been removed.

If I do the same thing for patients 49 and 48 only those two records will be removed since there are other records which exhibit matching properties with themselves.

Code Contribution

Issues that I opened

PTM-82 - Load patients for the incremental matching PTM-83 - Generate and save reports in incremental patient matching process PTM-84 - Perform patient match with two datasources PTM-85 - Option to select or deselect incremental patient matching PTM-86 - Update patient-matching report when patients in the report are updated PTM-87 : To merge patients in the patient matching report PTM-88 : To exclude non-matching patients from the report PTM-89 - Ignore voided patients when running patient match

All of the above issues are completed successfully.

Here are the commits related to each of the issue. (Note that all of the commits related to single issue has been squashed.)

PTM-82 - PTM-82: Functionality to load patients considering date created and c… · lahirujayathilake/openmrs-module-patientmatching@b3ffd77 · GitHub PTM-83 - PTM-83: Save and update incremental patient matching report to the da… · lahirujayathilake/openmrs-module-patientmatching@7704534 · GitHub PTM-84 - PTM-84: Functionality to support two datasources · lahirujayathilake/openmrs-module-patientmatching@c810245 · GitHub PTM-85 - PTM-85: Functionality to select or deselect incremental match · lahirujayathilake/openmrs-module-patientmatching@35172a9 · GitHub PTM-86 - PTM-86 : Remove matching pairs from the report when patients are updated · lahirujayathilake/openmrs-module-patientmatching@b624286 · GitHub PTM-87 - PTM-87 : Functionality to Merge Patients in the report · lahirujayathilake/openmrs-module-patientmatching@6ee57f1 · GitHub PTM-88 - PTM-88 : Functionality to exclude non-matching patients · lahirujayathilake/openmrs-module-patientmatching@b1f3fcc · GitHub PTM-89 - PTM-89 : Ignore voided patients when running a patient match · lahirujayathilake/openmrs-module-patientmatching@be4f391 · GitHub

Project Documentation Wiki

Here is the link to project documentation wiki.

Video Presentation


Throughout this summer I learned a lot. Whenever there were problems related to the project I had a great support from my mentor and the community. Participating in daily scrums showed me how good this OpenMRS community is. My mentors are the best. They gave me guidance at the first place, conducting many video conferences because of that I could carry out this project with a sound knowledge. @burke, @sgrannis thank you very much for your support throughout this summer. I feel really grateful to these mentors

Thanks everyone for conducting GSoC projects in a well organized manner :slight_smile:


Thank you for your contributions @lahiruj :). Keep up your good work.

1 Like