项目作者: OCTRI

项目描述 :
A REDCap external module for generating consort reports.
高级语言: JavaScript
项目地址: git://github.com/OCTRI/redcap-report-counts.git
创建时间: 2018-08-31T20:52:57Z
项目社区:https://github.com/OCTRI/redcap-report-counts

开源协议:BSD 2-Clause "Simplified" License

下载


REDCap Report Counts External Module

A REDCap external module for generating report counts.

Install Dependencies

  1. npm install

Run Unit Tests

JavaScript tests,

  1. npm test

PHP tests

  1. composer test

Build Application

Compilation is output into the dist directory.

  1. npm run build

Start Application for Local Development

To continuously build the application as you develop, run,

  1. npm run start

Install the module

Module directory format

External modules live in the modules directory under the REDCap root directory. After building the project copy the dist directory there and rename it as follows,

  1. redcap/modules/report_counts_vx.y.z

where report_counts is the module prefix, and x.y.z is the version.

Running under Docker

If you are running REDCap under Docker, you may want to bind mount the dist directory. For example,

  1. volumes:
  2. - /path/to/report-counts/dist:/var/www/html/redcap/modules/report_counts_v0.0.0

Now changes are published instantly when running npm run start.

Module URLs

In code, you may generate a page URL using the following syntax where $module is provided automatically. This will produce the index URL above.

  1. $indexUrl = $module->getUrl('index');

The URL will look something like the following,

http://localhost/redcap/external_modules/?prefix=report_counts&id=5&page=index&pid=782

with these parameters: prefix, id, page, and pid.

prefix is the module prefix as described previously.

id is the module id and is appended automatically when using the module functions, such as getUrl().

page corresponds to the PHP file. For example, page=index will pull up index.php. Including the .php extension is optional.

pid is the project id.

Enabling the module

Once your module directory is in place we need to tell REDCap about it.

  1. Navigate to Control Center > External Modules.
  2. Click Enable a module.
  3. You should see report counts with a version drop-down. Select the version you want to enable and click Enable.
  4. Next go to your project and on the left navigation bar click External Modules.
  5. Click Enable a module and find the report counts module.
  6. Click Enable to enable for your project.

Now you should see a link under the “External Modules” section on the left navigation bar.