4 * interface/super/rules/controllers/detail/view/view.php
7 * @link https://www.open-emr.org
8 * @author Aron Racho <aron@mi-squared.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2010-2011 Aron Racho <aron@mi-squared.com>
11 * @copyright Copyright (c) 2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 * @license There are segments of code in this file that have been generated via ChatGPT and are licensed as Public Domain, they are marked with a header and footer.
16 use OpenEMR\ClinicalDecisionRules\
Interface\Common
;
18 $rule = $viewBean->rule ?
>
20 <script src
="<?php Common::js_src('detail.js') ?>"></script
>
22 var detail
= new rule_detail( {editable
: <?php
echo $rule->isEditable() ?
"true" : "false"; ?
>});
27 <header
class="title"><?php
echo xlt('Rule Detail'); ?
>
28 <a href
="index.php?action=browse!list" class="btn btn-primary btn-back mx-auto" onclick
="top.restoreSession();"><?php
echo xlt('Back'); ?
></a
>
31 <div
class="rule_detail">
37 <?php
echo xlt('Summary'); ?
>
38 <a href
="index.php?action=edit!summary&id=<?php echo attr_url($rule->id); ?>"
39 class="action_link" id
="edit_summary" onclick
="top.restoreSession()">(<?php
echo xlt('edit'); ?
>)</a
>
41 <p
><b
><?php
echo xlt($rule->title
); ?
></b
>
42 (<?php
echo Common
::implode_funcs(", ", $rule->getRuleTypeLabels(), array('xlt')); ?
>)
44 <p
><b
><?php
echo xlt('Bibliographic Citation'); ?
>:</b
> 
;<?php
echo text($rule->bibliographic_citation
); ?
></p
>
45 <p
><b
><?php
echo xlt('Developer'); ?
>:</b
> 
;<?php
echo text($rule->developer
); ?
></p
>
46 <p
><b
><?php
echo xlt('Funding Source'); ?
>:</b
> 
;<?php
echo text($rule->funding_source
); ?
></p
>
47 <p
><b
><?php
echo xlt('Release'); ?
>:</b
> 
;<?php
echo text($rule->release
); ?
></p
>
48 <p
><b
><?php
echo xlt('Web Reference'); ?
>:</b
> 
;<?php
echo text($rule->web_reference
); ?
></p
>
49 <p
><b
><?php
echo xlt('Referential CDS (codetype:code)'); ?
>:</b
> 
;<?php
echo text($rule->linked_referential_cds
); ?
></p
>
51 /** Note the following code is in the Public Domain and was generated using ChatGPT */
53 <p
><b
><?php
echo xlt('Use of Patient\'s Race'); ?
>:</b
> 
;<?php
echo text($rule->patient_race_usage
); ?
></p
>
54 <p
><b
><?php
echo xlt('Use of Patient\'s Ethnicity'); ?
>:</b
> 
;<?php
echo text($rule->patient_ethnicity_usage
); ?
></p
>
55 <p
><b
><?php
echo xlt('Use of Patient\'s Language'); ?
>:</b
> 
;<?php
echo text($rule->patient_language_usage
); ?
></p
>
56 <p
><b
><?php
echo xlt('Use of Patient\'s Sexual Orientation'); ?
>:</b
> 
;<?php
echo text($rule->patient_sexual_orientation_usage
); ?
></p
>
57 <p
><b
><?php
echo xlt('Use of Patient\'s Gender Identity'); ?
>:</b
> 
;<?php
echo text($rule->patient_gender_identity_usage
); ?
></p
>
58 <p
><b
><?php
echo xlt('Use of Patient\'s Sex'); ?
>:</b
> 
;<?php
echo text($rule->patient_sex_usage
); ?
></p
>
59 <p
><b
><?php
echo xlt('Use of Patient\'s Date of Birth'); ?
>:</b
> 
;<?php
echo text($rule->patient_dob_usage
); ?
></p
>
60 <p
><b
><?php
echo xlt('Use of Patient\'s Social Determinants of Health'); ?
>:</b
> 
;<?php
echo text($rule->patient_sodh_usage
); ?
></p
>
61 <p
><b
><?php
echo xlt('Use of Patient\'s Health Status Assessments'); ?
>:</b
> 
;<?php
echo text($rule->patient_health_status_usage
); ?
></p
>
63 /** End ChatGPT Public Domain Code */
67 <!-- reminder intervals
-->
69 <?php
$intervals = $rule->reminderIntervals
; if ($intervals) { ?
>
72 <?php
echo xlt('Reminder intervals'); ?
>
73 <a href
="index.php?action=edit!intervals&id=<?php echo attr_url($rule->id); ?>" class="action_link" onclick
="top.restoreSession()">(<?php
echo xlt('edit'); ?
>)</a
>
76 <?php
if ($intervals->getTypes()) {?
>
79 <span
class="left_col colhead"><u
><?php
echo xlt('Type'); ?
></u
></span
>
80 <span
class="end_col colhead"><u
><?php
echo xlt('Detail'); ?
></u
></span
>
83 <?php
foreach ($intervals->getTypes() as $type) {?
>
85 <span
class="left_col"><?php
echo xlt($type->lbl
); ?
></span
>
86 <span
class="end_col">
87 <?php
echo text($intervals->displayDetails($type)); ?
>
93 <p
><?php
echo xlt('None defined'); ?
></p
>
99 <!-- rule filter criteria
-->
101 <?php
$filters = $rule->filters
; if ($filters) { ?
>
102 <div
class="section">
103 <p
class="header"><?php
echo xlt('Demographics filter criteria'); ?
> <a href
="index.php?action=edit!add_criteria&id=<?php echo attr_url($rule->id); ?>&criteriaType=filter" class="action_link" onclick
="top.restoreSession()">(<?php
echo xlt('add'); ?
>)</a
></p
>
105 <?php
if ($filters->criteria
) { ?
>
107 <span
class="left_col"> 
;</span
>
108 <span
class="mid_col"><u
><?php
echo xlt('Criteria'); ?
></u
></span
>
109 <span
class="mid_col"><u
><?php
echo xlt('Characteristics'); ?
></u
></span
>
110 <span
class="end_col"><u
><?php
echo xlt('Requirements'); ?
></u
></span
>
113 <?php
foreach ($filters->criteria
as $criteria) { ?
>
115 <span
class="left_col">
116 <a href
="index.php?action=edit!filter&id=<?php echo attr_url($rule->id); ?>&guid=<?php echo attr_url($criteria->guid); ?>"
117 class="action_link" onclick
="top.restoreSession()">
118 (<?php
echo xlt('edit'); ?
>)
120 <a href
="index.php?action=edit!delete_filter&id=<?php echo attr_url($rule->id); ?>&guid=<?php echo attr_url($criteria->guid); ?>"
121 class="action_link" onclick
="top.restoreSession()">
122 (<?php
echo xlt('delete'); ?
>)
125 <span
class="mid_col"><?php
echo( text($criteria->getTitle()) ); ?
></span
>
126 <span
class="mid_col"><?php
echo( text($criteria->getCharacteristics()) ); ?
></span
>
127 <span
class="end_col"><?php
echo( text($criteria->getRequirements()) ); ?
></span
>
131 <p
><?php
echo xlt('None defined'); ?
></p
>
142 <div
class="section">
143 <p
class="header"><?php
echo xlt('Target/Action Groups'); ?
></p
>
145 foreach ($rule->groups
as $group) {
146 $groupId = $group->groupId
; ?
>
149 <!-- rule target criteria
-->
152 <?php
$targets = $group->ruleTargets
; if ($targets) { ?
>
153 <div
class="section">
154 <p
class="header"><?php
echo xlt('Clinical targets'); ?
>
155 <a href
="index.php?action=edit!add_criteria&id=<?php echo attr_url($rule->id); ?>&group_id=<?php echo attr_url($group->groupId); ?>&criteriaType=target" class="action_link" onclick
="top.restoreSession()">
156 (<?php
echo xlt('add'); ?
>)
160 <?php
if ($targets->criteria
) { ?
>
162 <span
class="left_col"> 
;</span
>
163 <span
class="mid_col"><u
><?php
echo xlt('Criteria'); ?
></u
></span
>
164 <span
class="mid_col"><u
><?php
echo xlt('Characteristics'); ?
></u
></span
>
165 <span
class="end_col"><u
><?php
echo xlt('Requirements'); ?
></u
></span
>
168 <?php
foreach ($targets->criteria
as $criteria) { ?
>
169 <div
class="form-row">
170 <span
class="left_col">
171 <a href
="index.php?action=edit!target&id=<?php echo attr_url($rule->id); ?>&guid=<?php echo attr_url($criteria->guid); ?>"
172 class="action_link" onclick
="top.restoreSession()">
173 (<?php
echo xlt('edit'); ?
>)
175 <a href
="index.php?action=edit!delete_target&id=<?php echo attr_url($rule->id); ?>&guid=<?php echo attr_url($criteria->guid); ?>"
176 class="action_link" onclick
="top.restoreSession()">
177 (<?php
echo xlt('delete'); ?
>)
180 <span
class="mid_col"><?php
echo( text($criteria->getTitle()) ); ?
></span
>
181 <span
class="mid_col"><?php
echo( text($criteria->getCharacteristics()) ); ?
></span
>
182 <span
class="end_col">
183 <?php
echo( text($criteria->getRequirements()) ) ?
>
184 <?php
echo is_null($criteria->getInterval()) ?
"" :
185 " | " . xlt('Interval') . ": " . text($criteria->getInterval()); ?
>
190 <p
><?php
echo xlt('None defined'); ?
></p
>
197 <!-- rule actions
-->
199 <?php
$actions = $group->ruleActions
; if ($actions) { ?
>
200 <div
class="section">
201 <p
class="header"><?php
echo xlt('Actions'); ?
>
202 <a href
="index.php?action=edit!add_action&id=<?php echo attr_url($rule->id); ?>&group_id=<?php echo attr_url($group->groupId);?>" class="action_link" onclick
="top.restoreSession()">
203 (<?php
echo xlt('add'); ?
>)
207 <?php
if ($actions->actions
) { ?
>
209 <span
class="left_col"> 
;</span
>
210 <span
class="end_col"><u
><?php
echo xlt('Category/Title'); ?
></u
></span
>
214 <?php
foreach ($actions->actions
as $action) { ?
>
215 <span
class="left_col">
216 <a href
="index.php?action=edit!action&id=<?php echo attr_url($rule->id); ?>&guid=<?php echo attr_url($action->guid); ?>"
217 class="action_link" onclick
="top.restoreSession()">
218 (<?php
echo xlt('edit'); ?
>)</a
>
219 <a href
="index.php?action=edit!delete_action&id=<?php echo attr_url($rule->id); ?>&guid=<?php echo attr_url($action->guid); ?>"
220 class="action_link" onclick
="top.restoreSession()">
221 (<?php
echo xlt('delete'); ?
>)</a
>
223 <span
class="end_col"><?php
echo text($action->getTitle()); ?
></span
>
227 <p
><?php
echo xlt('None defined'); ?
></p
>
234 } // iteration over groups ?>
236 <?php
$nextGroupId = $groupId +
1; ?
>
237 <div
class="section">
238 <p
class="header"><?php
echo xlt('Clinical targets'); ?
>
239 <a href
="index.php?action=edit!add_criteria&id=<?php echo attr_url($rule->id); ?>&group_id=<?php echo attr_url($nextGroupId); ?>&criteriaType=target" class="action_link" onclick
="top.restoreSession()">
240 (<?php
echo xlt('add'); ?
>)
244 <div
class="section">
245 <p
class="header"><?php
echo xlt('Actions'); ?
>
246 <a href
="index.php?action=edit!add_action&id=<?php echo attr_url($rule->id); ?>&group_id=<?php echo attr_url($nextGroupId); ?>" class="action_link" onclick
="top.restoreSession()">
247 (<?php
echo xlt('add'); ?
>)