view Sphinx/source/plugins/python/autorouting-2.py @ 1218:166ec184efd8

fix spelling of DICOMWeb as DICOMweb
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 12 Nov 2025 13:08:40 +0100
parents 211d3cf87e6d
children
line wrap: on
line source

import orthanc
import json

def OnChange(changeType, level, resourceId):
    if changeType == orthanc.ChangeType.STABLE_STUDY:
        print('Stable study: %s' % resourceId)
        payload = { "Resources" : [resourceId] }
        orthanc.RestApiPostAfterPlugins('/dicom-web/servers/sample/stow', json.dumps(payload))

orthanc.RegisterOnChangeCallback(OnChange)