comparison OrthancServer/main.cpp @ 1786:164d78911382 worklists

primitives to handle dicom worklists
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 18 Nov 2015 12:00:14 +0100
parents 5ad4e4d92ecb
children 1b1d5470233f
comparison
equal deleted inserted replaced
1784:2dbf25006f88 1786:164d78911382
87 } 87 }
88 } 88 }
89 }; 89 };
90 90
91 91
92 class OrthancWorklistRequestHandler : public IWorklistRequestHandler
93 {
94 private:
95 ServerContext& server_;
96
97 public:
98 OrthancWorklistRequestHandler(ServerContext& context) :
99 server_(context)
100 {
101 }
102
103 virtual bool Handle(DicomWorklistAnswers& answers,
104 const ParsedDicomFile& query,
105 const std::string& remoteIp,
106 const std::string& remoteAet)
107 {
108 printf("Worklist\n");
109 return true;
110 }
111 };
112
92 113
93 class MyDicomServerFactory : 114 class MyDicomServerFactory :
94 public IStoreRequestHandlerFactory, 115 public IStoreRequestHandlerFactory,
95 public IFindRequestHandlerFactory, 116 public IFindRequestHandlerFactory,
117 public IWorklistRequestHandlerFactory,
96 public IMoveRequestHandlerFactory 118 public IMoveRequestHandlerFactory
97 { 119 {
98 private: 120 private:
99 ServerContext& context_; 121 ServerContext& context_;
100 122
139 } 161 }
140 162
141 virtual IMoveRequestHandler* ConstructMoveRequestHandler() 163 virtual IMoveRequestHandler* ConstructMoveRequestHandler()
142 { 164 {
143 return new OrthancMoveRequestHandler(context_); 165 return new OrthancMoveRequestHandler(context_);
166 }
167
168 virtual IWorklistRequestHandler* ConstructWorklistRequestHandler()
169 {
170 return new OrthancWorklistRequestHandler(context_);
144 } 171 }
145 172
146 void Done() 173 void Done()
147 { 174 {
148 } 175 }
548 PrintErrorCode(ErrorCode_StorageAreaAlreadyRegistered, "Another plugin has already registered a custom storage area"); 575 PrintErrorCode(ErrorCode_StorageAreaAlreadyRegistered, "Another plugin has already registered a custom storage area");
549 PrintErrorCode(ErrorCode_DatabaseBackendAlreadyRegistered, "Another plugin has already registered a custom database back-end"); 576 PrintErrorCode(ErrorCode_DatabaseBackendAlreadyRegistered, "Another plugin has already registered a custom database back-end");
550 PrintErrorCode(ErrorCode_DatabaseNotInitialized, "Plugin trying to call the database during its initialization"); 577 PrintErrorCode(ErrorCode_DatabaseNotInitialized, "Plugin trying to call the database during its initialization");
551 PrintErrorCode(ErrorCode_SslDisabled, "Orthanc has been built without SSL support"); 578 PrintErrorCode(ErrorCode_SslDisabled, "Orthanc has been built without SSL support");
552 PrintErrorCode(ErrorCode_CannotOrderSlices, "Unable to order the slices of the series"); 579 PrintErrorCode(ErrorCode_CannotOrderSlices, "Unable to order the slices of the series");
580 PrintErrorCode(ErrorCode_NoWorklistHandler, "No request handler factory for DICOM C-Find Modality SCP");
553 } 581 }
554 582
555 std::cout << std::endl; 583 std::cout << std::endl;
556 } 584 }
557 585
702 OrthancApplicationEntityFilter dicomFilter(context); 730 OrthancApplicationEntityFilter dicomFilter(context);
703 dicomServer.SetCalledApplicationEntityTitleCheck(Configuration::GetGlobalBoolParameter("DicomCheckCalledAet", false)); 731 dicomServer.SetCalledApplicationEntityTitleCheck(Configuration::GetGlobalBoolParameter("DicomCheckCalledAet", false));
704 dicomServer.SetStoreRequestHandlerFactory(serverFactory); 732 dicomServer.SetStoreRequestHandlerFactory(serverFactory);
705 dicomServer.SetMoveRequestHandlerFactory(serverFactory); 733 dicomServer.SetMoveRequestHandlerFactory(serverFactory);
706 dicomServer.SetFindRequestHandlerFactory(serverFactory); 734 dicomServer.SetFindRequestHandlerFactory(serverFactory);
735
736 // TODO - Disable the following line if no worklist plugin is available
737 dicomServer.SetWorklistRequestHandlerFactory(serverFactory);
738
707 dicomServer.SetPortNumber(Configuration::GetGlobalIntegerParameter("DicomPort", 4242)); 739 dicomServer.SetPortNumber(Configuration::GetGlobalIntegerParameter("DicomPort", 4242));
708 dicomServer.SetApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC")); 740 dicomServer.SetApplicationEntityTitle(Configuration::GetGlobalStringParameter("DicomAet", "ORTHANC"));
709 dicomServer.SetApplicationEntityFilter(dicomFilter); 741 dicomServer.SetApplicationEntityFilter(dicomFilter);
710 742
711 dicomServer.Start(); 743 dicomServer.Start();