From 7174ed44f066f751d3f48a8e39b5453a5efb1e33 Mon Sep 17 00:00:00 2001 From: Abdelkouddous LHACHIMI Date: Wed, 22 Apr 2026 22:17:05 +0100 Subject: [PATCH] Counters adjustment --- eb_dashboard.py | 4 +--- eb_dashboard_quality_checks.py | 5 +++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/eb_dashboard.py b/eb_dashboard.py index 64b201d..9875b8e 100644 --- a/eb_dashboard.py +++ b/eb_dashboard.py @@ -1005,12 +1005,10 @@ def get_organization_counters(organization): organization_id = organization['id'] stats = _get_organization_statistics(organization_id) + organization["patients_count"] = stats.get("totalInclusions", 0) organization["preincluded_count"] = stats.get("preIncluded", 0) organization["included_count"] = stats.get("included", 0) organization["prematurely_terminated_count"] = stats.get("prematurelyTerminated", 0) - organization["patients_count"] = (organization["preincluded_count"] + - organization["included_count"] + - organization["prematurely_terminated_count"]) return organization diff --git a/eb_dashboard_quality_checks.py b/eb_dashboard_quality_checks.py index ae3aec4..c9d0b08 100644 --- a/eb_dashboard_quality_checks.py +++ b/eb_dashboard_quality_checks.py @@ -430,11 +430,12 @@ def coherence_check(output_inclusions, organizations_list): if inc_org_id != org_id: continue - # API statistics exclude inclusions without signed consent + patients += 1 + + # API statistics exclude non-consented from status sub-counters only if get_nested_value(inclusion, ["Inclusion", "Consent_Signed"]) is not True: continue - patients += 1 status = get_nested_value(inclusion, ["Inclusion", "Inclusion_Status"], default="") if isinstance(status, str):