In order to effectively cope with the situation caused by the COVID-19 pandemic, cases should be concentrated in designated medical institutions with full capability to deal with patients infected by this virus. We studied the location of such hospitals dividing the patients into two categories: ordinary and severe. Genetic algorithms were constructed to achieve a three-phase dynamic approach for the location of hospitals designated to receive and treat COVID-19 cases based on the goal of minimizing the cost of construction and operation isolation wards as well as the transportation costs involved. A dynamic location model was established with the decision variables of the corresponding 'chromosome' of the genetic algorithms designed so that this goal could be reached. In the static location model, 15 hospitals were required throughout the treatment cycle, whereas the dynamic location model found a requirement of only 11 hospitals. It further showed that hospital construction costs can be reduced by approximately 13.7% and operational costs by approximately 26.7%. A comparison of the genetic algorithm and the Gurobi optimizer gave the genetic algorithm several advantages, such as great convergence and high operational efficiency.