public virtual PatientsInfo GetPatientsOnPathway(PatientInputInfo patientInputInfo)
        {
            var listInput = _listInputInfoToListInputMapper.Map(patientInputInfo.ListInputInfo);

            var pausedPatients = patientInputInfo.PatientsFilterInputInfo.PeriodType == PausedPeriod;

            var completedEvents = pausedPatients ?
                                  _completedEventRepository
                                  .Get(GetCriteriaForPatientsOnPathway(patientInputInfo.PatientsFilterInputInfo),
                                       null,
                                       listInput,
                                       e => e.Period.Pathway.Patient,
                                       e => e.Clinician.Hospital,
                                       e => e.Clinician.Specialty)
                                  .Where(completedEvent => completedEvent.Period.GetPeriodStatus() == PeriodStatus.Paused)
                                  .ToList() :
                                  _completedEventRepository
                                  .Get(
                GetCriteriaForPatientsOnPathway(patientInputInfo.PatientsFilterInputInfo),
                patientInputInfo.PatientsFilterInputInfo.PeriodType,
                listInput,
                e => e.Period.Pathway.Patient,
                e => e.Clinician.Hospital,
                e => e.Clinician.Specialty)
                                  .Where(completedEvent => completedEvent.Period.GetPeriodStatus() != PeriodStatus.Paused)
                                  .ToList();

            var patientInfoCount = completedEvents.Count;

            var patientsInfo = (
                from completedEvent in completedEvents
                select CreatePatientInfoFromEvent(completedEvent)).ToArray();

            return(new PatientsInfo
            {
                PatientInfo = patientsInfo,
                TotalNumberOfPatients = patientInfoCount
            });
        }
Beispiel #2
0
 public virtual PatientsInfo GetPatientsOnPathway(RoleData role, PatientInputInfo patientInputInfo)
 {
     return(_patientApplicationService.GetPatientsOnPathway(patientInputInfo));
 }