Send Rx is a REDCap module that allows users to automatically generate prescriptions on PDF format and send them to the pharmacies.
- REDCap >= 8.0.3
- Composer
- REDCap User Profile
- DAG Switcher (Note: this module has long since been rolled into REDCap Core. It is probably neither required nor available.)
- Clone this repo into to an
<redcap-root>/modules/send_rx_v<version_number>
. - Go to Control Center > External Modules and enable Send Rx.
- Automated installation of Composer dependencies (required)
send_rx assumes composer dependencies have been installers in
<redcap-root>/vendor
. The redcap_deployment packaging tools do this by default. We recommend you use them--at least once--to assure that composer-installed libraries are installed in the correct location. - Manual installation of Composer dependencies (optional)
- In a terminal, go to your REDCap root directory
- Download Composer
- Run
php composer.phar install
The steps below will walk you through a study research use case.
Send Rx requires user authentication method to work, so if your REDCap does not have it, you may need to follow the steps below:
- Go to Control Manager > Add Users (Table-based Only)
- Add a new user that will be the new admin account (since
site_admin
will become deprecated) - Go to Control Manager > Administrators & Acct Managers and add the new user to the administrators list
- Go to Control Manager > Security & Authentication, select an authentication method of your choice (e.g. Table-based), and save
- Check your email inbox and look for a "REDCap access granted" email
- Open the email contents, and click on "Set your new REDCap password" link
- Set your password
- Go to Control Manager > Administrators & Acct Managers and remove deprecated
site_admin
from administrators list
- Access + New Project page, then import
samples/UserProfiles.xml
file. - If User Profile module is not enabled yet, you may do that by accessing Control Center > External Modules.
- Then on Control Center > External Modules, configure the module as follows:
- Project: User Profiles (or any name you might have given to the project)
- Username field:
send_rx_user_id
- Make sure you are logged in as the admin user created on step 1 (not
site_admin
) - Access + New Project page, then import
samples/SendRxSites.xml
file. - Go to External Modules section and enable User Profile module for this project. No configuration at the project level is necessary.
- Go to External Modules section and enable Send Rx module for this project
- Then on External Modules page, click on Send Rx Configure button and set fields as follows:
- Type: Site
- Target Project: (Leave it blank for now, you are going to set it on step 4.7)
- PDF Template Name: (upload
SamplePDFTemplate.html
) file - PDF Template Variables:
- Key: "study_irb", Value: "2017-1234"
- Key: "study_name", Value: "Sample Study"
- Message subject: "Test prescription"
- Message body: "The prescription file is available at: [patient][send_rx_pdf]"
- Make sure you are logged in as the admin user created on step 1 (not
site_admin
) - Access + New Project page, then import
samples/SendRxPatients.xml
file. - Create a data access group named "ESU". Note its DAG ID.
- Go to External Modules section and enable Send Rx module for this project
- Then on External Modules page, click on Configure Button and set fields as follows:
- Type: Patient
- Target Project: the Sites project defined on section 3
- Go to User Rights section and create two roles:
prescriber
andstudy_coordinator
- Add a user to the study_coordinator role and assign them to the ESU DAG.
- Switch to Sites project, then access External Modules and click on Send Rx Configure button
- Set Target Project as the project you just imported.
- On site project, go to Add / Edit records and then click on Add new record.
- On Site Information form, set the site name to ESU, set the DAG ID to that one for ESU on the Patients project, set
Email
as delivery type, set the email address you want to use in your test, and finally save - making sure sure your form is set as Complete. - On Site Staff step, select Create a new user account from scratch, fill out user information, make sure your form is set as Complete, then click on Save & Go To Next Instance
- Repeat the step above a few times - making sure to add at least one prescriber and one study coordinator - then click on Save & Exit
- Go to Record Status Dashboard where you should be able to see two buttons: Rebuild staff permissions and Revoke staff permissions (if both buttons are disabled, make sure all forms previously filled are set as Complete, i.e. they appear as green bullets)
- Click on Rebuild staff permissions to grant permissions to your staff
- You may need to navigate to the Patients project and assign your coordinator and prescriber user(s) to the proper DAG
- Make sure that the "Data Access Group (DAG) ID" of the Site project's "Site Information" form contains the Group ID number of the prescriber user in the Patients Project's DAG page.
- Log in as prescriber
- On patient project, go to Add / Edit records and then click on Add new record
- Fill out all forms until the last one - Review & Send Rx - then click on Send and Stay
- At Messages History block you should now see the notification contents you just sent
- Check your email inbox
The presented example can be fully adapted to your needs. You may freely create your own PDF template, change the email contents configuration, and override all forms/instruments (as soon as the fields containing send_rx_
prefix remain untouched). All form fields you update/create will available to be used as wildcards on PDF and email (e.g. [patient][first_name]
, [site][send_rx_name]
, [prescriber][first_name]
, etc).