001 /*
002 Copyright (c) 2012, Regents of the University of Colorado
003 All rights reserved.
004
005 Redistribution and use in source and binary forms, with or without modification,
006 are permitted provided that the following conditions are met:
007
008 * Redistributions of source code must retain the above copyright notice, this
009 list of conditions and the following disclaimer.
010
011 * Redistributions in binary form must reproduce the above copyright notice,
012 this list of conditions and the following disclaimer in the documentation
013 and/or other materials provided with the distribution.
014
015 * Neither the name of the University of Colorado nor the names of its
016 contributors may be used to endorse or promote products derived from this
017 software without specific prior written permission.
018
019 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
020 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
021 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
022 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
023 ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
024 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
025 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
026 ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
027 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
028 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
029 */
030 package edu.ucdenver.ccp.medline.parser;
031
032 import java.util.List;
033
034 import lombok.Getter;
035 import lombok.ToString;
036
037 import com.thoughtworks.xstream.annotations.XStreamAlias;
038 import com.thoughtworks.xstream.annotations.XStreamAsAttribute;
039 import com.thoughtworks.xstream.annotations.XStreamImplicit;
040
041 /**
042 * @author Center for Computational Pharmacology, UC Denver; ccpsupport@ucdenver.edu
043 *
044 */
045 @Getter
046 @ToString
047 @XStreamAlias("PubmedArticle")
048 public class PubmedArticle extends PubmedArticleBase {
049
050 @XStreamAlias("MedlineCitation")
051 private MedlineCitation medlineCitation;
052
053 @XStreamAlias("PubmedData")
054 private PubmedData pubmedData;
055
056 @Getter
057 public static class PubmedData {
058
059 @XStreamAlias("History")
060 private History history;
061
062 @XStreamAlias("PublicationStatus")
063 private String publicationStatus;
064
065 @XStreamAlias("ArticleIdList")
066 private ArticleIdList articleIdList;
067
068 }
069
070 @Getter
071 @XStreamAlias("History")
072 public static class History {
073 @XStreamImplicit
074 List<PubMedPubDate> pubDates;
075 }
076
077 @Getter
078 @XStreamAlias("PubMedPubDate")
079 public static class PubMedPubDate {
080
081 @XStreamAlias("PubStatus")
082 @XStreamAsAttribute
083 private String pubStatus;
084
085 @XStreamAlias("Year")
086 private int year;
087
088 @XStreamAlias("Month")
089 private String month;
090
091 @XStreamAlias("Day")
092 private String day;
093
094 @XStreamAlias("Hour")
095 private int hour;
096
097 @XStreamAlias("Minute")
098 private int minute;
099
100 }
101
102 @Getter
103 @XStreamAlias("ArticleIdList")
104 public static class ArticleIdList {
105
106 @XStreamImplicit
107 List<ArticleId> articleIds;
108 }
109
110 @Getter
111 @XStreamAlias("ArticleId")
112 public static class ArticleId {
113
114 @XStreamAlias("IdType")
115 @XStreamAsAttribute
116 private String idType;
117
118 private String id; // write converter to get this
119 }
120 }