Implemented duplicate patients management. (#4502)
commit70390ef4f901f05219040d2c1375eecac00c8114
authorRod Roark <rod@sunsetsystems.com>
Tue, 6 Jul 2021 00:32:10 +0000 (6 10:32 +1000)
committerGitHub <noreply@github.com>
Tue, 6 Jul 2021 00:32:10 +0000 (6 10:32 +1000)
tree9cec8d1cc268089d74adf5a9c197b6c0ba6fd5be
parent2737e5dc3198aa7e77350fd7b54b009a3603344f
Implemented duplicate patients management. (#4502)

* Implemented duplicate patients management.

Identification and correction of duplicate patients involves the following:

 1. Column "dupscore" in the patient_data table was created to contain a value representing
    the likelihood that the patient duplicates any of the patients created earlier (that is,
    with a lesser "pid" value). It may have any of the following values:

    o -9, initially assigned, indicating that it needs to be computed.
    o -1, indicating that the patient has been manually flagged as not duplicating a previous patient.
    o A score in the range 0-40 computed by the SQL expression found in library/dupscore.inc.php.
      A value of 12 or higher is considered to be very likely a duplicate.

 2. The script library/dupscore.inc.php which provides the SQL expression needed for scoring.

 3. The command-line tool contrib/util/dupscore.cli.php which should be run to initially
    assign all patient_data.dupscore values, and may be run from time to time to update
    or recompute them. See the source of that script for its usage syntax.

 4. The web tool Administration -> Patient -> Manage Duplicates.
    For each patient with a dupscore of 7 or higher, it shows below it all the corresponding
    matching patients. Thus you see a collection of patient groups.
    Within each group you can choose to mark the first patient as not a duplicate, or you can
    merge it with one of the other patients. You do that by choosing "Merge and Keep" or
    "Merge and Discard" for the other patient, which brings up the Merge Patients page to
    complete the merge. That page describes in more detail what it will do.
contrib/util/dupscore.cli.php [new file with mode: 0755]
interface/main/tabs/menu/menus/standard.json
interface/patient_file/manage_dup_patients.php [new file with mode: 0644]
interface/patient_file/merge_patients.php
library/dupscore.inc.php [new file with mode: 0644]
library/patient.inc
sql/6_0_0-to-6_1_0_upgrade.sql
sql/database.sql