-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtb.html
90 lines (70 loc) · 2.41 KB
/
tb.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
<!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">
<title>Document</title>
<style>
table{
border-collapse: collapse;
border-spacing: 0;
}
th, td{
padding: 10px 20px;
border: 1px solid lightgray;
}
td.on{
background-color: green;
}
td.start{
background-color: lightgreen;
}
#data { height:100px;width:800px; }
</style>
</head>
<body id="body">
Load Drugogram from text file: <input type="file" id="file-input" ><br><br>
Format: Start,Stop,Type,Drug, Notes
<div id="file-content"></div>
<textarea id="data">
5/10/2021,5/20/2021,treatment,INH,10mg
5/10/2021,5/10/2021,vital,Weight,147lbs
5/15/2021,5/28/2021,treatment,RIF
4/10/2021,6/10/2021,treatment,EMB,100mg
7/10/2021,8/10/2021,treatment,EMB,200mg
3/10/2021,5/10/2021,treatment,RZA
3/10/2021,3/10/2021,vital,Weight,145lbs
4/10/2021,5/10/2021,treatment,PAS
4/27/2021,4/27/2021,lab,Cultures1,Negative
5/27/2021,5/27/2021,lab,Cultures1,Negative
5/27/2021,5/27/2021,lab,Cultures2,Positive
5/27/2021,5/27/2021,vital,Weight,150lbs
5/27/2021,5/27/2021,note,Notes,Notes about patient go here.
3/23/2021,3/23/2021,note,Notes,Clinic Visit.
</textarea>
<br>
<button type="button" id="save" title="Save as text file">Save Drugogram as Txt File</button>
<button type="button" id="load" title="Load Records">Visualize Drugogram Records</button>
<br><br>
<script type="text/javascript">
// when document is ready
document.getElementById("save").onclick = function() {
// when clicked the button
var content = document.getElementById('data').value;
function download(filename, text) {
var element = document.createElement('a');
element.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
element.setAttribute('download', filename);
element.style.display = 'none';
document.body.appendChild(element);
element.click();
document.body.removeChild(element);
}
// Start file download.
download("drugogram.txt",content);
}
</script>
<script language="javascript" src="script.js"></script>
</body>
</html>