WebApps Update

Finished the rewrite of the rxkinetics.net web site this week.

DripCharts© and TPNassist© were both changed to use cookies instead of server memory.

Looking at the traffic statistics, it doesn’t look like anyone is using the TPN program. But I spent 3 days working on it anyway.

Highlights of the TPNassist© changes:

  • Improved the layout on all the pages.
  • Improved the electrolyte calculations.
  • Improved the TPN summary report.
  • Added user-friendly error pages.
  • Added email functionality to the enteral summary page.
  • Updated the nutritional assessment calculations per latest recommendations.
  • Wrapped all database calls in Try..Finally blocks to decrease errors.

Finally, and what I’m most proud of, I added Calcium Phosphate solubility curve generation to the electrolytes assessment.

Maybe someone will start using the app, but I’m not expecting it. Most aren’t willing to invest the time to learn how helpful this app can be.

Time for a beer.

Marathon Coding Session

There is a point where you have the whole program in your head at once, one with it, and you don’t want to let it go, so you keep working in a marathon burst of energy. Memexplex

Saturday was a cold, rainy, dreary day. Wifey was watching her Lifetime movies, I had nothing constructive to do. Having worked in Eclipse/Java/Android all week (and sick of it), I was looking for something different.

Changing how data is stored/shared in the WebApps had been on my ToDo list for months, but I kept putting it off because I knew it would be a mammoth undertaking. Also, I have hesitated to implement cookies because everything I’ve read says how limited (useless) cookies are for storing data. Nothing could be further from the truth. Fifty variables and one very large string array easily fit within the 4KB limits of a cookie. Chrome developer tools make the task of checking cookie size quick and easy.

It started slowly, but I soon had the whole site in my head, at once, and would not stop until I had finished. After a 10 hour marathon coding session, it was complete. The WebApps now store session data in cookies instead of server memory. This will dramatically reduce or eliminate the “Session timeout” issue with the site.

So, now you can park on a page, get a cup of coffee, eat a doughnut, do some yoga, watch some YouTube clips, check your Facebook page, and then finish up your pk consult.

Enjoy

PS. Of course, I missed one page, the CrCl page (which I never use), and was immediately called out for it. I never hear from anyone who uses the site, except when they complain. Never a “thank you”, or a “good job”. In other words, just like any regular pharmacy job 🙂

AbPK for Android updated

I spent the last few days delving back into the dark world of Eclipse/Android/Java. I don’t wish that on my worst enemy. The simplest things seem to take forever to accomplish.

This update includes the following improvements and fixes:

  • Added extrapolated peak and trough to Model view and Email consult functions.
  • Fixed tab order on patient data and serum level screens.
  • Modified CrCl Adj body weight method to use 30% of excess weight (was 20%).
  • Moved the Email function up to a button and the Clear function down to the menu.
  • Made dialog titles one line only (quick fix to the “Huge” font problem),
  • Updated the help files.

The Jellybean “Huge” font issue seems to be a common problem among developers. Because Android does not have an “Auto-size” function, there are many code hacks for re-sizing fonts to fit text on a single line. None of the methods are fool proof. So, instead of adding all that verbose java code, I just added the layout element android:lines=”1″ for the titles on each window. A K-I-S-S solution, my favorite kind. The text is truncated, but it is simply not important.

Fixing the tab order was also a trial and error affair. The serum level input would jump from dose to trough, skipping interval and number of doses. This was also a no-code layout fix with the use of the element android:nextFocusDown=”@+id/next_text”. Many blogs leave out the “+”, but this does not work without it.

Setting up the Nexus 7 for USB debugging was an adventure as Google has hidden the developer functions in Jellybean. The weirdest thing in the setup is to set your USB connection as Camera (PTP) instead of Media device (MTP) – WTF. Here is a nice step-by-step how-to blog post:
      Nexus 7 android development

I haven’t updated the free version for nearly three years. But I did this time around, thinking maybe some of you rich freeloading pharmacists will see fit to support your fellow pharmacist and hardworking small businessman. Haha, I live in a fantasy world.

Android Fragmentation

In iOS, there are just two screen sizes and three resolutions. In the Android world we have to accommodate what is essentially an unlimited number of screen sizes and resolutions.

Android fragmentation affects developers and app users alike. Every year or so fragmentation rears it ugly head in my little world. The trigger is usually a new version of Android and/or a popular new device with an usual screen size and/or resolution. This time around it’s Jellybean and the new Google Nexus line of devices.

The effect of fragmentation on small-time developers like myself is app bashing on the public review section of Google play:
app bashing

This fellow gives my app a 1 star rating with a snarky comment about wanting his twenty bucks back. Instead of simply contacting me, he pisses all over my work. And yes I take it personally, this is my life’s work.

Turns out the issue was caused by the user himself when he changed the device font size setting to “Huge”. I wish I had a crystal ball. Six months ago, when the app was last updated, such a setting was not possible. I had no idea that Google would add such a silly font size setting to their upcoming version of Android.

This is what I hate about the Google market, or Play store, or whatever they will call it next month. Anybody with a chip on their shoulder can post an anonymous comment bashing your app. And I have no way of contacting this person to help, because comments are anonymous.

Industry watchers say that Android fragmentation is probably going to get worse. Here is a nice graphic showing the current state of Android fragmentation:

Android fragmentation

Android fragmentation map

The BBVM project, part II

Everyone who doses vancomycin knows what a crap shoot it is. Of course, that is the reason why we measure levels, there is never any certainty what levels will result.

Ten years ago I had (what I thought at the time) was a great idea. You see, I have these fabulous dosing programs that save pk data. So, I will ask my fellow pharmacists to voluntarily submit their population analysis results in order to pool them together and create the “ultimate vancomycin model“.

      Build a Better Vancomycin Model project

What a bitter disappointment that turned out to be. In those ten years not one single person has bothered to lift a finger to help.

“I will”, said the little red hen. Only this time, instead of asking for help, I will gather data in stealth mode, via the web app.

The web app doesn’t collect patient identity. There is no passing of confidential information, only the following pk parameters:

  • Drug name
  • Age
  • Height
  • Weight
  • SrCr
  • CrCl
  • Kel
  • Vd

Maybe, in another ten years, there will be enough data to create the “ultimate vancomycin model“. Then the lazy dog, the sleepy cat, and the noisy yellow duck will be able to eat the bread.

Adventures in JavaScript Land

scourge 
/skərj/
Noun
A whip used as an instrument of punishment.

Of all the scourges inflicted on developers, the JavaScript/jQuery/CSS/HTML5 model has to be the worst.

What bothers me about this paradigm is the drain in productivity. So much time is wasted on the most basic task, page layout.

Coding HTML has always reminded me of hand-writing TurboPascal code back in the Eighties (which I actually enjoyed). But CSS/jQuery adds a mind-numbing and eye-straining verbosity that tests the patience of the most dogged developer.

Is there a limit to how many div tags a page can have? Does every element need an identical name and id tag? jQuery mobile grid layout actually makes me wistful for tables.

And, like so many other programming languages, books, tutorials and examples only take you about halfway there.

Too many ‘helpful’ CSS web sites consist of stupid pet tricks – how to code some silly visual effect, with little practical coding examples.

My problem is, I’ve yet to find a decent editor to improve productivity. Dreamweaver came close, but its’ Mac-like quirks keep putting me off.

Every time I work in JavaScript, this song plays in my head.

Whipping Post

Hour after hour of ass-numbing coding this week produced but this one web page, which has very limited functionality:

abpk_web

Recent updates

Since the RSS to Facebook feed appears to be hopelessly broken, here is a recap of recent software updates:

APK© for Windows v 3.5.14

  • Added setup dialog.
  • Added obesity weight adjustment factor for CrCl.
  • Added check for update on startup.
  • Added check for presence of classic WinHelp.
  • Improved update checker.
  • Updated help file.

Antibiotic Kinetics© for Windows Desktop v 2.3.18

  • Added automatic update availability check.
  • Added BMI to consult form.
  • Fixed yes/no dialog default button.
  • Changed AdjBW for CrCl to 20%.

Kinetics© for Windows v 2.3.7

  • Added automatic check for update on startup
  • Changed CrCl adjusted BW to key off of BMI
  • Fixed model editor issue: “CL” and “Kel” selectors sometimes don’t change.
  • Added technical support dialog.
  • Added check if winhelp32.exe present.
  • Added MRU list save/load after main form closes-opens.
  • Changed BSA to BMI on consult and monitor forms.

DripCharts© for Windows v 2.1.10

  • Added check for classic winhelp.
  • Added WinHelpViewer unit.

RxInterventions© for Windows v 1.7

  • Added splash screen. 
  • Added support for multiple entries per patient.
  • Added check for proper MD name format.
  • Updated JvDialog (fixed default button selection).

Puzzling RSS graffiti problem

I don’t understand why the last two “What’s New” rss feeds for APK are not showing up on FB. Google reads them just fine, and news items before and between these two came through fine. I ran my xml through the W3C feed validation service and it flagged a couple of minor errors, but nothing to explain this.


APK for Windows 3.5.14 http://www.rxkinetics.com/autoupdate.html
Added check for presence of classic WinHelp.
Added check for update on startup.
Added setup dialog.
Added obesity weight adjustment factor for CrCl.
Improved update checker.
Updated help file.
Sat, 12 Jan 2013 08:00:00 GMT


APK for Windows 3.5.13 http://www.rxkinetics.com/autoupdate.html
Improved population analysis report.
Fixed comments not printing on consult.
Tue, 25 Dec 2012 08:00:00 GMT

Anyway, a new version of APK for windows was posted January 12, 2013.

KinPlot

A single page web application:

KinPlot web app

This is a rewrite of a PC app which I wrote for Windows many years ago.

KinPlot for Windows

The purpose of this app is to visualize basic pk concepts of 1-compartment models. To use: enter the model parameters and dosage regimen. Click the graph button to display a serum level plot. You may compare multiple dosing regimens on one graph.

The web version of KinPlot runs in any modern browser that supports HTML5 (Chrome, Firefox, IE 10, Safari). To access the app, point your browser here:
rxkinetics.com/kinplot

KinPlot was written using HTML5, CSS3, and JavaScript/jQuery. There are several tools that purport to combine all these elements into one IDE. I tried Apana studio, Blue Griffon, DreamWeaver, Kompozer, JetBrains Webstorm, and NetBeans. But each was lacking in one way or another.

Eventually I ended up using the best tool to write each portion of the app: Notepad++ for the HTML, TopStyle for the CSS, and Sublime editor for the JavaScript. Coding each portion separately may have helped. Since each of these languages are so different, I was able to concentrate on one task at a time. It took two days to write… not bad.

I plan to submit it to the Chrome marketplace.

Web apps are the wave of the future and single page web apps are the current rage. Downloading and installing a program on your PC/Phone/Device is so ten years ago.

When learning something new, it’s best to start with something simple. It feels good to learn a new programming paradigm and create a working app. I hope to eventually convert more of my tools over to web apps.

Time for a beer.

Addendum
I just stumbled upon Google Chrome Frame after seeing “IE with GCF” in the web site analytics. GCF is a plugin for Internet Explorer 6, 7, 8, and 9 that supports all the HTML5 features that are found in modern browsers. Now if the KinPlot web app is accessed from IE, the web site will prompt for installation of Google Chrome Frame.

iPhone app, so what

RxKinetics now has an iPhone app on the iTunes store.

So what, this is nothing new. The RxKinetics WebApp has been available for years.

This is only news because most iPhone people never explore outside their exclusive private app store. If an iApp doesn’t come from iTunes, then it apparently doesn’t exist. Why? Part of the reason may be that sense of belonging to a privileged and exclusive club which is an essential ingredient of the Apple mystique. Belonging is as much a human need as is shelter or love, and Apple’s marketing has masterfully manipulated that basic human need which exists within us all.

“Apple’s gizmos aren’t just cleverly designed computers: as the lines last week indicated, they are socioeconomic and cultural signifiers. Even when it turns out that some of these very same products are produced in sweatshop conditions redolent of nineteenth-century Manchester, many smart, affluent, and educated people want to be seen sporting them. Sorry, that is an understatement. They absolutely have to have them.” How Long will the Cult of Apple Endure? The New Yorker

Here’s the link… so what:
AbPK available on iTunes