public Object PostPatientView([FromBody] HookRequestVM hookInstance) { CdsServices cdsSvc = new CdsServices(); List <Card> cards = cdsSvc.GetPatientViewInsights(hookInstance); return(new { cards = cards }); }
public List <Card> GetPatientViewInsights(HookRequestVM hookRequest) { HookRequestVM vm = (HookRequestVM)hookRequest; List <Card> cards = new List <Card>(0); using (EaiDBEntities ctx = new EaiDBEntities()) { List <Insight> insights = (from s in ctx.Insight select s).Include(x => x.InsightLink) .ToList(); foreach (Insight site in insights) { Card c2 = new Card(); c2.summary = site.ProviderMessageheadline; c2.indicator = "info"; List <LinkVM> vms = new List <LinkVM>(0); foreach (InsightLink aLink in site.InsightLink.ToList()) { LinkVM lvm = new LinkVM(); lvm.label = aLink.LinkLabel; lvm.type = aLink.Vv_LinkType; lvm.url = aLink.LinkUrl; vms.Add(lvm); } if (vms.Count > 0) { c2.links = vms; } cards.Add(c2); } } return(cards); }