feat(schema): module de nettoyage des JSONs pour consommation aval
Le pipeline produit un JSON riche pendant l'exécution (ratios
checkbox, OCR raw, flags _parse_error/_truncated_loop/_crop_recodage,
_source, _elapsed_s…). Utile en audit, mais pollue quand on veut
exposer le résultat à un consommateur aval (Excel, dashboard, API).
pipeline/schema.py :
- SCHEMA_VERSION "2.0"
- clean_dossier(raw) : retourne une copie propre avec structure stable
(en-tête → codage → GHM/GHS → décisions) et validation ATIH en
format compact (summary + cross_checks + flags par champ).
- CLEAN_FIELDS_RECUEIL / CLEAN_FIELDS_CONCERTATION_{1,2} / CLEAN_FIELDS_PREUVES
documentent les champs stables par type de page.
- CLI : `python -m pipeline.schema` → nettoie `output/v2/*.json` vers
`output/v2_clean/`.
Séparation claire : `output/v2/` reste le JSON raw (audit), `output/v2_clean/`
est la sortie propre et stable pour livrables.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
333
output/v2_clean/OGC 66.json
Normal file
333
output/v2_clean/OGC 66.json
Normal file
@@ -0,0 +1,333 @@
|
||||
{
|
||||
"fichier": "OGC 66",
|
||||
"pdf_hash": "7176836d9d496cd7",
|
||||
"schema_version": "2.0",
|
||||
"extraction": {
|
||||
"recueil": {
|
||||
"etablissement": "CLINIQUE D'ARCACHON",
|
||||
"finess": "330780206",
|
||||
"date_debut_controle": "13/02/2018",
|
||||
"n_ogc": "66",
|
||||
"n_champ": "1",
|
||||
"dates_sejour": "04/04/2016 au 20/04/2016",
|
||||
"sejour_etab": {
|
||||
"age": "80 ans",
|
||||
"sexe": "1",
|
||||
"duree_sejour": "16 jours",
|
||||
"mode_entree": "8",
|
||||
"provenance": "8",
|
||||
"mode_sortie": "8",
|
||||
"destination": "0"
|
||||
},
|
||||
"sejour_reco": {
|
||||
"age": "80 ans",
|
||||
"sexe": "1",
|
||||
"duree_sejour": "16 jours",
|
||||
"mode_entree": "8",
|
||||
"provenance": "8",
|
||||
"mode_sortie": "8",
|
||||
"destination": "0"
|
||||
},
|
||||
"rum_etab": {
|
||||
"um": "UM",
|
||||
"igs": "IGS II",
|
||||
"duree": "16 jours",
|
||||
"dates": "du 04/04/2016 au 20/04/2016"
|
||||
},
|
||||
"codage_etab": {
|
||||
"dp": "C07",
|
||||
"dp_libelle": "T.M. DE LA GLD, PAROTIDE",
|
||||
"dr": "C795 *",
|
||||
"das": [
|
||||
{
|
||||
"code": "E440",
|
||||
"position": "2",
|
||||
"libelle": "MALNUTRITION PROTEINO-ENERGETIQUE MODEREE"
|
||||
},
|
||||
{
|
||||
"code": "J91",
|
||||
"position": "2",
|
||||
"libelle": "EPANCHEMENT PLEURAL AVEC MAL. CL. AILL."
|
||||
},
|
||||
{
|
||||
"code": "Z511",
|
||||
"position": "3",
|
||||
"libelle": "SEANCE DE CHIMIOTHERAPIE POUR TUM."
|
||||
}
|
||||
]
|
||||
},
|
||||
"codage_reco": {
|
||||
"dp": "C07",
|
||||
"dr": "C795 *",
|
||||
"das": [
|
||||
{
|
||||
"code": "E440",
|
||||
"position": "2",
|
||||
"libelle": "MALNUTRITION PROTEINO-ENERGETIQUE MODEREE"
|
||||
},
|
||||
{
|
||||
"code": "J91",
|
||||
"position": "2",
|
||||
"libelle": "EPANCHEMENT PLEURAL AVEC MAL. CL. AILL."
|
||||
},
|
||||
{
|
||||
"code": "Z511",
|
||||
"position": "3",
|
||||
"libelle": "SEANCE DE CHIMIOTHERAPIE POUR TUM."
|
||||
}
|
||||
]
|
||||
},
|
||||
"actes_etab": [
|
||||
{
|
||||
"code": "EBLA003",
|
||||
"position": "1",
|
||||
"libelle": "POSE CATHE RELIE - 1VN PROF. MB SUP/COU TRANSCUT+DIFFUSEUR SSCUT."
|
||||
}
|
||||
],
|
||||
"actes_reco": [],
|
||||
"ghm_etab": "03M073",
|
||||
"ghs_etab": "844",
|
||||
"ghm_reco": "04M093",
|
||||
"ghs_reco": "1163",
|
||||
"recodage_impactant": "1",
|
||||
"ghs_injustifie": "0",
|
||||
"accord_desaccord": "désaccord",
|
||||
"praticien_conseil": "DR VIGNAU",
|
||||
"_validation": {
|
||||
"summary": {
|
||||
"valid": 15,
|
||||
"invalid": 0,
|
||||
"empty": 0,
|
||||
"total_codes": 15,
|
||||
"ghm_ghs_incoherents": 0
|
||||
},
|
||||
"codage_etab": {
|
||||
"dp": {
|
||||
"valid": true,
|
||||
"libelle_ref": "Tumeur maligne de la glande parotide"
|
||||
},
|
||||
"dr": {
|
||||
"valid": true,
|
||||
"libelle_ref": "Tumeur maligne secondaire des os et de la moelle osseuse"
|
||||
},
|
||||
"das": [
|
||||
{
|
||||
"valid": true,
|
||||
"libelle_ref": "Malnutrition protéinoénergétique modérée"
|
||||
},
|
||||
{
|
||||
"valid": true,
|
||||
"libelle_ref": "Épanchement pleural au cours de maladies classées ailleurs"
|
||||
},
|
||||
{
|
||||
"valid": true,
|
||||
"libelle_ref": "Séance de chimiothérapie pour tumeur"
|
||||
}
|
||||
]
|
||||
},
|
||||
"codage_reco": {
|
||||
"dp": {
|
||||
"valid": true,
|
||||
"libelle_ref": "Tumeur maligne de la glande parotide"
|
||||
},
|
||||
"dr": {
|
||||
"valid": true,
|
||||
"libelle_ref": "Tumeur maligne secondaire des os et de la moelle osseuse"
|
||||
},
|
||||
"das": [
|
||||
{
|
||||
"valid": true,
|
||||
"libelle_ref": "Malnutrition protéinoénergétique modérée"
|
||||
},
|
||||
{
|
||||
"valid": true,
|
||||
"libelle_ref": "Épanchement pleural au cours de maladies classées ailleurs"
|
||||
},
|
||||
{
|
||||
"valid": true,
|
||||
"libelle_ref": "Séance de chimiothérapie pour tumeur"
|
||||
}
|
||||
]
|
||||
},
|
||||
"ghm_etab": {
|
||||
"valid": true
|
||||
},
|
||||
"ghs_etab": {
|
||||
"valid": true
|
||||
},
|
||||
"ghm_reco": {
|
||||
"valid": true
|
||||
},
|
||||
"ghs_reco": {
|
||||
"valid": true
|
||||
},
|
||||
"cross_checks": {
|
||||
"etab_ghm_ghs_coherent": true,
|
||||
"reco_ghm_ghs_coherent": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"concertation_2": {
|
||||
"ghs_initial": "844",
|
||||
"ghs_avant_concertation": "1163",
|
||||
"ghs_final": "163",
|
||||
"decision": "",
|
||||
"date_concertation": "2.3.18",
|
||||
"praticien_controleur": "DR VIGNAU",
|
||||
"medecin_dim": "DR ETTORCHI-TARDY",
|
||||
"_validation": {
|
||||
"ghs_initial": {
|
||||
"code": "844",
|
||||
"valid": true
|
||||
},
|
||||
"ghs_avant_concertation": {
|
||||
"code": "1163",
|
||||
"valid": true
|
||||
},
|
||||
"ghs_final": {
|
||||
"code": "163",
|
||||
"valid": false
|
||||
}
|
||||
}
|
||||
},
|
||||
"concertation_1": {
|
||||
"date_concertation": "2.3.19",
|
||||
"argumentaire": "La facturation du GHS par l'établissement n'est pas conforme à l'article 1 de l'arrêté du 19 février 2015 modifié du fait d'un non-respect des règles de codage édictées dans l'annexe II de l'arrêté du 21 décembre 2015 modifiant l'arrêté du 22 février 2008. Le non-respect des règles porte sur le diagnostic principal (DP) codé par l'établissement dans le résumé d'unité médicale (RUM). Le DP n'est pas conforme aux règles de codage des diagnostics rappelées par l'annexe II, chapitre V, paragraphe 1 : « les diagnostics doivent figurer dans le RUM sous forme codée selon la plus récente mise à jour de la 10e révision de la Classification internationale des maladies (CIM-10) de l'Organisation mondiale de la santé et selon les extensions nationales données dans la plus récente version du Manuel des groupes homogènes de malades. (...) Le meilleur code est le plus précis par rapport à l'information à coder. » Au vu des éléments présents dans le dossier du patient, le code CIM-10 choisi pour le DP par l'établissement n'est pas le plus précis par rapport à l'information à coder."
|
||||
},
|
||||
"preuves": {
|
||||
"date": "28/07/2019",
|
||||
"praticien_controleur": [
|
||||
"Dr RADZIKOWSKI",
|
||||
"Dr DELAYE-PHULPIN",
|
||||
"Dr ETTORCHI-TARDY"
|
||||
],
|
||||
"medecin_dim": "",
|
||||
"pieces": [
|
||||
{
|
||||
"intitule": "Compte-rendu d'acte",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Compte-rendu opératoire",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Compte-rendu d'accouchement",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Compte-rendu d'examen complémentaire",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Compte-rendu d'imagerie",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Compte-rendu d'anatomopathologie",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Observations médicales",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Dossier de transfusion",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Dossier d'anesthésie",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Administration thérapeutique",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Compte-rendu d'hospitalisation",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Lettre de sortie",
|
||||
"present": true,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Eléments de surveillance du dossier infirmier",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Prise en charge psychologue",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Prise en charge kinésithérapeute",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Prise en charge diététique",
|
||||
"present": false,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
},
|
||||
{
|
||||
"intitule": "Autre : lettre M",
|
||||
"present": true,
|
||||
"photocopie": false,
|
||||
"absent_date": "",
|
||||
"date_obtention": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"_meta": {
|
||||
"pipeline_version": "v1",
|
||||
"ocr_model": "zai-org/GLM-OCR",
|
||||
"generated_at": "2026-04-24T12:13:54+00:00"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user