Exemplo n.º 1
0
        private void CreateDateRangeReport(object obj)
        {
            PatientCount   = null;
            DoctorAmount   = null;
            HospitalAmount = null;
            Amount         = null;
            ValidationText = null;

            string dateRangeValidation = DateRangeValidator.Validate(FromDate, ToDate);

            if (!string.IsNullOrEmpty(dateRangeValidation))
            {
                ValidationText = dateRangeValidation;
                return;
            }

            int patientCount = Repository.Instance.GetPatientCount(FromDate, ToDate);

            if (patientCount == 0)
            {
                ValidationText = string.Format(Resources.ValidationErrorTemplate, Resources.PatientsWereNotAtClinicDuringSpecifiedPeriod);
                return;
            }

            PatientCount = patientCount;
            PatientRecordFinancialData aggregatedFinancialData = Repository.Instance.GetAggregatedFinancialData(FromDate, ToDate);

            DoctorAmount   = aggregatedFinancialData.DoctorAmount;
            HospitalAmount = aggregatedFinancialData.HospitalAmount;
            Amount         = aggregatedFinancialData.Amount;
        }
Exemplo n.º 2
0
        private void CreatePatientReport(object obj)
        {
            DoctorAmount   = null;
            HospitalAmount = null;
            Amount         = null;
            PatientRecords = null;
            ValidationText = null;

            if (!Repository.Instance.DoesPatientExist(PatientName))
            {
                ValidationText = string.Format(Resources.ValidationErrorTemplate, Resources.PatientNotFound);
                return;
            }

            string dateRangeValidation = DateRangeValidator.Validate(FromDate, ToDate);

            if (!string.IsNullOrEmpty(dateRangeValidation))
            {
                ValidationText = dateRangeValidation;
                return;
            }

            PatientRecordFinancialData aggregatedPatientFinancialData = Repository.Instance.GetAggregatedPatientFinancialData(PatientName, FromDate, ToDate);

            if (aggregatedPatientFinancialData == null)
            {
                ValidationText = string.Format(Resources.ValidationErrorTemplate, Resources.PatientWasNotAtClinicDuringSpecifiedPeriod);
                return;
            }

            DoctorAmount   = aggregatedPatientFinancialData.DoctorAmount;
            HospitalAmount = aggregatedPatientFinancialData.HospitalAmount;
            Amount         = aggregatedPatientFinancialData.Amount;
            PatientRecords = Repository.Instance.GetSpecificPatientRecords(PatientName, FromDate, ToDate);
        }