Highway to PSR2
[openemr.git] / interface / super / rules / controllers / detail / view / view.php
blobec627d6a3c74ee649e883506c181bd2ee90ac5cc
1 <?php
2 // Copyright (C) 2010-2011 Aron Racho <aron@mi-squred.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 $rule = $viewBean->rule ?>
11 <script language="javascript" src="<?php js_src('detail.js') ?>"></script>
12 <script type="text/javascript">
13 var detail = new rule_detail( {editable: <?php echo $rule->isEditable() ? "true":"false"; ?>});
14 detail.init();
15 </script>
17 <table class="header">
18 <tr >
19 <td class="title"><?php echo out(xl('Rule Detail')); ?></td>
20 <td>
21 <a href="index.php?action=browse!list" class="iframe_medium css_button" onclick="top.restoreSession()"><span><?php echo out(xl('Back')); ?></span></a>
22 </td>
23 </tr>
24 </table>
26 <div class="rule_detail">
27 <!-- -->
28 <!-- summary -->
29 <!-- -->
30 <div class="section text">
31 <p class="header">
32 <?php echo out(xl('Summary')); ?>
33 <a href="index.php?action=edit!summary&id=<?php echo out($rule->id); ?>"
34 class="action_link" id="edit_summary" onclick="top.restoreSession()">(<?php echo out(xl('edit')); ?>)</a>
35 </p>
36 <p><b><?php echo out(xl($rule->title)); ?></b>
37 (<?php echo implode_funcs(", ", $rule->getRuleTypeLabels(), array( 'xl', 'out' )); ?>)
38 </p>
39 <p><?php echo out(xl('Developer')); ?><b>:</b>&nbsp;<?php echo out($rule->developer); ?></p>
40 <p><?php echo out(xl('Funding Source')); ?><b>:</b>&nbsp;<?php echo out($rule->funding_source); ?></p>
41 <p><?php echo out(xl('Release')); ?><b>:</b>&nbsp;<?php echo out($rule->release); ?></p>
42 <p><?php echo out(xl('Web Reference')); ?><b>:</b>&nbsp;<?php echo out($rule->web_ref); ?></p>
43 </div>
45 <!-- -->
46 <!-- reminder intervals -->
47 <!-- -->
48 <?php $intervals = $rule->reminderIntervals; if ($intervals) { ?>
49 <div class="section text">
50 <p class="header">
51 <?php echo out(xl('Reminder intervals')); ?>
52 <a href="index.php?action=edit!intervals&id=<?php echo $rule->id ?>" class="action_link" onclick="top.restoreSession()">(<?php echo out(xl('edit')); ?>)</a>
53 </p>
55 <?php if ($intervals->getTypes()) {?>
56 <p>
57 <div>
58 <span class="left_col colhead"><u><?php echo out(xl('Type')); ?></u></span>
59 <span class="end_col colhead"><u><?php echo out(xl('Detail')); ?></u></span>
60 </div>
62 <?php foreach ($intervals->getTypes() as $type) {?>
63 <div>
64 <span class="left_col"><?php echo out(xl($type->lbl)); ?></span>
65 <span class="end_col">
66 <?php echo out($intervals->displayDetails($type)); ?>
67 </span>
68 </div>
69 <?php } ?>
70 </p>
71 <?php } else { ?>
72 <p><?php echo out(xl('None defined')); ?></p>
73 <?php } ?>
74 </div>
75 <?php } ?>
77 <!-- -->
78 <!-- rule filter criteria -->
79 <!-- -->
80 <?php $filters = $rule->filters; if ($filters) { ?>
81 <div class="section text">
82 <p class="header"><?php echo out(xl('Demographics filter criteria')); ?> <a href="index.php?action=edit!add_criteria&id=<?php echo out($rule->id); ?>&criteriaType=filter" class="action_link" onclick="top.restoreSession()">(<?php echo out(xl('add')); ?>)</a></p>
83 <p>
84 <?php if ($filters->criteria) { ?>
86 <div>
87 <span class="left_col">&nbsp;</span>
88 <span class="mid_col"><u><?php echo out(xl('Criteria')); ?></u></span>
89 <span class="mid_col"><u><?php echo out(xl('Characteristics')); ?></u></span>
90 <span class="end_col"><u><?php echo out(xl('Requirements')); ?></u></span>
91 </div>
93 <?php foreach ($filters->criteria as $criteria) { ?>
94 <div>
95 <span class="left_col">
96 <a href="index.php?action=edit!filter&id=<?php echo out($rule->id); ?>&guid=<?php echo out($criteria->guid); ?>"
97 class="action_link" onclick="top.restoreSession()">
98 (<?php echo out(xl('edit')); ?>)
99 </a>
100 <a href="index.php?action=edit!delete_filter&id=<?php echo out($rule->id); ?>&guid=<?php echo out($criteria->guid); ?>"
101 class="action_link" onclick="top.restoreSession()">
102 (<?php echo out(xl('delete')); ?>)
103 </a>
104 </span>
105 <span class="mid_col"><?php echo( out($criteria->getTitle()) ); ?></span>
106 <span class="mid_col"><?php echo( out($criteria->getCharacteristics()) ); ?></span>
107 <span class="end_col"><?php echo( out($criteria->getRequirements()) ); ?></span>
108 </div>
109 <?php } ?>
110 <?php } else { ?>
111 <p><?php echo out(xl('None defined')); ?></p>
112 <?php } ?>
113 </p>
114 </div>
115 <?php } ?>
117 <!-- -->
118 <!-- rule groups -->
119 <!-- -->
122 <div class="section text">
123 <p class="header"><?php echo out(xl('Target/Action Groups')); ?></p>
124 <?php $groupId = 0;
125 foreach ($rule->groups as $group) {
126 $groupId = $group->groupId; ?>
127 <div class="group">
128 <!-- -->
129 <!-- rule target criteria -->
130 <!-- -->
132 <?php $targets = $group->ruleTargets; if ($targets) { ?>
133 <div class="section text">
134 <p class="header"><?php echo out(xl('Clinical targets')); ?>
135 <a href="index.php?action=edit!add_criteria&id=<?php echo out($rule->id); ?>&group_id=<?php echo out($group->groupId); ?>&criteriaType=target" class="action_link" onclick="top.restoreSession()">
136 (<?php echo out(xl('add')); ?>)
137 </a>
138 </p>
140 <?php if ($targets->criteria) { ?>
142 <div>
143 <span class="left_col">&nbsp;</span>
144 <span class="mid_col"><u><?php echo out(xl('Criteria')); ?></u></span>
145 <span class="mid_col"><u><?php echo out(xl('Characteristics')); ?></u></span>
146 <span class="end_col"><u><?php echo out(xl('Requirements')); ?></u></span>
147 </div>
149 <?php foreach ($targets->criteria as $criteria) { ?>
150 <div class="row">
151 <span class="left_col">
152 <a href="index.php?action=edit!target&id=<?php echo out($rule->id); ?>&guid=<?php echo out($criteria->guid); ?>"
153 class="action_link" onclick="top.restoreSession()">
154 (<?php echo out(xl('edit')); ?>)
155 </a>
156 <a href="index.php?action=edit!delete_target&id=<?php echo out($rule->id); ?>&guid=<?php echo out($criteria->guid); ?>"
157 class="action_link" onclick="top.restoreSession()">
158 (<?php echo out(xl('delete')); ?>)
159 </a>
160 </span>
161 <span class="mid_col"><?php echo( out($criteria->getTitle()) ); ?></span>
162 <span class="mid_col"><?php echo( out($criteria->getCharacteristics()) ); ?></span>
163 <span class="end_col">
164 <?php echo( $criteria->getRequirements() ) ?>
165 <?php echo is_null($criteria->getInterval()) ? "" :
166 " | " . out(xl('Interval')) . ": " . out($criteria->getInterval()); ?>
167 </span>
168 </div>
169 <?php } ?>
170 <?php } else { ?>
171 <p><?php echo out(xl('None defined')); ?></p>
172 <?php } ?>
174 </p>
175 </div>
176 <?php } ?>
178 <!-- -->
179 <!-- rule actions -->
180 <!-- -->
181 <?php $actions = $group->ruleActions; if ($actions) { ?>
182 <div class="section text">
183 <p class="header"><?php echo out(xl('Actions')); ?>
184 <a href="index.php?action=edit!add_action&id=<?php echo out($rule->id); ?>&group_id=<?php echo out($group->groupId);?>" class="action_link" onclick="top.restoreSession()">
185 (<?php echo out(xl('add')); ?>)
186 </a>
187 </p>
189 <?php if ($actions->actions) { ?>
190 <div>
191 <span class="left_col">&nbsp;</span>
192 <span class="end_col"><u><?php echo out(xl('Category/Title')); ?></u></span>
193 </div>
195 <div>
196 <?php foreach ($actions->actions as $action) { ?>
197 <span class="left_col">
198 <a href="index.php?action=edit!action&id=<?php echo out($rule->id); ?>&guid=<?php echo out($action->guid); ?>"
199 class="action_link" onclick="top.restoreSession()">
200 (<?php echo out(xl('edit')); ?>)</a>
201 <a href="index.php?action=edit!delete_action&id=<?php echo out($rule->id); ?>&guid=<?php echo out($action->guid); ?>"
202 class="action_link" onclick="top.restoreSession()">
203 (<?php echo out(xl('delete')); ?>)</a>
204 </span>
205 <span class="end_col"><?php echo out($action->getTitle()); ?></span>
206 <?php } ?>
207 </div>
208 <?php } else { ?>
209 <p><?php echo out(xl('None defined')); ?></p>
210 <?php } ?>
211 </p>
212 </div>
213 <?php } ?>
214 </div>
215 <?php
216 } // iteration over groups ?>
217 <div class="group">
218 <?php $nextGroupId = $groupId + 1; ?>
219 <div class="section text">
220 <p class="header"><?php echo out(xl('Clinical targets')); ?>
221 <a href="index.php?action=edit!add_criteria&id=<?php echo out($rule->id); ?>&group_id=<?php echo $nextGroupId; ?>&criteriaType=target" class="action_link" onclick="top.restoreSession()">
222 (<?php echo out(xl('add')); ?>)
223 </a>
224 </p>
225 </div>
226 <div class="section text">
227 <p class="header"><?php echo out(xl('Actions')); ?>
228 <a href="index.php?action=edit!add_action&id=<?php echo out($rule->id); ?>&group_id=<?php echo $nextGroupId; ?>" class="action_link" onclick="top.restoreSession()">
229 (<?php echo out(xl('add')); ?>)
230 </a>
231 </p>
232 </div>
233 </div>
235 </div>
237 </div>