Friday, November 18, 2011

Collaborative Cursing SQL Style

Earlier this week at work, I had some discretionary time. I'm not quite sure what inspired me but I decided I wanted to brush up on my SQL scripting skills.  I'm not by any means a SQL scripting pro but I know how to find the data that I'm looking for. In my line of work, I'm generally just looking to verify that the data being written to the database is correct. Generally a simple query will do the trick but occasionally more complex scripts, like a cursor or a loop, make it easier. Unfortunately, I couldn't remember how to write a cursor. Oops. In fact, I couldn't even remember what they were called. Oops again. But that's why I wanted to practice so that when I actually need to write one, it'll be easy. I finally figured it out with the help of Google but I still ran into a couple of bumps in the road. The end result does work but I welcome tips for improvement.

Here's my cursor:

DECLARE @total int,
  @city varchar(64),
  @state varchar(16),
  @table char(64)

 SELECT DISTINCT City, State FROM MyAddressTable


CREATE TABLE #City_Count_Temp
 City VARCHAR(64),
 State VARCHAR(16),
 Total INT

OPEN city_cursor
FETCH NEXT FROM city_cursor INTO @city, @state

 SELECT @total = (SELECT COUNT(City) FROM MyAddressTable WHERE City = @city and State = @state)
 --SELECT @city AS City, @state AS State, @Total AS Total
INSERT INTO #City_Count_Temp VALUES (@city, @state, @total)
 FETCH NEXT FROM city_cursor INTO @city, @state
CLOSE city_cursor
DEALLOCATE city_cursor


SELECT * FROM #City_Count_Temp

DROP TABLE #City_Count_Temp
It's actually a pretty simple script. The purpose of the script is to count the occurrences of each city in the table and then output it into a nice pretty list. It accomplishes this by first querying the table for the unique list of City/State combinations. Then using this list it again curses through the table counts the number of occurrences of each and dumps the information to a temporary table. Finally, there's  a simple query of the temporary table that produces the final list.

So the bumps in the road that I couldn't quite figure out... First, the only way I could get the script to make a pretty list was write the data to a temporary table. You might have noticed a commented out line in the middle. Originally, this was how the script provided the output without writing to the temp table. The problem was that SQL Management Studio displayed a separate result for each curse of the script. If there's another way to do this, I'd love to know!

Also, I tried to set the table name (MyAddressTable) as a variable but for some reason, it would error every time saying that I needed to declare the variable (even though I had declared the variable).

So that's my little cursor. I'm happy to answer any questions about it. I'm also happy to receive any suggestions about how to improve it

Saturday, May 7, 2011

Rules for Driving in Chicago

  1. Watch out for the taxis - they are the absolute worst drivers there are
  2. Watch out for the out-of-towners - possibly even worse than the taxi drivers, you know the taxi is going to cut you off but out-of-towners are just plain unpredictable
  3. Watch out for the buses - they'll cut you off too so just stay out of the buss lane
  4. Watch out for the bikers - they're incompetent when it comes to obeying the rules of the road
  5. Know where you're going and how to get there
  6. NO LOLLY-GAGING! Keep up with the traffic in front of you, if you're going to make a turn then TURN. To sum it up in one word: Commit
  7. If you're not in the correct lane to make your turn, don't stop at the intersection and expect someone in the turn lane to let you in while you hold up everyone behind you - go around the block
  8. Watch out for pedestrians
  9. Watch out for bikers II - there are a lot of them, often they have their own lane so give them their space (don't cut them off when making a turn and look before you open your door when parking on the street)
  10. Watch out for potholes - they're deep, jagged, and everywhere
  11. Watch out for people double parked
  12. When turning, get all the way over in the turn lane or to the edge of the street
What have I missed? Feel free to add more rules in the comments.

Monday, April 4, 2011

Concerned About API Healthcare's Acquisition? What You Can Do

I know I'm not the only one that hopes Kronos' acquisition of API Healthcare falls through. I also know that most people don't feel comfortable talking about it for fear of their jobs. THERE IS SOMETHING YOU CAN DO. Contact the Federal Trade Commission.

The FTC, in conjunction with the Department of Justice, is the government agency that approves mergers and acquisitions and makes sure that antitrust laws aren't broken. If you think this is a bad idea, contact the FTC.

Here are your options:
By email:
This method isn't considered confidential, so if that's a concern...

By mail:
Federal trade Commission
Bureau of Competition-H374,
Washington, D.C. 20580
If you mark the mail "Confidential" it will be treated as such.

By phone:

As I understand it, the FTC has issued a second request for information. They don't always do this so hopefully it means they see a potential problem. It also means time is fleeting so ACT NOW.

For more information, visit or view this PDF from their website that gives a nice overview.

Sunday, April 3, 2011

API Heathcare's Acquisition by Kronos Remains Unpopular

My feelings about the pending sale of API Healthcare to Kronos is no secret. I think this is a horrible idea. As it turns out, I'm not the only one that thinks this. I have it on good authority that in addition to me, but the API employees AND customers are not in favor either!

Two and a half years ago when Francisco Partners bought API, there was a lot of uncertainty. The employees knew things were going to get shaken up. There was a shake up and really, I would say that the operation of the entire company  changed. The balance between making money, providing a quality product, and treating employees fairly shifted dramatically. I hate to say it but employees were on the losing end of that switch. Nonetheless, the core focus of the company remained steadfast and probably even got more precise. Because of that focus, the vast majority of employees remained loyal to the company. There were only a handful of employees that left or were let go.

Fast forward to 2011. Employee retention has become a big problem. I don't have exact number of departures but I'll let you draw your own conclusions but it's pretty obvious that there's a problem when the company has to resort to bribery. If you were a customer right now, how would you feel knowing employees are jumping ship?

Rumor has it that the clients aren't any more excited about this either. Why would they be? There are two major competitors in the market. They chose API over Kronos for a reason and now they're potentially being forced into using a product they don't want or with a company they don't want to work with.

If ever there was a time for the regulators to step in and say, "NO!!!" this is it. Competition is good for the market and for consumers. There is nothing good that could come of this acquisition. All Kronos wants is to eliminate their biggest competitor because that will translate to more money for them AND they won't have to work as hard to try to maintain some sort of edge in the market.

Monday, March 7, 2011

Shrinking Screens

About four months ago, I started thinking seriously about upgrading my laptop. Basically, all I use it for is surfing the internet and email but even that seems to take longer and longer than it should. For a while I contemplated going the table route but I really want a physical keyboard and I find the laptop configuration is easier to use when laying on the couch or in bed.

I won't indulge you with my list of "must haves" just yet but one thing I want is a high resolution screen. As I was looking around, I discovered two interesting trends. Most laptops now have a 16:9 aspect ratio. This makes sense since TV's are all 16:9 now however, it seems that the common aspect recently was 8:5. Personally, I like the 8:5 ratio.

The second observation I had is that screen resolution leaves much to be desired. Just about every model from every manufacturer I looked at only had displays at 1366x768 for sizes up to 15". That's not good enough for me. The manufactures like to "fancy it up" by calling it "720 HD" which is true but clearly a marketing ploy. I realize that full HD (1980x1080) will come at a premium and only be available on a small range of models. However, to not even be able to upgrade to something somewhere in between (around 1600x900) while not breaking the bank is disappointing. Even if I wanted a behemoth 17" laptop, the standard res is 1600x900 and it's next to impossible to find an upgrade. Is this just not important to enough people to warrant offering more upgrade options?

What I find particularly odd about this is that there is more and more buzz about the resolution of smart phones and tablets. My Evo is 800x480 for crying out loud and it's only 4.3"! Meanwhile complaints abound that the iPad 2 is still at 1024x768.

Are my expectations just too high? Should I just become a mac instead?

Saturday, February 26, 2011

API Healthcare Looks to the Future with Synergy

Yesterday I wondered aloud about API Healthcare's vision for the future and whether they even have one. I'm happy to learn that they do. Historically, HIMSS has been API's marketing focus for the ear. As such, they usually have some big announcement for the convention to stir up some buzz for the company. From what I've heard, they didn't have any new announcements but they did focus on their new platform, Synergy.

API made it's official announcement about Synergy on February 1 so they let the cat out of the bag before the convention. But I'd concede that the announcement was recent enough for it to be still fresh and largely unknown at HIMSS. Synergy is a big deal though and it's an exciting advancement for the company because it takes their vast array of products and unifies them on a single platform. This project has been in the works for years and it lays the foundation for the future but I don't know how it fits in with Kronos.

Previously, all of API's products were independently developed and engineered using a variety of technologies. The single platform brings them together in one seamless integration. It makes the whole system more efficient, easier to troubleshoot, and easier to expand. Think of it this way, if you put a slice of lassagna, a scoop of German potato salad, and some pickled herring on a plate, you'd have a well rounded meal. They might even all be things that you like but they don't really go together even though they get the job done. On the other hand if you put a cheeseburger, fries, and fresh corn on the cob all on the same plate, you have a meal where each component enhances the others. The flavors don't compete with each other. It's a weak analogy but I think you get the picture.

So, API has finally perfected their menu (hopefully just as Ryan Braun's Graffito). They are definitely ready to charge ahead. But then there's this acquisition business. It sounds to me like all this work is not going to reap the rewards that it could or should because obviously Kronos' software doesn't run on API's platform.

I really hope API gets to continue to operate largely independent of Kronos. This company has been working so hard and they have real vision for the future. And since I say that, I need to give credit where credit is due and that's with the CEO, J.P. Fingado. It would be a real shame otherwise.

P.S. I just had this unrelated thought: I wonder if Luis would have bought the company back rather than let it go to the enemy if he had had the chance?

Friday, February 25, 2011

Good News Remains Elusive for API Healthcare

Kronos detailed some more of its plans regarding its acquisition of API Healthcare at the 2011 HIMSS conference. For those of you that don't know, HIMSS is probably the largest healthcare information technology organizations in the world. They have a conference each February and it is enormous. In fact, only a handful of cities can host it because it's so big.

If there's any good news, it's that API's current solutions will continue to be supported. Of course, there's no word about continuing to develop them or actively market them to new customers.

They're pretty clear that they plan to combine the best from each product line. To me this sounds like ransack and pillage.

I think what is most telling though is their overt excitement about obtaining the patient classification system (PCS). What that system does is it calculates staffing levels based on patient needs. So if you have a lot of critically sick patients, it will show you that you need more staff to come in and which staff members will best fill the need, and how you can do it for the lowest cost. This, too, is an area that is being increasingly regulated. To my knowledge, API's PCS is a revolutionary technology in the industry and Kronos had nothing to match it. Because of the regulation in states like California, Kronos couldn't put up much competition.

Since jobs are a hot topic, let's talk about that. Sales and training staff are no longer needed. Engineering staff can be cut down to a skeleton crew for support issues. Configuration analysts can be reduced soon since there won't be new implementations. Tech writers are no longer needed. HR? Goodbye. Management? Goodbye. About the only group things look okay for are the support personnel.

Again, I hope to be proven wrong. PLEASE, prove me wrong! But what good comes from eliminating the biggest competitor in the market with an exclusive cutting edge technology?

P.S. Historically, API has always had some big announcement to make at HIMSS. I haven't been able to find anything about one this year. This is yet another sign of what's to come. No news is bad news because it says that the company is does not have anything exciting to announce about its future.

Thursday, February 24, 2011

Ode to Software Testing

I also blog occasionally on my company blog. I wrote a song about software testing last week. You can check it out here and search for past articles I've posted there.

P.S. My company is hiring - click here to see the latest.

Kronos' Acquisition of API Healthcare Is Only Good for Kronos

It was announced on February 7 that Kronos would acquire API Healthcare. This is not good news for anyone but Kronos. It is not good for API employees. It is not good for API customers. I suppose it may be good for Kronos customers in the short term but that remains to be seen.

Who Am I
Who am I to talk you ask? A former API Healthcare employee. I worked there for three years-two years under the original ownership and one year under Francisco Parterns' ownership. I liked working there. I had great coworkers. The management was professional. The company had drive. It was a trifecta for happy employees. The only reason I left was because after meeting my life partner, we decided to start a new life together in Chicago. Unfortunately, Francisco Partners has sold everyone out, in my opinion.

Why This Is Bad
So what's so bad about this? API Healthcare has had a laser focus on the healthcare industry. Everything they make is custom engineered for medical professionals. This means there are no half-ass solutions that try to maximize profits by stretching a single product across multiple industries. Don't get me wrong, the proverbial death of two birds with one stone is a good thing. Healthcare is such a unique industry though. The pay rules for nurses and other support staff  can be so convoluted. Government regulation is extensive and it varies wildly from state to state. This is a 24/7/365. To be a leader in this field, you need a laser focus.

Kronos has been trying to acquire API for as long as I know and certainly longer. API has been Kronos' biggest competitor. Kronos has solutions for a multitude of industries. And of course, their healthcare division simply doesn't have the precision of API. Because of Kronos' size though, they have a respectable market share despite their inferior product.

I would bet money that API employees are going to lose their jobs. Once Kronos gets their hands on the software, they're going to rip it apart, reverse engineer it, and shove it into their own product. They'll only keep API employees around to execute the carnage.

I would also bet money that API customers aren't going to be happy with the results. Kronos still will not have the laser focus. The product is going to get dumbed down and exploited and it's not going to work as well or have the same drive for improvement. Additionally, nothing good ever comes when competition goes away. Sure, there are a handful of other companies in the market but they're peons compared to what's to come. But it's not like Kronos is adding new solution to their portfolio, they're just eliminating the chief competition. Competition has forced both API and Kronos to keep raising the bar. There's no need to do that anymore. Hospitals will be backed into a corner and forced into using a shoddy product because there will be no other choices.

Please Prove Me Wrong
I hope to be proven wrong but I just don't see any silver lining to this. There's one last thought that I want to express. When Francisco Partners bought API from Luis Garcia, they were quite vocal about how they bought companies as long-term investments. They've only had API for two years, which is not very long. I wonder how long Kronos and Francisco have been in negotiations...