I am having problems deciding on model names for a new app I am building. These are important decisions so I want to make sure to do it right. This is going to be a database to hold medical records, so there can be records on people receiving medical services, their family members, doctors, nurses/administrative staff, witnesses to accidents, etc.
Instead of having a specific table for every type of person, I am thinking about just making ‘People’ and ‘User’ models. The ‘User’ model would hold all individuals who work for the health facility and the ‘People’ table would hold everyone else – such as patients and witnesses to accidents.
I still have a problem, because if a user documents an accident, one ‘User’ could be the witness and another could be the victim. It basically makes my app seem inflexible becuase I am separating ‘People’ (patients,etc) and ‘Users’ (employees, etc) into two constant places in the system.
So, why can’t I just make one table called ‘People’ for everyone? Then, a person could be a user, employee, doctor, patient, victim – or any combination of them.
Have we been taught to always name the people who work for us and login to the system ‘Users’? Does this matter?
Is there any negative to having a table called ‘Person’ for everyone? It seems to make things a little easier. Any person can be a user (by having a valid login/status enabled to login) or a non-user. I don’t see a negative to this.
You and I are always people but we play specific roles in certain circumstances–so what about a setup where all people are represented by a model called “Person”, and are linked to by the specific classes that require those roles. For instance:
In this way, the data that makes up what a person is is always constant, but the data that makes up the roles they play are stored in other models.
You’ll find this sort of setup often in the wild–for example, at a college I worked at, all records dealing with individuals pointed back to a master “PEOPLE” file–students that later became employees used the same record in the PEOPLE file in both instances.