REdcaP LogIC And Test gEnerator: Code to parse REDCap Logic expressions, either calculations or logic, and generate an Abstract Syntax Tree (AST). This AST can then be pushed into a parser that will generate a series of tests, in human-readable form, that can be used when undertaking validation.
- PHP 7.1 and above
- REDCap 8.8.2 as a minimum
- Composer
- phpunit
This code is intended to be utilised as a library. You can install in one of two ways:
If composer is not installed, please install as per the instructions at https://getcomposer.org/
composer require dappelbe/replicateIf you are not using composer, clone this repository (as this will make it easier to keep up to date) into the directory where you are developing your code.
git clone https://github.com/dappelbe/replicateYou will then need to download the package mossadal/math-parser
Before using this library you should run the included unit tests to confirm that everything has been installed ok.
use \NDORMS\REDCap\REDCapLexer;
$lexer = new REDCapLexer();Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change. Please make sure to update tests as appropriate. If you'd like to contribute, please fork the repository and make changes as you'd like. Pull requests are warmly welcome.
Steps to contribute:
- Fork this repository (link to your repository)
- Create your feature branch (git checkout -b feature/fooBar)
- Commit your changes (git commit -am 'Add some fooBar')
- Push to the branch (git push origin feature/fooBar)
- Create a new Pull Request
Library created by Duncan Appelbe ([email protected])
Inspiration for this library has come from Frank Wikström's math-parser package - Kudos!
This project is licensed under the MIT License - see LICENSE for details.
University of Oxford © Duncan Appelbe