primary reference

Updated to retrieve the study reference marked with PRIMARY="YES" if it
exists, otherwise returns the first listed