CastorDataBridge - Survey Inviter is a tool designed to streamline the process of sending out survey invitations using Castor EDC. This guide outlines the steps required to set up and use the tool effectively.
- Creating CSV Files
- Tag Usage
- API Credentials
- Email Body Format
- Output Files
- Developer Guide
- Getting Help
Create a CSV file (CSV-A
) containing participant details:
participant_id
email_address
- Additional tags for email body
Example: test_file.csv
in the examples
folder.
Create another CSV file (CSV-B
) with email header details:
- Subject
- Body
Example: header_file.csv
in the examples
folder.
Note: Both CSV files should be encoded as "UTF-8" or "ISO-8859-1".
The tool matches tags from the "Body" column in CSV-B
with headers in CSV-A
. It performs case-insensitive matching, replaces spaces with underscores, and searches for a corresponding name in CSV-B
.
Retrieve the Castor EDC API Client ID and Client Secret. The user obtaining these credentials must have “Participant Creation” rights in Castor EDC, which the tool needs to create new Participant IDs mentioned in CSV-A
.
Format your email body using "\n\n" for line breaks.
Example: header_file.csv
in the examples
folder.
After running the tool, you'll get two output files:
output/survey_package_invitations_[current_date].csv
: List of sent surveys.output/survey_invite_results_[current_date].csv
: Error logs, if any.
This application is formatted using the Black formatter. Please use this before submitting any code changes.
It's possible to create a standalone executable (application) with PyInstaller.
To create this standalone application all you need to do is run two commands.
The first command is needed to create a .spec
file. This can be seen as a configuration file.
Here's an example of how to create such a file with pyinstaller:
pyinstaller --onefile --add-data "help_icon.png;." api_call.py get_API_access_token.py get_site_list.py get_survey_list.py get_survey_package_list.py GUI_helper_functions.py GUI_module.py helper_functions.py log_handling.py send_survey_invite.py
This will create a .spec
file called api_call.spec
(because it's the first Python script mentioned in the commands above).
You can find an example .spec
file here.
When desired, one can adjust one of the .spec
file parameters.
If and once these parameters are adjusted, you can create the executable by running:
pyinstaller api_call.spec
This will create a new folder within your Python work environment called "dist".
You can run the application by simply executing the newly created .exe
file.
When executing the .spec
file with the pyinstaller
command, a new file with the .exe
extention will be created in the aforementioned folder.
- Branching
- When creating a new branch, please use the following convention:
<issue_number>_<description>_<author_name>
.
- When creating a new branch, please use the following convention:
- Pull Requests
- When creating a pull request, please use the following convention:
<type>: <description>
. Example types arefix:
,feat:
,build:
,chore:
,ci:
,docs:
,style:
,refactor:
,perf:
,test:
, and others based on the Angular convention.
- When creating a pull request, please use the following convention:
In the case an error occurs when using CastorDataBridge an error log is created. The Research Data Management team of Amsterdam UMC ([email protected]) may ask you to provide this log in helping to fix the error. Please find some actions/checks you can do yourself when unexpected behavior from the application occurs.