Skip to content

Commit

Permalink
Detab
Browse files Browse the repository at this point in the history
  • Loading branch information
Nikolai Schwertner committed Feb 14, 2018
1 parent e489f75 commit 569cb1d
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 87 deletions.
18 changes: 9 additions & 9 deletions src/app.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@
}

.navbar-inverse {
background-color: #4D5B66;
background-color: #4D5B66;
}

span.title,.navbar-inverse .navbar-brand {
text-shadow: 0 1px 1px #000;
color: #FFF;
font-weight: bold;
text-shadow: 0 1px 1px #000;
color: #FFF;
font-weight: bold;
}

.container-fluid {
position: absolute;
top: 70px;
right: 0;
bottom: 0;
left: 0;
position: absolute;
top: 70px;
right: 0;
bottom: 0;
left: 0;
}

.container-fluid-no-banner {
Expand Down
96 changes: 48 additions & 48 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,72 +5,72 @@ let state = {
}

const risks = {
highRiskLowerLimit: (hours) => (
0.0000000001087380116978890 * Math.pow(hours, 6)
- 0.0000000390241213926723000 * Math.pow(hours, 5)
+ 0.0000051614113948939000000 * Math.pow(hours, 4)
- 0.0002969267656958150000000 * Math.pow(hours, 3)
+ 0.0049045801308693600000000 * Math.pow(hours, 2)
+ 0.2770830724994080000000000 * hours + 3.0000000000000000000000000),
highIntermediateLowerLimit: (hours) => (
0.0000000001117640940944670 * Math.pow(hours, 6)
- 0.0000000412521674888165000 * Math.pow(hours, 5)
+ 0.0000056604841945917500000 * Math.pow(hours, 4)
- 0.0003464807831541350000000 * Math.pow(hours, 3)
+ 0.0075934710390583900000000 * Math.pow(hours, 2)
+ 0.1810763744197170000000000 * hours + 2.5000000000000000000000000),
lowIntermediateLowerLimit: (hours) => (
0.0000000000055158434836619 * Math.pow(hours, 6) -
0.0000000020974548879410700 * Math.pow(hours, 5) +
0.0000002627978699654140000 * Math.pow(hours, 4) -
0.0000054294662703569000000 * Math.pow(hours, 3) -
0.0018169823503626500000000 * Math.pow(hours, 2) +
0.2329924996556660000000000 * hours + 2.0000000000000000000000000),
highRiskLowerLimit: (hours) => (
0.0000000001087380116978890 * Math.pow(hours, 6)
- 0.0000000390241213926723000 * Math.pow(hours, 5)
+ 0.0000051614113948939000000 * Math.pow(hours, 4)
- 0.0002969267656958150000000 * Math.pow(hours, 3)
+ 0.0049045801308693600000000 * Math.pow(hours, 2)
+ 0.2770830724994080000000000 * hours + 3.0000000000000000000000000),
highIntermediateLowerLimit: (hours) => (
0.0000000001117640940944670 * Math.pow(hours, 6)
- 0.0000000412521674888165000 * Math.pow(hours, 5)
+ 0.0000056604841945917500000 * Math.pow(hours, 4)
- 0.0003464807831541350000000 * Math.pow(hours, 3)
+ 0.0075934710390583900000000 * Math.pow(hours, 2)
+ 0.1810763744197170000000000 * hours + 2.5000000000000000000000000),
lowIntermediateLowerLimit: (hours) => (
0.0000000000055158434836619 * Math.pow(hours, 6) -
0.0000000020974548879410700 * Math.pow(hours, 5) +
0.0000002627978699654140000 * Math.pow(hours, 4) -
0.0000054294662703569000000 * Math.pow(hours, 3) -
0.0018169823503626500000000 * Math.pow(hours, 2) +
0.2329924996556660000000000 * hours + 2.0000000000000000000000000),
}

const filter = {
date: (date, format) => {
return (new XDate(date)).toString(format)
},
age: (date) => {
let yearNow = new Date().getYear()
let monthNow = new Date().getMonth()
let dateNow = new Date().getDate()
let yearNow = new Date().getYear()
let monthNow = new Date().getMonth()
let dateNow = new Date().getDate()

let yearDob = new Date(date).getYear()
let monthDob = new Date(date).getMonth()
let dateDob = new Date(date).getDate()
let monthDob = new Date(date).getMonth()
let dateDob = new Date(date).getDate()

let yearAge = yearNow - yearDob
let monthAge = null
let dateAge = null
let monthAge = null
let dateAge = null

if (monthNow >= monthDob) monthAge = monthNow - monthDob
else {
yearAge--
monthAge = 12 + monthNow - monthDob
}
if (monthNow >= monthDob) monthAge = monthNow - monthDob
else {
yearAge--
monthAge = 12 + monthNow - monthDob
}

if (dateNow >= dateDob) dateAge = dateNow - dateDob
else {
monthAge--
dateAge = 31 + dateNow - dateDob
if (monthAge < 0) {
monthAge = 11
yearAge--
}
}
if (dateNow >= dateDob) dateAge = dateNow - dateDob
else {
monthAge--
dateAge = 31 + dateNow - dateDob
if (monthAge < 0) {
monthAge = 11
yearAge--
}
}

let hours = (new Date().getTime() - new Date(date).getTime()) / 36e5
if (dateAge > 1) hours = hours/(24 * dateAge)

if ( (yearAge > 0) && (monthAge > 0) && (dateAge > 0) ) return yearAge + "y " + monthAge + "m " + dateAge + "d"
else if ( (yearAge > 0) && (monthAge > 0) && (dateAge == 0) ) return yearAge + "y " + monthAge + "m"
else if ( (yearAge > 0) && (monthAge == 0) && (dateAge > 0) ) return yearAge + "y " + dateAge + "d"
else if ( (yearAge > 0) && (monthAge == 0) && (dateAge == 0) ) return yearAge + "y"
else if ( (yearAge == 0) && (monthAge > 0) && (dateAge > 0) ) return monthAge + "m " + dateAge + "d"
else if ( (yearAge == 0) && (monthAge > 0) && (dateAge == 0) ) return monthAge + "m"
else if ( (yearAge == 0) && (monthAge == 0) && (dateAge > 1) ) return dateAge + "d"
else if ( (yearAge > 0) && (monthAge > 0) && (dateAge == 0) ) return yearAge + "y " + monthAge + "m"
else if ( (yearAge > 0) && (monthAge == 0) && (dateAge > 0) ) return yearAge + "y " + dateAge + "d"
else if ( (yearAge > 0) && (monthAge == 0) && (dateAge == 0) ) return yearAge + "y"
else if ( (yearAge == 0) && (monthAge > 0) && (dateAge > 0) ) return monthAge + "m " + dateAge + "d"
else if ( (yearAge == 0) && (monthAge > 0) && (dateAge == 0) ) return monthAge + "m"
else if ( (yearAge == 0) && (monthAge == 0) && (dateAge > 1) ) return dateAge + "d"
else if ( (yearAge == 0) && (monthAge == 0) && (dateAge > 0) ) return hours.toFixed(2) + "h"
else return "Could not calculate age"
},
Expand Down
60 changes: 30 additions & 30 deletions src/index.html
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bilirubin</title>
<link rel="stylesheet" href="libs/bootstrap-3.3.5-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="app.css">
<script src="libs/xdate.js"></script>
<script src="libs/jquery-2.1.4/jquery.min.js"></script>
<script src="libs/highcharts/highcharts.js"></script>
<script src="libs/highcharts/highcharts-more.js"></script>
<head>
<title>Bilirubin</title>
<link rel="stylesheet" href="libs/bootstrap-3.3.5-dist/css/bootstrap.min.css">
<link rel="stylesheet" href="app.css">
<script src="libs/xdate.js"></script>
<script src="libs/jquery-2.1.4/jquery.min.js"></script>
<script src="libs/highcharts/highcharts.js"></script>
<script src="libs/highcharts/highcharts-more.js"></script>
<script src="libs/fhir-client/fhir-client.js"></script>
</head>
<body>
<header id="patientBanner" class="navbar navbar-inverse navbar-static-top" role="navigation">
<p class="navbar-brand"><span class="glyphicon glyphicon-user"></span><span id="patientName"></span></p>
<p class="navbar-text">sex <span id="patientSex" class="title"></span></p>
<p class="navbar-text">dob <span id="patientDOB" class="title"></span></p>
<p class="navbar-text">age <span id="patientAge" class="title"></span></p>
</header>
<div id="main">
<div class="row" style="height: 100%">
<div id="chartContainer" class="col-xs-6" style="height: 100%"></div>
<div class="col-xs-6">
</head>
<body>
<header id="patientBanner" class="navbar navbar-inverse navbar-static-top" role="navigation">
<p class="navbar-brand"><span class="glyphicon glyphicon-user"></span><span id="patientName"></span></p>
<p class="navbar-text">sex <span id="patientSex" class="title"></span></p>
<p class="navbar-text">dob <span id="patientDOB" class="title"></span></p>
<p class="navbar-text">age <span id="patientAge" class="title"></span></p>
</header>
<div id="main">
<div class="row" style="height: 100%">
<div id="chartContainer" class="col-xs-6" style="height: 100%"></div>
<div class="col-xs-6">
<table id="dataTable" class="table table-striped">
<tr>
<th>Date/Time</th>
<th>Result (mg/dL) </th>
<th>Age (Hrs)</th>
<th>Value:Test</th>
<th>Risk Zone</th>
</tr>
<tr>
<th>Date/Time</th>
<th>Result (mg/dL) </th>
<th>Age (Hrs)</th>
<th>Value:Test</th>
<th>Risk Zone</th>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="app.js"></script>
</body>
</html>

0 comments on commit 569cb1d

Please sign in to comment.