gboutwell wrote:
PIVL<TS> Daily = new PIVL<TS>(new IVL<TS>(today), new PQ(1, "d"));
// Something like:
// frequency.Hull.Add(Daily) or frequency.Hull.Intersect(Daily);
Kind of got this to work, don't know if it's correct but it does compile and appear to do roughly what I want:
// Initialize
GTS Freq = new GTS();
// First time through Parse
PIVL<TS> pivl = new PIVL<TS>();
pivl.Phase = new IVL<TS>(today);
pivl.Frequency = new RTO<INT, PQ>(3, new PQ(1, "d"));
pivl.InstitutionSpecified = true;
pivl.Operator = SetOperator.Intersect;
pivl.OriginalText = "TID";
Freq.Hull = pivl;
// Second time through Parse
EIVL<TS> trigger = new EIVL<TS>(DomainTimingEventType.Meal, new IVL<PQ>(new PQ(-1, "h"), new PQ(1, "h")));
trigger.Operator = SetOperator.Intersect;
trigger.OriginalText = "With Meals";
SXPR<TS> expression = new SXPR<TS>();
PIVL<TS> frequency = Freq.Hull as PIVL<TS>;
frequency.Operator = SetOperator.Intersect;
expression.Add(frequency);
expression.Add(trigger);
Freq.Hull = expression;