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
292 stars 142 forks source link

Merge duplicate case review #11425

Open sergiupacurariu opened 1 year ago

sergiupacurariu commented 1 year ago

Problem Description

Currently, the case duplicate search is a cartesian product within the user's region except for national users. The default case duplicate search jurisdiction is region. Due to this any user with jurisdiction below including district will see in the results cases from outside their jurisdiction. Besides the above, the case merge process is influenced by the case save and delete rights and, jurisdictions. Due to the above rights many of the duplicates shown cannot be merged especially by users with district jurisdictions or less. If one of the duplicates either picked or discarded is outside jurisdiction the merge process is blocked due to the saving (when the picked case is outside user's jurisdiction) or delete (when the discarded case is outside user's jurisdiction) process. "Merge Duplicate Contacts" follow the same approach as cases.

Proposed Change

Possible change scenarios: 1) Restrict the duplicate list to the duplicates where both cases are in the user's jurisdiction. This approach will allow the users to merge any of the duplicates shown in their list. If for example, a set of duplicates found has cases from different districts a district user will not see it anymore. (at this moment a district user is able to see it but due to save and delete restrictions is not able to do the merge). In this case, an user with region jurisdiction could tackle those situations. Drawback: finding duplicates is a resource-intensive process. Due to this, users with higher jurisdiction users might avoid running this task. 2) Keep the merge process as is. The amount of data is less and the user will find it a lot easier to go through the results. Make it possible for the user with insufficient rights to finalize the merge process to mark the 2 cases as duplicates. These results could be reviewed by an user with rights on both cases which could authorize the merge process. In order to ease the user's effort a checkbox to show only duplicates with both cases in the user's jurisdiction (that means duplicates that can be merged by the user) would take out some of the burdens.

  1. User restricted up to district logged in: -> in the merge duplicates grid, the user sees information that is otherwise confidential to him (such as names of persons associated with cases outside their jurisdiction); -> the merging of the displayed duplicates is not possible as the user does not have delete and save rights for entities outside their jurisdiction; Proposed change discussed with @MateStrysewske as well:
    • extend the level of checks for jurisdiction in the merge duplicates grids;
    • merge duplicates grid should be filtered based on the logged in user's jurisdiction (up to the lowest level that they have set; i.e. a user restricted by district should only see potential duplicates for that district; a user restricted by facility should only see potential duplicates from that facility);
    • note: the overall behavior described in this ticket can be reproduced with only configured users - as the rights for merging duplicates are by default only given to admins (regular admin. admin surveillance supervisor which have the national or regional jurisdiction level).

      Acceptance Criteria

Implementation Details

Additional Information

AndyBakcsy-she commented 1 year ago

@abrudanancuta @adinaflorea9 Could you please take a look at this ticket?

bernardsilenou commented 1 year ago