public bool InsertMedDocInIndex(PutMedRegistrationRequest request) { try { MedNameStrategy.AddUpdateLuceneIndex(request.MedDocument); return true; } catch (Exception ex) { throw new Exception("SearchDD:GetSearchByID()::" + ex.Message, ex.InnerException); } }
public bool DeleteMedDocs(List<MedNameSearchDocData> meds) { try { MedNameStrategy.DeleteFromIndex(meds); return true; } catch (Exception ex) { throw new Exception("SearchDD:GetSearchByID()::" + ex.Message, ex.InnerException); } }
public List<object> GetTermSearchResults(GetSearchRequest request, SearchEnum type) { try { List<object> result = null; switch (type) { case SearchEnum.Medication: { result = MedNameStrategy.Search(request.Term).Select(s => s).ToList<object>(); break; } case SearchEnum.Allergy: { if (AllergyStrategy == null) throw new ArgumentException("Allergystrategy is null."); var matched = AllergyStrategy.SearchComplex(request.Term, "Name"); if (matched != null) { result = matched.Select(s => s).ToList<object>(); } break; } } return result; } catch (Exception ex) { FileLog.LogMessageToFile("SearchDD:GetTermSearchResults()::" + ex.Message + " trace:" + ex.StackTrace); throw new Exception("SearchDD:GetTermSearchResults()::" + ex.Message, ex.InnerException); } }