Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 3083:683d572424b6 db-changes
IDatabaseWrapper::SetResourcesContent
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Fri, 04 Jan 2019 15:52:19 +0100 |
parents | 847a0ed92654 |
children | 74e3e48aa9bd |
comparison
equal
deleted
inserted
replaced
3082:847a0ed92654 | 3083:683d572424b6 |
---|---|
775 | 775 |
776 Recycle(instanceSize, hashPatient /* don't consider the current patient for recycling */); | 776 Recycle(instanceSize, hashPatient /* don't consider the current patient for recycling */); |
777 | 777 |
778 | 778 |
779 // Populate the newly-created resources | 779 // Populate the newly-created resources |
780 // TODO - GROUP THIS | 780 |
781 | 781 { |
782 ServerToolbox::StoreMainDicomTags(db_, instanceId, ResourceType_Instance, dicomSummary); | 782 ResourcesContent content; |
783 | 783 |
784 if (status.isNewSeries_) | 784 content.AddResource(instanceId, ResourceType_Instance, dicomSummary); |
785 { | 785 |
786 ServerToolbox::StoreMainDicomTags(db_, status.seriesId_, ResourceType_Series, dicomSummary); | 786 if (status.isNewSeries_) |
787 } | 787 { |
788 | 788 content.AddResource(status.seriesId_, ResourceType_Series, dicomSummary); |
789 if (status.isNewStudy_) | 789 } |
790 { | 790 |
791 ServerToolbox::StoreMainDicomTags(db_, status.studyId_, ResourceType_Study, dicomSummary); | 791 if (status.isNewStudy_) |
792 } | 792 { |
793 | 793 content.AddResource(status.studyId_, ResourceType_Study, dicomSummary); |
794 if (status.isNewPatient_) | 794 } |
795 { | 795 |
796 ServerToolbox::StoreMainDicomTags(db_, status.patientId_, ResourceType_Patient, dicomSummary); | 796 if (status.isNewPatient_) |
797 } | 797 { |
798 | 798 content.AddResource(status.patientId_, ResourceType_Patient, dicomSummary); |
799 } | |
800 | |
801 db_.SetResourcesContent(content); | |
802 } | |
803 | |
799 | 804 |
800 // Attach the files to the newly created instance | 805 // Attach the files to the newly created instance |
801 for (Attachments::const_iterator it = attachments.begin(); | 806 for (Attachments::const_iterator it = attachments.begin(); |
802 it != attachments.end(); ++it) | 807 it != attachments.end(); ++it) |
803 { | 808 { |
2457 db_.ClearMainDicomTags(patient); | 2462 db_.ClearMainDicomTags(patient); |
2458 db_.ClearMainDicomTags(study); | 2463 db_.ClearMainDicomTags(study); |
2459 db_.ClearMainDicomTags(series); | 2464 db_.ClearMainDicomTags(series); |
2460 db_.ClearMainDicomTags(instance); | 2465 db_.ClearMainDicomTags(instance); |
2461 | 2466 |
2462 ServerToolbox::StoreMainDicomTags(db_, patient, ResourceType_Patient, summary); | 2467 { |
2463 ServerToolbox::StoreMainDicomTags(db_, study, ResourceType_Study, summary); | 2468 ResourcesContent content; |
2464 ServerToolbox::StoreMainDicomTags(db_, series, ResourceType_Series, summary); | 2469 content.AddResource(patient, ResourceType_Patient, summary); |
2465 ServerToolbox::StoreMainDicomTags(db_, instance, ResourceType_Instance, summary); | 2470 content.AddResource(study, ResourceType_Study, summary); |
2471 content.AddResource(series, ResourceType_Series, summary); | |
2472 content.AddResource(instance, ResourceType_Instance, summary); | |
2473 db_.SetResourcesContent(content); | |
2474 } | |
2466 | 2475 |
2467 { | 2476 { |
2468 std::string s; | 2477 std::string s; |
2469 if (dicom.LookupTransferSyntax(s)) | 2478 if (dicom.LookupTransferSyntax(s)) |
2470 { | 2479 { |