Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Starting with CI #492

Merged
merged 2 commits into from Feb 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions .travis.yml
@@ -0,0 +1,10 @@
language: php
php:
- '5.4'
- '5.5'
- '5.6'
- '7.0'
- '7.1'

script:
- bash ci/lint.sh --dir ./
32 changes: 18 additions & 14 deletions README.md
@@ -1,14 +1,18 @@
Welcome to [OpenEMR](http://www.open-emr.org/)!!!
=====================

[OpenEMR](http://www.open-emr.org/) is a Free and Open Source electronic health records and
medical practice management application. It is ONC Complete
Ambulatory EHR Certified and it features fully integrated electronic
health records, practice management, scheduling, electronic billing,
internationalization, free support, a vibrant community, and a
[whole lot more](http://www.open-emr.org/wiki/index.php/OpenEMR_Features). It can run on Windows, Linux, Mac OS X, and many
other platforms.

The setup documentation can be found in the INSTALL file and extensive
documentation and forums can be found on the OpenEMR website at:
<http://www.open-emr.org>
![img](https://travis-ci.org/MatthewVita/openemr.svg?branch=ci)

# OpenEMR

[OpenEMR](http://open-emr.org) is the most popular open source electronic health records and medical practice management solution. [ONC certified](http://open-emr.org/wiki/index.php/OpenEMR_Wiki_Home_Page#ONC_Ambulatory_EHR_Certification) with international usage, OpenEMR's goal is a superior alternative to its proprietary counterparts.

### Contributing
OpenEMR is a leader in healthcare open source software. Costly proprietary EMRs are no longer the only option. [Learn how to start contributing today!](http://open-emr.org/wiki/index.php/FAQ#How_do_I_begin_to_volunteer_for_the_OpenEMR_project.3F)

### Support

Community and Professional support can be found [here](http://open-emr.org/wiki/index.php/OpenEMR_Support_Guide).

Extensive documentation and forums can be found on the [OpenEMR website](http://open-emr.org).

### License

[GNU GPL](LICENSE)
25 changes: 25 additions & 0 deletions ci/lint.sh
@@ -0,0 +1,25 @@
#!/bin/bash

if [ -z "$1" ] || [ "$1" == "-h" ] || [ "$1" == "--help" ] ; then
printf "OpenEMR Parallel Linter\n\n"
printf " Arguments\n"
printf " -h, --help | Information on using this script\n"
printf " -d, --dir | The codebase directory for OpenEMR\n"
exit 0
fi

if [ "$1" == "-d" ] || [ "$1" == "--dir" ] ; then
cd $2
find . -type d \( -path ./phpmyadmin \
-o -path ./vendor \
-o -path ./interface/main/calendar/modules \
-o -path ./interface/reports \
-o -path ./contrib/util \
-o -path ./library/openflashchart \
-o -path ./library/html2pdf/vendor/tecnickcom \
-o -path ./library/classes/fpdf \
-o -path ./library/html2pdf \
-o -path ./gacl \
-o -path ./library/edihistory \) -prune -o \
-name "*.php" -print0 | xargs -0 -n1 -P8 php -l
fi
3 changes: 2 additions & 1 deletion library/ajax/log_print_action_ajax.php
Expand Up @@ -26,7 +26,8 @@
require_once("../../interface/globals.php");
require_once("$srcdir/log.inc");

$h2t =& new html2text($_POST['comments']);
$instance = new html2text($_POST['comments']);
$h2t = &$instance;
$h2t->width = 0;
$h2t->_convert(false);

Expand Down
60 changes: 31 additions & 29 deletions patients/get_patient_documents.php
Expand Up @@ -3,41 +3,43 @@
* Download documents from OpenEMR to the patient portal in a zip file(get_patient_documents.php)
*
* This program is used to download patient documents in a zip file in the Patient Portal.
* The original author did not pursue this but I thought it would be a good addition to
* the patient portal
*
* Copyright (C) 2015 Terry Hill <terry@lillysystems.com>
* The original author did not pursue this but I thought it would be a good addition to
* the patient portal
*
* Copyright (C) 2015 Terry Hill <terry@lillysystems.com>
* Copyright (C) 2012 Giorgos Vasilakos <giorg.vasilakos@gmail.com>
*
* LICENSE: This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Terry Hill <terry@lilysystems.com>
* LICENSE: This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 3
* of the License, or (at your option) any later version.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
*
* @package OpenEMR
* @author Terry Hill <terry@lilysystems.com>
* @author Giorgos Vasilakos <giorg.vasilakos@gmail.com>
* @link http://www.open-emr.org
*
* @link http://www.open-emr.org
*
*/

require_once("verify_session.php");
include_once("$srcdir/documents.php");
require_once($GLOBALS['fileroot'] . "/controllers/C_Document.class.php");

// TODO: see if this can be removed (test in PHP 5 and 7)... throwing a warning
use C_Document;

// get the temporary folder
$tmp = $GLOBALS['temporary_files_dir'];
// get all the documents of the patient
$sql = "SELECT url, id, mimetype FROM `documents` WHERE `foreign_id` = ?";
$fres = sqlStatement($sql, array($pid));

// for every document
while ($file = sqlFetchArray($fres)) {
// find the document category
Expand All @@ -46,7 +48,7 @@
AND `categories_to_documents`.`document_id` = ?";
$catres = sqlStatement($sql, array($file['id']));
$cat = sqlFetchArray($catres);

// find the tree of the documents category
$sql = "SELECT name FROM categories WHERE lft < ? AND rght > ? ORDER BY lft ASC";
$pathres = sqlStatement($sql, array($cat['lft'], $cat['rght']));
Expand Down Expand Up @@ -88,19 +90,19 @@
echo xlt("Can't find file!")."<br />";
}
}

// zip the folder
Zip($tmp."/".$pid."/", $tmp."/".$pid.'.zip');

// serve it to the patient
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename="patient_documents.zip"');
readfile($tmp."/".$pid.'.zip');

// remove the temporary folders and files
recursive_remove_directory($tmp."/".$pid);
unlink($tmp."/".$pid.'.zip');

function recursive_remove_directory($directory, $empty=FALSE) {
if(substr($directory,-1) == '/') {
$directory = substr($directory,0,-1);
Expand Down Expand Up @@ -128,8 +130,8 @@ function recursive_remove_directory($directory, $empty=FALSE) {
}
return TRUE;
}


function Zip($source, $destination) {
if (!extension_loaded('zip') || !file_exists($source)) {
return false;
Expand Down