https://github.com/ctsit/organizations_demo
A demonstration of REDCap Entity, a library the simplifies REDCap module development by managing novel data types. This module creates an organization data type.
https://github.com/ctsit/organizations_demo
redcap redcap-entity redcap-external-module
Last synced: 9 months ago
JSON representation
A demonstration of REDCap Entity, a library the simplifies REDCap module development by managing novel data types. This module creates an organization data type.
- Host: GitHub
- URL: https://github.com/ctsit/organizations_demo
- Owner: ctsit
- License: other
- Created: 2019-08-30T19:57:44.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-01T16:10:45.000Z (almost 7 years ago)
- Last Synced: 2025-02-27T20:33:05.226Z (over 1 year ago)
- Topics: redcap, redcap-entity, redcap-external-module
- Language: PHP
- Size: 846 KB
- Stars: 0
- Watchers: 7
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Organizations REDCap Module
The module is a demonstration of REDCap Entity, a library the simplifies REDCap module development by managing novel data types. This module creates an organization data type.
## Prerequisites
- REDCap >= 8.7.0
- redcap_entity >= 2.2.0
- Install and configure [REDCap Entity](https://github.com/ctsit/redcap_entity) according to its instructions.
- Clone this repo into to `/modules/organizations_`.
- Go to **Control Center > Manage External Modules** and enable _Organizations_.
## Using this project
This module exists to show the code required to manage a data type with REDCap Entity. When enabled, it automatically creates the MySQL table `redcap_entity_organizations` and adds a link labeled "Organizations" in the _Control Center_. When clicked, that link shows this interface

If you click the "+ Organization" button you can manually enter new organization data. It enforces the rule that the level must be a number, but otherwise this particular form has no rules.

If you enter some new organizational records, the "Organizations" interface will look something like this:

You can use the interface presented by REDCap Entity to filter and sort the data. The pager allows you to move through very large datasets. If you load the sample dataset, you can see the performance is still very good even with a 5000-record dataset.
### Sample dataset
This repository includes a sample dataset of university organizations at [`sample_data/redcap_organizations_data.csv`](sample_data/redcap_organizations_data.csv)
This CSV matches the structure of the table REDCap Entity creates for this project. Use your favorite MySQL client to import the data into the table `redcap_entity_organizations`.
At CTS-IT, we load the data via the MySQL client of our test VMs like this:
```
echo "load data local infile 'sample_data/redcap_organizations_data.csv' into table redcap_entity_org FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' IGNORE 1 ROWS" | mysql
```