Why are so many men pregnant? Data entry mistakes in the health industry
straightstatistics.org
straightstatistics.org
Gender=F and isPregnant=True
combinations are allowed?
I know application layer can handle this. Also triggers. But is there any RDBMS that allows enforcement at DB level for rules like this?
Goes to show we hardly use the DB engine to prevent crap data from being persisted!
I blame the Java cargo cult for this. ;-)
The software is written in MUMPS, which has a built in (sort of) document oriented data storage layer.
http://en.wikipedia.org/wiki/MUMPS
You can read the Wikipedia page and look at some sample code and draw your own conclusions on whether that's better or worse.
What a name for a product servicing the healthcare industry. :-(
I'm currently working closely with ERP (inventory/job management systems, basically.) and tying into these legacy databases.
It's unfortunate because a lot of vendors store stuff in flat-files with no real relational checks or constraints. This bad data gets pushed to my app with an RDBMS and a schema and all kinds of foreign keys and I end up having to dance around the bad data.
What is so unfortunate is that this data isn't necessarily bad. It's all data you need, it just is out of date or inconsistent for whatever reason. You can't really discard it, but you can't really force it into an RDBMS without a makeover, either.
So what you end up with is a generic import routine that has lots of special cases for each different table that has to deal with inconsistent legacy data. It's a fricken nightmare at times.
This is of course ridiculous so you should just use triggers or application layer, that's how logical data restrictions are meant to be enforced.
You could have Male, Female, and Transgendered tables, each of which point back to the Patient table. Only the Female table (and perhaps the Transgendered table) would have an isPregnant column.
Besides, since we are in medical context, your chosen gender is less important than your physical sex (including all the known intermediates and nons), which is what is actually useful to the medical system. Your chosen gender might as well be a write-in slot for all it matters ("Jedi").
Designing a database system, and leaving a criminal liability open like that, is very unprofessional.
Not to mention that Data Protection Law in the EU requires you to store accurate personal data, and allows the person to have this data corrected (i.e. you have to change it if they tell you & can prove it). So you may think "We'll just lump you in the 'Transgendered' Category", however if the person says "I'm male, here's my birth cert showing male", you are legally required to change it.
"Male" isn't one homogenous lump of people; neither is "female". And, as you mentioned, neither is "transgender(ed)"[1].
[1]: http://www.paulinepark.com/2011/03/glaad-is-wrong-on-transge...
After all, it would be silly to have only 2 chategories "trans" and "cis" (trans:cis :: gay:straight).
> It is true that "not all men are the same" (and "not all women are the same"), but splitting into "trans male" and "trans female" is probably more accurate than lumping all "trans people" into one category.
> After all, it would be silly to have only 2 chategories "trans" and "cis" (trans:cis :: gay:straight).
My original post was in jest—in fact, it was inspired by some holy-crap-I-can't-believe-it's-real database schema I've had to work with. Someone made an effort to hyper-normalize things and saddled us with a disaster: Every query required seven or eight slow joins, and there was duplicate data sprinkled everywhere (in my example, the same patient could inadvertently have records in both the Male and Female tables). The "architect" quit a few weeks after it went to production.
Anyway, I consider (biological) "sex" to be a sliding scale: one end being female, the other end being male, and the middle being intersex. I consider (social) "gender" to be where one self-identifies on that scale. Others might disagree, but I think this is a useful distinction.
Upon reflection, it's obvious that my schema isn't even remotely helpful! My inclusion of the "Transgendered" table implied that the three tables were genders, not sexes. Gender, being a self-identified trait, has nothing to do with whether one can get pregnant.
So if we wanted to hyper-normalize our schema and indicate that only certain patients can get pregnant, we should clearly have a "Uterus" table. In fact, it would probably be wise to have tables for every body part, and inner-join on all of them whenever we need to grab a patient's information. Or we could use check constraints... but our schema diagrams would be much less impressive.
The webdev world, where there is 1 app in 1 language written by 1 team talking to 1 DB and that's as complex as that bit of the system architecture will ever get, doesn't have any techniques that can cope with this kind of environment.
Some things that might seem like mistake aren't mistakes, e.g. people over 18 having pædiatric procedures (e.g. undecended testes is often caught shortly after birth and an orchidopexy is often done in pædiatric wards, but if it was undetected and ignored, for 20 years a 20 year old might need it.).
It's hard to solve a people problem with technical solutions.
edit: apologies, that was from a comment on the article.
The other worry is that this data is potentially used for clinical research, so let's hope people know about the error rates.