Validate and lookup DOI/PMID with comprehensive error handling
Source:R/mod_references_fct_crossref.R
validate_and_lookup_identifier.RdMain function that validates input format, converts PMID to DOI if needed, looks up publication data from Crossref, and returns formatted results.
Usage
validate_and_lookup_identifier(input_string, access_date = Sys.Date())Value
List with components:
success: Logical indicating whether lookup succeeded
data: Mapped field data (if success = TRUE) or NULL
message: Status message for user feedback
identifier_type: Type of identifier detected ("doi" or "pmid")
Details
This is the main entry point for DOI/PMID lookup functionality. It handles the complete workflow:
Validate input format
Convert PMID to DOI if necessary
Query Crossref for publication data
Map results to reference field format