Skip to content

Retrieve billed-cost and payment details

This operation supports the financial-reconciliation side of recovery: clsBillAuditService splits a medical bill-audit service line's allowed amount between lien and non-lien portions, and clsClaimPaymentTransDetail performs the equivalent split for a claim payment transaction, adding an unknown-amount bucket. clsClaimCostCategoryCode is a read-only cost-category lookup used across lien, prediction, and expense categorization, while clsPolicyNote provides write-only policy-memo and mail-routing integration used to notify policy-side systems of recovery activity.

Field Value
Operation ID OP-TP-08
Trigger clsBillAuditService.Save(); clsClaimPaymentTransDetail.Save(); direct calls to clsClaimCostCategoryCode retrieval and clsPolicyNote.InsertMemoEntry/GetTeamMailID
Inputs LienAmt, NonLienAmt, AllowedAmt (bill-audit service); LienAmt, NonLienAmt, UnknownAmt, TransactionAmt (claim payment trans detail); policy number, team code, memo text
Outputs Persisted THRDPARTY_BILL_SERVICE rows reconciled to the allowed amount; persisted claim payment transaction detail rows reconciled to the transaction amount; cost-category code lookups; inserted policy memo entries and resolved team mail IDs
Primary components clsBillAuditService.ValidTotal, clsClaimPaymentTransDetail.ValidTotal, clsClaimCostCategoryCode, clsPolicyNote.InsertMemoEntry, clsPolicyNote.GetTeamMailID
Entry point Business\SAIF.Business.Claim.ThirdParty\clsBillAuditService.vb

Steps

  1. Create or retrieve a bill-audit service line for a lien category (fetched by its parent lien-category retrieval; see Manage liens and settlements).
  2. Validate the bill-audit service line (IsValid):
  3. Lien amount plus non-lien amount must equal the allowed amount (BR-033).
  4. Persist the bill-audit service line via insert (SQL-017) or update (SQL-071) against THRDPARTY_BILL_SERVICE.
  5. Create or retrieve a claim payment transaction detail row for a lien.
  6. Validate the claim payment transaction detail (IsValid):
  7. Lien amount plus non-lien amount plus unknown amount must equal the transaction amount (BR-033).
  8. Persist the claim payment transaction detail row via its own insert/update SQL (criteria-driven; catalogued generically under the parent claim-payment integration rather than as a standalone SQL entry).*
  9. Look up cost category codes. clsClaimCostCategoryCode retrieves the list of valid third-party claim cost category codes used to categorize liens, predictions, and expenses (SQL-040, TP_CLAIM_COST_CATEGORY_CODE); no business rules are registered — this is a pure reference lookup.*
  10. Insert a policy memo entry. clsPolicyNote.InsertMemoEntry writes a memo record directly against the legacy policy system via sp72155_insert_memo_entry (SQL-033); this call bypasses the BOF business-object save pipeline and issues the stored procedure directly, so no RulesAffected/row-count validation is performed.*
  11. Resolve a team mail ID. clsPolicyNote.GetTeamMailID calls policy_pkg.get_team_mailid directly to resolve the mailbox for a policy/team combination, used to route recovery correspondence (SQL-032); likewise bypasses the standard save pipeline.*

Process flow

The following diagram visualizes the two reconciliation validations that anchor this operation.

flowchart TD
    Start([Caller edits a bill-audit<br>service line or payment trans detail])
    Start --> Kind{Which object?}
    Kind -->|BillAuditService| BillCheck{Lien + Non-lien<br>= Allowed?}
    Kind -->|ClaimPaymentTransDetail| PayCheck{Lien + Non-lien<br>+ Unknown = Transaction?}
    BillCheck -->|No| BillFail([Error: amounts<br>must reconcile])
    BillCheck -->|Yes| BillSave[Insert or update<br>THRDPARTY_BILL_SERVICE]
    PayCheck -->|No| PayFail([Error: amounts<br>must reconcile])
    PayCheck -->|Yes| PaySave[Insert or update<br>payment trans detail]
    BillSave --> Done([Reconciled amounts persisted])
    PaySave --> Done

Failure and edge-case behavior

  • Both reconciliation rules use an exact equality check (<>) rather than a tolerance/rounding band, so even a one-cent rounding discrepancy between the summed components and the target amount fails validation.*
  • clsPolicyNote's memo-insert and mail-ID lookup calls issue their stored procedures directly rather than through the standard Save()/business-rule pipeline used elsewhere in this library, so they carry no IsValid/broken-rules protection of their own.*
  • clsClaimCostCategoryCode has no registered business rules — it is a pure reference lookup shared by liens, predictions, and expenses.*
  • No length or format validation is documented for the policy memo text passed to InsertMemoEntry; any constraint is enforced by the target stored procedure rather than the BOF layer.**

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** denote areas where the underlying behavior could not be determined from the available source and should be validated with a subject-matter expert before being treated as fact.

Sources

  • Business\SAIF.Business.Claim.ThirdParty\clsBillAuditService.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsBillAuditServiceCollection.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsClaimPaymentTransDetail.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsClaimPaymentTransDetailCollection.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsClaimCostCategoryCode.vb
  • Business\SAIF.Business.Claim.ThirdParty\clsPolicyNote.vb