BiologicalRecordsCentre / iRecord

Repository to store and track enhancements, issues and tasks regarding the iRecord website.
http://irecord.org.uk
2 stars 1 forks source link

Enable users to link records to multiple activities #1702

Open johnvanbreda opened 1 month ago

johnvanbreda commented 1 month ago

NB that a group is the internal term used for the concept that iRecord calls an activity.

Currently we have a single integer field that links a sample to a group, if a form is being submitted into a group. Changing this to a list field may be tricky without knock-on effects.

Once possibility would be to add a new field to the occurrence table, e.g. linked_group_ids which would be an integer array, which is for capturing any additional groups the record is linked to after initial submission. Therefore in the logical database we have 2 concepts - the group the sample was originally submitted into, plus the activities that the occurrences were later linked to. Therefore existing code or reports which refer to the existing group ID (the first concept, the group the sample was submitted into) will be unaffected.

For reporting purposes, an additional linked_group_ids field would be added to cache_occurrences_functional with an index for filtering in PostgreSQL queries. This would contain the contents of both samples.group_id and occurrences.linked_group_ids.

In Elasticsearch, a new nested field is added, metadata.linked_groups, which contains an id and title for each group.

Standard reporting parameter code is modified for both PostgreSQL and Elasticsearch reporting filter code. Therefore existing reports which filter on a group_id to show the data posted into a group would include the records which have been later linked to the group.

A user interface is required to allow the user to manage the activities/groups that a record falls into. This might consist of (open to discussion):

johnvanbreda commented 1 month ago

@kitenetter would welcome your thoughts on the proposals here.

kitenetter commented 3 weeks ago

The proposals seem excellent to me, as long as we can find a way of making the tools available without over-complicating the appearance of the Explore page. Maybe put the activity-related controls onto a separate tab on the Explore page, could that work?