Sepsis is an organ dysfunction caused by a dysregulated host response to infection and remains an ongoing threat to human health worldwide. Septic shock is the most severe subset of sepsis as characterized by abnormalities in cells, circulation, and metabolism. As a time-dependent condition, early recognition allowing appropriate therapeutic measures to be started in a timely manner becomes the most effective way to improve prognosis. However, because of the lack of a criterion standard, most diagnoses merely rely on medical history, empirical diagnosis, and blood culture results. Gene expression profiles have specific diagnostic value, as they reflect a subjective host response to pathogens. We propose a method, Condition Control based on Real-life Medical Scenarios, to control for factors in realistic medical scenarios. Restricted variables are used as much as possible to identify unique differential genes and progressively test their diagnostic value by relaxing restrictions. In total, three data sets were included in the study; the first two data sets were from the Gene Expression Omnibus database, and the third involved patients who were diagnosed with sepsis or septic shock within 7 days of admission to the intensive care unit at West China Hospital of Sichuan University from 2020 to 2021. DDX47 showed preferable diagnostic value in various scenarios, especially in patients with common infections or sepsis and septic shock. Here we also show that hub genes may regulate immune function and immune cell counts through the interaction of different apoptotic pathways and immune checkpoints based on the high correlation. DDX47 is closely associated with B cells according to single-cell sequencing results.