Mercurial > hg > orthanc
comparison OrthancServer/ServerIndex.cpp @ 188:090cefdab1d1
fix because of Windows macros
author | Sebastien Jodogne <s.jodogne@gmail.com> |
---|---|
date | Mon, 12 Nov 2012 17:43:12 +0100 |
parents | 8e673a65564d |
children | ccbc2cf64a0d |
comparison
equal
deleted
inserted
replaced
187:8e673a65564d | 188:090cefdab1d1 |
---|---|
529 int64_t patient, study, series, instance; | 529 int64_t patient, study, series, instance; |
530 ResourceType type; | 530 ResourceType type; |
531 bool isNewSeries = false; | 531 bool isNewSeries = false; |
532 | 532 |
533 // Do nothing if the instance already exists | 533 // Do nothing if the instance already exists |
534 if (db2_->FindResource(hasher.HashInstance(), patient, type)) | 534 if (db2_->LookupResource(hasher.HashInstance(), patient, type)) |
535 { | 535 { |
536 assert(type == ResourceType_Patient); | 536 assert(type == ResourceType_Instance); |
537 return StoreStatus_AlreadyStored; | 537 return StoreStatus_AlreadyStored; |
538 } | 538 } |
539 | 539 |
540 // Create the patient/study/series/instance hierarchy | 540 // Create the patient/study/series/instance hierarchy |
541 instance = db2_->CreateResource(hasher.HashInstance(), ResourceType_Instance); | 541 instance = db2_->CreateResource(hasher.HashInstance(), ResourceType_Instance); |
542 | 542 |
543 if (!db2_->FindResource(hasher.HashSeries(), series, type)) | 543 if (!db2_->LookupResource(hasher.HashSeries(), series, type)) |
544 { | 544 { |
545 // This is a new series | 545 // This is a new series |
546 isNewSeries = true; | 546 isNewSeries = true; |
547 series = db2_->CreateResource(hasher.HashSeries(), ResourceType_Series); | 547 series = db2_->CreateResource(hasher.HashSeries(), ResourceType_Series); |
548 db2_->AttachChild(series, instance); | 548 db2_->AttachChild(series, instance); |
549 | 549 |
550 if (!db2_->FindResource(hasher.HashStudy(), study, type)) | 550 if (!db2_->LookupResource(hasher.HashStudy(), study, type)) |
551 { | 551 { |
552 // This is a new study | 552 // This is a new study |
553 study = db2_->CreateResource(hasher.HashStudy(), ResourceType_Study); | 553 study = db2_->CreateResource(hasher.HashStudy(), ResourceType_Study); |
554 db2_->AttachChild(study, series); | 554 db2_->AttachChild(study, series); |
555 | 555 |
556 if (!db2_->FindResource(hasher.HashPatient(), patient, type)) | 556 if (!db2_->LookupResource(hasher.HashPatient(), patient, type)) |
557 { | 557 { |
558 // This is a new patient | 558 // This is a new patient |
559 patient = db2_->CreateResource(hasher.HashPatient(), ResourceType_Patient); | 559 patient = db2_->CreateResource(hasher.HashPatient(), ResourceType_Patient); |
560 db2_->AttachChild(patient, study); | 560 db2_->AttachChild(patient, study); |
561 } | 561 } |