r4840: Auto commit for Debian build
[umlisp.git] / data-structures.lisp
1 ;;;; -*- Mode: Lisp; Syntax: ANSI-Common-Lisp; Base: 10; Package: umlisp -*-
2 ;;;; *************************************************************************
3 ;;;; FILE IDENTIFICATION
4 ;;;;
5 ;;;; Name:          data-structures.lisp
6 ;;;; Purpose:       Basic data objects for UMLisp
7 ;;;; Author:        Kevin M. Rosenberg
8 ;;;; Date Started:  Apr 2000
9 ;;;;
10 ;;;; $Id: data-structures.lisp,v 1.8 2003/05/06 07:17:35 kevin Exp $
11 ;;;;
12 ;;;; This file, part of UMLisp, is
13 ;;;;    Copyright (c) 2000-2002 by Kevin M. Rosenberg, M.D.
14 ;;;;
15 ;;;; UMLisp users are granted the rights to distribute and use this software
16 ;;;; as governed by the terms of the GNU General Public License.
17 ;;;; *************************************************************************
18
19 (in-package #:umlisp)
20
21 (eval-when (:compile-toplevel)
22   (declaim (optimize (speed 3) (safety 1) (compilation-speed 0) (debug 3))))
23
24 ;;; Paths for files
25
26 (defvar *umls-path*
27   (make-pathname :directory '(:absolute "data" "umls" "2003AA"))
28   "Path for base of UMLS data files")
29
30 (defvar *meta-path* 
31     (merge-pathnames 
32      (make-pathname :directory '(:relative "META"))
33      *umls-path*))
34
35 (defvar *lex-path* 
36     (merge-pathnames 
37      (make-pathname :directory '(:relative "LEX"))
38      *umls-path*))
39
40 (defvar *net-path* 
41     (merge-pathnames 
42      (make-pathname :directory '(:relative "NET"))
43      *umls-path*))
44
45 (defun umls-path! (p)
46   (setq *umls-path* p))
47
48
49 ;;; Structures for parsing UMLS text files
50  
51 (defparameter *umls-files* nil 
52   "List of umls file structures. Used when parsing text files.")
53 (defparameter *umls-cols* nil 
54   "List of meta column structures. Used when parsing text files.")
55
56
57 ;; Preliminary objects to replace structures
58
59 (defclass ufile ()
60   ((fil :initarg :fil :accessor fil)
61    (table :initarg :table :accessor table)
62    (des :initarg :des :accessor des)
63    (fmt :initarg :fmt :accessor fmt)
64    (cls :initarg :cls :accessor cls)
65    (rws :initarg :rws :accessor rws)
66    (bts :initarg :bts :accessor bts)
67    (fields :initarg :fields :accessor fields)
68    (ucols :initarg :ucols :accessor ucols))
69   (:default-initargs :fil nil :table nil :des nil :fmt nil :cls nil :rws nil :bts nil
70                      :fields nil :ucols nil)
71   (:documentation "UMLS File"))
72
73 (defclass ucol ()
74   ((col :initarg :col :accessor col)
75    (des :initarg :des :accessor des)
76    (ref :initarg :ref :accessor ref)
77    (min :initarg :min :accessor cmin)
78    (av :initarg :av :accessor av)
79    (max :initarg :max :accessor cmax)
80    (fil :initarg :fil :accessor fil)
81    (sqltype :initarg :sqltype :accessor sqltype)
82    (dty :initarg :dty :accessor dty :documentation "new in 2002: suggested SQL datatype")
83    (parse-fun :initarg :parse-fun :accessor parse-fun)
84    (quotechar :initarg :quotechar :accessor quotechar)
85    (datatype :initarg :datatype :accessor datatype)
86    (custom-value-fun :initarg :custom-value-fun :accessor custom-value-fun))
87   (:default-initargs :col nil :des nil :ref nil :min nil :av nil :max nil :fil nil
88                      :sqltype nil :dty nil :parse-fun nil :datatype nil
89                      :custom-value-fun nil)
90   (:documentation "UMLS column"))
91