Pertinência de equipo fotossensível
Overview
Pertinence agent for photosensitive equipment (AI004). Evaluates whether photosensitive equipment charges are clinically justified by checking if the same invoice contains at least one medication from the photosensitive_equip_allowlist BigQuery artifact. Equipment in invoices without any justifying medication is flagged.
Architecture
| Field |
Value |
| Name |
Pertinência de equipo fotossensível |
| Agent ID |
AI004 |
| Version |
0.0.0 |
| Nature |
audit |
| Layer |
— |
Inheritance
PhotosensitiveEquipPertinenceRule → PertinenceRule → 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.photosensitiveequippertinencerule import PhotosensitiveEquipPertinenceRule
rule = PhotosensitiveEquipPertinenceRule()
violations_df = rule.rule_assessment(claims_df)
Configuration
rule = PhotosensitiveEquipPertinenceRule(
evaluated=False,
evaluated=evaluated,
artifact_loader=ArtifactLoader(self.logger),
DataFrame=pd.DataFrame(),
DataFrame=pd.DataFrame(),
allowlist_keys=set(),
taxonomy_raw=self.artifact_loader.load_taxonomy(,
familia_tax_3=[TARGET_FAMILIA_TAX_3],
)
| 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 |
- |
- |
ARVO_COLUMNS.id_evento_predicted |
- |
- |
ARVO_COLUMNS.code_type_predicted |
- |
- |
Glosa DataFrame Columns
| Column |
Description |
agent_id |
AI004 |
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.