Skip to content

LibreHealthIO/lh-ehr-laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LibreHealth EHR


Run Tests

LibreHealth EHR is a free and open-source electronic health records and medical practice management application.

The mission of LibreHealth is to help provide high quality medical care to all people, regardless of race, socioeconomic status, or geographic location, by providing medical practices and clinics across the globe access to free of charge medical software. That same software is designed to save clinics both time and money, which gives practitioners more time to spend with individual patients, thereby supplying patients with higher quality care.

We are current and former contributors to OpenEMR and thank that community for years of hard work. We intend to honor that legacy by allowing this new community to leverage the good things in OpenEMR, share what we create and not be afraid to break backward compatibility in the name of forward progress and modern development models.

We are collaborating closely with the LibreHealth Project, an umbrella organization for health IT projects with similar goals.

Table of Contents

  1. Tech-Stack
  2. Requirements
  3. Installation
  4. Usage
  5. Documentation
  6. Testing
  7. Contributing
  8. Security
  9. Credits
  10. License

Tech-Stack

Requirements

Make sure your server meets the following requirements.

  • Apache 2.2+ or nginx
  • MySQL Server 5.7.8+ , Mariadb 10.3.2+ or PostgreSQL
  • Composer installed 2.0+
  • PHP Version 8.0.x+
  • Redis 3.0+

PHP extensions

Make sure you have the following php extensions enabled

bz2, curl, date, dom, exif, gd, gettext, grpc,
imagick, intl, json, libxml, mbstring, mysqli, mysqlnd, openssl, pcntl, PDO,
pdo_mysql, posix, protobuf, redis, soap, sqlite3, xml, xmlreader, xmlwriter
xsl, zip, zlib

If you face issues while enabaling these extension, visit here

Installation

Install composer with the help of the instructions given here

$ wget https://getcomposer.org/composer.phar
$ chmod +x composer.phar
$ mv composer.phar /usr/local/bin/composer

Install Node.js/NPM with the help of the instructions given here

Linux/Unix yum install npm OR using MacOs brew install node

Fork and/or clone this project by running the following command

$ git clone https://github.com/LibreHealthIO/lh-ehr-laravel.git

Navigate into the project's directory

$ cd lh-ehr-laravel

Copy .env.example for .env and modify according to your credentials

cp .env.example .env

Run this command to install dependencies

composer install --prefer-dist

This command will install all dependencies needed by the LibreHealth EHR platform to run successfully!

Generate application key

php artisan key:generate

Install npm/yarn dependencies (Preference is using Yarn)

npm install or yarn install

This command will help migrate the database and populate the database!

php artisan migrate --seed

Or if for any reason, you wish to reset the database later, you can run

php artisan migrate:fresh --seed

Usage

Run yarn/npm in dev mode npm run dev OR yarn run dev

For live building of components while developing, you can run

npm run watch OR npm run watch-poll

Run the default laravel server

php artisan serve

To view LibreaHealth's EHR Platform, go to:

http://localhost:8000/

If you want to serve to another port for example (3000), Run the following

php artisan serve --host=<your_ip_address> --port=3000

Then view it on the browser by typing http://<your_ip_address>:3000

Login Credentials

By default, two(02) accounts are created with default roles - super_admin and admin which are all active.

  • Super Admin Account:

    • Username: s_admin
    • Email: s_admin@librehealthehr.com
    • Password: s_admin123
  • Admin Account (recommended):

    • Username: admin
    • Email: admin@librehealthehr.com
    • Password: admin123

Testing

Testing is very essential as this helps us to avoid bad practices and breaking code. To test the application, ensure to have the test env variables in the .env.testing file, if not create one using the cp .env.example .env.testing

TEST_DB_HOST=127.0.0.1
TEST_DB_DATABASE=lh_ehr_testing
TEST_DB_USERNAME=root
TEST_DB_PASSWORD=

Create a database for testing. Here, we will be using mysql for our db test since it supports column dropping etc, You can use pgsql, if you like by changing the default connection lh_ehr_testing driver pgsql in the config/database.php.

By default, the test connection is added to the phpunit.xml file. Feel free to edit this if needed to suit your custom database connection by changing the <env name="DB_CONNECTION" value="lh_ehr_testing"/> to <env name="DB_CONNECTION" value="custom_connection"/>

Create the test database (lh_ehr_test) and re-migrate your data and seed using the following command php artisan migrate --database=lh_ehr_testing php artisan db:seed --database=lh_ehr_testing

Or fresh install php artisan migrate:fresh --database=lh_ehr_testing --seed

Run the tests using:

$ composer test

Documentation

Official documentation is available Here.

Code Quality/Tools

We use Php CodeSniffer to ensure code quality and we all are using the same standards. This is enabled by default for this project and incorporated in the hooks when committing .git/hooks.

It is however advised to install this globally so as to manage a variety of projects

composer require global squizlabs/php_codesniffer

NB:

  • When you have modified or made changes to a file, ensure to run ./vendor/bin/phpcs to ensure all files are valid or fix them using ./vendor/bin/phpcbf.

Also you can use pre-commit hooks to point the git hooks to the .githooks by running git config core.hooksPath .githooks for validating upon committing.

Troubleshooting

Before opening an issue, please refer to the troubleshoot guide

Contributing

Please see contributing.md for details and a todolist.

Security

If you discover any security related issues, please email infrastructure@libreahealth.io instead of using the issue tracker.

Credits

License

LibreHealth EHR is primarily licensed under Mozilla Public License Version 2. The code inherited from OpenEMR is licensed under GPL 2 or higher. This project is a part of the Software Freedom Conservancy family.

Thank you for your support!