public void onPubmedIdUpdate(Publication publication, String oldId) { if (oldId == null){ publicationChangeLogger.log(Level.INFO, "The pubmed id has been initialised for the publication " + publication.toString()); } else if (publication.getPubmedId() == null){ publicationChangeLogger.log(Level.INFO, "The pubmed id has been reset for the publication " + publication.toString()); } else { publicationChangeLogger.log(Level.INFO, "The pubmed id " + oldId + " has been updated with " + publication.getPubmedId() + " in the publication " + publication.toString()); } }
public static Xref getPubmedReference(Publication pub){ if (pub == null){ return null; } else if (pub.getPubmedId() == null){ return null; } else{ return XrefUtils.collectFirstIdentifierWithDatabaseAndId(pub.getIdentifiers(), Xref.PUBMED_MI, Xref.PUBMED, pub.getPubmedId()); } }
public static String getPubmedId(Experiment exp){ if (exp == null){ return null; } else if (exp.getPublication() == null){ return null; } else{ return exp.getPublication().getPubmedId(); } }
@Override public void onImexIdAssigned(Publication intactPublication, String imex) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } NewAssignedImexEvent evt = new NewAssignedImexEvent(this, pubId, imex, null, null); getImexCentralManager().fireOnNewImexAssigned(evt); }
@Override public void onMissingImexId(Publication intactPublication) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.no_IMEX_id, pubId, null, null, null, "Publication " + ((IntactPublication)intactPublication).getAc() + " does not have a valid IMEx id and is ignored."); imexCentralManager.fireOnImexError(errorEvt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onImexIdConflicts(Publication intactPublication, Collection<Xref> conflictingXrefs) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.publication_imex_conflict, pubId, null, null, null, "Publication " + pubId + " cannot be updated because of IMEx identifier conflicts."); getImexCentralManager().fireOnImexError(errorEvt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onPublicationWhichCannotBeRegistered(Publication intactPublication) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } // unassigned publication, cannot use the webservice to automatically assign IMEx id for now, ask the curator to manually register and assign IMEx id to this publication if (!Pattern.matches(ImexCentralManager.PUBMED_REGEXP.toString(), pubId)){ log.warn("It is not possible to register an unassigned publication. " + "The publication needs to be registered manually by a curator in IMEx central."); } // the publication is already registered, we just update status and users else { ImexErrorEvent evt = new ImexErrorEvent(this, ImexErrorType.no_record_created, pubId, null, null, null, "It is not possible to register the publication " + pubId + " in IMEx central."); getImexCentralManager().fireOnImexError(evt); } // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onPublicationAlreadyRegisteredInImexCentral(Publication intactPublication, String imex) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } // we already have an IMEx id in IMEx central, it is not possible to update the intact publication because we have a conflict ImexErrorEvent evt = new ImexErrorEvent(this, ImexErrorType.publication_already_in_imex, pubId, imex, null, null, "It is not possible to assign a valid IMEx id to the publication " + pubId + " because it already registered in IMEx central with another institution"); getImexCentralManager().fireOnImexError(evt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
@Override public void onImexIdNotRecognized(Publication intactPublication, String imex) { String pubId = intactPublication.getPubmedId() != null ? intactPublication.getPubmedId() : intactPublication.getDoi(); if (pubId == null && !intactPublication.getIdentifiers().isEmpty()){ Xref id = intactPublication.getXrefs().iterator().next(); pubId = id.getId(); } ImexErrorEvent errorEvt = new ImexErrorEvent(this, ImexErrorType.imex_not_recognized, pubId, imex, null, null, "Publication " + ((IntactPublication)intactPublication).getAc() + " is not matching any record in IMEx central with id " + imex); getImexCentralManager().fireOnImexError(errorEvt); // do not update experiments and interactions getImexCentralManager().setEnableExperimentsAndInteractionsUpdate(false); }
hashcode = 31*hashcode + pub.getImexId().hashCode(); else if (pub.getPubmedId() != null){ hashcode = 31*hashcode + pub.getPubmedId().hashCode();
String pubmed1 = publication1.getPubmedId(); String pubmed2 = publication2.getPubmedId(); String doi1 = publication1.getDoi(); String doi2 = publication2.getDoi();
String pubmed1 = publication1.getPubmedId(); String pubmed2 = publication2.getPubmedId(); boolean hasPubmedId1 = pubmed1 != null; boolean hasPubmedId2 = pubmed2 != null;
String pubId = publication.getPubmedId() != null ? publication.getPubmedId() : publication.getDoi(); String source = publication.getPubmedId() != null ? Xref.PUBMED : Xref.DOI; if (pubId == null && !publication.getIdentifiers().isEmpty()){ Xref id = publication.getXrefs().iterator().next();