In IMS, a record is stored and accessed in a hierarchy. A hierarchy shows how each piece of data in a record relates to other pieces of data in the record. The following figure shows such a hierarchy.

Medical Database Hierarchy

Medical Database Hierarchy

IMS connects the pieces of information in a database record by defining the relationships between the pieces of information that relate to the same subject. The result is a database hierarchy.

In the medical database, the data that you are keeping is information about a particular patient. Information that is not associated with a particular patient is meaningless. For example, keeping information about a treatment given for a particular illness is meaningless if the illness is not associated with a patient. ILLNESS, TREATMNT, BILLING, PAYMENT, and HOUSJHOLD must always be associated with one of the clinic's patients to be meaningful information.

You keep five kinds of information about each patient. The information about the patient's illnesses billings, and household depends directly on the patient. Information about the patient's treatment depends on the patient's illness, while information about the patient's payments depends on the patient's billings.

Each piece of data represented in the following table is called a segment in the hierarchy. A segment is the smallest unit of data that an application program can retrieve from the database. Each segment contains one or more fields of information. The PATIENT segment, for example, contains all the information that relates strictly to the patient: the patient's identification number, the patient's name, and the patient's address.

The PATIENT segment in the medical database is called the root segment. The segments below the root segment are called dependents, or children, of the root. For example, ILLNESS, BILLING, and HOUSHOLD are all children of PATIENT. ILLNESS, BILLING, and HOUSHOLD are called direct dependents ex PATIENT; TREATMNT and PAYMENT are also dependents of PATIENT, but they are not direct dependent: because they are at a-lower level in the hierarchy. A database record is a single root segment (called a root segment occurrence) and all dependents. In the medical example, a database record is all the information about one patient.

Each database record has only one root segment occurrence, but it might have several occurrences at lower levels. For example, the database record for a patient contains only one occurrence of the PATIENT segment type, but it might contain several ILLNESS and TREATMNT segment occurrences for that patient.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

IBM Mainframe Topics