* @author Brady Miller * @copyright Copyright (c) 2005-2017 Rod Roark * @copyright Copyright (c) 2018 Brady Miller * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3 */ require_once('../../globals.php'); require_once($GLOBALS['srcdir'] . '/lists.inc'); require_once($GLOBALS['fileroot'] . '/custom/code_types.inc.php'); require_once($GLOBALS['srcdir'] . '/options.inc.php'); use OpenEMR\Common\Acl\AclMain; use OpenEMR\Common\Csrf\CsrfUtils; use OpenEMR\Common\Twig\TwigContainer; use OpenEMR\Core\Header; use OpenEMR\Menu\PatientMenuRole; use OpenEMR\OeUI\OemrUI; // Check if user has permission for any issue type. $auth = false; foreach ($ISSUE_TYPES as $type => $dummy) { if (AclMain::aclCheckIssue($type)) { $auth = true; break; } } if ($auth) { $tmp = getPatientData($pid, "squad"); if ($tmp['squad'] && ! AclMain::aclCheckCore('squads', $tmp['squad'])) { die(xlt('Not authorized')); } } else { echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Patient Issues")]); exit; } // Collect parameter(s) $category = empty($_REQUEST['category']) ? '' : $_REQUEST['category']; // Get patient's preferred language for the patient education URL. $tmp = getPatientData($pid, 'language'); $language = $tmp['language']; ?> <?php echo xlt('Patient Issues'); ?> xl('Medical Issues'), 'include_patient_name' => true, 'expandable' => true, 'expandable_files' => array("stats_full_patient_xpd", "external_data_patient_xpd", "patient_ledger_patient_xpd"),//all file names need suffix _xpd 'action' => "",//conceal, reveal, search, reset, link or back 'action_title' => "", 'action_href' => "",//only for actions - reset, link or back 'show_help_icon' => true, 'help_file_name' => "issues_dashboard_help.php" ); $oemr_ui = new OemrUI($arrOeUiSettings); ?>
displayHorizNavBarMenu(); ?>
$focustitles) { if (!AclMain::aclCheckIssue($focustype)) { continue; } if ($category) { // Only show this category if ($focustype != $category) { continue; } } if ($first) { $first = 0; } else { echo "
"; } // Show header $disptype = $focustitles[0]; echo "
" . text($disptype) . "\n"; if (AclMain::aclCheckIssue($focustype, '', array('write', 'addonly'))) { if (($focustype == 'allergy' || $focustype == 'medication') && $GLOBALS['erx_enable']) { echo "" . xlt('Add') . "\n"; } else { echo "" . xlt('Add') . "\n"; } } $canDelete = AclMain::aclCheckCore('admin', 'super'); if ($canDelete) { echo "\n"; } echo "
"; $canSelect = $canDelete; echo "
"; ?> "; } else { // Data entry has not happened to this type, so can show the none selection option. echo ""; } } // display issues while ($row = sqlFetchArray($pres)) { $rowid = $row['id']; $disptitle = trim($row['title']) ? $row['title'] : "[Missing Title]"; $ierow = sqlQuery("SELECT count(*) AS count FROM issue_encounter WHERE " . "list_id = ?", array($rowid)); // encount is used to toggle the color of the table-row output below ++$encount; $bgclass = (($encount & 1) ? "bg1" : "bg2"); $colorstyle = empty($row['enddate']) ? "style='color: var(--danger)'" : ""; // look up the diag codes $codetext = ""; if ($row['diagnosis'] != "") { $diags = explode(";", $row['diagnosis']); foreach ($diags as $diag) { $codedesc = lookup_code_descriptions($diag); list($codetype, $code) = explode(':', $diag); if ($codetext) { $codetext .= "
"; } $codetext .= "" . text($diag . " (" . $codedesc . ")") . ""; } } // calculate the status if ($row['outcome'] == "1" && $row['enddate'] != null) { // Resolved $statusCompute = generate_display_field(array('data_type' => '1','list_id' => 'outcome'), $row['outcome']); } elseif ($row['enddate'] == null) { $statusCompute = xlt("Active"); } else { if ($focustype == 'medical_problem') { // MU3 criteria, show medical problem's with end dates as a status of Completed. $statusCompute = xlt("Completed"); } else { $statusCompute = xlt("Inactive"); } } $click_class = 'statrow'; if ($row['erx_source'] == 1 && $focustype == 'allergy') { $click_class = ''; } elseif ($row['erx_uploaded'] == 1 && $focustype == 'medication') { $click_class = ''; } echo " \n"; if ($canSelect) { echo " \n"; } echo " \n"; echo " \n"; echo " \n"; // both codetext and statusCompute have already been escaped above with htmlspecialchars) echo " \n"; echo " \n"; echo " \n"; if ($focustype == "allergy") { echo " \n"; } if ($focustype == "allergy" || $focustype == "medical_problem") { $codeListName = (!empty($thistype) && ($thistype == 'medical_problem')) ? 'condition-verification' : 'allergyintolerance-verification'; echo " \n"; } echo " \n"; echo " \n"; echo " \n"; echo " "; echo " \n"; } } echo "
" . xlt("None{{Issue}}") . "
" . xlt("None{{Issue}}") . "
" . text($disptitle) . "" . text(trim(oeFormatDateTime($row['begdate']))) . " " . text(trim(oeFormatDateTime($row['enddate']))) . " " . $codetext . "" . $statusCompute . " "; echo generate_display_field(array('data_type' => '1','list_id' => 'occurrence'), $row['occurrence']); echo ""; echo generate_display_field(array('data_type' => '1','list_id' => 'reaction'), $row['reaction']); echo ""; echo generate_display_field(array('data_type' => '1','list_id' => $codeListName), $row['verification']); echo "" . text($row['referredby']) . "" . text(oeFormatDateTime($row['modifydate'])) . "" . text($row['comments']) . ""; echo " "; echo "
"; ?>
oeBelowContainerDiv();?>