Skip to content

Commit

Permalink
external dataload fix for RxNorm and necessary change for ICD10 (#3755)
Browse files Browse the repository at this point in the history
* revert weird zip archive and add icd10 dir
  • Loading branch information
stephenwaite committed Jul 16, 2020
1 parent 15a8bc2 commit e7a3fb6
Showing 1 changed file with 10 additions and 15 deletions.
25 changes: 10 additions & 15 deletions library/standard_tables_capture.inc
Expand Up @@ -47,18 +47,10 @@ function temp_unarchive($filename, $type)
return false;
} else {
// let's unzip the file
// use checksums to determine the "version"
//
$zip = new ZipArchive;
if ($zip->open($filename, ZipArchive::CREATE) === true) {
// cms.gov added a subfolder to the archive :| filed a ticket with them 8-20-19 :)
for ($i = 0; $i < $zip->numFiles; $i++) {
$full_file_name = $zip->getNameIndex($i);
$fileinfo = pathinfo($full_file_name);
if (!copy("zip://".$filename."#".$full_file_name, $GLOBALS['temporary_files_dir']."/".
$type."/".$fileinfo['basename'])) {
return false;
};
$zip = new ZipArchive();
if ($zip->open($filename) === true) {
if (!($zip->extractTo($GLOBALS['temporary_files_dir'] . "/" . $type))) {
return false;
}
$zip->close();
return true;
Expand Down Expand Up @@ -434,10 +426,13 @@ function snomedRF2_import()
//
function icd_import($type)
{

// set up paths
$dir_icd = $GLOBALS['temporary_files_dir']."/".$type."/";
$dir=str_replace('\\', '/', $dir_icd);
$dir_icd = $GLOBALS['temporary_files_dir'] . "/" . $type . "/";
$dir = str_replace('\\', '/', $dir_icd);
// since CMS nested the ICD10 codes...
if ($type == 'ICD10') {
$dir = $dir . "/2020 Code Descriptions/";
}
$db_load = '';
$db_update = '';

Expand Down

0 comments on commit e7a3fb6

Please sign in to comment.