📄 medlinecitation.java
字号:
/* * LingPipe v. 3.5 * Copyright (C) 2003-2008 Alias-i * * This program is licensed under the Alias-i Royalty Free License * Version 1 WITHOUT ANY WARRANTY, without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Alias-i * Royalty Free License Version 1 for more details. * * You should have received a copy of the Alias-i Royalty Free License * Version 1 along with this program; if not, visit * http://alias-i.com/lingpipe/licenses/lingpipe-license-1.txt or contact * Alias-i, Inc. at 181 North 11th Street, Suite 401, Brooklyn, NY 11211, * +1 (718) 290-9170. */package com.aliasi.medline;import com.aliasi.xml.DelegatingHandler;import com.aliasi.xml.DelegateHandler;import com.aliasi.xml.TextAccumulatorHandler;import java.io.IOException;import java.text.DateFormat;import java.text.ParseException;import java.text.SimpleDateFormat;import java.util.ArrayList;import java.util.Arrays;import java.util.Date;import java.util.Locale;import org.xml.sax.Attributes;import org.xml.sax.InputSource;import org.xml.sax.SAXException;import org.xml.sax.XMLReader;import org.xml.sax.helpers.DefaultHandler;/** * A <code>MedlineCitation</code> represents the content of a single * record in the 2008 MEDLINE database for the citation of an individual * article. * * <P>A citation contains a richly structured set of information. * Each citation contains an {@link Article}, which contains most of * the information drawn from the article itself. The other * information has been added by the creators of MEDLINE and comes in * two flavors. The first type is information about the MEDLINE * record itself, such as who "owns" it, when it was * created, completed and revised, etc. The second type of * information is metadata about the article itself, such as names of * chemicals and database links, keywords, lists of MeSH terms, gene * names and database links, cross-references to comments or * corrections in other articles, etc. * * <P>In addition to the structured information in a citation the raw * XML is available as a string through the {@link #xmlString()} * method. * * @author Bob Carpenter * @version 3.3 * @since LingPipe2.0 */public class MedlineCitation { private final String mNlmDcmsID; private final String mPMID; private final String mOwner; private final String mStatus; private final Date mDateCreated; private final Date mDateCompleted; private final Date mDateRevised; private final Chemical[] mChemicals; private final String[] mCitationSubsets; private final MeshHeading[] mMeshHeadings; private final String mNumberOfReferences; private final PersonalNameSubject[] mPersonalNameSubjects; private final KeywordList[] mKeywordLists; private final GeneralNote[] mGeneralNotes; private final String[] mGeneSymbols; private final String[] mSpaceFlightMissions; private final OtherID[] mOtherIDs; private final Investigator[] mInvestigators; private final OtherAbstract[] mOtherAbstracts; private final CommentOrCorrection[] mCommentOrCorrections; private final JournalInfo mJournalInfo; private final Article mArticle; private String mXMLString; MedlineCitation(String owner, String status, String nlmDcmsID, String pmid, Date dateCreated, Date dateCompleted, Date dateRevised, Chemical[] chemicals, String[] citationSubsets, MeshHeading[] meshHeadings, String numberOfReferences, PersonalNameSubject[] personalNameSubjects, KeywordList[] keywordLists, GeneralNote[] generalNotes, String[] geneSymbols, String[] spaceFlightMissions, OtherID[] otherIDs, Investigator[] investigators, OtherAbstract[] otherAbstracts, CommentOrCorrection[] commentOrCorrections, JournalInfo journalInfo, Article article) { mOwner = owner; mStatus = status; mNlmDcmsID = nlmDcmsID; mPMID = pmid; mDateCreated = dateCreated; mDateCompleted = dateCompleted; mDateRevised = dateRevised; mChemicals = chemicals; mCitationSubsets = citationSubsets; mMeshHeadings = meshHeadings; mNumberOfReferences = numberOfReferences; mPersonalNameSubjects = personalNameSubjects; mKeywordLists = keywordLists; mGeneralNotes = generalNotes; mGeneSymbols = geneSymbols; mSpaceFlightMissions = spaceFlightMissions; mOtherIDs = otherIDs; mInvestigators = investigators; mOtherAbstracts = otherAbstracts; mCommentOrCorrections = commentOrCorrections; mJournalInfo = journalInfo; mArticle = article; } /** * Returns the XML underlying this citation as a string. Note * that there will be no XML declaration in this string, nor * will there be a DTD reference. All entities and defaults * provided by the DTD will be expanded into the string. * * @return The XML underlying this citation as a string. */ public String xmlString() { return mXMLString; } /** * The owner is the group that created and validated this * citation. Each citation has a unique owner, which takes on one * of the following possible values, shown with their * corresponding constants in {@link MedlineCitationSet}. * * <blockquote> * <table border='1' cellpadding='5'> * <tr><td><i>Value</i></td> * <td><i>Constant in</i> <code>MedlineCitationSet</code></td> * <td><i>Description</i></td><td><i>Notes</i></tr> * <tr><td>NLM</td><td>NLM_VALUE</td> * <td>(U.S.) National Library of Medicine, Index Section</td> * <td>Value for majority of citations</td></tr> * <tr><td>NASA</td><td>NASA_VALUE</td> * <td>(U.S.) National Aeronautics and Space Administration</td> * <td> </td></tr> * <tr><td>PIP</td><td>PIP_VALUE</td> * <td>Population Information Program, Johns Hopkins</td> * <td>Not current; only on older citations</td></tr> * <tr><td>KIE</td><td>KIE_VALUE</td> * <td>Kennedy Institute of Ethics, Georgetown University</td> * <td> </td></tr> * <tr><td>HSR</td><td>HSR_VALUE</td> * <td>(U.S.) National Infomration Center on Health Services Reserach * and Health Care Technology, National Library of Medicine</td> * <td> </td></tr> * <tr><td>HMD</td><td>HMD_VALUE</td> * <td>History of Medicine Division, National Library of Medicine</td> * <td> </td></tr> * <tr><td>SIS</td><td>SIS_VALUE</td> * <td>Specialized Information Services Division, * National Library of Medicine</td> * <td>Not yet used; reserved for future use.</td></tr> * <tr><td>NOTNLM</td><td>NOT_NLM_VALUE</td> * <td>Not from NLM</td> * <td>Will never be used for any distributed MEDLINE record</td></tr> * </table> * </blockquote> * * <P>These values may also appear as owners of general notes and * keyword lists. * * @return The owner of the group that created and validated this * citation. */ public String owner() { return mOwner; } /** * Returns the status of this citation. The status is always * defined, and takes one of the values listed below. As articles * progress through the pipeline, they are rereleased with new * status values; the later versions should replace the earlier * ones based on PubMed identifier. * * <blockquote> * <table border='1' cellpadding='5'> * <tr><td><i>Value</i></td> * <td><i>Constant in</i> <code>MedlineCitationSet</code></td> * <td><i>Notes</i></td></tr> * <tr><td>In-Data-Review</td><td>IN_DATA_REVIEW_VALUE</td> * <td>Reference citation elements at the journal issue level have * been checked against print or online versions. Citations * with this status lack completion dates. They have not * undergrone quality assurance nor had MeSH terms added.</td></tr> * <tr><td>In-Process</td><td>IN_PROCESS_VALUE</td> * <td>Citation elements at the article level have been * reviewed, including author names, title and pagination. * Not every in-process article is promoted to MEDLINE; some * are classified out of scope and receive PubMed-not-Medline * as their final status</td></tr> * <tr><td>Completed</td><td>COMPLETED_VALUE</td> * <td>These are 'true' MEDLINE records with * date completed and typically with MeSH headings. * This status remains under revisions.</td></tr> * <tr><td>PubMed-not-MEDLINE</td><td>PUBMED_NOT_MEDLINE_VALUE * <td>These are articles have gone through data review, * but were not chosen for inclusion. They fall into * the following categories: * (1) citations that precede the data a journal was * selected for MEDLINE, (2) citations that are out of scope, * and (3) analytical summaries of articles published * elsewhere.</td></tr> * <tr><td>Publisher</td><td>PUBLISHER_VALUE</td> * <td>These are not distributed to licensees, and include * a number of categories of yet-to-be processed, out of scope, * and out of date articles.</td></tr> * <tr><td>MEDLINE</td><td>MEDLINE_VALUE</td> * <td>2005 addition not yet documented by the NLM.</td></tr> * <tr><td>OLDMEDLINE</td><td>MEDLINE_VALUE</td> * <td>2005 addition not yet documented by the NLM.</td></tr> * </table> * </blockquote> * * @return The status of this citation. */ public String status() { return mStatus; } /** * Returns the NLM DCMS identifier for this document. * May return <code>null</code> if there is no identifier. * * <P>The PubMed identifier, available through the method {@link * #pmid()}, is the official identifier for MEDLINE documents. * * <P>Note that this identifier was introduced in 2005 and * was previously known as the MEDLINE ID. * * @return The NLM DCMS identifier for this document. */ public String nlmDcmsID() { return mNlmDcmsID; } /** * Returns the PubMed identifier for this document. This is now * the official identifier for MEDLINE documents. Each document * has a unique PubMed identifier, which will be a one to eight * digit accession number without leading zeros. The identifiers * of deleted records will not be reused. * * @return The PubMed identifier for this document. */ public String pmid() { return mPMID; } /** * Returns the date on which this citation was created. Note that * this is <i>not</i> the date on which the article was created, * but is the date on which the MEDLINE citation for the article * was created. The value will be non-null because every citation * is required to have a creation date. The date will only be * resolved to the level of day, month and year. * * <P>Note that this is also not the same as the PubMed Entrez * date, which is not distributed as part of MEDLINE. * * @return The date on which this citation was created. */ public Date dateCreated() { return mDateCreated; } /** * Returns the date that the processing of this citation ended or * <code>null</code> if it is still in process. Specifically, * citations are completed when all extra information has been * added and quality assurance has been completed. If a record's * status is in-process, as indicated by method {@link #status()}, * it lacks a date completed, so that this method will return * <code>null</code>. The date will only be resolved to the level * of day, month and year. * * <P>For ciations before about the year 2000, the date created * and date completed were set to the same value. * * @return The date that this citation was completed. */ public Date dateCompleted() { return mDateCompleted; } /** * Returns the latest date on which a change was made to this * citation as a result of maintenance. Note that no information * is provided in MEDLINE as to the nature of the change, and only * the latest revision date is included. The date will only be * resolved to the level of day, month and year. The value may be * <code>null</code> if this citation has not been revised. * * <P>Note that every record that existed at the time was revised * on 18 December 2000, and many of these have been revised * subsequently. *
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -