Ejemplo n.º 1
0
        public void PerformSearch()
        {
            _criteriaComponent.Enabled = false;

            NBIAQueryParameters queryParameters = new NBIAQueryParameters();

            queryParameters.StudyInstanceUID = this.CreateQueryDataForLikePredicate(_criteriaComponent.StudyInstanceUid);
            queryParameters.PatientId        = this.CreateQueryDataForLikePredicate(_criteriaComponent.PatientId);
            queryParameters.PatientName      = this.CreateQueryDataForLikePredicate(_criteriaComponent.PatientsName);
            queryParameters.PatientSex       = this.CreateQueryDataForLikePredicate(_criteriaComponent.PatientsSex);
            if (_criteriaComponent.PatientsBirthDate.HasValue)
            {
                string bdValue = _criteriaComponent.PatientsBirthDate.Value.ToString("yyyy-MM-dd hh:mm:ss.f");
                queryParameters.PatientBirthDate = new QueryData(bdValue, QueryPredicate.LIKE);
            }
            queryParameters.ProjectName  = this.CreateQueryDataForLikePredicate(_criteriaComponent.Project);
            queryParameters.ProtocolId   = this.CreateQueryDataForLikePredicate(_criteriaComponent.ProtocolId);
            queryParameters.ProtocolName = this.CreateQueryDataForLikePredicate(_criteriaComponent.ProtocolName);
            queryParameters.SiteId       = this.CreateQueryDataForLikePredicate(_criteriaComponent.SiteId);
            queryParameters.SiteName     = this.CreateQueryDataForLikePredicate(_criteriaComponent.SiteName);
            if (_criteriaComponent.SearchModalities.Count > 0)
            {
                queryParameters.Modality = new QueryData(_criteriaComponent.SearchModalities[0], QueryPredicate.EQUAL_TO);
            }
            if (!string.IsNullOrEmpty(_criteriaComponent.SliceThickness))
            {
                queryParameters.SliceThickness = new QueryData(_criteriaComponent.SliceThickness, QueryPredicate.GREATER_THAN_EQUAL_TO);
            }
            QueryForStudiesCommand searchCommand = new QueryForStudiesCommand(queryParameters);

            base.PerformSearch(searchCommand);
        }
            public override void Execute()
            {
                List <NBIASearchResult> results = new List <NBIASearchResult>();

                // DO study search
                NBIAStudy studyService = new NBIAStudy();

                try
                {
                    DataTable dtStudies = studyService.getStudyInfo(_queryParameters, SearchSettings.Default.NBIADataServiceUrl);
                    if (dtStudies != null)
                    {
                        foreach (DataRow studyUid in dtStudies.Rows)
                        {
                            if (base.CancelRequested)
                            {
                                break;
                            }

                            NBIASearchResult result = new NBIASearchResult();
                            result.Study.StudyInstanceUid = studyUid["studyInstanceUID"].ToString();
                            results.Add(result);
                        }
                    }
                }
                catch (GridServicerException ex)
                {
                    // report Grid error back to the component
                    base.SetError(ex.Message);
                }
                catch (Exception ex)
                {
                    Platform.Log(LogLevel.Error, ex, "Failed to query grid for Study data");
                }

                base.AddResultsToTable(results);

                foreach (NBIASearchResult result in base.SearchResults)
                {
                    if (base.CancelRequested)
                    {
                        break;
                    }

                    NBIAQueryParameters nbiaQueryParameters = _queryParameters.Clone();
                    nbiaQueryParameters.StudyInstanceUID = new QueryData(result.Study.StudyInstanceUid, QueryPredicate.EQUAL_TO);

                    base.EnqueueNextCommand(new QueryForPatientInfoCommand(nbiaQueryParameters, result));
                    base.EnqueueNextCommand(new QueryForClinicalTrialProtocolDataCommand(nbiaQueryParameters, result));
                    base.EnqueueNextCommand(new QueryForTrialDataProvenanceCommand(nbiaQueryParameters, result));
                    base.EnqueueNextCommand(new QueryForClinicalTrialSiteDataCommand(nbiaQueryParameters, result));
                    base.EnqueueNextCommand(new QueryForSeriesDataCommand(nbiaQueryParameters, result));
                }

                base.OnCommandExecuted();
            }
        public DataTable getClinicalTrialProtocolInfo(NBIAQueryParameters queryParameters, string endPointUrl)
        {
            _queryParameters = queryParameters;
            DataTable dataTable = null;
            var       result    = getClinicalTrialProtocolCQLInfo(endPointUrl);

            if (result != null && result.Items != null && result.Items.Length > 0)
            {
                dataTable = processCQLObjectResult(result);
            }
            return(dataTable);
        }
Ejemplo n.º 4
0
        public DataTable getTrialDataProvenanceInfo(NBIAQueryParameters queryParameters, string endPointUrl)
        {
            _queryParameters = queryParameters;
            DataTable dataTable = null;

            NBIAService.CQLQueryResults result = getTrialDataProvenanceCQLInfo(endPointUrl);
            if (result != null && result.Items != null && result.Items.Length > 0)
            {
                dataTable = this.processCQLObjectResult(result);
            }
            return(dataTable);
        }
 public QueryForSeriesDataCommand(NBIAQueryParameters queryParameters, NBIASearchResult result)
 {
     _queryParameters = queryParameters;
     _result          = result;
 }
 public QueryForClinicalTrialSiteDataCommand(NBIAQueryParameters queryParameters, NBIASearchResult result)
 {
     _queryParameters = queryParameters;
     _result          = result;
 }
 public QueryForTrialDataProvenanceCommand(NBIAQueryParameters queryParameters, NBIASearchResult result)
 {
     _queryParameters = queryParameters;
     _result          = result;
 }
 public QueryForPatientInfoCommand(NBIAQueryParameters queryParameters, NBIASearchResult result)
 {
     _queryParameters = queryParameters;
     _result          = result;
 }
 public QueryForStudiesCommand(NBIAQueryParameters queryParameters)
 {
     _queryParameters = queryParameters;
 }