Example #1
0
 public ParallelPatientCohortService(
     ISqlCompiler compiler,
     PatientCountAggregator patientCountAggregator,
     IOptions <ClinDbOptions> clinOpts,
     ILogger <PatientCohortService> logger) : base(compiler, clinOpts, logger)
 {
     this.patientCountAggregator = patientCountAggregator;
 }
Example #2
0
        public void Single_Include_Only_Should_Equal_Output()
        {
            var context = new PartialPatientCountContext[]
            {
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "123", "234", "345", "456"
                    },
                    IsInclusionCriteria = true
                }
            };

            var agg = new PatientCountAggregator().Aggregate(context);

            Assert.True(agg.SequenceEqual(context.ElementAt(0).PatientIds));
        }
Example #3
0
        public void Complex_Context_Aggregates_Correctly()
        {
            var context = new PartialPatientCountContext[]
            {
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "123", "234", "345", "456"
                    },
                    IsInclusionCriteria = true
                },
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "234", "345", "456"
                    },
                    IsInclusionCriteria = true
                },
                new PartialPatientCountContext
                {
                    PatientIds = new HashSet <string>
                    {
                        "456"
                    },
                    IsInclusionCriteria = false
                }
            };

            var expected = new string[] { "234", "345" };

            var agg = new PatientCountAggregator().Aggregate(context);

            Assert.True(expected.SequenceEqual(agg));
        }