Códigos Inválidos
Overview
Documentação base para a regra "Códigos Inválidos".
Este agente é usado com os seguintes IDs:
- C007: Códigos inativos
- C008: Códigos inválidos
- C033: Códigos não preenchidos
Architecture
| Field | Value |
|---|---|
| Name | Códigos Inválidos |
| Agent ID | C007, C008, C033 |
| Version | 4 |
| Nature | adm |
| Layer | — |
Inheritance
InvalidCodeRule → BaseRule → BaseAgent
Core Functionality
- load_artifacts
- prepare_data
- rule_assessment
Business Rules
Conformidade da cobrança
Consultar código-fonte para regras de negócio detalhadas.
Usage
from agents.invalidcoderule import InvalidCodeRule
rule = InvalidCodeRule()
violations_df = rule.rule_assessment(claims_df)
Configuration
rule = InvalidCodeRule(
tabela_propria=None,
exp_th=500,
logger=logger,
evaluated=False,
origin="Contas",
)
Input Requirements
| Column | Type | Description |
|---|---|---|
EVENT_COLUMNS.id_evento |
- | - |
EVENT_COLUMNS.categoria |
- | - |
EVENT_COLUMNS.vl_pago |
- | - |
EVENT_COLUMNS.qt_paga |
- | - |
EVENT_COLUMNS.vl_unitario_pago |
- | - |
EVENT_COLUMNS.dt_atendimento |
- | - |
ARVO_COLUMNS.code_type |
- | - |
EVENT_COLUMNS.id |
- | - |
EVENT_COLUMNS.id_fatura |
- | - |
EVENT_COLUMNS.evento |
- | - |
PROVIDER_COLUMNS.id_prestador |
- | - |
Output Format
Glosa DataFrame Columns
| Column | Description |
|---|---|
agent_id |
C007, C008, C033 |
version |
4 |
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.