Commit 59ffab77 authored by Keith Jolley's avatar Keith Jolley
Browse files

Include publications in isolate REST output.

parent 0a1807dd
......@@ -79,6 +79,12 @@ get '/db/:db/isolates/:id' => sub {
push @$values, { $field => $field_values->{ lc $field } } if defined $field_values->{ lc $field };
}
}
my $pubmed_ids = $self->{'datastore'}->run_query("SELECT pubmed_id FROM refs WHERE isolate_id=? ORDER BY pubmed_id", $id, {fetch => 'col_arrayref'});
if (@$pubmed_ids){
my @refs;
push @refs, "http://www.ncbi.nlm.nih.gov/pubmed/$_" foreach @$pubmed_ids;
push @$values, {publications => \@refs};
}
return $values;
};
1;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment