comparison OrthancServer/OrthancGetRequestHandler.cpp @ 3966:fde1355a625a

c-get compatibility with ginkgocadx
author Sebastien Jodogne <s.jodogne@gmail.com>
date Fri, 22 May 2020 09:02:04 +0200
parents 3b0c555f16a3
children 4d1dcdf5c57e
comparison
equal deleted inserted replaced
3965:7f296ae25039 3966:fde1355a625a
157 { 157 {
158 DUL_PRESENTATIONCONTEXT* pc = (DUL_PRESENTATIONCONTEXT*) LST_Head(l); 158 DUL_PRESENTATIONCONTEXT* pc = (DUL_PRESENTATIONCONTEXT*) LST_Head(l);
159 LST_Position(l, (LST_NODE*)pc); 159 LST_Position(l, (LST_NODE*)pc);
160 while (pc) 160 while (pc)
161 { 161 {
162 DicomTransferSyntax transferSyntax;
162 if (pc->result == ASC_P_ACCEPTANCE && 163 if (pc->result == ASC_P_ACCEPTANCE &&
163 std::string(pc->abstractSyntax) == sopClassUid) 164 LookupTransferSyntax(transferSyntax, pc->acceptedTransferSyntax))
164 { 165 {
165 DicomTransferSyntax transferSyntax; 166 VLOG(0) << "C-GET SCP accepted: SOP class " << sopClassUid
166 if (LookupTransferSyntax(transferSyntax, pc->acceptedTransferSyntax)) 167 << " with transfer syntax " << GetTransferSyntaxUid(transferSyntax);
168 if (std::string(pc->abstractSyntax) == sopClassUid)
167 { 169 {
168 accepted[transferSyntax] = pc->presentationContextID; 170 accepted[transferSyntax] = pc->presentationContextID;
169 } 171 }
170 else 172 }
171 { 173 else
172 LOG(WARNING) << "C-GET: Unknown transfer syntax received: " 174 {
173 << pc->acceptedTransferSyntax; 175 LOG(WARNING) << "C-GET: Unknown transfer syntax received: "
174 } 176 << pc->acceptedTransferSyntax;
175 } 177 }
176 178
177 pc = (DUL_PRESENTATIONCONTEXT*) LST_Next(l); 179 pc = (DUL_PRESENTATIONCONTEXT*) LST_Next(l);
178 } 180 }
179 } 181 }
214 * accepted. 216 * accepted.
215 **/ 217 **/
216 218
217 for (std::list<DicomTransferSyntax>::const_iterator 219 for (std::list<DicomTransferSyntax>::const_iterator
218 it = preferred.begin(); it != preferred.end(); ++it) 220 it = preferred.begin(); it != preferred.end(); ++it)
219 { 221 {
220 Accepted::const_iterator found = accepted.find(*it); 222 Accepted::const_iterator found = accepted.find(*it);
221 if (found != accepted.end()) 223 if (found != accepted.end())
222 { 224 {
223 selectedPresentationId = found->second; 225 selectedPresentationId = found->second;
224 selectedSyntax = *it; 226 selectedSyntax = *it;
264 << dcmSOPClassUIDToModality(sopClassUid.c_str(), "OT") << ") " << sopClassUid; 266 << dcmSOPClassUIDToModality(sopClassUid.c_str(), "OT") << ") " << sopClassUid;
265 return DIMSE_NOVALIDPRESENTATIONCONTEXTID; 267 return DIMSE_NOVALIDPRESENTATIONCONTEXTID;
266 } 268 }
267 else 269 else
268 { 270 {
271 LOG(INFO) << "C-GET SCP selected transfer syntax " << GetTransferSyntaxUid(selectedSyntax)
272 << ", for source instance with SOP class " << sopClassUid
273 << " and transfer syntax " << GetTransferSyntaxUid(sourceSyntax);
274
269 // make sure that we can send images in this presentation context 275 // make sure that we can send images in this presentation context
270 T_ASC_PresentationContext pc; 276 T_ASC_PresentationContext pc;
271 ASC_findAcceptedPresentationContext(assoc->params, presId, &pc); 277 ASC_findAcceptedPresentationContext(assoc->params, presId, &pc);
272 // the acceptedRole is the association requestor role 278 // the acceptedRole is the association requestor role
273 if ((pc.acceptedRole != ASC_SC_ROLE_SCP) && 279
274 (pc.acceptedRole != ASC_SC_ROLE_SCUSCP)) 280 if (pc.acceptedRole != ASC_SC_ROLE_DEFAULT && // "DEFAULT" is necessary for GinkgoCADx
281 pc.acceptedRole != ASC_SC_ROLE_SCP &&
282 pc.acceptedRole != ASC_SC_ROLE_SCUSCP)
275 { 283 {
276 // the role is not appropriate 284 // the role is not appropriate
277 nFailed_++; 285 nFailed_++;
278 AddFailedUIDInstance(sopInstanceUid); 286 AddFailedUIDInstance(sopInstanceUid);
279 LOG(ERROR) << "C-GET SCP: storeSCU: [No presentation context with requestor SCP role for: (" 287 LOG(ERROR) << "C-GET SCP: storeSCU: [No presentation context with requestor SCP role for: ("