From 8c194872c0c9df226dceb33ce2d2b683482fcbff Mon Sep 17 00:00:00 2001 From: Brady Miller Date: Wed, 2 Mar 2022 19:00:04 -0800 Subject: [PATCH] complete a9 (#4976) --- interface/patient_file/education.php | 4 ++-- interface/patient_file/summary/demographics.php | 7 ++++++ .../super/rules/controllers/detail/view/view.php | 2 ++ .../super/rules/controllers/edit/controller.php | 4 +++- .../super/rules/controllers/edit/view/summary.php | 26 ++++++++++++++++++++++ interface/super/rules/library/Rule.php | 13 +++++++++++ interface/super/rules/library/RuleManager.php | 24 +++++++++++++------- library/clinical_rules.php | 24 ++++++++++++++++---- sql/6_1_0-to-7_0_0_upgrade.sql | 9 ++++++++ sql/database.sql | 2 ++ version.php | 2 +- 11 files changed, 101 insertions(+), 16 deletions(-) diff --git a/interface/patient_file/education.php b/interface/patient_file/education.php index e72ec340e..58dcb5901 100644 --- a/interface/patient_file/education.php +++ b/interface/patient_file/education.php @@ -34,8 +34,8 @@ if (!empty($_POST['bn_submit'])) { if ($source == 'MLP') { // MedlinePlus Connect Web Application. See: - // http://www.nlm.nih.gov/medlineplus/connect/application.html - $url = 'http://apps.nlm.nih.gov/medlineplus/services/mpconnect.cfm'; + // https://www.nlm.nih.gov/medlineplus/connect/application.html + $url = 'https://connect.medlineplus.gov/application'; // Set code type in URL. $url .= '?mainSearchCriteria.v.cs='; if ('ICD9' == $codetype) { diff --git a/interface/patient_file/summary/demographics.php b/interface/patient_file/summary/demographics.php index 361295d0b..d59244b6a 100644 --- a/interface/patient_file/summary/demographics.php +++ b/interface/patient_file/summary/demographics.php @@ -274,6 +274,13 @@ $oemr_ui = new OemrUI($arrOeUiSettings); require_once("$srcdir/options.js.php"); ?> @@ -54,6 +70,11 @@ $rule = $viewBean->rule ?>
+ + +
+ +
@@ -73,6 +94,11 @@ $rule = $viewBean->rule ?> +
+ + +
+ diff --git a/interface/super/rules/library/Rule.php b/interface/super/rules/library/Rule.php index 768a45bf2..92b6419a8 100644 --- a/interface/super/rules/library/Rule.php +++ b/interface/super/rules/library/Rule.php @@ -24,10 +24,13 @@ class Rule var $ruleTypes; var $id; var $title; + var $bibliographic_citation; var $developer; var $funding_source; var $release; var $web_ref; + var $linked_referential_cds; + /** * @var ReminderIntervals */ @@ -55,6 +58,11 @@ class Rule return $this->title; } + function setBibliographicCitation($s) + { + $this->bibliographic_citation = $s; + } + function setDeveloper($s) { $this->developer = $s; @@ -75,6 +83,11 @@ class Rule $this->web_ref = $s; } + function setLinkedReferentialCds($s) + { + $this->linked_referential_cds = $s; + } + /** * @param RuleType $ruleType */ diff --git a/interface/super/rules/library/RuleManager.php b/interface/super/rules/library/RuleManager.php index 5d4ca5155..cbce4d485 100644 --- a/interface/super/rules/library/RuleManager.php +++ b/interface/super/rules/library/RuleManager.php @@ -77,15 +77,17 @@ class RuleManager cqm_flag = ?, amc_flag = ?, patient_reminder_flag = ?, - developer = ?, - funding_source = ?, + developer = ?, + funding_source = ?, release_version = ?, - web_reference = ? + web_reference = ?, + bibliographic_citation = ?, + linked_referential_cds = ? WHERE id = ? AND pid = 0"; const SQL_UPDATE_TITLE = "UPDATE list_options - SET title = ? + SET title = ? WHERE list_id = 'clinical_rules' AND option_id = ?"; const SQL_REMOVE_INTERVALS = @@ -145,10 +147,12 @@ class RuleManager $rule = new Rule($id, $ruleResult['title']); + $rule->setBibliographicCitation($ruleResult['bibliographic_citation']); $rule->setDeveloper($ruleResult['developer']); $rule->setFunding($ruleResult['funding_source']); $rule->setRelease($ruleResult['release_version']); $rule->setWeb_ref($ruleResult['web_reference']); + $rule->setLinkedReferentialCds($ruleResult['linked_referential_cds']); $this->fillRuleTypes($rule, $ruleResult); $this->fillRuleReminderIntervals($rule); @@ -490,7 +494,7 @@ class RuleManager sqlStatement("DELETE FROM rule_filter WHERE SHA1(CONCAT( id, include_flag, required_flag, method, method_detail, value )) = ?", [$guid]); } - function updateSummary($ruleId, $types, $title, $developer, $funding, $release, $web_ref) + function updateSummary($ruleId, $types, $title, $developer, $funding, $release, $web_ref, $bibliographic_citation, $linked_referential_cds) { $rule = $this->getRule($ruleId); @@ -499,8 +503,8 @@ class RuleManager $result = sqlQuery("select count(*)+1 AS id from clinical_rules"); $ruleId = "rule_" . $result['id']; sqlStatement( - "INSERT INTO clinical_rules (id, pid, active_alert_flag, passive_alert_flag, cqm_flag, amc_flag, patient_reminder_flag, developer, funding_source, release_version, web_reference ) " . - "VALUES (?,?,?,?,?,?,?,?,?,?,?) ", + "INSERT INTO clinical_rules (id, pid, active_alert_flag, passive_alert_flag, cqm_flag, amc_flag, patient_reminder_flag, developer, funding_source, release_version, web_reference, bibliographic_citation, linked_referential_cds ) " . + "VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?) ", array( $ruleId, 0, @@ -512,7 +516,9 @@ class RuleManager $developer, $funding, $release, - $web_ref + $web_ref, + $bibliographic_citation, + $linked_referential_cds ) ); @@ -532,6 +538,8 @@ class RuleManager $funding, $release, $web_ref, + $bibliographic_citation, + $linked_referential_cds, $rule->id )); // update title diff --git a/library/clinical_rules.php b/library/clinical_rules.php index 520732698..88122ae37 100644 --- a/library/clinical_rules.php +++ b/library/clinical_rules.php @@ -81,21 +81,28 @@ function clinical_summary_widget($patient_id, $mode, $dateTarget = '', $organize echo "
"; - // Collect the Rule Title, Rule Developer, Rule Funding Source, and Rule Release and show it when hover over the item. + // Collect the Rule Title, Bibliographical citation, Rule Developer, Rule Funding Source, and Rule Release and show it when hover over the item. + // Show the link for Linked referential CDS (this is set via codetype:code) $tooltip = ''; if (!empty($action['rule_id'])) { $rule_title = getListItemTitle("clinical_rules", $action['rule_id']); - $ruleData = sqlQuery("SELECT `developer`, `funding_source`, `release_version`, `web_reference` " . + $ruleData = sqlQuery("SELECT `bibliographic_citation`, `developer`, `funding_source`, `release_version`, `web_reference`, `linked_referential_cds` " . "FROM `clinical_rules` " . "WHERE `id`=? AND `pid`=0", array($action['rule_id'])); + $bibliographic_citation = $ruleData['bibliographic_citation']; $developer = $ruleData['developer']; $funding_source = $ruleData['funding_source']; $release = $ruleData['release_version']; $web_reference = $ruleData['web_reference']; + $linked_referential_cds = $ruleData['linked_referential_cds']; if (!empty($rule_title)) { $tooltip = xla('Rule Title') . ": " . attr($rule_title) . " "; } + if (!empty($bibliographic_citation)) { + $tooltip .= xla('Rule Bibliographic Citation') . ": " . attr($bibliographic_citation) . " "; + } + if (!empty($developer)) { $tooltip .= xla('Rule Developer') . ": " . attr($developer) . " "; } @@ -110,9 +117,18 @@ function clinical_summary_widget($patient_id, $mode, $dateTarget = '', $organize if ((!empty($tooltip)) || (!empty($web_reference))) { if (!empty($web_reference)) { - $tooltip = "?"; + $tooltip = ""; } else { - $tooltip = "?"; + $tooltip = ""; + } + } + + if (!empty($linked_referential_cds)) { + $codeParse = explode(":", $linked_referential_cds); + $codetype = $codeParse[0] ?? null; + $code = $codeParse[1] ?? null; + if (!empty($codetype) && !empty($code)) { + $tooltip .= ""; } } } diff --git a/sql/6_1_0-to-7_0_0_upgrade.sql b/sql/6_1_0-to-7_0_0_upgrade.sql index e0908261c..a41a69ed4 100644 --- a/sql/6_1_0-to-7_0_0_upgrade.sql +++ b/sql/6_1_0-to-7_0_0_upgrade.sql @@ -113,3 +113,12 @@ SET @seq_add_to = (SELECT seq FROM layout_options WHERE group_id = @group_id AND INSERT INTO `layout_options` (`form_id`, `field_id`, `group_id`, `title`, `seq`, `data_type`, `uor`, `fld_length`, `max_length`, `list_id`, `titlecols`, `datacols`, `default_value`, `edit_options`, `description`, `fld_rows`) VALUES ('DEM','prevent_portal_apps',@group_id,'Prevent API Access',@seq_add_to+5,21,1,0,0,'',1,1,'','','Check to not allow third party API access.',0); ALTER TABLE `patient_data` ADD `prevent_portal_apps` TEXT; #Endif + +#IfMissingColumn clinical_rules bibliographic_citation +ALTER TABLE `clinical_rules` ADD COLUMN `bibliographic_citation` VARCHAR(255) NOT NULL DEFAULT ''; +#EndIf + +#IfMissingColumn clinical_rules linked_referential_cds +ALTER TABLE `clinical_rules` ADD COLUMN `linked_referential_cds` VARCHAR(50) NOT NULL DEFAULT ''; +#EndIf + diff --git a/sql/database.sql b/sql/database.sql index a1c1ff417..65417e3e9 100644 --- a/sql/database.sql +++ b/sql/database.sql @@ -641,10 +641,12 @@ CREATE TABLE `clinical_rules` ( `amc_2014_stage1_flag` tinyint(1) COMMENT '2014 Stage 1 - Automated Measure Calculation flag for (unable to customize per patient)', `amc_2014_stage2_flag` tinyint(1) COMMENT '2014 Stage 2 - Automated Measure Calculation flag for (unable to customize per patient)', `patient_reminder_flag` tinyint(1) COMMENT 'Clinical Reminder Module flag', + `bibliographic_citation` VARCHAR(255) NOT NULL DEFAULT '', `developer` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Developer', `funding_source` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Funding Source', `release_version` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Release Version', `web_reference` VARCHAR(255) NOT NULL DEFAULT '' COMMENT 'Clinical Rule Web Reference', + `linked_referential_cds` VARCHAR(50) NOT NULL DEFAULT '', `access_control` VARCHAR(255) NOT NULL DEFAULT 'patients:med' COMMENT 'ACO link for access control', PRIMARY KEY (`id`,`pid`) ) ENGINE=InnoDB; diff --git a/version.php b/version.php index c7a05626d..44c6643b6 100644 --- a/version.php +++ b/version.php @@ -28,7 +28,7 @@ $v_realpatch = '0'; // is a database change in the course of development. It is used // internally to determine when a database upgrade is needed. // -$v_database = 438; +$v_database = 439; // Access control version identifier, this is to be incremented whenever there // is a access control change in the course of development. It is used -- 2.11.4.GIT