« August 2008 | Main | October 2008 »

September 03, 2008

The case of the missing patient names

We received complaints that patient names were missing as the top 5% at the beginning of some reports. It was a mystery why patients wouldn't have names in a database focused on patients. Our investigation into the problem led to a number of issues. The first was that EMPI data was not always loaded before the report data was loaded so patients received from other sources with an ID didn't resolve to any known patient in the system. The next issue was that patient data was being displayed using the SQL that essentially looked like this:

select fname + ', ' + lname as patient from patients

SQL concatenates strings using the + sign but if one of the strings is a null then the whole output is a null. Patients loaded into the system through EMPI data have a name broken into parts. But patients loaded through sources that just have the full string are not and store the whole string in the lname field. Those patients were getting zapped by the null value.

One solution to this is to use isnull(fname,'')+ ', ' + isnull(lname,'') and should be considered for any case where a null might appear in a situation where data could be concatenated. Another is to fix the patients table to have a value rather than a null for key columns like this even if it is a blank value like ' '.

The last resort is to change the server settings to SET CONCAT_NULL_YIELDS_NULL { ON | OFF } or before each query... which the data warehouse architect wasn't fond of.

September 02, 2008

Choosing life - "This is the pro-life choice"?

I was wondering where McCain stood on abortion. This news relating to the handling of pregnancy of the 17 year old daughter of the VP candidate Palin and the strong support from the evangelicals clears this one up. The summary at the top of the CNN article starts with "Sarah Palin, John McCain oppose abortion, have supported abstinence education". She apparently is a great choice for the Republicans to carry the big base of evangelical voters that have supported Bush.

As a secular critic of the pro-life movement I find it odd how the evangelicals work to cast the choice not to have an abortion as the "pro-life choice" as if they support choice.

"Fortunately, Bristol is following her mother and father's example of choosing life in the midst of a difficult situation," Family Research Council president Tony Perkins said. "We are committed to praying for Bristol and her husband-to-be and the entire Palin family as they walk through a very private matter in the eyes of the public."

Evangelical leader Richard Land also backed Palin completely.

"This is the pro-life choice. The fact that people will criticize her for this shows the astounding extent to which the secular critics of the pro-life movement just don't get it," Land said in a statement.

Well I guess I am a bit offended when referred to as a secular critic who just doesn't get the pro-life position. I get the position and why it isn't hypocritical. These folks are pro-life. They don't want it to be legal to have an abortion. If a 17 year old gets pregnant and they don't have an abortion then the family isn't hypocritical because they are supporting their beliefs which is that people shouldn't have abortions. What exactly is not to get? I'm a secular critic of the movement to restrict choice not of the choices people make.

What is the other choice that a woman has when pregnant from their perspective? The "pro-choice choice"? Not really -- either way the woman chooses. So are they pro-choice or not? No - because if they were pro-choice then they would support the woman's choice and not try to legislate it away. There are no mandatory abortions like they have in China in the pro-choice legal structure that we have today. That isn't even being debated to my knowledge and that policy in China could very well have saved billions of people from starvation. I would argue that population control these days is actually one of the few ways to reduce the pressure that the human race is exerting on our environment and I'd predict that population control will become an issue if we ever do have significant resource shortages reaching the US coupled with large scale population increases.

The pro-life evangelical platform is like if the pro-vegetarian movement were to assert that the choice to not eat meat is the pro-vegetarian choice and then continue that the pro-vegetarian agenda is to put laws into effect to make sure no person eats meat.

Anyways I am now clear on the position the McCain/Palin folks are taking on this issue. I really was undecided until now. So a vote for McCain/Palin is a vote for the evangelical loony right and I won't vote for them.