Batch Job Reference

 

This page lists the Batch2 batch jobs registered in Smile CDR, the job ID used to invoke each one, and the parameters a caller typically supplies. When invoking a job from a custom scheduled job, the job ID is the value placed after the batch: prefix in the target field — for example batch:REINDEX.

The Scheduled job candidate column indicates how well-suited each job is to being run automatically on a recurring schedule:

  • Yes — Routine, idempotent maintenance work that is commonly scheduled.
  • Situational — Can be scheduled, but is more often triggered on demand. Schedule only when the inputs are stable and known ahead of time.
  • No (destructive) — Permanently removes data and should be run deliberately, not automated.
  • No (internal) — Triggered automatically by an operation or request. Its parameters (internal PIDs, Task IDs, request context) are not known ahead of time, so it cannot be driven by a scheduled job.

Job Catalog

Job IDWhat it doesTypical parametersScheduled job candidate
REINDEXReindexes stored resources to rebuild search parameters and optimize storage.url (search URLs to reindex), batchSize, optimizeStorage, reindexSearchParametersYes — common after adding/changing SearchParameters.
MDM_SUBMITSubmits resources to the MDM matching pipeline to create/update MDM links.url (search URLs selecting resources to submit), batchSizeYes — periodically match newly ingested resources.
BULK_EXPORTExports FHIR resources to NDJSON for bulk data exchange.resourceTypes, since, until, filters, exportStyle (PATIENT/GROUP/SYSTEM), groupId, expandMdmSituational — useful for recurring exports (e.g. nightly); often on demand.
BULK_IMPORT_PULLImports FHIR resources by pulling NDJSON from a set of URLs.ndJsonUrls (required), httpBasicCredentials, maxBatchResourceCountSituational — schedulable when polling a known, stable feed.
DELETE_EXPUNGEPermanently deletes resources matching the given criteria, optionally cascading.url (search URLs to delete), batchSize, cascade, cascadeMaxRoundsNo (destructive) — deliberate, audited operation.
MDM_CLEARRemoves MDM links and golden resources for the given resource types.resourceType, url, batchSizeNo (destructive) — wipes MDM state.
termCodeSystemDeleteJobDeletes an entire terminology CodeSystem and all of its versions/concepts.codeSystemPID (internal CodeSystem PID)No (internal) — triggered by a CodeSystem delete; needs an internal PID.
termCodeSystemVersionDeleteJobDeletes a single version of a CodeSystem and its concepts.versionPID (internal CodeSystem version PID)No (internal) — triggered by a version delete; needs an internal PID.
INVOKE_EXPORT_BATCH_JOBCDR system-to-system: invokes $export against an external system and ingests the result.taskId, exportParams, sourceOidcServer, patientReferenceNo (internal) — driven by a Task/request; parameters come from request context.
BULK_MEMBER_MATCH_BATCH_JOBCDR system-to-system: runs bulk $member-match over a Group and builds the response.businessId, bulkMemberMatchParameters, outputFormat, taskIdNo (internal) — driven by the $member-match operation.
PROVIDER_MEMBER_MATCH_BATCH_JOBCDR system-to-system: runs bulk $provider-member-match over a Group and builds the response.businessId, bulkMemberMatchParameters, outputFormat, taskIdNo (internal) — driven by the $provider-member-match operation.

Example Parameters

The examples below show the parameters object for each job that can be driven from a custom scheduled job. Each is the serialized form of the job's Batch2 parameters model, so the field names must match exactly. Two things to note:

  • URL-based resource selection is expressed as partitionedUrl — a list of { "url": ... } objects — not a bare url field. Each entry may optionally carry a requestPartitionId (e.g. { "url": "Patient?", "requestPartitionId": { "allPartitions": true } }).
  • These objects are shown pretty-printed for readability. When placing one in the parameters field of a scheduled job, it must be supplied as an escaped JSON string, as shown in that endpoint's examples.

The No (internal) jobs are omitted here: their parameters (internal PIDs, Task IDs, request context) are supplied by the platform and cannot be authored by hand.

REINDEX

{
  "partitionedUrl": [
    { "url": "Patient?" },
    { "url": "Observation?status=final" }
  ],
  "batchSize": 1000,
  "optimizeStorage": "CURRENT_VERSION",
  "reindexSearchParameters": "ALL"
}

optimizeStorage is one of NONE, CURRENT_VERSION, or ALL_VERSIONS; reindexSearchParameters is one of ALL or NONE.

MDM_SUBMIT

{
  "partitionedUrl": [
    { "url": "Patient?" }
  ],
  "batchSize": 500
}

BULK_EXPORT

{
  "resourceTypes": ["Patient", "Observation"],
  "since": "2026-01-01T00:00:00.000Z",
  "exportStyle": "GROUP",
  "groupId": "Group/123",
  "expandMdm": true,
  "outputFormat": "application/fhir+ndjson"
}

exportStyle is one of PATIENT, GROUP, or SYSTEM. groupId is required only for GROUP exports.

BULK_IMPORT_PULL

{
  "ndJsonUrls": [
    "https://example.com/data/patients.ndjson",
    "https://example.com/data/observations.ndjson"
  ],
  "maxBatchResourceCount": 500
}

ndJsonUrls is required. Supply httpBasicCredentials (a username:password string) if the feed requires authentication.

DELETE_EXPUNGE

{
  "partitionedUrl": [
    { "url": "AuditEvent?date=lt2025-01-01" }
  ],
  "batchSize": 1000,
  "cascade": false
}

Set cascade to true to delete referencing resources, and cascadeMaxRounds to bound the number of cascade passes.

MDM_CLEAR

{
  "resourceType": ["Patient"],
  "batchSize": 500
}

Notes

  • This list reflects the jobs registered in HAPI's JobDefinitionRegistry plus the CDR-specific jobs. The authoritative set of job IDs available at runtime can be queried through the batch job admin endpoint.
  • Parameter names and the full set of options for the core jobs are documented on each feature page: Bulk Export, Bulk Import, Delete Expunge, and Search Parameter Reindexing.
  • Jobs marked No (internal) are listed for completeness. They are invoked by the platform in response to an operation or request and are not intended to be started from a custom scheduled job.