r9093: changes for postgresql
[umlisp.git] / parse-2002.lisp
index 9e70e3c891c1a56c15bb1eeedbd4cd48c188a446..ae126a0e10ff058e8520f6c3729d7ef6ab6c2e7e 100644 (file)
@@ -8,10 +8,10 @@
 ;;;; Author:        Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: parse-2002.lisp,v 1.11 2003/05/08 02:59:21 kevin Exp $
+;;;; $Id$
 ;;;;
 ;;;; This file, part of UMLisp, is
-;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
+;;;;    Copyright (c) 2000-2003 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.
@@ -23,7 +23,7 @@
   (declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3))))
 
 ;;; Pre-read data for custom fields into hash tables
-(defvar *parse-hash-init?* nil)
+(defvar *preparse-hash-init?* nil)
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
 (let ((pfstr-hash nil)      ;;; Preferred concept strings by CUI
@@ -32,7 +32,7 @@
       (cuisui-lrl-hash nil) ;;; LRL by CUISUI
       (sab-srl-hash nil))   ;;; SRL by SAB
   
-  (defun make-parse-hash-table ()
+  (defun make-preparse-hash-table ()
     (if pfstr-hash
        (progn
          (clrhash pfstr-hash)
          cuisui-lrl-hash (make-hash-table :size 1800000)
          sab-srl-hash (make-hash-table :size 100 :test 'equal))))
     
-  (defun binit-hash-table (&optional (force-read nil))
-    (when (or force-read (not *parse-hash-init?*))
-      (make-parse-hash-table)
-      (setq *parse-hash-init?* t))
+  (defun buffered-ensure-preparse (&optional (force-read nil))
+    (when (or force-read (not *preparse-hash-init?*))
+      (make-preparse-hash-table)
+      (setq *preparse-hash-init?* t))
     (with-buffered-umls-file (line "MRCON")
       (let ((cui (parse-ui (aref line 0)))
            (lui (parse-ui (aref line 3)))
        (unless (gethash sab sab-srl-hash)  ;; if haven't stored
          (setf (gethash sab sab-srl-hash) (aref line 6))))))
   
-  (defun init-hash-table (&optional (force-read nil))
-    (when (or force-read (not *parse-hash-init?*))
-      (make-parse-hash-table)
-      (setq *parse-hash-init?* t))
+  (defun ensure-preparse (&optional (force-read nil))
+    (when (or force-read (not *preparse-hash-init?*))
+      (make-preparse-hash-table)
+      (setq *preparse-hash-init?* t))
     (with-umls-file (line "MRCON")
       (let ((cui (parse-ui (nth 0 line)))
            (lui (parse-ui (nth 3 line)))
     (gethash cuisui cuisui-lrl-hash))
   
   (defun sab-srl (sab)
-    (kmrcl:aif (gethash sab sab-srl-hash) kmrcl::it 0))
+    (aif (gethash sab sab-srl-hash) it 0))
 )) ;; closure
 
 (defun set-lrl-hash (key lrl hash)
 ;;; sql-i - Integer (32-bit)
 ;;; sql-l - Big integer (64-bit)
 ;;; sql-f - Floating point
+;;; sql-c - Character data
 
 (defparameter +col-datatypes+
     '(("AV" sql-f) ("BTS" sql-i) ("CLS" sql-i) ("COF" sql-i) ("CUI1" sql-u)
       ("CUI2" sql-u) ("CUI" sql-u) ("CXN" sql-s) ("FR" sql-i) ("LRL" sql-s)
-      ("LUI" sql-u) ("MAX" sql-s) ("MIN" sql-s) ("RANK" sql-s) ("REF" sql-s)
+      ("LUI" sql-u) ("MAX" sql-s) ("MIN" sql-s) ("RANK" sql-s) ("REF" sql-c)
       ("RNK" sql-s) ("RWS" sql-i) ("SRL" sql-s) ("SUI" sql-u) ("TUI" sql-u)
       ;;; Custom columns
       ("KCUISUI" sql-l) ("KCUILUI" sql-l) ("KCUILRL" sql-i) ("KLUILRL" sql-i)
       ("VCUI" "MRSAB") ("LAT" "MRSAB"))
   "Columns in files to index")
 
+
 (defparameter +custom-index-cols+
   nil
   #+ignore