Severe hyponatremia (sodium < 120 mEq/L) is a potentially serious electrolyte disturbance among hospitalized patients. Correcting hyponatremia too rapidly can lead to serious neurologicla complications such as Central pontine myelinolysis (CPM) and Osmotic Demyelination Syndrome (ODS). Avoiding these complications requires careful monitoring and titration of therapies. One challenge is defining precise sodium correction goals and determining if the correction is occuring as intended, particularly in the context of multiple therapies being administered. This is fundamentally a data visualization problem, that can be solved with an interactive web-app.
The patient's sodium values are displayed in an xy plot versus time. The safe rate of correction is shown as a glideslope. The user can add more sodium values and see if they fall within the safe rate of correction. Values outside the safe correction range are highlighted.
The user can use the default rate of sodium correction (6-8 mEq/L/day), a more cautious rate (4-6 mEq/L/day), a more aggressive rate (8-10 mEq/L/day), or even a custom rate.
The user can also indicate when treatments such as D5W, Normal Saline, 3% saline, or ddAVP are administered. These therapies are also shown on the graph. The app can also help the user estimate how giving crystalloid or free water with change the patients sodium.
Finally, the user can save the graph to disk, paste it into the medical record, or print it out, so everyone on the medical team has shared mental model about the plan for safe sodium correction.
demonstration of the features of NaPathway
Try it out here.
- Patient Information: Enter gender, age, and weight to auto-calculate total body water (TBW).
- Correction Rate: Select or customize target sodium correction rate (mEq/L/day).
- Sodium Measurements: Add time-stamped serum sodium values; see red flags when out of safe range.
- Treatments Administered: Log boluses and infusions (0.9% NS, 3% NS, LR, D5W, ddAVP).
- Bolus ΔNa computed per distribution formula.
- Infusion ΔNa per hour calculated using the same distribution formula.
- Dynamic Chart:
- Shaded blue zone representing allowable glideslope.
- Lines for minimum and maximum correction rates.
- Horizontal bars for treatments, color-coded.
- Tooltips & Labels:
- Detailed tooltips showing expected ∆Na (mEq/L or mEq/L/hour).
- Concise on-graph labels to avoid clutter.
- Export & Share: Copy graph to clipboard, save as PNG, or print for documentation.
Example of a warning when the rate of sodium correction exceeds the specified safe correction rate
In order to calculate how an infusion or bolus will alter the patients serum sodium, we need to estimate their Total Body Water (TBW). We can estimate TBW using:
The coefficient (C) used to estimate TBW depends on age, gender, and weight:
- Children and adult males: 0.6 * body weight (in kg)
- Adult females and elderly males: 0.5 * body weight (in kg)
- Elderly females: 0.45 * body weight (in kg)
Note that there are more accurate anthropometric equations - like the Watson Formula - that use height, weight, age, and gender. I have chosen to use the simpler approximation because height data is not always available. Ideally, if this was connected to the EHR, the app would use the better formula if more information was available.
In order to calculate the expected change in sodium, we also need to consider the sodium content of different intravenous fluid solutions:
- 0.9% saline = 154 mEq/L
- 3% saline = 513 mEq/L
- 5% saline = 856 mEq/L
- Lactated Ringers = 130 mEq/L
- Dextrose 5% water (D5W) = 0 mEq/L
Specifically to calculate the expected change in sodium, we use the patients TBW, most recent sodium value, and the sodium content of the infusate, using the following equation:
It's slighty more complicated if we want to calculate the hourly change in sodium with continuous infusions.
Given:
-
$TBW$ = total body water (L) -
${Na}_{start}$ = initial serum sodium (mEq/L) -
${Na}_{inf}$ = sodium concentration of the infusate (mEq/L) -
$\dot V$ = infusion rate (mL/hr) -
${V}_{hr}$ =$\dot{V} / 1000$ (L infused in one hour)
Then after one hour:
and the expected change per hour is
Practically, we can surface the expected change in sodium as a property of each infusion (as a tooltip on each therapy). Therefore if a patient is receiving multiple treatments we can see how each would be expected to change their serum sodium.
NaPathway calculates the expected change in sodium with each therapy administered
- HTML/CSS/JavaScript for the UI and calculations
- Uses luxon.js for handling date/times and chart.js for displaying the results. It uses the Luxon Chart.js adapter for easy interoperability between the two.
- Uses the Asynchronous Clipboard API for pasting and the window.print function for printing or export to PDF.
- Event Listeners: Inputs and buttons trigger updateGraph() or calculateTBW() to dynamically update the UI.
Although the original report of osmotic demyelination syndrome suggested that the cause was rapid correction of sodium (>12 mEq/L/day) more recent studies suggest that ODS can occur with slower rates of correction. In a cohort described by Seethapathy et al, CPM occured in 5 of 7 patients despite correcting sodiuma at a slower rate (<8 mEq/L/day). Even patients with relatively slow correction of hyponatremia can develop CPM/ODS. A larger multi-center observational study by MacMillan et al found that 7/12 patients who developed CPM did not have rapid correction. Thus, extremely cautious rates of sodium correction (e.g. <6 mEq/L/day) may be warranted in high risk patients. The NaPathway app allows users to choose a more cautious rate of correction for high risk patients. This is not a substitute for clinical judgement.
Frequently, patient present with hyponatremia in the setting of high endogenous ADH levels (for example with hypovolemia). Following volume resuscitation, the endogenous ADH levels drop and the sodium can rise rapidly, potentially causing dangerously rapid overocorrection. For this reason exogenous ADH can be administered in the form of ddAVP to blunt the rapid rise in sodium when endogenous ADH falls. This apporach is termed the ddAVP clamp. A good discussion of this approach can be found here. The NaPathway app allows you to add ddAVP on the plot to see when it is working.
In some circumstances (for example seizures), a rapid initial sodium correction is necessary. Typically the goal will be to rapidly increase sodium by 3-5 mEq/L, however the 24 hour correction goal remains unchanged. The current NaPathway app does not adjust the correction glideslope to account for this.
Perhaps most importantly, a data vizualization app isn't a substitute for clinical judgement. Context is important (what is the etiology of hyponatremia?) and there are many factors (ongoing free water intake, urinary losses, fluids in other medication infusion) that the app does not capture. The NaPathway app is intended to help experienced and trained clinicians combine the data together to make better informed decisions. It is not intended to tell clinicians what to do. Expert clinical judgement is still essential. Double check any calculation. Don't be stupid.
- 1.0 first working version - features sodium graph with variable rates of correction
- 1.1 added ability to print, save, & copy the graph
- 2.0 added basic therapies
- 3.0 implemented calculations of TBW and expected change in serum sodium
- 3.1 many bug fixes
[x] Add therapies (d5W, 3% NS, ddAVP, etc)
[x] Add more info about therapies on the graph, for example:
- ideally I could add a weight based calculator to estimate how much a given free water bolus would be expected to decrease the sodium
- when was ddAVP given --> show the expected half life of the drug
[ ] Make it possible to easily share the graph with someone else
- one approach would be to persist the data (e.g. on a server) and have a login or direct link
- alternatively could have a "share" button that included the data in the hyperlink itself?
[ ] Add a watermark to the graph
- always good to be be transparent about the source! also helps others find the app.
[ ] Ideally this would be integrated into the EHR so the user wouldn't have to do any data entry.
- this could pull lots of additional data --> therapeutics given, urine output, other labs, etc
- this is really where this app needs to go ultimately & why I've made it open source under an MIT license
NaPathway is released under an MIT License - free to reuse (including commercially) but please acknowledge where you got it! It's my sincere hope that people will steal this code and use it to deploy within thier own EHR.
- Sterns RH et al, Osmotic demyelination syndrome following correction of hyponatremia NEJM 1986 Jun 12;314(24):1535-42. - Original report of describing Osmotic Demyelination Syndrome
- MacMillan TE et al, Osmotic Demyelination Syndrome in Patients Hospitalized with Hyponatremia. NEJM Evidence 2023 Apr;2(4):EVIDoa2200215
- Seethapathy H et al, Severe Hyponatremia Correction, Mortality, and Central Pontine Myelinolysis. NEJM Evidence 2023 Oct;2(10):EVIDoa2300107
- Adrogué HJ, Madias NE. Hyponatremia. NEJM 2000 May 25;342(21):1581-9

