Analysis of the Impact of China’s Hierarchical Medical System and Online Appointment Diagnosis System on the Sustainable Development of Public Health: A Case Study of Shanghai

: In the study of the sustainable development of public health in China, academic circles have little to do with the unique hierarchical medical system and online appointment diagnosis system in China’s medical system. Therefore, based on the medical situation in Shanghai, China, in addition to the traditional dimension of medical expenses, this paper fully considers the impact of the current hierarchical medical policy, constructs a selection model for medical treatment behavior under the hierarchical medical system and online appointment diagnosis system, and carries out simulation analysis through the cellular automata grid dynamic model. This paper ﬁnds that the time-cost-oriented medical treatment behavior of Chinese patients will have di ﬀ erent distribution under the current hierarchical medical system and online appointment diagnosis system. (1) When the medical treatment system neither allows online appointment nor referral, a large number of patients congregated in high-grade hospitals, with the most unreasonable distribution. (2) With the implementation of the system of allowing referral and online appointment, patients are gradually diverted to lower-grade hospitals or o ﬀ -peak hours, and the distribution is relatively improved. (3) If the medical treatment system allows both referral and online appointment, the distribution of patients is the most reasonable. Therefore, China’s current hierarchical medical system and online appointment diagnosis system will, to a considerable extent, become a policy tool that a ﬀ ects patients’ choice of hospitals and an e ﬀ ective means to achieve the rational allocation of existing medical resources, which will play an important role in the sustainable development of public health in China.


Introduction
In 2018, the total number of instances of people using medical and health institutions in China has reached 8.31 billion, an increase of 130 million over the previous year [1], which has put great pressure on medical institutions. In order to improve the level of medical treatment and promote the sustainable development of public health, the State Council further deepened the reform of the medical and health system implemented since 2009 and improved the hierarchical medical system and online appointment diagnosis system [2][3][4].
Today, the public health system in China faces problems, such as huge differences between urban and rural areas and low level of health service technology. It is necessary to continuously improve the technical level of health services, while diversifying and promoting the level and quality of health services, in order to meet the needs of people for sustainable development of public health in China.
of health services, in order to meet the needs of people for sustainable development of public health in China.
The Chinese government is committed to improving the health and quality of life of the entire population, comprehensively improving the level of health services and health protection, and striving to build a highly efficient and sustainable health service and public health system [5]. However, in terms of medical services, China has not yet formed a reasonable medical order. Most patients and medical treatments are concentrated in large hospitals, which requires the medical resources to be further rationally allocated. Therefore, the establishment and improvement of the hierarchical medical system is imperative for the sustainable development of public health in China.
China's hierarchical medical system classifies patients according to their disease severity and treatment difficulty, so that different levels of medical institutions can undertake the diagnosis and treatment of their own treatment capabilities to gradually realize the specialization of medical institutions at all levels, and effectively balance various medical service resources; divert the general outpatient, rehabilitation, and nursing care undertaken by the original large and medium-sized medical institutions to the primary medical institutions; and form a system of "primary diagnosis, two-way referral, rapid division and treatment, and up and down linkage" (see Figure 1) [6,7]. (1) "Primary diagnosis" refers to use policy guidance to encourage patients with common diseases and frequently occurring diseases to seek medical treatment at the primary-level medical and health care institutions through policy guidance. If the insured patients of urban and rural residents need to be hospitalized, the first diagnosis place should be the nearest first-class-designated medical institution. If the disease is not cured, patients should be transferred to the second-classdesignated medical institution. If the condition is still not alleviated, patients should continue to be transferred to the third-class designated medical institution for treatment [8,9].
(2) "Two-way referral" refers to the gradual realization of orderly referral between different levels and categories of medical institutions by improving referral procedures, focusing on unblocking the downward referral of patients in the chronic period and recovery period. On the one hand, in the first-class medical institution, after the first-time diagnosis, there are some situations like (1) "Primary diagnosis" refers to use policy guidance to encourage patients with common diseases and frequently occurring diseases to seek medical treatment at the primary-level medical and health care institutions through policy guidance. If the insured patients of urban and rural residents need to be hospitalized, the first diagnosis place should be the nearest first-class-designated medical institution. If the disease is not cured, patients should be transferred to the second-class-designated medical institution. If the condition is still not alleviated, patients should continue to be transferred to the third-class designated medical institution for treatment [8,9].
(2) "Two-way referral" refers to the gradual realization of orderly referral between different levels and categories of medical institutions by improving referral procedures, focusing on unblocking the downward referral of patients in the chronic period and recovery period. On the one hand, in the first-class medical institution, after the first-time diagnosis, there are some situations like emergency cases that are difficult to treat, the incurable diseases that cannot be treated, and the cases that cannot be disposed of due to technical or equipment limitations. All of these can be directly referred to the higher-level medical institutions. On the other hand, after receiving treatment at a higher-level medical institution, cases of acute-disease patients with stable disease and advanced non-surgical treatment of patients with malignant tumors can be transferred to lower-level medical institutions for further rehabilitation [10,11].
(3) "Rapid division and treatment" refers to the transfer of patients who have passed the acute period from a third-class hospital and the implementation of the acute and chronic disease diagnosis and treatment services of all kinds of medical institutions at all levels by improving the subacute and chronic disease service system and implementing hierarchical medical treatment according to the severity of the disease and the difficulty of treatment. The first-class medical institutions are mainly responsible for the diagnosis and treatment of common diseases and frequently occurring diseases and the first-class technology, as well as low risk and simple operation. The second-class hospitals are mainly responsible for the diagnosis and treatment of specialized diseases, the second-and third-level technology, and medium-risk and complex operation. The third-class hospitals are mainly responsible for the diagnosis and treatment of sub-specialized diseases and difficult and miscellaneous diseases, as well as the third-and fourth-level technology, and high-risk and complex operation [12,13].
(4) "Up and down linkage" establishes a division of labor and cooperation mechanism among medical institutions to promote the vertical flow of high-quality medical resources. Following this requirement, hospitals at all levels should break the original administrative affiliation and make layout according to the needs of residents. A linkage and cooperation mechanism with one or two tertiary public hospitals as the core and other hospitals and community health service institutions as the cooperative units should be established in each area [14,15].
On the basis of the construction of a hierarchical medical system, China further strengthens the appointment diagnosis, especially the online appointment diagnosis system [16][17][18]. In September 2009, the Ministry of Health issued its opinions on the implementation of appointment diagnosis and treatment services in public hospitals, which requires all public hospitals to fully implement appointment diagnosis policy and vigorously build the online appointment diagnosis and real-name appointment system of hospitals at all levels [19]. These measures are helpful to alleviate the pressure of medical treatment, cooperate with the hierarchical medical system, and finally promote the sustainable development of public health [20][21][22][23].
In the field of public health sustainable development, scholars are increasingly concerned with how to ensure patients can quickly obtain the desired high-quality health services in the context of the general rise in medical expenditures [24][25][26][27]. Therefore, the hierarchical medical policy of a national or regional medical service system is now a hot topic in academic circles [28][29][30][31][32].
For example, Wang et al. analyzed the hierarchical medical system in China from the perspective of big data and mobile Internet. By constructed the innovative strategic choice model and data sharing and processing system, they explored the solution to biased resource allocation and high patient flows to large hospitals in China. Their results showed that it is highly feasible to improve the efficiency of the hierarchical medical system in China, with the hierarchical medical platform sharing the medical big data, and the mobile application system using the system dynamics structure [33]. Pan et al. focused on the unbalanced demand between general hospitals and community healthcare centers in a hierarchical healthcare system. They obtained the optimal booking limits policy by a dynamic programming approach. They also proved that their booking limits policy is better than the widely used ones between early low-priority patients and potential future higher priority patients [34]. Ren et al. constructed a thermodynamics model to evaluate the stability of the hierarchical medical system in China. They furtherly combined the weighted averaging operator and the TOPSIS method to simulate the medical system in West China Hospital. They showed that the thermodynamics model clearly portrays the fuzziness of the hierarchical medical system in China and reflected the quantity and the quality of decision process [35]. Zheng et al. established a new evaluation indicator system for hierarchical medical policies based on observation time. After analyzing three hierarchical medical policies proposals from existing studies, they further constructed a decision matrix for policy analysis.
They demonstrated that this new method can depict the interdependence relationship among the evaluation criteria of hierarchical medical policies and has a wider range of applications to solve the practical problems of the hierarchical medical system [36]. Sun et al. took Tianjin city as research example to study the organizational structure of the hierarchical medical system in China. By Voronoi diagrams and interpolation analysis, they measured different levels and the corresponding efficiencies of medical services in China's hierarchical medical system. They found that, although the overall service performance in Tianjin is excellent, there are still several deficiencies in the whole system. Therefore, they finally suggested increasing the number of medical institutions in specific regions near the edge of Tianjin to improve the efficiency of the hierarchical medical system [37].
However, in the context of the relative shortage of medical and health resources, and the fragmentation of medical institutions, as well as the growing demand for public health, the existing research has not clearly demonstrated how China should use the hierarchical medical system and online appointment diagnosis system to meet the needs of different stakeholders and enhance the important issue of the division of labor between medical institutions. Therefore, it is necessary to theoretically and scientifically analyze the influencing mechanism of patients' choice of medical behavior under the hierarchical medical system and take effective measures to improve the unreasonable distribution of medical behavior [38].
Hence, this research on the hierarchical medical system and online appointment diagnosis system may have important implications for sustainable development of public health in China.
First, it will help optimize the allocation of medical resources, make better use of existing medical resources to improve people's health, and make up for the uneven distribution and the uneven medical level of existing medical institutions in China.
Second, the efficient utilization of the hierarchical medical system will reduce the pressure on senior medical institutions to diagnose and treat basic diseases, so that they can concentrate their resources on overcoming those intractable diseases. The level of diagnosis and treatment of the public health system in China will be improved.
Finally, the efficient utilization of the online appointment diagnosis system will greatly save human and material resources of medical institutions at all levels and create a good medical environment for patients. The efficiency of the diagnosis and treatment system in China will also be improved.
For this reason, based on the actual situation of the hierarchical medical system and online appointment diagnosis system in China, this paper selects the second-class medical institutions in cities as the modeling object and constructs a behavior choice model under the hierarchical medical system. On this basis, this paper further uses cellular automata to build a grid dynamic model to analyze the online appointment diagnosis system. Based on the above analysis and the policy simulation of the medical situation in Shanghai, this paper depicts the impact of hierarchical medical and online appointment diagnosis policies on patients' choice of medical treatment and gives corresponding suggestions for using the above policies to better promote the future sustainable development of public health in China.

Basic Hypotheses of the Model
It is assumed that a large city has a second-class medical system, including primary medical institution A and superior medical institution B. Patients are located in different areas of the city and can only choose medical institutions between A and B. All patients are treated with the shortest time required for healing, and their individual utility function is a decreasing function with healing time as an independent variable. The utility function of the whole medical system is a decreasing function with the average healing time of all patients as the independent variable. The strategic behavior of different patients is affected by region, and patients will compare the effectiveness of the entire medical system in society according to their actual utility, which will affect the strategic behavior of patients in the same region.
Based on existing literature, we first should make some necessary hypotheses about the cities and medical institutions they live in, before specifically studying the patient's behavior. [39][40][41] (1) The distribution of residents in cities is evenly distributed.

Hypothesis about Ideal Cities
(2) The time required for residents to move from one place to another in an urban area is completely proportional to the linear distance between the two places. (3) The prevalence rate of residents in different areas is the same. [42][43][44] (1) The medical institutions of the same level have the same service capacity-cure rate, cure time, hospitalization speed, service radius, etc. (2) All areas of the city are covered by the services of at least one grassroots medical institution or one superior medical institution.

Hypothesis about the Medical Systems
Based on the above hypotheses about the medical systems, the distribution of medical institutions in the city is shown in Figure 2.
Sustainability 2018, 10, x FOR PEER REVIEW 5 of 26 medical system in society according to their actual utility, which will affect the strategic behavior of patients in the same region. Based on existing literature, we first should make some necessary hypotheses about the cities and medical institutions they live in, before specifically studying the patient's behavior. [39][40][41] (1) The distribution of residents in cities is evenly distributed.

Hypothesis about Ideal Cities
(2) The time required for residents to move from one place to another in an urban area is completely proportional to the linear distance between the two places. (3) The prevalence rate of residents in different areas is the same. [42][43][44] (1) The medical institutions of the same level have the same service capacity-cure rate, cure time, hospitalization speed, service radius, etc. (2) All areas of the city are covered by the services of at least one grassroots medical institution or one superior medical institution.

Hypothesis about the Medical Systems
Based on the above hypotheses about the medical systems, the distribution of medical institutions in the city is shown in Figure.  Based on the efficiency requirements of land use value in China's urban planning [45,46], we hypothesize that (3) The location of the superior medical institution can be nested into the location of the subordinate medical institution and the ratio of the two is 1:8.
From the above hypotheses, we can see that the ideal model of the urban second-class medical system is highly symmetrical, so we can deduce the results of the entire urban model by studying only one small region (see Figure 3). Based on the efficiency requirements of land use value in China's urban planning [45,46], we hypothesize that (3) The location of the superior medical institution can be nested into the location of the subordinate medical institution and the ratio of the two is 1:8.
From the above hypotheses, we can see that the ideal model of the urban second-class medical system is highly symmetrical, so we can deduce the results of the entire urban model by studying only one small region (see Figure 3).   [47][48][49] (1) After the patient becomes ill, according to his (her) own region, the choice of whether or not to seek medical treatment in the nearest region should be made in line with the medical treatment experience among other residents in the region. (2) After selecting the medical treatment location, the patient can choose whether to make an online appointment or not. (3) The patient cannot know the healing capability of the subordinate medical institutions for his (her) own disease but can feel whether he (she) is cured. (4) The patient suffers from a mild but urgent disease, that is, the condition will not change in a short time, but the patient hopes to be cured immediately after the disease. [50][51][52] (1) The cure rate of the subordinate medical institutions was P and < 1, and there was no misdiagnosis rate. (2) If the referral is supported by the medical institution, and the referral patient has certain priority.

Analysis of the Patients' Medical Service-Seeking Behaviors
In the process of seeking medical treatment, the action set of the patient's medical behavior is as follows: {go to the nearest hospital, select the superior medical institution for medical treatment, make an appointment for registration before going to medical institution, and register after arriving at the medical institution}. However, since the time-benefit function in the process of medical treatment depends to a large extent on the diagnosis and treatment model formulated by the medical institutions, we have the following classified discussion on whether the medical institutions support referral and appointment:

The Medical Treatment System Does Not Support Referral or Online Appointment
This kind of medical system is the most primitive one. There is no contact between different medical institutions. Once a patient is judged unable to be treated, he (she) needs to enter the superior medical institutions to wait in line again. In this condition, the patient's behavior set is to choose the superior medical institution or the subordinate medical institution, but since the subordinate medical  [47][48][49] (1) After the patient becomes ill, according to his (her) own region, the choice of whether or not to seek medical treatment in the nearest region should be made in line with the medical treatment experience among other residents in the region. (2) After selecting the medical treatment location, the patient can choose whether to make an online appointment or not. (3) The patient cannot know the healing capability of the subordinate medical institutions for his (her) own disease but can feel whether he (she) is cured. (4) The patient suffers from a mild but urgent disease, that is, the condition will not change in a short time, but the patient hopes to be cured immediately after the disease. [50][51][52] (1) The cure rate of the subordinate medical institutions was P and p < 1, and there was no misdiagnosis rate. (2) If the referral is supported by the medical institution, and the referral patient has certain priority.

Analysis of the Patients' Medical Service-Seeking Behaviors
In the process of seeking medical treatment, the action set of the patient's medical behavior is as follows: {go to the nearest hospital, select the superior medical institution for medical treatment, make an appointment for registration before going to medical institution, and register after arriving at the medical institution}. However, since the time-benefit function in the process of medical treatment depends to a large extent on the diagnosis and treatment model formulated by the medical institutions, we have the following classified discussion on whether the medical institutions support referral and appointment:

The Medical Treatment System Does Not Support Referral or Online Appointment
This kind of medical system is the most primitive one. There is no contact between different medical institutions. Once a patient is judged unable to be treated, he (she) needs to enter the superior medical institutions to wait in line again. In this condition, the patient's behavior set is to choose the superior medical institution or the subordinate medical institution, but since the subordinate medical hospital cannot guarantee to cure the patient, the patient needs to make a medical service-seeking choice according to the different time consumption and the possible second waiting time.
Since the competition between the two behaviors is not very straightforward, it is necessary to pre-calculate the time costs of the two behaviors of the patients under this medical system, so as to obtain the advantages and disadvantages of the two behaviors more intuitively. First, we consider the choice of the patient in superior medical institution, the steps in the medical treatment can be considered as go to the superior medical institution first, queue up for medical treatment next, and return home. It can be concluded that the time cost of selecting a superior medical institution is as follows: Among them, t A is the total time cost for patients who choose the superior medical institution and S A and v are the distance from the patient to the superior medical institution and the travel speed of the urban residents respectively. The time cost of the round trip to the medical institution is 2S A v , the queuing time cost in the superior medical institution t waitA , and the treatment time cost t H .
Then, we consider the time cost of the patient electing a subordinate medical institution. The patient who goes to the subordinate medical institution needs to face a certain probability of referral. Therefore, in this condition, we need to consider the extra time cost of referral behavior beyond the certain cure probability.
When a patient does not need to be referred, the steps in the medical treatment can be considered as: go to the subordinate medical institution first, queue up for medical treatment next, and return home finally. It can be concluded that the time cost of is as follows: Among them, t B1 is the total time cost for a patient who does not need to be referred to the subordinate medical institution and S B and v are the distance from the patient to the subordinate medical institution and the travel speed of the urban residents respectively. The time cost of the round trip to the medical institution is 2S B v , the queuing time cost in the subordinate medical institution t waitB , and the treatment time cost t H .
When a patient does not need to be referred, the steps in the medical treatment can be considered as go to the subordinate medical institution, queue up for medical treatment, go to the superior medical institution, queue up for medical treatment, and return home finally. It can be concluded that the time cost of is as follows: Among them, t B2 is the total time cost for a patient who needs to be referred to go to the subordinate medical institution, S BA is the distance from the subordinate medical institution to the superior medical institution, and the rest of the symbols are the same as in the two equations above.
The average time cost of a patient to the subordinate medical institution is For a rational group of patients, when the time cost of choosing to go to a superior medical institution is higher than that of subordinate medical institution, that is t A > t B , the patients will automatically choose the latter rather than the former, because for patients, the time cost of medical treatment for the patients is a function of the distance from the medical institution.
When the patient starts out, that is, when he (she) is in a subordinate medical institution, the behavioral time cost advantage of going to a subordinate medical institution than going to the superior one is as follows: When t A − t B > 0, the patient begins to turn to the subordinate medical institution spontaneously, from which the threshold of the healing capability of the subordinate medical institution was calculated, that is From the above analysis, we can see that: for a patient in different places in the city, and in the medical treatment system that neither supports referral nor online appointment, the willingness to go to the subordinate medical institution depends on the waiting time of the superior and subordinate medical institutions and the cure rate of the subordinate medical institution. However, the patient cannot judge the waiting time of the superior and subordinate medical institutions before departure, so he (she) can only determine according to the previous experiences.

The Medical Treatment System Does Not Support Referral but Supports Online Appointments
This system adds an appointment mechanism to 2.2.1, which can significantly reduce the negative benefits of waiting time for the patient in medical institutions. However, because the referral link of different medical institutions is still not supported, the patient who selects the subordinate medical institutions for treatment still needs to choose according to the different time consumption on the journey and the possible secondary waiting time etc. Under this medical system, patient must have a positive benefit by using online appointment behavior. Therefore, we might as well assume that all patients adopt the online appointment behavior to analyze the relationship between the behavior and the cure rate of the subordinate medical institutions when they choose the medical institutions.
Although it is possible to calculate the time cost for residents of a given region to travel to the superior and subordinate medical institutions in the event of illness. However, unlike the time cost of going to the superior and subordinate medical institutions in the previous section, we consider that the time cost of waiting for the first visit to a medical institution is negligible due to the prior online appointment. At this time, the time cost for a patient to go to the superior and subordinate medical institutions is Among them, t waitBA is additional waiting time that the patient needs to make a new appointment with the superior medical institution when he (she) went to the subordinate medical institution for treatment and cannot be cured.
The time cost difference between patients in a certain area going to the superior and subordinate medical institutions, When the patient goes to the subordinate medical institution spontaneously, the threshold of the cure rate of the subordinate medical institution is Compared with Equations (6) and (10), we can find that the online appointment can effectively reduce the cost of patients' time to see a doctor, but due to the lower rate of treatment in the subordinate medical institution, the utilization rate of medical resources in the society is decreasing.

The Medical Treatment System Supports Referral but Does Not Support Online Appointments
This system introduces a referral mechanism on the basis of 2.2.1, which completely eliminates the negative effects of the time required for patients to wait twice before switching to a superior medical institution when they are unable to receive treatment after selecting a subordinate medical institution. However, due to the lack of support for the medical institutions' own online appointment mechanisms, it is not possible to reduce the negative benefits of patients' waiting time in the medical institutions.
Similar to the previous deduction, we can calculate the time cost for residents of a certain place to go to the superior and subordinate medical institutions. However, unlike previous referrals from the subordinate medical institution, this medical treatment system supports referrals, i.e., the referral patients have the priority of medical treatment without waiting. At this time, the time costs for a patient to go to the superior and subordinate medical institutions are The time cost difference between patients in a certain area going to the superior and subordinate medical institutions, When the patient goes to the subordinate medical institution spontaneously, the threshold of the cure rate of the subordinate medical institution is

The Medical Treatment System Supports Referral and Online Appointment
This medical system not only introduces the referral mechanism on the basis of 2.2.1, but the medical institutions themselves have also increased the efficiency of the appointment mechanism. While eliminating the negative benefits of the second waiting time when patients cannot be cured after selecting the subordinate medical institutions, the negative benefits of the waiting time in the medical institutions can also be greatly reduced.
Similar to the previous deduction, we can calculate the time cost for residents of a certain place to go to the superior and subordinate medical institutions. Since the medical system considered in this section supports both referrals-that is, referral patients have the priority to see the doctor without waiting-and online appointments (patients do not need to wait for their first treatment), the time costs for patients to travel to the superior and subordinate medical institutions are The time cost difference between patients in a certain area going to the superior and subordinate medical institutions, t A − t B is When the patient goes to the subordinate medical institution spontaneously, the threshold of the cure rate of the subordinate medical institution is

Basic Conclusions of the Model
From the above analysis, the following basic conclusions can be drawn: (1) Because of the planned use of the existing medical resources, online appointments greatly increases the time utility of patients and play a decisive role in alleviating the high cost of patients' medical time. At the same time, when medical institutions begin to use online appointments, patients will use them to increase their own time utility (with some guidance). (2) Only when the subordinate medical institutions have a certain cure rate for most diseases can the hierarchical medical treatment continuously improve the patients' acceptance. However, because hierarchical medical treatment can make more medical resources be used, the ultimate time utility of hierarchical medical treatment is higher than that of online appointments alone. (3) Both online appointments and hierarchical medical treatment can reduce the time cost and increase the time utility of patients, but there is a certain competitive relationship between them from a certain perspective. Therefore, we need to further analyze the relationship between them through cellular automata model and policy simulation.

Basic Assumptions
Based on the ideal city model established in Part 2, this paper further introduces the cellular automata model [53][54][55], takes out a region of the ideal city model, and divides it into smaller regions as the cellular space of the cellular automata.
Under the initial condition, we assume that there is a certain number of patients in each cell, and the definition q i = q1 i , q2 i represents a medical treatment strategy for the residents in the i cell, in which q1 i is the probability of selecting the nearest medical treatment for the patients in the cell and q2 i is the probability of selecting the online appointment for the patients in the cell. In the initial condition, we pre-assume that there are no patients-that is, no patients need to be treated on the treatment path and in every medical institution. Updates are made after each unit time t, and the specific rules are set as follows: (1) Generation rules for patients. Select an appropriate number of patients per unit time N s , and use the average distribution to simulate the fluctuation of the population. After selecting the number of patients in a specific unit time according to the random number, the patient's location information is assigned randomly x, y . Next, read the probability of medical treatment strategy of patients in the cell through the location information. Then, through the probability of medical strategy, determine a specific patient after the onset of the medical strategy. (2) Movement rules for patients. Because the condition of the patient in this paper is not enough for emergency treatment, when the time evolves to the normal operating hours of the medical institution, the patient can go to the medical institution according to his (her) own treatment strategy. In this process, the time required for the patient to move is the required distance S divided by the urban traffic speed v, and then the value is rounded up or down plus one so that the data type of the time is always an integer. (3) Medical treatment rules. In the process of normal operation of the medical institution, it sorts the patients according to the preset medical system. Then according to the order, the patient with higher priority are diagnosed and treated according to his (her) own diagnosis and treatment speed. Here we assume that a time step in a subordinate medical institution can diagnose v a patients, and a time step in a superior medical institution can diagnose v b patients. After the patients are treated, a fixed time t h is added as the treatment duration. When a patient is treated in a subordinate medical institution, it is necessary to randomly determine whether the patient needs to be transferred through the treatment rate p preset by the subordinate medical institution. A patient who needs to be referred goes to a superior medical institution through the previous movement rule. When the medical institution is about to close, we agree that the medical institution will guarantee the treatment of a very small number of patients who are still in the hospital by extending the clinic or transferring them to the emergency department. By doing this, we can prevent these patients going home and then returning to the medical institution for treatment the next day, resulting in a lower time utility, thus misleading the results.

Benchmark Data
Taking Shanghai as an example, according to the data from the 2018 Shanghai Health and Family Planning Statistics Report, this paper will position hospitals as superior medical institutions, primary-level medical and health care institutions as subordinate medical institutions. In 2018, there were 364 hospitals in Shanghai, and 3458 primary health care institutions, except village clinics. The ratio of the two was about 1:9.5, which was roughly the same as the 1:8 of the two-level medical institutions in the ideal model. In 2018, the number of visits to outpatient clinics in Shanghai was 276.3778 million, and the average number of outpatient clinics per day in the service area of a single superior medical institution was about 2000 [56]. The central area of Shanghai is about 3950 square kilometers [57], with an average area of 11.7 square kilometers for a single superior medical institution. Based on this data, this paper simulates the cellular automata with Mathematica 8.0 (the software of Wolfram Research, Champaign, IL, USA), which includes the medical treatment strategy of the residents in the ideal city with the second-grade medical system.

Simulation Results
This article will cover the cells of the Shanghai medical system coverage area, that is, 1/6 of the service area of a single superior medical institution is divided into 465 cells, of which 435 are diamonds and 30 are triangles. Every diamond has the same side length as the triangle, which is 1/30 of the service radius of the superior medical institution. Compared with the average service area of hospitals in Shanghai, the service radius of higher medical institutions is 2.1 km. For the convenience of calculation, the single time step is five minutes, i.e., 288 hours per day. The moving speed in the city is for cell length/time step, i.e., 56 m/min. The average total number of patients in the study area was 1.5 person/time step, i.e., 2592 patients per day in a single parent facility. The diagnosis and treatment speed of the superior and subordinate medical institutions are subordinate va = 6 person/time step, superior vb= 24 person/time step. The compulsory diagnosis time is t h =6/time step, i.e., 30 minutes, including the time required for all non-waiting processes, such as the time taken by the doctor to inquire about the al condition and diagnosis, and the time for chemical examinations and inspections. The probability of cure in subordinate medical institutions is 40%.
In the simulation experiment, we chose the last working day of the end of the medical institution as the starting time, the total evolutionary time is 365 days. The closing of the medical institution on the previous day is the beginning of the simulated day, so that the medical institution is open for 180-288 time step per day. It is agreed that the patients are required to go to the medical institution after the door opens, and the appointment can be made all day if the appointment is allowed. The strategy modification factor is 0.05. Considering the diversity of patients' backgrounds, we assume that the probability of each strategy being selected fluctuates between 10% and 90%. The initial strategy choice including a rating rate of 50% and an appointment rate of 10% (in the system of no reservation, for the convenience of programming, we still keep the appointment rate in the corresponding resident strategy of each cell, but it has no effect on the process of patients' medical treatment process). Figure 4 depicts the changes of the simulation days and the proportion of outpatient clinics at the superior and subordinate medical institutions with different policies. In different medical treatment systems, the initial value of the proportion of the number of the outpatient clinics services in the total number of outpatient services is not 50% to 50%, because the patients who are not cured in the subordinate medical institutions will go to the superior medical institutions for further treatment. Therefore, in the case of a rating strategy of 50% and a cure rate of 40%, the proportion of superior and subordinate outpatients in the total number of outpatient clinics is actually 61.5% and 38.5%.      Comparing the simulation results of Figure 4 and Figure 5, we can find that 1. The comparison between Figure 4a and Figure 5a shows that under the medical treatment system that does not support referral or online appointments, patients tend to go directly to the superior medical institution, resulting in a decrease in the outpatient proportion of the subordinate medical institution. However, when the length of medical treatment is equal to the duration of compulsory treatment divided by the cure rate of the subordinate medical institution, the time effectiveness of patients going to the two-level medical institutions begins to be the same, and the rating rate does not change much at this time. Figure 4b and Figure 5b shows that under the system of supporting online appointments but not supporting referral, the implementation of an appointment system can effectively reduce the waiting time of residents, thus reducing the time cost of Comparing the simulation results of Figures 4 and 5, we can find that 1.

The comparison between
The comparison between Figures 4a and 5a shows that under the medical treatment system that does not support referral or online appointments, patients tend to go directly to the superior medical institution, resulting in a decrease in the outpatient proportion of the subordinate medical institution. However, when the length of medical treatment is equal to the duration of compulsory treatment divided by the cure rate of the subordinate medical institution, the time effectiveness of patients going to the two-level medical institutions begins to be the same, and the rating rate does not change much at this time. Figures 4b and 5b shows that under the system of supporting online appointments but not supporting referral, the implementation of an appointment system can effectively reduce the waiting time of residents, thus reducing the time cost of residents. However, due to the reduction of the waiting time of residents, the advantage of the former short waiting time of subordinate medical institutions will no longer appear, which leads to the lowest limit of the rating rate allowed by the procedure. 3.

The comparison between
The comparison between Figures 4c and 5c shows that under the medical treatment system that support referral but does not support online appointments, due to the existence of referral mechanism, the proportion of outpatient clinics in the subordinate medical institution has been greatly increased, thus releasing the medical capability of the subordinate medical institution and reducing the time for patients to seek medical treatment to a certain extent. However, due to the absence of an appointment mechanism, a large amount of waiting time makes it difficult for the length of medical treatment of patient to continue to decline. 4.
The comparison between Figures 4d and 5d shows that under the medical treatment system that supports referral and online appointments, the average time for patients to be treated was significantly reduced. At the same time, the rating rate was also maintained at a higher level.
This paper further simulates the number and time of patients waiting in the medical systems with different policies within 90 days, 180 days, and 360 days (see . residents. However, due to the reduction of the waiting time of residents, the advantage of the former short waiting time of subordinate medical institutions will no longer appear, which leads to the lowest limit of the rating rate allowed by the procedure. 3. The comparison between Figure 4c and Figure 5c shows that under the medical treatment system that support referral but does not support online appointments, due to the existence of referral mechanism, the proportion of outpatient clinics in the subordinate medical institution has been greatly increased, thus releasing the medical capability of the subordinate medical institution and reducing the time for patients to seek medical treatment to a certain extent. However, due to the absence of an appointment mechanism, a large amount of waiting time makes it difficult for the length of medical treatment of patient to continue to decline. 4. The comparison between Figure 4d and Figure 5d shows that under the medical treatment system that supports referral and online appointments, the average time for patients to be treated was significantly reduced. At the same time, the rating rate was also maintained at a higher level. This paper further simulates the number and time of patients waiting in the medical systems with different policies within 90 days, 180 days, and 360 days (see .   From the simulation results in Figures 6-8, it can be seen that in all medical systems with different policies, the superior medical institutions will have a waiting peak after the formal reception starts in the morning. This is because after the medical institution's business was closed on the previous day, the patients are constantly emerging, but they cannot get treatment. Therefore, when a patient does not make an appointment to go to the medical institution, the patients will pile up. The waiting peak will be intensified when the patients in subordinate medical institutions begin to receive referrals in succession. After the subordinate medical institutions are unable to withstand load operation, the number of people waiting in the superior medical institutions begin to decline significantly.

Results Analysis
According to the simulation results, patients are the beneficiaries of the hierarchical medical system and the online appointment diagnosis system. Their preferences for the medical system will have a great impact on the efficiency of the whole system. According to the previous analysis in this paper, although the current total amount of medical resources in China is insufficient, and the structural allocation is not completely desirable, the government has taken corresponding measures to continuously adjust the resource allocation structure and enhance the capacity of primary medical services. Therefore, it is necessary to take further measures from the perspective of the beneficiaries to change the patients' awareness of the medical institutions, improve their satisfaction with the medical service ability and service quality, and promote their active selection of the "primary diagnosis" and "two-way referral." On the one hand, although most patients tend to choose the primary diagnosis because of the convenience and low expenses of it, their awareness of the division of the medical institutions and their trust in the service capacity of primary medical institutions are highly insufficient. Therefore, governments should conduct regular health education for residents in their jurisdictions, improve residents' health awareness and increase health knowledge, and interpret medical reform policies for residents. In addition, it is necessary to let medical staff in primary medical institutions popularize the rationality and urgency of the division of China's medical institutions and make their patients understand the necessity of participating in this system.
On the other hand, medical expenses and degree of satisfaction are important factors influencing choice of patients for medical treatment. All medical institutions need to improve their convenience and lower the expenses of their patients. In terms of specific policy measures, the government can adjust the proportion of medical expenses reimbursed for the first-time consultation at the primary level institutions and directly to the higher-level medical institutions in the medical insurance policy, and give more economic benefits to the first-time patients at the primary level. Medical institutions should also enrich the types of drugs they carry, especially those for common diseases, frequently occurring diseases, and chronic diseases. The medical equipment, physician professional skills, and medical environment in the primary level institutions should be strengthened to satisfy the basic medical service needs of patients. In addition, in order to avoid conflicts between patients' commuting time and medical institution visit time, the working hours of the primary medical institutions should be appropriately adjusted according to the patient's visiting habits, and patients should be provided with convenient and quick medical services.
In order to more clearly simulate the impact of hierarchical medical system and online appointment diagnosis system, the limitations of this paper may be (1) no more analysis of specialized hospitals in China's existing medical system and (2) no more consideration for patients who need multiple treatments. Therefore, we will further integrate China's specialized hospitals into the existing model system and conduct a focused analysis of patients who need multiple treatments in our future research.

Conclusions
Based on the actual situation of hierarchical medical treatment and online appointment diagnosis system in China, this paper conducts a theoretical study and simulation analysis on patients' choice of medical behavior by means of cellular automaton grid dynamics model. The results show that China's hierarchical medical system can make more medical resources be used, and the ultimate time utility of patients under the system has been improved; while the online appointment system, under the constraints of existing medical resources, greatly increases the time utility of patients when they go to hospital, which can alleviate the higher time cost of patients' going to hospital and promote the sustainable development of public health. Of the four policy options-neither supporting referral nor online appointments, supporting appointments but not referral, supporting referral but not appointments, or supporting both referral and appointments-the best choice is to support referral and appointments at the same time. Under the resource constraints of the existing medical system, this policy can effectively reduce the average time for patients to seek medical treatment and also maintain the rate of hierarchical medical treatment to maximize the use of existing resources, thus achieving sustainable development of public health.
At present, in the practice of hierarchical medical treatment and online appointments diagnosis in China, there are still some serious problems such as over-concentration of patients in high-grade medical institutions, long time of treatment, crowded environment, overwork of doctors, and lack of timely treatment due to long waiting time [58][59][60]. However, some low-grade medical institutions, such as community hospitals, have the problems of insufficient patients and waste of medical resources [61][62][63]. In view of this, this paper proposes the following policy recommendations: (1) Strive to improve the diagnosis and treatment capability of low-level medical institutions in China, especially in rural areas. It is necessary for the government to take the lead in efforts to expand the grassroots level, particularly the medical talents in rural areas. Governments should encourage medical graduates to work at the grass-roots level in rural areas, raise the income of medical personnel at the grass-roots level through practical measures, and encourage doctors to practice more so as to effectively improve the diagnosis and treatment capability of low-level medical institutions [64][65][66].
(2) Accelerate the information and network construction of the whole medical system and further construct the intelligent referral matching and tele-medicine treatment system of different levels in medical institutions by using cloud platform that on the basis of the existing online appointment system. Through real-time sharing and intelligent matching of patients data between different levels of medical institutions, the hierarchical referral and online appointment system are optimized to further enhance the ultimate time utility of patients [66][67][68][69].
(3) On the basis of optimizing the hierarchical medical system and online appointment diagnosis system, we centralize the excellent medical resources of high-grade hospitals, focus on tackling the key problems of difficult and serious diseases such as cancer and malignant tumor, and strive to achieve a substantial breakthrough in the diagnosis and treatment of major diseases [70,71]. Through these measures, we can improve the level of diagnosis and treatment in China's healthcare system and contribute to the sustainable development of public health.

Conflicts of Interest:
The authors declare no conflict of interest.