fix: remove stats around procedure pénale

This commit is contained in:
sebastien.arod@gmail.com 2024-09-05 09:29:17 +02:00
parent b4d1a7edad
commit b26b428622
5 changed files with 1 additions and 73 deletions

View file

@ -44,16 +44,6 @@ const statPropsPublishOptions: {
pourcentageEntreeApresMiseEnDemeureSurPeriode: { pourcentageEntreeApresMiseEnDemeureSurPeriode: {
notionPropName: "% d'entrées après mises en demeure sur période", notionPropName: "% d'entrées après mises en demeure sur période",
}, },
nbFamillesProcedurePenale: {
notionPropName: "Nb familles avec procédure pénale",
},
pourcentageFamillesProcedurePenale: {
notionPropName: "% familles avec procédure pénale",
unit: "%",
},
nbFamilleAvecProcedurePenaleSurPeriode: {
notionPropName: "Nb familles avec procédure pénale sur période",
},
nbFamillesCompositionPenale: { nbFamillesCompositionPenale: {
notionPropName: "Nb familles avec composition pénale", notionPropName: "Nb familles avec composition pénale",
}, },
@ -61,10 +51,6 @@ const statPropsPublishOptions: {
notionPropName: "% familles avec composition pénale", notionPropName: "% familles avec composition pénale",
unit: "%", unit: "%",
}, },
pourcentageProcedurePenaleAvecCompositionPenale: {
notionPropName: "% procédure pénale avec composition pénale",
unit: "%",
},
nbFamillesCompositionPenaleAcceptee: { nbFamillesCompositionPenaleAcceptee: {
notionPropName: "Nb familles avec composition pénale acceptée", notionPropName: "Nb familles avec composition pénale acceptée",
}, },
@ -95,10 +81,6 @@ const statPropsPublishOptions: {
notionPropName: "% familles avec CRPC", notionPropName: "% familles avec CRPC",
unit: "%", unit: "%",
}, },
pourcentageProcedurePenaleAvecCRPC: {
notionPropName: "% procédure pénale avec CRPC",
unit: "%",
},
nbFamillesCRPCAcceptee: { nbFamillesCRPCAcceptee: {
notionPropName: "Nb familles avec CRPC acceptée", notionPropName: "Nb familles avec CRPC acceptée",
}, },
@ -141,9 +123,6 @@ const statPropsPublishOptions: {
notionPropName: "% familles avec procédure civile", notionPropName: "% familles avec procédure civile",
unit: "%", unit: "%",
}, },
nbFamilleAvecProcedureCivileSurPeriode: {
notionPropName: "Nb familles avec procédure civile sur période",
},
nbFamilleProcedureCivileClasseeSansSuite: { nbFamilleProcedureCivileClasseeSansSuite: {
notionPropName: "Nb familles avec procédure civile classée sans suite", notionPropName: "Nb familles avec procédure civile classée sans suite",

View file

@ -16,13 +16,10 @@ export type ELStatsAtDate<V> = {
// Pénale // Pénale
nbFamillesMisesEnDemeure: V; nbFamillesMisesEnDemeure: V;
pourcentageFamillesMisesEnDemeure: V; pourcentageFamillesMisesEnDemeure: V;
nbFamillesProcedurePenale: V;
pourcentageFamillesProcedurePenale: V;
// Pénale > Composition Pénale // Pénale > Composition Pénale
nbFamillesCompositionPenale: V; nbFamillesCompositionPenale: V;
pourcentageFamillesCompositionPenale: V; pourcentageFamillesCompositionPenale: V;
pourcentageProcedurePenaleAvecCompositionPenale: V;
nbFamillesCompositionPenaleAcceptee: V; nbFamillesCompositionPenaleAcceptee: V;
pourcentageCompositionPenaleAcceptee: V; pourcentageCompositionPenaleAcceptee: V;
pourcentageFamillesCompositionPenaleAcceptee: V; pourcentageFamillesCompositionPenaleAcceptee: V;
@ -33,7 +30,6 @@ export type ELStatsAtDate<V> = {
// Pénale > CRPC // Pénale > CRPC
nbFamillesCRPC: V; nbFamillesCRPC: V;
pourcentageFamillesCRPC: V; pourcentageFamillesCRPC: V;
pourcentageProcedurePenaleAvecCRPC: V;
nbFamillesCRPCAcceptee: V; nbFamillesCRPCAcceptee: V;
pourcentageCRPCAcceptee: V; pourcentageCRPCAcceptee: V;
pourcentageFamillesCRPCAcceptee: V; pourcentageFamillesCRPCAcceptee: V;
@ -74,8 +70,6 @@ export type PeriodStatsValues<V> = ELStatsAtDate<V> | ELStatsOverPeriod<V>;
export type ELStatsOverPeriod<V> = { export type ELStatsOverPeriod<V> = {
pourcentageEntreeApresMiseEnDemeureSurPeriode: V; pourcentageEntreeApresMiseEnDemeureSurPeriode: V;
nbFamilleResistantesSurPeriode: V; nbFamilleResistantesSurPeriode: V;
nbFamilleAvecProcedurePenaleSurPeriode: V;
nbFamilleAvecProcedureCivileSurPeriode: V;
}; };
export type ValueWithEvol = { export type ValueWithEvol = {

View file

@ -3,7 +3,6 @@ import {
isCompositionPenale, isCompositionPenale,
isEvenementBefore, isEvenementBefore,
isProcedureCivile, isProcedureCivile,
isProcedurePenale,
} from "../../data/EvenementFamille"; } from "../../data/EvenementFamille";
import { import {
Famille, Famille,
@ -35,11 +34,6 @@ export function computeELStatsAtDate(
f.Evenements.find((e) => e.Type === "Mise en demeure de scolarisation") f.Evenements.find((e) => e.Type === "Mise en demeure de scolarisation")
).length; ).length;
const famillesAvecProcedurePenale = familleResistantesOrEx.filter((famille) =>
famille.Evenements.find(
(evt) => isProcedurePenale(evt) && isEvenementBefore(evt, asOfDate)
)
);
const famillesAvecCompositionPenale = familleResistantesOrEx.filter( const famillesAvecCompositionPenale = familleResistantesOrEx.filter(
(famille) => (famille) =>
famille.Evenements.find( famille.Evenements.find(
@ -153,20 +147,11 @@ export function computeELStatsAtDate(
familleResistantesOrEx.length familleResistantesOrEx.length
), ),
nbFamillesProcedurePenale: famillesAvecProcedurePenale.length,
pourcentageFamillesProcedurePenale: percent(
famillesAvecProcedurePenale.length,
familleResistantesOrEx.length
),
nbFamillesCompositionPenale: famillesAvecCompositionPenale.length, nbFamillesCompositionPenale: famillesAvecCompositionPenale.length,
pourcentageFamillesCompositionPenale: percent( pourcentageFamillesCompositionPenale: percent(
famillesAvecCompositionPenale.length, famillesAvecCompositionPenale.length,
familleResistantesOrEx.length familleResistantesOrEx.length
), ),
pourcentageProcedurePenaleAvecCompositionPenale: percent(
famillesAvecCompositionPenale.length,
famillesAvecProcedurePenale.length
),
nbFamillesCompositionPenaleAcceptee: nbFamillesCompositionPenaleAcceptee:
famillesAvecCompositionPenaleAcceptee.length, famillesAvecCompositionPenaleAcceptee.length,
pourcentageCompositionPenaleAcceptee: percent( pourcentageCompositionPenaleAcceptee: percent(
@ -193,10 +178,6 @@ export function computeELStatsAtDate(
famillesAvecCRPC.length, famillesAvecCRPC.length,
familleResistantesOrEx.length familleResistantesOrEx.length
), ),
pourcentageProcedurePenaleAvecCRPC: percent(
famillesAvecCRPC.length,
famillesAvecProcedurePenale.length
),
nbFamillesCRPCAcceptee: famillesAvecCRPCAcceptee.length, nbFamillesCRPCAcceptee: famillesAvecCRPCAcceptee.length,
pourcentageCRPCAcceptee: percent( pourcentageCRPCAcceptee: percent(
famillesAvecCRPCAcceptee.length, famillesAvecCRPCAcceptee.length,

View file

@ -1,7 +1,3 @@
import {
isEvenementInPeriod,
isProcedurePenale,
} from "../../data/EvenementFamille";
import { import {
Famille, Famille,
isResistantOverPeriod, isResistantOverPeriod,
@ -26,23 +22,8 @@ export function computeELStatsOverPeriod(
).length; ).length;
const pourcentageEntreeApresMiseEnDemeureSurPeriode = const pourcentageEntreeApresMiseEnDemeureSurPeriode =
computePourcentageEntreeApresMiseEnDemeure(famillesEntreesSurPeriode); computePourcentageEntreeApresMiseEnDemeure(famillesEntreesSurPeriode);
const familleAvecProcedurePenaleSurPeriode = familles.filter((famille) =>
famille.Evenements.find(
(evt) => isProcedurePenale(evt) && isEvenementInPeriod(evt, period)
)
);
const familleAvecProcedureCivileSurPeriode = familles.filter((famille) =>
famille.Evenements.find(
(evt) => isProcedurePenale(evt) && isEvenementInPeriod(evt, period)
)
);
return { return {
nbFamilleResistantesSurPeriode, nbFamilleResistantesSurPeriode,
pourcentageEntreeApresMiseEnDemeureSurPeriode, pourcentageEntreeApresMiseEnDemeureSurPeriode,
nbFamilleAvecProcedurePenaleSurPeriode:
familleAvecProcedurePenaleSurPeriode.length,
nbFamilleAvecProcedureCivileSurPeriode:
familleAvecProcedureCivileSurPeriode.length,
}; };
} }

View file

@ -1,7 +1,4 @@
import { import { isProcedureCivile } from "../../data/EvenementFamille";
isProcedureCivile,
isProcedurePenale,
} from "../../data/EvenementFamille";
import { Famille } from "../../data/Famille"; import { Famille } from "../../data/Famille";
import { computeFamillesWithEventsConditionInEarlyPeriod } from "./computeFamilleWithEventAfterDurationOfDC"; import { computeFamillesWithEventsConditionInEarlyPeriod } from "./computeFamilleWithEventAfterDurationOfDC";
@ -11,10 +8,6 @@ export function computeStatsParAnciennete(familles: Famille[]) {
familles, familles,
(events) => events.find((ev) => isProcedureCivile(ev)) !== undefined (events) => events.find((ev) => isProcedureCivile(ev)) !== undefined
), ),
procedurePenale: computeFamillesWithEventsConditionInEarlyPeriod(
familles,
(events) => events.find((ev) => isProcedurePenale(ev)) !== undefined
),
miseEnDemeure: computeFamillesWithEventsConditionInEarlyPeriod( miseEnDemeure: computeFamillesWithEventsConditionInEarlyPeriod(
familles, familles,