Skip navigation

When I was in middle school, a friend and I were eating at a mall food court (of course) when he threw some trash on the ground. “What was that for?” I asked. “I felt like it,” my friend replied, “Besides someone is paid to clean the floors, so I’m contributing to job creation.”

It was a very long time before I could come up with a sound and convincing moral argument against him.

During an ethics discussion today, we were talking about prioritizing patients for organ transplants. Someone brought up the question of cost, and the leader, a specialist in lung transplantation, mentioned that because post-transplant therapy can be extremely expensive, patients are screened for ability to pay for that therapy prior to the transplant. The reasoning for this is, clearly, that it makes no sense to give a patient a donor’s lung if it will simply result in the patient’s death, e.g. from graft-vs-host as a result of inability to obtain proper immunosuppressive medication.

Perhaps I am naive, but this seemed pretty unbelievable to me. Sure, poor people get inferior care for a lot of reasons. Sure, you might call them the victims of clandestine or indirect rationing. But up to this point, I had not been aware of a situation as stark and grim as a patient sitting down with a counselor, opening up his financial and insurance records, and then being told that he cannot receive a life-saving treatment as a result.[1]

Nevertheless, it is true. Buried in Table 4 of this medscape article, listed under “Absolute Contraindications for Organ Transplantation In General” is the item “Lack of financial resources to pay for surgery, hospitalizations, medications, and follow-up care.” According to the physician I talked to, the assessment for this contraindication is made by financial specialists who operate under institutionally-defined guidelines.

Yikes.

The fact above is really the point of this post, and I think it should stand on its own–if it wasn’t already obvious to you, of couse. Just tangentially, however, I’d like to mention two other fascinating “absolute contraindications” from the same list: “History of failure to comply with medical regimen” and “Lack of functional psychosocial support system”. Of course, none of these contraindications are illogical, but the addition of these two, which address “social” issues, on top of the previous one does make it pretty hard to avoid the term “socioeconomic status” in summarizing what might disqualify someone for a transplant.

[1] Even after watching Michael Moore’s Sicko, which contains a very extended segment about a man who dies after his insurance company denies him coverage for a kidney transplant, it was not clear to me that he might have actually been denied the treatment in addition to the reimbursement for it. In fact, the distinction between those two is emphasized by insurance company representatives as justification for denials without explicit rebuttal. Which is strange, because Moore isn’t exactly known for editorial restraint. (This ABC news article, which addresses a similar issue, is better towards the end, but still doesn’t really explicitly make the coverage/care distinction.)

Ok, last post on this project. It’s a short one, largely because I haven’t done any real medicine-related work in like 3 days.

Long story short, Freebase is awesome and was the inspiration for this whole project. So once I got the data from wikipedia in Part 1, spent another couple hours writing(/learning how to write) a script that would upload the data to their wonderful service. The data still isn’t perfect, but having it on freebase makes editing it a lot easier. It also allows for cool visualizations like this one. Not the *most* practical visualization ever, but it’s kind of fun to play with: you can trace the arteries distally or proximally. Try typing name of any artery in the left search bar, and it should take you there. (Just make sure you don’t end up on a band named “Aorta” or something.)

After my last post, I promptly got several hits from google searches with terms like “scrape infobox” and “scraping wikipedia infobox,” so I thought I would post something useful for those people.

Here is a python script that does some simple parsing of wikipedia infoboxes. It only requires PyYaml in addition to a standard python 2.5+ library.

It can be run at the command line as “python scrape_infobox.py [ARTICLE] [BOX]” and will print out a yaml-formatted dictionary where the keys are the infobox item titles and the values are the corresponding data. ([BOX] is an optional argument. If you leave it off, it will just parse the first infobox on the page. Otherwise it will look for an infobox with the given name.)

For example “python scrape_infobox.py “Femoral artery” Artery” and “python scrape_infobox.py “Femoral artery”" both yield:

{BranchFrom: ‘[[external iliac artery]]’, BranchTo: ‘[[Superficial epigastric artery]]
[[Superficial
iliac circumflex artery|Superficial iliac circumflex]]
[[Superficial external
pudendal artery|Superficial external pudendal]]
[[Deep external pudendal artery|Deep
external pudendal]]
[[Deep femoral artery]]’, Caption: ‘Structures passing
behind the [[inguinal ligament]]. (Femoral artery labeled at upper right.)’, Caption2: ‘Femoral
artery and its major branches – right thigh, anterior view.’, DorlandsPre: a_61,
DorlandsSuf: ’12154275′, GrayPage: ’623′, GraySubject: ’157′, Image: Gray546.png,
Image2: Gray548.png, Latin: arteria femoralis, MeshName: Femoral+Artery, MeshNumber: A07.231.114.35,
Name: Femoral artery, Supplies: ‘[[anterior compartment of thigh]]’, Vein: ‘[[femoral
vein]]’}

Note that the script will fail with certain, more complex infoboxes that have templates inside them (i.e. things with pipe characters in places other than wikilinks).

Updated after thinking twice about 2am attempts at creative writing…

Arteries have a nice structure. Each artery branches successively into smaller arteries. I’ve been thinking for a while that it would be cool to have that structure in a computer in a format that allows us to analyze it and visualize it easily.

Wikipedia’s infoboxes are probably a good starting point. They provide the data I’m looking for in a pretty standard format that might make it easy to extract.

Wikipedia also has some really nice API’s that allows people to operate bots that view and edit the content automatically. Something like this url will spit out page content in a way that is easy to read into a programming language like python. For really intense users, there’s a whole library out there to provide a nice interface for doing these things, but it looked tough enough to learn that I decided to stick with pythons built-in urllib2. I hadn’t worked with it before, but like everything in Python, it’s beautifully simple.

The final process basically involved getting a list of article titles from the “arterial tree” article with one script, using more of wikipedia’s API’s to clean and normalize the titles, and spending 5-6 hours writing a big script that uses regular expressions to scrape the “Source” from each artery article and save it as a file that can be easily read by python. I had to manually clean some of it up (~20 items), since that big script didn’t work perfectly on some exceptional cases, but I ended up managing to use google’s visualization playground to come up with a final visualization that I think looks pretty good.

My two latest attempts at anatomical/scientific illustration from winter break. You can find these and the rest of my similar attempts at my wikipedia user page. As usual, all images are free to adapt or use for any purpose under the creative commons attribution license.

Schema of arteries of the thigh. I just added the arteries. The bone structure was taken from a public domain image on the wikimedia commons

 

A cross section of the thigh, traced and colored from a (slightly modified) image from a public domain copy of Gray's anatomy.

If you get a black background when trying to copy-paste images from wikipedia (this happens to me when I try to paste directly to MS paint or Anki) try pasting the image into word first and then copying it again from there.  It’s a simple fix, but it took me a few annoying minutes of searching and experimenting to figure out.

Earlier today I shared an article from cnn.com using the google reader bookmarklet (see the 1 minute intro video to the bookmarklet if you’re unfamiliar).  It’s a nice feature of reader, which is a web service that I generally love.*

But after reading about the recent Canadian libel case on Reader–and in light of the Righthaven lawsuits–I had the thought: how could what I did with the reader bookmarklet not be copyright infringement?  Unlike the video, I didn’t just take the opening paragraph, I took the whole article.  I almost certainly wouldn’t be allowed to copy-paste the entire article into this blog, even if I did include a link to the original article (as my “shared item” in google reader does).  The same “shared item” is even pushed out to my public Google Buzz stream, which is very much like a blog.

Given Google’s history of similar legal issues with YouTube and its recent efforts to “streamline its approach to digital copyright”, I wouldn’t be surprised if we see this feature of reader go away in the near future.

* This could be a post in and of itself, but reader basically replaces facebook for me as a way to keep in touch with friends.  Which leads me to ask the question: Am I really interested in my friends themselves?  Or am I more interested in the things that my friends are interested in?

It’s interesting to me how medical specialties are divided along different lines. Here’s my attempt to break down the specialties listed here  . Mix and match from different categories for sub-specialties!

*edit 2/27/2012* – broke some of the “system” specialties into “etiology of diease”

By technique:
Anesthesiology (sort of)
Plastic surgery
Radiology (diagnostic, interventional)
Surgery
Nuclear medicine
pathology
transplant

By setting:
critical care
emergency medicine
family medicine
hospitalist
occupational/environmental
sports medicine
urgent care

By system:
cardiothoracic (surgery)
cardiology
colorectal (surgery)
dermatology
endocrinology
gastroenterology
general (surgery)
gynecology
ob/gyn
otolaryngology
nephrology
neuro (surgery)
neurology
ophthamology
orthopedics
psychiatry
reproductive endocrinology
urology
vascular (surgery)

by etiology of disease:
allergy and immunology
infectious disease
oncology

by age:
geriatrics
peds
neonatology

mixtures of above:
gynecological oncology
radiation oncology

Bam. WordPress won’t let me embed the SVG, so the link is below. I’m just proud of myself for drawing something that doesn’t look like a 10-year-old did it, thanks to inkscape and the wonderful tutorials done by heathenx and to a lesser extent drawspace.com. Both images licensed under CC-BY.

SVG Stuffed Elephant

Follow

Get every new post delivered to your Inbox.