Agente de Pacotes
Overview
Agent to search for charges of itens already included in the package present in the claim. Packages composition in the artifact refined_{partner}.info_pacotes (not available for all partners).
Architecture
| Field | Value |
|---|---|
| Name | Agente de Pacotes |
| Agent ID | C003 |
| Version | 3 |
| Nature | tech |
| Layer | — |
Inheritance
ImproperPackageChargeRule → BaseRule → BaseAgent
Core Functionality
- load_artifacts
- prepare_data
- solve_code
- break_package
- expand_taxomy
- rule_assessment
- create_metadata
- partial_denial
Business Rules
Conformidade contrato
Consultar código-fonte para regras de negócio detalhadas.
Usage
from agents.improperpackagechargerule import ImproperPackageChargeRule
rule = ImproperPackageChargeRule()
violations_df = rule.rule_assessment(claims_df)
Configuration
Sem parâmetros configuráveis identificados.
Input Requirements
| Column | Type | Description |
|---|---|---|
ARVO_COLUMNS.code_type_predicted |
- | - |
ARVO_COLUMNS.id_evento_predicted |
- | - |
EVENT_COLUMNS.id_evento |
- | - |
EVENT_COLUMNS.evento |
- | - |
PROVIDER_COLUMNS.id_prestador |
- | - |
BENEFICIARY_COLUMNS.plano |
- | - |
EVENT_COLUMNS.vl_unitario_pago |
- | - |
EVENT_COLUMNS.vl_pago |
- | - |
EVENT_COLUMNS.id_fatura |
- | - |
EVENT_COLUMNS.id |
- | - |
EVENT_COLUMNS.qt_paga |
- | - |
EVENT_COLUMNS.dt_atendimento |
- | - |
EVENT_COLUMNS.categoria |
- | - |
EVENT_COLUMNS.guia |
- | - |
EVENT_COLUMNS.pacote |
- | - |
Output Format
Glosa DataFrame Columns
| Column | Description |
|---|---|
agent_id |
C003 |
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.