We have modelled the solution to the problem as a series of tasks that are performed in sequence (see the boxes with text in bold in Figure 1).
A) The starting point of the system is to consider all the antibiotic groups. These groups are sieved considering relevant data of the patient, that is, the task consists in finding the degree of adequacy of every group of antibiotics to that patient. It is performed taking into account data about pregnancy, allergic reactions to antibiotics, renal diseases or genetic alterations. The result of this task is the adequacy of every group to a concrete patient. It is independent of the disease we want to treat.
B) Then, taking into account the diagnosis of the patient, we dynamically generate (by selection) a set of treatment tasks, one for each microorganism that possibly caused the pneumonia.
C) Taking into account the adequacy of every group of antibiotics (task A) for the patient, every treatment task obtains the best set of antibiotics, for the treatment of the microorganism it is specialised on, that belongs to those sieved groups. A treatment task uses data about the patient, the more important is the patient's severity of illness, and pharmacological knowledge about the interactions between drugs, and their contrary effects (previously known adverse reactions to some antibiotics in a concrete patient).
D) The sets of antibiotics adequate for each microorganism are then combined. Combinations are produced by means of several criteria. For instance: do not combine antibiotics of the same group, nor those of the same spectrum (equivalent anti-microorganisms activity) nor with different administration route; we prefer monotherapy (one antibiotic) to combinations.
E) Finally, a new sieve is applied, now over the ordered set of antibiotics combinations taking into account the specificity and cost, giving as final result an ordered set of combinations that are the most adequate for the treatment of the patient.
The final result of this process is an adequacy-ordered set of treatments (combinations of antibiotics) for a particular pneumonia case of a concrete patient.