Mercurial > hg > orthanc
comparison OrthancServer/Sources/main.cpp @ 4796:94616af363ec filter-store-instance
added ReceivedCStoreInstanceFilter lua callback + OrthancPluginRegisterIncomingCStoreInstanceFilter in sdk
author | Alain Mazy <am@osimis.io> |
---|---|
date | Fri, 01 Oct 2021 18:36:45 +0200 |
parents | fc2ba1ce6538 |
children | 7afbb54bd028 |
comparison
equal
deleted
inserted
replaced
4795:22d5b611dea7 | 4796:94616af363ec |
---|---|
82 context_(context) | 82 context_(context) |
83 { | 83 { |
84 } | 84 } |
85 | 85 |
86 | 86 |
87 virtual void Handle(DcmDataset& dicom, | 87 virtual uint16_t Handle(DcmDataset& dicom, |
88 const std::string& remoteIp, | 88 const std::string& remoteIp, |
89 const std::string& remoteAet, | 89 const std::string& remoteAet, |
90 const std::string& calledAet) ORTHANC_OVERRIDE | 90 const std::string& calledAet) ORTHANC_OVERRIDE |
91 { | 91 { |
92 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromDcmDataset(dicom)); | 92 std::unique_ptr<DicomInstanceToStore> toStore(DicomInstanceToStore::CreateFromDcmDataset(dicom)); |
93 | 93 |
94 if (toStore->GetBufferSize() > 0) | 94 if (toStore->GetBufferSize() > 0) |
95 { | 95 { |
96 toStore->SetOrigin(DicomInstanceOrigin::FromDicomProtocol | 96 toStore->SetOrigin(DicomInstanceOrigin::FromDicomProtocol |
97 (remoteIp.c_str(), remoteAet.c_str(), calledAet.c_str())); | 97 (remoteIp.c_str(), remoteAet.c_str(), calledAet.c_str())); |
98 | 98 |
99 std::string id; | 99 std::string id; |
100 context_.Store(id, *toStore, StoreInstanceMode_Default); | 100 ServerContext::StoreResult result = context_.Store(id, *toStore, StoreInstanceMode_Default); |
101 } | 101 return result.GetCStoreStatusCode(); |
102 } | |
103 | |
104 return STATUS_STORE_Error_CannotUnderstand; | |
102 } | 105 } |
103 }; | 106 }; |
104 | 107 |
105 | 108 |
106 | 109 |