Mercurial > hg > orthanc-book
view Sphinx/source/plugins/python/set-stable-status.py @ 1229:e15a7861fdcd Orthanc-1.12.10
Orthanc 1.12.10
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Wed, 26 Nov 2025 16:48:43 +0100 |
| parents | 801707730af7 |
| children |
line wrap: on
line source
import orthanc import json def OnChange(changeType, level, resource): if changeType == orthanc.ChangeType.NEW_INSTANCE: parentSeries = json.loads(orthanc.RestApiGet('/instances/%s/series' % resource)) if parentSeries["MainDicomTags"]["Modality"] == "CR": orthanc.LogInfo('Stabilizing CR series directly: %s' % resource) ret, hasStableStatusChanged = orthanc.SetStableStatus(parentSeries["ID"], orthanc.StableStatus.STABLE) orthanc.RegisterOnChangeCallback(OnChange)
