r3334: *** empty log message ***
[umlisp.git] / sql-classes.lisp
index 60eeb23389809e16ae3a3feb29b3125c09b06408..0718c808f7cb101db3c68b727926a7e190bdc86d 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: sql-classes.lisp,v 1.6 2002/10/18 03:57:39 kevin Exp $
+;;;; $Id: sql-classes.lisp,v 1.7 2002/11/07 23:08:00 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
        ls
        :database db))))
 
+(defun map-ucon-all (fn &key (srl *current-srl*))
+  "Return list of all ucon's"
+  (let ((ls "select distinct CUI,KPFSTR,KCUILRL from MRCON"))
+    (when srl
+      (string-append ls (format nil " where KCUILRL <= ~d" srl)))
+    (string-append ls " order by CUI asc")
+    (with-sql-connection (db)
+      (clsql:map-query 
+       nil
+       #'(lambda (cui pfstr cuilrl)
+          (funcall fn
+                   (make-instance 'ucon :cui (ensure-integer cui)
+                                  :pfstr pfstr
+                                  :lrl (ensure-integer cuilrl))))
+       ls
+       :database db))))
 
 
 (defun find-udef-cui (cui &key (srl *current-srl*))