forked from OHDSI/Calypso
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
285 lines (278 loc) · 12.7 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE html>
<html>
<head>
<title>CALYPSO</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="icon" type="image/ico" href="favicon.ico" />
<link href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" href="css/bootstrap.min.css" />
<link rel="stylesheet" href="css/bootstrap-theme.min.css" />
<link rel="stylesheet" href="css/calypso.boostrap.css" />
<link rel="stylesheet" href="css/calypso.css" />
<style>
.divtext {
border: ridge 2px;
padding: 5px;
width: 100%;
min-height: 1.2em;
overflow: auto;
white-space: pre-wrap;
border: 1px solid rgb(204, 204, 204);
background-color: rgb(238, 238, 238);
}
</style>
<script src="js/require.js"></script>
<script src="js/main.js"></script>
</head>
<body>
<div data-bind="visible: selectedView() != null" id="wrapper" style="display:none">
<table>
<tr>
<td style="padding: 3px">
<img src="images/ohdsi_logo.png" alt="OHDSI">
</td>
<td style="padding: 3px">
<div style="font-family: Arial; font-size: 18px; color: #777; line-height: 18px">CALYPSO</div>
<div style="font-family: Arial; font-size: 10px; color: #777; line-height: 10px">Criteria Assessment Logic for Your
<br/>Population Studies of Observations</div>
</td>
<td style="padding-left: 75px;"><a href="#/" class="menu-link">Feasibility Study List</a></td>
<td style="padding-left:75px"><a href="help.html" target="new" class="menu-link">Help</a></td>
</tr>
</table>
<div class="container">
<div data-bind="visible: selectedView() == 'list'">
<table class="stripe compact hover" cellspacing="0" width="100%" data-bind="dataTable:{
onRowClick: selectStudy,
data: studyList(),
options: {
deferRender: true,
orderClasses: false,
autoWidth: true,
order: [ 1, 'asc' ],
columns: [
{ data: 'id', title: 'Id' },
{ data: 'name', title: 'Title' },
{ data: 'description', title: 'Description'}
],
language: {
search: 'Filter Studies:'
}
}
}">
</table>
<button data-bind="click: function() { router.setRoute('/new'); }">New Study</button>
</div>
<div data-bind="visible: selectedView() == 'detail'">
<div data-bind="if: selectedStudy()">
<table>
<tbody>
<tr>
<td>
<textarea maxlength="250" style="font-size: 18px; line-height: 1em; width: 500px; resize: none; overflow: hidden; word-wrap: break-word;" class="inputField" data-bind="textInput: selectedStudy().name, css: { emptyInput: !(selectedStudy().name() && (selectedStudy().name().length > 0)) }, jqAutoresize: {append: ''}"></textarea>
</td>
<td style="padding-left: 5px;">
<button class="button button-small" data-bind="click: save, enable: (dirtyFlag().isDirty() && !isRunning()), css: {'button-flat-primary': !dirtyFlag().isDirty, 'button-flat-caution': dirtyFlag().isDirty}">Save</button>
<button class="button button-small button-flat-primary" data-bind="click: showImprtExport">Import</button>
<!-- ko if: selectedStudy().id() != null -->
<button class="button button-small button-flat-primary" data-bind="click: copy, enable: !dirtyFlag().isDirty()">Copy</button>
<div class="generateAction" data-bind="ddSlickAction: generateActionsSettings "></div>
<!-- ko ifnot: isRunning -->
<button class="button button-small button-flat-caution" data-bind="click: $root.delete">Delete</button>
<!-- /ko -->
<!-- /ko -->
<button class="button button-flat-primary button-small" data-bind="click: showSql">Show SQL</button>
</td>
</tr>
<tr>
<td colspan="2" class="study_description">
<div class="header">Description</div>
<div width="100%"><textarea maxlength="1000" data-bind="textInput: selectedStudy().description, jqAutoresize: {append: ''}" style="background-color: #eee; border: solid 1px #ccc; resize: none; outline: none; width: 800px;"></textarea></div>
</td>
</tr>
</tbody>
</table>
<table>
<tbody>
<tr>
<!-- ko if: selectedStudy().indexCohortId() -->
<td class="header">Index Cohort ID: </td>
<td> <span data-bind="text: selectedStudy().indexCohortId"></span></td>
<!-- /ko -->
<!-- ko if: selectedStudy().matchingCohortId() -->
<td width="20"></td>
<td class="header">Matching Cohort ID:</td>
<td> <span data-bind="text: selectedStudy().matchingCohortId"></span></td>
<!-- /ko -->
</tr>
</tbody>
</table>
<div class="tabs" data-bind="tabs: { widget: tabWidget }">
<ul>
<li>
<a data-bind="attr: { title: 'Index Rule', href: '#indexRule' }, text: 'Index Rule'"></a>
</li>
<li>
<a data-bind="attr: { title: 'Inclusion Rules', href: '#inclusionRules' }, text: 'Inclusion Rules'"></a>
</li>
<li data-bind="attr: { 'aria-controls': 'conceptsets' }">
<a data-bind="attr: { title: 'Concept Sets', href: '#conceptsets' }, text: 'Concept Sets'"></a>
</li>
<li data-bind="attr: { 'aria-controls': 'printfriendly' }">
<a data-bind="attr: { title: 'Print Friendly', href: '#printfriendly' }, text: 'Print Friendly'"></a>
</li>
<li>
<a data-bind="attr: { title: 'Results', href: '#results' }">Results
<!-- ko if: isRunning -->
<img class="spin" src="images/running.png" />
<!-- /ko --></a>
</li>
</ul>
<div data-bind="attr: { id: 'indexRule' }">
<div class="tab_contents" data-bind="eventListener: [{ event: 'click', selector: '.addConceptSet', callback: addConceptSet}]" >
<!-- ko with: selectedStudy() -->
<div>
Description:<br/>
<div contenteditable class="divtext" data-bind="htmlValue:indexDescription"></div>
<cohort-expression-editor params="expression: indexRule, widget: $parent.indexRuleEditor"></cohort-expression-editor>
</div>
<!-- /ko -->
</div>
</div>
<div data-bind="attr: { id: 'inclusionRules' }">
<div class="tab_contents" data-bind="eventListener: [
{ event: 'click', selector: '.copyInclusionRule', callback: copyInclusionRule},
{ event: 'click', selector: '.deleteInclusionRule', callback: deleteInclusionRule},
{ event: 'click', selector: '.addConceptSet', callback: addConceptSet}]" >
<table style="width: 100%">
<colgroup>
<col span="1" style="width: 300px;" />
<col span="1" />
</colgroup>
<tbody>
<tr>
<td style="vertical-align: top; padding-right: 20px;">
<div>
<span class="header">Inclusion Rules</span> <span class="criteriaAddLink" data-bind="click: addInclusionRule">new</span>
</div>
<div data-bind="sortable: {data: selectedStudy().inclusionRules, connectClass: 'inclusionRuleItem'}">
<table style="width: 100%" class="inclusionRules">
<colgroup>
<col style="width: 25px;" />
<col />
</colgroup>
<tbody>
<tr data-bind="click: $root.selectInclusionRule, css: { selectedInclusion: $data == $root.selectedInclusionRule() }">
<td style="text-align: right; vertical-align: top;">
<span data-bind="text: $index() + 1"></span>.
</td>
<td style="vertical-align: top;" class="inclusionRules" data-bind="text: ((name() || '').length > 0) ? name() : 'Unnamed Rule' "></td>
</tr>
</tbody>
</table>
</div>
</td>
<td style="vertical-align: top; padding-left: 25px; border-left: 1px #eee solid;">
<!-- ko if: selectedInclusionRule() -->
<inclusion-rule-editor params="{InclusionRule: selectedInclusionRule(), IndexRule: selectedStudy().indexRule()}"></inclusion-rule-editor>
<!-- /ko -->
<!-- ko ifnot: selectedInclusionRule() -->
<div>Please select an inclusion rule to edit.</div>
<!-- /ko -->
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div data-bind="attr: { id: 'conceptsets' }">
<div class="tab_contents">
<div style="padding: 5px">
<!-- ko with: selectedStudy().indexRule -->
<concept-set-builder params="{conceptSets: ConceptSets, ref: $parent.conceptSetEditor}"></concept-set-builder>
<!-- /ko -->
</div>
</div>
</div>
<div data-bind="attr: { id: 'printfriendly' }">
<div class="tab_contents">
<div style="padding: 5px">
<!-- ko with: selectedStudy() -->
<div style="font-size:1.3em">Index Rule Definition:</div>
<cohort-expression-viewer params="expression: indexRule"></cohort-expression-viewer>
<br/>
<!-- ko foreach: inclusionRules -->
<div style="font-size:1.3em">Inclusion rule <span data-bind="text: ($index() + 1)"></span>: <span data-bind="text: name"></span></div>
<criteria-group-viewer params="{expression: $parent.indexRule, group: ko.observable(expression)}"></criteria-group-viewer>
<br/>
<!-- /ko -->
<div style="font-size:1.3em">Appendix 1: Concept Set Definitions</div>
<br/>
<!-- ko foreach: indexRule().ConceptSets.sorted -->
<div style="font-size: 1.15em"><span data-bind="text: ($index() + 1)"></span>. <span data-bind="text: $data.name"></span></div>
<div style="padding-left:20px">
<conceptset-viewer params="{conceptSet: $data}"></conceptset-viewer>
<br/>
</div>
<!-- /ko -->
<!-- /ko -->
</div>
</div>
</div>
<div data-bind="attr: { id: 'results' },
eventListener: [{ event: 'click', selector: '.generate', callback: onGenerate},
{ event: 'click', selector: '.removeResult', callback: onRemoveResult}]">
<div class="tab_contents" style="padding:5px 5px 5px 5px;">
<feasibility-results-viewer params="sources: filteredSources, dirtyFlag: dirtyFlag"></simulation-report-viewer>
</div>
</div>
</div>
<!-- ko if: isGeneratedOpen -->
<div title="Generated Sql..." data-bind="dialog: { isOpen: isGeneratedOpen, modal: true, width:700, height:500 }">
<div class="tabs" data-bind="tabs: { }">
<ul>
<li data-bind="attr: { 'aria-controls': 'sql_server' }">
<a data-bind="attr: { title: 'MSSQL Server', href: '#sql_server' }, text: 'MSSQL Server'"></a>
</li>
<li data-bind="attr: { 'aria-controls': 'oracle' }">
<a data-bind="attr: { title: 'Oracle', href: '#oracle' }, text: 'Oracle'"></a>
</li>
<li data-bind="attr: { 'aria-controls': 'postgres' }">
<a data-bind="attr: { title: 'Postgres', href: '#postgres' }, text: 'Postgres'"></a>
</li>
<li data-bind="attr: { 'aria-controls': 'redshift' }">
<a data-bind="attr: { title: 'Red Shift', href: '#redshift' }, text: 'Red Shift'"></a>
</li>
</ul>
<div data-bind="attr: { id: 'sql_server' }">
<textarea readonly style="width:100%" data-bind="textInput: generatedSql.mssql, jqAutoresize: {append: ''}"></textarea>
</div>
<div data-bind="attr: { id: 'oracle' }">
<textarea readonly style="width:100%" data-bind="textInput: generatedSql.oracle, jqAutoresize: {append: ''}"></textarea>
</div>
<div data-bind="attr: { id: 'postgres' }">
<textarea readonly style="width:100%" data-bind="textInput: generatedSql.postgres, jqAutoresize: {append: ''}"></textarea>
</div>
<div data-bind="attr: { id: 'redshift' }">
<textarea readonly style="width:100%" data-bind="textInput: generatedSql.redshift, jqAutoresize: {append: ''}"></textarea>
</div>
</div>
</div>
<!-- /ko -->
<!-- ko if: isImportOpen -->
<div title="Import Study..." style="padding: 0px; padding-top: 5px; padding-right: 5px" data-bind="dialog: { isOpen: isImportOpen, modal: true, width:700, height:500}">
<div style="height:100%; overflow: none; padding-top: 5px; padding-bottom: 40px;">
<textarea style="width: 100%; height: 100%; resize: none" data-bind="textInput: studyJSON"></textarea>
</div>
<div style="position: relative; margin-top: -30px; height: 30px; clear: both;">
<button class="button button-small button-flat-primary" data-bind="click: doImport">Import</button>
</div>
</div>
<!-- /ko -->
</div>
</div>
</div>
</div>
</body>
</html>