static public Study Find(IPersistenceContext context, ServerEntityKey studyStorageKey) { IStudyEntityBroker broker = context.GetBroker <IStudyEntityBroker>(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyStorageKey.EqualTo(studyStorageKey); return(broker.FindOne(criteria)); }
/// <summary> /// Find a <see cref="Study"/> with the specified study instance uid on the given partition. /// </summary> /// <param name="studyInstanceUid"></param> /// <param name="partition"></param> /// <returns></returns> /// static public Study Find(IPersistenceContext context, String studyInstanceUid, ServerPartition partition) { IStudyEntityBroker broker = context.GetBroker <IStudyEntityBroker>(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.ServerPartitionKey.EqualTo(partition.GetKey()); criteria.StudyInstanceUid.EqualTo(studyInstanceUid); Study study = broker.FindOne(criteria); return(study); }
private void LoadStudyPartition(string studyInstanceUid) { using (IReadContext read = PersistentStoreRegistry.GetDefaultStore().OpenReadContext()) { IStudyEntityBroker selectStudy = read.GetBroker <IStudyEntityBroker>(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyInstanceUid.EqualTo(studyInstanceUid); Study theStudy = selectStudy.FindOne(criteria); Partition = ServerPartition.Load(read, theStudy.ServerPartitionKey); } }
private Study GetStudyAndQueues(StudyStorageLocation location, out int integrityQueueCount, out int workQueueCount) { using (IReadContext context = _store.OpenReadContext()) { IStudyIntegrityQueueEntityBroker integrityBroker = context.GetBroker <IStudyIntegrityQueueEntityBroker>(); StudyIntegrityQueueSelectCriteria integrityCriteria = new StudyIntegrityQueueSelectCriteria(); integrityCriteria.StudyStorageKey.EqualTo(location.Key); integrityQueueCount = integrityBroker.Count(integrityCriteria); IWorkQueueEntityBroker workBroker = context.GetBroker <IWorkQueueEntityBroker>(); WorkQueueSelectCriteria workCriteria = new WorkQueueSelectCriteria(); workCriteria.StudyStorageKey.EqualTo(location.Key); workQueueCount = workBroker.Count(workCriteria); IStudyEntityBroker procedure = context.GetBroker <IStudyEntityBroker>(); StudySelectCriteria criteria = new StudySelectCriteria(); criteria.StudyStorageKey.EqualTo(location.Key); return(procedure.FindOne(criteria)); } }