You are on page 1of 11

HOW TO CREATE AN ONLINE CALCULATOR Using JavaScript to Improve

Productivity & Workflow


A CALCULATOR IS NOT JUST A CALCULATOR

Our Calculator is a complex tool that will


allow user input to quickly generate a
useful output.
The calculation performed can be a
simple equation or a complex
management algorithm.
The output can be a simple number or a
complete statement.
FINDING A PROBLEM TO SOLVE

The goal of the calculator should be to


improve workflow.
First, use primary literature to outline the
basic calculation or algorithm.
It is also important to get buy-in and
seek feedback from targeted audience.
MAKING A COMPLEX CALCULATION SIMPLE
Intracerebral hematoma volume is used
in the ICH Score, which is used to predict
outcomes of spontaneous intracerebral
hemorrhage.
Hematoma volume can be estimated
using the formula of an ellipsoid. An
4
ellipsoid has a volume of ,
3 2 2 2
where A, B, and C are the three
diameters. If is estimated to be 3, the
formula simplifies to V= ABC/2
MAKING A COMPLEX CALCULATION SIMPLE
To simplify things further in the calculation,
only the axial CT slice with the largest
hematoma area is used. The length is denoted
A in the equation and the width is denoted B.
The C value is calculated by finding the CT
slice with the greatest thickness and comparing
A it to every other slice. If the hematoma area in
B a slice is >75% the area of the largest slice, it
gets a value of 1. If it is from 50-75% of the
area, it gets a value of 0.5. All other slices get
a value of 0. The sum of these areas is
multiplied by the slice thickness to get the C
value.

C=
(1 + 1 + 1 + 1 + 0.5 + 0) x (Slice Thickness)
BUILDING FOR THE WEB

The hand calculation for this formula can


be tedious, and physicians are prone to
error when using this formula.
By creating a web based calculator,
anyone with an internet connection could
use the calculator to improve productivity
and workflow.
THE BASIC FRAMEWORK
HTML

Three components are used in the making


of the online calculator:
Hypertext markup language (HTML) CSS
forms the box that holds everything.
Cascading style sheets (CSS) makes the
box aesthetically pleasing.
JavaScript is the brains of the calculator
JavaScript
CREATING THE CODE

Anything displayed statically is written in


HTML.
CSS is the language used to make the
webpage design inviting to users.
It can be used to define what
page elements are hidden or
visible.
The code below gives an example
of how any page referencing this
CSS display will use sans-serif text
and a white background by default:
body {
font-family: arial, sans-serif;
background: white;
}
DYNAMIC INPUTS

JavaScript assigns the input from the


form as variables.
Javascript operators and functions
are used to process the input variables
into an output variable

Inputs

Output
DYNAMIC INPUTS

A truncated version of the code is displayed


below. Each form item becomes an input Inputs
variable. The output is a statement that can be
copied into the dictation system. Output
THE IMPLICATIONS

The development of instruments like this


have the capability to improve efficiency
in radiologic reporting.
Additionally, seeking feedback from
users could identify overlooked areas
leading to improved functionality.
These instruments standardize the way in
which results are reported, which would
help physicians quickly find critical results
essential to patient care.

You might also like