Metadata-Version: 2.4
Name: dcm-processor-job-scheduler
Version: 0.0.1
Summary: A Command line tool for the dicom processor library
Home-page: https://github.com/giesekow/dcm-processor-job-scheduler
Author: Giles Tetteh
Author-email: giles.tetteh@tum.de
Keywords: orthanc,dicom,worker,processor,translation,medical
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: dcm-processor-db-provider==0.0.1
Requires-Dist: dcm-processor-utils==0.0.1
Dynamic: license-file

# dcm-processor-job-scheduler

`dcm-processor-job-scheduler` is the orchestration layer for the dcm-processor platform.

It decides when processing jobs should be created and in what order they should run.

## Role In The Bigger Picture

This module sits between ingestion and execution.

Its place in the full flow is:

1. DICOM data is received and stored
2. the scheduler detects stable processing candidates
3. it evaluates service job definitions and registry callbacks
4. it creates queued jobs with dependencies
5. workers then execute those jobs

So this package is the coordination engine of the platform.

## Main Responsibilities

### 1. Detect Work To Be Scheduled

The scheduler looks for completed or stable patient data in the database and decides when to begin the processing workflow.

### 2. Interpret Service Job Definitions

Service packages define jobs in `dcm-processor.json`.

The scheduler interprets fields such as:

- `jobName`
- `workerEntry`
- `registryEntry`
- `events`
- `dependsOn`
- `sortPosition`

That job metadata becomes the execution plan.

### 3. Run Registry Callbacks

Before creating a queued job, the scheduler can load the service registry module and run its callback to determine whether a job should be scheduled and which parameters should be added.

### 4. Build Dependency Chains

The scheduler creates:

- pre-service jobs
- event-driven service jobs
- post-service jobs

It also resolves declared dependencies between jobs so workers process them in a valid order.

### 5. Emit Worker Queue Jobs

The final output of this module is queued work written through `dcm-processor-db-provider`.

Those queued jobs are then consumed by the worker runtime.

## Key Internal Areas

- `dcm_processor_job_scheduler/job_scheduler.py`
  - main scheduling logic
- `dcm_processor_job_scheduler/__init__.py`
  - exports `JobScheduler`

## Dependencies On Other Modules

This module depends mainly on:

- `dcm-processor-db-provider`
  - for reading services, workers, sessions, and creating queued jobs
- `dcm-processor-utils`
  - for shared settings and helpers

It collaborates directly with:

- `dcm-processor-worker`
  - by creating jobs whose functions are executed by worker consumers

## What This Module Is Not

This package is not:

- the DICOM listener
- the worker execution engine
- the end-user CLI

It is responsible for deciding what should run and when.

## Summary

Use this module when you need job orchestration for the dcm-processor platform.

It is the bridge between stored medical data and executable processing jobs.
