Detecting Conencted Devices in iOS

RibbitWe’ve been working with a client on a nifty little application that compliments their desktop workhorse. There are a couple cool things about this application. One it makes use of RESTful services to connect with their legacy system to collect and manipulate data, but that isn’t the coolest aspect of the project. The coolest part is how we collect user input.

Barcodes

Our client makes heavy use of barcodes in their application. To that end they decided to make use of KoamTac 300i and LineaPro Bluetooth barcode scanners. These two scanners include SDK’s so you can get tighter integration with the hardware. It makes total sense to get tighter integration because we don’t have any UITextView’s to collect input from a standard HID device. If you’re using a bluetooth barcode scanner and have a UITextView to collect input it’s fairly easy to use any scanner. It works just like a keyboard, but what about apps like this that don’t have a place to collect data? That’s where the SDK’s come in handy.

Detecting External Hardware

Since we have to integrate with multiple scanners we have to decide at runtime which scanner is being used. Using the SDK’s we could take a stab in the dark at initializing each one in turn and the one that succeeds to initialize is the winner. Not such a great way determine the one to use, but it would work.

What if there was a way to determine you had connected external devices without using a third party SDK? There is.

Using the External Accessory Framework you can do just that.

Here’s a little snippet of code you can use to get back a list of external devices connected to your iOS device. That’s all there is to it. The output produced from that small bit of code appears below.

Make sure you #import <ExternalAccessory/ExternalAccessory.h>

[code lang=”objc”]
– (void)_getAttachedDevices;
{
EAAccessoryManager* accessoryManager = [
EAAccessoryManager sharedAccessoryManager];
if (accessoryManager)
{
NSArray* connectedAccessories =
[accessoryManager connectedAccessories];
NSLog(@"ConnectedAccessories = %@", connectedAccessories);
}
}
[/code]

All this little piece of code does is get the shared Accessory Manager, EAAccessoryManager (man, I hate that name), and asks for connected accessories. Simple! The NSLog() call simply dumps out an instance of EAAccessory which describes the connected accessory. In this case we’re connected to a LINEA Pro scanner.

ConnectedAccessories = (
"<EAAccessory: 0x1f7810>
{\n connected:YES\n
connectionID:0xd0ff600\n
name: LINEA Pro\n
manufacturer: DATECS\n
modelNumber: XBAMBL\n
serialNumber: MSC140045UN11\n
firmwareRevision: 2.45.0\n
hardwareRevision: 1.0.0\n
protocols: (\n \"com.datecs.linea.pro.msr\",\n \"com.datecs.linea.pro.bar\"\n)\n
delegate: (null)\n}"
)

Need an iOS Developer to help turn your vision into reality? Get in touch, we’re here to help.

The Cost of Apps Development

I’ve been an iOS developer for the better part of four years now. Most of that time has been spent doing my own thing, but I’ve done work for others along the way. At one point a few years back I was bidding on some jobs for a games company. I sat down, looked at the document they’d given me, and wrote up a proposal.

A wonderful boquet of flowers.A couple days later I received an email back saying they thought my pricing was too high. Too high? Really? Basically they wanted to pay me about 1/3 what it would cost to develop the application. When you’re excited about doing work for someone and they come back at you with something like that, what do you do? You let the work walk out the door, that’s what you do.

It seems I’m not alone when it comes to people undervaluing the work of iOS developers. There is a really well know Mac and iOS developer, Craig Hockenberry, who chronicled on the true cost of creating the Twitter client, Twitterrific.

“With such a short schedule, we worked some pretty long hours. Let’s be conservative and say it’s 10 hours per day for 6 days a week. That 60 hours for 9 weeks gives us 540 hours. With two developers, that’s pretty close to 1,100 hours. Our rate for clients is $150 per hour giving $165,000 just for new code. Remember also that we were reusing a bunch existing code: I’m going to lowball the value of that code at $35,000 giving a total development cost of $200,000.” – Craig Hockenberry, 10.13.2010

I’m not sure if people think it should cost less because these applications run on a small device, or because the app store has turned into a $0.99 thrift store, but the truth is we’re professional developers. This is what we do for a living. You should expect high quality work with all the spit and polish you’ve come to expect in applications you make your living using. I’m not saying we deserve it, I’m saying we strive to earn it. If we don’t deliver what you expect, with the quality you expect, you won’t be back. That makes me work very hard to deliver something you’ll be very pleased with and proud of.

Recently another developer, Kent Nguyen, shared his thoughts on the subject and does a great job pointing out how complex applications can become. It adds up rather quickly.

“The process is not a simple one and I usually guide/educate the client through all the considerations using the following steps” – Kent Nguyen, 01.31.2012

This is a great source of information for anyone trying to decide if they need an iOS application. Know what you’re getting into, before you get into it.

Another Bad Review

We’re a bit bummed at the moment, we must admit. We haven’t checked the App Store for RxCalc reviews in quit a while, so we decided today would be the day. It was not encouraging.

In part the reviewer “found it less than useless.” Ouch. That statement really cuts to our heart. We want RxCalc to be your “go to” Pharmacokinetics calculator, we really do. We believe it to be accurate.

What do you do when you get a review like this? In our case, nothing. The reviewer didn’t contact us. We can’t fix what he, or she, sees as a problem because we don’t know what that problem is.

So, TXRph, if you see this, please contact us at support@applecorelabs.com, and tell us what’s wrong. If you can, please provide us with your calculations and what you expect them to be. We really want to get this stuff right. We have a PharmD on staff that verifies the calculations by exercising our algorithms, of which there are many different methods. Could it be your teaching lead you to expect a different set of numbers? Maybe, maybe not. If you see this, please, let us know how we can fix it.

There are thousands of users of RxCalc out there. We rarely get ratings from our users. It seems that we only hear from users that have a bad experience.

Take that how you will. We’d love to hear from you, good or bad.

Pretty please, with sugar on top.

We have a favor to ask. If you use RxCalc and have left a review in the App Store, please, get in touch with us. We’d love to have a conversation with you.

We have a bunch of great ideas for RxCalc but we’d like to put those on hold until we can resolve what folks see as under dosing. We’re pretty sure it has to do with the algorithm, or method of calculating kinetics, we chose to use, but until we hear from some of you we can’t be sure.

A wonderful boquet of flowers.So, please, drop us a line at one of our support e-mail addresses, or you can contact me directly at rob@applecorelabs.com.

Thank you.

The App Store Disconnect

My frustration with the disconnect between us and our customers on the App Store continues to grow. For RxCalc we typically see ratings that have to do more with lack of features, or new features, than the features we actually have. Don’t get me wrong, that’s great! The problem is we have NO way of communicating with these users to find out what they really want. We can make an educated guess and hope we’re correct, but that’s the best we can do.

Take a look at one of our latest ratings. It’s not horrible, three stars, but this person would like something added to the app. Based on this comment we have little to no idea what they’re really after.

“I found that when using 2 levels to calculate phamacokinetics that the VD is way off from any equations I have seen. Also it does not extrapolate a Cmin and Cmax. This program is useful for calculating first doses. I hope this can be fixed in the next update since this is the only kinetic program I could find for the apple”

In this case the user is probably used to using a different equation, or method, to determine dosing. As we’ve explained here before we use Creighton vancomycin calculations, but there are many others. Different method, different results.

If Apple would allow us to make contact with our reviewers we could actually bring some of these requests to life! As it sits today, we can only hope they’ll make contact via our support page, or we can make our best guess at their request.

That’s not so good.

Hello 1.2!

It’s been a few months in the making but RxCalc 1.2 is now available in the App Store.

What’s new? Glad you asked. There are two new features to talk about.

  1. Support for dosing adjustment using single level vancomycin kinetics.
    • The calculations are performed using both patient specific information supplied by the user as well as patient population parameters.
  2. Literature supported High Dose Extended Interval (HDEI) (aka “once daily” or “pulse”) aminoglycoside dosing.
    • Calculations for gentamicin and tobramycin are based on 7mg/kg adjusted body weight.
    • Calculations for amikacin are based on 15mg/kg adjusted body weight.

This release was also unique because we finally opened the door to a Beta Tester. Our heartfelt thanks goes out to Robert B. Martin, Pharm.D. Robert provided a critical eye for Jerry’s Pharmacokinetic Calculations and his years of clinical experience were priceless. He’s given us a lot of great feedback we’ll be sure to include in future releases. That’s right, we like to hear from our users!

We hope you enjoy using 1.2 as much as we enjoyed developing it.

Yes, and No

Something we need to do here at Apple Core Labs is create a FAQ for RxCalc. I’ve been saying that for quite a while now but I just haven’t gotten around to it. It’s one of those things that falls to the bottom of the list, but it really is time I did it.

Why?

A bouquet of flowers.We need to get this hammered out so we avoid bad reviews to be quite honest. Our calculations are accurate but we continue to receive reviews that say otherwise. There is no one true method for deriving Pharmacokinetics calculations. There are many methods. To say RxCalc under doses is true, and false, all at the same time. If you’re a new Pharmacist, or married to a particular method, you may be extremely disappointed with the numbers RxCalc produces.

By creating a FAQ the hope is we’ll help remove that disappointment. RxCalc currently uses the following Creighton formulas for vancomycin calculations:

  1. Cockcroft and Gault equation using IBW for creatinine clearance (use ABW if less than IBW)
  2. Elimination rate constant: ke = (0.00083 * CrCl) + 0.0044
  3. RxCalc considers the total dose of vancomcyin per dosing interval determined by equation; in this case [(ln Cp-ln Ctr)/ke] for the interval and [Cp*Vd*(1-e-^(ke*tau))] for the dose.
  4. Vd is defaulted to 0.7 liters/kg, but can be changed to the users taste between 0.5-1 liter/kg

Vancomycin dosing is so variable, and there are so many methods, that it was difficult to chose just one. Methods for vancomycin kinetics include Bauer, Burton, Matzke, Moellering and Winter just to name a few. At the time RxCalc was designed the Apple Core Labs team felt most comfortable with the formulas dervied by Creighton. This choice was neither right nor wrong as vancomycin kinetics are as much an art form as they are a science. You will find many different methods used throughout the various schools of pharmacy and medical centers in the United States.

With that said, Apple Core Labs chose to offer an adjustable volume of distribution for RxCalc, in effect giving the end user an amount of flexibility in their calculations. The option to set your default volume of distribution from 0.5 liters/kg to 1.0 liters/kg can make a significant difference in the final outcome of your vancomycin calculations. RxCalc relies not only on numbers to perform calculations, but the end user’s clinical acumen and experience as well.

Apple Core Labs will continue to improve RxCalc by adding features and improving functionality. We appreciate any and all feedback, no matter how good or bad. One thing we would like to request from our end users is detailed information included with their comments. If we know what method the user is comparing the results generated by RxCalc to, we can better understand what the problem might be and how best to help.

On the flip side

I give that a thumbs up!

Yesterday I shared a frustration, today, I’ll share one of those happy moments. We were bumming over the bad review, and have been for a few days, when what appears in one of our mailboxes? That’s right, some positive feedback, and a feature request! Woo-hoo!

Thank you for offering such a usable app. I hope you will continue developing others as clinically useful as RxCalc.

Thanks for that! It’s nice to hear something positive after getting a bad review.

Oh, what did he ask for? Glad you asked.

I seldom order peak levels anymore except in certain cases. As you know, most of the time we can do a very good job dosing and monitoring vanco patients with trough levels only. Because RxCalc requires both peak and trough levels in order to use the “Adjust with Levels” portion of the app, I am rarely able to use this feature. Is there any way to allow the peak level input to be optional?

Ahh, just you wait.