r4829: Auto commit for Debian build
authorKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 6 May 2003 02:41:01 +0000 (02:41 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Tue, 6 May 2003 02:41:01 +0000 (02:41 +0000)
sql-classes.lisp
tests.lisp
utils.lisp

index 6e62db214a273c52f4837b2f74e240b971f78aec..a66a455495ccc4ef02bd745af308dc11b39ebc3b 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: sql-classes.lisp,v 1.71 2003/05/06 01:34:57 kevin Exp $
+;;;; $Id: sql-classes.lisp,v 1.72 2003/05/06 02:41:01 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
    'string
    (format nil "select ~A~{~:@(~A~)~^,~} from ~:@(~A~)" 
           (if distinct "distinct " "") fields table)
+   (if where-name (format nil " where ~:@(~A~)" where-name) "")
    (if where-name
        (format nil
               (typecase where-value
-                (number " where ~A=~D")
-                (null " where ~A is null")
+                (number "=~D")
+                (null " is null")
                 (t
-                 (if like
-                     " where ~A like '%~A%'"
-                     " where ~A='~A'")))
-              where-name where-value)
+                 (if like " like '%~A%""='~A'")))
+              where-value)
        "")
    (if srl (format nil " and ~:@(~A~)<=~D" lrl srl) "")
    (if order (format nil " order by ~{~:@(~A~) ~(~A~)~^,~}" order) "")
index 0835436b57be4464e9c33c3ea9ae8ed30e620341..c12f21c7e6ac63b680f83f3cc3be4a9aedb7ef90 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  May 2003
 ;;;;
-;;;; $Id: tests.lisp,v 1.5 2003/05/06 02:14:59 kevin Exp $
+;;;; $Id: tests.lisp,v 1.6 2003/05/06 02:36:58 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
 (deftest ui.5 (fmt-cui 2341) "C0002341")
 (deftest ui.6 (fmt-lui 2341) "L0002341")
 (deftest ui.7 (fmt-sui 2341) "S0002341")
-(deftest ui.8 (fmt-lui 231) "T231")
-(deftest ui.9 (umlisp::make-cuisui 5 11) 50000011)
-(deftest ui.10 (umlisp::decompose-cuisui 50000011) 5 11)
-              
+(deftest ui.8 (fmt-tui 231) "T231")
+(deftest ui.9 (fmt-tui 231) "T231")
+(deftest ui.10 (fmt-eui 231) "E0000231")
+(deftest ui.11 (umlisp::make-cuisui 5 11) 50000011)
+(deftest ui.12 (umlisp::decompose-cuisui 50000011) 5 11)
+(deftest ui.13 (umlisp::parse-eui "E00002311") 2311)
+(deftest ui.14 (umlisp::parse-lui "1234") 1234)
+(deftest ui.15 (umlisp::parse-lui 1234) 1234)
+  
 (defun f2 (&key (srl *current-srl*))
   "Return list of all ucon's"
   (umlisp::with-umlisp-query ('mrcon (cui kpfstr kcuilrl) srl nil nil)
index 8415192448439baf2216bf0dce9a002337597b30..6c7d08fa7476b00f57e292b6394f293e07203822 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: utils.lisp,v 1.5 2003/05/06 02:21:30 kevin Exp $
+;;;; $Id: utils.lisp,v 1.6 2003/05/06 02:36:58 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
   "Return integer value for a UMLS unique identifier."
   (if (< (length s) 2)
       nullvalue
-    (parse-integer s :start 1)))
+    (nth-value 0 (parse-integer s :start 1))))
 
 (defun parse-cui (cui)
   (if (stringp cui)
       (let ((ch (aref cui 0)))
        (if (eql ch #\C)
            (parse-ui cui)
-         (parse-integer cui)))
+           (nth-value 0 (parse-integer cui))))
     cui))
     
 (defun parse-lui (lui)
@@ -54,7 +54,7 @@
       (let ((ch (aref lui 0)))
        (if (eql ch #\L)
            (parse-ui lui)
-         (parse-integer lui)))
+           (nth-value 0 (parse-integer lui))))
     lui))
     
 (defun parse-sui (sui)
@@ -62,7 +62,7 @@
       (let ((ch (aref sui 0)))
        (if (eql ch #\S)
            (parse-ui sui)
-         (parse-integer sui)))
+           (nth-value 0 (parse-integer sui))))
     sui))
     
 (defun parse-tui (tui)
@@ -70,7 +70,7 @@
       (let ((ch (aref tui 0)))
        (if (eql ch #\T)
            (parse-ui tui)
-         (parse-integer tui)))
+           (nth-value 0 (parse-integer tui))))
     tui))
 
 (defun parse-eui (eui)
@@ -78,7 +78,7 @@
       (let ((ch (aref eui 0)))
        (if (eql ch #\E)
            (parse-ui eui)
-         (parse-integer eui)))
+           (nth-value 0 (parse-integer eui))))
     eui))
     
 (defconstant +cuisui-scale+ 10000000)