FreeHealth EHR is written in C++/Qt5. In order to build one of the applications, you need to install and configure the Qt libraries.
FreeHealth requires Qt 5.7 or higher.
FreeHealth applications consist of a very small executable and various libraries and plugins. When the application starts, the executable is loaded, along with some libraries. The plugin manager then loads all needed plugins and executes them. The basic structure of FreeHealth EHR and its plugins system are derived from the code of Qt Creator.
Build workflow is similar for each supported OS, but there are slight differences and subtleties for each OS. This page concentrates on GNU/Linux. Read this page first. Then, have a look at these other pages with specific instructions and tips for other operating systems:
We use Git as version control system, and GitHub for code hosting.
Latest source package release is available on the download page. You must build from source package to make usable binaries. You can also create a source package yourself with script/source.sh
All code is compatible with the latest Qt 5.8 release.
find . -type f -name Makefile -exec rm -vrf {} \;
find . -type f -name .qmake.cache -exec rm -vrf {} \;
rm -vrf ./build
rm -vrf ./bin
We strongly suggest that you use the packages from you GNU/Linux distribution to build FreeHealth EHR.
FreeHealth devs are developing and building on Debian 9 Stretch (Stable) with Qt version 5.7.1 packages.
Tell your system to use Qt5 version of qmake (qt5-qmake) as the default:
sudo apt-get install qt5-default
In any case, use Qt version 5.7 or higher. Here is a list of Debian GNU/Linux packages required for compilation This should work on Debian 9, Debian 10, Ubuntu 17.04, Ubuntu 17.10 and other derivatives of Debian, make sure they ship with a Qt version superior or equal to 5.7
#Debian 9 Stable or higher & Ubuntu 16.04 or higher sudo apt-get install build-essential libgl1-mesa-dev libxext-dev libxext6 qttools5-dev libqt5svg5 libqt5svg5-dev qtscript5-dev qt5-qmake zlib1g-dev qtxmlpatterns5-dev-tools
CONFIG+=dontbuildquazip
to the qmake command line or by editing the buildspecs/optionalfeatures.pri file.
To avoid building unit tests, add “WITH_TESTS=0” to your qmake command
qmake ... "WITH_TESTS=0" ...
You can choose between two methods:
qmake ... "CONFIG+=with-agenda" ...
qmake ... "CONFIG+=with-alerts" ...
qmake ... "CONFIG+=with-feedback" ...
qmake ... "CONFIG+=with-pmh" ...
qmake ... "CONFIG+=with-webcam" ...
sudo apt-get install libqt5sql5-mysql libqt5sql5-sqlite
# get help ./build.sh -h # On Linux, you can use the GUI (you need to have zenity installed on your system) ./build.sh
lupdate -version
cd global_resources/translations lrelease *.ts
or use our lrelease_all.sh script.
qmake is a utility that automates the generation of Makefiles.
You can use make in multiple thread (make -j X).
make -j4
cd freehealth qmake freehealth.pro -r "CONFIG+=debug debug_without_install" make cd bin/freehealth # start the app ./freehealth_debug
# EHR sample # 1. Building a Linux package into a fake root system cd freehealth qmake freehealth.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=%build__path/usr/" make make install # 2. Fresh compilation and install without aiming to create a package cd freehealth qmake freehealth.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=/usr/" make make install # FreeRx (formerly known as FreeDiams) # 1. Building a Linux package into a fake root system cd freediams qmake freediams.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=%build__path/usr/" make make install # 2. Fresh compilation and install without aiming to create a package cd freediams qmake freediams.pro -r -config release "CONFIG+=LINUX_INTEGRATED" "INSTALL_ROOT_PATH=/usr/" make make install
cd scripts # Replace 0x75D4AE85B9520933 with your actual GPG key ID ./source.sh -k 0x75D4AE85B9520933 # find output cd ../source_package ls
We use Git as our VCS.
First tell git who you are - you are advised to use your real name and a valid email addresse, no nicknames please.
git config --global user.name "James T. Kirk" git config --global user.email "kirk@enterprise.com"
Now git clone the code from GitHub
git clone https://github.com/FreeHealth/freehealth.git
If you want to contribute some code, register on GitHub, fork the repository and send us a pull request.
We recommend to install our pre-defined git-hooks to simplify your work when pushing to our server. They run some code quality tests at each commit and automatically correct small issues (remove whitespace at the end of lines etc.):
cd /home/kirk/freehealth/.git/hooks ln -s ../../githooks/*
You are more than welcome to contribute code to the project! You can sign up on GitHub.com , fork our repository, modify the code and make a pull request. If you want to become a regular contributor to the project, please read Contribute and introduce yourself on the dev mailing list.