-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlexCTS2VS.html
462 lines (447 loc) · 25 KB
/
lexCTS2VS.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="../../docs-assets/ico/favicon.png">
<title>CTS2 Value Sets</title>
<!-- Bootstrap core CSS -->
<link href="bootstrap3/css/bootstrap.css" rel="stylesheet">
<link href="cts2/css/typeahead.js-bootstrap.css" rel="stylesheet" >
<!-- Custom styles for this template -->
<link href="bootstrap3/css/jumbotron.css" rel="stylesheet">
<link href="cts2/css/cts2.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.html">LexEVS CTS2</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="HowTo.html">How To</a></li>
<li><a href="lexCTS2CS.html">Code Systems</a></li>
<li class="active" ><a href="#">Value Sets</a></li>
<li><a href="lexCTS2Map.html">Maps</a></li>
<li><a href="lexCTS2Paginate.html">Paginate</a></li>
</ul>
</div>
</div>
</div>
<!-- Main jumbotron for a primary marketing message or call to action -->
<div class="jumbotron">
<div class="container">
<h1>CTS2 Value Sets in LexEVS</h1>
<p>Try out the examples below or learn more about CTS2 and LexEVS</p>
<p><a class="btn btn-primary btn-lg" href="index.html" role="button">Learn more »</a></p>
</div>
</div>
<div class="container">
<!-- Example row of columns -->
<div class="row">
<div class="col-md-4">
<div class="well">
<div class="example example-valuesets">
<h2 class="example-name">Value Set</h2>
<p class="example-description">This demonstrates an auto completion function on names of value sets in
the LexEVS terminology service. Example: Start typing imputation. </p>
<div class="demo">
<input class="typeahead" type="text" placeholder="valueset">
</div>
</div>
<div style="padding-top: 75px">
<p><a class="btn btn-info" href="#" role="button" data-toggle="modal" data-target="#vsAutoModal">Get Code »</a></p>
</div>
</div>
<div class="modal fade" id="vsAutoModal" tabindex="-1" role="dialog" aria-labelledby="vsAutoModalLabel" aria-hidden="true">
<div class="modal-dialog, modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="vsAutoModalLabel">How to Implement Value Set Auto-complete</h4>
</div>
<div class="modal-body">
<p>This function is based on a JavaScript framework called BootStrap and a Bootstrap Plugin called Typeahead</p>
<h4> HTML Required</h4>
<p>Import the css files by adding these lines to the head tag of the html</p>
<pre>
<code>
<link href="bootstrap3/css/bootstrap.css" rel="stylesheet">
<link href="cts2/css/typeahead.js-bootstrap.css" rel="stylesheet" >
<link href="cts2/css/cts2.css" rel="stylesheet">
</code>
</pre>
<p>Insert this code into the html body</p>
<pre><code>
<div class="example example-valuesets">
<h2 class="example-name">Value Set</h2>
<p class="example-description">Auto Complete</p>
<div class="demo">
<input class="typeahead" type="text" placeholder="valueset">
</div>
</div>
</code></pre>
<p>Placed at the end of the html document before the closing body tag so the pages load faster</p>
<pre>
<code>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="bootstrap3/js/bootstrap.min.js"></script>
<script src="cts2/js/typeahead.js"></script>
<script src="cts2/js/valueSetTypeahead.js"></script>
</code>
</pre>
<h4>JavaScript</h4>
<pre><code>
$('.example-valuesets .typeahead').typeahead({
name: 'valuesets',
valueKey: 'content',
remote: {
url : 'http://bmidev4:5555/cts2/resolvedvaluesets?matchvalue=%QUERY&filtercomponent=resourceName&format=json&callback=?',
filter: function (data) {
var values = []
var valueSets = data.ResolvedValueSetDirectory.entry;
for(i in valueSets){
var entry = data.ResolvedValueSetDirectory.entry[i].resolvedHeader.resolutionOf.valueSet.content;
values.push(entry)
}
return values;
}
},
limit: 3
});
</code></pre>
<p>Here the selector keys into the html div class "example-valuesets" and the input
class "typeahead." The "valueKey" attribute matches the name of the property returned
from the REST call.
</p>
<h4>Resources</h4>
<p>All source and files are available at this
<a href="https://github.com/lexevs/lexevscts2">github repository</a></p>
<p>Files required for this implementation are the <span class="r">bootstrap3 folder</span>, <span class="r">valueSetTypeahead.js</span>,
<span class="r">typeahead.js-bootstrap.css</span>, and <span class="r">typeahead.js</span></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="col-md-4">
<div class="well">
<h2>Value Set</h2>
<p>Tooltip for exposing a resolved value set's metadata</p>
<a href="#" data-toggle="tooltip" id="tooltip" data-cts="CDISC ADaM Date Imputation Flag Terminology">CDISC ADaM Date Imputation Flag Terminology</a>
<div style="padding-top: 75px">
<p><a class="btn btn-info" href="#" role="button" data-toggle="modal" data-target="#vsttModal">Get Code »</a></p>
</div>
</div>
<div class="modal fade" id="vsttModal" tabindex="-1" role="dialog" aria-labelledby="vsttModalLabel" aria-hidden="true">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="vsttModalLabel">How to Implement a Value Set ToolTip</h4>
</div>
<div class="modal-body">
<p>This function is based on BootStrap, a JavaScript Framework</p>
<h4> HTML Required</h4>
<p>Import the css files by adding these lines to the head tag of the html</p>
<pre>
<code>
<link href="bootstrap3/css/bootstrap.css" rel="stylesheet">
<link href="cts2/css/cts2.css" rel="stylesheet">
</code>
</pre>
<p>Insert this code into the html body</p>
<pre>
<code>
<div class="col-lg-6">
<a href="#" data-placement="bottom" data-toggle="tooltip" id="tooltip"
data-cts="CDISC ADaM Date Imputation Flag Terminology">
CDISC ADaM Date Imputation Flag Terminology</a>
</div>
</code>
</pre>
<p>Placed at the end of the html document before the closing body tag so the pages load faster</p>
<pre>
<code>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="bootstrap3/js/bootstrap.min.js"></script>
<script src="cts2/js/valueSetTooltip.js"></script>
</code>
</pre>
<h4>JavaScript</h4>
<pre>
<code>
$(document).ready(function(){
var url = "http://bmidev4:5555/cts2/resolvedvaluesets?matchvalue=${valueSetName}&filtercomponent=resourceName&format=json&callback=?";
var vsID = $("#tooltip").attr("data-cts");
$.getJSON(url.replace("${valueSetName}", vsID), function(cts2JSON) {
var html = getValueSetTableInfo(cts2JSON);
$('#tooltip').tooltip({title: html, html: true });
});
function getValueSetTableInfo(valueSetJson) {
// get the description, URI, and value set name
var entryList = valueSetJson.ResolvedValueSetDirectory.entry;
for(i in entryList){
var entry = valueSetJson.ResolvedValueSetDirectory.entry[i];
var valueSetName = entry.resolvedHeader.resolutionOf.valueSet.content;
var URI = entry.resolvedValueSetURI;
var description = entry.resolvedHeader.resolutionOf.valueSetDefinition.content;
}
var html =
"<table class="table table-striped table-bordered table-condensed">" +
"<th colspan="2" > Value Set </th>" +
"<tr><td >Name:</t><td>" + valueSetName+ "</td></tr>" +
"<tr><td >URI:</td><td>" + URI + "</td></tr>" +
"<tr><td >Description code:</td><td>" + description + "</td></tr>" +
"</table>";
return html;
}
});
</code>
</pre>
<p>
The REST URL for the value set is completed by a hidden data input named "data-cts"
The <i>getJson()</i> method returns JSON formatted text from the service which is parsed
automatically into jsonp. The resulting objects can be referenced for value set
metadata values after which some html is formatted around them and passed back to the
tooltip to be shown on mouse hover.
</p>
<h4>Resources</h4>
<p>All source and files are available at this
<a href="https://github.com/lexevs/lexevscts2">github repository</a></p>
<p>
Required files include the <span class="r">bootstrap3 folder</span>,
<span class="r">valueSetToolTip.js</span>, and <span class="r">cts2.css</span>.
</p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="col-md-4">
<div class="well">
<h2>Value Sets</h2>
<p>A dropdown list of all value sets (limited to the first 50 by default paging values in the
CTS2 REST implementation over LexEVS.)</p>
<div class="btn-group" data-spy="scroll" data-target="#valuesets">
<a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i>All Value Sets</a>
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
<ul class="dropdown-menu" id="valuesets">
<li><a href="#"><b>Value Sets</b></a></li>
<li class="divider"></li>
</ul>
</div>
<div style="padding-top: 75px">
<p><a class="btn btn-info" href="#" role="button" data-toggle="modal" data-target="#vsDDModal">Get Code»</a></p>
</div>
</div>
<div class="modal fade" id="vsDDModal" tabindex="-1" role="dialog" aria-labelledby="vsDDModalLabel" aria-hidden="true">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="vsDDModalLabel">How to Implement CTS2 Value Set Drop Down</h4>
</div>
<div class="modal-body">
<p>This function is based on a JavaScript framework called BootStrap</p>
<h4> HTML Required</h4>
<p>Import the css files by adding these lines to the head tag of the html</p>
<pre>
<code>
<link href="bootstrap3/css/bootstrap.css" rel="stylesheet">
<link href="cts2/css/cts2.css" rel="stylesheet">
</code>
</pre>
<p>Insert this code into the html body</p>
<pre><code>
<div class="btn-group" data-spy="scroll" data-target="#valuesets">
<a class="btn btn-primary" href="#">
<i class="icon-user icon-white"></i>All Value Sets
</a>
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown"
href="#"><span class="caret"></span>
</a>
<ul class="dropdown-menu" id="valuesets">
<li><a href="#">Value Sets</a></li>
<li class="divider"></li>
</ul>
</div>
</code></pre>
<p>Placed at the end of the html document before the closing body tag so the pages load faster</p>
<pre>
<code>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="bootstrap3/js/bootstrap.min.js"></script>
<script src="cts2/js/valueSetDropDown.js"></script>
</code>
</pre>
<h4>JavaScript</h4>
<pre><code>
$(function() {
var vsurl = "http://bmidev4:5555/cts2/resolvedvaluesets?format=json";
$.getJSON(vsurl + "&callback=?", function (vsdata) {
for (var i in vsdata.ResolvedValueSetDirectory.entry) {
var entry = vsdata.ResolvedValueSetDirectory.entry[i];
var name = entry.resolvedHeader.resolutionOf.valueSet.content;
$("ul.dropdown-menu#valuesets").append("<li><a href="#">" + name +
"</a></li>");
}
});
});
</code></pre>
<p>
Here the class attribute "dropdown-menu" is a selector value allowing the list of
JSON derived objects to be processed into a set of html attributes which are appended to
an html list created by bootstrap functions. Drop down scrolling is controlled by an
overflow designation in the cts2.css file.
</p>
<h4>Resources</h4>
<p>All source and files are available at this
<a href="https://github.com/lexevs/lexevscts2">github repository</a></p>
<p>Files required for this implementation are the <span class="r">bootstrap3 folder</span>,
<span class="r">cts2.css</span> and <span class="r">valueSetDropDown.js</span></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
</div>
<div class="row">
<div class="col-md-4">
</div>
<div class="col-md-4">
<div class="well">
<h2>Value Set Entities</h2>
<p>A resolved value set's entities are listed in this dropdown list. For code clarity we have only
resolved the first 50 after which we'd need to page to the next set via another REST call.</p>
<div class="btn-group">
<a class="btn btn-primary" href="#"><i class="icon-user icon-white"></i>UCUMT</a>
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
<ul class="dropdown-menu" id="resolved">
<li><a href="#"><b>Value Set Entity List</b></a></li>
<li class="divider"></li>
</ul>
</div>
<div style="padding-top: 75px">
<p><a class="btn btn-info" href="#" role="button" data-toggle="modal" data-target="#vsEntityModal">Get Code »</a></p>
</div>
</div>
<div class="modal fade" id="vsEntityModal" tabindex="-1" role="dialog" aria-labelledby="vsEntityModalLabel" aria-hidden="true">
<div class="modal-dialog modal-wide">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="vsEntityModalLabel">How Implement Value Set Resolution Entity Drop Down Display</h4>
</div>
<div class="modal-body">
<p>This function is based on a JavaScript framework called BootStrap</p>
<h4> HTML Required</h4>
<p>Import the css files by adding these lines to the head tag of the html</p>
<pre>
<code>
<link href="bootstrap3/css/bootstrap.css" rel="stylesheet">
<link href="cts2/css/cts2.css" rel="stylesheet">
</code>
</pre>
<p>Insert this code into the html body</p>
<pre><code>
<div class="btn-group">
<a class="btn btn-primary" href="#">
<i class="icon-user icon-white"></i>Unified Code for Units of Measure Terminology
</a>
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">
<span class="caret"></span>
</a>
<ul class="dropdown-menu" id="resolved">
<li><a href="#">Value Sets</a></li>
<li class="divider"></li>
</ul>
</div>
</code></pre>
<p>Placed at the end of the html document before the closing body tag so the pages load faster</p>
<pre>
<code>
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="bootstrap3/js/bootstrap.min.js"></script>
<script src="cts2/js/vsEntitiesDropDown.js"></script>
</code>
</pre>
<h4>JavasScript</h4>
<pre><code>
var resValueSetListConfig = {
serviceUrl: "http://bmidev4:5555/cts2/valueset/Unified Code for Units of Measure Terminology/definition/3f9797c0/resolution?format=json"
};
$(document).ready(
function() {
var url = resValueSetListConfig.serviceUrl;
var encodedUrl = encodeURI(url);
$.getJSON(encodedUrl + "&callback=?", function (data) {
or (var i in data.IteratableResolvedValueSet.entry) {
var entry = data.IteratableResolvedValueSet.entry[i];
var name = entry.designation;
$("ul.dropdown-menu#resolved").append("<li><a href="#">" + name + "</a></li>");
}
});
});
</code></pre>
<p>
Here the class attribute "dropdown-menu" is a selector value allowing the list of
JSON derived objects to be processed into a set of html attributes which are appended to
an html list a created by bootstrap functions. Drop down scrolling is controlled in the
cts.css with an overflow designation.
</p>
<h4>Resources</h4>
<p>All source and files are available at this
<a href="https://github.com/lexevs/lexevscts2">github repository</a></p>
<p>Files required to this implementation are the <span class="r">bootstrap3 folder</span>,
<span class="r">cts2.css</span> and <span class="r">vsEntitiesDropDown.js</span></p>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
</div>
<div class="col-md-4">
</div>
</div>
<hr>
</div> <!-- /container -->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="cts2/js/jquery-1.10.2.js"></script>
<script src="bootstrap3/js/bootstrap.min.js"></script>
<script src="cts2/js/typeahead.js"></script>
<script src="cts2/js/valueSetTypeahead.js"></script>
<script src="cts2/js/valueSetTooltip.js"></script>
<script src="cts2/js/valueSetDropDown.js"></script>
<script src="cts2/js/vsEntitiesDropDown.js"></script>
<script src="cts2/js/HeightAdjust.js"></script></li>
</body>
</html>