I need to develop a simple database application. A table to store a patient social history answering following question,
Do you smoke? If yes, how many cigarettes per day?__How many years?_
Do you drink alcohol?__ If yes, how many alcoholic beverages per week?_
Do you use drugs?_If yes, what kind?____How often?______
etc.
I can have table column for every answer. As there are if then else conditionals, I would like to know, what will be the best way to design table for this type of scenario.
Any kind of help is much appreciated.
The thing you want to do here is try and generalize the kind of questions you’re asking. What stands out for me is that you’re asking questions about habits, or a kind of repetitive behavior.
Abstract out your question: What kind of habit is it (Smoking? Drinking? Drug 1, Drug 2, Drug 3)? How frequently do you indulge this habit? Do you do it daily, weekly, monthly, yearly ? If you do it daily, how many times a day? How many times a week/month/year?
This means you can have a table describing generic ‘habits’, where each row represents a patient’s answers regarding a specific habit, and each column represents a specific piece of data that the patient has answered.