Welcome!

To run medax, you need the following:

1. Python 2.7+ installed in order to execute the scripts.
2. The environment of Minorthird used to identify the targeted dose attributes from text (the respective scripts used for the information extraction are included in the Scripts/ folder).


###########################INSTRUCTIONS#################################


1. create an empty folder for the prescription data.



2. have one file that contains all the prescription data in the following format:

	textid	text	daily_dose	dose_number	dose_unit	dose_frequency	dose_interval	choice_of_dose	dose_max_average	change_dose	dose_duration
	1	"TAKE ONE DAILY"	1	1	""	1	1	0	0	0	0
	2	"INHALE ONCE"		1	1	""	1	1	0	0	0	0	




3. Each prescription should be in a different file. You can do that from the drug_information_extraction.py script and the file in step 2. drug_information_extraction.py requires the following in this order: 
	a) the file from 2, 
	b) the stoplist.txt file 
	c) and a name for the files (I put pr so the name for each file would be pr.file_id.txt). 

Not only it creates separate files from the big prescription file, it also creates spaces between numbers and strings in case the prescriptions are written that way.





4. If you are using linux, you can run the program from the bash script -$ complete_project.sh. Make sure to go and read the comments inside this script at the top of the page. 

	a) Change the example.txt file (which is the input file that should contain your prescriptions to your file, it should be on a txt format)
	b) change as well the path of python (C:/cygdrive/c/Python27/python.exe) to the relative path that you have on your desktop or laptop (baseically where python in installed) 
	c) do the same for java. 


5. If you are using Windows, you run the program from the dos file -$ complete_script.bat %1 (path for the python exe) %2 (your input file with all the prescriptions) %3 (path for the java exe). Examples can be seen inthe comment section of the .bat file.




6. A csv file will produced in the parent folder (the one that contains the scripts and the minorthird jar file).






PS Please replace the name common_dosages.txt file in the complete_script.sh with the file of your choice - no need to do that in the complete_script.bat as it is considered an argument.
