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.g.miller@gmail.com>
24 * @link http://www.open-emr.org
30 require_once("../../interface/globals.php");
31 require_once("$srcdir/acl.inc");
33 // Ensure script doesn't time out and has enough memory
35 ini_set('memory_limit', '150M');
38 if (!acl_check('admin', 'super')) {
39 echo xlt('Not Authorized');
43 $activeAccordionSection = isset($_GET['aas']) ?
$_GET['aas'] : '0';
48 <title
><?php
echo xlt('External Data Loads'); ?
></title
>
49 <link rel
='stylesheet' href
='<?php echo $css_header ?>' type
='text/css'/>
50 <link rel
='stylesheet' href
='../../library/css/jquery-ui-1.8.21.custom.css' type
='text/css'/>
53 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-1-7-2/jquery.min.js"></script
>
54 <script type
="text/javascript" src
="../../library/js/jquery-ui-1.8.21.custom.min.js"></script
>
57 // placemaker for when support DSMIV
58 // var db_list = [ "DSMIV", "ICD9", "ICD10", "RXNORM", "SNOMED"];
59 var db_list
= [ "ICD9", "ICD10", "RXNORM", "SNOMED", "CQM_VALUESET"];
64 //add change event callback
65 change
: function(e
, ui
) {
66 var parm
= 'db=' + $
(ui
.newContent
).attr('id');
67 var inst_dets_id
= '#' + $
(ui
.newContent
).attr('id') +
"_install_details";
68 var stg_dets_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stage_details";
69 var inst_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_inst_loading";
70 var stg_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stg_loading";
72 $
(inst_load_id
).show();
73 $
(stg_load_id
).show();
75 url
: 'list_installed.php',
78 success
: function(data
) {
79 $
(inst_dets_id
).html(data
);
83 url
: 'list_staged.php',
86 success
: function(data
) {
87 $
(stg_load_id
).hide();
88 $
(stg_dets_id
).html(data
);
89 $
("#" + $
(ui
.newContent
).attr('id') +
"_instrmsg").hover(
91 var dlg
= "#" + $
(ui
.newContent
).attr('id') +
"_dialog";
92 $
(dlg
).dialog('open');
93 $
(dlg
).load($
(ui
.newContent
).attr('id').toLowerCase() +
'_howto.php');
98 $
("#" + $
(ui
.newContent
).attr('id') +
"_unsupportedmsg").hover(
100 $
(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>');
103 $
("div.tooltip").remove();
106 $
("#" + $
(ui
.newContent
).attr('id') +
"_dirmsg").hover(
108 $
(this
).append('<div class="tooltip"><p><?php echo xla("Please create the following directory before proceeding"); ?>' +
': contrib/' + $
(ui
.newContent
).attr('id').toLowerCase() +
'</p></div>');
111 $
("div.tooltip").remove();
114 $
("#" + $
(ui
.newContent
).attr('id') +
"_msg").hover(
116 $
(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>');
119 $
("div.tooltip").remove();
122 $
("#" + $
(ui
.newContent
).attr('id') +
"_install_button").click(
124 $
(this
).attr("disabled", "disabled");
125 var stg_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stg_loading";
126 $
(stg_load_id
).show();
128 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');
129 var stg_dets_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stage_details";
130 $activeAccordionSection = $
("#accordion").accordion('option', 'active');
133 url
: 'standard_tables_manage.php',
136 success
: function(data
) {
137 var stg_load_id
= '#' + $
(ui
.newContent
).attr('id') +
"_stg_loading";
138 $
(stg_load_id
).hide();
139 var $dialog=$
('<div class=stg id="response_dialog"></div>').dialog({
140 buttons
: { "Close": function() { $
(this
).dialog("close"); } },
141 close
: function(event
,ui
){$
(this
).remove ();},
146 hide
:{effect
:'blind',duration
:300}
148 $dialog.dialog('open');
149 $
("#response_dialog").html(data
);
150 $
("#accordion").accordion("activate", 0);
151 $
("#accordion").accordion("activate", <?php
echo $activeAccordionSection; ?
>);
163 $
("#accordion").accordion(accOpts
);
165 $
.each(db_list
, function() {
166 $
("#" + this +
"_inst_loading").hide();
167 $
("#" + this +
"_stg_loading").hide();
168 var dialog_name
= this +
'_dialog';
169 var dialog_title
= this +
' Installation Details';
170 var this_button
= "#" + this +
"_button";
171 var stg_load_id
= '#' + this +
"_stg_loading";
173 $
(".body_top").append('<div class="dialog" id="' + dialog_name +
'" title="' + dialog_title +
'"></div>');
174 $
( "#" + this +
"_dialog" ).dialog({
182 buttons
: { "Close": function() { $
(this
).dialog("close"); } }
185 $
( ".history_button" ).button({ icons
: {primary
:'ui-icon-triangle-1-s'}});
186 $
("#accordion").accordion("activate", <?php
echo $activeAccordionSection; ?
>);
191 .ui
-accordion
-header
{ font
-size
: .7em
; font
-weight
: bold
; }
192 .ui
-accordion
-content
{ background
-color
: #E4E7EA; }
193 .hdr
{ font
-size
: 1.1em
; font
-weight
: bold
; }
194 .overview
{ font
-size
: 1.1em
; font
-weight
: normal
; width
: 700px
; color
: blue
; }
195 .atr
{ font
-size
: .8em
; font
-weight
: normal
; clear
: both
; width
: 300px
; }
196 .left_wrpr
{ float: left
; clear
: both
; padding
:20px
; background
-color
: #E4E7EA}
197 .wrpr
{ float: left
; padding
:20px
; background
-color
: #E4E7EA}
198 .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; }
199 .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}
200 .stg
{ font
-size
: .8em
; font
-weight
: normal
; font
-style
: italic
; margin
: 10px
;}
201 .dialog
{ color
: blue
; padding
: 20px
; font
-size
: .9em
; font
-weight
: normal
; font
-style
: italic
; left
: 20px
; top
:20px
; }
202 a
.dialog
{ text
-decoration
: underline
; font
-size
: 1.1em
; font
-weight
: bold
; margin
: 10px
; }
203 .status
{ font
-size
: .8em
; font
-weight
: normal
; width
: 350px
; }
204 .error_msg
{ font
-size
: .9em
; font
-style
: italic
; font
-weight
: bold
; color
: red
; margin
: 10px
; }
208 display
: inline
-block
;
212 background
-color
: #89A4CC;
221 span
.msg
:hover
{ background
-color
: #3D6199; }
224 background
-color
: #3D6199;
233 border
-color
: transparent
#3D6199 transparent transparent;
234 border
-right
: 6px solid
#3D6199;
236 border
-width
: 6px
6px
6px
0px
;
253 <body
class="body_top">
254 <h4
><?php
echo xlt("External Database Import Utility"); ?
></h4
>
256 <h3
><a href
="#"><?php
echo xlt("Overview"); ?
></a
></h3
>
257 <div id
="overivew" class="stg">
258 <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."); ?
>
259 <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
>
264 // setup the divs for each supported external dataload
266 // placemaker for when support DSMIV
267 //$db_list = array("DSMIV", "ICD9", "ICD10", "RXNORM", "SNOMED");
268 $db_list = array("ICD9", "ICD10", "RXNORM", "SNOMED","CQM_VALUESET");
269 foreach ($db_list as $db) {
271 <h3
><a href
="#"><?php
echo attr($db); ?
></a
></h3
>
272 <div id
="<?php echo attr($db); ?>" class="hdr">
273 <div
class="status" id
="<?php echo attr($db); ?>_status"></div
>
274 <div
class="left_wrpr">
275 <div
class="inst_dets">
276 <div
class="inst_hdr"><?php
echo xlt("Installed Release"); ?
></div
>
278 <div id
="<?php echo attr($db); ?>_install_details">
279 <div id
='<?php echo attr($db); ?>_inst_loading' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>
284 <div
class="stg_dets">
285 <div
class="stg_hdr" id
="<?php echo attr($db); ?>_stg_hdr"><?php
echo xlt("Staged Releases"); ?
></div
>
287 <div id
="<?php echo attr($db); ?>_stage_details"></div
>
288 <div id
='<?php echo attr($db); ?>_stg_loading' style
='margin:10px;display:none;'><img src
='../pic/ajax-loader.gif'/></div
>