Database Reference
In-Depth Information
coming up with a model for this object. Modeling any object requires considera-
tions of the possible and relevant attributes for the object. Also, you must consider
the relationships that instances of this object have with instances of other objects.
As you proceed to model the object PATIENT, you realize that there are inpatients,
outpatients, and emergency room patients. Your model must include all these
patient types. Now examine these patient types for attributes. You note that all three
of these types of patients have common attributes such as PatientID, PatientName,
Address, Diagnosis, and so on. But you also realize that each set of patients has
attributes that are not common to the other two sets of patients. For example, inpa-
tients have attributes such as AdmissionDate, DischargeDate, LengthOfStay,
TypeOf Meals, and so on that are not shared by outpatients and ER patients. Fur-
thermore, inpatients are related to another object in the model, namely, ROOM.
They may be transferred from one room to another.
You see that there is something special about the three sets of patients in the
way they share their attributes and in the manner in which some attributes are spe-
cific to each set. Clearly, all patients in the medical center cannot be modeled with
one object PATIENT. Then what are the options? You can opt to model the patients
with three separate objects INPATIENT, OUTPATIENT, and ERPATIENT. If you
make this choice, then your model will repeat several attributes and perhaps rela-
tionships for each of the three objects.
Step back and look at the four objects PATIENT, INPATIENT, OUTPATIENT,
and ERPATIENT. It appears that an object PATIENT is a supertype of object
and that the other three are subtypes whose attributes and relations may be derived
from the supertype object. You will find it best to use these four objects in your
data model to truly represent the real-world information in the case of the medical
center. Figure 6-16 explains the need for this method of representation in the
model.
What you have noted is the concept of generalization and specialization in a data
model. This concept enables special types of objects to be represented in a data
model. As you examine the information requirements of any business, you will
Name
DrID
DrName
PatientID
Address
ATTENDING
PHYSICIAN
PATIENT
INPATIENT
OUTPATIENT
ERPATIENT
ERDate
AdmitDate
VisitDate
Procedure
DischrgDate
OPClinic
Figure 6-16
PATIENT object: supertype and subtypes.
Search WWH ::




Custom Search