From: Kevin M. Rosenberg Date: Tue, 6 May 2003 02:41:01 +0000 (+0000) Subject: r4829: Auto commit for Debian build X-Git-Tag: v2006ac.2~195 X-Git-Url: http://git.kpe.io/?a=commitdiff_plain;ds=sidebyside;h=7ecbfa0b3062a1995296d1b97cf557e57c3ed1df;p=umlisp.git r4829: Auto commit for Debian build --- diff --git a/sql-classes.lisp b/sql-classes.lisp index 6e62db2..a66a455 100644 --- a/sql-classes.lisp +++ b/sql-classes.lisp @@ -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. @@ -59,16 +59,15 @@ '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) "") diff --git a/tests.lisp b/tests.lisp index 0835436..c12f21c 100644 --- a/tests.lisp +++ b/tests.lisp @@ -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. @@ -81,10 +81,15 @@ (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) diff --git a/utils.lisp b/utils.lisp index 8415192..6c7d08f 100644 --- a/utils.lisp +++ b/utils.lisp @@ -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. @@ -39,14 +39,14 @@ "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)