Beispiel #1
0
  bool LookupResource::Level::Add(const DicomTag& tag,
                                  std::auto_ptr<IFindConstraint>& constraint)
  {
    if (identifiers_.find(tag) != identifiers_.end())
    {
      if (level_ == ResourceType_Patient)
      {
        // The filters on the patient level must be cloned to the study level
        identifiersConstraints_[tag] = constraint->Clone();
      }
      else
      {
        identifiersConstraints_[tag] = constraint.release();
      }

      return true;
    }
    else if (mainTags_.find(tag) != mainTags_.end())
    {
      if (level_ == ResourceType_Patient)
      {
        // The filters on the patient level must be cloned to the study level
        mainTagsConstraints_[tag] = constraint->Clone();
      }
      else
      {
        mainTagsConstraints_[tag] = constraint.release();
      }

      return true;
    }
    else
    {
      return false;
    }
  }