Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[biobank] new module #9475

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
1 change: 1 addition & 0 deletions SQL/0000-00-01-Modules.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ INSERT INTO modules (Name, Active) VALUES ('acknowledgements', 'Y');
INSERT INTO modules (Name, Active) VALUES ('api', 'Y');
INSERT INTO modules (Name, Active) VALUES ('battery_manager', 'Y');
INSERT INTO modules (Name, Active) VALUES ('behavioural_qc', 'Y');
INSERT INTO modules (Name, Active) VALUES ('biobank', 'Y');
INSERT INTO modules (Name, Active) VALUES ('brainbrowser', 'Y');
INSERT INTO modules (Name, Active) VALUES ('bvl_feedback', 'Y');
INSERT INTO modules (Name, Active) VALUES ('candidate_list', 'Y');
Expand Down
12 changes: 11 additions & 1 deletion SQL/0000-00-02-Permission.sql
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,17 @@ INSERT INTO `permissions` VALUES
(64,'dataquery_admin','Admin dataquery queries',(SELECT ID FROM modules WHERE Name='dataquery'),NULL,'2'),
(65,'schedule_module','Schedule Module - edit and delete the appointment',(SELECT ID FROM modules WHERE Name='schedule_module'),'View/Create/Edit','2'),
(66,'document_repository_categories','Categories',(SELECT ID FROM modules WHERE Name='document_repository'), 'Edit/Upload/Delete', '2'),
(67,'document_repository_hidden','Restricted files',(SELECT ID FROM modules WHERE Name='document_repository'), 'View', '2');
(67,'document_repository_hidden','Restricted files',(SELECT ID FROM modules WHERE Name='document_repository'), 'View', '2'),
(68,'biobank_specimen_view','View Specimen Data',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
(69,'biobank_specimen_create','Create Specimens',(SELECT ID FROM modules WHERE Name='biobank'), 'Create', '2'),
(70,'biobank_specimen_edit','Edit Specimen Data',(SELECT ID FROM modules WHERE Name='biobank'), 'Edit', '2'),
(71,'biobank_container_view','View Container Data',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
(72,'biobank_container_create','Create Containers',(SELECT ID FROM modules WHERE Name='biobank'), 'Create', '2'),
(73,'biobank_container_edit','Edit Container Data',(SELECT ID FROM modules WHERE Name='biobank'), 'Edit', '2'),
(74,'biobank_pool_view','View Pool Data',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
(75,'biobank_pool_create','Create Pools',(SELECT ID FROM modules WHERE Name='biobank'), 'Create', '2'),
(76,'biobank_fullsiteaccess','Full Site Access',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
(77,'biobank_fullprojectaccess','Full Project Access',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2');

INSERT INTO `user_perm_rel` (userID, permID)
SELECT u.ID, p.permID
Expand Down
402 changes: 402 additions & 0 deletions SQL/0000-00-06-BiobankTables.sql

Large diffs are not rendered by default.

32 changes: 32 additions & 0 deletions SQL/9999-99-99-drop_tables.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,38 @@ DROP TABLE IF EXISTS dataquery_run_queries;
DROP TABLE IF EXISTS dataquery_query_names;
DROP TABLE IF EXISTS dataquery_queries;

-- 0000-00-6-BiobankTables.sql
DROP TABLE IF EXISTS `biobank_container_shipment_rel`;
DROP TABLE IF EXISTS `shipment`;
DROP TABLE IF EXISTS `shipment_log`;
DROP TABLE IF EXISTS `shipment_status`;
DROP TABLE IF EXISTS `shipment_type`;
DROP TABLE IF EXISTS `biobank_specimen_pool_rel`;
DROP TABLE IF EXISTS `biobank_pool`;
DROP TABLE IF EXISTS `biobank_specimen_project_rel`;
DROP TABLE IF EXISTS `biobank_specimen_parent`;
DROP TABLE IF EXISTS `biobank_specimen_analysis`;
DROP TABLE IF EXISTS `biobank_specimen_preparation`;
DROP TABLE IF EXISTS `biobank_specimen_collection`;
DROP TABLE IF EXISTS `biobank_specimen_freezethaw`;
DROP TABLE IF EXISTS `biobank_specimen`;
DROP TABLE IF EXISTS `biobank_specimen_protocol_attribute_rel`;
DROP TABLE IF EXISTS `biobank_specimen_protocol`;
DROP TABLE IF EXISTS `biobank_specimen_attribute`;
DROP TABLE IF EXISTS `biobank_specimen_attribute_datatype`;
DROP TABLE IF EXISTS `biobank_specimen_process`;
DROP TABLE IF EXISTS `biobank_specimen_type_parent`;
DROP TABLE IF EXISTS `biobank_specimen_type_container_type_rel`;
DROP TABLE IF EXISTS `biobank_specimen_type_unit_rel`;
DROP TABLE IF EXISTS `biobank_specimen_type`;
DROP TABLE IF EXISTS `biobank_container_parent`;
DROP TABLE IF EXISTS `biobank_container`;
DROP TABLE IF EXISTS `biobank_container_type`;
DROP TABLE IF EXISTS `biobank_container_status`;
DROP TABLE IF EXISTS `biobank_container_capacity`;
DROP TABLE IF EXISTS `biobank_container_dimension`;
DROP TABLE IF EXISTS `biobank_unit`;

-- 0000-00-05-ElectrophysiologyTables.sql
DROP TABLE IF EXISTS `physiological_event_parameter_category_level`;
DROP TABLE IF EXISTS `physiological_event_parameter`;
Expand Down
13 changes: 13 additions & 0 deletions SQL/New_patches/2024-11-21_biobank_addmodule.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
INSERT INTO modules (Name, Active) VALUES ('biobank', 'Y');

INSERT INTO `permissions` VALUES
Copy link
Contributor

@kongtiaowang kongtiaowang Nov 27, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The permissions ID is not necessary since this will be applied as an update patch.

('biobank_specimen_view','View Specimen Data',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
('biobank_specimen_create','Create Specimens',(SELECT ID FROM modules WHERE Name='biobank'), 'Create', '2'),
('biobank_specimen_edit','Edit Specimen Data',(SELECT ID FROM modules WHERE Name='biobank'), 'Edit', '2'),
('biobank_container_view','View Container Data',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
('biobank_container_create','Create Containers',(SELECT ID FROM modules WHERE Name='biobank'), 'Create', '2'),
('biobank_container_edit','Edit Container Data',(SELECT ID FROM modules WHERE Name='biobank'), 'Edit', '2'),
('biobank_pool_view','View Pool Data',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
('biobank_pool_create','Create Pools',(SELECT ID FROM modules WHERE Name='biobank'), 'Create', '2'),
('biobank_fullsiteaccess','Full Site Access',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2'),
('biobank_fullprojectaccess','Full Project Access',(SELECT ID FROM modules WHERE Name='biobank'), 'View', '2');
6 changes: 3 additions & 3 deletions jsx/Modal.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
import {useState, PropsWithChildren, CSSProperties} from 'react';
import {useState, PropsWithChildren, CSSProperties, ReactNode} from 'react';
import Swal from 'sweetalert2';
import Loader from './Loader';
import {
ButtonElement,
} from 'jsx/Form';

type ModalProps = PropsWithChildren<{
export type ModalProps = PropsWithChildren<{
throwWarning?: boolean;
show: boolean;
onClose: () => void;
onSubmit?: () => Promise<any>;
onSuccess?: (data: any) => void;
title?: string;
title?: ReactNode;
}>;

/**
Expand Down
1 change: 1 addition & 0 deletions modules/biobank/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/*
88 changes: 88 additions & 0 deletions modules/biobank/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
# Biobank Module

## Purpose
The Biobank Module enables the management of biological specimens by providing functionalities for specimen tracking, container management, pooling, and shipment handling. It ensures standardized operations and maintains data integrity within the LORIS ecosystem.

## Intended Users
The primary users of the Biobank Module are:
- Biobank Managers: Oversee the overall biobank operations, including specimen tracking and inventory management.
- Laboratory Technicians: Handle the processing, storage, and preparation of biological specimens.
- Researchers: Access and utilize specimens for various studies and experiments.
- Site Coordinators: Ensure that specimens are correctly collected, processed, and integrated into the LORIS system across multiple sites.

## Scope
The Biobank Module facilitates the comprehensive management of biological specimens within the LORIS platform. Its functionalities include:

- **Specimen Tracking:** Monitor the lifecycle of each specimen from collection to storage and shipment.
- **Container Management:** Manage storage containers, including their types, capacities, and hierarchical relationships.
- **Pooling:** Combine multiple specimens into pools for efficient processing and analysis.
- **Shipment Handling:** Track the shipment of specimens, including logging shipment events and statuses.

**NOT in scope:**

- Automated quality control of specimens.
- Integration with external laboratory information management systems (LIMS) beyond LORIS.

## Permissions
Access to the Biobank Module is controlled through specific permissions to ensure data security and appropriate access levels.

| Permission Code | Description | Access Level |
|-----------------------------------|------------------------------|---------------|
| `biobank_specimen_view` | View Specimen Data | View |
| `biobank_specimen_create` | Create Specimens | Create |
| `biobank_specimen_edit` | Edit/Upload Specimen Data | Edit/Upload |
| `biobank_container_view` | View Container Data | View |
| `biobank_container_create` | Create Containers | Create |
| `biobank_container_edit` | Edit Container Data | Edit |
| `biobank_pool_view` | View Pool Data | View |
| `biobank_pool_create` | Create Pools | Create |
| `biobank_fullsiteaccess` | Full Site Access | View |
| `biobank_fullprojectaccess` | Full Project Access | View |

*Note: Ensure `Category` and `Access Level` align with your organization's permission schema.*

## Configuration
The module's functionality is supported by multiple configuration tables, each serving a specific purpose in managing specimens, containers, pools, and shipments.

| Table | Configuration | Description |
|---------------------------------------|-----------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `biobank_specimen_type` | Specimen Types | **Defines various specimen types (e.g., Blood, RNA) and their relationships with parent specimen types via `biobank_specimen_type_parent`.** |
| `biobank_container_capacity` | Container Capacity | **Defines the capacity of containers, specifying how many specimens each container can hold.** |
| `biobank_container_dimension` | Container Dimensions | **Stores dimensional data of containers, including size and volume specifications.** |
| `biobank_container_status` | Container Status | **Tracks the status of containers (e.g., Active, Inactive) to monitor their availability and usage.** |
| `biobank_container_type` | Container Types | **Specifies types of containers used for storing specimens, linked to specimen types through `biobank_specimen_type_container_type_rel`.** |
| `biobank_specimen_attribute` | Specimen Attributes | **Stores attributes related to specimens, such as concentration and quality metrics.** |
| `biobank_specimen_attribute_datatype` | Specimen Attribute Datatypes | **Defines data types for specimen attributes to ensure consistent data entry and validation.** |
| `biobank_specimen_protocol` | Specimen Protocols | **Associates specimens with specific collection and preparation protocols, ensuring standardized handling procedures.** |
| `biobank_specimen_protocol_attribute_rel` | Specimen Protocol Attribute Relations | **Links specimen protocols to their attributes, maintaining data consistency and integrity.** |
| `biobank_specimen_type_container_type_rel` | Specimen Type Container Type Relations | **Links specimen types to container types, ensuring appropriate container usage for each specimen type.** |
| `biobank_specimen_type_parent` | Specimen Type Parent Relations | **Manages parent-child relationships between specimen types, allowing for hierarchical classification and organization.** |
| `biobank_specimen_type_unit_rel` | Specimen Type Unit Relations | **Links specimen types to measurement units, ensuring consistent data entry for specimen measurements.** |
| `biobank_unit` | Measurement Units | **Defines measurement units (e.g., µL, mL) used across the Biobank Module for consistent data entry and reporting.** |
| `shipment_status` | Shipment Statuses | **Tracks the status of shipments (e.g., Pending, Shipped, Delivered) to monitor their progress and completion.** |
| `shipment_type` | Shipment Types | **Defines different types of shipments (e.g., Internal, External) to categorize and manage shipping processes effectively.** |


### Detailed Configuration Settings
- **Specimen Types (`biobank_specimen_type`):** Defines various specimen types (e.g., Blood, RNA) and their relationships with parent specimen types via `biobank_specimen_type_parent`.

- **Specimen Attributes (`biobank_specimen_attribute` & `biobank_specimen_attribute_datatype`):** Stores attributes related to specimens, such as concentration, quantification dates, and quality metrics. Data types are defined in `biobank_specimen_attribute_datatype`.

- **Container Types (`biobank_container_type`):** Specifies types of containers used for storing specimens, linked to specimen types through `biobank_specimen_type_container_type_rel`.

- **Measurement Units (`biobank_unit` & `biobank_specimen_type_unit_rel`):** Defines measurement units (e.g., µL, mL) and associates them with specimen types to ensure consistent data entry.

- **Protocols (`biobank_specimen_protocol`):** Links specimens and pools to specific collection and preparation protocols, ensuring standardized handling procedures.

- **Pools (`biobank_pool`):** Manages pools created from multiple specimens, allowing for efficient processing and aliquoting.

- **Shipments (`shipment`, `shipment_log`, `shipment_status`, `shipment_type`):** Tracks the shipment of containers, including event logging for comprehensive tracking and accountability.

- **Container Hierarchy (`biobank_container_parent`):** Manages parent-child relationships between containers to reflect storage hierarchies.

- **Data Integrity (`biobank_specimen_protocol_attribute_rel`):** Ensures that specimen protocols are correctly linked to their attributes, maintaining data consistency.

## Interactions with LORIS
The Biobank Module integrates seamlessly with various components of the LORIS platform to enhance functionality and data management:

- **Links:** Includes links to Session, Sites and Candidate modules.
Binary file added modules/biobank/css/._biobank.css
Binary file not shown.
Loading
Loading