docs: def get_or_create_citation(self,
                                 reference: str,
                                 type: Optional[str] = None,
                                 name: Optional[str] = None,
                                 title: Optional[str] = None,
                                 volume: Optional[str] = None,
                                 issue: Optional[str] = None,
                                 pages: Optional[str] = None,
                                 date: Optional[str] = None,
                                 first: Optional[str] = None,
                                 last: Optional[str] = None,
                                 authors: Union[None, List[str]] = None,
                                 ) -> Citation:
          """Create a citation if it does not exist, or return it if it does.
  
          :param type: Citation type (e.g. PubMed)
          :param reference: Identifier of the given citation (e.g. PubMed id)
          :param name: Name of the publication
          :param title: Title of article
          :param volume: Volume of publication
          :param issue: Issue of publication
          :param pages: Pages of issue
          :param date: Date of publication in ISO 8601 (YYYY-MM-DD) format
          :param first: Name of first author
          :param last: Name of last author
          :param authors: Either a list of authors separated by |, or an actual list of authors
          """
          if type is None:
              type = CITATION_TYPE_PUBMED
  
          sha512 = hash_citation(type=type, reference=reference)
  
          if sha512 in self.object_cache_citation:
              citation = self.object_cache_citation[sha512]
              self.session.add(citation)
              return citation
  
          citation = self.get_citation_by_hash(sha512)
  
          if citation is not None:
              self.object_cache_citation[sha512] = citation
              return citation
  
          citation = Citation(
              type=type,
              reference=reference,
              sha512=sha512,
              name=name,
              title=title,
              volume=volume,
              issue=issue,
              pages=pages
          )
          if date is not None:
              citation.date = parse_datetime(date)
  
          if first is not None:
              citation.first = self.get_or_create_author(first)
  
          if last is not None:
              citation.last = self.get_or_create_author(last)
  
          if authors is not None:
              for author in authors:
                  author_model = self.get_or_create_author(author)
                  if author_model not in citation.authors:
                      citation.authors.append(author_model)
  
          self.session.add(citation)
          self.object_cache_citation[sha512] = citation
          return citation