SORMAS-Foundation / SORMAS-Project

SORMAS (Surveillance, Outbreak Response Management and Analysis System) is an early warning and management system to fight the spread of infectious diseases.
https://sormas.org
GNU General Public License v3.0
291 stars 140 forks source link

[S2S] duplicate detection #11483

Open SahaLinaPrueger opened 1 year ago

SahaLinaPrueger commented 1 year ago

Problem Description

Duplicate detection for S2S was implemented before person merge was implemented. So the given recommendations nowadays are incomplete or false and have to be updated.

The duplicate detection for S2S and the shown recommendations are too much of a hindrance to independent thinking.

Duplicate detection for cases do not fit good for S2S because cases need the same place of stay region or the same responsible region to be detected as a duplicate. Sometimes persons get identified, while the case/contact do not.

Proposed Change

After accepting the shared case/contact in target system the following message should appear:

Headline: potential duplicates detected

Button: Download and save under documents

Text: The following duplicates were found:

persons: [Number of persons detected as duplicates] UUID line break UUID

cases: [Number of cases detected as duplicates - can be zero] UUID line break UUID

contacts: [Number of contacts detected as duplicates - can be zero] UUID line break UUID

Please check this and merge the duplicate persons / cases / contacts. You can begin with merging the persons.

shown buttons: Okay | Okay, and go to person directory | Cancel

Acceptance Criteria

Implementation Details

Additional Information

This issue is still in progress.

refers to #11292 revision of: https://github.com/hzi-braunschweig/SORMAS-Project/issues/9527

Open questions:

SahaLinaPrueger commented 1 year ago

@leventegal-she open question number one: I think the findings in this issue: https://github.com/hzi-braunschweig/SORMAS-Project/issues/10135 have no effect on the duplicate detection, which is running after accepting a share (see #9527). So we can delete the explanation: Please note: Cases need the same place of stay region or the same responsible region to be detected as a duplicate. If duplicate persons are found, you should be on the safe side and check the duplicate person found to see if there is a duplicate case with a different place of stay region or different responsible region. , right?

open question number two: https://github.com/hzi-braunschweig/SORMAS-Project/issues/9527#issuecomment-1265442536 accepting case scenario 3 and accepting contact scenario 3: how does duplicate detection between case and contact work? report date within 30 days and same disease?

leventegal-she commented 1 year ago

@SORMAS-SahaLinaPrueger open question number one: yes the duplicate detection excludes cases with different jurisdiction so we can delete the explanation

open question number two: for case scenario it takes the responsible district of the accepted case, the one that is set when accepting, the disease and report date within 30 for contact scenario: responsible district of the accepted case, the one that is set when accepting, and disease

In contact scenario the report date is not considered because there is an inconsistency in the code: the contact duplicate check does it by default but the check for similar cases considers it only if it is specified.

So we can change the case duplicate search by this ticket to specify the report date too, and maybe we need another change request to make the duplicate check consistent and change the case duplicate search to take the report date by default.

SahaLinaPrueger commented 1 year ago

@leventegal-she

open question number two: I do not understand the answer. I will clearify my question:

2.1 If I accept a case in the target system and there is a similar contact in the target system not converted to a case, the following message appears: There is at least one similar contact in your system. After accepting the request, it may be necessary to perform a manual conversion of those contacts to the accepted case (https://github.com/hzi-braunschweig/SORMAS-Project/issues/9527#issuecomment-1265442536)

What does the system check in this scenario? Case and Contact must be the same person, ok, what else? I would expect something like this: The accepted case must have the same responsible district as the contact (and if there is no responsible district in the contact than the same responsible district of the source case of the contact) The disease of case and contact must be the same (or if no disease is deposited in the contact then of case and source case of contact) The report date of the case and contact must be the same.

2.2 And if I accept a contact in the target system and there is a similar case in the target system, the following message appears:
There is at least one similar case in your system. After accepting the request, it may be necessary to perform a manual conversion of the accepted contacts. (https://github.com/hzi-braunschweig/SORMAS-Project/issues/9527#issuecomment-1265442536)

What does the system check in this scenario? Case and Contact must be the same person, ok, what else? I would expect the same as above.

2.3 For the other szenarios I thought the "normal duplicate detection mechanism" is running.

So for cases: Both cases (the accepted case and the case who is already in the target system) must have the same disease. Both cases must have the same responsible region. The report dates of both cases must be within 30 days of each other. And for contacts: Both contacts must have the same disease. If a source case has been selected, both contacts must have the same source case. The report dates of both contacts must be within 30 days of each other. The last contact dates of both contacts must be within 30 days of each other (if specified for the created contact). -> In S2S-Scenario it would make more sense to say: report date OR last contact dates of both contacts must be within 30 days of each other.