Skip to content

Commit

Permalink
Modify docs + SQL/RB
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffersoncasimir committed Feb 5, 2025
1 parent 73f26b9 commit 8120051
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 5 deletions.
10 changes: 9 additions & 1 deletion SQL/0000-00-00-schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,14 @@ CREATE TABLE `instrument_data` (
PRIMARY KEY (`ID`)
);

CREATE TABLE `instrument_data_files` (
`ID` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`DataID` INT(10) UNSIGNED DEFAULT NULL,
`FilePath` VARCHAR(255) NOT NULL,
CONSTRAINT `FK_flag_instrument_data_files` FOREIGN KEY (`DataID`) REFERENCES `instrument_data` (`ID`),
PRIMARY KEY (`ID`)
);

CREATE TABLE `flag` (
`ID` int(10) unsigned NOT NULL auto_increment,
`SessionID` int(10) unsigned NOT NULL,
Expand Down Expand Up @@ -1462,7 +1470,7 @@ INSERT INTO StatisticsTabs (ModuleName, SubModuleName, Description, OrderNo) VAL
CREATE TABLE `server_processes` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`pid` int(11) unsigned NOT NULL,
`type` enum('mri_upload') NOT NULL,
`type` enum('mri_upload','parse_instrument_data') NOT NULL,
`stdout_file` varchar(255) DEFAULT NULL,
`stderr_file` varchar(255) DEFAULT NULL,
`exit_code_file` varchar(255) DEFAULT NULL,
Expand Down
6 changes: 5 additions & 1 deletion modules/instrument_manager/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,17 @@ metadata for a LORIS instance as well as provide a centralized place
to install instruments created from the instrument builder without
backend access.

Instrument data can be uploaded from a csv file. A template with the
expected headers can be downloaded.

It provides overview of the "health" of the various MySQL instrument
tables and whether or not they are in sync with the instrument as it
tables and whether they are in sync with the instrument as it
exists on the filesystem or not. However, the checks are only possible
for LINST (instrument builder) instruments, as the appropriate state
of database tables can not easily be statically determined for PHP
instruments.


## Intended Users

The instrument manager is intended to be used by study or LORIS
Expand Down
6 changes: 5 additions & 1 deletion modules/instrument_manager/help/instrument_manager.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,14 @@ In the **Browse** tab, use the *Selection Filter* section to search for an instr

*Table Valid*: displays whether the SQL database is properly configured with respect to the instrument installed in the LORIS `project/instruments` directory.

*Pages Valid* displays whether the `instrument_subtests` table in LORIS is properly populated for this instrument
*Pages Valid*: displays whether the `instrument_subtests` table in LORIS is properly populated for this instrument

**Note**: the *Table Valid* and *Pages Valid* columns can only be determined for LINST instruments (generated by the Instrument Builder, see *Instrument Type* column), since this can't be determined for PHP instruments.

*Permission Required*: view and manage permissions required to access the instrument

*Upload*: display dialog to upload instrument data from a csv file

## Upload New Instrument

If your LORIS is configured for it, the **Upload** tab will display an *Upload Instrument* section. Click **Browse** to select a LINST file from your computer. Click **Install Instrument** to install the instrument into LORIS.
Expand Down
7 changes: 6 additions & 1 deletion modules/instrument_manager/test/TestPlan.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ eg "Table Valid" column is valid when instrument fields match up and "Pages Vali
[Manual Testing]
9. With a user who has the `instrument_manager_write` permission, click the button in the `Permission Required` column. A modal should popup where you can edit the permissions.
- Check that modifying the permissions saves the new permissions.
- Check that a user can access that instruments if and only if they has that permission.
- Check that a user can access that instruments if and only if they have that permission.
10. Test uploading csv data as a user who has the `instrument_manager_write` permission:
- Pick an instrument and press "Download expected template"
- Attempt to successfully upload a csv file, ideally with one or more data rows
- Attempt to make uploading fail (ex: uploading to the wrong instrument or omitting headers)
- Upload a csv file larger than `MAX_FILE_BYTES` (in `instrument_data.class.inc`) and ensure that the data is uploaded as a background task. Manually run the `tools/monitor_instrument_data.php` script and view the status change in `server_process_manager` module.
2 changes: 2 additions & 0 deletions raisinbread/RB_files/RB_Config.sql
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (126,129,'365');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (127,130,'/var/www/loris/');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (128,131,'/data/EEGUploadIncomingPath/');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (129,132,'false');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (130,133,'/data/uploads/instruments/');
INSERT INTO `Config` (`ID`, `ConfigID`, `Value`) VALUES (131,134,'/data/tmp/');

UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1;
4 changes: 3 additions & 1 deletion raisinbread/RB_files/RB_ConfigSettings.sql
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMult
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (122,'AWS_S3_Endpoint','Endpoint to use for accessing files stored in S3. Endpoint or region are required for S3 support.',1,0,'text',121,'AWS S3 Endpoint',3);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (123,'AWS_S3_Region','AWS Region to use for accessing files stored in S3. Endpoint or region are required for S3 support.',1,0,'text',121,'AWS S3 Region',3);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (124,'AWS_S3_Default_Bucket','Default bucket for LORIS to use for accessing files in S3.',1,0,'text',121,'AWS S3 Default Bucket',3);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES
(125,'useEEGBrowserVisualizationComponents','Whether to enable the visualization components on the EEG Browser module',1,0,'boolean',39,'Enable the EEG Browser components',4);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (126,'createVisit','Enable visit creation in the imaging pipeline',1,0,'boolean',69,'Enable visit creation',11);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (127,'default_project','Default project used when creating scan candidate or visit',1,0,'text',69,'Default project',12);
Expand All @@ -121,5 +121,7 @@ INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMult
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (130,'DownloadPath','Where files are downloaded',1,0,'text',26,'Downloads',4);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (131,'EEGUploadIncomingPath', 'Path to the upload directory for incoming EEG studies', 1, 0, 'text', 26, 'EEG Incoming Directory', 15);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (132,'useDoB','Use DoB (Date of Birth)',1,0,'boolean',1,'Use DoB',12);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (133,'instrumentDataPath','Path to directory for uploaded instrument data csv files',1,0,'text',26,'Instrument Data Upload Path',16);
INSERT INTO `ConfigSettings` (`ID`, `Name`, `Description`, `Visible`, `AllowMultiple`, `DataType`, `Parent`, `Label`, `OrderNumber`) VALUES (134,'tempPath','Path for temporary files',1,0,'text',26,'Temp File Path',17);
UNLOCK TABLES;
SET FOREIGN_KEY_CHECKS=1;

0 comments on commit 8120051

Please sign in to comment.