Mercurial > hg > orthanc
comparison OrthancServer/Scheduler/StoreScuCommand.cpp @ 2222:21713ce8717b
Fix handling of Move Originator AET and ID in C-MOVE SCP
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Tue, 13 Dec 2016 14:34:33 +0100 |
parents | 2b1520efa282 |
children | a3a65de1840f |
comparison
equal
deleted
inserted
replaced
2221:e7beca979562 | 2222:21713ce8717b |
---|---|
38 namespace Orthanc | 38 namespace Orthanc |
39 { | 39 { |
40 StoreScuCommand::StoreScuCommand(ServerContext& context, | 40 StoreScuCommand::StoreScuCommand(ServerContext& context, |
41 const std::string& localAet, | 41 const std::string& localAet, |
42 const RemoteModalityParameters& modality, | 42 const RemoteModalityParameters& modality, |
43 bool ignoreExceptions, | 43 bool ignoreExceptions) : |
44 uint16_t moveOriginatorID) : | |
45 context_(context), | 44 context_(context), |
46 modality_(modality), | 45 modality_(modality), |
47 ignoreExceptions_(ignoreExceptions), | 46 ignoreExceptions_(ignoreExceptions), |
48 localAet_(localAet), | 47 localAet_(localAet), |
49 moveOriginatorID_(moveOriginatorID) | 48 moveOriginatorID_(0) |
50 { | 49 { |
51 } | 50 } |
51 | |
52 | |
53 void StoreScuCommand::SetMoveOriginator(const std::string& aet, | |
54 uint16_t id) | |
55 { | |
56 moveOriginatorAET_ = aet; | |
57 moveOriginatorID_ = id; | |
58 } | |
59 | |
52 | 60 |
53 bool StoreScuCommand::Apply(ListOfStrings& outputs, | 61 bool StoreScuCommand::Apply(ListOfStrings& outputs, |
54 const ListOfStrings& inputs) | 62 const ListOfStrings& inputs) |
55 { | 63 { |
56 ReusableDicomUserConnection::Locker locker(context_.GetReusableDicomUserConnection(), localAet_, modality_); | 64 ReusableDicomUserConnection::Locker locker(context_.GetReusableDicomUserConnection(), localAet_, modality_); |
64 try | 72 try |
65 { | 73 { |
66 std::string dicom; | 74 std::string dicom; |
67 context_.ReadDicom(dicom, *it); | 75 context_.ReadDicom(dicom, *it); |
68 | 76 |
69 locker.GetConnection().Store(dicom, moveOriginatorID_); | 77 locker.GetConnection().Store(dicom, moveOriginatorAET_, moveOriginatorID_); |
70 | 78 |
71 // Only chain with other commands if this command succeeds | 79 // Only chain with other commands if this command succeeds |
72 outputs.push_back(*it); | 80 outputs.push_back(*it); |
73 } | 81 } |
74 catch (OrthancException& e) | 82 catch (OrthancException& e) |