/// <summary> /// Performs a search of patients /// </summary> /// <param name="searchCriteria"></param> /// <returns></returns> public async Task <PatientSearchResults> PatientSearchAsync(PatientSearchCriteria searchCriteria) { if (searchCriteria == null) { throw new ArgumentNullException(nameof(searchCriteria)); } if (string.IsNullOrEmpty(searchCriteria.SearchTerm)) { throw new ArgumentNullException(nameof(searchCriteria.SearchTerm)); } var searchTerm = searchCriteria.SearchTerm.Trim(); var patients = new List <Patient>(); // Find patients where the search term matches a string based property patients.AddRange(await SearchPatientStringBasedProperty(searchTerm)); // Convert the search term and search for patients with matching Health and Care numbers patients.AddRange(await SearchPatientHealthAndCareNumber(searchTerm)); // Convert the search term and search for patients with matching Id patients.AddRange(await SearchPatientIdNumber(searchTerm)); // Remove any patients fromthe results if the search criteria does // not indicate patients who have left, or are deceased or who's status // is unknown. if (!searchCriteria.IncludeLeftDeceasedAndUnknown) { patients.RemoveAll(s => s.Status != PatientStatus.Active); } return(new PatientSearchResults(patients)); }
public Patient[] Find(PatientSearchCriteria criteria) { using (var proxy = GetProxy()) { return(proxy.Channel.FindPatient(criteria).ToArray()); } }
public IList <Patient> Find(PatientSearchCriteria criteria) { var response = this.PatientService.Find(criteria); HttpAssert.Success(response); return(response.Result); }
public override void OnViewLoaded() { PatientSearchCriteria criteria = new PatientSearchCriteria(); criteria.FirstName = View.FirstName; criteria.LastName = View.LastName; View.Patients = _controller.Find(criteria); }
/// <summary> /// Return a collection of summaries for patients matching the search criteria /// </summary> /// <returns></returns> public async Task <PatientSearchResults> PerformPatientSearchAsync(PatientSearchCriteria searchCriteria) { if (searchCriteria == null) { throw new ArgumentNullException(nameof(searchCriteria)); } return(await _patientDal.PatientSearchAsync(searchCriteria)); }
public Patient FindPatientById(Guid patientId) { PatientSearchCriteria criteria = new PatientSearchCriteria(); criteria.Id = patientId; List <Patient> patients = new List <Patient>(_directoryServiceAgent.Find(criteria)); return(OutputValidationUtility.Encode <Patient>(patients[0])); }
/// <summary> /// Searches the specified criteria. /// </summary> /// <param name="criteria">The criteria.</param> /// <returns>ServiceResponse<IList<Patient>>.</returns> public ServiceResponse <IList <Patient> > Find(PatientSearchCriteria criteria) { Func <IList <Patient> > func = delegate { using (var context = _contextFactory()) { return(context.AsQueryable <Patient>().Apply(criteria).ToList()); } }; return(this.Execute(func)); }
public Patient[] Find(PatientSearchCriteria criteria) { List <Patient> patients = new List <Patient>(_directoryServiceAgent.Find(criteria)); return(OutputValidationUtility.Encode <Patient>(patients).ToArray()); }