table design to manage patients

amanco

Registered User.
Local time
Today, 23:02
Joined
May 10, 2004
Messages
53
Please Help: table design to manage my patients

i am trying to construct tables to manage my patients.

tbl_Patients
tbl_Symptoms (yes/no)

every patient has a set of symptoms given by yes/no in a table. so this is 1 to many relationship.

problems i am facing:

(1) i would like to make a form which can access the tbl_Symtoms, by a drop down menu i.e. the symptoms are in a combobox and when one chosen this will tick the check box in the tbl_Symptoms

(2) i also have other tables
tbl_Symptom1
tbl_Symptom2
tbl_Symptom3
...etc

i am having a problem understanding how can i relate the tbl_Symptoms to each one of these.

e.g. in tbl_symptoms i check the symptom "cough", i would like this "cough" to be related to the tbl_cough

am i missing something? my train of thoughts is blocked. please help me i am a newbie in this matter. appreciate your help.

cheers :)
 
Unfortunately, you have picked a tough starting point for a possible database app. Not impossible, mind you - just difficult.

OK, let me put on the professor hat for just a moment.

The FIRST thing you should do is try to do by hand what you want to do by machine, for one or two examples. If you cannot do it by hand, you will never be able to teach your machine how to do it. Think of this as a tool for problem visualization and formalization. You need BOTH. You must visualize (be able to see) the problem and define rules to follow (formalize) when entering new data or updating data. Think of this as research before implementing a new procedure.

The NEXT thing is to look at factors you want to track and whether those factors are permanent or temporary. Like, having a cough today is likely to be temporary, whereas amputation tends to be more permanent.

OK, now consider classes/types of information. Each one is a candidate for table. When joining tables together, though, you often find a many-to-many relationship, which Access doesn't directly support. (It makes you take the long way around.)

I'm now speculating, the professor hat is half-way off and the spectator hat is half-way on.

You have patients. They have allergies. They make many visits. Each visit has the potential for discovering different symptoms. The diagnosis for each visit has the chance for changing from prior diagnoses and for being multi-faceted. I.e. Rhinitis and Bronchitis. You might prescribe different drugs for each situation. To me this suggests the following:

tblPatient
fldPatientID - perhaps just a number, even an autonumber, that is your patient's permanent ID - maybe even their account billing number. Your call. But this will be the table's primary key.
fldPatFName, fldPatLName, fldPatMName, etc. - personal, non-keyed data about the patient. fldPatDOB, fldPatMarried, fldPatSex (Despite the chance for a grin, don't make this one yes/no).

tblVisit
fldVisitID - another number, maybe autonumber, prime key of this table.
fldPatientID - foreign key that links back to the patient.
fldVisitDate, fldIsFollowUp, fldVisDuration, etc.

tblSymptoms
fldSymptomID - maybe an autonumber or maybe there is an official medical reference of symptom IDs. I know in the USA there is a diagnosis code, so I could imagine a standardized symptom code, too.
fldSymptomName
fldSymptomDetails

tblSympVisit
fldSymptomID - foreign key
fldVisitID - foreign key
fldSymptomSeverity - arbitrary code
fldSymptomSpecifics - maybe if you took the person's temperature, you would record the raw number here. Or blood pressure. Heart rate. etc.

You would have one entry in tblSympVisit for every symptom exhibited at that visit. You don't need the patient ID here because the VisitID links back to the patient. So that links the patient to the symptoms for a specific date and time. (Date is one of the Visit fields.)

OK, diagnosis, anyone?

tblDiagnosisCodes
fldDiagCode - a code number for the given diagnosis. primary key.
fldDiagName - a longer name for the associated disease or condition.

tblDiagVisit
fldDiagCode - foreign key from diagnosis table.
fldVisitID - the visit for which this diagnosis was applied.

Again, VisitID leads to the patient. The date from the Visit tables establishes when the diagnosis was made.

How about prescriptions?

tblScrips
fldVisitID - foreign key, leads back to patient
fldMedName - the name of the product
fldMedGeneric - yes/no, allowed generic fill
fldMedRefills - number of refills allowed, could be zero to indicate NO REFILLS
fldMedDose - the recommended dosage
fldMedFreq - the recommended frequency
fldMedSample - gave samples? yes/no

I think this gives you an idea of a possible structure concept. But I warned you it wasn't trivial.

I think the key to WHATEVER you choose is to separate out the patient from the visit. Use the visit as the key to everything else. Exploit the Visit table's PatientID to find the patient data. Use the Visit table to hold info that is date-sensitive.

But ... you could easily have tables that directly link back to the patient anyway. For one possible example,...

tblAllergies
fldPatientID - foreign key
fldAllergen - name of allergen: pollen, dander, latex, peanuts, particular medication name, mother-in-law, etc.
fldReaction - what happens when the patient is exposed: rash, cough, toxic shock, convulsions, edema, nausea, shivering, etc.
fldSeverity - i.e. not-quite-nil, mild, moderate, severe, fatal.
fldDelayed - yes/no if this patient's reaction is immediate or not. Or maybe a number of hours or minutes delay, zero meaning immediate.

Here, the basic principle is that some things depend on the visit; some depend only on the patient. Another way of looking at it is whether the data comes from a patient history form filled out before the initial visit or whether it comes from your notes of an individual visit.
 
Thank you Professor for the post, I really enjoyed reading it :)

I realized that I didn’t give attention to the tblvisit being the one involved in all the rest, and thanks a million for pointing this out. And some of course as you mentioned related directly to the patient.

now back to the part i am having problems understanding which is the relationship between tbl_Symptoms (as you described below) and tbl_Symptom1
tbl_Symptom2
tbl_Symptom3
...etc

is it many-to-many? with a junction table? if so any clues? and if i would like to add a table with symptoms and checkboxes ... the checkboxes are driving me mad should they be in one field in tbl_Symptom or should they be in a different new table? and how are they going to be related?

thanks for your time prof :p
 
You only need One table for symptoms, do some searching here for articles on normalisation (normalization)
 
Rich said:
You only need One table for symptoms, do some searching here for articles on normalisation (normalization)

apart of the tbl_symptoms i'm going to have a table for each symptom to ask more about that particular symptom. and i can't include all in one table.

e.g. tbl_symptoms

ICDID ICDNumber ICDDescription
7082 786.02 Orthopnea
7084 786.1 Stridor
7085 786.2 Cough
7086 786.3 Hemoptysis
7087 786.4 Abnormal sputum
7088 786.5 Chest pain
...... etc

and tbl_Orthopnea, tbl_Stridor, tbl_Cough, tbl_Hemoptysis, tbl_AbnormalSputum, tbl_ChestPain, ...etc

say for example patient comes in visitID has cough from the tbl_Symptoms, i would like to enquire more from tbl_Cough (i.e. further questions about the cough)

but i am not sure how can these be related to each other. i hope it's more clear now.

cheers
 
No! you don't need a separate table for each symptom. You can add a Memo field to the original table and add lengthy notes for each one, or you could add a memo field to your patients table, again to add lengthy notes.

If you want to add multiple sets of notes for each symptom then just another table linked to symptoms on a One To Many basis or even a Many to Many will enable this. Using this method you can add as many symptoms and further notes etc. as you wish without having to create new tables every time a new symtom appears
 
Rich said:
If you want to add multiple sets of notes for each symptom then just another table linked to symptoms on a One To Many basis or even a Many to Many will enable this. Using this method you can add as many symptoms and further notes etc. as you wish without having to create new tables every time a new symtom appears

Rich i appreciate what you are saying, but each symptom has different questions than the other one. and i do this orally as well as i have a form for each symptom ready which is different than the other symptom.

for example asking a patient about cough is different than asking a patient about rectal bleeding. and i would like to add fields (Questions-at least 10 for each symptom) in a table rather than a memo for search and study analysis. i know this is a pain to do but i have to do it the hard way to be sensitive hunting for the symptom's cause, as each symptom is caused by different diseases.
so is there a way to relate tbl_symptoms to each symptom's table through the tbl_visit and tbl_visitSymptom? thanks
 
Last edited:
tblSymptoms
SymptomID
Symptom

tblQuestions
QuestionID
Question

tblSymptomsToQuestions
VisitID
SymptomID
QuestionID


or something like that....
 
Mile-O-Phile said:
tblSymptoms
SymptomID
Symptom

tblQuestions
QuestionID
Question

tblSymptomsToQuestions
VisitID
SymptomID
QuestionID


or something like that....

thank you Mile-O-Phile for your reply. let me get this straight please, shall i use "QuestionID" field as a primary Key in all the invidiual symptom tables [tbl_Orthopnea, tbl_Stridor, tbl_Cough, tbl_Hemoptysis, tbl_AbnormalSputum, tbl_ChestPain, ...etc] and this "QuestionID" will be foreign key in the tbl_SymptomVisit ? almost there, thanks :)
 
Pat Hartman said:
- you are still thinking multiple tables for symptoms. You need ONLY ONE. Try to put some sample data into the tables suggested by Mile. This may not be your final structure but believe me, if you start using multiple tables for symptoms, you will NEVER be able to properly analyze the data you are collecting. You need to learn what normalization is so that you can apply the principles to your database design. You may even want to hire a professional to do that part of the process for you. In a database whose primary purpose is data analysis, table design is CRITICAL. I believe that you will end up with a set of tables that define symptoms and questions and another set where you capture this information relative to a specific patient.

With the proper design, you will only need to add a new row to the questions table if you want to ask an additional question regarding a particular symptom. With the approach you are intent on now, you would need to add an additional column to the symptom table. You would also need to add that new column to any reports or forms and queries wihch could end up being a lot of work.

thanks for your reply Pat. i guess what Rich was suggesting makes sense now. regarding the tables suggested by Mile:

tblSymptoms
SymptomID FK?
Symptom

tblQuestions
QuestionID FK?
Question

tblSymptomsToQuestions
VisitID FK
SymptomID PK?
QuestionID PK?

is the SymptomID & QuestionID in tblSymptomsToQuestions PKs? and FKs in the rest? or is it like the attached image?

thank you for your patience :p
 

Attachments

  • relationship.jpg
    relationship.jpg
    21.8 KB · Views: 244
Last edited:
amanco

Think in terms of two boxes of cards and each box is represented by a table.

Box of Cards1 and Table1

All details on the patient such as name, address, date of birth etc. You might also have fields to cover such things as allergies or whatever.

If you have 9817 patients then this box of cards has 9817 cards or Table1 has 9817 records.

Box of Cards2 and Table2

This is for visits, procedures etc.

If Mary Smith has 10 visits/procedures then she has 10 cards in the second box of cards and 10 records in Table2. But Mary Smith NEVER has more than one card in the first box or cards and therefore she never has more than one record in Table1
 
Thank you Mike375 for your example, but my problem is beyond this stage.

Pat, Rich, Mile-O-phile i took this a big step forward and your suggestions in in the attached file. (based on a survey mdb found and edited by Pat in the forums) please let me know if i should continue based on this. or any other additions or corrections should be done. i'm so thankful for your help. Cheers :)
 

Attachments

Thank you for your reply Pat :)

Pat Hartman said:
1. OptionGroup in tblQuestions needs to be required. Your data will need to be fixed before you can set this field to required.

(1) changes were made. i was wondering Pat, if it is possible to add a field for OptionGroup2 in addition to OptionGroup where it is not required and i can add text to this field. so the answer to each question becomes OptionGroup and an optional "Other field" to type text for an answer. or shall i use this field in the tblAnswers?

2. What are tblSymptomsQuestions and tblQuestionOptions?

(2) I have no idea, found them in the survey examples and i thought there is a purpose that i didnt discover. so i guess i should remove them now. :p

3. I think that you should have a tblVisit between tblPatient and tblAnswers. This table will allow you to specify a date/time when the symptom was reported and the question asked. It also allows for the same question to be asked multiple times and the different answers stored. The Visit table would be the equivalent of the Survey table in the survey examples.

(3) i added the tblvisit between tblPatient and tblAnswers, with a foreign key in the tblAnswers (1-to-many), is that all or do i have to join it to the tblQuestion too?

4. There is an Access default that you need to turn off - Tools/Options-Tables/Queries - get rid of the string in the Auto Index on Import/Create. It is causing extraneous indexes to be created. Then open each table in design view, open the index dialog box (the lightning bolt) and delete any extraneous index. Most of the tables will have a Primary key (which is correct) and a spurious index on the same field. Delete the non-primary key index.

(4) i removed the string. but what about the foreign keys in the tables? should they be indexed (duplicates OK) ? or that is not necessary?

------------------------------------------------------------------------

(5) i am also having problems understanding how to make a form (subform) for each symptom based on the rows in tblQuestions. i really appreciate any pointers.

Thanks alot for the help, i learned so many things from you :)
 
I made a comment earlier and then got distracted from this thread by a really dirty, four-letter word: WORK!

One of my really important supplies for a database design project (and yet incredibly cheap, given their utility) is a big pack of post-it notes that I can use to "create tables" and see the relationships on a big dry-marker board. You would be bloody AMAZED how clear that sometimes makes your problem. If you can actually SEE the data and try to follow some links (which you draw on the dry board), you can see what makes sense and what leads to the wrong idea.

On the sub-topic of symptoms, questions, and answers:

Remembering that you have a VisitID from a Visit table and a SymptomID from a master Symptom table, here is (roughly) how you set this up.

tblQuestion
fldQuesID (PK)
fldQuesText (the question you ask.)

tblAnswers
fldAnsID (PK)
fldAnsText (the answers you recognize)

tblQACondoned
fldQuesID (FK)
fldAnsID (FK)

These three items sit in ISOLATION. They provide you with the list of possible answers that could be associated with a common question. It is the QACondoned table that is going to be UGLY (tedious) to set up. But to use it, you will simply have to find the list of answers that are responsive to the question. How do you use it? Well, once you have decided to ask a question, all you need to do is look up a list of condoned answers and select one.

OK, next step. You recall your Symptoms Table. Now you need this:

tblSympQues
fldSympID (FK)
fldQuesID (FK)

It is a list of the questions you need to ask for each reported symptom. This STILL does not tell you anything about a visit. It only tells you what questions you should ask if a given symptom is present. How do you use this? Well, once you have a symptom, all you need to do is look up a list of suggested questions and ask them. (See above for what to do with the answers.)

Now the step that ties it all together.

tblVisQuesAns
fldVisitID (FK)
fldSympID (FK)
fldQuesID (FK)
fldAnsID (FK)

This is the list of questions you asked at the visit given the reported symptoms, and the answers you got for each.

You will probably need either dynamic sub-forms or cascaded sub-forms to actually put together all of these options, but this would be a fairly compact method of keeping things together. And I think it meets normalization requirements pretty well.
 
Pat Hartman said:
5. The subform would be generic rather than specific. If you always want to include all the current questions for a symptom, I would create an append query that copies each questionID associated with the selected Symptom and append that set of records to the Answer table for this Patient's Symptom. That way the Answer subform will always contain all the questions. The user would then choose the answer for each question.

May I suggest that before you start building forms, you try out the tables to make sure you can create the queries you need to get the answers you are searching for.

Thanks Pat, i tried so hard to look for a way to do this. i get errors appending the questionID to the tbl_answers.
also i don't know where to start to make the queries to build the answers for each question. i'd appreciate any online tutorials about this or a brief step by step on how to do it.

The_Doc_Man said:
On the sub-topic of symptoms, questions, and answers:

Remembering that you have a VisitID from a Visit table and a SymptomID from a master Symptom table, here is (roughly) how you set this up.

tblQuestion
fldQuesID (PK)
fldQuesText (the question you ask.)

tblAnswers
fldAnsID (PK)
fldAnsText (the answers you recognize)

tblQACondoned
fldQuesID (FK)
fldAnsID (FK)

tblSympQues
fldSympID (FK)
fldQuesID (FK)

Now the step that ties it all together.

tblVisQuesAns
fldVisitID (FK)
fldSympID (FK)
fldQuesID (FK)
fldAnsID (FK)

Thank you The_Doc_Man for your reply, i added your suggestions to table structure (see attached image) but not sure though about the tbl_Option & tbl_OptionGroup [Circicled red] if they are correct in the design.

relationships3.jpg


Thank you all :)
 

Attachments

  • relationships3.jpg
    relationships3.jpg
    52.1 KB · Views: 203
Last edited:
amanco said:
Thanks Pat, i tried so hard to look for a way to do this. i get errors appending the questionID to the tbl_answers.
also i don't know where to start to make the queries to build the answers for each question. i'd appreciate any online tutorials about this or a brief step by step on how to do it.



Thank you The_Doc_Man for your reply, i added your suggestions to table structure (see attached image) but not sure though about the tbl_Option & tbl_OptionGroup [Circicled red] if they are correct in the design.

Thank you all :)

You are welcome.

The option group stuff looks like someone else's solution to the same problem I was attacking. Perhaps this solution and my Question and Answer tables are redundant when considered together. I answered your question in isolation because my site is kind of queasy about downloads from outside of the USA, and the web site is certainly outside the USA. Which means that I can't always see images and sample DBs.
 
The_Doc_Man said:
You are welcome.

The option group stuff looks like someone else's solution to the same problem I was attacking. Perhaps this solution and my Question and Answer tables are redundant when considered together. I answered your question in isolation because my site is kind of queasy about downloads from outside of the USA, and the web site is certainly outside the USA. Which means that I can't always see images and sample DBs.

uploaded to a US server :p

Symptoms.mdb is the old one
Symptoms2.mdb with your suggestions

thanks :)
 
Pat Hartman said:
5. The subform would be generic rather than specific. If you always want to include all the current questions for a symptom, I would create an append query that copies each questionID associated with the selected Symptom and append that set of records to the Answer table for this Patient's Symptom. That way the Answer subform will always contain all the questions. The user would then choose the answer for each question.

my query is
append_problem1.jpg


The error msg i get:
append_problem.jpg


May I suggest that before you start building forms, you try out the tables to make sure you can create the queries you need to get the answers you are searching for.

I have no idea how to start doing this. please help
 
The_Doc_Man, i think i'll stick with the old design as it is visually easier to manipulate, please let me know if your design add any more advantage. however i'm still stuck with appending queries, to show all questions at the same time with their options.
 
can someone help me please, i'm stuck o this for 3 weeks now :(
 

Users who are viewing this thread

Back
Top Bottom