Mercurial > hg > orthanc-databases
comparison Resources/Orthanc/Sdk-1.12.4/orthanc/OrthancDatabasePlugin.proto @ 518:e3102bad13a4
fix SDK 1.12.4 protobuf
author | Alain Mazy <am@orthanc.team> |
---|---|
date | Thu, 06 Jun 2024 12:38:28 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
517:2155c39914a2 | 518:e3102bad13a4 |
---|---|
1 /** | |
2 * Orthanc - A Lightweight, RESTful DICOM Store | |
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics | |
4 * Department, University Hospital of Liege, Belgium | |
5 * Copyright (C) 2017-2023 Osimis S.A., Belgium | |
6 * Copyright (C) 2024-2024 Orthanc Team SRL, Belgium | |
7 * Copyright (C) 2021-2024 Sebastien Jodogne, ICTEAM UCLouvain, Belgium | |
8 * | |
9 * This program is free software: you can redistribute it and/or | |
10 * modify it under the terms of the GNU General Public License as | |
11 * published by the Free Software Foundation, either version 3 of the | |
12 * License, or (at your option) any later version. | |
13 * | |
14 * This program is distributed in the hope that it will be useful, but | |
15 * WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
17 * General Public License for more details. | |
18 * | |
19 * You should have received a copy of the GNU General Public License | |
20 * along with this program. If not, see <http://www.gnu.org/licenses/>. | |
21 **/ | |
22 | |
23 | |
24 /** | |
25 * This Protocol Buffers prototype describes the exchanges between the | |
26 * Orthanc core and its database plugins. The various calls correspond | |
27 * to the "IDatabaseWrapper" interface in the source code of Orthanc. | |
28 * | |
29 * WARNING: *NEVER* modify or remove existing entries. It is only | |
30 * allowed to *add* new stuff. | |
31 **/ | |
32 | |
33 syntax = "proto3"; | |
34 | |
35 /** | |
36 * Turn off protobuf reflection to avoid clashes between the Orthanc | |
37 * core and the database plugin, otherwise both will try to register | |
38 * the same messages in the process-wide descriptor pool, which would | |
39 * result in protobuf error "File already exists in database". | |
40 **/ | |
41 option optimize_for = LITE_RUNTIME; | |
42 | |
43 package Orthanc.DatabasePluginMessages; | |
44 | |
45 | |
46 /** | |
47 * Data structures that are common with the Orthanc core. | |
48 **/ | |
49 | |
50 message FileInfo { | |
51 string uuid = 1; | |
52 int32 content_type = 2; // opaque "FileContentType" in Orthanc | |
53 uint64 uncompressed_size = 3; | |
54 string uncompressed_hash = 4; | |
55 int32 compression_type = 5; // opaque "CompressionType" in Orthanc | |
56 uint64 compressed_size = 6; | |
57 string compressed_hash = 7; | |
58 } | |
59 | |
60 enum ResourceType { | |
61 RESOURCE_PATIENT = 0; | |
62 RESOURCE_STUDY = 1; | |
63 RESOURCE_SERIES = 2; | |
64 RESOURCE_INSTANCE = 3; | |
65 } | |
66 | |
67 enum ConstraintType { | |
68 CONSTRAINT_EQUAL = 0; | |
69 CONSTRAINT_SMALLER_OR_EQUAL = 1; | |
70 CONSTRAINT_GREATER_OR_EQUAL = 2; | |
71 CONSTRAINT_WILDCARD = 3; | |
72 CONSTRAINT_LIST = 4; | |
73 } | |
74 | |
75 enum LabelsConstraintType { | |
76 LABELS_CONSTRAINT_ALL = 0; | |
77 LABELS_CONSTRAINT_ANY = 1; | |
78 LABELS_CONSTRAINT_NONE = 2; | |
79 } | |
80 | |
81 message ServerIndexChange { | |
82 int64 seq = 1; | |
83 int32 change_type = 2; // opaque "ChangeType" in Orthanc | |
84 ResourceType resource_type = 3; | |
85 string public_id = 4; | |
86 string date = 5; | |
87 } | |
88 | |
89 message ExportedResource { | |
90 int64 seq = 1; | |
91 ResourceType resource_type = 2; | |
92 string public_id = 3; | |
93 string modality = 4; | |
94 string date = 5; | |
95 string patient_id = 6; | |
96 string study_instance_uid = 7; | |
97 string series_instance_uid = 8; | |
98 string sop_instance_uid = 9; | |
99 } | |
100 | |
101 message DatabaseConstraint { | |
102 ResourceType level = 1; | |
103 uint32 tag_group = 2; | |
104 uint32 tag_element = 3; | |
105 bool is_identifier_tag = 4; | |
106 bool is_case_sensitive = 5; | |
107 bool is_mandatory = 6; | |
108 ConstraintType type = 7; | |
109 repeated string values = 8; | |
110 } | |
111 | |
112 | |
113 /** | |
114 * Database-level operations. | |
115 **/ | |
116 | |
117 enum DatabaseOperation { | |
118 OPERATION_GET_SYSTEM_INFORMATION = 0; | |
119 OPERATION_OPEN = 1; | |
120 OPERATION_CLOSE = 2; | |
121 OPERATION_FLUSH_TO_DISK = 3; | |
122 OPERATION_START_TRANSACTION = 4; | |
123 OPERATION_UPGRADE = 5; | |
124 OPERATION_FINALIZE_TRANSACTION = 6; | |
125 OPERATION_MEASURE_LATENCY = 7; // New in Orthanc 1.12.3 | |
126 } | |
127 | |
128 enum TransactionType { | |
129 TRANSACTION_READ_ONLY = 0; | |
130 TRANSACTION_READ_WRITE = 1; | |
131 } | |
132 | |
133 message GetSystemInformation { | |
134 message Request { | |
135 } | |
136 message Response { | |
137 uint32 database_version = 1; | |
138 bool supports_flush_to_disk = 2; | |
139 bool supports_revisions = 3; | |
140 bool supports_labels = 4; | |
141 bool supports_increment_global_property = 5; | |
142 bool has_update_and_get_statistics = 6; | |
143 bool has_measure_latency = 7; | |
144 } | |
145 } | |
146 | |
147 message Open { | |
148 message Request { | |
149 message IdentifierTag { | |
150 ResourceType level = 1; | |
151 uint32 group = 2; | |
152 uint32 element = 3; | |
153 string name = 4; | |
154 } | |
155 repeated IdentifierTag identifier_tags = 1; | |
156 } | |
157 message Response { | |
158 } | |
159 } | |
160 | |
161 message Close { | |
162 message Request { | |
163 } | |
164 message Response { | |
165 } | |
166 } | |
167 | |
168 message FlushToDisk { | |
169 message Request { | |
170 } | |
171 message Response { | |
172 } | |
173 } | |
174 | |
175 message StartTransaction { | |
176 message Request { | |
177 TransactionType type = 1; | |
178 } | |
179 message Response { | |
180 sfixed64 transaction = 1; | |
181 } | |
182 } | |
183 | |
184 message Upgrade { | |
185 /** | |
186 * It is guaranteed that a read-write transaction is created by the | |
187 * Orthanc core before executing this operation. | |
188 **/ | |
189 message Request { | |
190 uint32 target_version = 1; | |
191 sfixed64 storage_area = 2; | |
192 sfixed64 transaction = 3; | |
193 } | |
194 message Response { | |
195 } | |
196 } | |
197 | |
198 message FinalizeTransaction { | |
199 message Request { | |
200 sfixed64 transaction = 1; | |
201 } | |
202 message Response { | |
203 } | |
204 } | |
205 | |
206 message MeasureLatency { | |
207 message Request { | |
208 } | |
209 message Response { | |
210 int64 latency_us = 1; | |
211 } | |
212 } | |
213 | |
214 | |
215 message DatabaseRequest { | |
216 sfixed64 database = 1; | |
217 DatabaseOperation operation = 2; | |
218 | |
219 GetSystemInformation.Request get_system_information = 100; | |
220 Open.Request open = 101; | |
221 Close.Request close = 102; | |
222 FlushToDisk.Request flush_to_disk = 103; | |
223 StartTransaction.Request start_transaction = 104; | |
224 Upgrade.Request upgrade = 105; | |
225 FinalizeTransaction.Request finalize_transaction = 106; | |
226 MeasureLatency.Request measure_latency = 107; | |
227 } | |
228 | |
229 message DatabaseResponse { | |
230 GetSystemInformation.Response get_system_information = 100; | |
231 Open.Response open = 101; | |
232 Close.Response close = 102; | |
233 FlushToDisk.Response flush_to_disk = 103; | |
234 StartTransaction.Response start_transaction = 104; | |
235 Upgrade.Response upgrade = 105; | |
236 FinalizeTransaction.Response finalize_transaction = 106; | |
237 MeasureLatency.Response measure_latency = 107; | |
238 } | |
239 | |
240 | |
241 /** | |
242 * Transaction-level operations. | |
243 **/ | |
244 | |
245 enum TransactionOperation { | |
246 OPERATION_ROLLBACK = 0; | |
247 OPERATION_COMMIT = 1; | |
248 OPERATION_ADD_ATTACHMENT = 2; | |
249 OPERATION_CLEAR_CHANGES = 3; | |
250 OPERATION_CLEAR_EXPORTED_RESOURCES = 4; | |
251 OPERATION_DELETE_ATTACHMENT = 5; | |
252 OPERATION_DELETE_METADATA = 6; | |
253 OPERATION_DELETE_RESOURCE = 7; | |
254 OPERATION_GET_ALL_METADATA = 8; | |
255 OPERATION_GET_ALL_PUBLIC_IDS = 9; | |
256 OPERATION_GET_ALL_PUBLIC_IDS_WITH_LIMITS = 10; | |
257 OPERATION_GET_CHANGES = 11; | |
258 OPERATION_GET_CHILDREN_INTERNAL_ID = 12; | |
259 OPERATION_GET_CHILDREN_PUBLIC_ID = 13; | |
260 OPERATION_GET_EXPORTED_RESOURCES = 14; | |
261 OPERATION_GET_LAST_CHANGE = 15; | |
262 OPERATION_GET_LAST_EXPORTED_RESOURCE = 16; | |
263 OPERATION_GET_MAIN_DICOM_TAGS = 17; | |
264 OPERATION_GET_PUBLIC_ID = 18; | |
265 OPERATION_GET_RESOURCES_COUNT = 19; | |
266 OPERATION_GET_RESOURCE_TYPE = 20; | |
267 OPERATION_GET_TOTAL_COMPRESSED_SIZE = 21; | |
268 OPERATION_GET_TOTAL_UNCOMPRESSED_SIZE = 22; | |
269 OPERATION_IS_PROTECTED_PATIENT = 23; | |
270 OPERATION_LIST_AVAILABLE_ATTACHMENTS = 24; | |
271 OPERATION_LOG_CHANGE = 25; | |
272 OPERATION_LOG_EXPORTED_RESOURCE = 26; | |
273 OPERATION_LOOKUP_ATTACHMENT = 27; | |
274 OPERATION_LOOKUP_GLOBAL_PROPERTY = 28; | |
275 OPERATION_LOOKUP_METADATA = 29; | |
276 OPERATION_LOOKUP_PARENT = 30; | |
277 OPERATION_LOOKUP_RESOURCE = 31; | |
278 OPERATION_SELECT_PATIENT_TO_RECYCLE = 32; | |
279 OPERATION_SELECT_PATIENT_TO_RECYCLE_WITH_AVOID = 33; | |
280 OPERATION_SET_GLOBAL_PROPERTY = 34; | |
281 OPERATION_CLEAR_MAIN_DICOM_TAGS = 35; | |
282 OPERATION_SET_METADATA = 36; | |
283 OPERATION_SET_PROTECTED_PATIENT = 37; | |
284 OPERATION_IS_DISK_SIZE_ABOVE = 38; | |
285 OPERATION_LOOKUP_RESOURCES = 39; | |
286 OPERATION_CREATE_INSTANCE = 40; | |
287 OPERATION_SET_RESOURCES_CONTENT = 41; | |
288 OPERATION_GET_CHILDREN_METADATA = 42; | |
289 OPERATION_GET_LAST_CHANGE_INDEX = 43; | |
290 OPERATION_LOOKUP_RESOURCE_AND_PARENT = 44; | |
291 OPERATION_ADD_LABEL = 45; // New in Orthanc 1.12.0 | |
292 OPERATION_REMOVE_LABEL = 46; // New in Orthanc 1.12.0 | |
293 OPERATION_LIST_LABELS = 47; // New in Orthanc 1.12.0 | |
294 OPERATION_INCREMENT_GLOBAL_PROPERTY = 48; // New in Orthanc 1.12.3 | |
295 OPERATION_UPDATE_AND_GET_STATISTICS = 49; // New in Orthanc 1.12.3 | |
296 } | |
297 | |
298 message Rollback { | |
299 message Request { | |
300 } | |
301 message Response { | |
302 } | |
303 } | |
304 | |
305 message Commit { | |
306 message Request { | |
307 int64 file_size_delta = 1; | |
308 } | |
309 message Response { | |
310 } | |
311 } | |
312 | |
313 message AddAttachment { | |
314 message Request { | |
315 int64 id = 1; | |
316 FileInfo attachment = 2; | |
317 int64 revision = 3; | |
318 } | |
319 message Response { | |
320 } | |
321 } | |
322 | |
323 message ClearChanges { | |
324 message Request { | |
325 } | |
326 message Response { | |
327 } | |
328 } | |
329 | |
330 message ClearExportedResources { | |
331 message Request { | |
332 } | |
333 message Response { | |
334 } | |
335 } | |
336 | |
337 message DeleteAttachment { | |
338 message Request { | |
339 int64 id = 1; | |
340 int32 type = 2; | |
341 } | |
342 message Response { | |
343 FileInfo deleted_attachment = 1; | |
344 } | |
345 } | |
346 | |
347 message DeleteMetadata { | |
348 message Request { | |
349 int64 id = 1; | |
350 int32 type = 2; | |
351 } | |
352 message Response { | |
353 } | |
354 } | |
355 | |
356 message DeleteResource { | |
357 message Request { | |
358 int64 id = 1; | |
359 } | |
360 message Response { | |
361 message Resource { | |
362 ResourceType level = 1; | |
363 string public_id = 2; | |
364 } | |
365 repeated FileInfo deleted_attachments = 1; | |
366 repeated Resource deleted_resources = 2; | |
367 bool is_remaining_ancestor = 3; | |
368 Resource remaining_ancestor = 4; | |
369 } | |
370 } | |
371 | |
372 message GetAllMetadata { | |
373 message Request { | |
374 int64 id = 1; | |
375 } | |
376 message Response { | |
377 message Metadata { | |
378 int32 type = 1; | |
379 string value = 2; | |
380 } | |
381 repeated Metadata metadata = 1; | |
382 } | |
383 } | |
384 | |
385 message GetAllPublicIds { | |
386 message Request { | |
387 ResourceType resource_type = 1; | |
388 } | |
389 message Response { | |
390 repeated string ids = 1; | |
391 } | |
392 } | |
393 | |
394 message GetAllPublicIdsWithLimits { | |
395 message Request { | |
396 ResourceType resource_type = 1; | |
397 int64 since = 2; | |
398 uint32 limit = 3; | |
399 } | |
400 message Response { | |
401 repeated string ids = 1; | |
402 } | |
403 } | |
404 | |
405 message GetChanges { | |
406 message Request { | |
407 int64 since = 1; | |
408 uint32 limit = 2; | |
409 } | |
410 message Response { | |
411 repeated ServerIndexChange changes = 1; | |
412 bool done = 2; | |
413 } | |
414 } | |
415 | |
416 message GetChildrenInternalId { | |
417 message Request { | |
418 int64 id = 1; | |
419 } | |
420 message Response { | |
421 repeated int64 ids = 1; | |
422 } | |
423 } | |
424 | |
425 message GetChildrenPublicId { | |
426 message Request { | |
427 int64 id = 1; | |
428 } | |
429 message Response { | |
430 repeated string ids = 1; | |
431 } | |
432 } | |
433 | |
434 message GetExportedResources { | |
435 message Request { | |
436 int64 since = 1; | |
437 uint32 limit = 2; | |
438 } | |
439 message Response { | |
440 repeated ExportedResource resources = 1; | |
441 bool done = 2; | |
442 } | |
443 } | |
444 | |
445 message GetLastChange { | |
446 message Request { | |
447 } | |
448 message Response { | |
449 bool found = 1; | |
450 ServerIndexChange change = 2; | |
451 } | |
452 } | |
453 | |
454 message GetLastExportedResource { | |
455 message Request { | |
456 } | |
457 message Response { | |
458 bool found = 1; | |
459 ExportedResource resource = 2; | |
460 } | |
461 } | |
462 | |
463 message GetMainDicomTags { | |
464 message Request { | |
465 int64 id = 1; | |
466 } | |
467 message Response { | |
468 message Tag { | |
469 uint32 group = 1; | |
470 uint32 element = 2; | |
471 string value = 3; | |
472 } | |
473 repeated Tag tags = 1; | |
474 } | |
475 } | |
476 | |
477 message GetPublicId { | |
478 message Request { | |
479 int64 id = 1; | |
480 } | |
481 message Response { | |
482 string id = 1; | |
483 } | |
484 } | |
485 | |
486 message GetResourcesCount { | |
487 message Request { | |
488 ResourceType type = 1; | |
489 } | |
490 message Response { | |
491 uint64 count = 1; | |
492 } | |
493 } | |
494 | |
495 message GetResourceType { | |
496 message Request { | |
497 int64 id = 1; | |
498 } | |
499 message Response { | |
500 ResourceType type = 1; | |
501 } | |
502 } | |
503 | |
504 message GetTotalCompressedSize { | |
505 message Request { | |
506 } | |
507 message Response { | |
508 uint64 size = 1; | |
509 } | |
510 } | |
511 | |
512 message GetTotalUncompressedSize { | |
513 message Request { | |
514 } | |
515 message Response { | |
516 uint64 size = 1; | |
517 } | |
518 } | |
519 | |
520 message IsProtectedPatient { | |
521 message Request { | |
522 int64 patient_id = 1; | |
523 } | |
524 message Response { | |
525 bool protected_patient = 1; | |
526 } | |
527 } | |
528 | |
529 message ListAvailableAttachments { | |
530 message Request { | |
531 int64 id = 1; | |
532 } | |
533 message Response { | |
534 repeated int32 attachments = 1; | |
535 } | |
536 } | |
537 | |
538 message LogChange { | |
539 message Request { | |
540 int32 change_type = 1; | |
541 ResourceType resource_type = 2; | |
542 int64 resource_id = 3; | |
543 string date = 4; | |
544 } | |
545 message Response { | |
546 } | |
547 } | |
548 | |
549 message LogExportedResource { | |
550 message Request { | |
551 ResourceType resource_type = 1; | |
552 string public_id = 2; | |
553 string modality = 3; | |
554 string date = 4; | |
555 string patient_id = 5; | |
556 string study_instance_uid = 6; | |
557 string series_instance_uid = 7; | |
558 string sop_instance_uid = 8; | |
559 } | |
560 message Response { | |
561 } | |
562 } | |
563 | |
564 message LookupAttachment { | |
565 message Request { | |
566 int64 id = 1; | |
567 int32 content_type = 2; | |
568 } | |
569 message Response { | |
570 bool found = 1; | |
571 FileInfo attachment = 2; | |
572 int64 revision = 3; | |
573 } | |
574 } | |
575 | |
576 message LookupGlobalProperty { | |
577 message Request { | |
578 string server_id = 1; | |
579 int32 property = 2; | |
580 } | |
581 message Response { | |
582 bool found = 1; | |
583 string value = 2; | |
584 } | |
585 } | |
586 | |
587 message LookupMetadata { | |
588 message Request { | |
589 int64 id = 1; | |
590 int32 metadata_type = 2; | |
591 } | |
592 message Response { | |
593 bool found = 1; | |
594 string value = 2; | |
595 int64 revision = 3; | |
596 } | |
597 } | |
598 | |
599 message LookupParent { | |
600 message Request { | |
601 int64 id = 1; | |
602 } | |
603 message Response { | |
604 bool found = 1; | |
605 int64 parent = 2; | |
606 } | |
607 } | |
608 | |
609 message LookupResource { | |
610 message Request { | |
611 string public_id = 1; | |
612 } | |
613 message Response { | |
614 bool found = 1; | |
615 int64 internal_id = 2; | |
616 ResourceType type = 3; | |
617 } | |
618 } | |
619 | |
620 message SelectPatientToRecycle { | |
621 message Request { | |
622 } | |
623 message Response { | |
624 bool found = 1; | |
625 int64 patient_id = 2; | |
626 } | |
627 } | |
628 | |
629 message SelectPatientToRecycleWithAvoid { | |
630 message Request { | |
631 int64 patient_id_to_avoid = 1; | |
632 } | |
633 message Response { | |
634 bool found = 1; | |
635 int64 patient_id = 2; | |
636 } | |
637 } | |
638 | |
639 message SetGlobalProperty { | |
640 message Request { | |
641 string server_id = 1; | |
642 int32 property = 2; | |
643 string value = 3; | |
644 } | |
645 message Response { | |
646 } | |
647 } | |
648 | |
649 message IncrementGlobalProperty { | |
650 message Request { | |
651 string server_id = 1; | |
652 int32 property = 2; | |
653 int64 increment = 3; | |
654 } | |
655 message Response { | |
656 int64 new_value = 1; | |
657 } | |
658 } | |
659 | |
660 message UpdateAndGetStatistics { | |
661 message Request { | |
662 } | |
663 message Response { | |
664 int64 patients_count = 1; | |
665 int64 studies_count = 2; | |
666 int64 series_count = 3; | |
667 int64 instances_count = 4; | |
668 int64 total_compressed_size = 5; | |
669 int64 total_uncompressed_size = 6; | |
670 } | |
671 } | |
672 | |
673 message ClearMainDicomTags { | |
674 message Request { | |
675 int64 id = 1; | |
676 } | |
677 message Response { | |
678 } | |
679 } | |
680 | |
681 message SetMetadata { | |
682 message Request { | |
683 int64 id = 1; | |
684 int32 metadata_type = 2; | |
685 string value = 3; | |
686 int64 revision = 4; | |
687 } | |
688 message Response { | |
689 } | |
690 } | |
691 | |
692 message SetProtectedPatient { | |
693 message Request { | |
694 int64 patient_id = 1; | |
695 bool protected_patient = 2; | |
696 } | |
697 message Response { | |
698 } | |
699 } | |
700 | |
701 message IsDiskSizeAbove { | |
702 message Request { | |
703 uint64 threshold = 1; | |
704 } | |
705 message Response { | |
706 bool result = 1; | |
707 } | |
708 } | |
709 | |
710 message LookupResources { | |
711 message Request { | |
712 repeated DatabaseConstraint lookup = 1; | |
713 ResourceType query_level = 2; | |
714 uint32 limit = 3; | |
715 bool retrieve_instances_ids = 4; | |
716 repeated string labels = 5; // New in Orthanc 1.12.0 | |
717 LabelsConstraintType labels_constraint = 6; // New in Orthanc 1.12.0 | |
718 } | |
719 message Response { | |
720 repeated string resources_ids = 1; | |
721 repeated string instances_ids = 2; // Only filled if "retrieve_instances" is true | |
722 } | |
723 } | |
724 | |
725 message CreateInstance { | |
726 message Request { | |
727 string patient = 1; | |
728 string study = 2; | |
729 string series = 3; | |
730 string instance = 4; | |
731 } | |
732 message Response { | |
733 bool is_new_instance = 1; | |
734 int64 instance_id = 2; | |
735 | |
736 // The fields below are only set if "is_new_instance" is true | |
737 bool is_new_patient = 3; | |
738 bool is_new_study = 4; | |
739 bool is_new_series = 5; | |
740 int64 patient_id = 6; | |
741 int64 study_id = 7; | |
742 int64 series_id = 8; | |
743 } | |
744 } | |
745 | |
746 message SetResourcesContent { | |
747 message Request { | |
748 message Tag { | |
749 int64 resource_id = 1; | |
750 bool is_identifier = 2; | |
751 uint32 group = 3; | |
752 uint32 element = 4; | |
753 string value = 5; | |
754 } | |
755 | |
756 message Metadata { | |
757 int64 resource_id = 1; | |
758 int32 metadata = 2; | |
759 string value = 3; | |
760 } | |
761 | |
762 repeated Tag tags = 1; | |
763 repeated Metadata metadata = 2; | |
764 } | |
765 message Response { | |
766 } | |
767 } | |
768 | |
769 message GetChildrenMetadata { | |
770 message Request { | |
771 int64 id = 1; | |
772 int32 metadata = 2; | |
773 } | |
774 message Response { | |
775 repeated string values = 1; | |
776 } | |
777 } | |
778 | |
779 message GetLastChangeIndex { | |
780 message Request { | |
781 } | |
782 message Response { | |
783 int64 result = 1; | |
784 } | |
785 } | |
786 | |
787 message LookupResourceAndParent { | |
788 message Request { | |
789 string public_id = 1; | |
790 } | |
791 message Response { | |
792 bool found = 1; | |
793 int64 id = 2; | |
794 ResourceType type = 3; | |
795 string parent_public_id = 4; // Only for study, series, or instance | |
796 } | |
797 } | |
798 | |
799 message AddLabel { | |
800 message Request { | |
801 int64 id = 1; | |
802 string label = 2; | |
803 } | |
804 message Response { | |
805 } | |
806 } | |
807 | |
808 message RemoveLabel { | |
809 message Request { | |
810 int64 id = 1; | |
811 string label = 2; | |
812 } | |
813 message Response { | |
814 } | |
815 } | |
816 | |
817 message ListLabels { | |
818 message Request { | |
819 bool single_resource = 1; | |
820 int64 id = 2; // Only if "single_resource" is "true" | |
821 } | |
822 message Response { | |
823 repeated string labels = 1; | |
824 } | |
825 } | |
826 | |
827 message TransactionRequest { | |
828 sfixed64 transaction = 1; | |
829 TransactionOperation operation = 2; | |
830 | |
831 Rollback.Request rollback = 100; | |
832 Commit.Request commit = 101; | |
833 AddAttachment.Request add_attachment = 102; | |
834 ClearChanges.Request clear_changes = 103; | |
835 ClearExportedResources.Request clear_exported_resources = 104; | |
836 DeleteAttachment.Request delete_attachment = 105; | |
837 DeleteMetadata.Request delete_metadata = 106; | |
838 DeleteResource.Request delete_resource = 107; | |
839 GetAllMetadata.Request get_all_metadata = 108; | |
840 GetAllPublicIds.Request get_all_public_ids = 109; | |
841 GetAllPublicIdsWithLimits.Request get_all_public_ids_with_limits = 110; | |
842 GetChanges.Request get_changes = 111; | |
843 GetChildrenInternalId.Request get_children_internal_id = 112; | |
844 GetChildrenPublicId.Request get_children_public_id = 113; | |
845 GetExportedResources.Request get_exported_resources = 114; | |
846 GetLastChange.Request get_last_change = 115; | |
847 GetLastExportedResource.Request get_last_exported_resource = 116; | |
848 GetMainDicomTags.Request get_main_dicom_tags = 117; | |
849 GetPublicId.Request get_public_id = 118; | |
850 GetResourcesCount.Request get_resources_count = 119; | |
851 GetResourceType.Request get_resource_type = 120; | |
852 GetTotalCompressedSize.Request get_total_compressed_size = 121; | |
853 GetTotalUncompressedSize.Request get_total_uncompressed_size = 122; | |
854 IsProtectedPatient.Request is_protected_patient = 123; | |
855 ListAvailableAttachments.Request list_available_attachments = 124; | |
856 LogChange.Request log_change = 125; | |
857 LogExportedResource.Request log_exported_resource = 126; | |
858 LookupAttachment.Request lookup_attachment = 127; | |
859 LookupGlobalProperty.Request lookup_global_property = 128; | |
860 LookupMetadata.Request lookup_metadata = 129; | |
861 LookupParent.Request lookup_parent = 130; | |
862 LookupResource.Request lookup_resource = 131; | |
863 SelectPatientToRecycle.Request select_patient_to_recycle = 132; | |
864 SelectPatientToRecycleWithAvoid.Request select_patient_to_recycle_with_avoid = 133; | |
865 SetGlobalProperty.Request set_global_property = 134; | |
866 ClearMainDicomTags.Request clear_main_dicom_tags = 135; | |
867 SetMetadata.Request set_metadata = 136; | |
868 SetProtectedPatient.Request set_protected_patient = 137; | |
869 IsDiskSizeAbove.Request is_disk_size_above = 138; | |
870 LookupResources.Request lookup_resources = 139; | |
871 CreateInstance.Request create_instance = 140; | |
872 SetResourcesContent.Request set_resources_content = 141; | |
873 GetChildrenMetadata.Request get_children_metadata = 142; | |
874 GetLastChangeIndex.Request get_last_change_index = 143; | |
875 LookupResourceAndParent.Request lookup_resource_and_parent = 144; | |
876 AddLabel.Request add_label = 145; | |
877 RemoveLabel.Request remove_label = 146; | |
878 ListLabels.Request list_labels = 147; | |
879 IncrementGlobalProperty.Request increment_global_property = 148; | |
880 UpdateAndGetStatistics.Request update_and_get_statistics = 149; | |
881 } | |
882 | |
883 message TransactionResponse { | |
884 Rollback.Response rollback = 100; | |
885 Commit.Response commit = 101; | |
886 AddAttachment.Response add_attachment = 102; | |
887 ClearChanges.Response clear_changes = 103; | |
888 ClearExportedResources.Response clear_exported_resources = 104; | |
889 DeleteAttachment.Response delete_attachment = 105; | |
890 DeleteMetadata.Response delete_metadata = 106; | |
891 DeleteResource.Response delete_resource = 107; | |
892 GetAllMetadata.Response get_all_metadata = 108; | |
893 GetAllPublicIds.Response get_all_public_ids = 109; | |
894 GetAllPublicIdsWithLimits.Response get_all_public_ids_with_limits = 110; | |
895 GetChanges.Response get_changes = 111; | |
896 GetChildrenInternalId.Response get_children_internal_id = 112; | |
897 GetChildrenPublicId.Response get_children_public_id = 113; | |
898 GetExportedResources.Response get_exported_resources = 114; | |
899 GetLastChange.Response get_last_change = 115; | |
900 GetLastExportedResource.Response get_last_exported_resource = 116; | |
901 GetMainDicomTags.Response get_main_dicom_tags = 117; | |
902 GetPublicId.Response get_public_id = 118; | |
903 GetResourcesCount.Response get_resources_count = 119; | |
904 GetResourceType.Response get_resource_type = 120; | |
905 GetTotalCompressedSize.Response get_total_compressed_size = 121; | |
906 GetTotalUncompressedSize.Response get_total_uncompressed_size = 122; | |
907 IsProtectedPatient.Response is_protected_patient = 123; | |
908 ListAvailableAttachments.Response list_available_attachments = 124; | |
909 LogChange.Response log_change = 125; | |
910 LogExportedResource.Response log_exported_resource = 126; | |
911 LookupAttachment.Response lookup_attachment = 127; | |
912 LookupGlobalProperty.Response lookup_global_property = 128; | |
913 LookupMetadata.Response lookup_metadata = 129; | |
914 LookupParent.Response lookup_parent = 130; | |
915 LookupResource.Response lookup_resource = 131; | |
916 SelectPatientToRecycle.Response select_patient_to_recycle = 132; | |
917 SelectPatientToRecycleWithAvoid.Response select_patient_to_recycle_with_avoid = 133; | |
918 SetGlobalProperty.Response set_global_property = 134; | |
919 ClearMainDicomTags.Response clear_main_dicom_tags = 135; | |
920 SetMetadata.Response set_metadata = 136; | |
921 SetProtectedPatient.Response set_protected_patient = 137; | |
922 IsDiskSizeAbove.Response is_disk_size_above = 138; | |
923 LookupResources.Response lookup_resources = 139; | |
924 CreateInstance.Response create_instance = 140; | |
925 SetResourcesContent.Response set_resources_content = 141; | |
926 GetChildrenMetadata.Response get_children_metadata = 142; | |
927 GetLastChangeIndex.Response get_last_change_index = 143; | |
928 LookupResourceAndParent.Response lookup_resource_and_parent = 144; | |
929 AddLabel.Response add_label = 145; | |
930 RemoveLabel.Response remove_label = 146; | |
931 ListLabels.Response list_labels = 147; | |
932 IncrementGlobalProperty.Response increment_global_property = 148; | |
933 UpdateAndGetStatistics.Response update_and_get_statistics = 149; | |
934 } | |
935 | |
936 enum RequestType { | |
937 REQUEST_DATABASE = 0; | |
938 REQUEST_TRANSACTION = 1; | |
939 } | |
940 | |
941 message Request { | |
942 RequestType type = 1; | |
943 DatabaseRequest database_request = 2; | |
944 TransactionRequest transaction_request = 3; | |
945 } | |
946 | |
947 message Response { | |
948 DatabaseResponse database_response = 2; | |
949 TransactionResponse transaction_response = 3; | |
950 } |