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