ArvoAgentHub

Exclusão de materiais MAME — Intercâmbio

Overview

MAME material exclusion for national interchange (I005). Matches materials via two paths: (1) artifact id_eventoid_evento_predicted, or (2) familia_tax_mame + optional evento_regex expanded through taxonomy_mame. MAME manual version comes from dt_atendimento and mame_version_calendar. When filter_interchange_claims=True (default), only rows with a valid regra_intercambio are processed. When False, all input rows are evaluated regardless of interchange metadata (testing or non-interchange scenarios).

Architecture

Field Value
Name Exclusão de materiais MAME — Intercâmbio
Agent ID I005
Version 0.0.0
Nature tech
Layer

Inheritance

MameInterchangeExclusionRule → BaseAgent → BaseAgent

Core Functionality

  1. load_artifacts
  2. prepare_data
  3. rule_assessment

Business Rules

Pertinência da cobrança

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

Usage

from agents.mameinterchangeexclusionrule import MameInterchangeExclusionRule

rule = MameInterchangeExclusionRule()
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.vl_pago - -
EVENT_COLUMNS.qt_paga - -
EVENT_COLUMNS.categoria - -
EVENT_COLUMNS.regime_atendimento - -
EVENT_COLUMNS.regra_intercambio - -
EVENT_COLUMNS.dt_atendimento - -
ARVO_COLUMNS.id_evento_predicted - -
ARVO_COLUMNS.code_type_predicted - -

Output Format

Glosa DataFrame Columns

Column Description
agent_id I005
version 0.0.0
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.