Table des matiĂšres
< Tous les sujets
Imprimer

📊 API GERO — Stats : rĂ©fĂ©rence complĂšte des endpoints

Base : https://app.gero.fr/api/stats
Auth : HTTP Basic (voir article “Vue d’ensemble, auth, conventions”)
Params communs :

  • :eventId (path) — identifiant de l’évĂ©nement
  • start, end (query) — datetimes ISO-8601 (UTC recommandĂ©)
    Réponses : GroupCountStat[] ([{ name, value }]) ou SeriesStat[] ([{ name, series: [{ name, value }] }])
    Remarque : si aucune donnĂ©e → []

đŸ‘„ Patients

1) Patients en cours, par poste

GET /:eventId/patients/perpost/current?start&end → GroupCountStat[]
Ex :

curl -u "user:pass" \
  "https://app.gero.fr/api/stats/EVENT123/patients/perpost/current?start=2024-10-15T00:00:00.000Z&end=2024-10-16T00:00:00.000Z"

Réponse : [ { "name": "outpost 1", "value": 3 }, ... ]

2) Total patients, par poste

GET /:eventId/patients/perpost/total?start&end → GroupCountStat[]

3) Patients par poste et par heure

GET /:eventId/patients/perpost/perHour?start&end → SeriesStat[]

⚠ Le path est perHour (H majuscule) cĂŽtĂ© API publique ; le backend agrĂšge en /perhour/.
Réponse type :

[
  {
    "name": "outpost 1",
    "series": [
      { "name": "2024-10-15T00:59:59.000Z", "value": 3 },
      { "name": "2024-10-15T01:59:59.000Z", "value": 1 }
    ]
  }
]

4) Patients par sexe

GET /:eventId/patients/sex?start&end → GroupCountStat[]
Ex : [{"name":"female","value":42},{"name":"male","value":38}]

5) Patients mineurs / majeurs

GET /:eventId/patients/minor?start&end → GroupCountStat[]
Ex : [{"name":"minor","value":12},{"name":"adult","value":68}] (exemple indicatif — “name” dĂ©pend des donnĂ©es)

6) Patients par classes d’ñge

GET /:eventId/patients/ages?start&end → GroupCountStat[]
Ex : [{"name":"0-7","value":3},{"name":"8-12","value":6}, ... ]

7) Patients par nationalité

GET /:eventId/patients/nationality?start&end → GroupCountStat[]
Ex : [{"name":"FR","value":50},{"name":"MG","value":20}]

8) Patients par type

GET /:eventId/patients/type?start&end → GroupCountStat[]
Ex : [{"name":"visitor","value":30},{"name":"staff","value":10}]


⚠ Incidents

9) Incidents par motif de venue (visit-purposes) — total

GET /:eventId/incidents/visit-purposes/count?start&end → GroupCountStat[]
Ex : [{"name":"allergy","value":3},{"name":"trauma","value":12}]

10) Incidents par motif de venue, par poste

GET /:eventId/incidents/visit-purposes/perpost?start&end → SeriesStat[]
Ex :

[
  {
    "name": "Poste 1",
    "series": [
      { "name": "allergy", "value": 2 },
      { "name": "trauma",  "value": 5 }
    ]
  }
]

11) Évacuations — total

GET /:eventId/incidents/evacuations/total?start&end → GroupCountStat[]

12) Évacuations — par poste

GET /:eventId/incidents/evacuations/perpost?start&end → GroupCountStat[]

13) Évacuations — par destination

GET /:eventId/incidents/evacuations/destinations?start&end → GroupCountStat[]

14) Évacuations — par vĂ©hicule

GET /:eventId/incidents/evacuations/vehicles?start&end → GroupCountStat[]

15) EntrĂ©es (coming) — par poste

GET /:eventId/incidents/coming/perpost?start&end → GroupCountStat[]

16) Conclusions — total par type

GET /:eventId/incidents/conclusions/count?start&end → GroupCountStat[]
Ex : [{"name":"left_on_site","value":18},{"name":"transferred","value":7}]

17) Conclusions — par poste et par type

GET /:eventId/incidents/conclusions/perpost?start&end → SeriesStat[]
Retour type :

[
  {
    "name": "Poste 1",
    "series": [
      { "name": "left_on_site", "value": 5 },
      { "name": "transferred",  "value": 2 }
    ]
  }
]

18) Incidents — total

GET /:eventId/incidents/total?start&end → GroupCountStat[]

19) Incidents — par heure et par poste

GET /:eventId/incidents/perhour?start&end → SeriesStat[]

⚠ series[].name peut ĂȘtre un horodatage ISO (ex. "2024-10-15T00:59:59.000Z").


🚑 Interventions

20) Interventions — par heure

GET /:eventId/interventions/perhour?start&end → GroupCountStat[]

21) Interventions — par vĂ©hicule

GET /:eventId/interventions/pervehicle?start&end → GroupCountStat[]

22) Interventions — par type de vĂ©hicule

GET /:eventId/interventions/pertypeofvehicle?start&end → GroupCountStat[]

23) Interventions — par zone

GET /:eventId/interventions/perzone?start&end → GroupCountStat[]

24) Interventions — par “purpose”

GET /:eventId/interventions/perpurpose?start&end → GroupCountStat[]

25) Interventions — en cours

GET /:eventId/interventions/current?start&end → GroupCountStat[]

26) Interventions — total

GET /:eventId/interventions/total?start&end → GroupCountStat[]


🔒 Endpoints internes (exclus de la doc publique)

MarquĂ©s @ApiExcludeEndpoint() — rĂ©servĂ©s Ă  l’app interne / compat de transition.

  • GET /:eventId/posts/occupied → map { [postName]: number }
  • GET /:eventId/posts/passages?start&end → map { [postName]: number }
  • GET /:eventId/evacuations?start&end → array (payload brut du datastore)

🧰 Exemples CURL supplĂ©mentaires

Conclusions par poste (série)

curl -u "user:pass" \
  "https://app.gero.fr/api/stats/EVENT123/incidents/conclusions/perpost?start=2024-10-15T00:00:00.000Z&end=2024-10-16T00:00:00.000Z"

Patients par sexe (groupes)

curl -u "user:pass" \
  "https://app.gero.fr/api/stats/EVENT123/patients/sex?start=2024-10-15T00:00:00.000Z&end=2024-10-16T00:00:00.000Z"

Interventions par type de véhicule

curl -u "user:pass" \
  "https://app.gero.fr/api/stats/EVENT123/interventions/pertypeofvehicle?start=2024-10-15T00:00:00.000Z&end=2024-10-16T00:00:00.000Z"

✅ Check-list intĂ©grateur

  • [ ] Auth Basic OK (401/403 sinon).
  • [ ] start / end au format ISO-8601 UTC.
  • [ ] GĂ©rer les rĂ©ponses vides ([]).
  • [ ] Conserver les labels name tels que renvoyĂ©s (postes, motifs, classes d’ñge
).
Catégories