Switch to unified view

a b/nih-ct-protocol-ui/index.html
1
<html xmlns="http://www.w3.org/1999/xhtml">
2
<head>
3
4
    <title>:: AIMCTE CTEP Report Writing :: </title>
5
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
6
    
7
    <!-- <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> -->
8
        
9
    <!-- <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script> -->
10
11
12
    
13
    <script>
14
function add_field()
15
{
16
  var total_text=document.getElementsByClassName("input_text");
17
  total_text=total_text.length+1;
18
  document.getElementById("field_div").innerHTML=document.getElementById("field_div").innerHTML+
19
  "<p id='input_text"+total_text+"_wrapper'><br><input type='text' class='input_text' id='input_text"+total_text+"' placeholder='Enter Criteria'> <input type='button' value='-' onclick=remove_field('input_text"+total_text+"');> <font size='1'> <b>* remove this criteria</b></font></p>";
20
}
21
function remove_field(id)
22
{
23
  document.getElementById(id+"_wrapper").innerHTML="";
24
}
25
    // // new function for displaying JSON on web page.
26
    // function displayjson() {
27
    //  //$("#gettext").on("click", function () {
28
    //      alert("I am in a function");
29
30
    //      //this point needs to work
31
    //      var url = "get-suggestion/included";
32
    //      var newname = $.get(url, function (data) { alert("Success!")})
33
            
34
    //          //.done(function (data) {
35
    //              //$.each(data, function (key, value) {
36
    //              alert("I have data" + data);
37
    //              $("#updateme").html(data);
38
    //              //}
39
    //              //);
40
    //          //});
41
    //  //});
42
    // //});
43
    // }
44
    </script>
45
46
    <style>
47
    body
48
    {
49
  margin:0 auto;
50
  padding:0;
51
  text-align:center;
52
  height:2000px;
53
  background-color:white;
54
    }
55
    #wrapper
56
    {
57
  width:995px;
58
  padding:0px;
59
  margin:0px auto;
60
  font-family:helvetica;
61
  text-align:center;
62
    }
63
    input[type="text"]
64
    {
65
  width:200px;
66
  height:35px;
67
  margin-right:2px;
68
  border-radius:3px;
69
  border:1px solid green;
70
  padding:5px;
71
    }
72
    input[type="button"]
73
    {
74
  background:none;
75
  color:white;
76
  border:none;
77
  width:110px;
78
  height:35px;
79
  border-radius:3px;
80
  background-color:green;
81
  font-size:16px;
82
    }
83
</style>
84
<!--    
85
    <script language="javascript">
86
            function changeIt()
87
            {
88
            var i = 1;
89
            my_div.innerHTML = my_div.innerHTML +"<br><br><font size=2>New Enrolment Criteria:</font> <input id='newenrid"+i+"' type='text' name='newenrolmentcriteria"+i+"'>" + " <input type='button' value='-' onclick='removeRow(this)'> <font size=1>Remove Enrolment Criteria</font>";
90
            i += 1;
91
            }
92
            
93
            // need to remove first input
94
            function removeRow(input) { 
95
            input.parentNode.childNodes[2].remove();
96
            }
97
    </script>
98
-->
99
100
   
101
</head>
102
<body>
103
104
<div class='container'>
105
106
107
<form>
108
<h3>
109
<img src='static/cteplogo.jpg' height=140 width=140>
110
Welcome to AIM (AI-Mediated) Clinical Trial Editor!
111
</h3>
112
<!-- Welcome to AI-Mediated CT Protocol Writing Tool! -->
113
<br>
114
<font size=4><b>AIMCTE: </b><i>A recommendation engine with an Interactive UI for quick writing of CT Protocols.</i></font>
115
<br>
116
<b>Features:</b>
117
<br>
118
* would require minimal system resources
119
* identify eligibility criteria matching user inputs and recommend
120
* quick generation of CT protocols
121
<br>* a more intuitive UXp
122
* intelligent protocol drafting
123
* automated and accurate protocol writing
124
<!--
125
<span id="fooBar">&nbsp;</span>
126
-->
127
128
</form>
129
<form method="POST" id="form1">
130
<br><input class='btn'  type="button" value="Print Minimal" id="btnPrint" />
131
132
    <div id="dvContainer">
133
        <!-- This content needs to be printed. Dynamically add form elements textbox, and radio button. -->
134
<H1>ELIGIBILITY:</H1>
135
        <p>
136
        <table border=0>
137
138
        <tr>
139
        <td width='10%'>TRIAL ID: </td>
140
        <td width='30%'><input name="hello1" type="text" size="40" id="btnPrint" /></td>
141
        <td width='30%'>&nbsp;</td>
142
        <td width='30%'>&nbsp;</td>
143
        </tr>
144
145
        <tr>
146
        <td width='20%'>Within </td><td width='20%' colspan='2'><input name="prior_reg" type="text" size="10" id="btnPrint" />
147
<select class="form-group" name="prior_reg_period" id="btnPrint" />
148
<option value='prior_reg_period_days'>days</option>
149
<option value='prior_reg_period_weeks'>weeks</option>
150
<option value='prior_reg_period_months'>months</option>
151
<option value='prior_reg_period_years'>years</option>
152
</select>
153
&nbsp;prior to registration, you must not have treatment.
154
</td>
155
<td>&nbsp;</td>
156
        </tr>
157
        
158
        <tr>
159
        <td>&nbsp;</td><td width='20%' colspan='2'>
160
<select class="form-group" name="compare_measure" id="btnPrint" />
161
<option value='bpm'>BPM</option>
162
<option value='blood_pressure'>Blood Pressure</option>
163
<option value='blood_sugar'>Blood Sugar</option>
164
<option value='platelet_count'>Platelet Count</option>
165
</select>
166
<select class="form-group" name="compare_sign" id="btnPrint" />
167
<option value='grt_or_eq'>>=</option>
168
<option value='grt_than'>></option>
169
<option value='less_or_eq'><=</option>
170
<option value='less_than'><</option>
171
</select>
172
<input name="compare_measure_value" type="text" size="10" id="btnPrint" />
173
</td>
174
<td>&nbsp;</td>
175
        </tr>
176
        <tr>
177
        <td>
178
        &nbsp;
179
        </td>
180
        <td colspan='2' align='left'>       
181
        <div id="wrapper" align='left'>
182
        <div id="field_div" align='left'>
183
        <input  align='left' class='btn' type="button" value="+" onclick="add_field();"><font size='1'> <b>* add new criteria</b></font>
184
        </div>
185
        </div>  
186
        </td>
187
        <td width='30%'>&nbsp;</td>
188
        </tr>
189
190
        <tr>
191
            <td width='10%'>Enter Free Text: </td>
192
            <td width='30%'><input name="freesuggest" type="text" size="40" id="freesuggest" /></td>
193
            <td width='30%'>&nbsp;</td>
194
            <td width='30%'>&nbsp;</td>
195
        </tr>
196
197
        <tr>
198
        <td>
199
        &nbsp;
200
        </td>
201
        <td colspan=2 align='left'>     
202
        <div id="wrapper" align='left'>
203
        <div id="field_div" align='left'>
204
<input id="gettext" align='left' class='btn' type="button" value="suggest" onclick="displayjson();"><font size='1'> <b>* show new suggestions</b></font>
205
        <div id="updateme">     
206
207
        </div>
208
209
        </div>
210
        </div>  
211
        </td>
212
        <td width='30%'>&nbsp;</td>
213
        </tr>
214
215
216
        <!--        
217
        
218
        <tr>
219
        <td>Hello1: </td><td><input name="hello1" type="text" size="80" id="btnPrint" /></td>
220
        </tr>
221
222
        <input type="text" name=t1>
223
        <input class='btn' type="button" value="+" onClick="changeIt()"><font size='1'> add new criteria</font>
224
        <div id="my_div">&nbsp;</div>
225
        
226
        -->
227
        </table>
228
        </p>
229
    </div>
230
    
231
    </form>
232
</div>
233
    
234
    <script src="https://code.jquery.com/jquery-3.3.1.min.js" crossorigin="anonymous"></script>
235
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
236
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
237
    
238
    <script>
239
        // new function for displaying JSON on web page.        
240
        function displayjson() {
241
            //$("#gettext").on("click", function () {
242
            // alert("I wanna display JSON!");
243
            // jQuery.get(url, function (data) { alert("Success!");})
244
            //this point now works
245
            // $("#updateme").html(data);
246
            // alert("Done. I now have data! " + JSON.stringify(data));
247
            // alert("Done. I now have data! " + JSON.stringify(data));
248
                        //}
249
                        //);
250
                    //});
251
                var squery = $("#freesuggest").val();
252
                var url = "get-suggestion/" + squery;
253
                jQuery.getJSON(url, {
254
                    q: squery
255
            })
256
                    .done(function (data) {
257
                        // I need to copy and write this similar ffn for CTEP suggestion
258
                        //$.each(data[0], function (key, value) {
259
                        // alert("My Suggestion(s):" + JSON.stringify(data[0]['data_suggestion']));
260
                         var sresult = JSON.stringify(data[0]['data_suggestion'][0]);
261
                         var sresult = sresult.slice(1,-1);
262
                         var newsresult = new Array();
263
                         var newsresult = sresult.split(";");
264
                        //  $.each(newsresult)
265
                    
266
                        var items = [];
267
                        for(i=0; i < newsresult.length; i++)
268
                            {
269
                                items.push( "<li>" + newsresult[i] + "</li>" );
270
                            }   
271
                        $("<ul/>", {
272
                            "class": "list-group-item",
273
                            html: items.join("")
274
                        }).appendTo("#updateme");
275
                    });
276
//                       $("#updateme").html(sresult);
277
//          });
278
        }
279
        </script>
280
281
<script type="text/javascript">
282
    $("#btnPrint").on("click", function () {
283
        var divContents = $("#dvContainer").html();
284
        var printWindow = window.open('', '', 'height=400,width=800');
285
        printWindow.document.write('<html><head><title>CTEP Report Writing</title>');
286
        printWindow.document.write('</head><body >');
287
        printWindow.document.write(divContents);
288
        printWindow.document.write('</body></html>');
289
        printWindow.document.close();
290
        printWindow.print();
291
    });
292
</script>
293
294
<script>
295
296
    // $(document).ready(function () {
297
    //  $("#gettext").on("click", function () {
298
    //      var url = "http://localhost:4000/get-suggestion/included";
299
    //      $.getJSON(url, function (data) { })
300
    //          .done(function (data) {
301
    //              //$.each(data, function (key, value) {
302
    //                  $("#updateme").text(data);
303
    //              //}
304
    //              //);
305
    //          });
306
    //  });
307
    // });
308
309
310
</script>   
311
312
</body>
313
</html>