Skip to content

Commit

Permalink
feat: support for loading 2024 reporting cqm valueset (openemr#7318)
Browse files Browse the repository at this point in the history
* feat: support for loading 2024 reporting cqm valueset

* cast simplexml to string and ignore zip file in tmp dir
  • Loading branch information
stephenwaite authored Apr 6, 2024
1 parent 24905d5 commit 51b92a5
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 16 deletions.
2 changes: 1 addition & 1 deletion interface/code_systems/list_staged.php
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@
$supported_file = 1;
}
} elseif ($db == 'CQM_VALUESET') {
if (preg_match("/ep_.*_cms_([0-9]{8}).xml.zip/", $file, $matches)) {
if (preg_match("/e[p,c]_.*_cms_([0-9]{8}).xml.zip/", $file, $matches)) {
$version = "Standard";
$date_release = substr($matches[1], 0, 4) . "-" . substr($matches[1], 4, -2) . "-" . substr($matches[1], 6);
$temp_date = array('date' => $date_release, 'version' => $version, 'path' => $mainPATH . "/" . $matches[0]);
Expand Down
32 changes: 18 additions & 14 deletions library/standard_tables_capture.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,13 @@ function valueset_import($type)
sqlStatementNoLog("START TRANSACTION");
if (is_dir($dir) && $handle = opendir($dir)) {
while (false !== ($filename = readdir($handle))) {
// skip the zip file that's in the tmp file dir
if (stripos($filename, ".zip")) {
continue;
}
if (stripos($filename, ".xml")) {
$abs_path = $dir . $filename;
$xml = simplexml_load_file($abs_path, null, null, 'ns0', true);
$xml = simplexml_load_file($abs_path, null, 0, 'ns0', true);
foreach ($xml->DescribedValueSet as $vset) {
$vset_attr = $vset->attributes();
$nqf = $vset->xpath('ns0:Group[@displayName="NQF Number"]/ns0:Keyword');
Expand All @@ -628,13 +632,13 @@ function valueset_import($type)
description = values(description),
valueset_name = values(valueset_name)",
array(
$nqf_code,
$con_attr->code,
$con_attr->codeSystem,
$con_attr->codeSystemName,
$vset_attr->ID,
$con_attr->displayName,
$vset_attr->displayName
(string) $nqf_code,
(string) $con_attr->code,
(string) $con_attr->codeSystem,
(string) $con_attr->codeSystemName,
(string) $vset_attr->ID,
(string) $con_attr->displayName,
(string) $vset_attr->displayName
)
);
sqlStatementNoLog(
Expand All @@ -643,13 +647,13 @@ function valueset_import($type)
description = values(description),
valueset_name = values(valueset_name)",
array(
$nqf_code,
$vset_attr->ID,
$con_attr->codeSystem,
(string) $nqf_code,
(string) $vset_attr->ID,
(string) $con_attr->codeSystem,
'OID',
$vset_attr->ID,
$vset_attr->displayName,
$vset_attr->displayName
(string) $vset_attr->ID,
(string) $vset_attr->displayName,
(string) $vset_attr->displayName
)
);
}
Expand Down
4 changes: 4 additions & 0 deletions sql/7_0_2-to-7_0_3_upgrade.sql
Original file line number Diff line number Diff line change
Expand Up @@ -113,3 +113,7 @@
ALTER TABLE `form_encounter` ADD `last_update` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP;
#EndIf

#IfNotRow4D supported_external_dataloads load_type CQM_VALUESET load_source NIH_VSAC load_release_date 2023-05-04 load_filename ec_only_cms_20230504.xml.zip
INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES
('CQM_VALUESET', 'NIH_VSAC', '2023-05-04', 'ec_only_cms_20230504.xml.zip', 'b77b3c2a88d23de0ec427c1cfc5088ce');
#EndIf
2 changes: 2 additions & 0 deletions sql/database.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8798,6 +8798,8 @@ INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_re
('ICD10', 'CMS', '2023-10-01', 'Code Descriptions.zip', '15404ef88e0ffa15474e6d6076aa0a8a');
INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES
('ICD10', 'CMS', '2023-10-01', 'Zip File 3 2024 ICD-10-PCS Codes File.zip', '30e096ed9971755c4dfc134b938f3c1f');
INSERT INTO `supported_external_dataloads` (`load_type`, `load_source`, `load_release_date`, `load_filename`, `load_checksum`) VALUES
('CQM_VALUESET', 'NIH_VSAC', '2023-05-04', 'ec_only_cms_20230504.xml.zip', 'b77b3c2a88d23de0ec427c1cfc5088ce');
-- --------------------------------------------------------

--
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
// is a database change in the course of development. It is used
// internally to determine when a database upgrade is needed.
//
$v_database = 501;
$v_database = 502;

// Access control version identifier, this is to be incremented whenever there
// is a access control change in the course of development. It is used
Expand Down

0 comments on commit 51b92a5

Please sign in to comment.