With the introduction of Electronic Medical Records (EMR) systems in health care institutions, a huge data repository has been created. By employing computational intelligence (CI) techniques, this data repository can be used to address important health care issues such as improving quality and reducing medical errors. In this paper, we introduce a general word sequence alignment method based on a fuzzy version of the Smith-Waterman (SW) dynamic programming algorithm. The word similarity matrix used in computing the sequence alignment is calculated based on a domain ontology (taxonomy). The fuzzy version of the SW algorithm is designed to accommodate words not present in the initial dictionary used to precompute the similarity matrix, hence avoiding its recalculation. We apply the developed algorithm for patient retrieval in an EMR. Each patient is described by an ordered sequence of ICD9 diagnoses. We analyze various properties of the proposed algorithm on a patient dataset that contains 107 patients described by ICD9 diagnose sequences.