Life as Clay

Archive for the ‘Public Health’ Category

New Population Pyramid Generator

leave a comment »

I created a new OS X population pyramid generator application, called Pyramids. Click here to see it in the Mac App Store. It’s $0.99. If you have a Mac and need to make population pyramids with any regularity, or even just a single one, then give it a shot!

Pyramids

Performance of a free niche app in the Mac App Store

with 2 comments

I released the free Population Pyramid Generator in the Mac App Store at the end of last week. The tool is very simple. I tried to make sure that it was stable and that it does what it claims to do without trouble. I think that I succeeded on those fronts. There certainly is room for improvement, however, and I have plans to add several features in a forthcoming revision.

My expectations upon release of the application were that maybe 50-60 people would download it. Let’s be honest: it’s a niche tool, and while useful for people who need a population pyramid, it’s pretty useless to anybody else. Part of my motivation to create it was that my business website receives a lot of hits related to population pyramids because I wrote a blog post there about them. I thought that it would be nice to provide the tool and that it potentially could help me find additional clients.

What I didn’t expect is that aggregation sites like macupdate.com would pick up the app. It turns out that a lot of people are exposed to it through those sites. It’s appearance in Google rankings received a quick boost and traffic to my company’s website skyrocketed shortly after the app became available.

In the first 5 days, the Population Pyramid Generator was downloaded nearly 450 times — ten times my expectation. It went live around 4pm EST on 02/24.

Equally surprising was the breakdown by country. This view shows only the first 4 days (due to the week cutoff in the itunesconnect interface):

Considering that I did basically zero marketing of this app, what’s the lesson here? I think that simple free tools, especially ones that fill an unmet niche, can be relatively effective marketing tools for a business. All told, it took me ~ 1.5 weeks to build the Population Pyramid Generator. As people with need for such a tool find and download it, perhaps I’ll gain an additional client or two. That would be worth the time investment alone. In fact, the increase in Google rankings following the release of the app probably make it worth the time investment.

The Population Pyramid Generator is a fun experiment for me and I look forward to adding additional features to it, as time allows. I also plan to create a similar tool for Windows (and use it as a project to teach myself .NET and C#).

Written by Clay

March 1, 2011 at 08:40

DC as seen through population pyramids

with one comment

All of the recent work on parsing US Census data was part of a larger project — one that includes the dynamic generation of population pyramids for the entire population and for selected racial groups within each county in the United States. Residents of DC (like myself) frequently hear about how it is a terrible place for young women to meet boyfriends and date successfully. All data here are from the 2009 US Census Bureau population estimates.

Here’s what the population pyramids show:

For the final one, keep in mind that “Hispanic” is considered an ethnicity by the US Census Bureau and that most Hispanics also select a race on census forms and most people who select a race also indicate whether they also consider themselves Hispanic.

What really is striking here is the difference between the shapes of the white and black population pyramids. Perhaps a lot of young white people move to DC for congressional jobs and then move away when the job is finished. DC traditionally has a larger permanent black population and that is reflected in the more even distribution of the pyramid. However, DC also is known for having one of the least healthy black populations in the country, a fact reflected in the low numbers of elderly people. For comparison, look at this view of whites in Palm Beach, Florida:

Back to the original question — yes, you can see in the population pyramid that there are more females than males in Washington, DC, except in the population that identify as being ethnically Hispanic. Where do you go to find the opposite problem? One place is Honolulu, Hawaii:

Only Native Hawaiians (a group including other Pacific Islanders) show a normal distribution:

(All of these population pyramids were generated using CSS in a custom script written in Ruby on Rails.)

Written by Clay

July 26, 2010 at 12:40

How to query PubMed and retrieve XML results

This seems like it should be a simple thing to figure out how to do on the PubMed website — return a single result as XML. If you visit PubMed, there is a “Display” link at the top left that allow you to view an entry in XML format, but when you select that option, the URL changes to the vanilla PubMed URL. Anyhow, let’s say you go to PubMed and look at a particular article:

http://www.ncbi.nlm.nih.gov/pubmed/20598978

You can retrieve the same result in XML by simply going to this URL:

http://www.ncbi.nlm.nih.gov/pubmed/20598978?report=XML

Other formats are available and outlined on the PubMed help site. The help files on the site are not particularly easy to search, so it took me forever to find this info.

When you use the URL above, the page is designed to create XML that displays properly in the browser — not XML parsing by Ruby or another language. For that, you have to use the eutils. The proper link for returning XML that you can parse with nokogiri or another gem is:

http://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id=20598978&retmode=xml

Written by Clay

July 6, 2010 at 13:07

Posted in Public Health, Technology

Tagged with ,

Closing a Haitian field hospital

leave a comment »

Part of life is realizing when to throw caution aside and step forward to partake in something interesting. I did that and traveled to a field hospital in Fond Parisien, Haiti back in the middle of February. I found there a fantastic center for patient care, along with dozens of hard-working and committed local staff and volunteers. They had a data management problem — too many spreadsheets, too many lists, not enough organization. It was a burden even to produce a simple census of the tent camp patient population.

I quickly whipped together a simple Ruby on Rails EMR system based on the structure of a blog. Each patient had a medical record that was a blog entry and with each subsequent medical evaluation or event, a “comment” was added to their medical record. This improved continuity of care, helped staff remember when to give important medications, and generally improved the medical stance of the facility. (Note: the “comments” were structured medical notes, not just free text…)

There is a huge number of factors that play into the care of patients in a field hospital. Sometimes those factors do not all work well together. The hospital is closing this week, due to a lack of funding and a deteriorating security situation. Now, I get to return to the field to help disassemble the systems that I helped put together only a few months ago.

Data systems must be flexible during humanitarian response, I learned. In spite of a strong internal voice telling me to make certain that all of the data is normalized and collected in a proper format, the truth is that patient care comes first and the needs of staff change over time. When you have 300 patients and 30 doctors for a sustained period of time, you develop an understanding of what they can enter into a simple patient charting system. When you then find yourself with 300 patients and 7 staff members, you no longer can rely on the earlier learnings. The people are busy and they will not change, but we can change our data systems to accommodate their overload.

That is exactly how the Fond Parisien EMR system changed over the past few months. It left me with many questions about how to create the proper types of “data integrity tiers” that support different stages of a humanitarian response effort. GIS is vital in the beginning — proper patient discharge sheets are vital in the end, when GIS no longer is in use. How do you reconcile those changing needs into a unified system?

I look forward to helping close the hospital and to the lessons that we learn from this deployment. The staff who poured their lives into the effort surely will continue to come up with new insights based on this experience for years to come. I look forward to tagging along to capture those insights, in hopes of developing the skills and knowledge necessary to develop better data systems for humanitarian response in the future.

Public Health & Technology: Confronting the Realities of Disaster

leave a comment »

My true interest, the one that drives my pursuit of programming, is the use of technology to improve response during public health emergencies. I do not write a lot about it on this blog because I currently am not directly involved in emergency response or recovery work. Previous experience, both post-tsunami and post-Katrina, taught me that technology, when deployed properly, can save time, ease minds, and help keep disaster survivors safe. Technology becomes a sharp double-edged sword during times of crisis, though, because if it does not work as expected when needed, it can confuse response efforts and effectively harm the people it is meant to help.

The devastation in Haiti from yesterday’s earthquake is severe and people there are suffering. Families search desperately for missing members who may be buried under the rubble of a collapsed building. People probably cannot get the fresh water they need or visit the markets that usually supply their food. I once saw a family of three, several days after Katrina hit New Orleans, dehydrated, tired, ragged, dirty, and exhausted, walking towards the Red Cross headquarters building in search of diapers for their baby. In contrast to conditions in Haiti, that now seems like a problem of the privileged.

How does technology shoehorn itself into these situations of human suffering? How do we use it to save lives? Find missing children? Prevent disease? Provide water? Understand that people need diapers for their children? The answers are not obvious and they may differ with each unfortunate disaster.

I believe in the power of technology to transform disaster response. So today, as I sit at my desk and build a database, surrounded by more than I need and the luxuries of a modern life of gadgets, my head will be elsewhere, wondering how I could leverage those devices in Haiti, to help improve the lives of the people suffering.

Written by Clay

January 13, 2010 at 12:39

And the flu slowed me down…

with one comment

I’ve been living in a Dayquil haze for the past several days, unable to do much other than look forward to the departure of this cold/flu that I have. I hope it’s H1N1, just to get that out of the way, but who knows? Between bouts of delirium, I’ve managed to update the population generator a little. It now assigns a weight and height to everybody, based on national statistics. Weight and height for children under 18 are assigned based on CDC growth charts, whereby the children are put on a course to achieve a BMI that corresponds with the national average. BMI reads differently for children, so it is not displayed for them. The chart on the lower-left is the distribution of the population based on BMI. It’s not perfect, but comes close to mimicking the US data.

bmi calcs

Written by Clay

November 11, 2009 at 16:01