Skip to content

Commit

Permalink
add shortCitation to JSON and fix pubModID logic (#1782)
Browse files Browse the repository at this point in the history
(cherry picked from commit fb163ea)
  • Loading branch information
cmpich authored Jan 6, 2025
1 parent 37b859c commit 1301d0c
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class Reference extends InformationContentEntity {
@EqualsAndHashCode.Include
private List<CrossReference> crossReferences;

@JsonView({View.FieldsOnly.class})
@JsonView({View.FieldsOnly.class, View.ForPublic.class})
@FullTextField(analyzer = "autocompleteAnalyzer", searchAnalyzer = "autocompleteSearchAnalyzer")
@KeywordField(name = "shortCitation_keyword", aggregable = Aggregable.YES, sortable = Sortable.YES, searchable = Searchable.YES, normalizer = "sortNormalizer")
@Column(columnDefinition = "TEXT")
Expand Down Expand Up @@ -82,7 +82,7 @@ private String getReferenceID(boolean pubmedIdFirst) {
if (!pubmedIdFirst) {
String pmid = "PMID";
primaryXrefOrder = ReferenceConstants.primaryXrefOrder.stream()
.filter(s -> s.equals(pmid)).toList();
.filter(s -> !s.equals(pmid)).toList();
boolean success = primaryXrefOrder.size() < ReferenceConstants.primaryXrefOrder.size();
if (!success) {
throw new RuntimeException("Could not find " + pmid + " in ReferenceConstants.primaryXrefOrder");
Expand Down

0 comments on commit 1301d0c

Please sign in to comment.