Vous êtes sur la page 1sur 60

Introducing Database

Sin-Guo Chai, Ph.D. Yung-Fu Chen, Ph.D. Department of Health Services Administration China Medical University

Learning Objectives (1)

Discuss the differences between conceptual and logical data modes. Differentiate between files, records, and fields. Differentiate between file and database processing environments. Differentiate between database models including relational, network, hierarchical, and objectoriented models.

Learning Objectives (2)

Define the functions of a database management system (DBMS) Identify and describe the various types of organizational databases Describe the roles of a data administrator (DA) Describe the Request for Proposal (REP) document and process.

Introduction (1)

A role of health information manager

A liaison between users and system developers

Essential to the health information manager


The development and management of database systems The derivation of physical data models from conceptual data models

CASE

Transforming the conceptual data model into a logical (physical) model (Fig. 6-1, Fig. 6-2)

Introduction (2)

The conceptual data model


the

users view of how the data should be organized and displayed.

The logical data model


refines

the conceptual model targeted to a specified database configuration, e.g. a relational database (Fig.6-2).

Introduction (3)

In todays information-intensive health-care environment, it is essential to know what an organizations information needs are. to design and develop automated systems that best support those needs.

Introduction (4)

Databases and database management systems (DBMS)

essential components in an enterprise information architecture.

The purpose of this chapter


to introduce basic concepts associated with databases and their management to present an overview of the roles that the health information manager can assume.

Database and Database Management Concepts

Files, Records, and Fields File Versus Database Processing Database Structure Models

Files, Records, and Fields (1)

The most fundamental concepts associated with the conceptual data model are entities, attributes, and relationships. An entity is a person, location, thing, or concept about which data can be collected and stored. For example, patient, physician, encounter, and employee.

Files, Records, and Fields (2)

An attribute describes an entity and is sometimes thought of as the property of an entity. Common attributes of the entity patient include name, gender, birthdate, and medical record number. In the physical database environment, the critical concepts are field, record, and file.

Files, Records, and Fields (3)

A character or a collection of characters make up a field. A collection of fields represents a record. A collection of records (or occurrences of a record) constitute a file.

Figure 6-3 the file is called Patient, the columns represent fields or data elements, and the rows represent records.

Files, Records, and Fields (4)


For each entity in the conceptual model there is a file in the physical database. Attributes in the conceptual model are analogous to fields in the physical model. The conceptual model describes relationships between entities. These same relationships must be translated to the physical model, which is accomplished by placing the key attribute (unique identifier) of one entity as a field in the entity with which it has a relation.

Files, Records, and Fields (5)


The placement of this key identifier in another entity is sometimes referred to as a foreign key. In looking at Figure 6-2, we can see that in the physical model the field medical record number is added as a field in the Encounter file. In the conceptual data model the relationship between the entity patient and the entity encounter is a one-to-many relationship.

Files, Records, and Fields (6)

By placing the unique identifier medical record number as a foreign key in the file Encounter, this one-to-many relationship is represented. Representing the relationships among entities is important for data retrieval purposes. In a many-to-many relationship, such as that existing between the entities physician and encounter, the key attributes or fields of each entity are included as a foreign key in the other entity.

File Versus Database Processing (1)


In file systems, each user has its own files, as illustrated in Fig. 6-4. The problems of the file system
Data redundancy: duplication of data fields. Poor space utilization. Poor coordination and communication.

Two of the biggest problems associated with data redundancy


poor data integrity difficult data retrieval

figure 6-4

File Versus Database Processing (2)

Data integrity usually refers to the consistency of data. Data retrieval is also a significant problem in a file environment. A database is a structure that allows for the storage of data about multiple entities and the relationships among these entities.

figure 6-5

File Versus Database Processing (3)

Data retrieval can be accomplished across the various files (tables) because relationships among the entities have been established through the use of key identifiers and foreign keys. Specific software programs exist that are called database management systems (DBMS).

For example, the DBMS provides the mechanisms that allow users to add, update, delete, and retrieve data.

File Versus Database Processing (4)

Using the query, Provide a listing of patient names and addresses with insurance coverage by payer 8790 as an example, the DBMS would locate and access the appropriate files, records, and fields to answer the query. This function releases the user from having to know what files contain the needed information or how these files are structured or indexed.

File Versus Database Processing (5)

A major advantage of a DBMS is that it provides each user or user group with its own view of the database. A user view (part of the database) is often referred to as a subschema and the entire database is often called a schema. User views or subschemas are created by the database administrator.

File Versus Database Processing (6)

The user view is a pseudofile that consists of data fields to which a user may have access. The data fields most useful to a user in the dietary department would probably include diet code, room/bed number, patient number, patient name, birthdate, and diagnosis description.

File Versus Database Processing (7)

Therefore, these data fields would compose the subschema or user view for a dietary employee. The database is much simpler for the user. Also through the use of subschemas the database administrator can control access to data fields on a need-to-know basis.

File Versus Database Processing (8)

Another benefit of user views is that they are independent of the physical structure of the database files. In addition to the features already discussed, a DBMS performs many other functions such as providing concurrency, security, and integrity controls.

Database Structure Models

Relational, network, hierarchical, and objectoriented models. Each data model has two components: structure and operations. System structure is the way users perceive the system to be constructed or the way data are organized. Operations refers to the facilities given to users to manipulate the data within the database.

Relational Model (1)


A relational database model consists of a collection of tables. (Fig.6-6) Formally these tables are called relations. In the relational model each entity gets a table of its own. Relationships among entities are represented by common columns. Each column has a unique name, and entries within that column match the column name.

Figure6-6

Relational Model (2)

All rows must be unique. Multiple entries (repeating groups) for one position are not allowed. Fig.6-7 shows a table for an ED encounter that violates the repeating group convention. When the relational model was first proposed, the terms relation, tuple, and attribute were used to describe the relational model. Each row in the table is referred to as a tuple and each column is referred to as an attribute.

Figure6-7

Relational Model (3)

A comparison of the terms is provided below. The most common used terminology is Alternative One.

Data manipulation languages (DMLs) assist end users in querying the database.

Relational Model (4)

Several DML approaches exist including structured query language (SQL) and query by example (QBE). An advantage of the relational model is that it maintains data independence.

Changes can be made in the database structure without having to make changes in the programs accessing the database.

Relational Model (5)

The model promotes a much higher degree of data independence than, the hierarchical and network models. The chief disadvantage concerns efficiency. The relational model may not be appropriate for developing very large-scale application programs.

Network Model (1)

Just like the relational model, the network model represents entities, their attributes, and relationships among entities within its structure. In the network model, entities are referred to as record types, attributes are referred to as fields within a record type, and relationships are explicitly defined in terms of sets.

Network Model (2)

Figure 6-8 is a representation of three of the emergency department entities and their relationships in a network model.

Network Model (3)

The rectangles represent the record types (entities) in the database. The arrows represent the one-to-many relationships among entities. In Figure 6-8, one patient has many encounters, but one encounter can have only one patient; one encounter has many tests, but one test can have only one encounter.

Network Model (4)

The relationship between patient and encounter is called a set. Likewise, the relationship between encounter and tests is called a set. Sets are given names. The set from patient to encounter is called Has because each patient has an encounter. The set from encounter to tests is called Composed of because each encounter is composed of tests.

Network Model (5)

The record type patient is referred to as the owner of the record type encounter, and encounter is referred to as a member of patient. Within the network model, and more specifically the CODASYL model, there is no facility for handling many-to-many relationships. Thus, these types of relationships have to be represented through another record type called a link record.

Network Model (5)

The network model database is manipulated essentially by following the arrows in either direction. If we follow the arrow from patient to encounter, we will retrieve all the encounters that a particular patient has had in the emergency department. If we follow the arrow in the reverse direction from encounter to patient, we will retrieve information about the single patient who was the object of a given emergency department encounter.

Network Model (6)

Figure 6-9 provides a diagram to illustrate how data are queried or manipulated in a network database model. Thus, patient 1 has three encounters and encounter 1 is composed of three tests. If we would want to know how many encounters patient 1 had, we would ask the DBMS to find patient 1. After patient 1 was found, we would repeatedly ask the DBMS to find the next encounter among the collection of encounters for patient 1 until the last encounter had been located.

Network Model (7)

Queries to the database are not always fulfilled by traversing the network from owner to member. Sometimes it is necessary to transverse the database in the opposite direction. For example, suppose we wanted to know who was treated during encounter 1. To answer this query we would ask the DBMS to find encounter 1. We would then ask the DBMS to fine the owner of encounter 1. The owner is a single patient in this case.

6-9

Network Model (8)


Network models are very efficient and are able to handle large databases with a lot of activity. Network systems also have better facilities for ensuring data integrity. For example, information about an encounter could not be added to a network database before information about a patient was entered. This type of check ensures that there is not incomplete or orphaned data in the database.

Network Model (9)

Network systems have several disadvantages. As opposed to the relational model, it is not as easy for users to manipulate data in the network approach. In order to retrieve the desired information out of a network system, the user needs to know what path (arrows) to follow. An actual knowledge of the underlying database structure is needed to follow the right path to satisfy a given query. When changes in a database using a network model are made, changes are also required in all the programs that access that part of the database that has been changed.

Hierarchical Model (1)


A hierarchical model is a special case of a network model. Basically the model is a network with an added restriction-no record type (entity) can have more than one arrow entering it, although it may have more than one arrow leaving it. In the hierarchical model, the one end of the relationship is called a parent and the many end of the relationship is called a child.

Hierarchical Model (2)

Although different strategies are employed to store and manipulate the data, the navigation of a hierarchical model is similar to that described for a network model. Hierarchical systems provide advantages over the relational model similar to those of the network model.

Hierarchical Model (3)

Basically the advantages are efficiency and data integrity protection. The disadvantages of the network model apply to the hierarchical model as well, including issues relating to changes in the underlying data structure that also require changes in affected application programs and cumbersome methods of data manipulation for end users.

Object-Oriented Models (1)


Each object essentially represents an entity. However, in addition to the attributes being stored within the object, an object can store other objects as well. An object can also include actions that can be taken on that object. A non-object-oriented system implements actions as part of its data manipulation process and the actions appear in the programs that update or change the database.

Object-Oriented Models (2)

Big advantage, an object can also contain complex data types such as pictures, graphics, and sound. This is of particular interest in the health-care field where a lot of clinical data are represented as pictures, graphs, x-rays, and so on.

Database Management System Functions (1)

First, a database approach to data storage and retrieval reduces data redundancy.
Reducing data redundancy reduces the space it takes to store data. It also reduces the amount of human resources and time it takes to update data. Another benefit to reducing data redundancy is that there is a better chance for improving data integrity.

Database Management System Functions (2)

Another important advantage of a database approach is that the physical structure of the data are independent of the enterprise schema and user subschemas or views.
Thus, changes can be made in the physical structure of the database without affecting the user view of the data. As we have already learned, this is particularly true with the relational model approach to database design.

Database Management System Functions (3)

The management of the database approach is very complex. In order to manage this complicated system, a software tool was developed called a database management system. The DBMS software can be thought of as a middle man that facilitates interface of users with the physical database.

Database Management System Functions (4)

When a query is made to the database, it is the DBMS that determines what data should be accessed, by whom the data can be accessed, and what data can be released. When data need to be added, changed, or deleted in the database, the DBMS ensures that the correct sequence of events occurs to perform the required function.

Storing, Retrieving, and Updating Functions (1)


The DBMS identifies the record to be updated and instructs the operating system to read the record. The record is loaded into the computer buffers and the DBMS determines what data are required to fulfill the original user request. The DBMS then authorizes transfer of the data from system buffers back to the application program from where the request originated. The required data are now located in the user work area, and the user can now perform the necessary operations to update the record.

Storing, Retrieving, and Updating Functions (2)

Once the changes have been made by the user, the application program automatically sends an instruction to the DBMS to write back the updated record. Although this process is complicated, it virtually goes unnoticed by the user-that is, the user does not have to be concerned with all the algorithms and procedures that are necessary to ensure that the operations are performed.

Data Dictionary

Catalog all the information about the database itself. The data dictionary, in essence, stores data about data. For the health information manager, a thorough understanding about the DD is important.

Transaction Support (1)

It must be retrievable to answer queries and support everyday transactions. In order for an application program to do its job, it must have access to the data in the database. An important function of a DBMS is to provide mechanisms for the application program to manipulate transactions that affect the database.

Transaction Support (2)

Modifications must take place in other files as well. The facility to do this task is provided through use of a data manipulation language. The DML assists users in directly querying the database, but it is also used by application programmers who embed appropriate DML in their programs to access and manipulate data in the database.

Vous aimerez peut-être aussi