public ConceptItems Concepts(int valueSetId, DateTime activeDate) { var valueSet = this.tdb.ValueSets.Single(y => y.Id == valueSetId); if (valueSet.ImportSource == ValueSetImportSources.VSAC) { var currentUser = CheckPoint.Instance.GetUser(this.tdb); if (!currentUser.HasValidUmlsLicense()) { throw new AuthorizationException("You do not have a valid/active UMLS license, and cannot view the concepts within this value set. <a href=\"/Account/MyProfile\">Update your profile</a> to view this value set."); } } var activeMembers = valueSet.GetActiveMembers(activeDate); ConceptItems ci = new ConceptItems(); ci.rows = (from am in activeMembers select new ConceptItem() { Id = am.Id, Code = am.Code, DisplayName = am.DisplayName, CodeSystemId = am.CodeSystemId, CodeSystemName = am.CodeSystem.Name, CodeSystemOid = am.CodeSystem.Oid, Status = am.Status, StatusDate = am.StatusDate }).ToArray(); ci.total = ci.rows.Length; return(ci); }
public ConceptItems Concepts(int valueSetId, int?page = null, string query = null, int count = 20) { ConceptItems concepts = new ConceptItems(); var rows = (from vsm in this.tdb.ValueSetMembers where vsm.ValueSetId == valueSetId && (string.IsNullOrEmpty(query) || ( vsm.Code.ToLower().Contains(query.ToLower()) || vsm.DisplayName.ToLower().Contains(query.ToLower()) )) orderby vsm.DisplayName select new ConceptItem() { Id = vsm.Id, Code = vsm.Code, DisplayName = vsm.DisplayName, CodeSystemId = vsm.CodeSystemId, CodeSystemName = vsm.CodeSystem.Name, CodeSystemOid = vsm.CodeSystem.Oid, Status = vsm.Status, StatusDate = vsm.StatusDate }); concepts.total = rows.Count(); if (page != null) { int skipCount = (page.Value - 1) * count; rows = rows.Skip(skipCount).Take(count); } concepts.rows = rows.ToArray(); return(concepts); }
public ConceptItems Concepts(int valueSetId, int?page = null, string query = null, int count = 20) { ValueSet valueSet = this.tdb.ValueSets.Single(y => y.Id == valueSetId); if (valueSet.ImportSource == ValueSetImportSources.VSAC) { var currentUser = CheckPoint.Instance.GetUser(this.tdb); if (!currentUser.HasValidUmlsLicense()) { throw new AuthorizationException("You do not have a valid/active UMLS license, and cannot view the concepts within this value set. <a href=\"/Account/MyProfile\">Update your profile</a> to view this value set."); } } ConceptItems concepts = new ConceptItems(); var rows = (from vsm in this.tdb.ValueSetMembers where vsm.ValueSetId == valueSetId && (string.IsNullOrEmpty(query) || ( vsm.Code.ToLower().Contains(query.ToLower()) || vsm.DisplayName.ToLower().Contains(query.ToLower()) )) orderby vsm.DisplayName select new ConceptItem() { Id = vsm.Id, Code = vsm.Code, DisplayName = vsm.DisplayName, CodeSystemId = vsm.CodeSystemId, CodeSystemName = vsm.CodeSystem.Name, CodeSystemOid = vsm.CodeSystem.Oid, Status = vsm.Status, StatusDate = vsm.StatusDate }); concepts.total = rows.Count(); if (page != null) { int skipCount = (page.Value - 1) * count; rows = rows.Skip(skipCount).Take(count); } concepts.rows = rows.ToArray(); return(concepts); }
public ConceptItems Concepts(int valueSetId, DateTime activeDate) { var valueSet = this.tdb.ValueSets.Single(y => y.Id == valueSetId); var activeMembers = valueSet.GetActiveMembers(activeDate); ConceptItems ci = new ConceptItems(); ci.rows = (from am in activeMembers select new ConceptItem() { Id = am.Id, Code = am.Code, DisplayName = am.DisplayName, CodeSystemId = am.CodeSystemId, CodeSystemName = am.CodeSystem.Name, CodeSystemOid = am.CodeSystem.Oid, Status = am.Status, StatusDate = am.StatusDate }).ToArray(); ci.total = ci.rows.Length; return(ci); }