forked from Gaduo/FHIRSampleCreator
-
Notifications
You must be signed in to change notification settings - Fork 3
/
valuesetCreator.html
593 lines (449 loc) · 25 KB
/
valuesetCreator.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
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
584
585
586
587
588
589
590
591
592
593
<!DOCTYPE html>
<html>
<head lang="en">
<base href="/" />
<meta charset="UTF-8">
<script src="js/libs/angular.min1-5.js"></script>
<script src="js/libs/ui-bootstrap-tpls-1.2.5.min.js"></script>
<script src="js/libs/lodash.core.js"></script>
<link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
<link rel="stylesheet" type="text/css" href="css/main.css"/>
<script src="js/libs/angular-sanitize.js"></script>
<script>
angular.module("sampleApp",['ui.bootstrap','ngStorage']).config(function($locationProvider) {
$locationProvider.html5Mode(true);
$locationProvider.hashPrefix('!');
});
</script>
<style>
.display-row {
background-color: #fafafa;
margin-bottom: 5px;
}
</style>
<!-- files needed for valuesetCreator -->
<script src="resourceBuilder/rbServices.js"></script>
<script src="js/appConfigSvc.js"></script>
<script src="js/valuesetCtrl.js"></script>
<script src="js/libs/ngStorage.min.js"></script>
<script src="js/resourceSvc.js"></script>
<script src="js/services.js"></script>
<script src="js/resourceCreatorSvc.js"></script>
<script src="js/profileCreatorSvc.js"></script>
<script src="js/modalDialogSvc.js"></script>
<script src="js/igSvc.js"></script>
<title>FHIR ValueSet Editor</title>
</head>
<body style="padding: 8px;padding-top:80px" >
<div ng-app="sampleApp" ng-controller="valuesetCtrl" class="container-fluid">
<nav class="navbar navbar-default navbar-fixed-top" role="navigation">
<div class="container-fluid">
<div class="col-md-2">
<a class="navbar-brand" href="#">
clinFHIR ValueSet Editor
</a>
</div>
<div class="col-md-2 col-sm-2">
<div class="navbar-text">
{{terminologyServer.name}}
</div>
</div>
<div class="col-md-5 col-sm-5">
<div class="navbar-text">
<div ng-show="vs.id">
ValueSet: {{serverRoot}}ValueSet/{{vs.id}}
</div>
<div ng-show="implementationGuide">
IG: {{implementationGuide}}
</div>
</div>
</div>
<div class="col-md-3">
<form class="navbar-form navbar-left" ng-show="showWaiting">
<img ng-show="showWaiting" src="css/ajax_loader_blue_32.gif"/>
</form>
<!-- Only show the available commands when a server has been selected -->
<div ng-show="serverRoot">
<!-- Show save when a vs has been updated-->
<form class="navbar-form navbar-right" ng-show="input.isDirty">
<button class="btn btn-danger" ng-click="save()">Save</button>
</form>
<!-- Show 'back to list' when where's a list, anda valueset has been selected from that list-->
<!-- not sure if we need this...
<form class="navbar-form navbar-right" ng-show="(vs && searchResultBundle.entry.length >0) || state=='new' ">
<button popover-placement="bottom" popover-trigger='mouseenter'
uib-popover="Find a ValueSet"
class="btn btn-success" ng-click="backToList()">Find</button>
</form>
-->
<!-- Show 'clone' when there is a vs that cannot be edited (was copy(-->
<form class="navbar-form navbar-right" ng-show="(vs && ! canEdit) ">
<button popover-placement="bottom" popover-trigger='mouseenter'
uib-popover="Create a clone of this ValueSet that you can edit"
class="btn btn-warning" ng-click="cloneVs()">Clone</button>
</form>
<!-- Show 'copy (to different server)' when there is a selected vs-->
<!--
<form class="navbar-form navbar-right" ng-show="(vs && (state=='new' || state=='edit')) ">
<button popover-placement="bottom" popover-trigger='mouseenter'
uib-popover="Copy this ValueSet to another server"
class="btn btn-warning" ng-click="copyVs()">Copy</button>
</form>
-->
<!-- Show 'New' button when there is no vs selected-->
<form class="navbar-form navbar-right" ng-hide="vs || state=='new'">
<button popover-placement="bottom" popover-trigger='mouseenter'
uib-popover="Create a new ValueSet"
class="btn btn-default" ng-click="newVs()">New ValueSet</button>
</form>
</div>
</div>
</div>
</nav>
<div class="row" ng-show="state == 'find'">
<div class="col-md-6 col-sm-6">
<div>Search</div>
<div class="row">
<div class="col-md-9 col-sm-9">
<input type="text" ng-model="input.searchName" class="form-control" placeholder="Enter search text"/>
</div>
<div class="col-md-3 col-sm-3">
<button class="btn btn-link" ng-click="search(input.searchName)">Find</button>
</div>
</div>
<br/>
<div uib-alert class="alert-warning" ng-show="message">
{{message}}
</div>
<div uib-alert class="alert-info" ng-hide="searchResultBundle.entry">
Enter a search string into the text box above and click 'Find'.
The app will find all ValueSets where the string you enter is in the name of the ValueSet.
<br /><br />
Alternatively, click the 'New' button at the top right to create a new ValueSet.
</div>
<div class="list-group">
<a href="#" ng-class="{'list-group-item':true, active:entry.resource.id == input.vspreview.id}"
style="cursor: pointer" ng-repeat="entry in searchResultBundle.entry"
ng-click="newSelect(entry.resource)">
{{entry.resource.name}} ({{entry.resource.id}})
<div style="margin-left: 10px"><em>{{entry.resource.description}}</em></div>
</a>
</div>
</div>
<div class="col-md-6 col-sm-6" ng-show="input.vspreview">
<button class="btn btn-primary pull-right" ng-click="selectVs(input.vspreview)">Edit</button>
<uib-tabset>
<uib-tab heading="Contents">
<br/>
<div class="banner">{{input.vspreview.name}}: definition</div>
<div ng-repeat="inc in input.vspreview.compose.include">
<div class="row">
<div class="col-md-6 col-sm-6">
<strong>System Url: </strong>{{inc.system}}
</div>
<div class="col-md-6 col-sm-6">
<strong>Version: </strong>{{inc.version}}
</div>
</div>
<h4 ng-show="inc.concept">Concepts</h4>
<table class="table table-bordered">
<tr ng-repeat="concept in inc.concept">
<td>{{concept.code}}</td>
<td>{{concept.display}}</td>
</tr>
</table>
<h4 ng-show="inc.filter">Filters</h4>
<table class="table table-bordered">
<tr ng-repeat="filter in inc.filter">
<td>{{filter.property}}</td>
<td>{{filter.op}}</td>
<td>{{filter.value}}</td>
</tr>
</table>
</div>
<div class="banner">{{input.vspreview.name}}: expansion</div>
<div class="row">
<div class="col-md-6 col-sm-6">
<input type="text" class="form-control" ng-model="input.newFilter"
placeholder="Enter the filter text" />
</div>
<div class="col-md-6 col-sm-6">
<button class="btn btn-success" ng-click="newExpand(input.vspreview,input.newFilter)">
Expand
</button>
</div>
</div>
<br/>
<hr/>
<table class="table table-condensed table-bordered" ng-show="expansion.contains.length > 1">
<tr>
<th>Code</th><th>Display</th><th>System</th>
</tr>
<tr ng-repeat="concept in expansion.contains">
<td><div class="clickable" ng-click="newLookup(concept)"> {{concept.code}}</div></td>
<td>{{concept.display}}</td>
<td>{{concept.system}}</td>
</tr>
</table>
<div ng-show="expansion.contains.length == 0">
<h5>Nothing in expansion</h5>
</div>
<em>{{queryUrl}}</em>
</uib-tab>
<uib-tab heading="Json">
<!-- <pre>{{vs | json}}</pre> -->
<pre ng-show="input.vspreview">{{input.vspreview | json}}</pre>
</uib-tab>
</uib-tabset>
</div>
</div>
<div class="row" ng-show="vs">
<div class="col-md-6 col-sm-6">
<uib-tabset>
<uib-tab heading="Contents">
<br/>
<!-- This display logic is a bit wonky...-->
<!-- Individually included elements - ie not via a filter -->
<!--
<h4 ng-show="includeElement.concept.length > 0">Specific included concepts</h4>
-->
<div ng-repeat="include in vs.compose.include">
<div ng-show = "! include.filter">
<h5 class="banner" >Directly specified - System: {{include.system}}</h5>
<div class="row display-row">
<div class="col-md-2 col-sm-2"><strong>Code</strong></div>
<div class="col-md-8 col-sm-8"><strong>Display</strong></div>
<div class="col-md-1 col-sm-1"></div>
<div><strong>Remove</strong></div>
</div>
<div ng-repeat = "concept in include.concept">
<div class="row display-row">
<div class="col-md-2 col-sm-2">
{{concept.code}}
</div>
<div class="col-md-8 col-sm-8">
{{concept.display}}
</div>
<div class="col-md-1 col-sm-1">
</div>
<div class="col-md-1 col-sm-1">
<i style="cursor: pointer"
ng-click="removeInclude($index)"
class="glyphicon glyphicon-minus-sign pull-right"></i>
</div>
</div>
</div>
</div>
</div>
<!-- -->
<h5 ng-show="input.hasSystem">Systems</h5>
<div ng-repeat="include in vs.compose.include track by $index">
<div ng-if = "!include.concept && !include.filter ">
<div ng-init = "input.hasSystem = true" class="row display-row">
<div class="col-md-1 col-sm-1">
</div>
<div class="col-md-10 col-sm-10">
{{include.system}}
</div>
</div>
</div>
</div>
<!--
<h5 ng-show="includeElement.concept.length > 0">Specific included concepts</h5>
<div ng-repeat="concept in includeElement.concept">
<div class="row display-row">
<div class="col-md-2 col-sm-2">
{{concept.code}}
</div>
<div class="col-md-8 col-sm-8">
{{concept.display}}
</div>
<div class="col-md-1 col-sm-1">
</div>
<div class="col-md-1 col-sm-1">
<i style="cursor: pointer"
ng-click="removeInclude($index)"
class="glyphicon glyphicon-minus-sign pull-right"></i>
</div>
</div>
</div>
-->
<h5 ng-show="input.hasIsa">'is-a' included concepts (Branch)</h5>
<div ng-repeat="include in vs.compose.include">
<div ng-show = "include.filter">
<h5 class="banner">Filtered System: {{include.system}}</h5>
<div class="row">
<div class="col-md-2 col-sm-2"><strong>Property</strong></div>
<div class="col-md-2 col-sm-2"><strong>Operation</strong></div>
<div class="col-md-3 col-sm-3"><strong>Value</strong></div>
<div class="col-md-4 col-sm-4"><strong>Display</strong></div>
<div class="col-md-1 col-sm-1"><strong>Remove</strong></div>
</div>
<div class="row">
<div class="col-md-2 col-sm-2">
{{include.filter[0].property}}
</div>
<div class="col-md-2 col-sm-2">
{{include.filter[0].op}}
</div>
<div class="col-md-3 col-sm-3">
{{include.filter[0].value}}
</div>
<div class="col-md-4 col-sm-4">
{{input.conceptCache[include.filter[0].value]}}
</div>
<div class="col-md-1 col-sm-1">
<i style="cursor: pointer"
ng-click="removeIsa($index)"
class="glyphicon glyphicon-minus-sign pull-right"></i>
</div>
</div>
</div>
</div>
</uib-tab>
<uib-tab heading="Description">
<div class="row">
<div class="col-md-6 col-sm-6">
<form>
<div class="form-group">
<label>Name</label>
<input type="text" class="form-control" ng-model="vs.name" ng-change="input.isDirty = true"/>
</div>
<div class="form-group">
<label>Publisher</label>
<input type="text" class="form-control" ng-model="vs.publisher" ng-change="input.isDirty = true"/>
</div>
</form>
</div>
<div class="col-md-6 col-sm-6">
<form>
<div class="form-group">
<label>Description</label>
<textarea class="form-control" ng-model="vs.description" ng-change="input.isDirty = true"></textarea>
</div>
<div class="form-group">
<label>Requirements</label>
<textarea class="form-control" ng-model="vs.requirements" ng-change="input.isDirty = true"></textarea>
</div>
</form>
</div>
</div>
</uib-tab>
<uib-tab heading="Expansion">
<br/>
<div uib-alert class="alert-warning" ng-show="input.isDirty">
This ValueSet has been altered, so Save it if you want the expansion to work against the most recent version
</div>
<div class="row">
<div class="col-md-8 col-sm-8">
<input class="form-control" type="text" ng-model="input.filterText" placeholder="Filter text"/>
</div>
<div class="col-md-4 col-sm-4">
<button class="btn btn-primary pull-right" ng-click="expand(input.filterText)">Expand</button>
</div>
</div>
<br/>
{{queryUrl}}
<table class="table table-bordered">
<tr ng-repeat="item in expansion.contains">
<td>{{item.code}}</td>
<td>{{item.display}}</td>
</tr>
</table>
</uib-tab>
<uib-tab heading="Json">
<br/>
<pre>{{vs|json}}</pre>
</uib-tab>
</uib-tabset>
<div close="closeQueryError()" uib-alert class="alert-info" ng-show="queryError">
<div>Sorry, there were some issues:</div>
<div>{{queryUrl}}</div>
<br/>
<table class="table table-bordered">
<tr><th>Severity</th><th>Code</th><th>Details/Diagnostics</th><th>Location</th></tr>
<tr ng-repeat = "iss in queryError.issue">
<td>{{iss.severity}}</td>
<td>{{iss.code}}</td>
<td>{{iss.details.text}}
<div>{{iss.diagnostics}}</div>
</td>
<td><div ng-repeat="loc in iss.location">{{loc}}</div></td>
</tr>
</table>
<!--
{{queryError | json}}
-->
</div>
</div>
<div class="col-md-6 col-sm-6">
<div ng-show="canEdit">
<uib-tabset>
<uib-tab heading="Add from a Terminology">
<br/>
<div class="row">
<div class="col-md-4 col-sm-4">
<!-- <h4>Add a new concept from a Terminology</h4> -->
</div>
<div class="col-md-4 col-sm-4">
<div class="pull-right">Search root</div>
</div>
<div class="col-md-4 col-sm-4">
<select class="form-control" ng-model="input.rootConcept"
ng-options="root.display for root in rootConcepts"
ng-change="setRootConcept(input.rootConcept)"
></select>
</div>
</div>
<ng-include src="'/prTemplates/codeableconcept.html'"></ng-include>
<div ng-show="results.cc.code">
<button class="btn btn-primary" ng-click="addConcept()"
popover-placement="top" popover-trigger='mouseenter'
uib-popover="Adds the code as a single option">Add</button>
<button class="btn btn-primary" ng-click="isAConcept()"
popover-placement="top" popover-trigger='mouseenter'
uib-popover="Adds the code as an 'is-a' filter">
Add as a branch</button>
</div>
</uib-tab>
<uib-tab heading="Enter directly">
<br/>
<div class="rounded-box">
<div class="row">
<div class="col-sm-2 col-md-2">
System
</div>
<div class="col-sm-10 col-md-10">
<input type="text" class="form-control" ng-model="input.directSystem"/>
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-2 col-md-2">
Code
</div>
<div class="col-sm-4 col-md-4">
<input type="text" class="form-control" ng-model="input.directCode"/>
</div>
<div class="col-sm-2 col-md-2">
Description
</div>
<div class="col-sm-4 col-md-4">
<input type="text" class="form-control" ng-model="input.directDescription"/>
</div>
</div>
<br/>
<div class="row">
<div class="col-sm-12 col-md-12">
<button class="btn btn-primary pull-right" ng-click="addDirect()">Add</button>
</div>
</div>
</div>
</uib-tab>
</uib-tabset>
</div>
</div>
</div>
</div>
</body>
</html>