Skip to main content

Diagnose a stuck claim 🚨

Outcome

A claim that is stuck at any lifecycle stage has a documented root cause and a clear next action — submit, fix and rebuild, or escalate.

Prerequisites

  • billing.claim.read (status inspection) and billing.claim.write (any state-changing action).
  • psql access for direct DB inspection.
  • Access to the EDI Gateway logs.

Common stuck states

StatusMeaningInvestigation
CREATEDNot yet builtConfirm charges are validated; run POST /claims/build.
BUILTBuilt but not submittedCheck EDI Gateway for submission errors.
SUBMITTEDWaiting for acknowledgmentCheck 999/TA1 response; check SFTP polling.
REJECTEDPayer rejected (999)Inspect error_details; fix and resubmit.
DENIEDPayer denied paymentSee Denials and appeals.

Diagnostic flow

Steps

  1. Check current claim status:

    curl "http://localhost:3002/claims/<claim_id>"
  2. Read the status history:

    SELECT c.claim_id, c.status_current,
    csh.status, csh.changed_at, csh.reason
    FROM billing.claim c
    JOIN billing.claim_status_history csh ON c.claim_id = csh.claim_id
    WHERE c.claim_id = '<claim_id>'
    ORDER BY csh.changed_at;

    The history tells you when the claim got stuck, not just where.

  3. Inspect EDI transactions for this claim:

    SELECT et.edi_transaction_id, et.direction, et.tx_type, et.status,
    et.error_details, et.retry_count, et.created_at
    FROM billing.edi_transaction et
    JOIN billing.edi_transaction_claim etc
    ON et.edi_transaction_id = etc.edi_transaction_id
    WHERE etc.claim_id = '<claim_id>'
    ORDER BY et.created_at DESC;

    Patterns:

    PatternMeaningNext
    Outbound SUBMITTED, no inbound 999Acknowledgment never receivedHandle SFTP failure
    Outbound ERROR with retry_count >= 3Stuck in retry loopFix root cause; manually replay
    No edi_transaction rows at allRouting failed; claim never built into a batchCheck routing rules simulator
  4. Take the appropriate action based on status:

    StatusAction
    CREATEDRun POST /claims/build. If it fails, the response carries the validation issue.
    BUILTReplay submission: POST /edi/admin/replay/<edi_transaction_id>
    SUBMITTEDCheck SFTP poller; see Handle SFTP failure.
    REJECTEDRead edi_transaction.error_details; fix charges/configuration; rebuild.
    DENIEDMove to Denials and appeals.

Validation

CheckExpected
claim.status_currentAdvanced past stuck state
edi_transaction rowLatest transaction has clean error_details
claim_status_historyNew row with the recovery transition

Troubleshooting

SymptomCauseFix
POST /claims/build fails with CHARGES_NOT_VALIDATEDCharges have validation errorsInspect charge.errors; fix and revalidate.
Replay returns 200 but transaction stays ERRORUnderlying batch malformedLook at error_details — typically a companion-guide validation failure.
Claim moves to SUBMITTED then back to BUILTTA1/999 rejection not detectedCheck the 999 parser; the claim shouldn't auto-revert without a status reason.
Multiple claims stuck simultaneouslyRouting or partner outageSee Submission routing rules and SFTP failure.

Cross-references

Next

3.2 — Manage denials and appeals