Пример #1
0
        private IEnumerable <PatientLog> pracAdminQueryGenerator(DateTime fallDate)
        {
            List <string> pcps = new List <string>();

            pcps = DataCollections.getPracticeAdminPCPs(db, AimsHub.Security.HubSecurity.getLoggedInUserID());

            IEnumerable <PatientLog> patients = from p in db.PatientLogs
                                                where p.ServiceDate >= fallDate &&
                                                pcps.Contains(p.PCP_Practice)
                                                select p;

            return(patients);
        }
Пример #2
0
        private IEnumerable <PatientLog> pracAdminSearchQueryGenerator(DateTime fromDate, DateTime toDate, string patient)
        {
            List <string> pcps = new List <string>();

            pcps = DataCollections.getPracticeAdminPCPs(db, AimsHub.Security.HubSecurity.getLoggedInUserID());

            IEnumerable <PatientLog> patients = from p in db.PatientLogs
                                                where (p.ServiceDate >= fromDate && p.ServiceDate <= toDate) &&
                                                pcps.Contains(p.PCP_Practice)
                                                select p;

            if (patient != null && patient != "")
            {
                patients = patients.Where(p => p.PatientName.Contains(patient));
            }

            return(patients);
        }