/// <summary> /// Gets the list of items to show in the table, according to the specifed first and max items. /// </summary> /// <param name="firstItem"></param> /// <param name="maxItems"></param> /// <returns></returns> protected override IList <VisitSummary> ListItems(int firstItem, int maxItems) { ListVisitsForPatientResponse listResponse = null; Platform.GetService( delegate(IVisitAdminService service) { listResponse = service.ListVisitsForPatient(new ListVisitsForPatientRequest(_patientProfile.PatientRef)); }); return(listResponse.Visits); }
public ListVisitsForPatientResponse ListVisitsForPatient(ListVisitsForPatientRequest request) { Patient patient = PersistenceContext.Load <Patient>(request.PatientRef); VisitSearchCriteria criteria = new VisitSearchCriteria(); criteria.Patient.EqualTo(patient); IList <Visit> visits = PersistenceContext.GetBroker <IVisitBroker>().Find(criteria); VisitAssembler assembler = new VisitAssembler(); ListVisitsForPatientResponse response = new ListVisitsForPatientResponse(); response.Visits = new List <VisitSummary>(); foreach (Visit v in visits) { response.Visits.Add(assembler.CreateVisitSummary(v, PersistenceContext)); } return(response); }