-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathcohort-definition-manager.html
More file actions
583 lines (558 loc) · 35.6 KB
/
Copy pathcohort-definition-manager.html
File metadata and controls
583 lines (558 loc) · 35.6 KB
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
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
<loading data-bind="visible: $component.isLoading()"></loading>
<div data-bind="if: currentCohortDefinition() && $root.router.currentView() == 'cohort-definition-manager' && !$component.isLoading()" class="flexed">
<heading-title params="name: cohortDefinitionCaption(), icon: 'users', theme: 'dark'"></heading-title>
<div class="authorship-container">
<!-- ko if: currentCohortDefinition().id() != 0 -->
<!-- ko component: {name: 'authorship', params: getAuthorship()} --> <!-- /ko -->
<!-- /ko -->
</div>
<access-denied params="isAuthenticated: isAuthenticated, isPermitted: hasAccess"></access-denied>
<!-- ko if: hasAccess -->
<div data-bind="currentCohortDefinition() != null">
<div class="asset-heading">
<div class="input-group">
<input class="form-control" type="text" placeholder="New Cohort Definition" data-bind="enabled: canEdit(), textInput: currentCohortDefinition().name, css: { emptyInput: !isNameFilled() }"/>
<div class="input-group-btn">
<button class="btn btn-success" title="Save cohort definition" data-bind="click: save, enable: canSave() && !isProcessing()"><i class="fa fa-save"></i></button>
<button class="btn btn-primary" title="Close cohort definition" data-bind="click: close, css: { disabled: isProcessing() }"><i class="fa fa-times"></i></button>
<!-- ko if: currentCohortDefinition().id() != null && currentCohortDefinition().id() != 0 -->
<button class="btn btn-primary" title="Create a copy of this cohort definition" data-bind="click: copy, enable: canCopy() && !isProcessing()"><i class="fa fa-copy"></i></button>
<button class="btn btn-primary" title="Get a link to this cohort definition" data-bind="enable: !dirtyFlag().isDirty() && !isProcessing(), click: function () { $component.cohortLinkModalOpened(true) }"><i class="fa fa-link"></i></button>
<button class="btn btn-primary" title="Configure access" data-bind="visible: isOwner, click: () => isAccessModalShown(!isAccessModalShown())">
<i class="fa fa-lock"></i>
</button>
<!-- ko if: !isRunning() -->
<button class="btn btn-danger" title="Delete" data-bind="click: $component.delete, enable: canDelete() && !isProcessing()"><i class="fa fa-trash-o"></i></button>
<!-- /ko -->
<!-- /ko -->
</div>
</div>
<div data-bind="visible: !isNameFilled()" class="empty-name-error">
<i class="fa fa-exclamation-circle" aria-hidden="true"></i>
<label>Cohort Definition name is empty.</label>
</div>
</div>
<ul class="nav nav-tabs">
<li role="presentation" data-bind="css: { active: $component.tabMode() == 'definition' }, click: function() { $component.selectTab('definition'); }">
<a>Definition <i data-bind="click: function () { $component.cohortDefinitionOpened(true) }" class="fa fa-question-circle-o"></i></a>
</li>
<li role="presentation" data-bind="css: { active: $component.tabMode() == 'conceptsets' }, click: function() { $component.selectTab('conceptsets'); }">
<a>Concept Sets</a>
</li>
<li role="presentation" data-bind="css: { active: $component.tabMode() == 'generation' }, click: function() { $component.selectTab('generation'); }">
<a>Generation</a>
</li>
<li role="presentation" data-bind="css: { active: $component.tabMode() == 'reporting' }, click: function() { $component.selectTab('reporting'); }">
<a>Reporting</a>
</li>
<!--
<li role="presentation" data-bind="css: { active: $component.tabMode() == 'explore' }, click: function() { $component.selectTab('explore'); }"><a>Explore</a></li>
-->
<li role="presentation" data-bind="css: { active: $component.tabMode() == 'export' }, click: () => $component.selectTab('export')">
<a>Export</a>
</li>
<li role="presentation" data-bind="css: { active: $component.tabMode() === 'warnings' }, click: function(){ $component.selectTab('warnings'); } ">
<a data-bind="attr: { class: warningClass }">Messages <span class="badge" data-bind="text: warningsTotals, visible: warningsTotals() > 0"></span></a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" data-bind="css: { active: $component.tabMode() == 'definition' }" class="tab-pane">
<atlas.cohort-editor params="canEditCurrentCohortDefinition: canEdit, loadConceptSet: loadConceptSet"></atlas.cohort-editor>
</div>
<div role="tabpanel" data-bind="css: { active: $component.tabMode() == 'conceptsets' }, eventListener: [{event: 'click', selector: '.repositoryConceptSetItem', callback: onConceptSetTabRespositoryConceptSetSelected}]" class="tab-pane">
<loading params="status: 'Exporting All Concept Sets To CSV'" data-bind="visible: exporting()"></loading>
<div data-bind="hidden: exporting()">
<div class="cohort-conceptset-button-pane pull-right">
<button type="button" class="btn btn-sm btn-primary" data-bind="click:function() { newConceptSet(); }, enable: canEdit">New Concept Set</button>
<button type="button" class="btn btn-sm btn-primary" data-bind="click:function(){ $component.importConceptSet() }, enable: canEdit"><i class="fa fa-upload" aria-hidden="true" /> Import</button>
<span data-bind="tooltip: $component.disableConceptSetExport() ? $component.disableConceptSetExportMessage() : null" data-placement="bottom"><button type="button" class="btn btn-sm btn-success" data-bind="click:function() { exportConceptSetsCSV(); }, css: {'disabled': disableConceptSetExport}"><i class="fa fa-download" aria-hidden="true"></i> Export All Concept Sets To CSV</button></span>
</div>
<table class="conceptSetTable stripe compact hover" cellspacing="0" width="100%" data-bind="dataTable:{
data: currentCohortDefinition() && currentCohortDefinition().expression().ConceptSets,
options: {
deferRender: true,
orderClasses: false,
autoWidth: false,
order: [ 1, 'asc' ],
columnDefs: [
{ width: '25px', targets: 0},
{ width: '100%', targets: 1},
],
stripeClasses : [ 'repositoryConceptSetItem' ],
columns: [
{ data: 'id', title: 'Id', width: '25px'},
$component.getDataboundColumn('name', 'Title', '100%')
],
language: {
search: 'Filter Cohort Concept Sets:'
}
}
}">
</table>
<!-- ko if: currentConceptSet() && currentConceptSetSource() == 'cohort' -->
<hr/>
<ul class="nav nav-pills">
<li role="presentation" data-bind="css: {active: $component.conceptSetTabMode() == cohortConst.conceptSetTabModes.details}, click: function() {$component.conceptSetTabMode(cohortConst.conceptSetTabModes.details)};">
<a>Concept Set Expression</a>
</li>
<li role="presentation" data-bind="css: {active: $component.conceptSetTabMode() == cohortConst.conceptSetTabModes.included}, click: function() {$component.conceptSetTabMode(cohortConst.conceptSetTabModes.included)};">
<a>Included Concepts <conceptset-inclusion-count params="conceptSetExpression: selectedConcepts"></conceptset-inclusion-count>
</a>
</li>
<li role="presentation" data-bind="css: {active: $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.sourcecodes}, click: function() {$component.conceptSetTabMode(cohortConst.conceptSetTabModes.sourcecodes)};">
<a>Included Source Codes</a>
</li>
<li role="presentation" data-bind="css: {active: $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.export}, click: function() {$component.conceptSetTabMode(cohortConst.conceptSetTabModes.export)};"> <a>Export</a>
</li>
<li role="presentation" data-bind="css: { active: $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.import }, click: function() { $component.conceptSetTabMode(cohortConst.conceptSetTabModes.import); }">
<a>Import</a>
</li>
</ul>
<div data-bind="if: $root.router.currentView() != 'loading' && $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.details">
<div class="paddedWrapper">
<div class="heading">
Name:
</div>
<div class="divtext" placeholder="Concept Set Name" data-bind="attr: { contenteditable:canEdit() }, htmlValue:currentConceptSet().name"></div>
<conceptset-editor params="conceptSets:selectedConcepts, canEditCurrentConceptSet: canEdit"></conceptset-editor>
<div class="clear"></div>
<div class="cohort-conceptset-button-pane pull-right">
<button type="button" class="btn btn-sm btn-danger" data-bind="click:function() { $component.deleteConceptSet(); }">Delete Concept Set</button>
<button type="button" class="btn btn-sm btn-success" data-bind="click:function(){ $component.showSaveConceptSet(); }, enable: canCreateConceptSet">Copy To Concept Set Repository</button>
<button type="button" class="btn btn-sm btn-primary" data-bind="click: function() { $component.closeConceptSet(); }">Close Concept Set</button>
</div>
</div>
</div>
<loading data-bind="visible: $root.router.currentView() === 'loading' || loadingSourcecodes() || loadingIncluded()"></loading>
<div data-bind="visible: $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.included && !loadingIncluded()">
<faceted-datatable params="{columns: $component.includedConceptsColumns, options: $component.includedConceptsOptions, reference: $component.includedConcepts, rowCallback: commonUtils.contextSensitiveLinkColor}"></faceted-datatable>
</div>
<div data-bind="visible: $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.sourcecodes && !loadingSourcecodes() && !loadingIncluded()">
<faceted-datatable params="{columns: $component.relatedSourcecodesColumns, options: $component.relatedSourcecodesOptions, reference: $component.includedSourcecodes}"></faceted-datatable>
</div>
<div id="wrapperConceptSetExport" data-bind="if: $component.conceptSetTabMode() === cohortConst.conceptSetTabModes.export">
<loading data-bind="visible: resolvingConceptSetExpression()" params="status: 'Loading for export...'"></loading>
<div data-bind="visible: !resolvingConceptSetExpression()">
<div class="heading">Concept Set Expression JSON <button class="btn btn-sm btn-primary" title="Copy to clipboard" id="btnCopyExpressionClipboard" data-bind="click: copyExpressionToClipboard" data-clipboard-target="#conceptSetExpression"><i class="fa fa-clipboard" aria-hidden="true"></i></button>
<span id="copyExpressionToClipboardMessage" style="display:none" class="alert alert-success" role="alert"><i class="fa fa-check-square-o" aria-hidden="true"></i><strong>Copied To Clipboard!</strong></span>
</div>
<pre id="conceptSetExpression" data-bind="html: currentConceptSetExpressionJson, selectOnFocus: {events: ['click']}"></pre>
<div class="heading">Concept Identifer List <button class="btn btn-sm btn-primary" title="Copy to clipboard" id="btnCopyIdentifierListClipboard" data-bind="click: copyIdentifierListToClipboard" data-clipboard-target="#conceptIdentifierList"><i class="fa fa-clipboard" aria-hidden="true"></i></button>
<span id="copyIdentifierListMessage" style="display:none" class="alert alert-success" role="alert"><i class="fa fa-check-square-o" aria-hidden="true"></i><strong>Copied To Clipboard!</strong></span>
</div>
<pre id="conceptIdentifierList" data-bind="html: currentConceptIdentifierList, selectOnFocus: {events: ['click']}"></pre>
<div class="heading">Included Concept Identifer List <button class="btn btn-sm btn-primary" title="Copy to clipboard" id="btnCopyIncludedConceptIdentifierListClipboard" data-bind="click: copyIncludedConceptIdentifierListToClipboard" data-clipboard-target="#includedConceptIdentifierList"><i class="fa fa-clipboard" aria-hidden="true"></i></button>
<span id="copyIncludedConceptIdentifierListMessage" style="display:none" class="alert alert-success" role="alert"><i class="fa fa-check-square-o" aria-hidden="true"></i><strong>Copied To Clipboard!</strong></span>
</div>
<pre id="includedConceptIdentifierList" data-bind="html: $component.currentIncludedConceptIdentifierList, selectOnFocus: {events: ['click']}"></pre>
</div>
</div>
<div id="wrapperConceptSetImport" data-bind="if:$component.conceptSetTabMode() === cohortConst.conceptSetTabModes.import">
<ul class="nav nav-pills">
<li role="presentation" data-bind="css: {active: $component.importTabMode() === cohortConst.importTabModes.identifiers}, click: function(){ $component.importTabMode(cohortConst.importTabModes.identifiers); }">
<a>Concept Identifiers</a>
</li>
<li role="presentation" data-bind="css: {active: $component.importTabMode() === cohortConst.importTabModes.sourcecodes}, click: function(){ $component.importTabMode(cohortConst.importTabModes.sourcecodes); }">
<a>Source Codes</a>
</li>
<li role="presentation" data-bind="css: {active: $component.importTabMode() === cohortConst.importTabModes.conceptset}, click: function(){ $component.importTabMode(cohortConst.importTabModes.conceptset); }">
<a>Concept Set</a>
</li>
<li role="presentation" data-bind="click: importFromRepository">
<a>Repository</a>
</li>
</ul>
<div id="wrapperImportConceptIdentifiers" class="paddedWrapper form-group" data-bind="if:$component.importTabMode() === cohortConst.importTabModes.identifiers">
<div class="heading">Enter Concept Identifiers (<a class="linkish" data-bind="click: function() { identifiers(''); }">click to clear</a>)</div>
<textarea class="form-control" rows="5" data-bind="value: identifiers"></textarea>
<a data-bind="click:function() {importConceptIdentifiers();}" class="btn btn-sm btn-primary pull-right"><span class="fa fa-upload"></span> Import Concept Identifiers</a>
<div class="clear"></div>
</div>
<div id="wrapperImportSourcecodes" class="paddedWrapper form-group" data-bind="if:$component.importTabMode() == cohortConst.importTabModes.sourcecodes">
<div class="heading">Enter Source Codes (<a class="linkish" data-bind="click: function() { sourcecodes(''); }">click to clear</a>)</div>
<textarea class="form-control" rows="5" data-bind="value: sourcecodes"></textarea>
<a data-bind="click:function() {importSourceCodes();}" class="btn btn-sm btn-primary pull-right"><span class="fa fa-upload"></span> Import Source Codes</a>
<div class="clear"></div>
</div>
<div class="paddedWrapper form-group" data-bind="if:$component.importTabMode() === cohortConst.importTabModes.conceptset">
<div class="heading">Concept Set Expression JSON (<a class="linkish" data-bind="click: function() { $component.clearImportConceptSetJson(); }">click to clear</a>)</div>
<textarea class="form-control" rows="5" data-bind="value: importConceptSetJson"></textarea>
<div type="button" data-bind="css: {disabled: !currentConceptSet()}, click:function() { $component.importConceptSetExpression(); }" class="btn btn-sm btn-primary pull-right "><i class="fa fa-upload"></i> Import Concept Set Expression</div>
<div class="clear"></div>
</div>
</div>
<loading data-bind="visible: conceptLoading()" params="status: 'retrieving concepts'"></loading>
<!-- /ko -->
</div>
</div>
<div role="tabpanel" data-bind="css: { active: $component.tabMode() == 'export' }" class="tab-pane">
<ul class="nav nav-pills">
<li role="presentation" data-bind="css: { active: $component.exportTabMode() == 'printfriendly' }, click: function() { $component.exportTabMode('printfriendly'); }">
<a>Text View</a>
</li>
<li role="presentation" data-bind="css: { active: $component.exportTabMode() == 'cartoon' }, click: function() { $component.exportTabMode('cartoon'); }">
<a>Graphical View</a>
</li>
<li role="presentation" data-bind="css: { active: $component.exportTabMode() == 'json' }, click: function() { $component.exportTabMode('json'); }">
<a>JSON</a>
</li>
<li role="presentation" data-bind="css: { active: $component.exportTabMode() == 'sql' }, click: function() { $component.exportTabMode('sql');}">
<a>SQL</a>
</li>
</ul>
<div class="tab-content">
<div role="tabpanel" data-bind="css: {active: $component.exportTabMode() == 'printfriendly'}" class="tab-pane">
<div class="paddedWrapper">
<button class="btn btn-sm btn-primary" title="Copy to clipboard" id="btnCopyTextViewClipboard" data-bind="click: copyTextViewToClipboard" data-clipboard-target="#cohortTextView"><i class="fa fa-clipboard" aria-hidden="true"></i> Copy To Clipboard</button>
<span id="copyTextViewMessage" style="display:none" class="alert alert-success" role="alert"><i class="fa fa-check-square-o" aria-hidden="true"></i><strong>Copied To Clipboard!</strong></span>
<div id="cohortTextView" class="pad-10">
<div class="heading" data-bind="text:currentCohortDefinition().name"></div>
<div data-bind="text:currentCohortDefinition().description"></div>
<cohort-expression-viewer params="expression: currentCohortDefinition().expression"></cohort-expression-viewer>
<br/>
<div class="heading">Appendix 1: Concept Set Definitions</div>
<br/>
</div>
<!-- ko foreach: sortedConceptSets -->
<div><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 role="tabpanel" data-bind="css: {active: $component.exportTabMode() == 'cartoon'}" class="tab-pane">
<div class="paddedWrapper">
<!-- ko if: $component.selectedCriteria() -->
<div id="cartoon-tooltip" data-bind='with: $component.selectedCriteria()'>
<div id="tooltip">
<!-- ko ifnot: $data.Criteria -->
<div data-bind='component: {
name: $component.getCriteriaIndexComponent($data),
params: {expression: currentCohortDefinition().expression(),
criteria: $data} }'></div>
<!-- /ko -->
<!-- ko if: $data.Criteria -->
<span data-bind="text: Occurrence.Count"></span> <span data-bind="text: Occurrence.IsDistinct ? 'distinct' : ''"></span> occurrence
<span data-bind="text: Occurrence.Count != 1 ? 's' : ''"></span> of
<span data-bind="component: {
name: $component.getCriteriaIndexComponent($data.Criteria),
params: {expression: currentCohortDefinition().expression(),
criteria: $data.Criteria }
}"></span> occurring between
<window-input-viewer params="Window: StartWindow"></window-input-viewer> index
<!-- /ko -->
</div>
</div>
<!-- /ko -->
<div data-bind="cohortExpressionCartoon:{expression:currentCohortDefinition().expression,
selectedCriteria: $component.selectedCriteria,
tabPath: $component.tabPath,
delayedCartoonUpdate: $component.delayedCartoonUpdate}"></div>
</div>
</div>
<div role="tabpanel" data-bind="if: $component.tabMode() === 'export' && $component.exportTabMode() == 'json', css: { active: $component.exportTabMode() == 'json' }" class="tab-pane">
<textarea id="cohortExpressionJSON" class="code" style="width: 100%; height: 300px" data-bind="textInput: $component.expressionJSON"></textarea>
<div class="row">
<div class="col-md-6" style="float: left">
<button class="btn btn-sm btn-primary" title="Copy to clipboard" id="btnCopyExpressionJSONClipboard" data-bind="click: copyCohortExpressionJSONToClipboard" data-clipboard-target="#cohortExpressionJSON"><i class="fa fa-clipboard" aria-hidden="true"></i> Copy To Clipboard</button>
<span id="copyCohortExpressionJSONMessage" style="display:none" class="alert alert-success" role="alert"><i class="fa fa-check-square-o" aria-hidden="true"></i><strong>Copied To Clipboard!</strong></span>
</div>
<div class="col-md-6" style="text-align: right">
<button class="btn btn-sm btn-primary" data-bind="click: $component.reload">Reload</button>
</div>
</div>
</div>
<div role="tabpanel" data-bind="css: { active: $component.exportTabMode() == 'sql'}" class="tab-pane">
<export-sql params="
analysisId: $component.currentCohortDefinition() && $component.currentCohortDefinition().id(),
expression: $component.currentCohortDefinition() && $component.currentCohortDefinition().expression,
isPermittedExport: hasAccess,
exportSqlService: $component.exportSqlService,
"></export-sql>
</div>
</div>
</div>
<div role="tabpanel" data-bind="css: { active: $component.tabMode() == 'generation' }" class="tab-pane">
<div class="heading">Available CDM Sources</div>
<table class="cohort-generate-sources">
<thead>
<th></th>
<th>Source Name</th>
<th class="text-right nowrap">Generation Status</th>
<th class="text-right nowrap">People</th>
<th class="text-right nowrap">Records</th>
<th class="text-right nowrap">Generated</th>
<th class="text-right nowrap">Generation Duration</th>
<th></th>
</thead>
<tbody data-bind="foreach:cohortDefinitionSourceInfo, css: {overflow: cohortDefinitionSourceInfo().length > 3, 'max-height': $component.selectedReportSource()}">
<tr data-bind="css: { 'selected': $component.selectedReportSource() && $component.selectedReportSource().sourceKey == $data.sourceKey}">
<td>
<span data-bind="tooltip: $component.isNew() ? 'You must save the current cohort definition before you can perform generation' : !$component.hasAccessToGenerate($data.sourceKey) ? 'Not enough permissions to generate' : null" data-placement="right">
<span data-bind="tooltip: !$component.canGenerate() ? 'Initial event is not set or changes not saved' : null" data-placement="right">
<button class="btn btn-sm btn-primary"
data-bind="attr: {'disabled':!$component.canGenerate() || !$component.hasAccessToGenerate($data.sourceKey)},
visible: !$component.isSourceRunning($data),
click: (data, event) => $component.generateCohort(data, false)">
<i class="fa fa-play"></i> Generate
</button>
</span>
</span>
<a role="button" class="btn btn-sm btn-danger"
data-bind="click:$component.cancelGenerate,
visible: $component.isSourceRunning($data),
attr: {disabled: $component.isSourceStopping($data)}"><i class="fa fa-spinner fa-spin"></i> Cancel
</a>
</td>
<td class="nowrap" data-bind="text:name"></td>
<td class="statusIndicator text-right nowrap">
<span data-bind="template: { name: $component.getStatusTemplate, data: { item: $data, status: $component.getStatusMessage($data)} }"></span>
</td>
<td class="text-right nowrap" data-bind="html: $component.renderCountColumn($data.personCount)">
</td>
<td class="text-right nowrap" data-bind="html: $component.renderCountColumn($data.recordCount)">
</td>
<td class="text-right nowrap" data-bind="text: startTime">
</td>
<td class="text-right nowrap" data-bind="text: executionDuration">
</td>
<td>
<div class="btn btn-sm btn-primary" data-bind="visible:!$component.isSourceRunning($data) && isValid(), click:$component.toggleCohortReport">
<i class="fa fa-eye"></i>
<span data-bind="text: (($component.selectedReportSource() && $component.selectedReportSource().sourceKey === $data.sourceKey) ? 'Hide Reports' : 'View Reports')"></span>
</div>
</td>
</tr>
</tbody>
</table>
<!-- ko if: selectedReportSource() -->
<cohort-reports params="cohort: currentCohortDefinition, source: selectedReportSource"></cohort-reports>
<!-- /ko -->
</div>
<div role="tabpanel" data-bind="css: { active: $component.tabMode() == 'reporting' }" class="tab-pane">
<div class="pad-5">
<div class="panel panel-primary">
<div class="panel-heading">
Report Selections
</div>
<div class="panel-body">
<div class="row">
<div class="btn-group pull-right pad-5">
<button class="btn btn-primary btn-sm" data-bind="visible: $component.generateReportsEnabled, css : {disabled:!$component.generateReportsEnabled()}, attr : {'disabled':!$component.generateReportsEnabled()}, click:$component.generateAllAnalyses">Full Analysis</button>
<button class="btn btn-success btn-sm" data-bind="visible: $component.generateReportsEnabled, css : {disabled:!$component.generateReportsEnabled()}, attr : {'disabled':!$component.generateReportsEnabled()}, click:$component.generateQuickAnalysis">Quick Analysis</button>
<button class="btn btn-info btn-sm" data-bind="visible: $component.generateReportsEnabled, css : {disabled:!$component.generateReportsEnabled()}, attr : {'disabled':!$component.generateReportsEnabled()}, click:$component.selectHealthcareAnalyses">Utilization</button>
<button class="btn btn-default btn-sm" data-bind="visible: $component.generateReportsEnabled, click: function () { $component.analysisTypesOpened(true) }"><i class="fa fa-question-circle text-primary"></i></button>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<select class="form-control" data-bind="css : { invalid: $component.reportSourceKey()==undefined }, options: $component.cdmSources(), optionsValue:'sourceKey', optionsText:'sourceName', value:$component.reportSourceKey, optionsCaption:'Select a Source'"></select>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<select class="form-control" data-bind="visible: showReportNameDropdown,disable: $component.loadingReport, attr:{disabled: $component.loadingReport}, css : {invalid: $component.reportReportName()==undefined }, options:reportingAvailableReports, optionsCaption:$component.reportOptionCaption, optionsText:'name', optionsValue:'name', value:$component.reportReportName"></select>
</div>
</div>
</div>
</div>
<loading data-bind="visible: $component.isReportGenerating()"></loading>
<div data-bind="visible: !$component.isReportGenerating()">
<div class="panel panel-danger" data-bind="visible: $component.reportingState()=='cohort_not_generated'">
<div class="panel-heading">
Cohort Not Generated
</div>
<div class="panel-body">
This cohort has not been generated in the data source you selected. Please return to the generation tab to generate the cohort before accessing reporting.
</div>
</div>
<div class="panel panel-danger" data-bind="visible: $component.reportingState()=='reports_not_generated'">
<div class="panel-heading ">
Reports Not Generated
</div>
<div class="panel-body">
Reports have not yet been generated for this cohort. Please click the generate button below to generate the reports.
</div>
</div>
<div class="panel panel-info" data-bind="visible: $component.reportingState()=='awaiting_selection'">
<div class="panel-heading ">
Make a Selection
</div>
<div class="panel-body">
Please make a selection in the Report Selections panel.
</div>
</div>
<div class="panel panel-info" data-bind="visible: (!$component.reportingSourceStatusLoading() && $component.reportingState()=='generating_reports')">
<div class="panel-heading ">
Generating Reports
</div>
<div class="panel-body">
<table class="pad-5" style="width:100%;">
<thead>
<th>Job Name</th>
<th>Progress</th>
<th>Status</th>
</thead>
<tbody>
<tr data-bind="with:$component.currentJob">
<td class="pad-5"><i class="fa fa-tasks"></i> <span data-bind="html: name"></span></td>
<td class="pad-5">
<div data-bind="if:$data.progress">
<div class="progress">
<div class="progress-bar" aria-valuenow="25" aria-valuemin="0" aria-valuemax="100" role="progressbar" data-bind="style:{ width: $component.calculateProgress($data)}, text: $component.calculateProgress($data)"></div>
</div>
</div>
</td>
<td class="pad-5" data-bind="html: status"></td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="panel panel-danger" data-bind="visible: (!$component.reportingSourceStatusLoading() && $component.reportingState()=='report_unavailable')">
<div class="panel-heading ">
Report Unavailable
</div>
<div class="panel-body">
The report you requested is not available. Please click the generate button to generate cohort reports for this data source.
</div>
</div>
<div class="panel panel-danger" data-bind="visible: (!$component.reportingSourceStatusLoading() && $component.reportingState()=='unknown_cohort_report_state')">
<div class="panel-heading ">
Whoops
</div>
<div class="panel-body">
The reporting system has encountered an error. Please provide the following details to your ATLAS administration team or submit an issue on <a href="https://www.github.com/ohdsi/atlas"><i class="fa fa-github"></i> Github</a>.
</div>
<div class="panel-footer">
<div data-bind="html:$component.reportingError"></div>
</div>
</div>
<div class="panel panel-danger" data-bind="visible: (!$component.reportingSourceStatusLoading() && $component.createReportJobFailed)">
<div class="panel-heading ">
Create Reporting Job Failed
</div>
<div class="panel-body">
The reporting system has encountered an error. Please provide the following details to your ATLAS administration team or submit an issue on <a href="https://www.github.com/ohdsi/atlas"><i class="fa fa-github"></i> Github</a>.
</div>
<div class="panel-footer">
<div data-bind="html:$component.createReportJobError"></div>
</div>
</div>
<div class="panel panel-warning" data-bind="visible: $component.reportingSourceStatusLoading()">
<div class="panel-heading ">
Please Wait
</div>
<div class="panel-body">
Please wait while for the report status to be loaded.
</div>
</div>
</div>
</div>
<loading params="status:'loading'" data-bind="visible:$root.router.currentView() == 'loading' || $component.loadingReport()">
</loading>
<report-manager data-bind="visible:$component.reportingState()=='report_active' " params="{reportSourceKey: reportSourceKey, loadingReport: loadingReport, reportReportName: reportReportName, reportCohortDefinitionId: reportCohortDefinitionId, reportTriggerRun: reportTriggerRun, showSelectionArea: false} "></report-manager>
</div>
<div role="tabpanel " data-bind="css: { active: $component.tabMode()=='explore' } " class="tab-pane ">
<div class="paddedWrapper ">
<explore-cohort params="{showSelectionArea: false } "></explore-cohort>
</div>
</div>
<div role="tabpanel" data-bind="css: { active: $component.tabMode() === 'warnings' }" class="tab-pane">
<div class="paddedWrapper">
<conceptset-warnings params="{count: warningsTotals, infoCount: infoCount,
warningCount: warningCount, crititcalCount: criticalCount,
canDiagnose: canSave, onFixCallback: fixConceptSet}"></conceptset-warnings>
</div>
</div>
</div>
</div>
<atlas-modal params="{
showModal: analysisTypesOpened,
iconClass: 'fa fa-group',
title: 'Analysis Types',
data: {}
}">
<b>Quick Analysis</b>
<p>Runs minimal analysis to provide a quick overview of this cohort's year of birth, demographics, drug eras and condition eras. (estimated: 10 minutes)</p>
<b>Healthcare Utilization</b>
<p>Runs analyses to provide Exposure, Visit and Drug Utilization reports. (estimated: 10 - 40 minutes)</p>
<b>Full Analysis</b>
<p>Runs a complete set of characterization reports. (estimated: 60 minutes)</p>
</atlas-modal>
<!-- /ko -->
<atlas-modal params="{
showModal: cohortLinkModalOpened,
iconClass: 'fa fa-group',
title: 'Link to Cohort Definition',
templateWrapperClass: {},
data: {
cohortDefinitionLink: $component.cohortDefinitionLink,
}
}">
<div data-bind="css: $parent.classes({ element: 'modal-body', extra: 'modal-body' })">
<input readonly data-bind="value: cohortDefinitionLink" type="text" class="form-control text-cursor">
</div>
<div data-bind="css: $parent.classes({ element: 'modal-footer', extra: 'modal-footer' })">
This link can be used to access this cohort definition directly from the WebAPI from other tools like R as well as for importing across ATLAS instances.
</div>
</atlas-modal>
<atlas-modal params="{
showModal: cohortDefinitionOpened,
title: 'Cohort Definition',
data: {}
}">
A cohort is defined as the set of persons satisfying one or more inclusion criteria for a duration of time. One person may qualify for one cohort multiple times during non-overlapping time intervals. Cohorts are constructed in ATLAS by specifying cohort
entry criteria and cohort exit criteria. Cohort entry criteria involve selecting one or more initial events, which determine the start date for cohort entry, and optionally specifying additional inclusion criteria which filter to the qualifying events.
Cohort exit criteria are applied to each cohort entry record to determine the end date when the person’s episode no longer qualifies for the cohort.
</atlas-modal>
<atlas-modal params="
showModal: $component.showImportConceptSetModal,
template: 'import-conceptset-template',
title: 'Import Concept Set From Repository...',
data: {
onRespositoryConceptSetSelected: $component.onConceptSetRepositoryImport,
criteriaContext: criteriaContext,
cohortConceptSets: currentCohortDefinition().expression().ConceptSets,
}
"
></atlas-modal>
<script type='text/html' id="import-conceptset-template">
<cohort-concept-set-browser params="
criteriaContext: criteriaContext,
cohortConceptSets: cohortConceptSets,
onRespositoryConceptSetSelected: onRespositoryConceptSetSelected,
buttonActionEnabled: false
"></cohort-concept-set-browser>
</script>
<modal-pick-options params="{
showModal: $component.showUtilizationToRunModal,
title: 'Configure reports to run',
options: $component.utilReportOptions,
submitLabel: 'Run',
submit: $component.generateHealthcareAnalyses,
}"></modal-pick-options>
<conceptset-save params="conceptSetName: newConceptSetName, onSave: saveConceptSet, show: saveConceptSetShow"></conceptset-save>
<modal-exit-message params="{
showModal: isExitMessageShown,
title: 'Generation Exit Message',
exitMessage: $component.exitMessage,
}"></modal-exit-message>
</div>
<conceptset-list-modal params="{isShown: $component.ancestorsModalIsShown, conceptSetList: $component.ancestors, title: 'Common Ancestors'}"></conceptset-list-modal>
<configure-access-modal params="
isModalShown: $component.isAccessModalShown,
isOwnerFn: $component.isOwnerFn,
loadAccessListFn: $component.loadAccessList,
grantAccessFn: $component.grantAccess,
revokeAccessFn: $component.revokeAccess,
loadRoleSuggestionsFn: $component.loadAccessRoleSuggestions
"></configure-access-modal>
<script type="text/html" id="success-status-tmpl">
<span data-bind="text: $data.status"></span>
</script>
<script type="text/html" id="failed-status-tmpl">
<a href='#' data-bind="css: $component.classes('status-link'), click: () => $component.showExitMessage($data.item.sourceKey), text: $data.status"></a>
</script>