Design and implementation of springboot+mysql+ssm hospital registration system Graduation project - with source code 211633

Springboot hospital registration system

Summary

In the information society, there is a need for targeted information acquisition channels, but the expansion of channels is basically the direction that people are striving for. Due to the deviation in their perspective, people can often obtain different types of information, which is also the most difficult technology to overcome. topic. Aiming at the problems of hospital queuing registration, etc., the online registration is studied and analyzed, and then the hospital registration system is developed and designed to solve the problems.

The main functional modules of the hospital registration system include doctor management, department information management, registration appointment management, department management, registration cancellation management, nucleic acid appointment management, patient case management, etc., adopting an object-oriented development model for software development and hardware installation , can well meet the needs of actual use, perfect the corresponding software construction and program coding work, adopt MySQL as the main storage unit of background data, and use Springboot framework, JSP technology, Ajax technology for business system coding and development , to realize all the functions of the system. This report first analyzes the background, function and significance of the research, laying the foundation for the rationality of the research work. Analyze the various needs and technical problems of the hospital registration system, prove the necessity and technical feasibility of the system, then make a basic introduction to the technical software and design ideas that need to be used in the design system, and finally realize the hospital registration system and Deployment runs use it.

Key words: hospital registration; Springboot framework; MySQL database

Springboot hospital registration system

Abstract

In the information society, there is a need for targeted information access, but the expansion of access is basically the direction of people's efforts. Due to the deviation of the perspective, people can often obtain different types of information, which is also the most difficult subject for technology to overcome. Aiming at the problems of hospital queuing registration, this paper studies and analyzes the online registration, and then develops and designs the hospital registration system to solve the problem.

The main functional modules of the hospital registration system include doctor management, department information management, registration reservation management, department management, registration cancellation management, nucleic acid reservation management, patient case management, etc. the object-oriented development mode is adopted for software development and hardware erection, which can well meet the needs of actual use and improve the corresponding software erection and program coding, MySQL is used as the main storage unit of background data, and springboot framework, JSP technology and Ajax technology are used to code and develop the business system, which realizes all the functions of the system. This report first analyzes the background, function and significance of the research, which lays a foundation for the rationality of the research work. This paper analyzes the various requirements and technical problems of the hospital registration system, proves the necessity and technical feasibility of the system, and then makes a basic introduction to the technical software and design idea needed to design the system. Finally, it realizes the hospital registration system and deploys it.

Key words:Hospital registration; Springboot framework; The MySQL database

Table of contents

Chapter 1 Introduction 5

1.1  Research Background and Significance 5

1.2 Development and research status 5 

Chapter 2 Introduction to Related Technologies 6

2.1  J2EE Technology 3

2.2 MVVM pattern 3

2.3 B/S structure 3

2.4 Spring boot framework 3

2.5  Mysql database 4

Chapter 3 System Analysis 11

3.1  Feasibility Analysis 11

3.2  Analysis of Functional Requirements 11

3.2.1  Foreground User Function 13

3.2.2  Background administrator function 13

3.3  Non-functional requirements analysis 14

3.4  Security Requirements Analysis 14

3.4.1  System security 14

3.4.2  Data Security 15

3.5  Data flow analysis 15

Chapter 4 System Design 17

4.1  System Architecture Design 17

4.2  Overall system design 17

4.3  System function design 18

4.4  Database Design 18

4.4.1  Data Requirements Analysis 18

4.4.2  Database conceptual design 19

4.4.3  Database Table Design 19

Chapter 5 System Implementation 23

5.1  Implementation of the database access layer 23

5.2  Implementation of Registration Module 23

5.3  Implementation of login module 25

5.4  Realization of User Data Modification Module 28

5.5 Realization of Department Information Module 31

5.6 Implementation of the review module 34 

5.7 Realization of the registration reservation module 37

5.8 Realization of  doctor management module 40

Chapter 6 System Testing 46

6.1  Test purpose 46

6.2  Functional testing 46

6.3  Performance testing 47

Chapter 7 Summary and Outlook 49

References 50

Thanks 50

  1. introduction
    1. research background and meaning

As more and more artificial intelligence is continuously integrated and applied in the medical field, medical services are gradually becoming intelligent. Under the background of China's new medical reform, online registration has become a key and hot area of ​​people's livelihood projects.

The research significance of the hospital online registration system:

(1) Save the queuing time of patients for registration. The registration procedures in traditional hospitals are cumbersome and highly uncertain. The flow of patients is uneven, and there are obvious peak and trough periods. During the peak period, patients need to queue for a long time, and acquaintances are prone to jump in the queue. The trough period will cause Doctors slip away, medical resources are idle, etc. The hospital registration system can automatically calculate the patient's waiting time, reasonably allocate the time for seeing a doctor, and improve the efficiency of the patient's seeing a doctor.

(2) Improve the quality of patients' consultation. Some patients do not know the information of the hospital very clearly before visiting the hospital, nor do they know the qualifications of the specialist departments and doctors to be listed, so they can only choose based on their own feelings and impressions, which is blind. The hospital registration system can register according to the patient's condition and doctor's qualifications, and select the most suitable doctor, which is targeted and greatly improves the quality of patient consultation.

(3) Reduce the illegal activities of "number traffickers". In traditional hospitals, especially large hospitals, it is very difficult to get a famous expert account, and there is a phenomenon of "expert account number one is hard to find", which seriously damages the interests of patients and affects the reputation of hospital doctors. The emergence of the hospital registration system makes the meaning of "expert number" less important. Patients only need to choose the most suitable doctor for their condition.

(4) The operation is convenient and simple. Patients can use the Internet to register and make appointments anytime and anywhere. The operation is simple and convenient, which is convenient for users and improves the efficiency of patients' treatment.

(5) Enhance the social competitiveness of the hospital. The emergence of the hospital registration system has improved the traditional cumbersome and crowded medical treatment environment, improved the hospital's medical service quality, enhanced the hospital's social competitiveness, and improved the hospital's economic and social benefits.

    1. Development and Research Status

The hospital registration system studied in this project is a comprehensive website that integrates patient registration, department doctor management, medical appointment, medical information and payment system, and is convenient for the public to go from seeing a doctor to seeing a doctor. The reason why it is called a hospital registration system is as the name implies. , the users of this system can not be affected by the regionality of the hospital, and can make an appointment for experts or registration at any time and any place as long as they have mobile devices that can access the network terminal.

At present, there are many similar registration websites in China, such as Shanghai Zhuyi (www.91985.com), Zhejiang Provincial People's Hospital (www.hospi-talstar.com), etc., but most of the hospital registration systems are There are no uniform operating procedures, and many sites only provide appointment services for a certain hospital in a certain area, so they cannot achieve the purpose of facilitating all patients, and due to the concept of medical treatment, hospital funds, Due to technical platform and other reasons, some problems also appeared during the implementation of appointment registration service, such as low success rate of registration, high rate of missed appointments, and it is difficult to really curb "number traffickers", especially because hospitals need to provide more manpower and material resources And financial resources, increased the hospital's operating costs. Therefore, some hospitals try to introduce third-party agencies to make appointment registration, and some hospitals even cancel their own appointment system. Considering cost and technology, these cooperations are justifiable, but the increasingly obvious tendency of commercialization is cause for concern.

There is no free lunch in the world, and companies with various names "cooperate" with hospitals, of course, for the purpose of making profits. Therefore, various fees are added to the reservation service. Due to the lack of uniform standards, high reservation service fees are unavoidable. As a public welfare institution, it is debatable whether it is appropriate for hospitals to provide part of the scarce high-quality public medical resources to cooperative companies and allow them to charge service fees. However, the blocking of number sources by cooperative companies will inevitably lead to the reduction of queuing number sources and "difficulty" for ordinary people to register.

Compared with the domestic medical system, the development and construction of the hospital appointment information system in developed countries has a history of more than 30 years, and has made great progress so far. There are many world-recognized successful systems that operate effectively in hospitals, such as the HELP system of LDS Hospital in Salt Lake City, USA. Throughout the history of HIS development in the United States, it can be roughly divided into three stages: the first decade focused on the development of hospital administrative functions, such as financial charge management, inpatient and outpatient management, etc. But until 1972 the United States still did not have a successful comprehensive computer system. In the second decade, while continuing to complete and implement hospital registration informatization, developers' efforts have entered the field of medical information processing. In the last ten years, researchers have focused on the process of miniaturization, intelligence, and integration of information systems.

  1. Related technology introduction
    1. J2EE technology

People can master many foreign languages, but what a computer scientist is proficient in is mostly programming languages, which are not human natural languages, such as C language, Java, Perl and so on. Since the "middleware" developed by different companies is not standardized enough, Sun launched J2EE and used this standard to solve the ills. It provides a good mechanism, allowing each layer to allow the corresponding server and components to run, making the system stable and usable, efficient in development, and easy to maintain.

    1. MVVM pattern

The MVVM model is a commonly used development model, which is mainly divided into M layer, V layer and C layer in terms of code implementation.

View (View) represents the user interaction interface. A web application may have many interfaces. In the MVVM mode, the view only deals with data collection, processing, and user requests, and does not include the processing of business processes and business processes. Handled by the Model.

Model (Model) is the processing of business processes/states and the formulation of business rules. The process of the model processing the business process cannot be seen by other layers. It is like a black box. After receiving the data requested by the view, it returns the final processing result. The main core of MVVM is the design of the business model. A typical application example is the popular EJB model. It further divides the model from the perspective of application technology implementation in order to make full use of existing components, but it cannot be used as a A framework for applying design models.

The controller (Controller) can be understood as receiving the user's request, and then the view and the model are matched together to complete the user's request together. It has a very obvious role in dividing the control layer, and can clearly tell you that it is a distributor, which model and view to choose, and what kind of request from the user can be completed. The control layer does not do all the data processing, for example: the user clicks a connection, after the control layer receives the request, it does not process the business information, it just transmits the user's information to the model, and tells the model what to do, and then chooses the one that meets the requirements The view is returned to the user.

    1. B/S structure

B/S (Browser/Server) is a more convenient architecture than its predecessor architecture. It uses the Web server to complete the data transfer and exchange. You only need to download the browser as the client, then the work will achieve a "slimming" effect, and there is no need to consider the problem of non-stop installation of software.

    1. Spring boot framework

The Spring framework is an open source application framework on the Java platform that provides a container with inversion of control features. Although the Spring framework itself has no restrictions on the programming model, its frequent use in Java applications made it so popular that it was later used as a supplement or even a substitute for the EJB (EnterpriseJavaBeans) model. The Spring framework provides a series of solutions for development, such as using the core features of inversion of control, and implementing inversion of control through dependency injection to realize the containerization of the management object life cycle, using aspect-oriented programming for declarative transaction management, and integrating A variety of persistence technologies manage data access, provide a large number of excellent web frameworks to facilitate development, and so on. The Spring framework has the feature of inversion of control (IOC). IOC is designed to facilitate project maintenance and testing. It provides a method for unified configuration and management of Java objects through the Java reflection mechanism. The Spring framework uses the container to manage the life cycle of objects. The container can configure objects by scanning XML files or specific Java annotations on classes. Developers can obtain objects through dependency lookup or dependency injection. Aspect Oriented Programming(AOP) framework, the Spring AOP framework is based on the proxy mode, and can be configured at runtime; the AOP framework is mainly modularized for the cross concerns between modules. The AOP framework of the Spring framework only provides basic AOP features. Although it cannot be compared with the AspectJ framework, it can also meet the basic needs through integration with AspectJ. Functions such as transaction management and remote access under the Spring framework can be realized by using Spring AOP technology. Spring's transaction management framework brings an abstraction mechanism to the Java platform that enables local and global transactions, as well as nested transactions, to work with savepoints and in almost any environment on the Java platform. Spring integrates multiple transaction templates. The system can configure transactions through transaction templates, XML or Java annotations, and the transaction framework integrates functions such as messaging and caching. Spring's data access framework addresses common difficulties developers encounter when using databases in their applications. It not only provides support for all popular data access frameworks such as Java: JDBC, iBATS/MyBATIs, Hibernate, Java Data Objects (JDO), ApacheOJB and Apache Cayne, but also can be used with Spring's transaction management to provide data access Flexible abstraction. The Spring framework initially did not intend to build its own Web MVC framework . During the development process, its developers believed that the separation between the presentation layer and the request processing layer of the existing Struts Web framework and between the request processing layer and the model was not enough, so they created Spring MVC.

    1. Mysql database

Mysql has been updated many times, and the functional level has been very rich and perfect. From Mysql4 version to 5 version, a relatively large update has been made, and it has achieved good practical application results in actual commercial use. The latest version of Mysql supports the compression of information, and at the same time, it can also perform encryption to better meet the needs of information security. At the same time, after multiple updates of the system, the mirroring function of the database itself has also been greatly enhanced, the smoothness of operation and ease of use have been greatly improved, and the use and creation of drivers are also more efficient and faster. The biggest change is the optimization of the display of spatial information, which makes it easier to label and calculate coordinates on the application map. The powerful backup function also ensures that users will feel more at ease during the use process, and the supported Office features also support users' self-installation and use. The display form of information has also been greatly updated, and two very useful display areas have been added, one is the information area, which has classified tables and text, and the display of the interface is more refreshing and specific. The second is the information control of the instrument, which can display information in the instrument information area and compare multiple information at the same time, which brings great convenience to the actual use of users.

In the actual implementation process of the hospital registration system designed in this paper, the main reason for choosing the Mysql database is that there will be a large number of databases that are frequently operated during the application and development of the enterprise application system, and the data security requirements It is also very high. Based on these factors, Mysql with a relatively high safety factor was finally selected to store the background data of the hospital registration system.

  1. system analysis
    1. Feasibility Analysis

In terms of technology, the current mainstream Springboot framework is used to build the main framework of the system. The front desk uses jquery and ajax to realize the design and aesthetic adjustment of the front page. The above technologies are all learned systematically by myself and practiced in course design It can make development more convenient and systematic. From a technical point of view, this system is completely achievable.

In terms of practicability, the main task of this design is to make registration appointments, doctor information inquiries, nucleic acid appointments, cancellation appointments, and medical information browsing in the hospital registration system, which is in line with the current trend of development. From the perspective of users, while also considering system operating costs and human resources, it adopts a convenient way on the Internet to realize online business, making the business process more systematic and more convenient for user experience, which is more practical.

In terms of economy, the main purpose of the hospital registration system designed in this project is to provide more convenient and fast information query and retrieval services, that is, information software that can be directly put into use. The main cost of the system is mainly concentrated on the operation of continuous maintenance and management update of the used data in the later period. However, once the system is put into actual operation and use, it can improve the efficiency of information query and retrieval. At the same time, it is also necessary to effectively ensure the security of the information of the inquirer. At the same time, the practical application brought by the hospital registration system The value of the software far exceeds the cost of developing and maintaining the actual system. Therefore, it is economically feasible to develop this software.

    1. Functional Requirements Analysis

The functions of the hospital registration system are mainly divided into front-end users registering and logging in according to their own needs, browsing doctor information and making registration appointments for selected doctors. The background system administrators are divided into doctors and administrators due to different responsibilities. Doctors mainly process registration appointment orders, while administrators mainly handle registered users, information data, department details, doctor details, registration appointments, nucleic acid appointments, Nucleic acid reports are managed.

The administrator use case diagram is shown below.

 

Figure 3-1 Administrator use case diagram

The user use case diagram is shown below.

 

Figure 3-1 User use case diagram

The doctor use case diagram is shown below.

 

Figure 3-1 Doctor use case diagram

      1. front-end user function

Foreground users can be divided into unregistered user needs and registered user needs.

The functions for unregistered users are as follows:

Account registration: The user fills in personal information and verifies the mobile phone number.

Browsing hospital information data: Users can browse the hospital information data on the main page to understand the latest hospital information data of the system.

Browse departments: Users can browse department information according to department type, and select a department to view details, such as department name, department category, department picture, etc.

Browse doctors: Users can browse doctor information according to doctor type, and select a doctor to view details, such as: doctor's name, gender, title, department, attending symptoms, photos, etc.

The functions for registered users are as follows:

Login: Log in according to the account password.

Maintain personal information: Users can modify their registration information at any time due to changes in personal information.

Registration appointment: The user selects a department doctor to release the number source according to his illness to make a registration appointment operation.

Registration cancellation: Users can submit registration cancellation applications according to their actual situation.

Nucleic acid appointment: users can make nucleic acid appointments online.

Nucleic acid report: Users can view personal nucleic acid test reports.

      1. Background administrator function

The background can be divided into doctors and administrators.

The doctor function is as follows.

Change password: Administrators can change their own login passwords to the system at any time to ensure system security.

Registration appointment management: process registration appointment information submitted by users.

For nucleic acid appointments: View nucleic acid appointment order information, handle appointment review, etc.

Patient Cases: Manage patient case information.

The administrator functions are as follows:

Change password: Administrators can change their own login passwords to the system at any time to ensure system security.

Processing of registration reservation information: handle registration reservation order review, etc.

Department information management: maintain department information, add, delete, and modify information.

Doctor information management: maintain doctor information, add, delete and modify information.

Patient case management: maintain patient cases, add, delete, and modify information.

Registration appointment management: for the registration and appointment processing submitted by the patient user system.

Registration cancellation management: review the registration cancellation submitted by the patient user system.

News information management: release and delete related news data information.

Nucleic acid report management: maintain and manage nucleic acid test report information.

    1. Non-Functional Requirements Analysis

The first thing to consider is the system function software. In terms of specific design, whether it can better meet the basic functional requirements of various users. If it cannot better meet the needs of users, then the existence of this system is worthless. The non-functional analysis of the software system is carried out from 7 aspects, one is performance analysis, which is aimed at the system; one is security analysis, which is aimed at the system; the other is integrity analysis, which is aimed at the system; It is scalability analysis, for the system, and the other is performance analysis to adapt to the business. In the face of the comprehensive comparison and analysis of the seven aspects of performance, security, expansion, and integrity of the hospital registration system, it is found that the corresponding non-functional requirements analysis is needed.

    1. Security Requirements Analysis
      1. system security

Security is very important to every system. A system with good security can protect enterprise information and user information from being stolen. Improving the security of the system is not only the responsibility of the user, but also the responsibility of the enterprise. Especially for the hospital registration system, there must be good security to protect the entire system.

The system has authority control for users, and limits the authority of users according to the role barriers, so as to ensure the security of the system.

      1. data security

The data in the database is input from the outside world. When the data is input, due to various reasons, the input data will be invalid or dirty. Therefore, how to ensure that the input data conforms to the regulations has become the primary concern of database systems, especially multi-user relational database systems.

Therefore, when writing to the database, data integrity, correctness, and consistency must be guaranteed.

    1. Data Flow Analysis

Analyze the data flow of the system, and the users of the system are divided into two categories, general users and administrators. The system mainly processes interface information transmission, login information verification, registration information reception, and user response to various operations.

The top-level data flow diagram of the system is shown in the figure below.

 

Figure 3-2 Top-level data flow diagram

To judge the identity of the user, it is judged according to the login data, and then jumps to the corresponding function interface. The internal users of the system can operate the data, and the database center can receive the effective data stream transmitted by the system to perform corresponding operations on the data SQL statements.

The underlying data flow diagram of the system is shown in the figure below.

 Figure 3-3 The underlying data flow diagram

 

The system can be divided into two parts, the foreground and the background. After each operation, the system returns the operation result. The data connection between the foreground and the background is mainly through the database, which means that different operations are performed on the database respectively.

  1. system design
    1. System architecture design

The architecture design of the hospital registration system is mainly divided into three layers, mainly including the Web layer, the business layer, and the Model layer. The web layer also includes the View layer and the Controller layer, and the Model layer includes the metadata extension layer and the data access layer.

The system architecture is shown in the figure below.

 

Figure 4-1 System architecture

    1. Overall System Design

The hospital registration system is generally divided into a front-end user module and a back-end administrator module.

The two modules appear to exist independently, but the accessed database is the same. The function of each module is made according to the previously completed demand analysis, and after consulting relevant materials.

To sum up, the functional structure diagram of the system is shown in the figure below.

Figure 4-2 System function structure diagram

 

    1. System function design

Information data module: It can be divided into three modules: information data browsing, information data retrieval, and information data maintenance. The administrator has the authority to maintain information data, release new information data, update existing information data, etc.

Department management module: Department management is divided into department addition, modification and department purchase. Department information is modified, added, and deleted by administrators; department purchases are performed by ordinary users.

Doctor management module: Doctor management is divided into doctor addition, modification and doctor online communication. The doctor's information is modified, added, and deleted by the administrator; the doctor's online communication is performed by ordinary users.

Registered medical treatment management module: appointment medical appointment management is divided into: addition, modification, and submission of medical appointments. After the user submits, the doctor can query it, and the background administrator will process the appointment.

    1. Database Design
      1. Data Requirements Analysis

From the previous analysis, the most important things in the database are doctor information, department information, registration appointment information, and patient information. The analysis can get the following data description:

Platform users: used to record various information of users, including user name, password, name, gender, address, email address, contact information and other data items.

Administrator: Record the login information of the administrator. Including user name, password, permissions and other data items.

Department: Department name, including data items such as department number, department category, and department picture.

Doctor: store various doctor information. Including data items such as doctor's job number, password, doctor's name, gender, professional title, department, attending symptoms, photos, whether to review or not.

Registration appointment: store the user's registration appointment information. Including data items such as the order number of the registered appointment, the doctor's job number, the name of the doctor, the category of the department, the date and time of the registration, the person who made the appointment, whether to pay, whether to review, and review reply.

It can be known from the demand analysis that we mainly create a complete class diagram based on the following objects: system administrator, patient, appointment, appointment order, doctor, department classification, patient than you, etc., as shown in Figure 4-3.

 

                     Figure 4-3 System Class Diagram

      1. Database conceptual design

According to the previous data flow chart, combined with the functional module design of the system, design each information entity that conforms to the system.

(1) The front-end user entity attribute diagram, as shown in Figure 4-4.

 

Figure 4-4 Front-end user entity attribute diagram

  1. The department entity attribute diagram is shown in Figure 4-5.

 

                      Figure 4-5 Department Entity Attribute Map

  1. The attribute diagram of the doctor entity is shown in Figure 4-6.

 

                         Figure 4-6 Physician entity attribute diagram

  1. The attribute diagram of the medical reservation entity is shown in Figure 4-7.

 

                         Figure 4-7 Entity attribute diagram for medical appointment

  1. The attribute map of the administrator entity is shown in Figure 4-8.

 

                         Figure 4-8 Administrator entity attribute map

  1. Figure 4-9 shows the attribute map of the canceled reservation entity.

 

                         Figure 4-9 Cancel reservation entity property diagram

  1. Entity relationship diagram, as shown in 4-10.

 

                         Figure 4-10 Entity connection diagram

  1. Based on the Springboot hospital registration system activity diagram, as shown in Figure 4-11.

 

                            Figure 4-11 System activity diagram

      1. database table design

The data tables owned by the hospital registration system are as follows: user information table, department information table, registration appointment table, doctor information table, hospital information table.

Due to the large number of data tables, only the main data tables of the system are displayed, as shown in the following table.

name

type

length

not null

primary key

note

group_id

mediumint

8

yes

yes

user group ID

display

smallint

4

yes

no

display order

name

varchar

16

yes

no

name

description

varchar

255

no

no

describe

source_table

varchar

255

no

no

Source table:

source_field

varchar

255

no

no

Source field:

source_id

int

10

yes

no

Source ID:

register

smallint

1

no

no

Registration location:

create_time

timestamp

0

yes

no

Creation time:

update_time

timestamp

0

yes

no

Update time:

name

type

length

not null

primary key

note

department_management_id

int

11

yes

yes

Department Management ID

department_name

varchar

64

no

no

Department name

department_number

varchar

64

yes

no

Department number

picture

varchar

255

no

no

picture

department_details

varchar

64

no

no

Department Details

department_director

int

11

no

no

Department director

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

notice_announcement_id

int

11

yes

yes

Notification Bulletin ID

title

varchar

64

no

no

title

content

text

0

no

no

content

release_date

date

0

no

no

release date

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

visit_appointment_id

int

11

yes

yes

Registration ID

visiting_doctor

int

11

no

no

Visiting doctor

department

varchar

64

no

no

Department

visit_time

varchar

64

no

no

Treatment time

registration_fee

int

11

no

no

Registration fee

remaining_number_source

int

11

no

no

remaining source

visits

varchar

64

no

no

Outpatient status

doctor_attending

text

0

no

no

attending doctor

job_number

varchar

64

no

no

Job number

examine_state

varchar

16

yes

no

Approval Status

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

doctor_information_id

int

11

yes

yes

Doctor Information ID

doctor

int

11

no

no

doctor

name_of_doctor

varchar

64

no

no

doctor name

doctor_photos

varchar

255

no

no

doctor photo

department

varchar

64

no

no

department

title

varchar

64

no

no

job title

visit_time

varchar

64

no

no

Visiting time

place_of_visit

varchar

64

no

no

Visiting location

doctor_profile

text

0

no

no

Doctor profile

hits

int

11

yes

no

hits

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

name

type

length

not null

primary key

note

Hospital information_id

int

11

yes

yes

Hospital Information ID

title

varchar

64

no

no

title

brief introduction

text

0

no

no

Introduction

recommend

int

11

yes

no

Intelligent Recommendation

create_time

datetime

0

yes

no

creation time

update_time

timestamp

0

yes

no

update time

  1. 系统实现
    1. 数据库访问层的实现

该系统是通过jdbc和MySQL达成连接的,新建一个jdbc.properties文件来填写与数据库连接所需要的驱动和参数。

jdbc.driverClass=com.MySQL.jdbc.Driver

jdbc.url=jdbc:MySQL://localhost:3306/tsi

jdbc.username=root

jdbc.password=123

第一个参数代表MySQL数据库的驱动,第二个参数代表要连接的数据库,第三个和第四个参数代表数据库连接名和密码。

后台与数据库访问主要是通过HQL语句来进行查询的,查询语句中的表名是表格的实体类名,在这种查询语句中*是不允许使用的,除非适合聚合函数一起使用才可以。

    1. 注册模块的实现

用户在填写数据的时候必须与注册页面上的验证相匹配否则会注册失败,注册页面的表单验证是通过JavaScript进行验证的,用户名的长度必须在6到18之间,邮箱必须带有@符号,密码和密码确认必须相同,你输入的密码,系统会根据你输入密码的强度给出指定的值,电话号码和身份证号码必须要求输入格式与生活相符合,当你前台验证通过的时候你点击注册,表单会将你输入的值通过name值传递给后台并保存到数据库中。

用户注册流程图如下图所示。

 

图5-1用户注册流程图

用户注册界面如下图所示。

 

图5-2用户注册界面

用户注册的关键代码如下。

/**

     * 注册

     * @param user

     * @return

     */

    @PostMapping("register")

    public Map<String, Object> signUp(@RequestBody User user) {

        // 查询用户

        Map<String, String> query = new HashMap<>();

        query.put("username",user.getUsername());

        List list = service.select(query, new HashMap<>()).getResultList();

        if (list.size()>0){

            return error(30000, "用户已存在");

        }

        user.setUserId(null);

        user.setPassword(service.encryption(user.getPassword()));

        service.save(user);

        return success(1);

}

/**

     * 用户ID:[0,8388607]用户获取其他与用户相关的数据

     */

    @Id

    @GeneratedValue(strategy = GenerationType.IDENTITY)

    @Column(name = "user_id")

    private Integer userId;

    /**

     * 账户状态:[0,10](1可用|2异常|3已冻结|4已注销)

     */

    @Basic

    @Column(name = "state")

    private Integer state;

    /**

     * 所在用户组:[0,32767]决定用户身份和权限

     */

    @Basic

    @Column(name = "user_group")

    private String userGroup;

    /**

     * 上次登录时间:

     */

    @Basic

    @Column(name = "login_time")

    private Timestamp loginTime;

    /**

     * 手机号码:[0,11]用户的手机号码,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "phone")

    private String phone;

    /**

     * 手机认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "phone_state")

    private Integer phoneState;

    /**

     * 用户名:[0,16]用户登录时所用的账户名称

     */

    @Basic

    @Column(name = "username")

    private String username;

    /**

     * 昵称:[0,16]

     */

    @Basic

    @Column(name = "nickname")

    private String nickname;

    /**

     * 密码:[0,32]用户登录所需的密码,由6-16位数字或英文组成

     */

    @Basic

    @Column(name = "password")

    private String password;

    /**

     * 邮箱:[0,64]用户的邮箱,用于找回密码时或登录时

     */

    @Basic

    @Column(name = "email")

    private String email;

    /**

     * 邮箱认证:[0,1](0未认证|1审核中|2已认证)

     */

    @Basic

    @Column(name = "email_state")

    private Integer emailState;

    /**

     * 头像地址:[0,255]

     */

    @Basic

    @Column(name = "avatar")

    private String avatar;

    /**

     * 创建时间:

     */

    @Basic

    @Column(name = "create_time")

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")

    private Timestamp createTime;

    @Basic

    @Transient

    private String code;

}

    1. 登录模块的实现

主要由两部分组成,登录前的登录界面以及登录后的用户功能界面。登录界面,要求用户输入用户名和密码,当用户名和密码其中一个输入为空时,给出提示“用户名,密码不能为空”。获取用户名和密码后到数据库中查找,如果用户名存在,以及对应的密码正确,则登录成功,否则登录失败。登录失败后给出提示,并把焦点停在文本框中。登录成功后将该次会话的全局变量username设置为用户名。登录成功后进入会员的功能模块,主要有会员基本信息修改,已经发布药品信息管理,发布信息,和退出功能。退出功能是清除全局变量username的值,并跳回到首页。

登录流程图如下图所示。

 

图5-3登录流程图

用户登录界面如下图所示。

 

图5-4用户登录界面

用户登录的关键代码如下。

/**

     * 登录

     * @param data

     * @param httpServletRequest

     * @return

     */

    @PostMapping("login")

    public Map<String, Object> login(@RequestBody Map<String, String> data, HttpServletRequest httpServletRequest) {

        log.info("[执行登录接口]");

        String username = data.get("username");

        String email = data.get("email");

        String phone = data.get("phone");

        String password = data.get("password");

        List resultList = null;

        Map<String, String> map = new HashMap<>();

        if(username != null && "".equals(username) == false){

            map.put("username", username);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(email != null && "".equals(email) == false){

            map.put("email", email);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }

        else if(phone != null && "".equals(phone) == false){

            map.put("phone", phone);

            resultList = service.select(map, new HashMap<>()).getResultList();

        }else{

            return error(30000, "账号或密码不能为空");

        }

        if (resultList == null || password == null) {

            return error(30000, "账号或密码不能为空");

        }

        //判断是否有这个用户

        if (resultList.size()<=0){

            return error(30000,"用户不存在");

        }

        User byUsername = (User) resultList.get(0);

        Map<String, String> groupMap = new HashMap<>();

        groupMap.put("name",byUsername.getUserGroup());

        List groupList = userGroupService.select(groupMap, new HashMap<>()).getResultList();

        if (groupList.size()<1){

            return error(30000,"用户组不存在");

        }

        UserGroup userGroup = (UserGroup) groupList.get(0);

        //查询用户审核状态

        if (!StringUtils.isEmpty(userGroup.getSourceTable())){

            String sql = "select examine_state from "+ userGroup.getSourceTable() +" WHERE user_id = " + byUsername.getUserId();

            String res = String.valueOf(service.runCountSql(sql).getSingleResult());

            if (res==null){

                return error(30000,"用户不存在");

            }

            if (!res.equals("已通过")){

                return error(30000,"该用户审核未通过");

            }

        }

        //查询用户状态

        if (byUsername.getState()!=1){

            return error(30000,"用户非可用状态,不能登录");

        }

        String md5password = service.encryption(password);

        if (byUsername.getPassword().equals(md5password)) {

            // 存储Token到数据库

            AccessToken accessToken = new AccessToken();

            accessToken.setToken(UUID.randomUUID().toString().replaceAll("-", ""));

            accessToken.setUser_id(byUsername.getUserId());

            tokenService.save(accessToken);

            // 返回用户信息

            JSONObject user = JSONObject.parseObject(JSONObject.toJSONString(byUsername));

            user.put("token", accessToken.getToken());

            JSONObject ret = new JSONObject();

            ret.put("obj",user);

            return success(ret);

        } else {

            return error(30000, "账号或密码不正确");

        }

}

    1. 用户资料修改模块的实现

用户登录/注册成功之后可以修改自己的基本信息。修改页面的表单中每一个input的name值都要与实体类中的参数相匹配,在用户点击修改页面的时候,如果改后用户名与数据库里面重复了,页面会提示该用户名已经存在了,否则通过Id来查询用户,并将用户的信息修改为表单提交的数据。

    1. 科室信息模块的实现

如果科室信息的信息需要修改,管理员可以通过查询科室的基本信息来查询科室信息,查询科室信息是通过ajax技术来进行查询的,需要传递科室名称、编号等参数然后在返回到该页面中,可以选中要修改或删除的那条信息,如果选中了超过一条数据,页面会挑一个窗口提醒只能选择一条数,如果没有选中数据会挑一个窗口题型必须选择一条数据。当选择确认修改的时候,后台会根据传过来的id到数据库查询,并将结果返回到修改页面中,可以在修改页面中修改刚刚选中的信息当点击确认的时候from表单会将修改的数据提交到后台并保存到数据库中,就是说如果提交的数据数据库中存在就修改,否则就保存。

科室信息展示界面如下图所示。

 

图5-5科室信息展示界面

科室信息的关键代码如下。

 @PostMapping("/add")

    @Transactional

    public Map<String, Object> add(HttpServletRequest request) throws IOException {

        service.insert(service.readBody(request.getReader()));

        return success(1);

    }

    @Transactional

    public Map<String, Object> addMap(Map<String,Object> map){

        service.insert(map);

        return success(1);

}

    public Map<String,Object> readBody(BufferedReader reader){

        BufferedReader br = null;

        StringBuilder sb = new StringBuilder("");

        try{

            br = reader;

            String str;

            while ((str = br.readLine()) != null){

                sb.append(str);

            }

            br.close();

            String json = sb.toString();

            return JSONObject.parseObject(json, Map.class);

        }catch (IOException e){

            e.printStackTrace();

        }finally{

            if (null != br){

                try{

                    br.close();

                }catch (IOException e){

                    e.printStackTrace();

                }

            }

        }

        return null;

}

    public void insert(Map<String,Object> body){

        StringBuffer sql = new StringBuffer("INSERT INTO ");

        sql.append("`").append(table).append("`").append(" (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            sql.append("`"+humpToLine(entry.getKey())+"`").append(",");

        }

        sql.deleteCharAt(sql.length()-1);

        sql.append(") VALUES (");

        for (Map.Entry<String,Object> entry:body.entrySet()){

            Object value = entry.getValue();

            if (value instanceof String){

                sql.append("'").append(entry.getValue()).append("'").append(",");

            }else {

                sql.append(entry.getValue()).append(",");

            }

        }

        sql.deleteCharAt(sql.length() - 1);

        sql.append(")");

        log.info("[{}] - 插入操作:{}",table,sql);

        Query query = runCountSql(sql.toString());

        query.executeUpdate();

    }

    1. 评论模块的实现

用户可以发表自己的评论。将页面session中的用户账号userId和发表评论文字框内容传入控制层PinlunAction,调用addPinlun方法,通过PinlunDAOImp向数据库评论表插入,将结果返回lyb.jsp界面。

评论添加流程图如下图所示。

 

图5-1评论添加流程图

    1. 挂号预约模块的实现

挂号预约功能需要考虑高并发,防止出现挂号重复预约、挂号状态显示出错等情况,特预约这一共享数据增加锁机制。在乐观锁、悲观锁以及线程锁中,综合考虑性能效率和错误的可接受性选择了乐观锁机制。乐观锁的实现方式是使用版本标识来确定读到的数据与提交时的数据是否一致,提交后修改版本标识,不一致时可以采取丢弃和再次尝试的策略。在数据库预约表(对应号源)设计中增加了version字段,每次数据提交时(更改号源状态)会判断version是否匹配,若不匹配停止本次提交,若匹配则提交成功并增加version的值。

挂号预约功能整体流程:用户浏览号源信息时,同时会显示状态,系统会在其显示详细信息的页面时便会判断号源的状态,若号源状态为可预约,则会显示预约的链接按钮。在用户点击预约按钮时,会先通过拦截器判断用户是否登录,若未登录,会跳转至登录页面,提示用户先登录,若为登录用户就会跳转至填写预约信息的页面,填写好预约信息之后,点击提交按钮,预约成功之后返回提示信息,告知用户预约成功。

挂号预约流程图如下图所示。

 

图5-1挂号预约流程图

挂号预约界面如下图所示。

 

图5-1挂号预约界面

挂号预约关键代码如下。

@RequestMapping(value = {"/avg_group", "/avg"})

public Map<String, Object> avg(HttpServletRequest request) {

        Query count = service.avg(service.readQuery(request), service.readConfig(request));

        return success(count.getResultList());

}

    1. 医生管理模块的实现

根据需求,需要对医生进行添加、删除或修改详情信息。删除或修改医生时,系统根据医生的状态判定为可删除状态下,才会给出删除和修改链接,点击删除链接按钮时,请求到达后台,还会先查询医生状态再次做出判定能否删除。点击修改链接按钮时,会跳转到修改信息的页面,重新填写好数据后,数据提交到后台会对数据库中相应的记录做出修改。

添加医生时,会给出数据填写的页面,该页面根据填写好的医生编号同样会事先发送Ajax请求查询编号是否已存在,数据填写好之后提交到后台,会调用相关服务在数据库中插入记录。

医生管理流程图如下图所示。

 

图5-1医生管理流程图

医生管理页面设计效果如下图所示。

 

图5-1医生管理界面

医生管理的关键代码如下。

@RequestMapping("/get_list")

    public Map<String, Object> getList(HttpServletRequest request) {

        Map<String, Object> map = service.selectToPage(service.readQuery(request), service.readConfig(request));

        return success(map);

}

  1. 系统测试
    1. 测试目的

对任何系统而言,测试都是必不可少的环节,测试可以发现系统存在的很多问题,所有的软件上线之前,都应该进行充足的测试之后才能保证上线后不会Bug频发,或者是功能不满足需求等问题的发生。下面分别从单元测试,功能测试和用例测试来对系统进行测试以保证系统的稳定性和可靠性。

    1. 功能测试

下表是科室管理功能的测试用例,检测了科室管理中对科室信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-1 科室管理的测试用例

功能描述

用于科室管理

测试目的

检测科室管理时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加科室,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加科室,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改科室,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改科室,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除科室,选择科室删除

提示删除成功

与预期结果一致

点击搜索科室,输入存在的科室名

查找出科室

与预期结果一致

点击搜索科室,输入不存在的科室名

不显示科室

与预期结果一致

下表是医生管理功能的测试用例,检测了医生管理中对医生信息的增加,删除,修改,查询操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-2 医生管理的测试用例

功能描述

用于医生管理

测试目的

检测医生管理时的各种操作的运行情况

测试数据以及操作

预期结果

实际结果

点击添加医生,必填项合法输入,点击保存

提示添加成功

与预期结果一致

点击添加医生,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击修改医生,必填项修改为空,点击保存

提示必填项不能为空

与预期结果一致

点击修改医生,必填项输入不合法,点击保存

提示必填项不能为空

与预期结果一致

点击删除医生,选择医生删除

提示删除成功

与预期结果一致

点击搜索医生,输入存在的医生名

查找出医生

与预期结果一致

点击搜索医生,输入不存在的医生名

不显示医生

与预期结果一致

下表是挂号预约管理功能的测试用例,检测了挂号预约管理中购药订单的操作是否成功运行。观察系统的响应情况,得出该功能也达到了设计目标,系统运行正确。

前置条件;用户登录系统。

表6-3 挂号预约管理的测试用例

功能描述

用于挂号预约管理

测试目的

检测挂号预约管理时各种操作的情况

测试数据以及操作

预期结果

实际结果

未选择药品,点击提交

提示请选择药品

与预期结果一致

未输入数量,点击提交

提示请输入数量

与预期结果一致

未输入时间,点击提交

提示请输入时间

与预期结果一致

    1. 性能测试

使用阿里云PTS(Performance Testing Service)性能测试服务对线上系统进行压力测试。线上服务器环境为:1核心CPU,1G内存,1Mbps公网带宽,Centos7.0操作系统。

压测过程中使用了2台并发机器,每台机器20个用户并发,对系统主页,登录,数据查询和数据维护等模块进行并发访问,测试结果是有40个用户并发时,数据管理相关页面的响应时间甚至达到了7s,通过查看服务器出网流量发现已经达到1381kb/s,可以看出服务器的带宽已经达到峰值,如果系统使用5Mbps的带宽,系统的响应时间和TPS将会大大增加。在整个测试的过程中,CPU的使用率占用仅8%,也提现出带宽瓶颈对系统的影响非常严重。

  1. 总结与展望

随着计算机互联网技术的迅猛发展,各行各业都已经实现采用计算机相关技术对日益放大的数据进行管理。该课题是医院挂号为核心展开的,主要是为了实现线上医疗信息化管理的需求。

医院挂号系统的开发是以Java编程语言作为基础,在Myeclipse平台上完成编码工作,系统整体为B/S架构,数据库系统使用MySQL。文中详细分析了医院挂号系统的研究背景、研究目的和意义、开发工具和相关技术以及系统需求、系统详细设计和系统测试等等一系列内容。系统实现了医院挂号系统所需的一些基本功能,并通过测试对这些实现的功能进行了完善,进而提高了系统整体的实用性。整个系统的开发过程中大量使用了Java相关的知识以及前端采用了比较流行的渐进式JavaScript框架Vue.js,同时涉及到了很多开源框架和组件,例如后台后端部分,采用Springboot作为开发框架,同时集成MyBatis、Redis等相关技术实现。

系统投入运行时,各功能均运行正常。系统的每个界面的操作符合常规逻辑,对使用者来说操作简单,界面友好。整个系统的各个功能设计合理,体现了人性化。但是由于自己在系统开发过程中对一些用到的相关知识和技术掌握不够牢固,再加上自身开发经验欠缺,因此系统在有些方面的功能还不够完善,考虑的不够全面,因此整个系统还有待日后逐步完善。

参考文献

[1]刘新宇,易蕾香,肖斌斌,赵军霞.期末在线测评系统的设计与实现[J].现代信息科技,2020,4(02):1-3.

[1]孙剑,程建军.基于微信小程序的医院远程挂号系统设计[J].电子设计工程,2021,29(22):51-54.DOI:10.14022/j.issn1674-6236.2021.22.012.

[2]邢娜,郑蕾,王莉.医院网站预约挂号系统设计[J].解放军医院管理杂志,2021,28(10):929-930+969.DOI:10.16770/J.cnki.1008-9985.2021.10.012.

[3]晏合虎,张吉珂,陈虹全.浅析医院“号贩子”乱象整治与思考[J].现代医院,2021,21(10):1498-1501+1505.

[4]陶博,杨妍,王琳,王胤涛,王昆华.基于贝叶斯理论的医院预约挂号反黄牛机制研究[J].现代医药卫生,2021,37(18):3094-3097.

[5]肖扩礼.基于微信公众平台的医院预约挂号服务技术系统的实现路径研究[J].中国设备工程,2021(18):184-185.

[6]常佳宁,潘琳.一种基于Web的医院挂号系统设计[J].中国科技信息,2021(16):45-46.

[7]刘艳,王悦悦,吴丹,宁飘婷,李春燕,王宇博. Application Analysis of Appointment Registration in Hospital Queuing System during the Epidemic[J]. 应用数学进展,2021,10(06):

[8]徐安琪,韩娇娇,徐一涵,范春.智慧医院建设与规划研究[J].医学信息学杂志,2021,42(05):56-60+78.

[9]叶基林. 某医院挂号预约管理系统设计与实现[D].电子科技大学,2021.DOI:10.27005/d.cnki.gdzku.2021.002694.

[10]李慧宁,王文军.基于JavaWeb的医院在线挂号系统设计与实现[J].电子元器件与信息技术,2021,5(02):172-175.DOI:10.19772/j.cnki.2096-4455.2021.2.076.

[11]卢鹏章.数据分析系统在医院信息系统中的应用[J].信息与电脑(理论版),2020,32(22):27-29.

[12]王丽娜,李伟庆.基于共现网络的互联网就医研究现状分析[J].电脑知识与技术,2020,16(30):47-49.DOI:10.14004/j.cnki.ckt.2020.3067.

[13]宗金运,芦立华,姬庆,石静,金彦.医院智能挂号系统的设计和实现[J].福建电脑,2020,36(08):1-9.DOI:10.16707/j.cnki.fjpc.2020.08.001.

[14] Computers; Research from Peking Union Medical College Hospital Yields New Findings on Computers (Generation of a local lung respiratory motion model using a weighted sparse algorithm and motion prior-based registration)[J]. Journal of Mathematics,2020:

[15]张玉芬.现代化医院电子信息工程建设与应用管窥[J].电子元器件与信息技术,2020,4(04):101-102+119.DOI:10.19772/j.cnki.2096-4455.2020.4.039.

[16]卢友传,周建设,俞威英.门诊诊间挂号报到系统的设计与应用[J].电子技术与软件工程,2020(08):28-29.

[17]顾绍君.自助挂号收费系统在医院的应用浅谈[J].行政事业资产与财务,2019(24):81+72.

致谢

This design took 3 months. In this graduation project, it is inseparable from the guidance of the instructor to make things go smoothly. The instructor has given me a lot of help both in the graduation design experience and in the completion of the thesis. On the other hand, I have benefited a lot from the teacher's serious and responsible work attitude, prudent teaching spirit and strong theoretical level. His diligent and cautious attitude towards teaching and educating people also left me with a particularly deep feeling. I have learned a lot from my teachers. In theory and practice, my skills have been greatly improved. Here, I would like to express my heartfelt gratitude to the teachers.

After all the research and development of this graduation project, my system research and development has experienced a special progress from requirement analysis to realization of detailed functions, to final testing and maintenance. Let me have a deeper understanding of system development. Now my hands-on ability and ability to deal with doubts alone have also gained a particularly large increase in practice and learning. This is the best harvest of this graduation project.

Finally, during the whole system development process, the classmates and friends around me gave me a lot of opinions, so I quickly confirmed the business idea of ​​the system. Here, I sincerely express my gratitude to them.

Like+Favorite+Follow → private message to receive the source code and database

Guess you like

Origin blog.csdn.net/weixin_61498557/article/details/130962147