  Using the theory of Lie-Hamilton systems, formal generalized time-dependent
Hamiltonian systems that enlarge a recently proposed SIS epidemic model with a
variable infection rate are considered. It is shown that, independently on the
particular interpretation of the time-dependent coefficients, these systems
generally admit an exact solution, up to the case of the maximal extension
within the classification of Lie-Hamilton systems, for which a superposition
rule is constructed. The method provides the algebraic frame to which any SIS
epidemic model that preserves the above mentioned properties is subjected. In
particular, we obtain exact solutions for generalized SIS Hamiltonian models
based on the book and oscillator algebras, denoted by $\mathfrak{b}_2$ and
$\mathfrak{h}_4$, respectively. The last generalization corresponds to a SIS
system possessing the so-called two-photon algebra symmetry $\mathfrak{h}_6$,
according to the embedding chain $\mathfrak{b}_2\subset \mathfrak{h}_4\subset
\mathfrak{h}_6$, for which an exact solution cannot generally be found, but a
nonlinear superposition rule is explicitly given.
