Package dispatch


dispatch.process_dcmsend_result.create_arg_parser() argparse.ArgumentParser[source]

Creates and returns the ArgumentParser object.

dispatch.process_dcmsend_result.parse(result_file) Dict[source]

Parses the dcmsend result file and returns a python dictionary.


dispatch.retry.increase_retry(source_folder, retry_max, retry_delay) bool[source]

Increases the retries counter and set the wait counter to a new time in the future. :return True if increase has been successful or False if maximum retries has been reached


The functions for sending DICOM series to target destinations.

dispatch.send.execute(source_folder: pathlib.Path, success_folder: pathlib.Path, error_folder: pathlib.Path, retry_max, retry_delay)[source]

Execute the dcmsend command. It will create a .sending file to indicate that the folder is being sent. This is to prevent double sending. If there happens any error the .lock file is deleted and an .error file is created. Folder with .error files are _not_ ready for sending.


dispatch.status.has_been_send(folder) bool[source]

Checks if the given folder has already been sent.

dispatch.status.is_ready_for_sending(folder) Optional[common.types.TaskDispatch][source]

Checks if a case in the outgoing folder is ready for sending by the dispatcher.

No lock file (.lock) should be in sending folder and no error file (.error), if there is one copy/move is not done yet. Also at least some dicom files should be there for sending. Also checks for a task.json file and if it is valid.

dispatch.status.is_target_json_valid(folder) Optional[common.types.TaskDispatch][source]

Checks if the task.json file exists and is also valid. Mandatory subkeys are target_ip, target_port and target_aet_target under the dispatch key