feat(sp7): ServiceLinePayment ORM model
This commit is contained in:
@@ -300,6 +300,48 @@ class CasAdjustment(Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
class ServiceLinePayment(Base):
|
||||||
|
"""One row per 835 SVC composite (loop 2110).
|
||||||
|
|
||||||
|
SP7. Persisted on 835 ingest *before* ``reconcile.run()`` decides
|
||||||
|
which claim this line applies to. Independent of claim matching.
|
||||||
|
|
||||||
|
See spec §3.1.
|
||||||
|
"""
|
||||||
|
__tablename__ = "service_line_payments"
|
||||||
|
|
||||||
|
id: Mapped[int] = mapped_column(Integer, primary_key=True, autoincrement=True)
|
||||||
|
remittance_id: Mapped[str] = mapped_column(
|
||||||
|
String(64), ForeignKey("remittances.id", ondelete="CASCADE"), nullable=False
|
||||||
|
)
|
||||||
|
line_number: Mapped[int] = mapped_column(Integer, nullable=False)
|
||||||
|
procedure_qualifier: Mapped[str] = mapped_column(String(4), nullable=False)
|
||||||
|
procedure_code: Mapped[str] = mapped_column(String(16), nullable=False)
|
||||||
|
modifiers_json: Mapped[str] = mapped_column(
|
||||||
|
JSONText, nullable=False, default=lambda: "[]"
|
||||||
|
)
|
||||||
|
charge: Mapped[Decimal] = mapped_column(Numeric(12, 2), nullable=False)
|
||||||
|
payment: Mapped[Decimal] = mapped_column(Numeric(12, 2), nullable=False)
|
||||||
|
units: Mapped[Optional[Decimal]] = mapped_column(Numeric(10, 2), nullable=True)
|
||||||
|
unit_type: Mapped[Optional[str]] = mapped_column(String(8), nullable=True)
|
||||||
|
service_date: Mapped[Optional[date]] = mapped_column(Date, nullable=True)
|
||||||
|
ref_benefit_plan: Mapped[Optional[str]] = mapped_column(String(64), nullable=True)
|
||||||
|
superseded_by_id: Mapped[Optional[int]] = mapped_column(
|
||||||
|
Integer,
|
||||||
|
ForeignKey("service_line_payments.id", ondelete="SET NULL"),
|
||||||
|
nullable=True,
|
||||||
|
)
|
||||||
|
|
||||||
|
__table_args__ = (
|
||||||
|
Index("ix_service_line_payments_remittance_id", "remittance_id"),
|
||||||
|
Index(
|
||||||
|
"ix_service_line_payments_procedure_code_date",
|
||||||
|
"procedure_code",
|
||||||
|
"service_date",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
class Match(Base):
|
class Match(Base):
|
||||||
__tablename__ = "matches"
|
__tablename__ = "matches"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user