I am a creating a database to keep track of therapies patients
received. I have each therapy in a separate table (for field name
simplification, since the same information is collected on different
therapies). When physicians fill out the form, I want to make sure
that if they answer "Yes" for the field "Was therapy A given?" (in
table A), then the field "Was therapy B given?" automatically goes to
"No" and no details can be entered into table B.
Really bad idea: check out normalisation methods or read any dozen or so
posts in this newsgroup. May I suggest another approach:
Patients(*RecordNumber, FName, LName, Address, etc etc)
/* you've probably already got this!!
*/
Therapists(*TxNum, Name, Specialty, DollarsPerHour, etc etc)
/* to be honest, I'd probably include all medical professionals
in this, e.g. specialists, GPs, Home nurses etc etc
*/
Referrals(*PtRecordNum, *TherapistNum, DateOfRef, ReferredByWhom, etc)
/* the PK is made up of two fields so that the same patient can only
have one active referral to the same therapist at a time.
*/
Sessions(*PtRecordNum, *TherapistNum, DateOfSession, DoneByWhom, etc)
/* the combination (PtRecordNum, TherapistNum) is a FK into the
referrals table, so that you can't have sessions that don't
belong to a specific referral
*/
This seems to cover all the things that you mentioned above, although my
guess is that it's only a small subset of what you really need to know.
Isn't it generally easier to build this into your normal medical records/
clinical information system?
All the best
Tim F