private void setMetaDataWithManualInput()
        {
            foreach (var metaData in _metaDataCategories)
            {
                if (!metaData.AllowsManualInput)
                {
                    continue;
                }

                var parameter = _dataSourceFile.Format.Parameters.OfType <MetaDataFormatParameter>().FirstOrDefault(p => p.ColumnName == metaData.Name);

                if (parameter != null)
                {
                    continue;
                }

                parameter = new MetaDataFormatParameter(null, metaData.Name, false);

                if (_dataSourceFile.Format.Parameters.Any(p => (p as MetaDataFormatParameter)?.MetaDataId == parameter.MetaDataId))
                {
                    if (_dataSourceFile.Format.Parameters.Any(p => (p as MetaDataFormatParameter)?.MetaDataId == parameter.MetaDataId))
                    {
                        continue;
                    }
                }

                _dataSourceFile.Format.Parameters.Add(parameter);
                return;
            }
        }
Esempio n. 2
0
        protected override void Context()
        {
            base.Context();
            UpdateSettings();
            MetaDataFormatParameter metaDataSource = null;

            metaDataSource = _parameters[3] as MetaDataFormatParameter;

            _model = new ColumnMappingDTO(ColumnMappingDTO.ColumnType.MetaData, "Study id", metaDataSource, 0)
            {
                ExcelColumn = "Study id"
            };
        }
        public void UpdateMetaDataForModel(MetaDataFormatParameter mappingSource)
        {
            if (mappingSource == null)
            {
                return;
            }

            _mappings.First(m => m.MappingName == mappingSource.MetaDataId).ExcelColumn = _metaDataParameterEditorPresenter.Input;
            mappingSource.ColumnName = _metaDataParameterEditorPresenter.Input;
            mappingSource.IsColumn   = false;
            ValidateMapping();
            _view.CloseEditor();
        }
        private void setDefaultMetaData()
        {
            foreach (var metaData in _metaDataCategories)
            {
                if (!metaData.SelectDefaultValue || metaData.DefaultValue == null)
                {
                    continue;
                }
                var parameter = _dataSourceFile.Format.Parameters.OfType <MetaDataFormatParameter>().FirstOrDefault(p => p.ColumnName == metaData.Name);
                if (parameter == null)
                {
                    parameter = new MetaDataFormatParameter(metaData.DefaultValue.ToString(), metaData.Name, false);
                    _dataSourceFile.Format.Parameters.Add(parameter);
                    return;
                }

                parameter.ColumnName = metaData.DefaultValue.ToString();
                parameter.IsColumn   = false;
            }
        }
Esempio n. 5
0
        protected override void Context()
        {
            base.Context();
            UpdateSettings();

            MetaDataFormatParameter metaDataSource = null;

            metaDataSource = _parameters[3] as MetaDataFormatParameter;

            _firstModel = new ColumnMappingDTO(ColumnMappingDTO.ColumnType.MetaData, "Study id", metaDataSource, 0)
            {
                ExcelColumn = "Study id"
            };

            MetaDataFormatParameter secondMetaDataSource = null;

            secondMetaDataSource = _parameters[4] as MetaDataFormatParameter;

            _secondModel = new ColumnMappingDTO(ColumnMappingDTO.ColumnType.MetaData, "Patient id", secondMetaDataSource, 0)
            {
                ExcelColumn = "Patient id"
            };
            sut.SetDescriptionForRow(_firstModel);
        }