예제 #1
0
 public DatasetJoinedSequentialSqlSet(DatasetCachedPanelItemSqlSet set)
 {
     Set      = set;
     Alias    = $"{Dialect.Alias.Sequence}C";
     PersonId = new Column(set.PersonId, this);
     Salt     = new Column(set.Salt, this);
 }
예제 #2
0
 public DatasetNonAggregateJoinedSqlSet(Panel panel, CompilerOptions compilerOptions) : base(panel, compilerOptions)
 {
     var sp    = GetCachedCohortSubPanel(compilerOptions);
     var cache = new DatasetCachedPanelItemSqlSet(panel, sp, sp.PanelItems.First(), compilerOptions);
     var join  = new DatasetJoinedSequentialSqlSet(cache);
     var first = From.First() as JoinedSequentialSqlSet;
     var last  = From.Last() as JoinedSequentialSqlSet;
예제 #3
0
        public DatasetJoinedSqlSet(Panel panel, CompilerOptions compilerOptions) : base(panel, compilerOptions)
        {
            var sp    = GetCachedCohortSubPanel(compilerOptions);
            var cache = new DatasetCachedPanelItemSqlSet(panel, sp, sp.PanelItems.First(), compilerOptions);
            var join  = new DatasetJoinedSequentialSqlSet(cache);
            var first = From.First() as JoinedSequentialSqlSet;
            var last  = From.Last() as JoinedSequentialSqlSet;

            first.On   = new[] { join.PersonId == first.PersonId };
            first.Type = JoinType.Inner;

            Select = new ISelectable[]
            {
                new ExpressedColumn(last.PersonId, DatasetColumns.PersonId),
                new ExpressedColumn(last.EncounterId, EncounterColumns.EncounterId),
                join.Salt
            };
            From    = From.Prepend(join);
            GroupBy = new[] { last.PersonId, last.EncounterId, join.Salt };
        }