Class NihmsPublicationToSubmission

java.lang.Object
org.eclipse.pass.loader.nihms.NihmsPublicationToSubmission

@Component public class NihmsPublicationToSubmission extends Object
Does the heavy lifting of data transform work, converting a NihmsPublication to a NihmsSubmissionDTO (submission + deposits) for loading to the database
Author:
Karen Hanson
  • Constructor Details

    • NihmsPublicationToSubmission

      public NihmsPublicationToSubmission(NihmsPassClientService clientService, PmidLookup pmidLookup)
      Constructor initiates with the required NIHMS Client Service and PMID lookup Useful to pass in an existing clientService to reuse cache
      Parameters:
      clientService - PASS client
      pmidLookup - Entrez client
  • Method Details

    • transform

      public SubmissionDTO transform(NihmsPublication pub) throws IOException
      Does the heavy lifting of converting a NihmsPublication record into the NihmsSubmissionDTO that is needed for the NihmsLoader
      Parameters:
      pub - the publication
      Returns:
      the DTO, never null
      Throws:
      IOException - if there is a problem with the lookup of the publication, repository, submission
    • calcRepoCopyStatus

      public static CopyStatus calcRepoCopyStatus(NihmsPublication pub, CopyStatus currCopyStatus)
      Determines a new deposit status based on various dates populated in the NIHMS publication If the status registered in PASS is further along than NIHMS thinks we are, roll back to what NIHMS says and log the fact as a warning. If this calc returns NULL, a repository copy should not have been created
      Parameters:
      pub - the publication
      currCopyStatus - current RepositoryCopy CopyStatus
      Returns:
      the new copy status, may be null