public DatasetJoinedSequentialSqlSet(DatasetCachedPanelItemSqlSet set) { Set = set; Alias = $"{Dialect.Alias.Sequence}C"; PersonId = new Column(set.PersonId, this); Salt = new Column(set.Salt, this); }
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;
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 }; }