3 * This file implements the main jquery interface for loading external
4 * database files into openEMR
6 * Copyright (C) 2012 Patient Healthcare Analytics, Inc.
7 * Copyright (C) 2011 Phyaura, LLC <info@phyaura.com>
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
21 * @author (Mac) Kevin McAloon <mcaloon@patienthealthcareanalytics.com>
22 * @author Rohit Kumar <pandit.rohit@netsity.com>
23 * @author Brady Miller <brady@sparmy.com>
24 * @link http://www.open-emr.org
28 //SANITIZE ALL ESCAPES
29 $sanitize_all_escapes=true;
32 //STOP FAKE REGISTER GLOBALS
33 $fake_register_globals=false;
36 require_once("../../interface/globals.php");
37 require_once("$srcdir/acl.inc");
39 // Ensure script doesn't time out and has enough memory
41 ini_set('memory_limit', '150M');
44 if (!acl_check('admin', 'super')) {
45 echo xlt('Not Authorized');
49 $activeAccordionSection = isset($_GET['aas']) ?
$_GET['aas'] : '0';
54 <link rel
='stylesheet' href
='<?php echo $css_header ?>' type
='text/css'/>
55 <link rel
='stylesheet' href
='../../library/css/jquery-ui-1.8.21.custom.css' type
='text/css'/>
58 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-7-2/index.js"></script
>
59 <script type
="text/javascript" src
="../../library/js/jquery-ui-1.8.21.custom.min.js"></script
>
62 // placemaker for when support DSMIV
63 // var db_list = [ "DSMIV", "ICD9", "ICD10", "RXNORM", "SNOMED"];
64 var db_list
= [ "ICD9", "ICD10", "RXNORM", "SNOMED", "CQM_VALUESET"];
69 //add change event callback
70 change
: function(e
, ui
) {
71 var parm
= 'db=' + $
(ui
.newContent
).attr('id');
72 var inst_dets_id
= '#' + $
(ui
.newContent
).attr('id') +
"_install_details";
73 var stg_dets_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stage_details";
74 var inst_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_inst_loading";
75 var stg_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stg_loading";
77 $
(inst_load_id
).show();
78 $
(stg_load_id
).show();
80 url
: 'list_installed.php',
83 success
: function(data
) {
84 $
(inst_dets_id
).html(data
);
88 url
: 'list_staged.php',
91 success
: function(data
) {
92 $
(stg_load_id
).hide();
93 $
(stg_dets_id
).html(data
);
94 $
("#" + $
(ui
.newContent
).attr('id') +
"_instrmsg").hover(
96 var dlg
= "#" + $
(ui
.newContent
).attr('id') +
"_dialog";
97 $
(dlg
).dialog('open');
98 $
(dlg
).load($
(ui
.newContent
).attr('id').toLowerCase() +
'_howto.php');
103 $
("#" + $
(ui
.newContent
).attr('id') +
"_unsupportedmsg").hover(
105 $
(this
).append('<div class="tooltip"><p><?php echo xla("OpenEMR does not recognize the incoming file in the contrib directory. This is most likely because you need to configure the release in the supported_external_dataloads table in the MySQL database."); ?></p></div>');
108 $
("div.tooltip").remove();
111 $
("#" + $
(ui
.newContent
).attr('id') +
"_dirmsg").hover(
113 $
(this
).append('<div class="tooltip"><p><?php echo xla("Please create the following directory before proceeding"); ?>' +
': contrib/' + $
(ui
.newContent
).attr('id').toLowerCase() +
'</p></div>');
116 $
("div.tooltip").remove();
119 $
("#" + $
(ui
.newContent
).attr('id') +
"_msg").hover(
121 $
(this
).append('<div class="tooltip"><p><?php echo xla("Please place your install files in following directory"); ?>' +
': contrib/' + $
(ui
.newContent
).attr('id').toLowerCase() +
'</p></div>');
124 $
("div.tooltip").remove();
127 $
("#" + $
(ui
.newContent
).attr('id') +
"_install_button").click(
129 $
(this
).attr("disabled", "disabled");
130 var stg_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stg_loading";
131 $
(stg_load_id
).show();
133 var parm
= 'db=' + $
(ui
.newContent
).attr('id') +
'&newInstall=' +
(($
(this
).val() === 'INSTALL') ?
1 : 0) +
'&file_checksum=' + $
(this
).attr('file_checksum') +
'&file_revision_date=' + $
(this
).attr('file_revision_date') +
'&version=' + $
(this
).attr('version');
134 var stg_dets_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stage_details";
135 $activeAccordionSection = $
("#accordion").accordion('option', 'active');
138 url
: 'standard_tables_manage.php',
141 success
: function(data
) {
142 var stg_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stg_loading";
143 $
(stg_load_id
).hide();
144 var $dialog=$
('<div class=stg id="response_dialog"></div>').dialog({
145 buttons
: { "Close": function() { $
(this
).dialog("close"); } },
146 close
: function(event
,ui
){$
(this
).remove ();},
151 hide
:{effect
:'blind',duration
:300}
153 $dialog.dialog('open');
154 $
("#response_dialog").html(data
);
155 $
("#accordion").accordion("activate", 0);
156 $
("#accordion").accordion("activate", <?php
echo $activeAccordionSection; ?
>);
168 $
("#accordion").accordion(accOpts
);
170 $
.each(db_list
, function() {
171 $
("#" + this +
"_inst_loading").hide();
172 $
("#" + this +
"_stg_loading").hide();
173 var dialog_name
= this +
'_dialog';
174 var dialog_title
= this +
' Installation Details';
175 var this_button
= "#" + this +
"_button";
176 var stg_load_id
= '#' + this +
"_stg_loading";
178 $
(".body_top").append('<div class="dialog" id="' + dialog_name +
'" title="' + dialog_title +
'"></div>');
179 $
( "#" + this +
"_dialog" ).dialog({
187 buttons
: { "Close": function() { $
(this
).dialog("close"); } }
190 $
( ".history_button" ).button({ icons
: {primary
:'ui-icon-triangle-1-s'}});
191 $
("#accordion").accordion("activate", <?php
echo $activeAccordionSection; ?
>);
196 .ui
-accordion
-header
{ font
-size
: .7em
; font
-weight
: bold
; }
197 .ui
-accordion
-content
{ background
-color
: #E4E7EA; }
198 .hdr
{ font
-size
: 1.1em
; font
-weight
: bold
; }
199 .overview
{ font
-size
: 1.1em
; font
-weight
: normal
; width
: 700px
; color
: blue
; }
200 .atr
{ font
-size
: .8em
; font
-weight
: normal
; clear
: both
; width
: 300px
; }
201 .left_wrpr
{ float: left
; clear
: both
; padding
:20px
; background
-color
: #E4E7EA}
202 .wrpr
{ float: left
; padding
:20px
; background
-color
: #E4E7EA}
203 .inst_dets
{ font
-size
: .8em
; font
-weight
: normal
; clear
: both
; border
-style
: solid
; border
-width
: 2px
; padding
: 25px
; margins
: 20px
; outline
-color
:#E4E7EA; outline-style: solid; outline-width: 20px; float: left; }
204 .stg_dets
{ padding
-left
: 20px
; font
-size
: .8em
; font
-weight
: normal
; border
-style
: solid
; border
-width
: 2px
; padding
: 25px
; margins
: 20px
; outline
-color
:#E4E7EA; outline-style: solid; outline-width: 20px; float: left; background-color: #E4E7EA}
205 .stg
{ font
-size
: .8em
; font
-weight
: normal
; font
-style
: italic
; margin
: 10px
;}
206 .dialog
{ color
: blue
; padding
: 20px
; font
-size
: .9em
; font
-weight
: normal
; font
-style
: italic
; left
: 20px
; top
:20px
; }
207 a
.dialog
{ text
-decoration
: underline
; font
-size
: 1.1em
; font
-weight
: bold
; margin
: 10px
; }
208 .status
{ font
-size
: .8em
; font
-weight
: normal
; width
: 350px
; }
209 .error_msg
{ font
-size
: .9em
; font
-style
: italic
; font
-weight
: bold
; color
: red
; margin
: 10px
; }
213 display
: inline
-block
;
217 background
-color
: #89A4CC;
226 span
.msg
:hover
{ background
-color
: #3D6199; }
229 background
-color
: #3D6199;
238 border
-color
: transparent
#3D6199 transparent transparent;
239 border
-right
: 6px solid
#3D6199;
241 border
-width
: 6px
6px
6px
0px
;
258 <body
class="body_top">
259 <h4
><?php
echo xlt("External Database Import Utility"); ?
></h4
>
261 <h3
><a href
="#"><?php
echo xlt("Overview"); ?
></a
></h3
>
262 <div id
="overivew" class="stg">
263 <div
class="overview"><?php
echo xlt("This page allows you to review each of the supported external dataloads that you can install and upgrade. Each section below can be expanded by clicking on the section header to review the status of the particular database of interest."); ?
>
264 <div
class="error_msg"><?php
echo xlt("NOTE: Importing external data can take more than an hour depending on your hardware configuration. For example, one of the RxNorm data tables contain in excess of 6 million rows."); ?
></div
>
269 // setup the divs for each supported external dataload
271 // placemaker for when support DSMIV
272 //$db_list = array("DSMIV", "ICD9", "ICD10", "RXNORM", "SNOMED");
273 $db_list = array("ICD9", "ICD10", "RXNORM", "SNOMED","CQM_VALUESET");
274 foreach ($db_list as $db) {
276 <h3
><a href
="#"><?php
echo attr($db); ?
></a
></h3
>
277 <div id
="<?php echo attr($db); ?>" class="hdr">
278 <div
class="status" id
="<?php echo attr($db); ?>_status"></div
>
279 <div
class="left_wrpr">
280 <div
class="inst_dets">
281 <div
class="inst_hdr"><?php
echo xlt("Installed Release"); ?
></div
>
283 <div id
="<?php echo attr($db); ?>_install_details">
284 <div id
='<?php echo attr($db); ?>_inst_loading' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>
289 <div
class="stg_dets">
290 <div
class="stg_hdr" id
="<?php echo attr($db); ?>_stg_hdr"><?php
echo xlt("Staged Releases"); ?
></div
>
292 <div id
="<?php echo attr($db); ?>_stage_details"></div
>
293 <div id
='<?php echo attr($db); ?>_stg_loading' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>