Skip to main content

Run batch operations

Outcome

Bulk claim builds, ingestion batches, and the nightly job runner are visible and operable; failed records are retriable.

Prerequisites

  • claims.write for claim build calls.
  • ingestion.read / ingestion.update for batch operations.

Batch claim building

Build claims from validated charges:

curl -X POST http://localhost:3002/claims/build \
-H "Content-Type: application/json" \
-d '{
"chargeIds": ["<charge_id_1>", "<charge_id_2>", "..."]
}'

If charges fail validation, the response carries per-charge errors. Fix upstream and re-call.

Batch data ingestion

# Start batch processing
curl -X POST http://localhost:3007/batches \
-H "Content-Type: application/json" \
-d '{
"artifactId": "<artifact_id>",
"records": [{"rowNumber": 1, "data": {...}}, ...],
"idempotencyKeyFields": ["ServiceDate", "MemberId"]
}'

# Check batch status
curl http://localhost:3007/batches/<batch_id>

# Retry failed records
curl -X POST http://localhost:3007/batches/<batch_id>/retry

idempotencyKeyFields lets the processor skip already-seen rows on retry — pick a tuple that's stable across re-deliveries from the source.

Nightly job runner

The claim service includes an automatic nightly job runner that starts on service init. It handles:

  • Building claims from validated charges.
  • Timely-filing deadline checks (see Timely filing alerts).
  • Stale claim detection.

Monitor via structured logs:

journalctl -u rcm-core | grep jobRunner

Refresh materialized views

Reporting views feed dashboards. See Refresh reporting views for the full refresh contract; the manual one-shot is:

-- Refresh billing reconciliation views
SELECT billing.fn_refresh_recon_views();

-- Refresh reporting views
SELECT reporting.fn_refresh_reporting_views();

Validation

CheckExpected
Claim build responseAll claim IDs returned, no errors
Batch statusCounters tie out: total = processed = success + error
Retry resultFailed records flip PENDING → SUCCESS on next tick
jobRunner logsHeartbeat per cycle

Troubleshooting

SymptomCauseFix
/claims/build returns 400 with per-charge errorsCharges not validated yetValidate first; re-call.
Batch never advances past PENDINGWorker not runningCheck process-batch worker; see Feed admin JOBS_DISABLED.
Retry has no effectAll ERROR rows already retried; new errorsInspect error_detail; the underlying issue persists.

Cross-references

Next

7.2 — Check timely filing alerts