đ 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Ă©nementstart,end(query) â datetimes ISO-8601 (UTC recommandĂ©)
Réponses :GroupCountStat[]([{ name, value }]) ouSeriesStat[]([{ 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[].namepeut ĂȘ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/endau format ISO-8601 UTC. - [ ] Gérer les réponses vides (
[]). - [ ] Conserver les labels
nametels que renvoyĂ©s (postes, motifs, classes dâĂągeâŠ).