-;;; ArticleSet and Article Classes
-
-(defclass pmsearch ()
- ((search-str :type string :accessor search-str)
- (date :type string :accessor date)
- (user-id :type fixnum :accessor user-id))
- (:documentation "Pubmed Stored Search Class"))
-
-(defclass pmarticleset ()
- ((search-str :type string :initarg :search-str :accessor search-str)
- (total-count :type fixnum :initarg :total-count :accessor total-count)
- (article-count :type fixnum :initarg :article-count :accessor article-count)
- (article-start :type fixnum :initarg :article-start :accessor article-start)
- (articles :type list :initarg :articles :accessor articles))
+(define-condition pubmed-condition ()
+ ())
+
+
+(define-condition pubmed-server-error (error pubmed-condition)
+ ((response :initarg :response
+ :initform nil
+ :reader pubmed-server-error-response))
+ (:report (lambda (c stream)
+ (format stream "A PubMed server error occurred.")
+ (awhen (pubmed-server-error-response c)
+ (format stream " The server response was:~&~S" it)))))
+
+;;; Article-Set and Article Classes
+
+(defclass pm-article-set ()
+ ((query :type string :initarg :query :accessor articles-query)
+ (articles :type list :initarg :articles :accessor articles)
+ (total :type fixnum :initarg :total :accessor articles-total)
+ (count :type fixnum :initarg :count :accessor articles-count)
+ (start :type fixnum :initarg :start :accessor articles-start))