コード例 #1
0
 protected override void Context()
 {
     _renamedField = new PopulationAnalysisParameterField {
         Name = _oldName, ParameterPath = "Path"
     };
     _groupingFieldUsing1 = new PopulationAnalysisGroupingField(new NumberOfBinsGroupingDefinition(_oldName)
     {
         NumberOfBins = 5
     })
     {
         Name = "Using1"
     };
     _groupingFieldUsing2 = new PopulationAnalysisGroupingField(new FixedLimitsGroupingDefinition(_oldName))
     {
         Name = "Using2"
     };
     _groupingFieldNotUsing = new PopulationAnalysisGroupingField(new FixedLimitsGroupingDefinition("ANOTHER NAME"))
     {
         Name = "NotUsing"
     };
     _expressionField = new PopulationAnalysisExpressionField($"[{_oldName}] + [Field2]")
     {
         Name = "Expression"
     };
     sut = new PopulationPivotAnalysis();
     sut.Add(_renamedField);
     sut.Add(_groupingFieldUsing1);
     sut.Add(_groupingFieldNotUsing);
     sut.Add(_groupingFieldUsing2);
     sut.Add(_expressionField);
 }
コード例 #2
0
        public void should_find_fields_in_expression()
        {
            var testExpression = "[Field1] + [Field2]";
            var test           = new PopulationAnalysisExpressionField(testExpression);

            test.FindFieldsIn(testExpression).ShouldContain("Field1");
            test.FindFieldsIn(testExpression).ShouldContain("Field2");
        }
コード例 #3
0
        public override void GlobalContext()
        {
            base.GlobalContext();
            _populationAnalysis = new PopulationPivotAnalysis();

            _pkParameterField              = new PopulationAnalysisPKParameterField().WithName("PKParam");
            _pkParameterField.PKParameter  = "AUC";
            _pkParameterField.QuantityPath = "A|B|C";
            _pkParameterField.QuantityType = QuantityType.Drug;
            _pkParameterField.Dimension    = _dimensionRepository.MassConcentration;

            _parameterField = new PopulationAnalysisParameterField().WithName("Param");
            _parameterField.ParameterPath = "A|B|C|D";
            _parameterField.Dimension     = _dimensionRepository.Auc;

            _outputField = new PopulationAnalysisOutputField().WithName("Output");
            _outputField.QuantityPath = "A|B|C";
            _outputField.Dimension    = _dimensionRepository.Auc;
            _outputField.Color        = Color.Aquamarine;

            _genderField = new PopulationAnalysisCovariateField {
                Covariate = "Gender"
            }.WithName("Gender");
            var numberOfBinsGroupingDefinition = new NumberOfBinsGroupingDefinition(_parameterField.Name)
            {
                NumberOfBins = 2
            };

            numberOfBinsGroupingDefinition.NamingPattern = "AA";
            numberOfBinsGroupingDefinition.StartColor    = Color.AliceBlue;
            numberOfBinsGroupingDefinition.EndColor      = Color.RoyalBlue;
            numberOfBinsGroupingDefinition.Strategy      = LabelGenerationStrategies.Roman;
            numberOfBinsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.BMIGroups);
            _numberOfBinsDerivedField = new PopulationAnalysisGroupingField(numberOfBinsGroupingDefinition).WithName("NumberOfBins");

            var fixedLimitsGroupingDefinition = new FixedLimitsGroupingDefinition(_pkParameterField.Name);

            fixedLimitsGroupingDefinition.AddItems(PopulationAnalysisHelperForSpecs.AgeGroups);

            _fixedLimitsGroupingDefinitionField = new PopulationAnalysisGroupingField(fixedLimitsGroupingDefinition)
                                                  .WithName("FixedLimits");

            fixedLimitsGroupingDefinition.SetLimits(new[] { 1d, 2d }.OrderBy(x => x));

            _derivedFieldWithFixedExpression = new PopulationAnalysisExpressionField("A+B")
                                               .WithName("FixedExpression");


            var valueMappingGroupingDefinition = new ValueMappingGroupingDefinition(_genderField.Name);

            valueMappingGroupingDefinition.AddValueLabel("Male", PopulationAnalysisHelperForSpecs.GroupingItemMale);
            valueMappingGroupingDefinition.AddValueLabel("Female", PopulationAnalysisHelperForSpecs.GroupingItemFemale);
            var valueMappingGroupingDefinitionField = new PopulationAnalysisGroupingField(valueMappingGroupingDefinition).WithName("ValueMapping");

            _populationAnalysis.Add(_pkParameterField);
            _populationAnalysis.Add(_parameterField);
            _populationAnalysis.Add(_genderField);
            _populationAnalysis.Add(_numberOfBinsDerivedField);
            _populationAnalysis.Add(_fixedLimitsGroupingDefinitionField);
            _populationAnalysis.Add(_derivedFieldWithFixedExpression);
            _populationAnalysis.Add(valueMappingGroupingDefinitionField);
            _populationAnalysis.Add(_outputField);
        }
コード例 #4
0
 public void the_expression_should_be_set()
 {
     sut = new PopulationAnalysisExpressionField(_testExpression);
     sut.Expression.ShouldBeEqualTo(_testExpression);
 }