PFAnalyse is a command-line tool for analysing PROformajs protocols.
With Nodejs (tested with v4+) and Git installed you can first clone the repository, install the dependencies and then link the package.
you@yourmachine:~$ git clone https://gitlab.com/openclinical/pfanalyse.git you@yourmachine:~$ cd pfanalyse you@yourmachine:~$ npm install you@yourmachine:~$ npm link you@yourmachine:~$ pfanalyse Usage: pfanalyse [options] <guideline_url> [decision_path] [data_url] A command line tool to analyse proformajs decisions Options: -V, --version output the version number -d, --debug Show debug information -h, --help output usage information
PFAnalyse performs the following steps:
- loads the guildeline
- grabs the decision, analyses it to find it's dependent data datadefinitions
- loads the csv file
- checks the csv file to make sure that the first columns match the set of data definitions and the subsequent columns match the set of decision candidates
- loads the data from each row from the csv through the extracted single decision model to see if the recommendation matches the suggested recommendation
- returns a csv that has the following shape:
loaded matched flu cold other true false NN YN NY true true YY NN NN
Where the first "Y" or "N" indicates the value passed in the data file and the second "Y" or "N" indicates whether the candidate is recommended by the decision model.
Note that if the csv file is ommitted, the tool performs steps 1 and 2 above and then outputs the headers for the csv it expects to injest.
Try the following examples:
pfanalyse file://./etc/cold_or_flu.json pfanalyse file://./etc/cold_or_flu.json cold_or_flu:diagnosis pfanalyse file://./etc/cold_or_flu.json cold_or_flu:diagnosis file://./etc/cold_or_flu.tsv pfanalyse file://./etc/cold_or_flu.json cold_or_flu:diagnosis file://./etc/cold_or_flu-noparse.tsv pfanalyse file://./etc/dyndef.json exporttest:decision file://./etc/dyndef.tsv