|
13 | 13 | * When the staged files are the same as the instance installed then
|
14 | 14 | * an appropriate message is rendered
|
15 | 15 | *
|
16 |
| - * Copyright (C) 2012 Patient Healthcare Analytics, Inc. |
17 |
| - * Copyright (C) 2011 Phyaura, LLC <[email protected]> |
18 | 16 | *
|
19 |
| - * LICENSE: This program is free software; you can redistribute it and/or |
20 |
| - * modify it under the terms of the GNU General Public License |
21 |
| - * as published by the Free Software Foundation; either version 2 |
22 |
| - * of the License, or (at your option) any later version. |
23 |
| - * This program is distributed in the hope that it will be useful, |
24 |
| - * but WITHOUT ANY WARRANTY; without even the implied warranty of |
25 |
| - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
26 |
| - * GNU General Public License for more details. |
27 |
| - * You should have received a copy of the GNU General Public License |
28 |
| - * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;. |
29 |
| - * |
30 |
| - * @package OpenEMR |
31 |
| - * @author (Mac) Kevin McAloon <[email protected]> |
32 |
| - * @author Rohit Kumar <[email protected]> |
33 |
| - * @author Brady Miller <[email protected]> |
34 |
| - * @author Roberto Vasquez <[email protected]> |
35 |
| - * @link http://www.open-emr.org |
| 17 | + * @package OpenEMR |
| 18 | + * @link https://www.open-emr.org |
| 19 | + * @author (Mac) Kevin McAloon <[email protected]> |
| 20 | + * @author Rohit Kumar <[email protected]> |
| 21 | + * @author Brady Miller <[email protected]> |
| 22 | + * @author Roberto Vasquez <[email protected]> |
| 23 | + * @copyright Copyright (c) 2011 Phyaura, LLC <[email protected]> |
| 24 | + * @copyright Copyright (c) 2012 Patient Healthcare Analytics, Inc. |
| 25 | + * @copyright Copyright (c) 2019 Brady Miller <[email protected]> |
| 26 | + * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 |
36 | 27 | */
|
37 | 28 |
|
38 | 29 |
|
39 |
| - |
40 |
| - |
41 | 30 | require_once("../../interface/globals.php");
|
42 | 31 | require_once("$srcdir/acl.inc");
|
43 | 32 |
|
|
187 | 176 | $temp_date = array('date'=>$date_release, 'version'=>$version, 'path'=>$mainPATH."/".$matches[0]);
|
188 | 177 | array_push($revisions, $temp_date);
|
189 | 178 | $supported_file = 1;
|
190 |
| - } else if (preg_match("/SnomedCT_RF2Release_INT_([0-9]{8}).zip/",$file,$matches)) { |
191 |
| - |
| 179 | + } else if (preg_match("/SnomedCT_InternationalRF2_PRODUCTION_([0-9]{8})[0-9a-zA-Z]{8}.zip/", $file, $matches)) { |
192 | 180 | // Hard code the version SNOMED feed to be International:English
|
193 |
| - // (if add different SNOMED types/versions/languages, then can use this) |
194 | 181 | //
|
195 |
| - $version = "RF2International:English"; |
196 |
| - $date_release = substr($matches[1],0,4)."-".substr($matches[1],4,-2)."-".substr($matches[1],6); |
| 182 | + $version = "International:English"; |
| 183 | + $rf2 = true; |
| 184 | + $date_release = substr($matches[1], 0, 4)."-".substr($matches[1], 4, -2)."-".substr($matches[1], 6); |
| 185 | + $temp_date = array('date'=>$date_release, 'version'=>$version, 'path'=>$mainPATH."/".$matches[0]); |
| 186 | + array_push($revisions, $temp_date); |
| 187 | + $supported_file = 1; |
| 188 | + } else if (preg_match("/SnomedCT_USEditionRF2_PRODUCTION_([0-9]{8})[0-9a-zA-Z]{8}.zip/", $file, $matches)) { |
| 189 | + // Hard code the version SNOMED feed to be Complete US Extension |
| 190 | + // |
| 191 | + $version = "Complete US Extension"; |
| 192 | + $rf2 = true; |
| 193 | + $date_release = substr($matches[1], 0, 4)."-".substr($matches[1], 4, -2)."-".substr($matches[1], 6); |
197 | 194 | $temp_date = array('date'=>$date_release, 'version'=>$version, 'path'=>$mainPATH."/".$matches[0]);
|
198 |
| - array_push($revisions,$temp_date); |
| 195 | + array_push($revisions, $temp_date); |
| 196 | + $supported_file = 1; |
| 197 | + } else if (preg_match("/SnomedCT_SpanishRelease-es_PRODUCTION_([0-9]{8})[0-9a-zA-Z]{8}.zip/", $file, $matches)) { |
| 198 | + // Hard code the version SNOMED feed to be International:Spanish |
| 199 | + // |
| 200 | + $version = "International:Spanish"; |
| 201 | + $rf2 = true; |
| 202 | + $date_release = substr($matches[1], 0, 4)."-".substr($matches[1], 4, -2)."-".substr($matches[1], 6); |
| 203 | + $temp_date = array('date'=>$date_release, 'version'=>$version, 'path'=>$mainPATH."/".$matches[0]); |
| 204 | + array_push($revisions, $temp_date); |
199 | 205 | $supported_file = 1;
|
200 | 206 | } else {
|
201 | 207 | // nothing
|
202 | 208 | }
|
203 | 209 | } else if (is_numeric(strpos($db, "ICD"))) {
|
204 | 210 | $qry_str = "SELECT `load_checksum`,`load_source`,`load_release_date` FROM `supported_external_dataloads` WHERE `load_type` = ? and `load_filename` = ? and `load_checksum` = ? ORDER BY `load_release_date` DESC";
|
205 | 211 |
|
206 |
| - // this query determines whether you can load the data into openEMR. you must have the correct |
207 |
| - // filename and checksum for each file that are part of the same release. |
208 |
| - // |
209 |
| - // IMPORTANT: Releases that contain mutliple zip file (e.g. ICD10) are grouped together based |
210 |
| - // on the load_release_date attribute value specified in the supported_external_dataloads table |
| 212 | + // this query determines whether you can load the data into openEMR. you must have the correct |
| 213 | + // filename and checksum for each file that are part of the same release. |
| 214 | + // |
| 215 | + // IMPORTANT: Releases that contain mutliple zip file (e.g. ICD10) are grouped together based |
| 216 | + // on the load_release_date attribute value specified in the supported_external_dataloads table |
211 | 217 | //
|
212 | 218 | // Just in case same filename is released on different release dates, best to actually include the md5sum in the query itself.
|
213 | 219 | // (and if a hit, then it is a pass)
|
|
261 | 267 | if ($supported_file === 1) {
|
262 | 268 | $success_flag=1;
|
263 | 269 |
|
264 |
| - // Only allow 1 staged revision for the SNOMED and RXNORM imports |
| 270 | + // Only allow 1 staged revision for the SNOMED and RXNORM imports |
265 | 271 | if (($db=="SNOMED" || $db=="RXNORM") && (count($revisions) > 1)) {
|
266 | 272 | ?>
|
267 | 273 | <div class="error_msg"><?php echo xlt("The number of staged files is incorrect. Only place the file that you wish to install/upgrade to."); ?></div>
|
|
270 | 276 | $success_flag=0;
|
271 | 277 | }
|
272 | 278 |
|
273 |
| - // Ensure all release dates and revisions are the same for multiple file imports |
274 |
| - // and collect the date and revision. Also collect a checksum and path. |
| 279 | + // Ensure all release dates and revisions are the same for multiple file imports |
| 280 | + // and collect the date and revision. Also collect a checksum and path. |
275 | 281 | $file_revision_date = '';
|
276 | 282 | $file_revision = '';
|
277 | 283 | $file_checksum = '';
|
|
311 | 317 | $file_revision_path = $value['path'];
|
312 | 318 | }
|
313 | 319 |
|
314 |
| - // Determine and enforce only a certain number of files to be staged |
| 320 | + // Determine and enforce only a certain number of files to be staged |
315 | 321 | if ($success_flag === 1) {
|
316 | 322 | $number_files = 1;
|
317 | 323 | $sql_query_ret = sqlStatement("SELECT * FROM `supported_external_dataloads` WHERE `load_type` = ? AND `load_source` = ? AND `load_release_date` = ?", array($db,$file_revision,$file_revision_date));
|
|
330 | 336 | }
|
331 | 337 | }
|
332 | 338 |
|
333 |
| - // If new version is being offered, then provide install/upgrade options |
| 339 | + // If new version is being offered, then provide install/upgrade options |
334 | 340 | if ($success_flag === 1) {
|
335 | 341 | $action = "";
|
336 | 342 | if ($installed_flag === 1) {
|
|
419 | 425 | }
|
420 | 426 |
|
421 | 427 | if (strlen($action) > 0) {
|
| 428 | + $rf = "rf1"; |
| 429 | + if (!empty($rf2)) { |
| 430 | + $rf = "rf2"; |
| 431 | + } |
422 | 432 | ?>
|
423 |
| - <input id="<?php echo attr($db); ?>_install_button" version="<?php echo attr($file_revision); ?>" file_revision_date="<?php echo attr($file_revision_date); ?>" file_checksum="<?php echo attr($file_checksum); ?>" type="button" value="<?php echo attr($action); ?>"/> |
| 433 | + <input id="<?php echo attr($db); ?>_install_button" version="<?php echo attr($file_revision); ?>" rf="<?php echo $rf; ?>" file_revision_date="<?php echo attr($file_revision_date); ?>" file_checksum="<?php echo attr($file_checksum); ?>" type="button" value="<?php echo attr($action); ?>"/> |
424 | 434 | </div>
|
425 | 435 | <?php
|
426 | 436 | }
|
|
0 commit comments