In this paper, we propose an ontology-based approach for integrating clinical pathways into Clinical Decision Support Systems (CDSS) recognizing that flexible pathways are critical for the success of CDSS. Our approach is based on a better understanding of clinical context through ontologies, and bringing them to bear in deciding the right rules for a certain activity. We also describe an approach for integrating and instantiating context specific subprocess fragment into a clinical pathway on the fly based on the needs of a specific case. To illustrate the feasibility of our approach, we present a system architecture and prototype implementation, along with a case study for handling patients with heart disease. The role of semantic web technologies in integrating clinical pathways into CDSS is highlighted.