Changes needed for 2009AB version of UMLS
authorMedTermServer <mts@cheetah.med-info.com>
Mon, 15 Feb 2010 21:14:18 +0000 (14:14 -0700)
committerMedTermServer <mts@cheetah.med-info.com>
Mon, 15 Feb 2010 21:14:18 +0000 (14:14 -0700)
15 files changed:
class-support.lisp
classes.lisp
composite.lisp
create-sql.lisp
data-structures.lisp
package.lisp
parse-common.lisp
parse-macros.lisp
parse-rrf.lisp
run-tests.lisp
sql-classes.lisp
sql.lisp
umlisp-tests.asd
umlisp.asd
utils.lisp

index 5de221198d17be93ccdf74e51607b4ad5861ee66..7892abed792da14ea9dfcb75bcccce4e51593dbf 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
 
 (when *has-fixnum-class*
   (defmethod fmt-cui ((c fixnum))
-    (prefixed-fixnum-string c #\C 7)))
+    (if (>= c 10000000)
+        (prefixed-fixnum-string c #\C 8)
+      (prefixed-fixnum-string c #\C 7))))
 
 (defmethod fmt-cui ((c integer))
-    (prefixed-integer-string c #\C 7))
+  (if (>= c 10000000)
+      (prefixed-fixnum-string c #\C 8)
+    (prefixed-fixnum-string c #\C 7)))
 
 (defmethod fmt-cui ((c string))
   (if (eql (aref c 0) #\C)
 
 (when *has-fixnum-class*
   (defmethod fmt-lui ((l fixnum))
-    (prefixed-fixnum-string l #\L 7)))
+    (if (>= l 10000000)
+        (prefixed-fixnum-string l #\L 8)
+      (prefixed-fixnum-string l #\L 7))))
 
 (defmethod fmt-lui ((l integer))
-  (prefixed-integer-string l #\L 7))
+  (if (>= l 10000000)
+      (prefixed-fixnum-string l #\L 8)
+    (prefixed-fixnum-string l #\L 7)))
 
 (defmethod fmt-lui ((l string))
   (if (eql (aref l 0) #\L)
 
 (when *has-fixnum-class*
   (defmethod fmt-sui ((s fixnum))
-    (prefixed-fixnum-string s #\S 7)))
-
+    (if (>= s 10000000)
+        (prefixed-fixnum-string s #\S 8)
+      (prefixed-fixnum-string s #\S 7))))
+    
 (defmethod fmt-sui ((s integer))
-  (prefixed-integer-string s #\S 7))
+  (if (>= s 10000000)
+      (prefixed-fixnum-string s #\S 8)
+    (prefixed-fixnum-string s #\S 7)))
 
 (defmethod fmt-sui ((s string))
   (if (eql (aref s 0) #\S)
index ba0f51c06ac9f4267bc97d25fc616d1ddb51fcbb..587efce21883c37d561c6d36a4edf7bc1825f7cb 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
index 84d47213ba58090f5c1f0e21787224407e83cec7..afd3e16176a3a81f437f622a28cc7924834edfd2 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
index a7d8cffca0ce16d697e830c2eb946616f807f9b0..79732ebc649e4cc5816049944be951ce9f6ac470 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
@@ -264,15 +262,15 @@ This is much faster that using create-umls-db-insert."
       (dolist (file *umls-files*)
         (when verbose (format t "UMLS Import: Importing file ~A to SQL.~%" (fil file)))
         (sql-execute (funcall copy-cmd file extension) conn))
-      (When verbose (format t "UMLS Import: Creating SQL indices.~%"))
+      (when verbose (format t "UMLS Import: Creating SQL indices.~%"))
       (sql-create-indexes conn :verbose verbose)
-      (When verbose (format t "UMLS Import: Creating custom tables.~%"))
+      (when verbose (format t "UMLS Import: Creating custom tables.~%"))
       (sql-create-custom-tables conn)
-      (When verbose (format t "UMLS Import: Creating custom indices.~%"))
+      (when verbose (format t "UMLS Import: Creating custom indices.~%"))
       (sql-create-indexes conn :indexes +custom-index-cols+ :verbose verbose)
-      (When verbose (format t "UMLS Import: Creating special tables.~%"))
+      (when verbose (format t "UMLS Import: Creating special tables.~%"))
       (sql-create-special-tables conn)))
-  (When verbose (format t "UMLS Import: Completed.~%"))
+  (when verbose (format t "UMLS Import: Completed.~%"))
   t)
 
 (defun translate-all-files (&key (extension "-trans") verbose force)
@@ -300,6 +298,12 @@ This is much faster that using create-umls-db-insert."
           (eof (cons nil nil)))
       (catch 'done-counting
         (with-open-file (ts output-path :direction :input
+                            #+(and sbcl sb-unicode) :external-format
+                            #+(and sbcl sb-unicode) :UTF-8
+                            #+(and allegro ics) :external-format
+                            #+(and allegro ics) :UTF-8
+                            #+lispworks :external-format
+                            #+lispworks :UTF-8
                             #+(and clisp unicode) :external-format
                             #+(and clisp unicode) charset:utf-8)
           (do ()
@@ -335,6 +339,12 @@ This is much faster that using create-umls-db-insert."
     (with-open-file (ostream output-path :direction :output
                              :if-exists :overwrite
                              :if-does-not-exist :create
+                             #+(and sbcl sb-unicode) :external-format
+                             #+(and sbcl sb-unicode) :UTF-8
+                             #+(and allegro ics) :external-format
+                             #+(and allegro ics) :UTF-8
+                             #+lispworks :external-format
+                             #+lispworks :UTF-8
                              #+(and clisp unicode) :external-format
                              #+(and clisp unicode) charset:utf-8)
       (dolist (input-ufile input-ufiles)
index 9fc75fffeeee6b6babd14da13f756bcb112b8937..c869160f890faf6f971d9c9b8c5ed48108d6c25a 100644 (file)
@@ -2,15 +2,13 @@
 ;;;; *************************************************************************
 ;;;; FILE IDENTIFICATION
 ;;;;
-;;;; Name:    data-structures.lisp
+;;;; Name:     data-structures.lisp
 ;;;; Purpose:  Basic data objects for UMLisp
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
@@ -20,7 +18,7 @@
 
 ;;; Paths for files
 
-(defparameter *release* "2006AD")
+(defparameter *release* "2009AB")
 
 (defparameter *umls-path*
   (make-pathname :directory (list :absolute "srv" "umls" *release*))
   (:documentation "UMLS column"))
 
 
-(defmethod print-object ((obj ufile) (s stream))
+(defmethod print-object ((obj ufile) s)
   (print-unreadable-object (obj s :type t)
     (format s "~A" (fil obj))))
 
-(defmethod print-object ((obj ucol) (s stream))
+(defmethod print-object ((obj ucol) s)
   (print-unreadable-object (obj s :type t)
     (format s "~A" (col obj))))
 
index 604ea7dffad8b353fede303f2a8221ca52ef8e1a..26a41a100b52fd91f0709487b6a532f078764696 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
index 11f569944f7b3a8eec37d5b6aa894af58d5c2998..67a523636f787679afcac0c3689f4747700467b7 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
@@ -142,7 +140,7 @@ Currently, these are the LEX and NET files."
                                 (ext:convert-string-to-bytes str charset:utf-8)
                               str))))
           #-(and clisp unicode) (declare (string str))
-          (declare (type (integer 0 10000000) len))
+          (declare (type (integer 0 100000000) len))
           (incf (aref fields-av i) len)
           (when (> len (aref fields-max i))
             (setf (aref fields-max i) len))))
index 67af3c6ddd2f51806a86f035898fba5b144a6ce7..490934fd79fa3836794cceac703a6ef665390849 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
            (,buffer (make-fields-buffer))
            (,files (source-files ,path)))
        (with-open-file (,ustream (first ,files) :direction :input
+                        #+(and sbcl sb-unicode) :external-format
+                        #+(and sbcl sb-unicode) :UTF-8
+                        #+(and allegro ics) :external-format
+                        #+(and allegro ics) :UTF-8
+                        #+lispworks :external-format
+                        #+lispworks :UTF-8
                         #+(and clisp unicode) :external-format
                         #+(and clisp unicode) charset:utf-8)
          (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof)
       (unless ,files
         (error "Can't find files for ~A~%" (namestring ,path)))
       (with-open-file (,ustream (first ,files) :direction :input
-                       #+(and clisp unicode) :external-format
-                       #+(and clisp unicode) charset:utf-8)
+                                #+(and sbcl sb-unicode) :external-format
+                                #+(and sbcl sb-unicode) :UTF-8
+                                #+(and allegro ics) :external-format
+                                #+(and allegro ics) :UTF-8
+                                #+lispworks :external-format
+                                #+lispworks :UTF-8
+                                #+(and clisp unicode) :external-format
+                                #+(and clisp unicode) charset:utf-8)
         (do ((,line (read-umls-line ,ustream ,eof)
                     (read-umls-line ,ustream ,eof)))
             ((eq ,line ,eof) t)
     `(let ((,buffer (make-fields-buffer))
            (,eof (gensym "EOFSYM-")))
       (with-open-file
-          (,ustream (umls-pathname ,filename) :direction :input)
+          (,ustream (umls-pathname ,filename) :direction :input
+                    #+(and sbcl sb-unicode) :external-format
+                    #+(and sbcl sb-unicode) :UTF-8
+                    #+(and allegro ics) :external-format
+                    #+(and allegro ics) :UTF-8
+                    #+lispworks :external-format
+                    #+lispworks :UTF-8
+                    #+(and clisp unicode) :external-format
+                    #+(and clisp unicode) charset:utf-8)
         (do ((,line (read-buffered-fields ,buffer ,ustream #\| ,eof)
                     (read-buffered-fields ,buffer ,ustream #\| ,eof)))
             ((eq ,line ,eof) t)
index 08b633d3100d9588873baf3557fd5b52d2344330..59f48269aa4bc3bc7520cf0a804f9d89e849559c 100644 (file)
@@ -8,10 +8,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
index 79433d691a658c6ab119ca327edd32e25d25bb7d..7eefd5091bab7c04a0c7bc9a0c4ed40ae3a1aea8 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
index ae14b38c892faf2ce85ba4c3590b22fd306de9ca..8fe7d95621a91c0ee0535b8ed093c2101878cc0c 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
index 985bf98900fe5334635fd08f577f2cccf91882f5..207d68c6fa86ef933298fc2576ce6b35e26fb698 100644 (file)
--- a/sql.lisp
+++ b/sql.lisp
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
@@ -21,9 +19,9 @@
 (defvar +umls-sql-map+
     '((:2004aa . "KUMLS2004AA")
       (:2006ac . "KUMLS2006AC")
-      (:2006ad . "MTS2006AD")))
-(defvar +default-umls-db+ "MTS2006AD")
-
+      (:2006ad . "MTS2006AD")
+      (:2009ab . "MTS2009AB")))
+(defvar +default-umls-db+ "MTS2009AB")
 
 (defun lookup-db-name (db)
   (cdr (assoc (ensure-keyword db) +umls-sql-map+)))
   (setq *umls-sql-type* h))
 
 (defun umls-connection-spec ()
-  (list *umls-sql-host* *umls-sql-db*
-        *umls-sql-user* *umls-sql-passwd*))
+  (if (eql *umls-sql-type* :mysql)
+      (list *umls-sql-host* *umls-sql-db*
+            *umls-sql-user* *umls-sql-passwd*
+            nil '((:local-infile . 1)))
+    (list *umls-sql-host* *umls-sql-db*
+          *umls-sql-user* *umls-sql-passwd*)))
 
 (defun sql-connect ()
   "Connect to UMLS database, automatically used pooled connections"
index 091361769ae6f65368ad353ca502b84607b0a489..7fe4832a4e3293af6d6761d0492178e32e614143 100644 (file)
@@ -6,8 +6,6 @@
 ;;;; Purpose:       ASDF system definitionf for umlisp testing package
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2003
-;;;;
-;;;; $Id$
 ;;;; *************************************************************************
 
 (defpackage #:umlisp-tests-system
index 03e53016ef8bf0beaf137ca2ea37c877659bcfec..a9e7cb291a6b03d6aa5e0ad6e02bac95e8c6948a 100644 (file)
@@ -7,8 +7,6 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
 ;;;;
index 416405f9647f9501f0104b18aac6217b734f582f..20f91c4fe9d2ddea62b8c81030cf138d35eaa351 100644 (file)
@@ -7,10 +7,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2006 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2010 by Kevin M. Rosenberg, M.D.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
             (nth-value 0 (parse-integer eui))))
     eui))
 
-(defconstant +cuisui-scale+ 10000000)
-(declaim (type (integer 0 10000000) +cuisui-scale+))
+(defconstant +cuisui-scale+ 100000000)
+(declaim (type (integer 0 100000000) +cuisui-scale+))
 
 #+(or 64bit x86-64)
 (defun make-cuisui (cui sui)
-  (declare (type (integer 0 10000000) cui sui)
+  (declare (type (integer 0 100000000) cui sui)
            (optimize (speed 3) (safety 0) (space 0)))
   (the fixnum
     (+ (the fixnum (* +cuisui-scale+ cui)) sui)))
 
 #+(or 64bit x86-64)
 (defun make-cuilui (cui lui)
-  (declare (type (integer 0 10000000) cui lui)
+  (declare (type (integer 0 100000000) cui lui)
            (optimize (speed 3) (safety 0) (space 0)))
   (the fixnum
     (+ (the fixnum (* +cuisui-scale+ cui)) lui)))