ArvoAgentHub

Quantidade excessiva de pacotes

Overview

Rule agent for detecting excessive package charges in healthcare claims. This class implements a rule to identify cases where the same package are charged multiple times for the same patient, provider, and date of service.

Architecture

Field Value
Name Quantidade excessiva de pacotes
Agent ID C059
Version 1
Nature audit
Layer

Inheritance

ExcessivePackagesChargeRule → BaseRule → BaseAgent

Core Functionality

  1. load_artifacts
  2. prepare_data
  3. rule_assessment

Business Rules

Pertinência de cobrança

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

Usage

from agents.excessivepackageschargerule import ExcessivePackagesChargeRule

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

Configuration

Sem parâmetros configuráveis identificados.

Input Requirements

Column Type Description
EVENT_COLUMNS.id - -
EVENT_COLUMNS.id_fatura - -
EVENT_COLUMNS.id_evento - -
EVENT_COLUMNS.evento - -
EVENT_COLUMNS.qt_paga - -
EVENT_COLUMNS.vl_pago - -
PROVIDER_COLUMNS.id_prestador - -
EVENT_COLUMNS.dt_atendimento - -
EVENT_COLUMNS.guia - -
EVENT_COLUMNS.pacote - -
BENEFICIARY_COLUMNS.id_matricula - -
EVENT_COLUMNS.categoria - -

Output Format

Glosa DataFrame Columns

Column Description
agent_id C059
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.