HSCP-T-015 · open test
Eco-design framework assessment: 2024 criteria, health adaptations traced
What the test checks
The evidence is the service assessment, one JSON object per criterion (JSON Lines), following the recipe's data model:
| Field | Required | Meaning |
|---|---|---|
referentiel |
yes | rgesn_2024 (French general eco-design framework for digital services, 2024 version) |
critere |
yes | criterion number in the 2024 version (1.1 to 9.7) |
statut |
yes | conforme (compliant), non-conforme (non-compliant), non-applicable or adapte-sante (adapted for health) |
raison |
not applicable, adapted | reason specific to the service |
adaptation |
adapted | dns_ecoconception_sante_2025/NN, NN from 1 to 32 |
action |
non-compliant | action and echeance (deadline) |
evalue_le |
yes | assessment date |
The test accepts the assessment if each criterion exists in the 2024 version of the framework and appears only once, if each criterion adapted for health names an existing adaptation of the health guide and the reason specific to the service, if each not-applicable criterion gives its reason, if each non-compliance carries an action and a deadline, and if the assessment is recent. A 2022 criterion number that no longer exists in 2024 is refused.
It reports, without refusing, a partial assessment.
Running the test
python3 verifier.py evaluation.jsonl --date 2026-12-02 --revue-mois 12
--date sets the check date (today by default), --revue-mois the maximum age of the assessment (12 months by default), --json returns the answer in JSON. Exit code: 0 evidence accepted, 1 evidence refused, 2 incorrect call. Python 3.10 or later, no dependencies.
Examples
exemples/valide/: a compliant criterion, a criterion adapted for health with its adaptation and reason, a planned non-compliance, a justified not-applicable criterion. Accepted, with the partial assessment reported.exemples/refuse/: another framework, a criterion number missing from the 2024 version, a non-existent adaptation without reason, a not-applicable criterion without reason, a non-compliance without action assessed two years ago, a duplicate criterion with a status outside the list. Refused.
What the test does not say
- It does not say that the statuses are right: the review rereads them, with a business user for health deviations.
- It does not say that the adaptation invoked actually concerns the criterion: the guide follows the 2022 numbering, the match is checked at review.
- It replaces neither the published eco-design statement nor an audit.
Code
Download the test (zip archive: program, examples, README, licence) (11 KB) · verifier.py
The code and its messages are not translated (French).
#!/usr/bin/env python3
# SPDX-License-Identifier: Apache-2.0
# Copyright 2026 les contributeurs des Gestes communs du logiciel de santé
"""HSCP-T-015 : évaluation du service au référentiel d'écoconception (version 2024), critère par critère, adaptations
à la santé tracées.
python3 verifier.py <evaluation.jsonl> [--date AAAA-MM-JJ] [--revue-mois N] [--json]
Lit l'évaluation, un objet JSON par critère (JSON Lines) : referentiel, critere, statut, raison, adaptation,
action {action, echeance}, evalue_le.
Refus : ligne illisible ; champ obligatoire absent ; référentiel autre que rgesn_2024 ; critère absent de la version
2024 (par exemple un numéro de la version 2022) ; critère en double ; statut hors liste ; critère adapté sans
adaptation du guide santé existante (dns_ecoconception_sante_2025/1 à 32) ou sans raison ; critère non applicable sans
raison ; critère non conforme sans action ni échéance ; évaluation plus ancienne que --revue-mois mois (12 par
défaut).
Note seulement : critères de la version 2024 absents de l'évaluation (évaluation partielle).
Il ne dit pas que les statuts sont justes, ni que l'adaptation invoquée s'applique au critère.
Codes de retour : 0 pièce acceptée, 1 pièce refusée, 2 appel incorrect.
Bibliothèque standard seulement, aucun accès réseau.
"""
import argparse
import datetime as dt
import json
import sys
ID = "HSCP-T-015"
REFERENTIEL = "rgesn_2024"
# Critères de la version 2024 : 9 thématiques, 78 critères.
CRITERES = [f"{t}.{i}" for t, n in ((1, 10), (2, 10), (3, 7), (4, 15), (5, 8), (6, 7), (7, 4), (8, 10), (9, 7))
for i in range(1, n + 1)]
ADAPTATIONS = {f"dns_ecoconception_sante_2025/{i}" for i in range(1, 33)}
STATUTS = {"conforme", "non-conforme", "non-applicable", "adapte-sante"}
OBLIGATOIRES = ("referentiel", "critere", "statut", "evalue_le")
def jour(v):
try:
return dt.date.fromisoformat(str(v))
except ValueError:
return None
def verifier(chemin, aujourdhui, revue):
refus, notes, vus, n = [], [], set(), 0
limite = aujourdhui - dt.timedelta(days=round(revue * 30.44))
for num, ligne in enumerate(open(chemin, encoding="utf-8"), 1):
if not ligne.strip():
continue
try:
c = json.loads(ligne)
assert isinstance(c, dict)
except (ValueError, AssertionError):
refus.append(f"ligne {num} : objet JSON illisible")
continue
n += 1
nom = f"critère {c.get('critere') or '? (ligne ' + str(num) + ')'}"
manque = [k for k in OBLIGATOIRES if c.get(k) in (None, "")]
if manque:
refus.append(f"{nom} : champ(s) absent(s) : {', '.join(manque)}")
continue
if c["referentiel"] != REFERENTIEL:
refus.append(f"{nom} : référentiel autre que {REFERENTIEL}")
crit = str(c["critere"])
if crit not in CRITERES:
refus.append(f"{nom} : absent de la version 2024 du référentiel")
elif crit in vus:
refus.append(f"{nom} : évalué deux fois")
vus.add(crit)
s = c["statut"]
if s not in STATUTS:
refus.append(f"{nom} : statut hors liste")
elif s == "adapte-sante":
if c.get("adaptation") not in ADAPTATIONS:
refus.append(f"{nom} : adapté pour la santé sans adaptation existante du guide")
if not c.get("raison"):
refus.append(f"{nom} : adapté pour la santé sans raison propre au service")
elif s == "non-applicable" and not c.get("raison"):
refus.append(f"{nom} : non applicable sans raison")
elif s == "non-conforme":
a = c.get("action") if isinstance(c.get("action"), dict) else {}
if not a.get("action") or jour(a.get("echeance")) is None:
refus.append(f"{nom} : non conforme sans action ni échéance")
e = jour(c["evalue_le"])
if e is None or e < limite:
refus.append(f"{nom} : évaluation illisible ou plus ancienne que {revue} mois")
if n == 0:
refus.append("évaluation vide")
else:
absents = [k for k in CRITERES if k not in vus]
if absents:
notes.append(f"évaluation partielle : {len(absents)} critère(s) de la version 2024 non évalué(s)")
return refus, notes, n
def main(argv):
p = argparse.ArgumentParser(prog="verifier.py", description=__doc__.splitlines()[0])
p.add_argument("evaluation")
p.add_argument("--date", default=dt.date.today().isoformat())
p.add_argument("--revue-mois", type=int, default=12)
p.add_argument("--json", action="store_true")
try:
a = p.parse_args(argv)
aujourdhui = dt.date.fromisoformat(a.date)
except (SystemExit, ValueError):
return 2
try:
refus, notes, n = verifier(a.evaluation, aujourdhui, a.revue_mois)
except OSError as e:
print(f"{ID} : pièce illisible : {e}", file=sys.stderr)
return 2
if a.json:
print(json.dumps({"test": ID, "accepte": not refus, "criteres": n, "refus": refus, "notes": notes},
ensure_ascii=False, indent=2))
else:
print(f"{ID} : {'pièce acceptée' if not refus else 'pièce refusée'} ({n} critère(s))")
for r in refus:
print(" refus :", r)
for x in notes:
print(" note :", x)
return 0 if not refus else 1
if __name__ == "__main__":
sys.exit(main(sys.argv[1:]))