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

New Data Dictionary framework and module #6936

Merged
merged 60 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
42580f8
WIP
driusan Apr 23, 2020
20847d0
WIP
driusan Apr 23, 2020
ecddf60
Add metadata fields to linst files
driusan Apr 23, 2020
88479b4
[Core] Require correct types for lorisform->addSelect
driusan Jun 15, 2020
6139b53
PHPCS
driusan Jun 15, 2020
084a013
phan
driusan Jun 15, 2020
31fe6b7
Remove unused class
driusan Jun 16, 2020
c2324b5
Add scope to dictionary
driusan Jun 16, 2020
a5f39c6
Add data scope to datadict frontend
driusan Jun 16, 2020
c0c801c
Add data type to dictionary
driusan Jun 16, 2020
7aa4a10
Add Data types
driusan Jul 8, 2020
e1cacfb
WIP
driusan Jul 9, 2020
046bb3b
WIP
driusan Jul 13, 2020
2c99c1c
Add cardinality and imaging things
driusan Jul 16, 2020
e24d64c
add missing files
driusan Jul 16, 2020
d2e235a
Remove category from field name
driusan Jul 22, 2020
c673653
fix build after rebase
driusan Aug 3, 2020
75f55d9
Move fieldOptions to new endpoint
driusan Aug 3, 2020
64cc8cf
Share more code between endpoints
driusan Aug 5, 2020
6dd8e6b
Add options for enum
driusan Aug 6, 2020
a77cef8
Move to new module name
driusan Aug 24, 2020
e97248c
Remove unused file
driusan Aug 24, 2020
df900bd
Move serialization to datainstance, not provisioner
driusan Aug 24, 2020
5d2926f
Some PHPCS
driusan Aug 24, 2020
5ce0503
Restore datadict module from main branch
driusan Aug 24, 2020
fff6d6c
Remove unused files
driusan Aug 24, 2020
ae6522c
PHPCS
driusan Aug 24, 2020
95a2861
More phan
driusan Aug 26, 2020
6f9c226
More phan phun
driusan Aug 26, 2020
11a8569
Update README
driusan Aug 26, 2020
70f0de9
Move module dictionary to own endpoint
driusan Aug 26, 2020
094e7cc
Update help text
driusan Aug 26, 2020
0c22ab7
Update tests
driusan Aug 26, 2020
b1a7ff9
Fix type
driusan Aug 26, 2020
05ee648
Remove duplicated function which was merged separately
driusan Aug 26, 2020
4fa0109
Update gitignore
driusan Aug 26, 2020
ec757d1
Update comments
driusan Aug 26, 2020
40439c7
Remove unnecessary changes
driusan Dec 9, 2020
14d475b
Fix file rename that was somehow lost in a rebase
driusan Dec 9, 2020
942a2b5
Remove invalid token
driusan Dec 9, 2020
acd47af
Fix badly rebased DictionaryItem
driusan Mar 17, 2021
eef9559
More bad rebasing
driusan Mar 17, 2021
d4d2c57
Change Created response code to No Content.
driusan Mar 17, 2021
7e98577
Fix typo
driusan Mar 17, 2021
94d91fe
More duplication from bad rebasing
driusan Mar 17, 2021
208fec2
phpcs
driusan Mar 17, 2021
8453e3e
More phpcs
driusan Mar 17, 2021
1a2a392
Remove duplicate imports
driusan Mar 17, 2021
4c749c7
Remove duplicate function
driusan Mar 19, 2021
445d75c
More phan and restore linst from main branch
driusan Mar 19, 2021
d91f7e4
more missing props
driusan Mar 19, 2021
0f91778
More phan and restore linst from main branch
driusan Mar 19, 2021
0bccd5d
Fix remaining phan problems
driusan Mar 19, 2021
9981e05
fix phan after rebase
driusan Mar 25, 2021
97bd572
Send appropriate request when not a GET
driusan Mar 25, 2021
16f389b
Spelling mistakes in comments
driusan Mar 31, 2021
58cb857
Check for resp.ok
driusan Mar 31, 2021
312c1ed
Add SQL patch
driusan Mar 31, 2021
eaf2f4e
Fixes from rebase
driusan Apr 12, 2021
35294f0
Restore unnecessary changes from main
driusan Apr 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions SQL/0000-00-01-Modules.sql
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ INSERT INTO modules (Name, Active) VALUES ('data_release', 'Y');
INSERT INTO modules (Name, Active) VALUES ('datadict', 'Y');
INSERT INTO modules (Name, Active) VALUES ('dataquery', 'Y');
INSERT INTO modules (Name, Active) VALUES ('dicom_archive', 'Y');
INSERT INTO modules (Name, Active) VALUES ('dictionary', 'Y');
INSERT INTO modules (Name, Active) VALUES ('document_repository', 'Y');
INSERT INTO modules (Name, Active) VALUES ('examiner', 'Y');
INSERT INTO modules (Name, Active) VALUES ('genomic_browser', 'Y');
Expand Down
1 change: 1 addition & 0 deletions SQL/New_patches/2021-03-31-NewDictionaryModule.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
INSERT INTO modules (Name, Active) VALUES ('dictionary', 'Y');
1 change: 1 addition & 0 deletions modules/dictionary/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
js/*
53 changes: 53 additions & 0 deletions modules/dictionary/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Data Dictionary

## Purpose

The dictionary module is used for viewing and modifying the
LORIS data dictionary for installed and active modules.

## Scope

The module displays and manages the data dictionary for modules
which provide a dictionary, and allows users to override the
descriptions provided.

It does not provide a way to enter new fields into the data dictionary,
doing so requires updating or creating a new module which provides
a dictionary.

## Permission

The `data_dict_view` permission allows the user to view the LORIS
data dictionary.

The `data_dict_edit` permission allows the user to both view, and
modify the description of, rows in the data dictionary.

## Configuration

None

## Notes

The field names should be unique (see interactions below).

Instruments must implement the getDataDictionary method. The
`LorisFormDictionaryImpl` trait can be used to implement the
dictionary in the same way that the `data_dictionary_builder`
script populates the `parameter_type` table for the `data_dict`
module. However, this is done on a heuristic best-effort basis.
Data can be described more accurately described by implementing
the function manually.

## Interactions with LORIS

The `dictionary` module uses the same override descriptions as
the `data_dict` module so that users do not need to modify the
description twice as the dictionary is migrated to being managed
by modules. This means that the name of fields should be unique
across LORIS until the `data_dict` module is retired.

Modules such as the data query module may use this module as
an API to get a list of fields to be displayed and determine
their scope, cardinality, and (possibly overriddens) description for
context sensitive display purposes.
17 changes: 17 additions & 0 deletions modules/dictionary/help/dictionary.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Data Dictionary

This module houses definitions or descriptions for the data fields in LORIS.

Use the *Selection Filter* section to search for specific fields. Your results will be displayed in the data table below.

Click on the pencil icon to override the *Description* of a field - this should be done with caution. When a field description is modified, the new description is used in the Data Query Tool (after it is refreshed), by users who are selecting data fields to analyze or download. The modified field description will not be visible in the instrument form into which a user or survey participant enters data.

The *Data Scope* column represents the scope that the dictionary item corresponds to and can be
either "candidate" or "session".

The *Data Cardinality* describes how many items of the dictionary type may exist per scope.
It may be one of:
- **Unique** -- there is a single value across all entities of the scope (ie. an unique candidate identifier for a candidate or a visit label for a session)
- **Single** -- There is exactly one value per entity of the scope
- **Optional** -- There may be one or zero values per entity of the scope
- **Many** -- There may be zero or more values associated with entities of the scope
Loading