Skip to content

[DT-4061] Add study-scoped DAR summaries and research outputs - #3053

Open
otchet-broad wants to merge 1 commit into
otchet-dt-4061-study-commentsfrom
otchet-dt-4061-study-dar-metrics
Open

[DT-4061] Add study-scoped DAR summaries and research outputs#3053
otchet-broad wants to merge 1 commit into
otchet-dt-4061-study-commentsfrom
otchet-dt-4061-study-dar-metrics

Conversation

@otchet-broad

Copy link
Copy Markdown
Contributor

Base: branch 3 · 15 files, +729/-6 · Migration: no · UI impact: additive fields on one existing endpoint

Adds GET /api/metrics/dar-summaries/study/{studyId} and GET /api/metrics/research-outputs/study/{studyId}. The study-scoped summary
query covers the whole study in one round trip rather than re-running the
per-dataset query once per dataset.

A DAR qualifies for a study summary when it was approved on one of the
study's datasets or is a closeout against one of them, and each row is
sourced from the most recently submitted qualifying DAR in its collection.
That constraint is the subtle part and worth a careful read: sourcing from
the collection's newest submission instead would let a pending progress
report — a submitted child DAR with no election of its own — overwrite the
grant's title, RUS, and date and reset its current/expired chip.

Research outputs aggregate the presentations, publications, and intellectual
properties reported across a study's progress reports.

DarMetricsSummary gains submissionDate, piName, and institutionName.
piName prefers the PI recorded on the DAR itself so the metric stays a
stable record of what was granted, falling back to the submitter for DARs
predating that field; the DAR's own institution field is deprecated and no
longer written, so the submitter's current institution is the only available
source. These three fields are also now returned by the existing
per-dataset endpoint
— additive, so existing consumers are unaffected, but
it is the one existing response this branch touches.

Reads go through verifyStudyVisibilityAccess.

Minor: MetricsServiceTest carries an unused
generateDarMetricsSummary(String, Timestamp) overload that can be dropped.

Depends on: branch 1 (visibility gate).


Where this sits in the DT-4061 stack

otchet-dt-3990-study-ratings-pi-details was too large to review meaningfully
(95 files, +8168), so it was split into eight PRs. This PR targets otchet-dt-4061-study-comments,
not develop
, so its diff shows only its own work.

# Branch Base
1 otchet-dt-4061-study-visibility-authz develop
1b otchet-dt-4061-study-patch-ownership otchet-dt-4061-study-visibility-authz
2 otchet-dt-4061-study-pi-details otchet-dt-4061-study-visibility-authz
3 otchet-dt-4061-study-comments otchet-dt-4061-study-pi-details
4 otchet-dt-4061-study-dar-metricsthis PR otchet-dt-4061-study-comments
5 otchet-dt-4061-study-recommendations otchet-dt-4061-study-dar-metrics
6 otchet-dt-4061-study-asset-fields otchet-dt-4061-study-recommendations
7 otchet-dt-4061-study-asset-endpoints otchet-dt-4061-study-asset-fields

Branch 1b is a sibling rather than a link in the chain: nothing depends on it,
so it can be held or dropped without blocking the others. Land the numbered
chain in order — merging out of order, or squash-merging, will require rebasing
the descendants.

The split is verified lossless: branch 7 plus 1b reproduces the original branch
exactly, apart from five scripts/verify-study-*.sh helper scripts that were
dropped at the author's request. ./mvnw test-compile passes on each branch
independently.

🤖 Generated with Claude Code

@otchet-broad
otchet-broad marked this pull request as ready for review September 8, 2026 20:45
@otchet-broad
otchet-broad requested a review from a team as a code owner September 8, 2026 20:45
@otchet-broad
otchet-broad requested review from kevinmarete and rushtong and removed request for a team September 8, 2026 20:45
Adds GET /api/metrics/dar-summaries/study/{studyId} and GET
/api/metrics/research-outputs/study/{studyId}. The study-scoped summary
query does the whole study in one round trip rather than re-running the
per-dataset query once per dataset.

A DAR qualifies for a study summary when it was approved on one of the
study's datasets or is a closeout against one of them, and each row is
sourced from the most recently submitted qualifying DAR in its collection.
Sourcing from the collection's newest submission instead would let a
pending progress report — a submitted child DAR with no election of its
own — overwrite the grant's title, RUS, and date and reset its
current/expired chip.

Research outputs aggregate the presentations, publications, and
intellectual properties reported across a study's progress reports.

DarMetricsSummary gains submissionDate, piName, and institutionName.
piName prefers the PI recorded on the DAR itself so the metric stays a
stable record of what was granted, falling back to the submitter for DARs
predating that field; the DAR's own institution field is deprecated and no
longer written, so the submitter's current institution is the only source.
These three fields are also now returned by the existing per-dataset
endpoint — additive only, so existing consumers are unaffected.

Reads go through DatasetService#verifyStudyVisibilityAccess, matching the
study endpoint. No migration.

Note for review: MetricsServiceTest carries an unused
generateDarMetricsSummary(String, Timestamp) overload that can be dropped.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-comments branch from 0d6f3c0 to f16b34c Compare September 8, 2026 21:58
@otchet-broad
otchet-broad force-pushed the otchet-dt-4061-study-dar-metrics branch from 2014320 to e31cd4a Compare September 8, 2026 21:58

@kevinmarete kevinmarete left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants