Mercurial > hg > orthanc-education
changeset 82:0e695d856b0c
job ID is reported when starting the DICOM-ization
| author | Sebastien Jodogne <s.jodogne@gmail.com> |
|---|---|
| date | Fri, 19 Jun 2026 12:26:55 +0200 |
| parents | 53b35f52cf45 |
| children | 95cb8629add4 |
| files | NEWS Sources/Dicomization/DicomizationJob.cpp Sources/EducationRestApi.cpp |
| diffstat | 3 files changed, 12 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/NEWS Thu Apr 30 10:50:27 2026 +0200 +++ b/NEWS Fri Jun 19 12:26:55 2026 +0200 @@ -5,6 +5,8 @@ * Disabled "Expect: 100-continue" HTTP header during LTI registration, which is not always properly handled by certain LTI deployments (e.g., if HAProxy is put in front of Moodle) +* REST API: Job ID is reported when starting the DICOM-ization, and upload ID + is part of the DICOM-ization status Version 1.1 (2025-11-07)
--- a/Sources/Dicomization/DicomizationJob.cpp Thu Apr 30 10:50:27 2026 +0200 +++ b/Sources/Dicomization/DicomizationJob.cpp Fri Jun 19 12:26:55 2026 +0200 @@ -149,6 +149,7 @@ value = Json::objectValue; value["logs"] = logs; value["name"] = name_; + value["upload-id"] = uploadId_; }
--- a/Sources/EducationRestApi.cpp Thu Apr 30 10:50:27 2026 +0200 +++ b/Sources/EducationRestApi.cpp Fri Jun 19 12:26:55 2026 +0200 @@ -1260,10 +1260,13 @@ Orthanc::JobInfo info; if (DicomizationJob::GetJobsEngine().GetRegistry().GetJobInfo(info, *it)) { + const Json::Value& content = info.GetStatus().GetPublicContent(); + Json::Value item; item["id"] = *it; item["time"] = boost::posix_time::to_iso_extended_string(info.GetCreationTime()); - item["name"] = Orthanc::SerializationToolbox::ReadString(info.GetStatus().GetPublicContent(), "name"); + item["name"] = Orthanc::SerializationToolbox::ReadString(content, "name"); + item["upload-id"] = Orthanc::SerializationToolbox::ReadString(content, "upload-id"); item["type"] = info.GetStatus().GetJobType(); switch (info.GetState()) @@ -1346,9 +1349,12 @@ throw; } - DicomizationJob::GetJobsEngine().GetRegistry().Submit(new DicomizationJob(uploadId, dicomizer.release()), 0 /* priority */); + std::string jobId; + DicomizationJob::GetJobsEngine().GetRegistry().Submit(jobId, new DicomizationJob(uploadId, dicomizer.release()), 0 /* priority */); - HttpToolbox::AnswerText(output, ""); + Json::Value answer; + answer["id"] = jobId; + HttpToolbox::AnswerJson(output, answer); } } else
