How luisabeccar/anemias_r works
Project Type and Purpose
• This is an R-based data‐analysis pipeline focused on processing clinical/anemia documents, performing word counts and patient‐decision analyses, then generating summary reports.
• There is no web UI or database; instead it’s a batch ETL + analytics + reporting tool implemented as a set of R scripts.
High‐Level Architectural Components
a. Data Sources
– Raw DOCX files (clinical notes, epicrisis)
b. Ingestion & Preprocessing
– docx_a_txt.R: converts DOCX → plain text
– contar_palabras_todo.R: counts words across all texts
c. Core Analysis
– analisis_resultados.R: performs main statistical/clinical analyses
– decision_pacientes_02.R: applies business rules / patient‐decision logic
– funciones.R: shared helper functions used by multiple analysis scripts
d. Orchestration
– ejecutar.R / ejecutar_2.R: pipeline drivers that call the above modules in sequence
e. Reporting
– generar_reporte.R / generar_reporte_2.R: assemble results into final reports
– docx or other target formats (e.g., Word/PDF)
f. Configuration & Dependencies
– librerias.R: installs or loads required R packages
– PaulaAnemias.Rproj: RStudio project settings
– scripts_viejos/: archival scripts (for reference)
Interactions and Data Flow
• Raw DOCX → docx_a_txt.R → text files
• Text files → contar_palabras_todo.R → word‐count tables
• Word‐count tables + definitions → analisis_resultados.R → intermediate result datasets
• Intermediate datasets → decision_pacientes_02.R → flagged patient decisions
• All intermediate results → generar_reporte(.R) → final reports
• ejecutar(.R) orchestrates the full chain
• librerias.R is sourced at the start of each script to ensure dependencies
Architectural Patterns & Principles
• Pipeline pattern: linear ETL + analysis + reporting stages
• Modular scripts: each R file is a reusable component (single responsibility)
• Orchestrator scripts drive reproducibility and ordering
• Separation of concerns: ingestion vs analysis vs reporting
Detailed Elements
• Title: “Anemias_R Processing Pipeline”
[librerias.R] → [docx_a_txt.R] → [contar_palabras_todo.R] →
[analisis_resultados.R] → [decision_pacientes_02.R] → [generar_reporte.R]