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

S2S_facilities_crowdsourcing [in progress] #9982

Open SahaLinaPrueger opened 1 year ago

SahaLinaPrueger commented 1 year ago

Feature Description

In order for the share of records to SORMAS 2 SORMAS to be possible, it is necessary that a facility linked to a record is present in both instances and that it can be unambiguously determined that it is technically the same institution.

However, in each country there are a large number of institutions that could potentially be relevant for data collection in SORMAS. Therefore, keeping this data centrally is both economically and technically impractical.

For this reason, a "crowdsourcing" approach for the entities is introduced.

Proposed Change

Each instance holder creates the relevant facilities for their own area of responsibility in their own instance.

When sharing data sets that are linked to facilities, these are also created there if the target instance does not know them.

With this approach, the infrastructure data distributes itself over the instances in the course of time and it is ensured that no unnecessary load is created on the instances through regular synchronisation of irrelevant data.

Once a facility has been created during a handover, the local administrator can freely change the facility data stored in his instance (except for the UUID). There is no subsequent synchronisation.

This is intended to reduce sources of error on the one hand, and on the other hand to maintain sovereignty over their own data with the local adminsitrators.

Acceptance Criteria

Implementation Details

The display of the UUID of an institution is added in the administration interface. However, it cannot be edited. (Reason: The administrator must have the possibility to quickly check the UUIDs in case of troubleshooting).

If an instance receives a share from a source system in which one or more facilities are linked, it is checked whether a facility with the corresponding UUID already exists in the target system and, if necessary, this is automatically created with the initial data from the transfer.

If an instance send a share and if the record to be shared is linked to a facility and this facility has no value for "external ID": Generate a UUID and store it at the facility in the "external ID" field.

Processing of a share according to the facilities in target system

  1. Perform a check for all facilities included in the share: Does the share contain one or more facilities? 1.1 no: nothing happens 1.2 yes: next check has to be performed: Does the received instance (target system) not have a facility with the same UUID as the share?

    1.2.1 yes: create the facility with the data contained in the share in the target system 1.2.2 no: next check has to be performed: Does the receiving instance have exactly one facility with the same UUID as the facility in the share?

1.2.2.1 yes: no activity required 1.2.2.2 no: display error message: Shared data could not be processed! Multiple facilities with the same value for 'UUID' have been found. Please contact your administrator. (German: Die Übergabe kann nicht verarbeitet werden! In Ihrer Instanz befinden sich mehrere Einrichtungen mit dem gleichen Wert im Feld 'UUID'. Bitte wenden Sie sich an ihren Administrator.). -> Abort processing of the transfor.

Additional Information

Issue is still in progress.

  • I think it is better if the facilities are sync all the time. So if an instance makes a change all other facilities will be sync, too. Otherwise we have different versions of a facility under the same uuid. To avoid changes who are false, we can implement that every facility primarily belongs to one instance (the instance where the facility is local is the "responsible instance") and if another instance wants to make a change to a facility for which they are not responsible then the responsible instance gets a notice (similar to the share request in s2s for cases/ contacts) and the responsible instance has to accept the change or reject it with an explanation why not. If the facility has a location and this part of the world do not have a s2s instance then every instance can make a change. A facility can get the responsible instance afterwards, if the instance is created one day.
  • so what we also need is a duplicate detection for facilities
  • we also need a merge function for facilities.
SahaLinaPrueger commented 1 year ago

@JaquM-HZI

JonasCir commented 1 year ago

@SahaLinaPrueger This is related: https://github.com/hzi-braunschweig/SORMAS-Project/issues/9389