Skip to content

Add submission-to-decision time metric to editorial stats - #2622

Open
Chrystinne wants to merge 2 commits into
devfrom
cf/metrics-editorial-decision-time
Open

Add submission-to-decision time metric to editorial stats#2622
Chrystinne wants to merge 2 commits into
devfrom
cf/metrics-editorial-decision-time

Conversation

@Chrystinne

Copy link
Copy Markdown
Collaborator

Part of #2620

This PR adds a new time metric to the editorial stats page: Submission to decision time (median days).

@Chrystinne

Chrystinne commented May 13, 2026

Copy link
Copy Markdown
Collaborator Author

That's what's displayed with projects on my local database after adding the new column (Submission to decision time (median days)):

image
from project.models import ActiveProject, PublishedProject

all_projects = [PublishedProject.objects.filter(is_legacy=False), ActiveProject.objects.all()]

for project_set in all_projects:
    for project in project_set:
        for log in project.edit_log_history():
            if log.decision_datetime and project.submission_datetime:
                duration = log.decision_datetime - project.submission_datetime
                print(f"{project} | decision={log.decision} | submission={project.submission_datetime.date()} | decision_date={log.decision_datetime.date()} | days={duration.days}")

Demo eICU Collaborative Research Database v2.0.0 | decision=1 | submission=2018-11-04 | decision_date=2018-11-14 | days=10
Demo eICU Collaborative Research Database v2.0.0 | decision=2 | submission=2018-11-04 | decision_date=2018-11-14 | days=10
Demo for visualizing waveforms v1.0.0 | decision=2 | submission=2020-12-23 | decision_date=2020-12-23 | days=0
Demo software for parsing clinical notes v1.0 | decision=2 | submission=2020-04-10 | decision_date=2020-04-10 | days=0
Demo eICU Collaborative Research Database | decision=2 | submission=2026-05-11 | decision_date=2026-05-11 | days=0
Demo software for parsing clinical notes | decision=0 | submission=2020-04-10 | decision_date=2026-05-13 | days=2223

2019 was a bit weird, so I found out that it was a demo project created directly as published, bypassing the normal editorial workflow:

from project.models import PublishedProject

p = PublishedProject.objects.filter(is_legacy=False, publish_datetime__year=2019).first()
print(p)
print("submission_datetime:", p.submission_datetime)
print("editor_assignment_datetime:", p.editor_assignment_datetime)
print("publish_datetime:", p.publish_datetime)
for log in p.edit_log_history():
    print("log decision:", log.decision, "| decision_datetime:", log.decision_datetime)

Demo 2018 BHI and BSN Data Challenge v1.0
submission_datetime: None
editor_assignment_datetime: None
publish_datetime: 2019-04-17 07:53:10.022000+00:00
log decision: 2 | decision_datetime: 2019-03-17 07:52:34.096000+00:00

@Chrystinne
Chrystinne requested a review from tompollard May 18, 2026 15:42
@Chrystinne Chrystinne added U24 Deliverables for the U24 metrics labels May 18, 2026
# Submission to decision for all projects (published + active)
all_projects = [PublishedProject.objects.filter(is_legacy=False), ActiveProject.objects.all()]

# Calculate durations by decision year

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is it possible to move some of the work into the query (following a similar approach to the stats above)?

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

Labels

metrics U24 Deliverables for the U24

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants