Configuration
=============

After the installation has been completed the software is ready for configuration.

Step 1: Run software initialization
-----------------------------------

First navigate to the project bin (C:\Program Files (x86)\BJS CCHR\bin) and then issue the following command

>>> python init.py

You will be prompted to select a past project to use as the default business rules:

>>> Please select a previous project to use as the default business rules (project specific metadata and coding rules)
>>> 1: Federal Probationers
>>> 2: Juvenile Offenders
>>> 3: Prisoners Released in 2005
>>> 0: Exit

Enter the number that corresponds to the project business rules you want to use as the default rules.
 
  .. Note: As of 10/2013 the Juvenile Offender rules reflect the most recent NLETS parsing logic
  
  		   This list is based on the projects that are in the business_rules folder (default location is C:\Program Files (x86)\BJS CCHR\business_rules). 
		   If you want to use a different project place the business rules for that project in the business_rules folder.

Next you will be prompted with:

>>> Please enter the directory where project data will be stored
>>> >>>

The project data directory will contain one project folder to store the configuratio, rules, input, output, and log files for each project. 
Please see _directory structure for more details on the project folder.

  .. Note: Make sure that the user running the program has read/write access to the directory entered in this step.
  
Next you will be prompted with:

>>> Please enter the database host (default=localhost)
>>> >>>
 
>>> Please enter the database port (default=3306)
>>> >>>

This is the host address and port for the MySQL Community Server. 
If MySQL Community Server was installed with default installation setting on the same server as the Conversion Software 
then simply press "enter"  to these prompts to accept the default setting of localhost and 3306.

At this point the program will copy the desired project business logic and setup the default config file for the system.

Step 2: Create a new project
============================

After the software has been initialized it is time create your first project with the following command:

>>> python cchrrd.py new_project

You will be prompted to enter a project name and your username/password for the MySQL database you specified in the project initialization stage above.
After entering the project name you will be asked to provide the number of years for the follow-up window (number of years after a prisoners date of release that statistics will be gathered for 
a given prisoner.) 

>>> Please enter your username: 
>>> >>> demo_account
>>> Please enter your password: 
>>> >>> ********
>>> Please enter the name of the project
>>> >>> demo
>>> Please enter the number of years for the follow-up window
>>> >>> 5

Step 3: Update Project Metadata
===============================

Depending on the format of the NLETS/Pragmatica intermediate parsed file it may be necessary to update the project metadata. Additionally,
all new variables or codeframe updates require project metadata manipulation. To allow for simple modification of the project metadata,
all metadata json files have been transformed into excel file format.

The project metadata files can be found here: (C:\Program Files (x86)\BJS CCHR\project_data\demo\metadata). 
