コード例 #1
0
        public async Task <IActionResult> Index()
        {
            try
            {
                string cpFileKey           = nameof(CPFileSummaryViewModel);
                string hospitalPracticeKey = nameof(HospitalPracticeSummaryViewModel);

                if (!MedicCache.TryGetValue(cpFileKey, out List <CPFileSummaryViewModel> cpFiles))
                {
                    cpFiles = await CPFileService.GetSummaryByMonthAsync();

                    MedicCache.Set(cpFileKey, cpFiles);
                }

                if (!MedicCache.TryGetValue(hospitalPracticeKey, out List <HospitalPracticeSummaryViewModel> hospitalPractices))
                {
                    hospitalPractices = await HospitalPracticeService.GetSummaryByMonthAsync();

                    MedicCache.Set(hospitalPracticeKey, hospitalPractices);
                }

                if (!MedicCache.TryGetValue(MedicConstants.PatientsCount, out int patientsCount))
                {
                    patientsCount = await PatientService.GetPatientsCountAsync(new PatientWhereBuilder(default));