Archive for February, 2010

Android week 8 update

Saturday, February 27th, 2010

Today I played around with the layout so the buttons are more uniform. I am using TableLayout for each dialog, seems to be the easiest. I finally realized that column sizes are set in the widest row. So it doesn’t matter what column widths are set in subsequent rows, android will maintain the settings it found in the widest row. After that realization, I was able to trim a lot of excess code out of the layout xml.

Finished up the week by adding all the checking logic for the serum level entry screen. Next is the easy part, writing the code for serum level analysis. Of course I’m being facetious.

Android week 8

Thursday, February 25th, 2010

This Android GUI stuff is just wearing me out. Today I spent 7 hours just creating the screen for serum level entry.

Three of those hours were wasted trying to figure out how to show and hide elements on the screen.

It seems simple now, after I finally figured it out, but there is absolutely nothing in the Android docs to explain how to do such a simple thing:

In java:
txtDose.setVisibility(View.INVISIBLE);
txtDose.setVisibility(View.VISIBLE);

In XML:
android:visibility=”invisible”
android:visibility=”visible”

dot this then dot that, then dot some more. google you can dot my shiny metal android ass. I haven’t even begun to code any of the checking code or calculations, I’m spent.

apk_droid_serumlevels

PK_calc

Wednesday, February 24th, 2010

A internet friend asked me to help with an unusual kinetics question: is it possible to predict a serum level for citalopram? This isn’t exactly something I see everyday so I agreed to the challenge. Of course, the first thing I did was an internet search. How did I get into that habit? Google is not the answer to everything, in fact it often muddies the picture with irrelevant or misleading information. Eventually I remembered the Pharmacokinetic data table in the Appendix of Goodman and Gilman. The table had everything I needed to create a drug model: absorption rate, peak level, volume of distribution, clearance and half-life.

So, I did the calculations by hand, but then realized that it would be nice to have a tool that could more easily utilize the wealth of pk data in Goodman and Gilman. Being a geek, I threw myself into writing a program. It came together in about half a day using my favorite programming tool, Delphi. And I tried something different with the help, used a TWebbrowser control on a winform and compiled the HTML into a resource file, it turned out okay.

For lack of something better, call it PK_calc. I’m releasing it as freeware. Click on the pic to download, enjoy.


Javatar

Sunday, February 21st, 2010

Click the link to view the Foxtrot cartoon from Sunday’s paper. I loved the movie Avatar, I program in Java, and I’m growing a ponytail, so it really hit home. Enjoy:

Foxtrot by Bill Amend, 02/21/2010

Posted using ShareThis

Android week 7

Friday, February 12th, 2010

I haven’t had much time lately to devote to the Android project. But I was finally able to put aside three days this week. This is the most time-consuming programming project I’ve ever undertaken. Everything is hand-coded. It took two full days to hand code the layout, adding each widget with code, sizing and resizing and rearranging them to look good on the screen. Then in the java code, you have to declare each widget, then assign them to the variable, then hand code each handler. Then finally, add the code for the various calculations. That, it turns out, is the easy part. Before I started this project, I thought java was some strange exotic language. Far from it, it is very easy to understand and code java. It is the GUI stuff that is taking forever.

Anyway, this week I added the PK/PD screen and the “Other CrCl” methods screen. Also added listeners to the text boxes on the patient entry screen, so the CrCl will change in real time. Then fixed the preferences screen so that it would jive with the “Other CrCl” methods screen. Added a loading dose calculation and entry on the Dose select screen. And finally, added graphing of the loading dose.

The prospective dosing methods are nearly complete. I need to do a couple of things on the main screen, e.g., popup nondisplayed calculated data when the “Calc” button is clicked. The lay out of the levels entry screen and the model editor will be incredibly time consuming. I don’t look forward to all that work. If the price of this program was based on the work involved, I should charge at least $200 each.

Here is the PK/PD screen:
android_PKPD

And the Other CrCl methods screen:
android_otherCrCl