Qtd excessiva de terapia internação
Overview
Rule to detect excessive therapy sessions during hospitalization. This rule analyzes therapy events associated with inpatient stays, compares them against predefined therapy limits (artifacts), and identifies cases where the number of sessions exceeds the maximum allowed quantity.
Architecture
| Field | Value |
|---|---|
| Name | Qtd excessiva de terapia internação |
| Agent ID | C037 |
| Version | 3 |
| Nature | tech |
| Layer | — |
Inheritance
ExcessiveTherapiesIntRule → BaseRule → BaseAgent
Core Functionality
- artifacts_tolerance
- load_artifacts
- prepare_data
- rule_assessment
Business Rules
Comportamento indevido
Consultar código-fonte para regras de negócio detalhadas.
Usage
from agents.excessivetherapiesintrule import ExcessiveTherapiesIntRule
rule = ExcessiveTherapiesIntRule()
violations_df = rule.rule_assessment(claims_df)
Configuration
Sem parâmetros configuráveis identificados.
Input Requirements
Consultar expected_input_columns no código-fonte.
Output Format
Glosa DataFrame Columns
| Column | Description |
|---|---|
agent_id |
C037 |
version |
3 |
id_arvo |
Original record ID |
vl_glosa_arvo |
Glosa value |
qt_glosa_arvo |
Glosa quantity |
score_arvo |
Confidence score |
motivo_glosa_arvo |
Detailed reason in Portuguese |
motivo_glosa_ANS |
ANS standard code |
data_dict |
JSON metadata with calculation details |
Error Handling
- DataFrames vazios retornam estrutura vazia com colunas obrigatórias.
- Colunas ausentes geram warning mas não causam crash.
- Conversões numéricas usam
errors="coerce"para evitar falhas.