In this paper, we propose a novel ontology-based approach for text mining of EMR information retrieval. The advantage of this approach is that it is capable of handling numerous variations in nature text which essentially refer to the same identity, as well as inferring implicit information from the plain text, which are both important in data mining of medical records. We applied the approach to text mining of EMR documents for stroke patients in a Chinese medical hospital. A benchmark study on an independent test set shows that the proposed pipeline can accurately extract the vast majority of useful information from the EMR documents, including the implicit ones through ontology inference. We also carry out a primary statistical analysis on a sample EMR set to illustrate the utilization of the approach on medical studies.