Mercurial > hg > orthanc-book
comparison Sphinx/source/users/rest.rst @ 136:8e08909ab69b bryandearlove/added-find-information-to-performing-que-1523454574665
Added find information to: Performing Query/Retrieve and Find with REST
author | Bryan Dearlove <bdearlove@gmail.com> |
---|---|
date | Wed, 11 Apr 2018 13:49:46 +0000 |
parents | 55a2ee3c462d |
children | f3127d33cf5e |
comparison
equal
deleted
inserted
replaced
134:6a9e5f2b10b2 | 136:8e08909ab69b |
---|---|
304 You also have the opportunity to access the raw value of the DICOM | 304 You also have the opportunity to access the raw value of the DICOM |
305 tags of an instance, without going through a JSON file. Here is how | 305 tags of an instance, without going through a JSON file. Here is how |
306 you would find the Patient Name of the instance:: | 306 you would find the Patient Name of the instance:: |
307 | 307 |
308 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content/0010-0010 | 308 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content/0010-0010 |
309 Anonymous^Unknown | 309 Anonymous^Unknown |
310 | 310 |
311 The list of all the available tags for this instance can also be retrieved easily:: | 311 The list of all the available tags for this instance can also be retrieved easily:: |
312 | 312 |
313 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content | 313 $ curl http://localhost:8042/instances/e668dcbf-8829a100-c0bd203b-41e404d9-c533f3d4/content |
314 | 314 |
412 this case, a single DICOM connection is used. `Sample code is | 412 this case, a single DICOM connection is used. `Sample code is |
413 available | 413 available |
414 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/HighPerformanceAutoRouting.py>`__. | 414 <https://bitbucket.org/sjodogne/orthanc/src/default/Resources/Samples/Python/HighPerformanceAutoRouting.py>`__. |
415 | 415 |
416 | 416 |
417 Performing Query/Retrieve with REST | 417 Performing Query/Retrieve and Find with REST |
418 ----------------------------------- | 418 ----------------------------------- |
419 | 419 |
420 *Section contributed by Bryan Dearlove* | 420 *Section contributed by Bryan Dearlove* |
421 | 421 |
422 Orthanc can be used to perform queries on the local Orthanc instance, | 422 Orthanc can be used to perform queries on the local Orthanc instance, |
425 To perform a query of a remote modality you must define the modality | 425 To perform a query of a remote modality you must define the modality |
426 within the :ref:`configuration file <configuration>` (See | 426 within the :ref:`configuration file <configuration>` (See |
427 Configuration section under Sending resources to remote modalities). | 427 Configuration section under Sending resources to remote modalities). |
428 | 428 |
429 | 429 |
430 Performing a Query on a Remote Modality | 430 .. highlight:: bash |
431 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | 431 |
432 | 432 Performing Queries on Modalities |
433 .. highlight:: bash | 433 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
434 | 434 |
435 To initiate a query you perform a POST command against the Modality | 435 To initiate a query you perform a POST command against the Modality |
436 with the identifiers you are looking for. The the example below we are | 436 with the identifiers you are looking for. The the example below we are |
437 performing a study level query against the modality sample for any | 437 performing a study level query against the modality sample for any |
438 study descriptions with the word chest within it. This search is case | 438 study descriptions with the word chest within it. This search is case |
444 --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}' | 444 --data '{"Level":"Study","Query": {"PatientID":"","StudyDescription":"*Chest*","PatientName":""}}' |
445 | 445 |
446 | 446 |
447 .. highlight:: json | 447 .. highlight:: json |
448 | 448 |
449 You will receive back an ID which can be used to retrieve more information with GET commands or C-Move requests with a POST Command:: | 449 You will receive back an ID which can be used to retrieve more information with GET commands or C-Move requests with a POST Command:: |
450 | 450 |
451 { | 451 { |
452 "ID": "5af318ac-78fb-47ff-b0b0-0df18b0588e0", | 452 "ID": "5af318ac-78fb-47ff-b0b0-0df18b0588e0", |
453 "Path": "/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0" | 453 "Path": "/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0" |
454 } | 454 } |
455 | 455 |
456 | 456 |
457 Additional Query Options | 457 Additional Options |
458 ^^^^^^^^^^^^^^^^^^^^^^^^ | 458 ^^^^^^^^^^^^^^^^^^ |
459 | 459 |
460 .. highlight:: json | 460 .. highlight:: json |
461 | 461 |
462 You can use patient identifiers by including the `*` within your | 462 You can use patient identifiers by including the `*` within your |
463 search. For example if you were searching for a name beginning with | 463 search. For example if you were searching for a name beginning with |
464 `Jones` you can do:: | 464 `Jones` you can do:: |
465 | 465 |
466 "PatientName":"Jones*". | 466 "PatientName":"Jones*". |
467 | 467 |
468 If you wanted to search for a name with the words `Jo` anywhere within | 468 If you wanted to search for a name with the words `Jo` anywhere within |
469 it you can do:: | 469 it you can do:: |
470 | 470 |
471 "PatientName":"*Jo*". | 471 "PatientName":"*Jo*". |
472 | 472 |
473 To perform date searches you can specify within StudyDate a starting date and/or | |
474 a before date. For example "StudyDate":"20180323-" would search for all study dates after the specified date to now. | |
475 Doing "StudyDate":"20180323-20180325" would search for all study dates between the specified date. | |
476 | |
473 | 477 |
474 Reviewing Level | 478 Reviewing Level |
475 ^^^^^^^^^^^^^^^ | 479 ^^^^^^^^^^^^^^^ |
476 | 480 |
477 .. highlight:: bash | 481 .. highlight:: bash |
480 | 484 |
481 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/level | 485 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/level |
482 | 486 |
483 Will retrieve the level with which the query was performed, Study, | 487 Will retrieve the level with which the query was performed, Study, |
484 Series or Instance. | 488 Series or Instance. |
485 | 489 |
486 | 490 |
487 Reviewing Modality | 491 Reviewing Modality |
488 ^^^^^^^^^^^^^^^^^^ | 492 ^^^^^^^^^^^^^^^^^^ |
489 | 493 |
490 .. highlight:: bash | 494 .. highlight:: bash |
491 | 495 |
492 :: | 496 :: |
493 | 497 |
494 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/modality | 498 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/modality |
495 | 499 |
496 Will provide the modality name which the original query was performed against. | 500 Will provide the modality name which the original query was performed against. |
497 | 501 |
498 | 502 |
499 Reviewing Query | 503 Reviewing Query |
500 ^^^^^^^^^^^^^^^ | 504 ^^^^^^^^^^^^^^^ |
501 | 505 |
504 To retrieve information on what identifiers the query was originally | 508 To retrieve information on what identifiers the query was originally |
505 performed using you can use the query filter:: | 509 performed using you can use the query filter:: |
506 | 510 |
507 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/query | 511 $ curl --request GET --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/query |
508 | 512 |
509 | 513 |
510 Reviewing Query Answers | 514 Reviewing Query Answers |
511 ^^^^^^^^^^^^^^^^^^^^^^^ | 515 ^^^^^^^^^^^^^^^^^^^^^^^ |
512 | 516 |
513 .. highlight:: bash | 517 .. highlight:: bash |
514 | 518 |
543 | 547 |
544 You are also able to perform individual C-Moves for a content item by | 548 You are also able to perform individual C-Moves for a content item by |
545 specifying that individual content item:: | 549 specifying that individual content item:: |
546 | 550 |
547 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers/0/retrieve --data Orthanc | 551 $ curl --request POST --url http://localhost:8042/queries/5af318ac-78fb-47ff-b0b0-0df18b0588e0/answers/0/retrieve --data Orthanc |
552 | |
553 Performing Finds within Orthanc | |
554 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |
555 .. highlight:: bash | |
556 | |
557 Performing a find within Orthanc is very similar to using Queries against DICOM modalities and the additional options listed above work with find also. | |
558 When performing a find, you will receive the Orthanc ID's of all the matched items within your find. For example if you perform a study level find and 5 Studies | |
559 match you will receive 5 study level Orthanc ID's in JSON format as a response:: | |
560 | |
561 $ curl --request POST --url http://localhost:8042/tools/find --data '{"Level":"Instance","Query":{"Modality":"CR","StudyDate":"20180323-","PatientID":"*"}}' | |
562 | |
563 Additional Options | |
564 ^^^^^^^^^^^^^^^^^^ | |
565 .. highlight:: bash | |
566 | |
567 You also have the ability to limit the responses by specifying a limit within the body of the POST message. For example:: | |
568 | |
569 "Limit":4 | |
548 | 570 |
549 | 571 |
550 Tracking changes | 572 Tracking changes |
551 ---------------- | 573 ---------------- |
552 | 574 |