Skip to content

Commit

Permalink
Merge pull request #147 from KPMP/KPMP-5609_fix_file_counts
Browse files Browse the repository at this point in the history
KPMP-5609: stop double-counting files w >1 DOI
  • Loading branch information
rlreamy authored Oct 8, 2024
2 parents 668e93a + 05b775d commit 9559368
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ public interface ParticipantRepoDataRepository extends CrudRepository<Participan

@Query(value = "select a.experimental_strategy, a.data_type, a.data_category, coalesce(count,0) as count "
+ "from (select distinct experimental_strategy, data_type, data_category from repo_file_v) as a "
+ "left join (select count(*) as count, experimental_strategy, data_type, data_category from repo_file_v where redcap_id= :redcap_id "
+ "group by experimental_strategy) as b on a.experimental_strategy=b.experimental_strategy", nativeQuery = true)
+ "left join (select count(*) as count, c.experimental_strategy, c.data_type, c.data_category from "
+ "(select distinct(dl_file_id), experimental_strategy, data_type, data_category from repo_file_v where redcap_id= :redcap_id) as c "
+ "group by c.experimental_strategy) as b on a.experimental_strategy=b.experimental_strategy", nativeQuery = true)
public List<ParticipantRepoData> findFileCountsByParticipant(@Param("redcap_id") String redcapId);

}

0 comments on commit 9559368

Please sign in to comment.