46 lines
2.1 KiB
Python
46 lines
2.1 KiB
Python
from sqlalchemy import Column, String, Integer, Boolean, DateTime, ForeignKey, Text, JSON, ARRAY, relationship
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
from src.config.database import Base
|
|
from sqlalchemy.sql import func
|
|
import uuid
|
|
|
|
class ClaimScrubResult(Base):
|
|
__tablename__ = 'claim_scrub_results'
|
|
|
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4, nullable=False)
|
|
claim_id = Column(UUID(as_uuid=True), nullable=False)
|
|
scrub_status = Column(String(255), nullable=False)
|
|
overall_risk_level = Column(String(255), nullable=True)
|
|
total_checks = Column(Integer, nullable=False)
|
|
passed_checks = Column(Integer, nullable=False)
|
|
failed_checks = Column(Integer, nullable=False)
|
|
warning_checks = Column(Integer, nullable=True)
|
|
ncci_violations = Column(JSON, nullable=True)
|
|
lcd_violations = Column(JSON, nullable=True)
|
|
ncd_violations = Column(JSON, nullable=True)
|
|
payer_rule_violations = Column(JSON, nullable=True)
|
|
coding_errors = Column(JSON, nullable=True)
|
|
medical_necessity_issues = Column(JSON, nullable=True)
|
|
modifier_issues = Column(JSON, nullable=True)
|
|
bundling_issues = Column(JSON, nullable=True)
|
|
denial_risk_patterns = Column(JSON, nullable=True)
|
|
corrective_actions = Column(JSON, nullable=True)
|
|
suggested_codes = Column(JSON, nullable=True)
|
|
rag_documents_used = Column(JSON, nullable=True)
|
|
scrub_engine_version = Column(String(255), nullable=True)
|
|
processing_time_ms = Column(Integer, nullable=True)
|
|
auto_fix_applied = Column(Boolean, nullable=True)
|
|
auto_fix_details = Column(JSON, nullable=True)
|
|
requires_manual_review = Column(Boolean, nullable=True)
|
|
review_priority = Column(String(255), nullable=True)
|
|
|
|
claim_id = Column(UUID(as_uuid=True), ForeignKey('claims.id'), nullable=False)
|
|
claim = relationship('Claim', back_populates='')
|
|
|
|
created_at = Column(DateTime(timezone=True), server_default=func.now(), nullable=False)
|
|
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now(), nullable=False)
|
|
|
|
def __repr__(self):
|
|
return f'<ClaimScrubResult(id={self.id})>'
|
|
|