fixed headers of prior commit
[openemr.git] / library / ajax / offsite_portal_ajax.php
blobffb5f0be8a9f08a92d95a53451b1f2f8555f1edc
1 <?php
2 /**
3 * Ajax script to connect to offsite patient portal.
5 * Currently supports collecting the vpn connection package and
6 * can be expanded to support other features in the future.
8 * Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
10 * LICENSE: This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @package OpenEMR
22 * @author Eldho Chacko <eldho@zhservices.com>
23 * @author Vinish K <vinish@zhservices.com>
24 * @link http://www.open-emr.org
27 //SANITIZE ALL ESCAPES
28 $sanitize_all_escapes=true;
31 //STOP FAKE REGISTER GLOBALS
32 $fake_register_globals=false;
34 require_once(dirname(__FILE__)."/../../interface/globals.php");
35 require_once("$srcdir/acl.inc");
36 require_once(dirname(__FILE__)."/../../myportal/soap_service/portal_connectivity.php");
38 if($_POST['action'] == 'check_file' && acl_check('admin', 'super')){
39 $client = portal_connection();
40 $error_message = '';
41 try {
42 $response = $client->getPortalConnectionFiles($credentials);
44 catch(SoapFault $e){
45 error_log('SoapFault Error');
46 $error_message = xlt('Patient Portal connectivity issue');
48 catch(Exception $e){
49 error_log('Exception Error');
50 $error_message = xlt('Patient Portal connectivity issue');
52 if($response['status'] == 1){
53 if($response['value'] != '')
54 echo "OK";
55 else
56 echo $error_message;
58 else{
59 echo xlt('Offsite Portal web Service Failed').": ".text($response['value']);