Run batch operations
Outcome
Bulk claim builds, ingestion batches, and the nightly job runner are visible and operable; failed records are retriable.
Prerequisites
claims.writefor claim build calls.ingestion.read/ingestion.updatefor 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
| Check | Expected |
|---|---|
| Claim build response | All claim IDs returned, no errors |
| Batch status | Counters tie out: total = processed = success + error |
| Retry result | Failed records flip PENDING → SUCCESS on next tick |
| jobRunner logs | Heartbeat per cycle |
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
/claims/build returns 400 with per-charge errors | Charges not validated yet | Validate first; re-call. |
Batch never advances past PENDING | Worker not running | Check process-batch worker; see Feed admin JOBS_DISABLED. |
| Retry has no effect | All ERROR rows already retried; new errors | Inspect error_detail; the underlying issue persists. |
Cross-references
- Feed admin for batch retry on the SFTP side.
- Timely filing alerts — fed by the nightly runner.
- Refresh reporting views.