This paper presents an innovative approach to automate the treatment of sleep apnea and Chronic Obstructive Pulmonary Disease (COPD) through the application of Continuous Positive Airway Pressure (CPAP) and/or Bilevel Positive Airway Pressure (BiPAP) machines. Recognizing the constraints posed by moderate to severe cases that demand round-the-clock healthcare professional supervision, this study aims to increase the utility and availability of PAP machines by automating the treatment process. We introduce a hypothesis centering around conceptualizing the treatment process as a Markov Decision Process (MDP). Traditionally, the construction of an MDP graph requires environmental interaction. However, in this specific context, where the environment pertains to patient treatment, we propose a method to construct the graph drawing from expert knowledge and treatment records of a select group of patients. This model fosters an environment for future enhancement and refinement of apnea/COPD treatment. Ultimately, the goal is to streamline the treatment process, accelerating patient condition normalization, and reducing the necessity for numerous interventions. This proposed automated approach has potential implications for enhancing patient care and optimizing health care resources. © 2023 IEEE.