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

Introduce a new task type `CREATE_CASE_FROM_SAMPLE` which is automatically created when a user with not enough rights adds a positive sample to a contact #8897

Open vidi42 opened 2 years ago

vidi42 commented 2 years ago

Feature Description

A follow-up to #8786

Problem Description

When saving a sample with a positive test result for a contact, the user should receive a message to convert the contact to a case. However, not all users which have access to create samples also have access to create cases and contacts, so it doesn't make sense to ask the user to create a case out of the contact since this will result in an authorization issue.

Proposed Change

Extract from the ticket mentioned above: If a user does not have the CASE_CREATE and/or CONTACT_EDIT user right, instead of showing the popup to create a case for the contact person, ask them whether they want to create a task that is automatically assigned to either the user assigned as the responsible user to the contact, or an eligible user in the contact's jurisdiction (i.e. probably any user that has both the CASE_CREATE and CASE_RESPONSIBLE user right, but we'd need to refine this). This would be a new task type, probably called something like CREATE_CASE_FROM_SAMPLE, that would be assigned to the contact and would probably need a link to the sample in question in the creatorComment field.

Possible Alternatives

No alternatives at the moment.

Additional Information

Can be reproduced with a user which has the Clinician role. @MateStrysewske @MartinWahnschaffe, please add if any.

bernardsilenou commented 2 years ago

@vidi42

vidi42 commented 2 years ago

@bernardsilenou Regarding your first 3 points. You probably are correct that from a purely functional point of view that all the users who can create/edit samples can also create/edit associated entities. The not all users which have access to create samples also have access to create cases and contacts statement comes from a more technical point of view and can be seen implemented for the Clinician user role, which has the right to create samples and view contacts, but not the right to create contacts. image

Besides that, we need to keep in mind that we are going for a more flexible approach to user rights, where each system can define what rights a role has, so in case we don't enforce this all users that have the right to create samples should also be able to create their associated entities (cases, contacts, ep) it's very easy to end up with a role that just has the sample create/edit/view rights.

As for the last two points, I think this can be doable, however, the idea with the new task type was to create a reminder in the system and to guide the user a bit through the new workflow instead of asking them to discover it. I can see however how this might become obsolete sometimes in the future.

@MateStrysewske / @MartinWahnschaffe any opinions?

MartinWahnschaffe commented 2 years ago

The whole problem here comes from the situation that a clinician is ment to work on cases, but not contacts. So he should acutally never be in a situation where he changes the result of the sample of a contact. But since we don't have sepearate rights to edit the sample of a case and the sample of a contact, this could happen.

Bernard definitely has a point, when he says that these automatic tasks are not a great tool and we have to ask ourselves whether we can find an alternative solution.

  1. The easiest solution would be to enforce the user rights for case & contact creation & editing for any user who can edit samples. @bernardsilenou Do you think allowing the clinician to create contacts would be an option?
  2. The filter for contacts with a positive lab result that have not been converted to a case yet. The problem I see with that is that someone has to think about it and check this once a day or once a week. Still something that we could live with
  3. The task solution proposed here.

At this point I would be in favor of solution 1. If we ever have a need to a allow a user to create/edit samples without creating case/contacts, we cann still do solution 2 or 3 or maybe something else that becomes obvious once we have a clear use case.

bernardsilenou commented 2 years ago

@MartinWahnschaffe

  1. I am in support of this point. I think if this kind of issue happens to any other user role that has the right to create cases and pathogen tests, then we can just give them the right to also create contacts or event participants also.
  2. This is also my second choice. What about having something like a weekly task or reminder message on data inconsistencies to all the users in a jurisdiction. An email or notification with something like "10 contacts reported in our jurisdiction have a positive pathogen test but have not been converted to cases, please review these contacts and take necessary measures" + "URL link to connect to sorma and filter the contacts "