;;;; 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)
;;;; 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.
;;;; 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.
;;;; 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.
(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)
(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 ()
(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)
;;;; *************************************************************************
;;;; 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.
;;; 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))))
;;;; 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.
;;;; 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.
(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))))
;;;; 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)
;;;; 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.
;;;; 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.
;;;; 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.
;;;; 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.
(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"
;;;; Purpose: ASDF system definitionf for umlisp testing package
;;;; Author: Kevin M. Rosenberg
;;;; Date Started: Apr 2003
-;;;;
-;;;; $Id$
;;;; *************************************************************************
(defpackage #:umlisp-tests-system
;;;; 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.
;;;;
;;;; 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)))