2 // Copyright (C) 2010-2011 Aron Racho <aron@mi-squred.com>
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"; ?
>});
17 <table
class="header">
19 <td
class="title"><?php
echo out( xl( 'Rule Detail' ) ); ?
></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
>
26 <div
class="rule_detail">
30 <div
class="section text">
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
>
36 <p
><b
><?php
echo out( xl( $rule->title
) ); ?
></b
>
37 (<?php
echo implode_funcs( ", ", $rule->getRuleTypeLabels(), array( 'xl', 'out' ) ); ?
>)
42 <!-- reminder intervals
-->
44 <?php
$intervals = $rule->reminderIntervals
; if ( $intervals) { ?
>
45 <div
class="section text">
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
>
51 <?php
if ( $intervals->getTypes() ) {?
>
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
>
58 <?php
foreach($intervals->getTypes() as $type) {?
>
60 <span
class="left_col"><?php
echo out( xl( $type->lbl
) ); ?
></span
>
61 <span
class="end_col">
62 <?php
echo out( $intervals->displayDetails( $type ) ); ?
>
68 <p
><?php
echo out( xl( 'None defined' ) ); ?
></p
>
74 <!-- rule filter criteria
-->
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
>
80 <?php
if ( $filters->criteria
) { ?
>
83 <span
class="left_col"> 
;</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
>
89 <?php
foreach($filters->criteria
as $criteria) { ?
>
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' ) ); ?
>)
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' ) ); ?
>)
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
>
107 <p
><?php
echo out( xl( 'None defined' ) ); ?
></p
>
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
; ?
>
123 <!-- rule target criteria
-->
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' ) ); ?
>)
134 <?php
if ( $targets->criteria
) { ?
>
137 <span
class="left_col"> 
;</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
>
143 <?php
foreach($targets->criteria
as $criteria) { ?
>
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' ) ); ?
>)
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' ) ); ?
>)
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() ); ?
>
165 <p
><?php
echo out( xl( 'None defined' ) ); ?
></p
>
173 <!-- rule actions
-->
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' ) ); ?
>)
183 <?php
if ( $actions->actions
) { ?
>
185 <span
class="left_col"> 
;</span
>
186 <span
class="end_col"><u
><?php
echo out( xl( 'Category/Title' ) ); ?
></u
></span
>
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
>
199 <span
class="end_col"><?php
echo out( $action->getTitle() ); ?
></span
>
203 <p
><?php
echo out( xl( 'None defined' ) ); ?
></p
>
209 <?php
} // iteration over groups ?>
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' ) ); ?
>)
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' ) ); ?
>)