comparison OrthancServer/OrthancInitialization.cpp @ 773:3bd0589af992

refactoring
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 30 Apr 2014 15:08:51 +0200
parents 31cc399c7762
children 557575fd93e9
comparison
equal deleted inserted replaced
772:31cc399c7762 773:3bd0589af992
506 target.push_back(lst[i].asString()); 506 target.push_back(lst[i].asString());
507 } 507 }
508 } 508 }
509 509
510 510
511 void ConnectToModalityUsingSymbolicName(DicomUserConnection& connection,
512 const std::string& name)
513 {
514 std::string aet, address;
515 int port;
516 ModalityManufacturer manufacturer;
517 GetDicomModalityUsingSymbolicName(name, aet, address, port, manufacturer);
518
519 LOG(WARNING) << "Connecting to remote DICOM modality: AET=" << aet << ", address=" << address << ", port=" << port;
520
521 connection.SetLocalApplicationEntityTitle(GetGlobalStringParameter("DicomAet", "ORTHANC"));
522 connection.SetDistantApplicationEntityTitle(aet);
523 connection.SetDistantHost(address);
524 connection.SetDistantPort(port);
525 connection.SetDistantManufacturer(manufacturer);
526 connection.Open();
527 }
528
529
530 bool IsSameAETitle(const std::string& aet1, 511 bool IsSameAETitle(const std::string& aet1,
531 const std::string& aet2) 512 const std::string& aet2)
532 { 513 {
533 if (GetGlobalBoolParameter("StrictAetComparison", false)) 514 if (GetGlobalBoolParameter("StrictAetComparison", false))
534 { 515 {
585 566
586 return LookupDicomModalityUsingAETitle(aet, symbolicName, address, port, manufacturer); 567 return LookupDicomModalityUsingAETitle(aet, symbolicName, address, port, manufacturer);
587 } 568 }
588 569
589 570
590
591 RemoteModalityParameters GetModalityUsingSymbolicName(const std::string& name) 571 RemoteModalityParameters GetModalityUsingSymbolicName(const std::string& name)
592 { 572 {
593 std::string aet, address; 573 std::string aet, address;
594 int port; 574 int port;
595 ModalityManufacturer manufacturer; 575 ModalityManufacturer manufacturer;
597 GetDicomModalityUsingSymbolicName(name, aet, address, port, manufacturer); 577 GetDicomModalityUsingSymbolicName(name, aet, address, port, manufacturer);
598 578
599 return RemoteModalityParameters(name, aet, address, port, manufacturer); 579 return RemoteModalityParameters(name, aet, address, port, manufacturer);
600 } 580 }
601 581
582
602 RemoteModalityParameters GetModalityUsingAet(const std::string& aet) 583 RemoteModalityParameters GetModalityUsingAet(const std::string& aet)
603 { 584 {
604 std::string name, address; 585 std::string name, address;
605 int port; 586 int port;
606 ModalityManufacturer manufacturer; 587 ModalityManufacturer manufacturer;
611 } 592 }
612 else 593 else
613 { 594 {
614 throw OrthancException("Unknown modality for AET: " + aet); 595 throw OrthancException("Unknown modality for AET: " + aet);
615 } 596 }
616
617 } 597 }
618 } 598 }