CDR Module: Incorporated restore session in admin gui scripts.
[openemr.git] / interface / super / rules / controllers / detail / view / view.php
blobc538f581ae19e99546831c22553a9df662b5b8d7
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 </div>
41 <!-- -->
42 <!-- reminder intervals -->
43 <!-- -->
44 <?php $intervals = $rule->reminderIntervals; if ( $intervals) { ?>
45 <div class="section text">
46 <p class="header">
47 <?php echo out( xl( 'Reminder intervals' ) ); ?>
48 <a href="index.php?action=edit!intervals&id=<?php echo $rule->id ?>" class="action_link" onclick="top.restoreSession()">(<?php echo out( xl( 'edit' ) ); ?>)</a>
49 </p>
51 <?php if ( $intervals->getTypes() ) {?>
52 <p>
53 <div>
54 <span class="left_col colhead"><u><?php echo out( xl( 'Type' ) ); ?></u></span>
55 <span class="end_col colhead"><u><?php echo out( xl( 'Detail' ) ); ?></u></span>
56 </div>
58 <?php foreach($intervals->getTypes() as $type) {?>
59 <div>
60 <span class="left_col"><?php echo out( xl( $type->lbl ) ); ?></span>
61 <span class="end_col">
62 <?php echo out( $intervals->displayDetails( $type ) ); ?>
63 </span>
64 </div>
65 <?php } ?>
66 </p>
67 <?php } else { ?>
68 <p><?php echo out( xl( 'None defined' ) ); ?></p>
69 <?php } ?>
70 </div>
71 <?php } ?>
73 <!-- -->
74 <!-- rule filter criteria -->
75 <!-- -->
76 <?php $filters = $rule->filters; if ( $filters ) { ?>
77 <div class="section text">
78 <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>
79 <p>
80 <?php if ( $filters->criteria ) { ?>
82 <div>
83 <span class="left_col">&nbsp;</span>
84 <span class="mid_col"><u><?php echo out( xl( 'Criteria' ) ); ?></u></span>
85 <span class="mid_col"><u><?php echo out( xl( 'Characteristics' ) ); ?></u></span>
86 <span class="end_col"><u><?php echo out( xl( 'Requirements' ) ); ?></u></span>
87 </div>
89 <?php foreach($filters->criteria as $criteria) { ?>
90 <div>
91 <span class="left_col">
92 <a href="index.php?action=edit!filter&id=<?php echo out( $rule->id ); ?>&guid=<?php echo out( $criteria->guid ); ?>"
93 class="action_link" onclick="top.restoreSession()">
94 (<?php echo out( xl( 'edit' ) ); ?>)
95 </a>
96 <a href="index.php?action=edit!delete_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( 'delete' ) ); ?>)
99 </a>
100 </span>
101 <span class="mid_col"><?php echo( out( $criteria->getTitle() ) ); ?></span>
102 <span class="mid_col"><?php echo( out( $criteria->getCharacteristics() ) ); ?></span>
103 <span class="end_col"><?php echo( out( $criteria->getRequirements() ) ); ?></span>
104 </div>
105 <?php } ?>
106 <?php } else { ?>
107 <p><?php echo out( xl( 'None defined' ) ); ?></p>
108 <?php } ?>
109 </p>
110 </div>
111 <?php } ?>
113 <!-- -->
114 <!-- rule groups -->
115 <!-- -->
118 <div class="section text">
119 <p class="header"><?php echo out( xl( 'Target/Action Groups' ) ); ?></p>
120 <?php $groupId = 0; foreach ( $rule->groups as $group ) { $groupId = $group->groupId; ?>
121 <div class="group">
122 <!-- -->
123 <!-- rule target criteria -->
124 <!-- -->
126 <?php $targets = $group->ruleTargets; if ( $targets ) { ?>
127 <div class="section text">
128 <p class="header"><?php echo out( xl( 'Clinical targets' ) ); ?>
129 <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()">
130 (<?php echo out( xl( 'add' ) ); ?>)
131 </a>
132 </p>
134 <?php if ( $targets->criteria ) { ?>
136 <div>
137 <span class="left_col">&nbsp;</span>
138 <span class="mid_col"><u><?php echo out( xl( 'Criteria' ) ); ?></u></span>
139 <span class="mid_col"><u><?php echo out( xl( 'Characteristics' ) ); ?></u></span>
140 <span class="end_col"><u><?php echo out( xl( 'Requirements' ) ); ?></u></span>
141 </div>
143 <?php foreach($targets->criteria as $criteria) { ?>
144 <div class="row">
145 <span class="left_col">
146 <a href="index.php?action=edit!target&id=<?php echo out( $rule->id ); ?>&guid=<?php echo out( $criteria->guid ); ?>"
147 class="action_link" onclick="top.restoreSession()">
148 (<?php echo out( xl( 'edit' ) ); ?>)
149 </a>
150 <a href="index.php?action=edit!delete_target&id=<?php echo out( $rule->id ); ?>&guid=<?php echo out( $criteria->guid ); ?>"
151 class="action_link" onclick="top.restoreSession()">
152 (<?php echo out( xl( 'delete' ) ); ?>)
153 </a>
154 </span>
155 <span class="mid_col"><?php echo( out( $criteria->getTitle() ) ); ?></span>
156 <span class="mid_col"><?php echo( out( $criteria->getCharacteristics() ) ); ?></span>
157 <span class="end_col">
158 <?php echo( $criteria->getRequirements() ) ?>
159 <?php echo is_null( $criteria->getInterval() ) ? "" :
160 " | " . out( xl( 'Interval' ) ) . ": " . out( $criteria->getInterval() ); ?>
161 </span>
162 </div>
163 <?php } ?>
164 <?php } else { ?>
165 <p><?php echo out( xl( 'None defined' ) ); ?></p>
166 <?php } ?>
168 </p>
169 </div>
170 <?php } ?>
172 <!-- -->
173 <!-- rule actions -->
174 <!-- -->
175 <?php $actions = $group->ruleActions; if ( $actions ) { ?>
176 <div class="section text">
177 <p class="header"><?php echo out( xl( 'Actions' ) ); ?>
178 <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()">
179 (<?php echo out( xl( 'add' ) ); ?>)
180 </a>
181 </p>
183 <?php if ( $actions->actions) { ?>
184 <div>
185 <span class="left_col">&nbsp;</span>
186 <span class="end_col"><u><?php echo out( xl( 'Category/Title' ) ); ?></u></span>
187 </div>
189 <div>
190 <?php foreach($actions->actions as $action) { ?>
191 <span class="left_col">
192 <a href="index.php?action=edit!action&id=<?php echo out( $rule->id ); ?>&guid=<?php echo out( $action->guid ); ?>"
193 class="action_link" onclick="top.restoreSession()">
194 (<?php echo out( xl( 'edit' ) ); ?>)</a>
195 <a href="index.php?action=edit!delete_action&id=<?php echo out( $rule->id ); ?>&guid=<?php echo out( $action->guid ); ?>"
196 class="action_link" onclick="top.restoreSession()">
197 (<?php echo out( xl( 'delete' ) ); ?>)</a>
198 </span>
199 <span class="end_col"><?php echo out( $action->getTitle() ); ?></span>
200 <?php } ?>
201 </div>
202 <?php } else { ?>
203 <p><?php echo out( xl( 'None defined' ) ); ?></p>
204 <?php } ?>
205 </p>
206 </div>
207 <?php } ?>
208 </div>
209 <?php } // iteration over groups ?>
210 <div class="group">
211 <?php $nextGroupId = $groupId + 1; ?>
212 <div class="section text">
213 <p class="header"><?php echo out( xl( 'Clinical targets' ) ); ?>
214 <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()">
215 (<?php echo out( xl( 'add' ) ); ?>)
216 </a>
217 </p>
218 </div>
219 <div class="section text">
220 <p class="header"><?php echo out( xl( 'Actions' ) ); ?>
221 <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()">
222 (<?php echo out( xl( 'add' ) ); ?>)
223 </a>
224 </p>
225 </div>
226 </div>
228 </div>
230 </div>