Bug #8322

Specimens showing up in profile but not in "/specimens" page

Added by Abram Connelly over 5 years ago. Updated over 5 years ago.

Status:
New
Priority:
Normal
Assigned To:
-
Category:
-
Target version:
-
Start date:
01/29/2016
Due date:
% Done:

0%

Estimated time:
Story points:
-

Description

There are public specimens that are viewable from the profile page but not the "/specimens" list.

For example, the profile for hu826751 shows:

PGP Blood Collection     Sample 30380893 (whole blood) received 2013-05-06 21:28:00 UTC by hu826751.   Show log
Sample 41803289 (whole blood) received 2013-05-06 21:28:00 UTC by hu826751.   Show log
Sample 23397098 (whole blood) received 2013-05-06 21:27:59 UTC by hu826751.   Show log
Sample 37059756 (whole blood) received 2013-05-06 21:27:59 UTC by hu826751.   Show log
Sample 5515657 (whole blood) received 2013-05-06 21:27:59 UTC by hu826751.   Show log
Sample 92175438 (whole blood) received 2013-05-06 21:27:59 UTC by hu826751.   Show log
Saliva Collection for Multiple Studies     Sample 41881121 (saliva) mailed 2012-05-05 08:30:21 UTC by hu826751.   Show log
Sample 82626966 (saliva) mailed 2012-05-05 08:30:21 UTC by hu826751.   Show log
Saliva Re-collection for Multiple Studies     Sample 36054196 (saliva) received 2012-05-23 23:28:49 UTC by Harvard University / TeloMe, Inc..   Show log
Sample 49506079 (saliva) received 2012-05-23 23:28:44 UTC by Harvard University / TeloMe, Inc..   Show log
Sample 21667129 (saliva) received 2012-05-23 23:28:48 UTC by Harvard University / TeloMe, Inc..   Show log 

Whereas filtering on hu826751 on the https://my.pgp-hms.org/specimens page only yields 3 saliva entries:

21667129    Saliva, 2.5 to 3.0 ml    Saliva Re-collection for Multiple Studies    hu826751    Harvard University / TeloMe, Inc.
36054196    Saliva, 2.5 to 3.0 ml    Saliva Re-collection for Multiple Studies    hu826751    Harvard University / TeloMe, Inc.
49506079    Saliva, 2 to 4 ml    Saliva Re-collection for Multiple Studies    hu826751    Harvard University / TeloMe, Inc.

For this profile, the "whole blood" specimens do not show up in the "https://my.pgp-hms.org/specimens" page (e.g. crc_id 30380893 does not appear in the "specimens" page).

History

#1 Updated by Abram Connelly over 5 years ago

Note: when logging in as an admin, I see all the appropriate specimens for that profile. I also see all specimens in the "https://my.pgp-hms.org/specimens" when logging in as 'hu826751'.

FWIW, I see the following lines:

  scope :visible_to, lambda { |user|
    if user and user.is_admin?
      unscoped.scoped(:include => [:study, :participant, :owner])
    else
      real.scoped(:include => [:study, :participant, :owner],
                  :conditions => ['? in (samples.participant_id, samples.owner_id, studies.creator_id) or (samples.participant_id is not ? and samples.owner_id is not ? and samples.owner_id <> samples.participant_id and users.suspended_at is ?)',
                                  (user ? user.id : -1), nil, nil, nil])
    end

at https://github.com/curoverse/tapestry/blob/master/app/models/sample.rb#L42 (which gets called from https://github.com/curoverse/tapestry/blob/master/app/controllers/samples_controller.rb#L19 ?). If I'm reading it right, if there's a 'public' user, the second part of the 'or' gets evaluated and the condition "samples.owner_id <> samples.participant_id" might filter out some relevant results?

Also available in: Atom PDF