Skip to content

Commit

Permalink
fix: fix none issue mechanism in the patient summary screen (openemr#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bradymiller authored Sep 18, 2023
1 parent 6d45c12 commit 25e5280
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions interface/patient_file/summary/demographics.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
*/

require_once("../../globals.php");
require_once("$srcdir/lists.inc.php");
require_once("$srcdir/patient.inc.php");
require_once("$srcdir/options.inc.php");
require_once("../history/history.inc.php");
Expand Down Expand Up @@ -1053,7 +1054,7 @@ function filterActiveIssues(array $i): array
}

// ALLERGY CARD
if (AclMain::aclCheckIssue('allergy')) {
if ($allergy === 1) {
$allergyService = new AllergyIntoleranceService();
$_rawAllergies = filterActiveIssues($allergyService->getAll(['lists.pid' => $pid])->getData());
$_priority = [];
Expand All @@ -1065,8 +1066,6 @@ function filterActiveIssues(array $i): array
$_standard[] = $_;
}
}
$allergyTouchListSQL = "SELECT COUNT(*) as touched FROM lists_touch WHERE pid = ? AND type = 'allergy'";
$allergyTouchListResult = sqlQuery($allergyTouchListSQL, [$pid]);
$id = 'allergy_ps_expand';
$viewArgs = [
'title' => xl('Allergies'),
Expand All @@ -1076,7 +1075,7 @@ function filterActiveIssues(array $i): array
'initiallyCollapsed' => (getUserSetting($id) == 0) ? true : false,
'linkMethod' => "javascript",
'list' => ['priority' => $_priority, 'standard' => $_standard],
'listTouched' => ($allergyTouchListResult['touched'] > 0) ? true : false,
'listTouched' => (!empty(getListTouch($pid, 'allergy'))) ? true : false,
'auth' => true,
'btnLabel' => 'Edit',
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=allergy')"
Expand All @@ -1089,7 +1088,7 @@ function filterActiveIssues(array $i): array
$patIssueService = new PatientIssuesService();

// MEDICAL PROBLEMS CARD
if (AclMain::aclCheckIssue('medical_problem')) {
if ($pl === 1) {
$_rawPL = $patIssueService->search(['lists.pid' => $pid, 'lists.type' => 'medical_problem'])->getData();
$id = 'medical_problem_ps_expand';
$viewArgs = [
Expand All @@ -1100,6 +1099,7 @@ function filterActiveIssues(array $i): array
'initiallyCollapsed' => (getUserSetting($id) == 0) ? true : false,
'linkMethod' => "javascript",
'list' => filterActiveIssues($_rawPL),
'listTouched' => (!empty(getListTouch($pid, 'medical_problem'))) ? true : false,
'auth' => true,
'btnLabel' => 'Edit',
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=medical_problem')"
Expand All @@ -1110,7 +1110,7 @@ function filterActiveIssues(array $i): array
}

// MEDICATION CARD
if (AclMain::aclCheckIssue('medication')) {
if ($meds === 1) {
$_rawMedList = $patIssueService->search(['lists.pid' => $pid, 'lists.type' => 'medication'])->getData();
$id = 'medication_ps_expand';
$viewArgs = [
Expand All @@ -1121,6 +1121,7 @@ function filterActiveIssues(array $i): array
'initiallyCollapsed' => (getUserSetting($id) == 0) ? true : false,
'linkMethod' => "javascript",
'list' => filterActiveIssues($_rawMedList),
'listTouched' => (!empty(getListTouch($pid, 'medication'))) ? true : false,
'auth' => true,
'btnLabel' => 'Edit',
'btnLink' => "return load_location('{$GLOBALS['webroot']}/interface/patient_file/summary/stats_full.php?active=all&category=medication')"
Expand All @@ -1131,7 +1132,7 @@ function filterActiveIssues(array $i): array
}

// Render the Prescriptions card if turned on
if (!$GLOBALS['disable_prescriptions'] && AclMain::aclCheckCore('patients', 'rx')) :
if ($rx === 1) :
if ($GLOBALS['erx_enable'] && $display_current_medications_below == 1) {
$sql = "SELECT * FROM prescriptions WHERE patient_id = ? AND active = '1'";
$res = sqlStatement($sql, [$pid]);
Expand Down

0 comments on commit 25e5280

Please sign in to comment.