comparison OrthancFramework/Sources/DicomNetworking/Internals/StoreScp.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 e3e759cbd19c
children 7053502fbf97
comparison
equal deleted inserted replaced
4795:22d5b611dea7 4796:94616af363ec
159 if (rsp->DimseStatus == STATUS_Success) 159 if (rsp->DimseStatus == STATUS_Success)
160 { 160 {
161 // which SOP class and SOP instance ? 161 // which SOP class and SOP instance ?
162 162
163 #if DCMTK_VERSION_NUMBER >= 364 163 #if DCMTK_VERSION_NUMBER >= 364
164 if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass), 164 if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sizeof(sopClass),
165 sopInstance, sizeof(sopInstance), /*opt_correctUIDPadding*/ OFFalse)) 165 sopInstance, sizeof(sopInstance), /*opt_correctUIDPadding*/ OFFalse))
166 #else 166 #else
167 if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, /*opt_correctUIDPadding*/ OFFalse)) 167 if (!DU_findSOPClassAndInstanceInDataSet(*imageDataSet, sopClass, sopInstance, /*opt_correctUIDPadding*/ OFFalse))
168 #endif 168 #endif
169 { 169 {
170 //LOG4CPP_ERROR(Internals::GetLogger(), "bad DICOM file: " << fileName); 170 //LOG4CPP_ERROR(Internals::GetLogger(), "bad DICOM file: " << fileName);
171 rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand; 171 rsp->DimseStatus = STATUS_STORE_Error_CannotUnderstand;
172 } 172 }
173 else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0) 173 else if (strcmp(sopClass, req->AffectedSOPClassUID) != 0)
174 { 174 {
175 rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass; 175 rsp->DimseStatus = STATUS_STORE_Error_DataSetDoesNotMatchSOPClass;
176 } 176 }
180 } 180 }
181 else 181 else
182 { 182 {
183 try 183 try
184 { 184 {
185 cbdata->handler->Handle(**imageDataSet, *cbdata->remoteIp, cbdata->remoteAET, cbdata->calledAET); 185 rsp->DimseStatus = cbdata->handler->Handle(**imageDataSet, *cbdata->remoteIp, cbdata->remoteAET, cbdata->calledAET);
186 } 186 }
187 catch (OrthancException& e) 187 catch (OrthancException& e)
188 { 188 {
189 rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources; 189 rsp->DimseStatus = STATUS_STORE_Refused_OutOfResources;
190 190