Elegibilidade de Procedimento e Contrato
Overview
T004 — Elegibilidade de procedimento e contrato. Sub-rules: A (carencia): beneficiário em período de carência → glosa total B (cobertura): procedimento não coberto pelo plano → glosa total CID workaround: Partners that map CID in dictionarization (Petro, Austa, Leve, Vivest) must pass cid_raw_table and cid_column kwargs so the agent can load CID from raw claims and include it in the eligibility key.
Architecture
| Field | Value |
|---|---|
| Name | Elegibilidade de Procedimento e Contrato |
| Agent ID | T004 |
| Version | 0.0.0 |
| Nature | adm |
| Layer | — |
Inheritance
ProcedureContractEligibilityRule → EligibilityRule → BaseAgent
Core Functionality
- evaluate_cpt
- load_artifacts
- prepare_data
- rule_assessment
Business Rules
Conformidade contrato
Consultar código-fonte para regras de negócio detalhadas.
Usage
from agents.procedurecontracteligibilityrule import ProcedureContractEligibilityRule
rule = ProcedureContractEligibilityRule()
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 |
- | - |
ARVO_COLUMNS.id_evento_predicted |
- | - |
ARVO_COLUMNS.code_type_predicted |
- | - |
EVENT_COLUMNS.evento |
- | - |
EVENT_COLUMNS.dt_atendimento |
- | - |
BENEFICIARY_COLUMNS.id_matricula |
- | - |
EVENT_COLUMNS.qt_paga |
- | - |
EVENT_COLUMNS.vl_pago |
- | - |
ARVO_COLUMNS.code_type |
- | - |
EVENT_COLUMNS.categoria |
- | - |
EVENT_COLUMNS.regime_atendimento |
- | - |
EVENT_COLUMNS.carater_atendimento |
- | - |
EVENT_COLUMNS.codigo_tuss |
- | - |
Output Format
Glosa DataFrame Columns
| Column | Description |
|---|---|
agent_id |
T004 |
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.