r5126: *** empty log message ***
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 15 Jun 2003 07:48:30 +0000 (07:48 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 15 Jun 2003 07:48:30 +0000 (07:48 +0000)
class-support.lisp
package.lisp

index 5f8778da086ce822185cdf9f420d9dd2ae33a896..84a4790d74672f2e9e55c81c1a31fd471994ade0 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Author:       Kevin M. Rosenberg
 ;;;; Date Started: Apr 2000
 ;;;;
-;;;; $Id: class-support.lisp,v 1.12 2003/06/12 16:37:44 kevin Exp $
+;;;; $Id: class-support.lisp,v 1.13 2003/06/15 07:48:30 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2003 by Kevin M. Rosenberg, M.D.
 (defmethod fmt-eui ((e null))
   (format nil "nil"))
 
+(defun cui-p (ui)
+  "Check if a string is a CUI"
+  (check-ui ui #\C 7))
+
+(defun lui-p (ui)
+  "Check if a string is a LUI"
+  (check-ui ui #\L 7))
+
+(defun sui-p (ui)
+  "Check if a string is a SUI"
+  (check-ui ui #\S 7))
+
+(defun tui-p (ui)
+  (check-ui ui #\T 3))
+
+(defun eui-p (ui)
+  (check-ui ui #\E 7))
+
+(defun check-ui (ui start-char len)
+  (when (and (stringp ui)
+            (= (length ui) (1+ len))
+            (char-equal start-char (schar ui 0))
+            (ignore-errors (parse-integer ui :start 1)))
+    t))
+
+
 ;;; Generic display functions
 
 (eval-when (:compile-toplevel :load-toplevel :execute)
index d8946fbada92e93dedd63276a28ebdc41f5133a8..fd299e9f785deca0b3a931ba3c444301984b87ba 100644 (file)
@@ -7,7 +7,7 @@
 ;;;; Programmer:    Kevin M. Rosenberg
 ;;;; Date Started:  Apr 2000
 ;;;;
-;;;; $Id: package.lisp,v 1.20 2003/06/10 22:30:16 kevin Exp $
+;;;; $Id: package.lisp,v 1.21 2003/06/15 07:48:30 kevin Exp $
 ;;;;
 ;;;; This file, part of UMLisp, is
 ;;;;    Copyright (c) 2000-2003 by Kevin M. Rosenberg, M.D.
@@ -45,6 +45,7 @@
    #:fmt-cui #:fmt-tui #:fmt-sui #:fmt-eui #:fmt-tui
    #:display-con #:display-term #:display-str
    #:uterm-pfstr
+   #:cui-p #:lui-p #:sui-p #:tui-p #:eui-p
    
    ;; From sql.lisp
    #:umls-sql-user!