From: MedTermServer Date: Mon, 15 Feb 2010 21:14:18 +0000 (-0700) Subject: Changes needed for 2009AB version of UMLS X-Git-Tag: debian-2007ac.2-6~14 X-Git-Url: http://git.kpe.io/?p=umlisp.git;a=commitdiff_plain;h=8dc001f5e7cf851c06006e489473a85611d348be Changes needed for 2009AB version of UMLS --- diff --git a/class-support.lisp b/class-support.lisp index 5de2211..7892abe 100644 --- a/class-support.lisp +++ b/class-support.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. @@ -26,10 +24,14 @@ (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) @@ -45,10 +47,14 @@ (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) @@ -61,10 +67,14 @@ (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) diff --git a/classes.lisp b/classes.lisp index ba0f51c..587efce 100644 --- a/classes.lisp +++ b/classes.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. diff --git a/composite.lisp b/composite.lisp index 84d4721..afd3e16 100644 --- a/composite.lisp +++ b/composite.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. diff --git a/create-sql.lisp b/create-sql.lisp index a7d8cff..79732eb 100644 --- a/create-sql.lisp +++ b/create-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. @@ -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) diff --git a/data-structures.lisp b/data-structures.lisp index 9fc75ff..c869160 100644 --- a/data-structures.lisp +++ b/data-structures.lisp @@ -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*)) @@ -106,11 +104,11 @@ (: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)))) diff --git a/package.lisp b/package.lisp index 604ea7d..26a41a1 100644 --- a/package.lisp +++ b/package.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. diff --git a/parse-common.lisp b/parse-common.lisp index 11f5699..67a5236 100644 --- a/parse-common.lisp +++ b/parse-common.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. @@ -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)))) diff --git a/parse-macros.lisp b/parse-macros.lisp index 67af3c6..490934f 100644 --- a/parse-macros.lisp +++ b/parse-macros.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. @@ -48,6 +46,12 @@ (,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) @@ -67,8 +71,14 @@ (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) @@ -93,7 +103,15 @@ `(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) diff --git a/parse-rrf.lisp b/parse-rrf.lisp index 08b633d..59f4826 100644 --- a/parse-rrf.lisp +++ b/parse-rrf.lisp @@ -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. diff --git a/run-tests.lisp b/run-tests.lisp index 79433d6..7eefd50 100644 --- a/run-tests.lisp +++ b/run-tests.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. diff --git a/sql-classes.lisp b/sql-classes.lisp index ae14b38..8fe7d95 100644 --- a/sql-classes.lisp +++ b/sql-classes.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. diff --git a/sql.lisp b/sql.lisp index 985bf98..207d68c 100644 --- 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+))) @@ -68,8 +66,12 @@ (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" diff --git a/umlisp-tests.asd b/umlisp-tests.asd index 0913617..7fe4832 100644 --- a/umlisp-tests.asd +++ b/umlisp-tests.asd @@ -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 diff --git a/umlisp.asd b/umlisp.asd index 03e5301..a9e7cb2 100644 --- a/umlisp.asd +++ b/umlisp.asd @@ -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. ;;;; diff --git a/utils.lisp b/utils.lisp index 416405f..20f91c4 100644 --- a/utils.lisp +++ b/utils.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. @@ -103,12 +101,12 @@ (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))) @@ -122,7 +120,7 @@ #+(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)))