Mercurial > hg > orthanc
comparison OrthancServer/Sources/main.cpp @ 4502:e3e759cbd19c
refactoring IStoreRequestHandler
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 09 Feb 2021 15:50:14 +0100 |
parents | 8efeaba1b7f9 |
children | 7d1eabfac6e0 |
comparison
equal
deleted
inserted
replaced
4501:11c2ddb4e2ca | 4502:e3e759cbd19c |
---|---|
81 context_(context) | 81 context_(context) |
82 { | 82 { |
83 } | 83 } |
84 | 84 |
85 | 85 |
86 virtual void Handle(const std::string& dicomFile, | 86 virtual void Handle(DcmDataset& dicom, |
87 const DicomMap& dicomSummary, | |
88 const Json::Value& dicomJson, | |
89 const std::string& remoteIp, | 87 const std::string& remoteIp, |
90 const std::string& remoteAet, | 88 const std::string& remoteAet, |
91 const std::string& calledAet) ORTHANC_OVERRIDE | 89 const std::string& calledAet) ORTHANC_OVERRIDE |
92 { | 90 { |
91 DicomMap dicomSummary; | |
92 Json::Value dicomJson; | |
93 std::string dicomFile; | |
94 | |
95 const std::set<DicomTag> ignoreTagLength; | |
96 | |
97 // TODO => Parameters in class "DicomServer" | |
98 FromDcmtkBridge::ExtractDicomSummary(dicomSummary, dicom, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); | |
99 FromDcmtkBridge::ExtractDicomAsJson(dicomJson, dicom, DicomToJsonFormat_Full, | |
100 DicomToJsonFlags_Default, ORTHANC_MAXIMUM_TAG_LENGTH, ignoreTagLength); | |
101 | |
102 if (!FromDcmtkBridge::SaveToMemoryBuffer(dicomFile, dicom)) | |
103 { | |
104 throw OrthancException(ErrorCode_InternalError, "Cannot write DICOM file to memory"); | |
105 } | |
106 | |
93 if (dicomFile.size() > 0) | 107 if (dicomFile.size() > 0) |
94 { | 108 { |
95 DicomInstanceToStore toStore; | 109 DicomInstanceToStore toStore; |
96 toStore.SetOrigin(DicomInstanceOrigin::FromDicomProtocol | 110 toStore.SetOrigin(DicomInstanceOrigin::FromDicomProtocol |
97 (remoteIp.c_str(), remoteAet.c_str(), calledAet.c_str())); | 111 (remoteIp.c_str(), remoteAet.c_str(), calledAet.c_str())); |