First Evaluations over and coding continues in LibreHealth EHR

Mua Laurent
3 min readJun 23, 2018

--

Weeks and weeks have passed since coding began. Generally, the fifth week covers the first evaluations. During this phase, mentors evaluate their students and vice versa. The latter was a successful one as i made it with a pass grade.

My mentors Priyanshu Sinha and Tony Mccormick continually encouraged me to get along with my project proposal. In my case i love UI and UX so i began by writing the base css of my project (setup.css). In this i make sure i carefully choose my colors and fonts which are the orange and Circle respectively. Color code of my orange theme is #F57C31. A screenshot of my project can be seen below.

Step 2 of the installation process for LibreEHR software (System/OS/Browser detection and detection of requirements for LibreEHR).

I made a PR and this can be found here. For LibreHealthEHR to run smoothly, it depends on some certain dependencies. These are capital cause without them, we wont be running an efficient EHR(Electronic Health Recording system). Some of these dependencies include PHP, (7.0.*) and extensions like php-curl ,php-json, php-soap etc. Another important dependency is MySQL , Apache2 and so on. My code focuses on providing an upgrade section during the installation process if your system doesnt meet the conditions necessary to efficiently run LibreHealthEHR this can be seen in the screen below ~ (linux OS- ubuntu 16.04 firefox)

This section is not an easy one cause it will require you handle the cases in which users are on different platforms (Operating Systems). That wasn’t so tough though. A writen php class UserInfo was implemented in the codebase and with this we can call methods such as getBrowser(), getOS() on a object of this class. A sample code looks like so

class UserInfo
{
.... .....public static function get_os() {

$user_agent = self::get_user_agent();
$os_platform = "Unknown OS Platform";
$os_array = array(
'/windows nt 10/i' => 'Windows 10',
'/windows nt 6.3/i' => 'Windows 8.1',
'/windows nt 6.2/i' => 'Windows 8',
'/windows nt 6.1/i' => 'Windows 7',
'/windows nt 6.0/i' => 'Windows Vista',
'/windows nt 5.2/i' => 'Windows Server 2003/XP x64',
'/windows nt 5.1/i' => 'Windows XP',
'/windows xp/i' => 'Windows XP',
'/windows nt 5.0/i' => 'Windows 2000',
'/windows me/i' => 'Windows ME',
'/win98/i' => 'Windows 98',
'/win95/i' => 'Windows 95',
'/win16/i' => 'Windows 3.11',
'/macintosh|mac os x/i' => 'Mac OS X',
'/mac_powerpc/i' => 'Mac OS 9',
'/linux/i' => 'Linux',
'/ubuntu/i' => 'Ubuntu',
'/iphone/i' => 'iPhone',
'/ipod/i' => 'iPod',
'/ipad/i' => 'iPad',
'/android/i' => 'Android',
'/blackberry/i' => 'BlackBerry',
'/webos/i' => 'Mobile'
);

foreach ($os_array as $regex => $value) {
if (preg_match($regex, $user_agent)) {
$os_platform = $value;
}
}
return $os_platform;
}
... .....
}

Now we can get the necessary information about the system as this

$userInfo =  new UserInfo();
//get system info
$sys = $userInfo::get_os();

With this, the program knows exactly what to do next cause the instructions are different for each operating system.

Whats Next in line

My next target is to write a bash script for linux/unix users. This script will help install dependencies necessary for the proper functioning of the LibreHealth EHR software. Stay tuned…

--

--