ArvoAgentHub

Quantidade Excessiva de Materiais

Overview

Agent for detecting excessive quantity of enteral materials. This agent implements business rules to identify cases where the quantity of enteral equipment billed exceeds the technical recommendation based on patient length of stay, following ANVISA's Caderno 4 guidelines. Business Rule: The maximum quantity of enteral equipment that can be billed per invoice must be equal to the number of days of patient stay. Quantities above this limit are considered excessive and should be denied. Example: Patient hospitalized for 5 days = maximum 5 billable enteral equipment. If 8 equipment were billed = 3 excess equipment should be denied.

Architecture

Field Value
Name Quantidade Excessiva de Materiais
Agent ID C064
Version 1
Nature tech
Layer

Inheritance

ExcessiveEquipoEnteralRule → BaseRule → BaseAgent

Core Functionality

  1. load_artifacts
  2. aplica_glosa_parcial
  3. prepare_data
  4. rule_assessment

Business Rules

Pertinência da cobrança

Consultar código-fonte para regras de negócio detalhadas.

Usage

from agents.excessiveequipoenteralrule import ExcessiveEquipoEnteralRule

rule = ExcessiveEquipoEnteralRule()
violations_df = rule.rule_assessment(claims_df)

Configuration

rule = ExcessiveEquipoEnteralRule(
    logger=logger,
    evaluated=False) -> None:,
)

Input Requirements

Consultar expected_input_columns no código-fonte.

Output Format

Glosa DataFrame Columns

Column Description
agent_id C064
version 1
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.