Procedimentos excludentes e incompatíveis UNIMED
Overview
Implements the exclusion codes rule for UNIMED Interchange claims. Agent id: I002 This agent evaluates interchange claims to ensure that incompatible or mutual exclusive codes are not charged together. It flags and annotates items that are not in accordance with the interchange rules. The artifact is loaded from the parameters informed in the artifacts parameter by the user. There are three types of rules for the artifact: - REGIONAL: when the provider is inside the zone of abrangency of the partner. - FEDERATIVO: when the provider is from the same state of the partner but outside its zone of abrangency. - NACIONAL: when the provider is from a different state of the partner. For each rule type, a specific artifact is expected. For now, only NACIONAL rules are supported. See details below. Three artifact sources are supported: - Standard exclusion codes (ARTIFACTS.unimed_interchange_national_exclusion_codes) - Anexo I Protocolo Nacional (ARTIFACTS.annex_i_unimed_interchange_national_exclusion_codes) - MAME (ARTIFACTS.mame_interchange_exclusion_codes) Each source has its own motivo_critica_arvo template and is tracked via the artifact_source column (values: "exclusion_codes", "annex_i", or "mame").
Architecture
| Field | Value |
|---|---|
| Name | Procedimentos excludentes e incompatíveis UNIMED |
| Agent ID | I002 |
| Version | 1 |
| Nature | tech |
| Layer | — |
Inheritance
InterchangeExclusionCodesRule → BaseRule → BaseAgent
Core Functionality
- load_artifacts
- prepare_data
- rule_assessment
Business Rules
Pertinência da cobrança
Consultar código-fonte para regras de negócio detalhadas.
Usage
from agents.interchangeexclusioncodesrule import InterchangeExclusionCodesRule
rule = InterchangeExclusionCodesRule()
violations_df = rule.rule_assessment(claims_df)
Configuration
Sem parâmetros configuráveis identificados.
Input Requirements
| Column | Type | Description |
|---|---|---|
EVENT_COLUMNS.id_fatura |
- | - |
EVENT_COLUMNS.dt_atendimento |
- | - |
EVENT_COLUMNS.id_evento |
- | - |
PROVIDER_COLUMNS.id_prestador |
- | - |
EVENT_COLUMNS.vl_pago |
- | - |
EVENT_COLUMNS.vl_unitario_pago |
- | - |
EVENT_COLUMNS.qt_paga |
- | - |
EVENT_COLUMNS.id |
- | - |
EVENT_COLUMNS.categoria |
- | - |
EVENT_COLUMNS.guia |
- | - |
EVENT_COLUMNS.pacote |
- | - |
EVENT_COLUMNS.tipo_intercambio |
- | - |
Output Format
Glosa DataFrame Columns
| Column | Description |
|---|---|
agent_id |
I002 |
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.