How fog-3/cloudcare works
Project type and purpose
• CloudCare is a full-stack, data-driven clinical assistant for hospitals.
• Frontend: Angular SPA/SSR providing UI for patient search, charts, and chat.
• Backend: Java Spring Boot REST API for CRUD (patients, labs, notes, meds, procedures).
• AI layer: Python Lambda functions (deployed via API Gateway) to run LLM prompts and generate summaries/plots.
• Data/ML: Python ETL scripts to load and clean data; CSV backups and SQL scripts; test harness for OpenAI integration.
File structure
• Top-level modules:
• ai/ — Python code for local examples and AWS Lambda (lambda_project).
• backend/CloudCareSpring — Spring Boot microservice (pom.xml, main/java, repositories, services).
• backend/api — tests for OpenAI-based endpoints (invokes Lambda?).
• backend/data_processing — ETL scripts ingesting raw data into the database.
• backend/prompts — JSON templates for LLM prompts.
• frontend/ — Angular project (app components, routes, services/types, assets, SSR entry points).
• ml/ — synthetic and real CSV datasets, SQL import scripts.
• docs/ — architecture.md (reference), presentation materials.
• Key patterns:
• Layered design in Spring Boot (Controller → Service → Repository → DB).
• Angular module/component hierarchy (pages, services).
• Serverless functions behind API Gateway for AI tasks.
• Separate ETL/ML pipelines feeding the main database.
Extract additional insights from README
• Purpose: Automate generation of “evolutive summaries” for hospitalized patients.
• Main flows: patient lookup → view clinical history and labs → generate interactive graphics → ask chatbot for summary or custom chart.
• Tech stack: Angular, TypeScript, Spring Boot, Java, Maven, Python, AWS Lambda, API Gateway, OpenAI APIs.
a. Main components
1. User & Browser (Patient/Doctor UI).
2. Angular Frontend (deployed on static host or Node SSR).
3. API Gateway (REST endpoints for chat/summary).
4. AWS Lambda Functions (lambda_function1.py, lambda_function2.py).
5. Spring Boot Backend (PacientesResource & other controllers).
6. Relational Database (e.g., RDS/Postgres) holding patients, labs, notes, meds, procedures.
7. ETL/Data Processing module (data_check.py) loading CSV/SQL into DB.
8. ML/Data Store (csv files, insertarDatos.SQL) for offline analytics.
9. OpenAI Service (external LLM).
10. Prompts Store (JSON templates).
b. Relationships & interactions
• Browser ↔ Angular Frontend via HTTP/HTTPS.
• Frontend ↔ Spring Boot API for CRUD operations on patient data.
• Frontend ↔ API Gateway → Lambda → OpenAI for chat & summaries.
• Spring Boot ↔ Database via JPA repositories.
• ETL scripts (cron or manual) load raw/clean CSVs into Database.
• ML/data folder serves as source for ETL or bulk imports.
• Lambda functions may also read/write to test_db.py or directly to the DB for caching.
• Prompts JSON are consumed by Lambda when composing LLM requests.
c. Architectural patterns
• Layered MVC in Spring Boot.
• Component-based in Angular.
• Serverless micro-functions for AI workloads.
• Batch ETL pipeline separate from real-time services.
• Clear separation of concerns: UI, business logic, data, and AI.
d. Key technologies/frameworks
• Angular (components, services, routing, SSR).
• Spring Boot (REST controllers, services, JPA, Maven).
• AWS Lambda + API Gateway (Python 3.x functions).
• OpenAI SDK (invoked inside Lambda).
• ETL scripts in Python (pandas/sqlalchemy).
• Relational DB (MySQL/Postgres via JPA).