+++ /dev/null
-;;; $Id: obj.lisp,v 1.1 2002/10/05 20:17:14 kevin Exp $
-;;;
-;;; UMLS object defintions and printing routines
-
-(in-package :umlisp)
-(declaim (optimize (speed 3) (safety 1)))
-
-(defclass umlsclass ()
- ()
- (:metaclass ml-class)
- (:documentation "Parent class of all UMLS objects"))
-
-
-(defmethod print-object ((obj umlsclass) (s stream))
- (print-unreadable-object (obj s :type t :identity t)
- (let ((fmt (make-instance 'gu.ml::textformat)))
- (apply #'format
- s (funcall (gu.ml::obj-data-fmtstr fmt) obj)
- (multiple-value-list
- (funcall (funcall (gu.ml::obj-data-value-func fmt) obj) obj))))))
-
-
-(defclass umlisp-user (umlsclass)
- ((id :type fixnum :initarg :id :reader id)
- (first-name :type string :initarg :first-name :reader first-name)
- (last-name :type string :initarg :last-name :reader last-name)
- (organization :type string :initarg :organization :reader organization)
- (address1 :type string :initarg :address1 :reader address1)
- (address2 :type string :initarg :address2 :reader address2)
- (city :type string :initarg :city :reader city)
- (state :type string :initarg :state :reader state)
- (zip :type string :initarg :zip :reader zip)
- (country :type string :initarg :country :reader country)
- (licensed :type boolean :initarg :licensed :reader licensed)
- (occupation :type string :initarg :occupation :reader occupation)
- (email :type string :initarg :email :reader email)
- (passwd :type string :initarg :passwd :reader passwd)
- (srl :type fixnum :initarg :srl :reader srl)
- (timeout :type fixnum :initarg :timeout :reader timeout)
- (maillist :type boolean :initarg :maillist :reader maillist)
- (datetime-created :type string :initarg :datetime-created
- :reader datetime-created)
- (datetime-modified :type string :initarg :datetime-modified
- :reader datetime-modified))
- (:default-initargs
- :id nil :first-name nil :last-name nil :email nil :passwd nil :srl nil
- :organization nil :address1 nil :address2 nil :city nil :state nil
- :zip nil :country nil :licensed nil :occupation nil :maillist nil
- :timeout nil :datetime-created nil :datetime-modified nil)
- (:metaclass ml-class)
- (:title "UMLisp User")
- (:fields
- (id :fixnum) (first-name :string) (last-name :string) (email :string)
- (occupation :string) (organization :string) (address1 :string)
- (address2 :string) (city :string) (state :string) (zip :string)
- (country :string) (licensed :boolean) (maillist :boolean) (srl :fixnum)
- (timeout :fixnum) (datetime-created :string) (datetime-modified :string))
- (:documentation "Class for UMLisp user database"))
-
-(defclass ustats (umlsclass)
- ((name :type string :initarg :name :reader name)
- (hits :type integer :initarg :hits :reader hits)
- (srl :type fixnum :initarg :srl :reader srl))
- (:metaclass ml-class)
- (:default-initargs :name nil :hits nil :srl nil)
- (:title "UMLS Statistic")
- (:fields (name :string) (hits :commainteger) (srl :fixnum))
- (:documentation "Custom Table: UMLS Database statistics."))
-
-(defclass usrl (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (srl :type integer :initarg :srl :reader srl))
- (:metaclass ml-class)
- (:default-initargs :sab nil :srl nil)
- (:title "Source Restriction Level")
- (:fields (sab :string) (srl :fixnum))
- (:documentation "Custom Table: Source Restriction Level"))
-
-(defclass bsab (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (name :type string :initarg :name :reader name)
- (hits :type fixnum :initarg :hits :reader hits))
- (:metaclass ml-class)
- (:default-initargs :sab nil :name nil :hits nil)
- (:title "Source of Abbreviation")
- (:fields (sab :string) (name :string) (hits :commainteger))
- (:ref-fields (sab find-ustr-sab (("subobjects" "no"))))
- (:documentation "Bonus SAB file"))
-
-(defclass btty (umlsclass)
- ((tty :type string :initarg :tty :reader tty)
- (name :type string :initarg :name :reader name))
- (:metaclass ml-class)
- (:default-initargs :tty nil :name nil)
- (:title "Bonus TTY")
- (:fields (tty :string) (name :fixnum))
- (:documentation "Bonus TTY file"))
-
-(defclass brel (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (sl :type string :initarg :sl :reader sl)
- (rel :type string :initarg :rel :reader rel)
- (rela :type string :initarg :rela :reader rela)
- (hits :type fixnum :initarg :hits :reader hits))
- (:metaclass ml-class)
- (:default-initargs :sab nil :sl nil :rel nil :rela nil :hits nil)
- (:title "Bonus REL")
- (:fields
- (sab :string) (sl :string) (rel :string) (rela :string) (hits :commainteger))
- (:documentation "Bonus REL file"))
-
-(defclass batn (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (atn :type string :initarg :atn :reader atn)
- (hits :type fixnum :initarg :hits :reader hits))
- (:metaclass ml-class)
- (:default-initargs :sab nil :atn nil)
- (:title "Bonus ATN")
- (:fields (sab :string) (atn :string) (hits :commaninteger))
- (:documentation "Bonus ATN file"))
-
-(defclass urank (umlsclass)
- ((rank :type fixnum :initarg :rank :reader rank)
- (sab :type string :initarg :sab :reader sab)
- (tty :type string :initarg :tty :reader tty)
- (supres :type string :initarg :supres :reader supres))
- (:metaclass ml-class)
- (:default-initargs :rank nil :sab nil :tty nil :supres nil)
- (:title "Rank")
- (:fields (rank :fixnum) (sab :string) (tty :string) (supres :string)))
-
-(defclass udef (umlsclass)
- ((def :type string :initarg :def :reader def)
- (sab :type string :initarg :sab :reader sab))
- (:metaclass ml-class)
- (:default-initargs :def nil :sab nil)
- (:title "Definition")
- (:ref-fields (sab find-bsab-sab))
- (:fields (sab :string) (def :cdata)))
-
-(defclass usat (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (code :type string :initarg :code :reader code)
- (atn :type string :initarg :atn :reader atn)
- (atv :type string :initarg :atv :reader atv))
- (:metaclass ml-class)
- (:default-initargs :sab nil :code nil :atn nil :atv nil)
- (:title "Simple Attribute")
- (:ref-fields (sab find-bsab-sab))
- (:fields (sab :string) (code :string) (atn :string) (atv :cdata)))
-
-(defclass uso (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (code :type string :initarg :code :reader code)
- (tty :type string :initarg :tty :reader tty)
- (srl :type fixnum :initarg :srl :reader srl))
- (:metaclass ml-class)
- (:default-initargs :sab nil :code nil :tty nil :srl nil)
- (:title "Source")
- (:ref-fields (sab find-bsab-sab) (tty find-btty-tty))
- (:fields (sab :string) (code :string) (tty :string) (srl :fixnum)))
-
-(defclass ucxt (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (code :type string :initarg :code :reader code)
- (rnk :type fixnum :initarg :rnk :reader rnk)
- (cxn :type fixnum :initarg :cxn :reader cxn)
- (cxl :type string :initarg :cxl :reader cxl)
- (cxs :type string :initarg :cxs :reader cxs)
- (cui2 :type fixnum :initarg :cui2 :reader cui2)
- (hcd :type string :initarg :hcd :reader hcd)
- (rela :type string :initarg :rela :reader rela)
- (xc :type string :initarg :xc :reader xc))
- (:metaclass ml-class)
- (:default-initargs :sab nil :code nil :rnk nil :cxn nil :cxl nil :cxs nil
- :cui2 nil :hcd nil :rela nil :xc nil)
- (:title "Context")
- (:ref-fields (sab find-bsab-sab) (cui2 find-ucon-cui))
- (:fields
- (sab :string) (code :string) (rnk :fixnum) (cxn :fixnum) (cxl :string)
- (hcd :string) (rela :string) (xc :string) (cui2 :string fmt-cui)
- (cxs :cdata)))
-
-(defclass ustr (umlsclass)
- ((sui :type fixnum :initarg :sui :reader sui)
- (cui :type fixnum :initarg :cui :reader cui)
- (lui :type fixnum :initarg :lui :reader lui)
- (cuisui :type integer :initarg :cuisui :reader cuisui )
- (str :type string :initarg :str :reader str)
- (lrl :type fixnum :initarg :lrl :reader lrl)
- (stt :type string :initarg :stt :reader stt)
- (s#sat :reader s#sat)
- (s#so :reader s#so)
- (s#cxt :reader s#cxt))
- (:metaclass ml-class)
- (:default-initargs
- :sui nil :cui nil :lui nil :cuisui nil :str nil :lrl nil :stt nil)
- (:title "String")
- (:subobjects-lists (s#sat usat) (s#so uso) (s#cxt ucxt))
- (:fields (sui :string fmt-sui) (stt :string) (lrl :fixnum) (str :cdata))
- (:ref-fields (sui find-ustr-sui)))
-
-(defclass ulo (umlsclass)
- ((isn :type string :initarg :isn :reader isn)
- (fr :type fixnum :initarg :fr :reader fr)
- (un :type string :initarg :un :reader un)
- (sui :type fixnum :initarg :sui :reader sui)
- (sna :type string :initarg :sna :reader sna)
- (soui :type string :initarg :soui :reader soui))
- (:metaclass ml-class)
- (:default-initargs :isn nil :fr nil :un nil :sui nil :sna nil :soui nil)
- (:title "Locator")
- (:fields (isn :string) (fr :fixnum) (un :string) (sna :string)
- (soui :string) (sui :string fmt-sui) (suistr :string)))
-
-(defclass uterm (umlsclass)
- ((lui :type fixnum :initarg :lui :reader lui)
- (cui :type fixnum :initarg :cui :reader cui)
- (lat :type string :initarg :lat :reader lat)
- (ts :type string :initarg :ts :reader ts)
- (lrl :type fixnum :initarg :lrl :reader lrl)
- (s#str :reader s#str)
- (s#sat :reader s#sat))
- (:metaclass ml-class)
- (:default-initargs :lui nil :cui nil :lat nil :ts nil :lrl nil)
- (:title "Term")
- (:subobjects-lists (s#sat usat) (s#str ustr))
- (:fields (lui :string fmt-lui) (lat :string) (ts :string) (lrl :fixnum))
- (:ref-fields (lui find-uterm-lui)))
-
-(defclass usty (umlsclass)
- ((tui :type fixnum :initarg :tui :reader tui)
- (sty :type string :initarg :sty :reader sty))
- (:metaclass ml-class)
- (:default-initargs :tui nil :sty nil)
- (:title "Semantic Type")
- (:ref-fields (tui find-ucon-tui (("subobjects" "no"))))
- (:fields (tui :string fmt-tui) (sty :string)))
-
-(defclass urel (umlsclass)
- ((rel :type string :initarg :rel :reader rel)
- (cui1 :type fixnum :initarg :cui1 :reader cui1)
- (cui2 :type fixnum :initarg :cui2 :reader cui2)
- (pfstr2 :type string :initarg :pfstr2 :reader pfstr2)
- (rela :type string :initarg :rela :reader rela)
- (sab :type string :initarg :sab :reader sab)
- (sl :type string :initarg :sl :reader sl)
- (mg :type string :initarg :mg :reader mg))
- (:metaclass ml-class)
- (:default-initargs
- :rel nil :cui1 nil :cui2 nil :pfstr2 nil :rela nil :sab nil :sl nil :mg nil)
- (:title "Relationship")
- (:ref-fields (rel find-brel-rel) (sab find-bsab-sab) (cui2 find-ucon-cui))
- (:fields (rel :string) (rela :string) (sab :string) (sl :string)
- (mg :string) (cui2 :string fmt-cui) (pfstr2 :cdata)))
-
-(defclass ucoc (umlsclass)
- ((cui1 :type fixnum :initarg :cui1 :reader cui1)
- (cui2 :type fixnum :initarg :cui2 :reader cui2)
- (pfstr2 :type string :initarg :pfstr2 :reader pfstr2)
- (soc :type string :initarg :soc :reader soc)
- (cot :type string :initarg :cot :reader cot)
- (cof :type fixnum :initarg :cof :reader cof)
- (coa :type string :initarg :coa :reader coa))
- (:metaclass ml-class)
- (:default-initargs
- :cui1 nil :cui2 nil :pfstr2 nil :soc nil :cot nil :cof nil :coa nil)
- (:title "Co-occuring Concept")
- (:ref-fields (cui2 find-ucon-cui))
- (:fields (soc :string) (cot :string) (cof :fixnum) (coa :cdata)
- (cui2 :string fmt-cui) (pfstr2 :cdata)))
-
-
-(defclass uatx (umlsclass)
- ((sab :type string :initarg :sab :reader sab)
- (rel :type string :initarg :rel :reader rel)
- (atx :type string :initarg :atx :reader atx))
- (:metaclass ml-class)
- (:default-initargs :sab nil :rel nil :atx nil)
- (:title "Associated Expression")
- (:fields (sab :string) (rel :string) (atx :cdata)))
-
-(defclass ucon (umlsclass)
- ((cui :type fixnum :initarg :cui :reader cui )
- (pfstr :initarg :pfstr :reader pfstr)
- (lrl :initarg :lrl :reader lrl)
- (s#term :reader s#term)
- (s#def :reader s#def)
- (s#lo :reader s#lo)
- (s#rel :reader s#rel)
- (s#coc :reader s#coc)
- (s#sat :reader s#sat)
- (s#atx :reader s#atx)
- (s#sty :reader s#sty))
- (:metaclass ml-class)
- (:default-initargs :cui nil :pfstr nil :lrl nil)
- (:title "Concept")
- (:subobjects-lists
- (s#def udef) (s#sty usty) (s#lo ulo) (s#atx uatx) (s#sat usat) (s#rel urel)
- (s#coc ucoc) (s#term uterm))
- (:fields (cui :string fmt-cui) (lrl :fixum) (pfstr :cdata))
- (:ref-fields (cui find-ucon-cui)))
-
-(defclass uxw (umlsclass)
- ((wd :type string :initarg :wd :reader wd)
- (cui :type fixnum :initform nil :initarg :cui :reader cui)
- (lui :type fixnum :initform nil :initarg :lui :reader lui)
- (sui :type fixnum :initform nil :initarg :sui :reader sui))
- (:metaclass ml-class)
- (:default-initargs :wd nil :cui nil :lui nil :sui nil)
- (:title "XW Index")
- (:fields (wd :string) (cui :string fmt-cui) (lui :string fmt-lui)
- (sui :string fmt-sui)))
-
-(defclass uxnw (umlsclass)
- ((lat :type string :initarg :lat :reader lat)
- (nwd :type string :initarg :nwd :reader nwd)
- (cuilist :type list :initarg :cuilist :reader uxnw-cuilist))
- (:metaclass ml-class)
- (:default-initargs :lat nil :nwd nil :cuilist nil)
- (:title "XNW Index")
- (:fields (lat :string) (nwd :string) (cuilist :string)))
-
-(defclass uxns (umlsclass)
- ((lat :type string :initarg :lat :reader lat)
- (nstr :type string :initarg :nstr :reader nstr)
- (cuilist :type list :initarg :cuilist :reader cuilist))
- (:metaclass ml-class)
- (:default-initargs :lat nil :nstr nil :cuilist nil)
- (:title "XNS Index")
- (:fields (lat :string) (nstr :string) (cuilist :string)))
-
-
-;;; LEX objects
-
-(defclass lexterm (umlsclass)
- ((eui :type fixnum :initarg :eui :reader eui)
- (wrd :type string :initarg :wrd :reader wrd)
- (s#abr :reader s#abr)
- (s#agr :reader s#agr)
- (s#cmp :reader s#cmp)
- (s#mod :reader s#mod)
- (s#nom :reader s#nom)
- (s#prn :reader s#prn)
- (s#prp :reader s#prp)
- (s#spl :reader s#spl)
- (s#trm :reader s#trm)
- (s#typ :reader s#typ))
- (:metaclass ml-class)
- (:default-initargs :eui nil :wrd nil)
- (:title "Lexical Term")
- (:subobjects-lists
- (s#abr labr) (s#agr lagr) (s#cmp lcmp) (s#mod lmod) (s#nom unom)
- (s#prn lprn) (s#prp lprp) (s#spl lspl) (s#trm ltrm) (s#typ ltyp))
- (:fields (eui :string fmt-eui) (wrd :string))
- (:ref-fields (eui find-lexterm-eui)))
-
-
-(defclass labr (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (abr :type string :initarg :abr :reader abr)
- (eui2 :type integer :initarg :eui2 :reader eui2)
- (bas2 :type string :initarg :bas2 :reader bas2))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :abr nil :eui2 nil :bas2 nil)
- (:title "Abbreviations and Acronyms")
- (:fields (eui :string fmt-eui) (bas :string) (abr :string)
- (eui2 :string fmt-eui) (bas2 :string )))
-
-(defclass lagr (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (str :type string :initarg :str :reader str)
- (sca :type string :initarg :sca :reader sca)
- (agr :type string :initarg :agr :reader agr)
- (cit :type string :initarg :cit :reader cit)
- (bas :type string :initarg :bas :reader bas))
- (:metaclass ml-class)
- (:default-initargs :eui nil :str nil :sca nil :agr nil :cit nil :bas nil)
- (:title "Agreement and Inflection")
- (:fields (eui :string fmt-eui) (str :string) (sca :string) (agr :string)
- (cit :string) (bas :string)))
-
-(defclass lcmp (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (sca :type string :initarg :sca :reader sca)
- (com :type string :initarg :com :reader com))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :sca nil :com nil)
- (:title "Complementation")
- (:fields (eui :string fmt-eui) (bas :string) (sca :string) (com :string)))
-
-(defclass lmod (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (sca :type string :initarg :sca :reader sca)
- (psnmod :type string :initarg :psnmod :reader psnmod)
- (fea :type string :initarg :fea :reader fea))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :sca nil :psnmod nil :fea nil)
- (:title "Modifiers")
- (:fields (eui :string fmt-eui) (bas :string) (sca :string) (psnmod :string)
- (fea :string)))
-
-(defclass lnom (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (sca :type string :initarg :sca :reader sca)
- (eui2 :type integer :initarg :eui2 :reader eui2)
- (bas2 :type string :initarg :bas2 :reader bas2)
- (sca2 :type string :initarg :sca2 :reader sca2))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :sca nil :eui2 nil :bas2 nil :sca2 nil)
- (:title "Nominalizations")
- (:fields (eui :string fmt-eui) (bas :string) (sca :string)
- (eui2 :string fmt-eui) (bas2 :string) (sca2 :string)))
-
-(defclass lprn (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (num :type string :initarg :num :reader num)
- (gnd :type string :initarg :gnd :reader gnd)
- (cas :type string :initarg :cas :reader cas)
- (pos :type string :initarg :pos :reader pos)
- (qnt :type string :initarg :qnt :reader qnt)
- (fea :type string :initarg :fea :reader fea))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :num nil :gnd nil :cas nil
- :pos nil :qnt nil :fea nil)
- (:title "Pronouns")
- (:fields (eui :string fmt-eui) (bas :string) (num :string) (gnd :string)
- (cas :string) (pos :string) (qnt :string) (fea :string)))
-
-(defclass lprp (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (str :type string :initarg :str :reader str)
- (sca :type string :initarg :sca :reader sca)
- (fea :type string :initarg :fea :reader fea))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :str nil :sca nil :fea nil)
- (:title "Properties")
- (:fields (eui :string fmt-eui) (bas :string) (str :string) (sca :string)
- (fea :string)))
-
-
-(defclass lspl (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (spv :type string :initarg :spv :reader spv)
- (bas :type string :initarg :bas :reader bas))
- (:metaclass ml-class)
- (:default-initargs :eui nil :spv nil :bas nil)
- (:title "Spelling Variants")
- (:fields (eui :string fmt-eui) (spv :string) (bas :string)))
-
-
-
-(defclass ltrm (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (gen :type string :initarg :gen :reader gen))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :gen nil)
- (:title "Trade Marks")
- (:fields (eui :string fmt-eui) (bas :string) (gen :string)))
-
-(defclass ltyp (umlsclass)
- ((eui :type integer :initarg :eui :reader eui)
- (bas :type string :initarg :bas :reader bas)
- (sca :type string :initarg :sca :reader sca)
- (typ :type string :initarg :typ :reader typ))
- (:metaclass ml-class)
- (:default-initargs :eui nil :bas nil :sca nil :typ nil)
- (:title "Inflection Type")
- (:fields (eui :string fmt-eui) (bas :string) (sca :string) (typ :string)))
-
-(defclass lwd (umlsclass)
- ((wrd :type string :initarg :wrd :reader wrd)
- (euilist :type list :initarg :euilist :reader euilist))
- (:metaclass ml-class)
- (:default-initargs :wrd nil :euilist nil)
- (:title "Lexical Word Index")
- (:fields (wrd :string) (euilist :string)))
-
-;;; Semantic NET objects
-
-(defclass sdef (umlsclass)
- ((rt :type string :initarg :rt :reader rt)
- (ui :type integer :initarg :ui :reader ui)
- (styrl :type string :initarg :styrl :reader styrl)
- (stnrtn :type string :initarg :stnrtn :reader stnrtn)
- (def :type string :initarg :def :reader def)
- (ex :type string :initarg :ex :reader ex)
- (un :type string :initarg :un :reader un)
- (rh :type string :initarg :rh :reader rh)
- (abr :type string :initarg :abr :reader abr)
- (rin :type string :initarg :rin :reader rin))
- (:metaclass ml-class)
- (:default-initargs
- :rt nil :ui nil :styrl nil :stnrtn nil :def nil :ex nil :un nil :rh nil
- :abr nil :rin nil)
- (:title "Basic information about Semantic Types and Relations")
- (:fields
- (rt :string) (ui :string fmt-tui) (styrl :string) (stnrtn :string-tui)
- (def :string) (ex :string) (un :string) (rh :string) (abr :string)
- (rin :string)))
-
-(defclass sstr (umlsclass)
- ((styrl :type string :initarg :styrl :reader styrl)
- (rl :type string :initarg :rl :reader rl)
- (styrl2 :type string :initarg :styrl2 :reader styrl2)
- (ls :type string :initarg :ls :reader ls))
- (:metaclass ml-class)
- (:default-initargs :styrl nil :rl nil :styrl2 nil :ls nil)
- (:title "Structure of the Network")
- (:fields (styrl :string) (rl :string) (styrl2 :string) (ls :string)))
-
-(defclass sstre1 (umlsclass)
- ((ui :type integer :initarg :ui :reader ui)
- (ui2 :type integer :initarg :ui2 :reader ui2)
- (ui3 :type integer :initarg :ui3 :reader ui3))
- (:metaclass ml-class)
- (:default-initargs :ui nil :ui2 nil :ui3 nil)
- (:title "Fully Inherited Set of Releatons (TUI's)")
- (:fields (ui :string fmt-tui) (ui2 :string fmt-tui) (ui3 :string fmt-tui)))
-
-(defclass sstre2 (umlsclass)
- ((sty :type string :initarg :ui :reader sty)
- (rl :type string :initarg :ui2 :reader rl)
- (sty2 :type string :initarg :ui3 :reader sty2))
- (:metaclass ml-class)
- (:default-initargs :sty nil :rl nil :sty2 nil)
- (:title "Fully Inherited Set of Releatons (strings)")
- (:fields (sty :string) (rl :string) (sty2 :string)))
-
-;;; Formatting routines
-
-(defmethod fmt-cui ((c ucon))
- (format nil "C~7,'0d" (cui c)))
-
-(defmethod fmt-cui ((c fixnum))
- (format nil "C~7,'0d" c))
-
-(defmethod fmt-cui ((c string))
- (if (eql (aref c 0) #\C)
- c
- (format nil "C~7,'0d" (parse-integer c))))
-
-(defmethod fmt-cui ((c null))
- (format nil "nil"))
-
-(defmethod fmt-lui ((l uterm))
- (format nil "L~7,'0d" (lui l)))
-
-(defmethod fmt-lui ((l fixnum))
- (format nil "L~7,'0d" l))
-
-(defmethod fmt-lui ((l string))
- (if (eql (aref l 0) #\L)
- l
- (format nil "L~7,'0d" (parse-integer l))))
-
-(defmethod fmt-sui ((s ustr))
- (format nil "S~7,'0d" (sui s)))
-
-(defmethod fmt-sui ((s fixnum))
- (format nil "S~7,'0d" s))
-
-(defmethod fmt-sui ((s string))
- (if (eql (aref s 0) #\S)
- s
- (format nil "S~7,'0d" (parse-integer s))))
-
-(defmethod fmt-tui ((s fixnum))
- (format nil "T~3,'0d" s))
-
-(defmethod fmt-tui ((s string))
- (if (eql (aref s 0) #\T)
- s
- (format nil "T~3,'0d" (parse-integer s))))
-
-(defmethod fmt-eui ((e fixnum))
- (format nil "E~7,'0d" e))
-
-(defmethod fmt-eui ((e string))
- (if (eql (aref e 0) #\E)
- e
- (format nil "E~7,'0d" (parse-integer e))))
-
-(defmethod fmt-eui ((e null))
- (format nil "nil"))
-
-;;; Generic display functions
-
-(eval-when (:compile-toplevel :load-toplevel :execute)
-(defun english-term-p (obj)
- (and (eq (class-name (class-of obj)) 'uterm)
- (string-equal (lat obj) "ENG"))))
-
-(defun display-umls-obj
- (obj &key (os *standard-output*) (format :text) (label nil)
- (file-wrapper t) (english-only nil) (subobjects nil)
- (refvars nil))
- (display-ml-class
- obj :os os :format format :label label :subobjects subobjects
- :file-wrapper file-wrapper
- :english-only-function (if english-only #'english-term-p nil)
- :refvars refvars))
-
-(defmacro defludisp-ml-class (newfuncname lookup-func)
- "Defines functions for looking up and displaying objects"
- `(defun ,newfuncname
- (keyval &key (os *standard-output*) (format :text) (label nil)
- (file-wrapper t) (english-only nil) (subobjects nil))
- (let ((obj (funcall ,lookup-func keyval)))
- (display-umls-obj obj :os os :format format :label label
- :file-wrapper file-wrapper :english-only english-only
- :subobjects subobjects))))
-
-(defludisp-ml-class disp-con #'find-ucon-cui)
-(defludisp-ml-class disp-term #'find-uterm-lui)
-(defludisp-ml-class disp-str #'find-ustr-sui)
-