- 1 Requirements
- 2 Installing GNU Health on GNU/Linux
- 3 Booting up the Tryton Server
- 4 Logging into the application
- 5 Installing the default modules
- 6 Installing Extra Modules
The latest stable GNU Health has the following requirements:
- Operating System: GNU Health is Operating System independent, although we highly recommend the use of a Free OS (such as GNU/Linux or FreeBSD)
- Database: PostgreSQL
- Python: >= 2.6 < 3.0
- Tryton: = 3.0
- libldap2-dev, libsasl2-dev (.deb packages)
Installing GNU Health on GNU/Linux
||Install requirements and dependencies.
Make sure you completed the Operating System-Specific Notes Section
Please keep in mind that for the following instructions to work smoothly, you should ideally install GNU Health on a fresh installation of the respective GNU Linux operating system.
It is essential that you have not made any changes to the default PostgreSQL installation.
Creating the Operating System User
It is highly recommended that you use a dedicated user for your GNU Health Installation. The following steps will create the GNU Health operating system user:
Note : If your Operating System does NOT include the adduser command, you can use the useradd command
useradd -m gnuhealth
Creating the Database user
The following command switches to the postgres administration user and gives permissions to your newly created gnuhealth administrator:
Execute, as root :
su - postgres -c "createuser --createdb --no-createrole --no-superuser gnuhealth"
Downloading and Installing GNU Health
Running the GNU Health Installer
Do the installation with your newly created gnuhealth user, DO NOT use root
The main steps are:
1. Become user gnuhealth
su - gnuhealth
2. Download GNU Health from GNU.org . You can get the latest version from http://ftp.gnu.org/gnu/health/gnuhealth-latest.tar.gz:
3. Uncompress the file
tar xzf gnuhealth-latest.tar.gz cd gnuhealth-*
4. Run the gnuhealth_install.sh script
Finally, enable the BASH envrironment for the gnuhealth user.
Setting Up your Server Timezone
Edit the server configuration file and enter your server timezone. Since 2.2.1 the alias editconf opens the configuration file with your favorite editor.
For instance, if you live in the Canary Islands, your timezone will be Atlantic/Canary . The line would be :
timezone = Atlantic/Canary
Similarly, if your server is in Buenos Aires, you would put timezone = America/Argentina/Buenos_Aires
If you want to set your server timezone to UTC, it would be timezone = UTC
Note that there are no quotes around the timezone !
Activate network devices for the JSON-RPC protocol
The Tryton GNU Health server listens to localhost at port 8000, not allowing direct connections from other workstations.
You can change the line with the parameter jsonrpc, to activate the network device so workstations in your net can connect. For example, the following line
jsonrpc = *:8000
Will allow to connect to the server in the different devices of your system.
Setting up a local directory for attachments
By default, Tryton uses a system-wide directory to store the attachments. In GNU Health is advisable to keep the attachments in the gnuhealth user space. With a text editor, open the server configuration file trytond.conf and enter the attach directory, for instance :
data_path = /home/gnuhealth/attach
Booting up the Tryton Server
Change to your newly installed System ( use the alias cdexe since 2.2.1 )
and boot the server
You should see something like this. Pay attention at the last line INFO:server:starting JSON-RPC protocol on localhost:8000
[Sat Oct 29 21:03:48 2011] INFO:server:using default configuration [Sat Oct 29 21:03:48 2011] INFO:server:initialising distributed objects services [Sat Oct 29 21:03:48 2011] INFO:server:starting JSON-RPC protocol on localhost:8000
Installation of the Tryton Client
If you are in a Windows operating system, download the latest Tryton client compatible with GNU Health from here.
If you are in a GNU/Linux or other UNIX-like Operating system, you can download the latest Tryton compatible with GNU Health with the PIP command.
Please do NOT install the client with the gnuhealth user. The gnuhealth user should be responsible only to running the server
pip install --user "tryton"
This command will install the tryton client under the $HOME/.local/bin directory .
Upgrading the Tryton client
If you have an older Tryton client (installed with PIP), you can upgrade it to the latest version with the following command :
pip install --upgrade --user tryton
The following command will boot your tryton client
cd $HOME/.local/bin ./tryton
Setting the Tryton client Tabs position for GNU Health
Before you start the installation of the database, you need to set the Tabs position to be on "Top". This will produce the optimal navigation.
The following action in the Tryton client will set it: Options -> Form -> Tabs Position -> Top
Finally, save your client preferences Options -> Save Options
You can also change the default value to "top" on the Tryton client configuration file, that resides in your $HOME directory, ($HOME/.config/tryton/x.y/tryton.conf). So for a Tryton version 2.8, you can check the value of your tab positions by doing:
cd $HOME/.config/tryton/2.8 grep form_tab tryton.conf
It should give back form_tab = top. If it has another value, please change it to "top".
Creating the GNU Health database
The first step is to create a database that will hold all the information for your GNU Health system.
All GNU Health information is stored in a PostgreSQL database, and processed by the Tryton kernel. No action is needed at the operating system level to create or manage the database, as all can be done via the Tryton / GNU Health frontend.
To create a Database, open your Tryton client. You will be presented with the following Login popup window:
Click on Manage profiles, then click on Add. Give your new connection a name on the left side, and fill the fields on the right side. If you're doing the installation on the same machine, choose localhost as the hostname. Example:
Click on the Create button, the following popup appears:
The default Tryton Server Password is admin (you can change it later). Give your database a name, and enter a new admin password twice. Note: this will be the password of the super-user for your new database, so use a strong password when dealing with production servers.
Check in the server log (or console) if any error occurs. If so, try to fix the problem (ie. any Python module missing or some unmet dependencies), drop the database just created and repeat the procedure.
After the database is created, click OK. You're now ready to log in!
Logging into the application
Now that you're back at the login screen, you'll notice that the selected Profile is the one you've just created. Fill in the login form:
- User name: The one you used previously usually, admin
- Password: the one entered twice in the previous section
Installing the default modules
From this point on, you will use the client for almost every process. Start with the installation of the basic functionality:
- After you've created the database, the system will ask you to create some new users. You can skip this step for now.
- You are then presented with a list of modules that will provide the functionality you desire. If you don't see the Modules window, navigate to it on the right side: Administration > Modules > Modules.
- Select the health_profile module, and click on Mark for installation:
- Click on the Action icon (a blue rotated square) and select Perform Pending Installation/Upgrade:
- Tryton will automatically select all the dependent modules required for the installation:
- Click on Start Upgrade. This process will take a while, depending on the computer where GNU Health is being installed on. Once it's done, the following message appears:
Congratulations, you've successfully installed GNU Health!
Installing Extra Modules
GNU Health is constantly evolving. The default modules are just a subset of the modules available and provide basic functionality. Depending on your Health center, you will most likely want to install some of the other modules that come with GNU Health. Some of the modules that are ready to install are:
- health_history: Generates the patient clinical history reports.
- health_reporting: Statistics on different indicators (diseases, doctor assignments, .. ). It also creates different charts
- health_services: Registers all the services done to a patient, in an ambulatory or inpatient scenario. It will also generate invoices on selected services.
- health_qrcodes: Permits identifying the patient and the newborns with 2-dimensional Quick-Recognition codes.
There are many more. Just check on the module list and select those that fit best your health center.
Congratulations ! You have completed the initial installation of GNU Health.
The next chapters will guide you through the customization of GNU Health to meet your health center needs.