Change default SQL server host
[umlisp.git] / parse-rrf.lisp
index ef56f8516358913b292bb6f88473e28163ec18ef..5e28ed5ca8a9f82f6cb9c89233e6e677b4fdf5cd 100644 (file)
@@ -8,10 +8,8 @@
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
 ;;;; Author:   Kevin M. Rosenberg
 ;;;; Created:  Apr 2000
 ;;;;
-;;;; $Id$
-;;;;
 ;;;; This file, part of UMLisp, is
 ;;;; 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.
 ;;;;
 ;;;; UMLisp users are granted the rights to distribute and use this software
 ;;;; as governed by the terms of the GNU General Public License.
 
 (declaim (inline srl-to-srlus))
 (defun srl-to-srlus (srl)
 
 (declaim (inline srl-to-srlus))
 (defun srl-to-srlus (srl)
-  "Convert the standard SRL category to one oriented for use in the United States.
-Specifically, SRL 4 in the USA has license restrictions between SRL 1 and 2 when
-used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapping is:
-(0->0, 1->1, 4->2, 2->3, 3->4)."
+  "Convert the standard SRL category to one oriented for use in the ~
+United States. Specifically, SRL 4 in the USA has license restrictions ~
+between SRL 1 and 2 when used in the United States. As of 2009AA, the
+SNOMED SRL changed from 4 to 9. So we create a new scale ~
+(SRLUS) where SRL to SRLUS mapping is: ~
+(0->0, 1->1, 4->2, 9->2, 2->3, 3->4)."
   (declare (type (integer 0 100) srl))
   (cond
     ((<= srl 1) srl)
     ((= srl 4) 2)
   (declare (type (integer 0 100) srl))
   (cond
     ((<= srl 1) srl)
     ((= srl 4) 2)
+    ((= srl 9) 2)
     ((= srl 2) 3)
     ((= srl 3) 4)
     (t srl)))
     ((= srl 2) 3)
     ((= srl 3) 4)
     (t srl)))
@@ -85,18 +86,18 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
 
   (defun make-preparse-hash-table ()
     (if sui-lrl-hash
 
   (defun make-preparse-hash-table ()
     (if sui-lrl-hash
-       (clear-preparse-hash-tables)
+        (clear-preparse-hash-tables)
       (setf
       (setf
-         pfstr-hash (make-hash-table :size 1500000)
-         cui-lrl-hash (make-hash-table :size 1500000)
-         lui-lrl-hash (make-hash-table :size 5000000)
-         sui-lrl-hash (make-hash-table :size 6000000)
-         cuisui-lrl-hash (make-hash-table :size 6000000)
-         cui-lrlus-hash (make-hash-table :size 1500000)
-         lui-lrlus-hash (make-hash-table :size 5000000)
-         sui-lrlus-hash (make-hash-table :size 6000000)
-         cuisui-lrlus-hash (make-hash-table :size 6000000)
-         sab-srl-hash (make-hash-table :size 200 :test 'equal)
+          pfstr-hash (make-hash-table :size 1500000)
+          cui-lrl-hash (make-hash-table :size 1500000)
+          lui-lrl-hash (make-hash-table :size 5000000)
+          sui-lrl-hash (make-hash-table :size 6000000)
+          cuisui-lrl-hash (make-hash-table :size 6000000)
+          cui-lrlus-hash (make-hash-table :size 1500000)
+          lui-lrlus-hash (make-hash-table :size 5000000)
+          sui-lrlus-hash (make-hash-table :size 6000000)
+          cuisui-lrlus-hash (make-hash-table :size 6000000)
+          sab-srl-hash (make-hash-table :size 200 :test 'equal)
           sab-srlus-hash (make-hash-table :size 200 :test 'equal))))
 
   (defun ensure-preparse (&optional (force-read nil))
           sab-srlus-hash (make-hash-table :size 200 :test 'equal))))
 
   (defun ensure-preparse (&optional (force-read nil))
@@ -123,7 +124,7 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
             (when (and (string-equal (vff "MRCONSO.RRF" "LAT" line) "ENG")
                        (string-equal (vff "MRCONSO.RRF" "TS" line) "P")
                        (string-equal (vff "MRCONSO.RRF" "STT" line) "PF"))
             (when (and (string-equal (vff "MRCONSO.RRF" "LAT" line) "ENG")
                        (string-equal (vff "MRCONSO.RRF" "TS" line) "P")
                        (string-equal (vff "MRCONSO.RRF" "STT" line) "PF"))
-             (setf (gethash cui pfstr-hash) (vff "MRCONSO.RRF" "STR" line))))
+              (setf (gethash cui pfstr-hash) (vff "MRCONSO.RRF" "STR" line))))
           (set-lrl-hash cui srl cui-lrl-hash)
           (set-lrl-hash lui srl lui-lrl-hash)
           (set-lrl-hash sui srl sui-lrl-hash)
           (set-lrl-hash cui srl cui-lrl-hash)
           (set-lrl-hash lui srl lui-lrl-hash)
           (set-lrl-hash sui srl sui-lrl-hash)
@@ -165,7 +166,7 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
     (declare (type (or null fixnum) hash-lrl)
              (boolean found))
     (if (or (not found) (< srl hash-lrl))
     (declare (type (or null fixnum) hash-lrl)
              (boolean found))
     (if (or (not found) (< srl hash-lrl))
-       (setf (gethash key hash) srl))))
+        (setf (gethash key hash) srl))))
 
 ;; UMLS file and column structures
 ;;; SQL datatypes symbols
 
 ;; UMLS file and column structures
 ;;; SQL datatypes symbols
@@ -224,7 +225,7 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
                                                  (parse-ui (vff "MRCONSO.RRF" "SUI" x))))))
       ("MRCONSO.RRF" "KCUILUI" "BIGINT" 0
        (lambda (x) (write-to-string (make-cuilui (parse-ui (vff "MRCONSO.RRF" "CUI" x))
                                                  (parse-ui (vff "MRCONSO.RRF" "SUI" x))))))
       ("MRCONSO.RRF" "KCUILUI" "BIGINT" 0
        (lambda (x) (write-to-string (make-cuilui (parse-ui (vff "MRCONSO.RRF" "CUI" x))
-                                                 (parse-ui (vff "MRCONSO.RRF" "SUI" x))))))
+                                                 (parse-ui (vff "MRCONSO.RRF" "LUI" x))))))
       ("MRCONSO.RRF" "KCUILRL" "TINYINT" 0
        (lambda (x) (write-to-string (cui-lrl (parse-ui (vff "MRCONSO.RRF" "CUI" x))))))
       ("MRCONSO.RRF" "KCUILRLUS" "TINYINT" 0
       ("MRCONSO.RRF" "KCUILRL" "TINYINT" 0
        (lambda (x) (write-to-string (cui-lrl (parse-ui (vff "MRCONSO.RRF" "CUI" x))))))
       ("MRCONSO.RRF" "KCUILRLUS" "TINYINT" 0
@@ -245,14 +246,14 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
        (lambda (x) (write-to-string (cui-lrl (parse-ui (vff "MRSTY.RRF" "CUI" x))))))
       ("MRSTY.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cui-lrlus (parse-ui (vff "MRSTY.RRF" "CUI" x))))))
        (lambda (x) (write-to-string (cui-lrl (parse-ui (vff "MRSTY.RRF" "CUI" x))))))
       ("MRSTY.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cui-lrlus (parse-ui (vff "MRSTY.RRF" "CUI" x))))))
-      ("MRCOC.RRF" "KLRL" "TINYINT" 0
+      #+mrcoc ("MRCOC.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string
        (lambda (x) (write-to-string
-                   (max (cui-lrl (parse-ui (vff "MRCOC.RRF" "CUI1" x)))
-                        (kmrcl:aif (cui-lrl (parse-ui (vff "MRCOC.RRF" "CUI2" x))) kmrcl::it 0)))))
-      ("MRCOC.RRF" "KLRLUS" "TINYINT" 0
+                    (max (cui-lrl (parse-ui (vff "MRCOC.RRF" "CUI1" x)))
+                         (kmrcl:aif (cui-lrl (parse-ui (vff "MRCOC.RRF" "CUI2" x))) kmrcl::it 0)))))
+      #+mrcoc ("MRCOC.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string
        (lambda (x) (write-to-string
-                   (max (cui-lrlus (parse-ui (vff "MRCOC.RRF" "CUI1" x)))
-                        (kmrcl:aif (cui-lrl (parse-ui (vff "MRCOC.RRF" "CUI2" x))) kmrcl::it 0)))))
+                    (max (cui-lrlus (parse-ui (vff "MRCOC.RRF" "CUI1" x)))
+                         (kmrcl:aif (cui-lrl (parse-ui (vff "MRCOC.RRF" "CUI2" x))) kmrcl::it 0)))))
       ("MRSAT.RRF" "KSRL" "TINYINT" 0
        (lambda (x) (write-to-string (sab-srl (vff "MRSAT.RRF" "SAB" x)))))
       ("MRSAT.RRF" "KSRLUS" "TINYINT" 0
       ("MRSAT.RRF" "KSRL" "TINYINT" 0
        (lambda (x) (write-to-string (sab-srl (vff "MRSAT.RRF" "SAB" x)))))
       ("MRSAT.RRF" "KSRLUS" "TINYINT" 0
@@ -283,39 +284,39 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
        (lambda (x) (write-to-string (sab-srlus (vff "MRDEF.RRF" "SAB" x)))))
       ("MRXW_ENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
        (lambda (x) (write-to-string (sab-srlus (vff "MRDEF.RRF" "SAB" x)))))
       ("MRXW_ENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
-                                                (parse-ui (vff "MRXW_ENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXW_ENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXW_ENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXW_ENG.RRF" "SUI" x)))))))
       ("MRXW_ENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
       ("MRXW_ENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
-                                                (parse-ui (vff "MRXW_ENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXW_ENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXW_ENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXW_ENG.RRF" "SUI" x)))))))
       ("MRXW_NONENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
       ("MRXW_NONENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
-                                                (parse-ui (vff "MRXW_NONENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXW_NONENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXW_NONENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXW_NONENG.RRF" "SUI" x)))))))
       ("MRXW_NONENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
       ("MRXW_NONENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
-                                                (parse-ui (vff "MRXW_NONENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXW_NONENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXW_NONENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXW_NONENG.RRF" "SUI" x)))))))
       ("MRXNW_ENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
       ("MRXNW_ENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
-                                                (parse-ui (vff "MRXNW_ENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXNW_ENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXNW_ENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXNW_ENG.RRF" "SUI" x)))))))
       ("MRXNW_ENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
       ("MRXNW_ENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
-                                                (parse-ui (vff "MRXNW_ENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXNW_ENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXNW_ENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXNW_ENG.RRF" "SUI" x)))))))
       ("MRXNS_ENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
       ("MRXNS_ENG.RRF" "KLRL" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrl (make-cuisui
-                                                (parse-ui (vff "MRXNS_ENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXNS_ENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXNS_ENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXNS_ENG.RRF" "SUI" x)))))))
       ("MRXNS_ENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
       ("MRXNS_ENG.RRF" "KLRLUS" "TINYINT" 0
        (lambda (x) (write-to-string (cuisui-lrlus (make-cuisui
-                                                (parse-ui (vff "MRXNS_ENG.RRF" "CUI" x))
-                                                (parse-ui (vff "MRXNS_ENG.RRF" "SUI" x)))))))
+                                                 (parse-ui (vff "MRXNS_ENG.RRF" "CUI" x))
+                                                 (parse-ui (vff "MRXNS_ENG.RRF" "SUI" x)))))))
 
       #+nil  ("MRREL.RRF" "KPFSTR2" "TEXT" 1024 (lambda (x) (pfstr-hash (parse-ui (vff "MRREL.RRF" "CUI2" x)))))
 
       #+nil  ("MRREL.RRF" "KPFSTR2" "TEXT" 1024 (lambda (x) (pfstr-hash (parse-ui (vff "MRREL.RRF" "CUI2" x)))))
-      #+nil  ("MRCOC.RRF" "KPFSTR2" "TEXT" 1024 (lambda (x) (pfstr-hash (parse-ui (vff "MRCOC.RRF" "CUI2" x)))))
+      #+mrcoc  ("MRCOC.RRF" "KPFSTR2" "TEXT" 1024 (lambda (x) (pfstr-hash (parse-ui (vff "MRCOC.RRF" "CUI2" x)))))
 
       ("MRSAT.RRF" "KCUILUI" "BIGINT" 0
        (lambda (x) (write-to-string (make-cuilui
 
       ("MRSAT.RRF" "KCUILUI" "BIGINT" 0
        (lambda (x) (write-to-string (make-cuilui
@@ -349,19 +350,20 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
     "Custom columns to create.(filename, col, sqltype, value-func).")
 
 (defparameter +index-cols+
     "Custom columns to create.(filename, col, sqltype, value-func).")
 
 (defparameter +index-cols+
-    '(("CUI1" "MRCOC") ("CUI" "MRCONSO") ("LUI" "MRCONSO")
-      ("SRL" "MRCONSO") ("KSRLUS" "MRCONSO") ("AUI" "MRCONSO") ("KPFENG" "MRCONSO")
-      ("SUI" "MRCONSO") ("SAUI" "MRCONSO") ("CODE" "MRCONSO")
-      ("SCUI" "MRCONSO")
-      ("CUI" "MRDEF")
-      ("CUI1" "MRREL") ("CUI2" "MRREL") ("SAB" "MRREL")
+  '( #+mrcoc ("CUI1" "MRCOC") #+mrcoc ("KLRL" "MRCOC") #+mrcoc ("KLRLUS" "MRCOC")
+    ("CUI" "MRCONSO") ("LUI" "MRCONSO")
+    ("SRL" "MRCONSO") ("KSRLUS" "MRCONSO") ("AUI" "MRCONSO") ("KPFENG" "MRCONSO")
+    ("SUI" "MRCONSO") ("SAUI" "MRCONSO") ("CODE" "MRCONSO")
+    ("SCUI" "MRCONSO")
+    ("CUI" "MRDEF")
+    ("CUI1" "MRREL") ("CUI2" "MRREL") ("SAB" "MRREL")
       ("RUI" "MRREL") ("AUI1" "MRREL") ("AUI2" "MRREL")
       ("CUI" "MRSAT") ("LUI" "MRSAT") ("SUI" "MRSAT")
       ("METAUI" "MRSAT") ("ATN" "MRSAT")
       ("CUI" "MRSTY")  ("TUI" "MRSTY") ("CUI" "MRXNS_ENG")
       ("RUI" "MRREL") ("AUI1" "MRREL") ("AUI2" "MRREL")
       ("CUI" "MRSAT") ("LUI" "MRSAT") ("SUI" "MRSAT")
       ("METAUI" "MRSAT") ("ATN" "MRSAT")
       ("CUI" "MRSTY")  ("TUI" "MRSTY") ("CUI" "MRXNS_ENG")
-      ("AUI" "MRHIER") ("CUI" "MRHIER") ("CXN" "MRHIER") ("RELA" "MRHIER") ("PAUI" "MRHIER")
-      ("SAB" "MRHIER")
-      #+ignore ("NSTR" "MRXNS_ENG" 10)
+      ("AUI" "MRHIER") ("CUI" "MRHIER") ("CXN" "MRHIER") ("RELA" "MRHIER")
+      ("PAUI" "MRHIER") ("SAB" "MRHIER")
+      ("NSTR" "MRXNS_ENG" 255)
       ("CUI" "MRXNW_ENG") ("NWD" "MRXNW_ENG") ("WD" "MRXW_ENG")
       ("KCUISUI" "MRCONSO") ("KCUILUI" "MRCONSO")
       ("KCUILRL" "MRCONSO") ("KLUILRL" "MRCONSO") ("KSUILRL" "MRCONSO")
       ("CUI" "MRXNW_ENG") ("NWD" "MRXNW_ENG") ("WD" "MRXW_ENG")
       ("KCUISUI" "MRCONSO") ("KCUILUI" "MRCONSO")
       ("KCUILRL" "MRCONSO") ("KLUILRL" "MRCONSO") ("KSUILRL" "MRCONSO")
@@ -371,8 +373,8 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
       ("KCUISUI" "MRXNS_ENG") ("KCUISUI" "MRXW_NONENG")
       ("KSRL" "MRDEF") ("KSRL" "MRRANK")("KSRL" "MRREL") ("KSRL" "MRSAT")
       ("KSRLUS" "MRDEF") ("KSRLUS" "MRRANK")("KSRLUS" "MRREL") ("KSRLUS" "MRSAT")
       ("KCUISUI" "MRXNS_ENG") ("KCUISUI" "MRXW_NONENG")
       ("KSRL" "MRDEF") ("KSRL" "MRRANK")("KSRL" "MRREL") ("KSRL" "MRSAT")
       ("KSRLUS" "MRDEF") ("KSRLUS" "MRRANK")("KSRLUS" "MRREL") ("KSRLUS" "MRSAT")
-      ("KLRL" "MRCOC") ("KLRL" "MRSTY") ("KLRL" "MRXW_ENG") ("KLRL" "MRXNW_ENG")
-      ("KLRLUS" "MRCOC") ("KLRLUS" "MRSTY") ("KLRLUS" "MRXW_ENG") ("KLRLUS" "MRXNW_ENG")
+      ("KLRL" "MRSTY") ("KLRL" "MRXW_ENG") ("KLRL" "MRXNW_ENG")
+      ("KLRLUS" "MRSTY") ("KLRLUS" "MRXW_ENG") ("KLRLUS" "MRXNW_ENG")
       ("KLRL" "MRXNS_ENG") ("KLRL" "MRXW_NONENG")
       ("KLRLUS" "MRXNS_ENG") ("KLRLUS" "MRXW_NONENG")
       ;; LEX indices
       ("KLRL" "MRXNS_ENG") ("KLRL" "MRXW_NONENG")
       ("KLRLUS" "MRXNS_ENG") ("KLRLUS" "MRXW_NONENG")
       ;; LEX indices
@@ -386,8 +388,7 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
       ("RL" "SRSTR")
 
       ("SRL" "MRSAB") ("KSRLUS" "MRSAB") ("RSAB" "MRSAB") ("VSAB" "MRSAB") ("RCUI" "MRSAB")
       ("RL" "SRSTR")
 
       ("SRL" "MRSAB") ("KSRLUS" "MRSAB") ("RSAB" "MRSAB") ("VSAB" "MRSAB") ("RCUI" "MRSAB")
-      ("VCUI" "MRSAB") ("LAT" "MRSAB") ("MAPSETCUI" "MRMAP")  ("MAPSETCUI" "MRSMAP")
-      ("CUI" "MRHIER"))
+      ("VCUI" "MRSAB") ("LAT" "MRSAB") ("MAPSETCUI" "MRMAP")  ("MAPSETCUI" "MRSMAP"))
   "Columns in files to index")
 
 
   "Columns in files to index")
 
 
@@ -410,29 +411,29 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
   (let ((cols '()))
     (with-umls-file (line "MRCOLS.RRF")
       (destructuring-bind (col des ref min av max fil dty) line
   (let ((cols '()))
     (with-umls-file (line "MRCOLS.RRF")
       (destructuring-bind (col des ref min av max fil dty) line
-       (push (make-ucol col des ref (parse-integer min) (read-from-string av)
-                        (parse-integer max) fil dty)
-             cols)))
+        (push (make-ucol col des ref (parse-integer min) (read-from-string av)
+                         (parse-integer max) fil dty)
+              cols)))
     (nreverse cols)))
 
 (defun gen-ucols-custom ()
 "Initialize umls columns for custom columns"
   (loop for customcol in +custom-cols+
     (nreverse cols)))
 
 (defun gen-ucols-custom ()
 "Initialize umls columns for custom columns"
   (loop for customcol in +custom-cols+
-       collect
-       (make-ucol (nth 1 customcol) "" 0 0 0 (eval (nth 3 customcol))
-                  (nth 0 customcol) nil :sqltype (canonicalize-column-type (nth 2 customcol))
-                  :custom-value-fun (compile nil (nth 4 customcol)))))
+        collect
+        (make-ucol (nth 1 customcol) "" 0 0 0 (eval (nth 3 customcol))
+                   (nth 0 customcol) nil :sqltype (canonicalize-column-type (nth 2 customcol))
+                   :custom-value-fun (compile nil (nth 4 customcol)))))
 
 (defun gen-ucols-generic (col-filename)
 "Initialize for generic (LEX/NET) columns"
   (let ((cols '()))
     (with-umls-file (line col-filename)
       (destructuring-bind (nam des ref fil) line
 
 (defun gen-ucols-generic (col-filename)
 "Initialize for generic (LEX/NET) columns"
   (let ((cols '()))
     (with-umls-file (line col-filename)
       (destructuring-bind (nam des ref fil) line
-       (setq nam (escape-column-name nam))
-       (dolist (file (delimited-string-to-list fil #\,))
-         (push
-          (make-ucol nam des ref nil nil nil file nil)
-          cols))))
+        (setq nam (escape-column-name nam))
+        (dolist (file (delimited-string-to-list fil #\,))
+          (push
+           (make-ucol nam des ref nil nil nil file nil)
+           cols))))
     (nreverse cols)))
 
 
     (nreverse cols)))
 
 
@@ -449,18 +450,15 @@ used in the United States. We create a new scale (SRLUS) where SRL to SRLUS mapp
   (let ((files '()))
     (with-umls-file (line files-filename)
       (destructuring-bind (fil des fmt cls rws bts) line
   (let ((files '()))
     (with-umls-file (line files-filename)
       (destructuring-bind (fil des fmt cls rws bts) line
-       (push (make-ufile
-              dir fil des
-              (parse-integer cls)
-              (parse-integer rws) (parse-integer bts)
-              (concatenate 'list (umls-field-string-to-list fmt)
-                           (custom-colnames-for-filename fil)))
-             files)))
+        (push (make-ufile
+               dir fil des
+               (parse-integer cls)
+               (parse-integer rws) (parse-integer bts)
+               (concatenate 'list (umls-field-string-to-list fmt)
+                            (custom-colnames-for-filename fil)))
+              files)))
     (nreverse files)))
 
 (defun gen-ufiles-custom ()
   (make-ufile "META" "MRXW_NONENG.RRF" "Custom NonEnglish Index"
     (nreverse files)))
 
 (defun gen-ufiles-custom ()
   (make-ufile "META" "MRXW_NONENG.RRF" "Custom NonEnglish Index"
-             5 0 0 (fields (find-ufile "MRXW_ENG.RRF"))))
-
-
-
+              5 0 0 (fields (find-ufile "MRXW_ENG.RRF"))))