forked from OHDSI/Circe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
207 lines (203 loc) · 9.13 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
<!DOCTYPE html>
<html>
<head>
<title>CIRCE</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<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/circe.boostrap.css" />
<link rel="stylesheet" href="css/circe.css" />
<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">CIRCE</div>
<div style="font-family: Arial; font-size: 10px; color: #777; line-height: 10px">Cohort Inclusion and Restriction Criteria Expression</div>
</td>
<td style="padding-left: 75px;"><a href="#/" class="menu-link">Cohort Definition 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: selectDefinition,
data: definitions(),
options: {
deferRender: true,
orderClasses: false,
autoWidth: true,
order: [ 1, 'asc' ],
columns: [
{ data: 'id', title: 'Id' },
{ data: 'name', title: 'Title' },
{ data: 'expressionType', title: 'Definition Type' },
{ data: 'description', title: 'Description'}
],
language: {
search: 'Filter records:'
}
}
}">
</table>
<button class="button-flat-primary" data-bind="click: function() { router.setRoute('/new'); }">New Definition</button>
</div>
<div data-bind="visible: selectedView() == 'detail'">
<table width="99%">
<col width="100%" />
<tr>
<td style="vertical-align: top">
<div data-bind="if: selectedDefinition()">
<table>
<tbody>
<tr>
<td><textarea maxlength="250" rows="1"
style="font-size: 18px; width: 500px; resize: none; overflow: hidden; word-wrap: break-word;"
class="inputField" data-bind="textInput: selectedDefinition().name, jqAutoresize: {append: ''}, css: { emptyInput: !(selectedDefinition().name() && (selectedDefinition().name().length > 0)) }"></textarea>
</td>
<td>
<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>
<!-- ko if: selectedDefinition().id() != null -->
<button class="button button-small button-flat-primary" data-bind="click: copy, enable: !dirtyFlag().isDirty()">Copy</button>
<!-- ko ifnot: isRunning -->
<button class="button button-small button-flat-caution" data-bind="click: $root.delete">Delete</button>
<!-- /ko -->
<!-- ko if: isRunning -->
<img class="spin" src="images/running.png" />Generating...
<!-- /ko -->
<!-- /ko -->
<button class="button button-small button-flat-primary" data-bind="click: showSql">Show SQL</button>
</td>
</tr>
<tr>
<td colspan=2>Description:<br/>
<textarea maxlength="1000" rows="1"
style="font-size: 1em; width: 800px; resize: none; overflow: hidden; word-wrap: break-word;"
class="inputField" data-bind="textInput: selectedDefinition().description, jqAutoresize: {append: ''}"></textarea>
</td>
</tr>
</tbody>
</table>
<div class="tabs" data-bind="tabs: { widget: tabWidget }">
<ul>
<li data-bind="attr: { 'aria-controls': 'criteria' }">
<a data-bind="attr: { title: 'Expression', href: '#criteria' }, text: 'Expression'"></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 data-bind="attr: { 'aria-controls': 'raw' }">
<a data-bind="attr: { title: 'Raw JSON', href: '#raw' }, text: 'Raw JSON'"></a>
</li>
<li data-bind="attr: { 'aria-controls': 'generate' }">
<a data-bind="attr: { title: 'Generate', href: '#generate' }">
<span data-bind="text: 'Generate'"></span> <img data-bind="visible: isRunning" class="spin" src="images/running.png" />
</a>
</li>
</ul>
<div data-bind="attr: { id: 'conceptsets' }, with: selectedDefinition().expression">
<div style="padding: 5px">
<concept-set-builder params="{conceptSets: ConceptSets, ref: $root.conceptSetEditor}"></concept-set-builder>
</div>
</div>
<div data-bind="attr: { id: 'criteria' }, eventListener: { event: 'click', selector: '.addConceptSet', callback: addConceptSet}">
<cohort-expression-editor params="expression: selectedDefinition().expression, widget: cohortExpressionEditor"></cohort-expression-editor>
</div>
<div data-bind="attr: { id: 'printfriendly' }">
<div style="padding: 5px">
<cohort-expression-viewer params="expression: selectedDefinition().expression"></cohort-expression-viewer>
<br/>
<div style="font-size:1.3em">Appendix 1: Concept Set Definitions</div>
<br/>
<!-- ko foreach: selectedDefinition().expression().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 -->
</div>
</div>
<div data-bind="attr: { id: 'raw' }">
<textarea style="width: 100%; height: 500px" data-bind="textInput: expressionJSON"></textarea>
<div style="text-align: right"><button data-bind="click: reload">Reload</button></div>
</div>
<div data-bind="attr: { id: 'generate' }, eventListener: { event: 'click', selector: '.generate', callback: onGenerate}">
<div style="padding: 5px">
<table class="sourceTable">
<thead>
<th>Source</th>
<th>Name</th>
<th>Dialect</th>
<th></th>
</thead>
<tbody data-bind="foreach: sources">
<tr>
<td data-bind="text: source.sourceKey"></td>
<td data-bind="text: source.sourceName"></td>
<td data-bind="text: source.sourceDialect"></td>
<td><generate-component params="{info: info, source: source, dirtyFlag: $parent.dirtyFlag}"></generate-component></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
<!-- 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': 'sql_aps' }">
<a data-bind="attr: { title: 'MS APS', href: '#ms_aps' }, text: 'MS APS'"></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' }">
<pre data-bind="text: generatedSql.mssql"></pre>
</div>
<div data-bind="attr: { id: 'ms_aps' }">
<pre data-bind="text: generatedSql.msaps"></pre>
</div>
<div data-bind="attr: { id: 'oracle' }">
<pre data-bind="text: generatedSql.oracle"></pre>
</div>
<div data-bind="attr: { id: 'postgres' }">
<pre data-bind="text: generatedSql.postgres"></pre>
</div>
<div data-bind="attr: { id: 'redshift' }">
<pre data-bind="text: generatedSql.redshift"></pre>
</div>
</div>
</div>
<!-- /ko -->
</div>
</div>
</div>
</body>
</html>