From fc30cb39eedf2b81889b6c6ad3561f1d9553452a Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 20 Sep 2024 10:19:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0Global=20Using?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BusinessFilter/UnifiedApiResultFilter.cs | 2 +- IRC.Core.SCP/HostConfig/AutofacModuleSetup.cs | 2 +- IRC.Core.SCP/Service/BaseService.cs | 2 +- .../Controllers/ExtraController.cs | 2 +- .../Controllers/FinancialChangeController.cs | 2 +- IRaCIS.Core.API/Progranm.cs | 2 +- .../_PipelineExtensions/HangfireConfig.cs | 2 +- .../_ServiceExtensions/AutofacModuleSetup.cs | 2 +- IRaCIS.Core.Application/Auth/IRaCISClaims.cs | 8 +- IRaCIS.Core.Application/Auth/IRaCISPolicy.cs | 10 +- IRaCIS.Core.Application/Auth/JwtSetting.cs | 3 +- IRaCIS.Core.Application/Auth/TokenService.cs | 8 +- .../BackGroundJob/IRaCISCHangfireJob.cs | 8 +- .../BackGroundJob/ObtainTaskAutoCancelJob.cs | 9 +- IRaCIS.Core.Application/BaseService.cs | 7 +- .../Encryption/AesEncryption.cs | 10 +- .../Encryption/EncreptApiResultFilter.cs | 4 - .../Encryption/EncryptionRequestMiddleware.cs | 7 +- .../Encryption/RSAEncryption.cs | 8 +- .../BusinessFilter/GlobalExceptionHandler.cs | 6 - .../LimitUserRequestAuthorization.cs | 10 +- .../BusinessFilter/ModelActionFilter .cs | 19 +- .../BusinessFilter/ModelBinding.cs | 1 - .../BusinessFilter/ProjectExceptionFilter.cs | 1 - .../BusinessFilter/UnifiedApiResultFilter.cs | 8 +- IRaCIS.Core.Application/GlobalUsings.cs | 12 + .../Attribute/DictionaryTranslateAttribute.cs | 13 +- IRaCIS.Core.Application/Helper/CacheHelper.cs | 9 +- .../Helper/ExcelExportHelper.cs | 12 +- .../Helper/FileConvertHelper.cs | 7 +- .../Helper/FileStoreHelper.cs | 41 +- .../Helper/HangfireJobHelper.cs | 14 +- .../Helper/HolidayHelper.cs | 5 - .../Helper/IRCEmailPasswordHelper.cs | 9 +- IRaCIS.Core.Application/Helper/ImageHelper.cs | 4 +- .../Helper/InternationalizationHelper.cs | 12 +- IRaCIS.Core.Application/Helper/OSSService.cs | 45 +- .../Helper/SendEmailHelper.cs | 8 +- .../Helper/WordTempleteHelper.cs | 5 - .../IRaCIS.Core.Application.csproj | 15 - .../IRaCIS.Core.Application.xml | 4350 ++++++++--------- .../Command/ConsistenCheckCommand.cs | 5 - .../Consumer/ConsistencyCheckConsumer.cs | 7 +- .../DTO/TaskAllocationRuleViewModel.cs | 23 +- .../DTO/TaskConsistentRuleViewModel.cs | 22 +- .../DTO/TaskMedicalReviewRuleViewModel.cs | 7 +- .../DTO/TaskMedicalReviewViewModel.cs | 20 +- .../Allocation/DTO/VisitTaskViewModel.cs | 36 +- .../Interface/ITaskAllocationRuleService.cs | 24 +- .../Interface/ITaskConsistentRuleService.cs | 24 +- .../Interface/IVisitTaskHelpeService.cs | 2 +- .../Allocation/TaskAllocationRuleService.cs | 7 +- .../Allocation/TaskConsistentRuleService.cs | 23 +- .../TaskMedicalReviewRuleService.cs | 17 +- .../Allocation/TaskMedicalReviewService.cs | 76 +- .../Allocation/VisitTaskHelpeService.cs | 39 +- .../Service/Allocation/VisitTaskService.cs | 27 +- .../Service/Allocation/_MapConfig.cs | 42 +- .../Service/Common/CommonDocumentService.cs | 20 +- .../Common/DTO/CommonDocumentViewModel.cs | 6 +- .../Service/Common/DTO/DictionaryModel.cs | 13 +- .../Common/DTO/EmailNoticeConfigViewModel.cs | 4 +- .../Common/DTO/ExploreRecommendViewModel.cs | 11 +- .../Common/DTO/FrontAuditConfigViewModel.cs | 25 +- .../DTO/InternationalizationViewModel.cs | 5 +- .../Service/Common/DTO/PublishLogViewModel.cs | 5 +- .../Service/Common/DTO/SysMessageModel.cs | 4 +- .../Common/DTO/SystemBasicDataViewModel.cs | 14 +- .../Service/Common/DTO/SystemLogModel.cs | 10 +- .../Service/Common/DevelopService.cs | 5 - .../Service/Common/DictionaryService.cs | 168 +- .../Common/EmailNoticeConfigService.cs | 11 +- .../Service/Common/ExcelExportService.cs | 67 +- .../Service/Common/ExploreRecommendService.cs | 11 +- .../Service/Common/FileService.cs | 8 +- .../Interface/ICommonDocumentService.cs | 22 +- .../Common/Interface/IDictionaryService.cs | 9 +- .../Interface/IExploreRecommendService.cs | 22 +- .../Service/Common/Interface/IFileService.cs | 4 +- .../Interface/IFrontAuditConfigService.cs | 24 +- .../Service/Common/Interface/ILogService.cs | 5 +- .../Common/Interface/IMessageService.cs | 4 +- .../Common/Interface/IPublishLogService.cs | 22 +- .../Interface/ISystemBasicDataService.cs | 24 +- .../Common/InternationalizationService.cs | 14 +- .../Service/Common/MailService.cs | 36 +- .../Service/Common/PublishLogService.cs | 12 +- .../Service/Common/SystemBasicDataService.cs | 10 +- .../Service/Common/SystemMonitor.cs | 24 +- .../Service/Common/_MapConfig.cs | 4 +- .../Service/Doctor/AttachmentService.cs | 49 +- .../Service/Doctor/DTO/AttachmentModel.cs | 4 +- .../Doctor/DTO/DoctorAccountRegisterModel.cs | 4 +- .../Service/Doctor/DTO/DoctorModel.cs | 35 +- .../Service/Doctor/DTO/EducationModel.cs | 17 +- .../Service/Doctor/DTO/HolidayModel.cs | 4 +- .../Doctor/DTO/ResearchPublicationModel.cs | 4 +- .../Doctor/DTO/TrialExperienceModel.cs | 6 +- .../Service/Doctor/DoctorListService.cs | 29 +- .../Service/Doctor/DoctorService.cs | 22 +- .../Service/Doctor/EducationService.cs | 17 +- .../Doctor/Interface/IAttachmentService.cs | 9 +- .../Doctor/Interface/IDoctorAccountService.cs | 5 +- .../Interface/IDoctorListQueryService.cs | 14 +- .../Doctor/Interface/IDoctorService.cs | 7 +- .../Doctor/Interface/IEducationService.cs | 4 +- .../Interface/IResearchPublicationService.cs | 4 +- .../Interface/ITrialExperienceService.cs | 4 +- .../Doctor/Interface/IVacationService.cs | 9 +- .../Doctor/ResearchPublicationService.cs | 10 +- .../Service/Doctor/TrialExperienceService.cs | 26 +- .../Service/Doctor/VacationService.cs | 21 +- .../Service/Doctor/_MapConfig.cs | 9 +- .../Document/DTO/SystemDocumentViewModel.cs | 38 +- .../DTO/TrialDocumentUserConfirmViewModel.cs | 6 +- .../Document/DTO/TrialDocumentViewModel.cs | 11 +- .../DTO/TrialEmailNoticeConfigViewModel.cs | 3 - .../Service/Document/EmailSendService.cs | 77 +- .../Interface/ISystemDocumentService.cs | 3 +- .../Interface/ITrialDocumentService.cs | 5 - .../ITrialEmailNoticeConfigService.cs | 29 +- .../Service/Document/SystemDocumentService.cs | 23 +- .../Service/Document/TrialDocumentService.cs | 22 +- .../Document/TrialEmailNoticeConfigService.cs | 32 +- .../Service/Document/_MapConfig.cs | 25 +- .../Service/Financial/CalculateService.cs | 99 +- .../Service/Financial/DTO/AwardPriceModel.cs | 8 +- .../Service/Financial/DTO/CalculateModel.cs | 4 +- .../Financial/DTO/ExchangeRateModel.cs | 6 +- .../Financial/DTO/PaymentAdjustmentModel.cs | 19 +- .../Financial/DTO/PaymentDetailModel.cs | 8 +- .../Service/Financial/DTO/PaymentModel.cs | 16 +- .../Service/Financial/DTO/RankPriceModel.cs | 7 +- .../Financial/DTO/ReviewerPayInfoModel.cs | 4 +- .../Financial/DTO/TrialPaymentPriceModel.cs | 11 +- .../Financial/DTO/TrialRevenuesPriceModel.cs | 13 +- .../DTO/TrialRevenuesPriceVerificationDTO.cs | 5 +- .../Service/Financial/ExchangeRateService.cs | 20 +- .../Service/Financial/FinancialService.cs | 111 +- .../Financial/Interface/ICalculateService.cs | 3 - .../Interface/IDoctorPayInfoService.cs | 6 +- .../Interface/IExchangeRateService.cs | 2 - .../Interface/IPaymentAdjustmentService.cs | 5 +- .../Financial/Interface/IPaymentService.cs | 5 +- .../Financial/Interface/IRankPriceService.cs | 7 +- .../Interface/ITrialPaymentPriceService.cs | 5 +- .../Interface/ITrialRevenuesPriceService.cs | 2 - .../ITrialRevenuesPriceVerificationService.cs | 1 - .../Interface/IVolumeRewardService.cs | 5 +- .../Financial/PaymentAdjustmentService.cs | 9 +- .../Service/Financial/RankPriceService.cs | 21 +- .../Financial/ReviewerPayInfoService.cs | 21 +- .../Financial/TrialPaymentPriceService.cs | 8 +- .../Financial/TrialRevenuesPriceService.cs | 9 +- .../TrialRevenuesPriceVerificationService.cs | 45 +- .../Service/Financial/VolumeRewardService.cs | 22 +- .../Service/Financial/_MapConfig.cs | 5 +- .../Fixed/CriterionAdditionalAssessment.cs | 9 +- .../ImageAndDoc/DTO/DicomArchiveResult.cs | 5 +- .../ImageAndDoc/DTO/DicomInstanceModel.cs | 6 +- .../ImageAndDoc/DTO/DicomSeriesModel.cs | 12 +- .../ImageAndDoc/DTO/DownloadAndUploadDTO.cs | 13 +- .../ImageAndDoc/DTO/ImageLabelModel.cs | 6 +- .../ImageAndDoc/DTO/ImageShareModel.cs | 4 +- .../ImageAndDoc/DTO/StudyStatusDetailModel.cs | 6 +- .../DTO/SystemAnonymizationViewModel.cs | 10 +- .../ImageAndDoc/DTO/UnionStudyViewDodel.cs | 5 - .../ImageAndDoc/DicomArchiveService.cs | 15 +- .../ImageAndDoc/DownloadAndUploadService.cs | 23 +- .../Service/ImageAndDoc/ImageShareService.cs | 11 +- .../Service/ImageAndDoc/InstanceService.cs | 6 +- .../Interface/IDicomArchiveService.cs | 2 +- .../ImageAndDoc/Interface/IStudyService.cs | 3 +- .../Interface/ISystemAnonymizationService.cs | 24 +- .../ImageAndDoc/NoneDicomStudyService.cs | 6 +- .../Service/ImageAndDoc/SeriesService.cs | 15 +- .../Service/ImageAndDoc/StudyService.cs | 24 +- .../ImageAndDoc/SystemAnonymizationService.cs | 1 - .../Service/ImageAndDoc/_MapConfig.cs | 7 +- .../Service/Inspection/DTO/InspectionModel.cs | 55 +- .../Inspection/DTO/InspectionViewModel.cs | 1 - .../Inspection/FrontAuditConfigService.cs | 15 +- .../Service/Inspection/InspectionService.cs | 35 +- .../Interface/IInspectionService.cs | 9 +- .../Service/Inspection/_MapConfig.cs | 12 +- .../Service/Institution/CROService.cs | 9 +- .../Institution/DTO/CROCompanyModel.cs | 5 +- .../Service/Institution/DTO/HospitalModel.cs | 5 +- .../Service/Institution/DTO/SiteModel.cs | 15 +- .../Service/Institution/DTO/SponsorModel.cs | 7 +- .../Service/Institution/HospitalService.cs | 13 +- .../Institution/Interface/ICROService.cs | 5 +- .../Institution/Interface/IHospitalService.cs | 9 +- .../Institution/Interface/ISiteService.cs | 7 +- .../Institution/Interface/ISponsorService.cs | 11 +- .../Service/Institution/SiteService.cs | 15 +- .../Service/Institution/SponsorService.cs | 36 +- .../Service/Institution/_MapConfig.cs | 7 +- .../Service/Management/DTO/MenuModel.cs | 22 +- .../Service/Management/DTO/RoleModel.cs | 6 +- .../Management/DTO/SystemNoticeViewModel.cs | 17 +- .../Service/Management/DTO/TreeNode.cs | 8 +- .../Management/DTO/UserFeedBackViewModel.cs | 5 +- .../Management/DTO/UserLogViewModel.cs | 2 - .../Service/Management/DTO/UserModel.cs | 51 +- .../Management/Interface/IMenuService.cs | 2 +- .../Interface/ISystemNoticeService.cs | 24 +- .../Management/Interface/IUserService.cs | 10 +- .../Service/Management/MenuService.cs | 9 +- .../Service/Management/SystemNoticeService.cs | 13 +- .../Service/Management/UserFeedBackService.cs | 14 +- .../Service/Management/UserService.cs | 29 +- .../Service/Management/UserTypeService.cs | 28 +- .../Service/Management/_MapConfig.cs | 3 +- .../Service/QC/ClinicalDataService.cs | 13 +- .../QC/DTO/NoneDicomStudyFileViewModel.cs | 3 - .../Service/QC/DTO/NoneDicomStudyViewModel.cs | 14 +- .../Service/QC/DTO/PreviousOtherViewModel.cs | 6 +- .../QC/DTO/PreviousSurgeryViewModel.cs | 4 +- .../Service/QC/DTO/QARecordViewModel.cs | 22 +- .../Service/QC/DTO/QCListViewModel.cs | 4 - .../QC/DTO/QCQuestionConfigureViewModel.cs | 48 +- .../DTO/TrialQCQuestionConfigureViewModel.cs | 48 +- .../QC/Interface/IClinicalDataService.cs | 5 - .../QC/Interface/INoneDicomStudyService.cs | 7 +- .../Service/QC/Interface/IQCListService.cs | 4 +- .../QC/Interface/IQCOperationService.cs | 6 +- .../QC/Interface/IQCQuestionService.cs | 4 +- .../ITrialQCQuestionConfigureService.cs | 2 - .../Service/QC/QCCommon.cs | 12 +- .../Service/QC/QCListService.cs | 145 +- .../Service/QC/QCOperationService.cs | 50 +- .../Service/QC/QCQuestionService.cs | 49 +- .../Service/QC/TrialQCQuestionService.cs | 22 +- .../Service/QC/_MapConfig.cs | 13 +- .../DTO/SubjectCriteriaEvaluationViewModel.cs | 2 - ...tCriteriaEvaluationVisitFilterViewModel.cs | 15 +- ...eriaEvaluationVisitStudyFilterViewModel.cs | 3 - .../ISubjectCriteriaEvaluationService.cs | 13 +- .../SubjectCriteriaEvaluationService.cs | 35 +- .../ClinicalData/ClinicalAnswerService.cs | 708 +-- .../ClinicalData/ClinicalDataSetService.cs | 95 +- .../ClinicalData/ClinicalQuestionService.cs | 8 +- .../ReadingClinicalDataService.cs | 21 +- .../Service/Reading/Dto/ClinicalAnswerDto.cs | 263 +- .../Dto/ClinicalDataServiceViewModel.cs | 93 +- .../Reading/Dto/ClinicalQuestionDto.cs | 211 +- .../Dto/DefaultShortcutKeyViewModel.cs | 109 +- .../Service/Reading/Dto/GetReadModuleDto.cs | 29 +- .../Service/Reading/Dto/OrganInfoViewModel.cs | 32 +- .../Reading/Dto/PreviousPDFViewModel.cs | 10 +- .../Reading/Dto/ReadingCalculateViewModel.cs | 49 +- .../Reading/Dto/ReadingClinicalDataDto.cs | 767 ++- .../Reading/Dto/ReadingImageTaskViewModel.cs | 605 ++- .../Reading/Dto/ReadingMedicalReviewDto.cs | 92 +- .../Dto/ReadingMedicineQuestionViewModel.cs | 112 +- .../Reading/Dto/ReadingPeriodSetViewModel.cs | 15 +- .../Reading/Dto/ReadingQuestionViewModel.cs | 3369 +++++++------ .../Reading/Dto/UserWLTemplateViewModel.cs | 77 +- .../Service/Reading/Dto/VisitTaskDto.cs | 11 +- .../Interface/IClinicalAnswerService.cs | 17 +- .../Interface/IClinicalQuestionService.cs | 5 +- .../Reading/Interface/IOrganInfoService.cs | 22 +- .../Reading/Interface/IReadModuleService.cs | 5 +- .../Interface/IReadingClinicalDataService.cs | 7 +- .../Interface/IReadingImageTaskService.cs | 4 +- .../IReadingMedicineQuestionService.cs | 1 - .../ReadingMedicalReviewService.cs | 363 +- .../ReadingMedicineQuestionService.cs | 1062 ++-- .../ReadingCriterion/OrganInfoService.cs | 126 +- .../ReadingCriterionService.cs | 71 +- .../ReadingQuestionService.cs | 155 +- .../TumorAssessmentService.cs | 12 +- .../ReadingGlobalTaskService.cs | 221 +- .../ReadingImageTaskService.cs | 127 +- .../ReadingJudgeTaskService.cs | 196 +- .../ReadingNoDicomTaskService.cs | 17 +- .../ReadingOncologyTaskService.cs | 309 +- .../ReadingTaskQuestionService.cs | 21 +- .../ReadingPeriod/ReadModuleService.cs | 19 +- .../ReadingPeriod/ReadingPeriodSetService.cs | 13 +- .../Reading/ShortcutKey/ShortcutKeyService.cs | 6 +- .../ShortcutKey/UserWLTemplateService.cs | 154 +- .../Service/Reading/_MapConfig.cs | 22 +- .../Dto/CriterionCalculateDto.cs | 43 +- .../General/GeneralCalculateService.cs | 94 +- .../General/ReadingCalculateService.cs | 90 +- .../IRECIST1Point1CalculateService.cs | 773 ++- .../ReadingCalculate/IVUSCalculateService.cs | 222 +- .../Interface/ICriterionCalculateService.cs | 10 +- .../Interface/IGeneralCalculateService.cs | 5 - .../Interface/ILuganoCalculateService.cs | 35 +- .../Interface/IReadingCalculateService.cs | 7 +- .../LuganoCalculateService.cs | 755 ++- .../LuganoWithoutPETCalculateService.cs | 755 ++- .../ReadingCalculate/OCTCalculateService.cs | 138 +- .../ReadingCalculate/PCWG3CalculateService.cs | 188 +- .../RECIST1Point1CalculateService.cs | 175 +- .../RECIST1Point1_BMCalculateService.cs | 147 +- .../SelfDefineCalculateService.cs | 141 +- .../DTO/TrialSiteSurveyViewModel.cs | 7 +- .../Interface/ITrialSiteSurveyService.cs | 1 - .../TrialSiteEquipmentSurveyService.cs | 8 +- .../SiteSurvey/TrialSiteSurveyService.cs | 32 +- .../SiteSurvey/TrialSiteUserSurveyService.cs | 11 +- .../Service/SiteSurvey/_MapConfig.cs | 6 +- .../Service/Stat/DTO/StatisticsViewModel.cs | 21 +- .../Service/Stat/IStatisticsService.cs | 9 +- .../Service/Stat/StatisticsService.cs | 12 +- .../Service/Stat/_MapConfig.cs | 6 +- .../DTO/UltrasonicDicomViewModel.cs | 15 +- .../UltrasonicDicomService.cs | 14 +- .../Service/Third-partyProject/_MapConfig.cs | 12 +- .../TrialSiteUser/DTO/DicomAEViewModel.cs | 3 - .../TrialSiteUser/DTO/InspectionViewModel.cs | 7 +- .../DTO/PersonalWorkstationViewModel.cs | 18 +- .../TrialSiteUser/DTO/TrialConfigDTO.cs | 33 +- .../DTO/TrialExternalUserViewModel.cs | 13 +- .../TrialSiteUser/DTO/TrialResearchCenter.cs | 5 +- .../DTO/TrialSiteDicomAEViewModel.cs | 3 - .../TrialSiteUser/DTO/TrialSiteViewModel.cs | 6 +- .../DTO/TrialUserPreparationViewModel.cs | 11 +- .../TrialSiteUser/DTO/TrialViewModel.cs | 30 +- .../TrialSiteUser/DTO/UserTrialViewModel.cs | 8 +- .../Interface/ITrialConfigService.cs | 6 +- .../Interface/ITrialExternalUserService.cs | 26 +- .../Interface/ITrialSiteDicomAEService.cs | 22 +- .../TrialSiteUser/PersonalWorkstation.cs | 99 +- .../TrialSiteUser/TrialConfigService.cs | 36 +- .../TrialSiteUser/TrialDicomAEService.cs | 16 +- .../TrialSiteUser/TrialExternalUserService.cs | 19 +- .../TrialSiteUser/TrialMaintenanceService.cs | 33 +- .../Service/TrialSiteUser/TrialService.cs | 26 +- .../TrialSiteUser/TrialSiteDicomAEService.cs | 15 +- .../Service/TrialSiteUser/TrialSiteService.cs | 45 +- .../Service/TrialSiteUser/_MapConfig.cs | 6 +- .../Service/TrialSiteUser/_MapConfig2.cs | 10 +- .../Visit/DTO/ClinicalStudySubjects.cs | 32 +- .../Service/Visit/DTO/PatientViewModel.cs | 5 +- .../Service/Visit/DTO/VisitPlanViewModel.cs | 3 +- .../Service/Visit/DTO/VisitPointViewModel.cs | 4 +- .../Visit/Interface/IVisitPlanService.cs | 1 - .../Service/Visit/PatientService.cs | 46 +- .../Service/Visit/SubjectService.cs | 24 +- .../Service/Visit/SubjectVisitService.cs | 24 +- .../Service/Visit/VisitPlanService.cs | 40 +- .../Service/Visit/_MapConfig.cs | 24 +- .../WorkLoad/DTO/DoctorWorkLoadViewModel.cs | 13 +- .../Service/WorkLoad/DTO/EnrollViewModel.cs | 17 +- .../WorkLoad/DTO/WorkloadDistribution.cs | 8 +- .../Service/WorkLoad/DoctorWorkloadService.cs | 28 +- .../Service/WorkLoad/EnrollService.cs | 48 +- .../Interface/IDoctorWorkloadService.cs | 2 +- .../WorkLoad/Interface/IEnrollService.cs | 2 +- .../Interface/ITrialEnrollmentService.cs | 14 +- .../Interface/IWorkloadDistributionService.cs | 7 +- .../Service/WorkLoad/_MapConfig.cs | 5 +- IRaCIS.Core.Application/TestService.cs | 21 +- .../Triggers/AddCRCCliniaclDataTrigger.cs | 33 +- .../Triggers/AddSubjectTrigger.cs | 9 +- .../Triggers/AddlTrialUserTrigger.cs | 13 +- .../Triggers/ChallengeStateTrigger.cs | 4 +- .../Triggers/SubjectStateTrigger.cs | 15 +- .../SubjectVisitCheckPassedTrigger.cs | 8 +- .../Triggers/SubjectVisitFinalVisitTrigger.cs | 8 +- .../Triggers/SubjectVisitTrigger.cs | 46 +- .../Triggers/TableQuestionRowTrigger.cs | 9 +- .../Triggers/TrialCriterionSignTrigger.cs | 13 +- .../Triggers/UserLogTrigger.cs | 11 +- .../Triggers/VisitTaskIbeforeTrigger.cs | 10 +- ...askIsFrontTaskNeedSignButNotSignTrigger.cs | 15 +- IRaCIS.Core.Domain.Share/GlobalUsings.cs | 4 + IRaCIS.Core.Domain/GlobalUsings.cs | 1 + IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj | 7 - .../AuthUser/IUserInfo.cs | 14 +- IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs | 7 +- .../Common/AuditingData.cs | 474 +- .../Common/AuditingDto.cs | 8 +- .../Common/ReadingCommon.cs | 46 +- .../Convention/DecimalPrecisionConvention.cs | 8 +- .../DefaultStringLengthConvention .cs | 2 - .../Context/DbContextExt.cs | 6 +- .../Context/IRaCISDBContext.cs | 29 +- .../Context/IRaCISDBContextFactory.cs | 6 - .../MySequentialGuidValueGenerator.cs | 4 +- .../EntityConfigration/SubjectConfigration.cs | 4 +- .../TrialUserConfigration.cs | 1 - .../VisitTaskConfigration.cs | 4 +- IRaCIS.Core.Infra.EFCore/GlobalUsings.cs | 9 + .../Interceptor/AuditEntityInterceptor.cs | 12 +- .../DispatchDomainEventsInterceptor.cs | 16 +- .../QueryWithNoLockDbCommandInterceptor.cs | 5 - .../Interceptor/SoftDeleteQueryExtension.cs | 8 +- .../Repository/DynamicRelationalExtensions.cs | 10 +- .../Repository/ICommandRepository.cs | 10 +- .../Repository/IQueryRepository.cs | 10 +- .../Repository/IRaCISContextExtension.cs | 13 +- .../Repository/IRepository.cs | 18 +- .../Repository/Repository.cs | 26 +- .../UnitOfWork/EFUnitOfWork.cs | 4 +- .../UnitOfWork/EFUnitOfWorkFilter.cs | 9 +- .../GenerateContextModelFolder/Dictionary.cs | 37 - .../GenerateContextModelFolder/TempContext.cs | 46 - .../LiquidTemplate/EntityViewModel.liquid | 32 +- .../LiquidTemplate/IEntityService.liquid | 14 +- .../LiquidTemplateOutPut/DictionaryService.cs | 60 - .../DictionaryViewModel.cs | 76 - .../IDictionaryService.cs | 23 - 408 files changed, 11031 insertions(+), 12556 deletions(-) create mode 100644 IRaCIS.Core.Application/GlobalUsings.cs create mode 100644 IRaCIS.Core.Domain.Share/GlobalUsings.cs create mode 100644 IRaCIS.Core.Infra.EFCore/GlobalUsings.cs delete mode 100644 IRaCIS.Core.Test/GenerateContextModelFolder/Dictionary.cs delete mode 100644 IRaCIS.Core.Test/GenerateContextModelFolder/TempContext.cs delete mode 100644 IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryService.cs delete mode 100644 IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryViewModel.cs delete mode 100644 IRaCIS.Core.Test/LiquidTemplateOutPut/IDictionaryService.cs diff --git a/IRC.Core.SCP/BusinessFilter/UnifiedApiResultFilter.cs b/IRC.Core.SCP/BusinessFilter/UnifiedApiResultFilter.cs index 7609ae4bc..4dffb183c 100644 --- a/IRC.Core.SCP/BusinessFilter/UnifiedApiResultFilter.cs +++ b/IRC.Core.SCP/BusinessFilter/UnifiedApiResultFilter.cs @@ -3,7 +3,7 @@ using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure.Extention; -namespace IRaCIS.Application.Services.BusinessFilter +namespace IRaCIS.Core.Application.Service.BusinessFilter { /// /// 统一返回前端数据包装,之前在控制器包装,现在修改为动态Api 在ResultFilter这里包装,减少重复冗余代码 diff --git a/IRC.Core.SCP/HostConfig/AutofacModuleSetup.cs b/IRC.Core.SCP/HostConfig/AutofacModuleSetup.cs index 629cf9636..717d06fad 100644 --- a/IRC.Core.SCP/HostConfig/AutofacModuleSetup.cs +++ b/IRC.Core.SCP/HostConfig/AutofacModuleSetup.cs @@ -7,7 +7,7 @@ using System.Linq; using System.Reflection; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; -using IRaCIS.Application.Services; +using IRaCIS.Core.Application.Service; using AutoMapper; using IRaCIS.Core.SCP.Service; diff --git a/IRC.Core.SCP/Service/BaseService.cs b/IRC.Core.SCP/Service/BaseService.cs index e1a97e0b9..f410074c3 100644 --- a/IRC.Core.SCP/Service/BaseService.cs +++ b/IRC.Core.SCP/Service/BaseService.cs @@ -1,5 +1,5 @@ using AutoMapper; -using IRaCIS.Application.Services.BusinessFilter; +using IRaCIS.Core.Application.Service.BusinessFilter; using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; diff --git a/IRaCIS.Core.API/Controllers/ExtraController.cs b/IRaCIS.Core.API/Controllers/ExtraController.cs index 203a4fc97..a9ec63b2d 100644 --- a/IRaCIS.Core.API/Controllers/ExtraController.cs +++ b/IRaCIS.Core.API/Controllers/ExtraController.cs @@ -14,7 +14,7 @@ using System.Text; using Microsoft.AspNetCore.Http; using IRaCIS.Core.Application.Interfaces; using System.Threading.Tasks; -using IRaCIS.Application.Services; +using IRaCIS.Core.Application.Service; using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Infrastructure; diff --git a/IRaCIS.Core.API/Controllers/FinancialChangeController.cs b/IRaCIS.Core.API/Controllers/FinancialChangeController.cs index 43f02d674..40ca6fc59 100644 --- a/IRaCIS.Core.API/Controllers/FinancialChangeController.cs +++ b/IRaCIS.Core.API/Controllers/FinancialChangeController.cs @@ -7,7 +7,7 @@ using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Authorization; using System.Threading.Tasks; -using IRaCIS.Application.Services; +using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Domain.Models; diff --git a/IRaCIS.Core.API/Progranm.cs b/IRaCIS.Core.API/Progranm.cs index 5d258c077..c06f45d52 100644 --- a/IRaCIS.Core.API/Progranm.cs +++ b/IRaCIS.Core.API/Progranm.cs @@ -20,7 +20,7 @@ using Microsoft.AspNetCore.SignalR; using Microsoft.Extensions.DependencyInjection; using IRaCIS.Core.Application.Filter; using Microsoft.AspNetCore.HttpOverrides; -using IRaCIS.Application.Services.BackGroundJob; +using IRaCIS.Core.Application.Service.BackGroundJob; using LogDashboard; using FellowOakDicom.Network; using IRaCIS.Core.Application.Service.ImageAndDoc; diff --git a/IRaCIS.Core.API/_PipelineExtensions/HangfireConfig.cs b/IRaCIS.Core.API/_PipelineExtensions/HangfireConfig.cs index 3b9cb8b7a..873aac78f 100644 --- a/IRaCIS.Core.API/_PipelineExtensions/HangfireConfig.cs +++ b/IRaCIS.Core.API/_PipelineExtensions/HangfireConfig.cs @@ -1,7 +1,7 @@ using Hangfire; using Hangfire.Dashboard; using Hangfire.Dashboard.BasicAuthorization; -using IRaCIS.Application.Services.BackGroundJob; +using IRaCIS.Core.Application.Service.BackGroundJob; using IRaCIS.Core.API.Filter; using IRaCIS.Core.Application.Helper; using Microsoft.AspNetCore.Builder; diff --git a/IRaCIS.Core.API/_ServiceExtensions/AutofacModuleSetup.cs b/IRaCIS.Core.API/_ServiceExtensions/AutofacModuleSetup.cs index 3bb3e37fc..d87a1cbed 100644 --- a/IRaCIS.Core.API/_ServiceExtensions/AutofacModuleSetup.cs +++ b/IRaCIS.Core.API/_ServiceExtensions/AutofacModuleSetup.cs @@ -9,7 +9,7 @@ using System.Linq; using System.Reflection; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; -using IRaCIS.Application.Services; +using IRaCIS.Core.Application.Service; using IRaCIS.Application.Interfaces; using AutoMapper; diff --git a/IRaCIS.Core.Application/Auth/IRaCISClaims.cs b/IRaCIS.Core.Application/Auth/IRaCISClaims.cs index 446140787..60e18cf7d 100644 --- a/IRaCIS.Core.Application/Auth/IRaCISClaims.cs +++ b/IRaCIS.Core.Application/Auth/IRaCISClaims.cs @@ -31,9 +31,9 @@ namespace IRaCIS.Core.Application.Auth Id = user.Id, FullName = user.UserName, RealName = user.RealName, - UserTypeEnum=user.UserTypeEnum, - UserTypeId=user.UserTypeId, - IsTestUser=user.IsTestUser, + UserTypeEnum = user.UserTypeEnum, + UserTypeId = user.UserTypeId, + IsTestUser = user.IsTestUser, Code = user.Code, PermissionStr = user.PermissionStr, @@ -46,7 +46,7 @@ namespace IRaCIS.Core.Application.Auth { Id = doctor.Id, FullName = doctor.FirstName + doctor.LastName, - Phone = doctor.Phone, + Phone = doctor.Phone, }; } } diff --git a/IRaCIS.Core.Application/Auth/IRaCISPolicy.cs b/IRaCIS.Core.Application/Auth/IRaCISPolicy.cs index 994cbbc9f..0988866b8 100644 --- a/IRaCIS.Core.Application/Auth/IRaCISPolicy.cs +++ b/IRaCIS.Core.Application/Auth/IRaCISPolicy.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Application.Auth +namespace IRaCIS.Core.Application.Auth { @@ -13,7 +7,7 @@ namespace IRaCIS.Core.Application.Auth - public const string CRC = "CRC"; + public const string CRC = "CRC"; public const string PM = "PM"; diff --git a/IRaCIS.Core.Application/Auth/JwtSetting.cs b/IRaCIS.Core.Application/Auth/JwtSetting.cs index 1987c91bd..cc54eb4d0 100644 --- a/IRaCIS.Core.Application/Auth/JwtSetting.cs +++ b/IRaCIS.Core.Application/Auth/JwtSetting.cs @@ -1,6 +1,5 @@ -using System.Collections.Generic; +using Microsoft.IdentityModel.Tokens; using System.Text; -using Microsoft.IdentityModel.Tokens; namespace IRaCIS.Core.Application.Auth { diff --git a/IRaCIS.Core.Application/Auth/TokenService.cs b/IRaCIS.Core.Application/Auth/TokenService.cs index 4890a0339..365c97e68 100644 --- a/IRaCIS.Core.Application/Auth/TokenService.cs +++ b/IRaCIS.Core.Application/Auth/TokenService.cs @@ -1,7 +1,7 @@ -using System.IdentityModel.Tokens.Jwt; -using System.Security.Claims; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using Microsoft.Extensions.Options; +using System.IdentityModel.Tokens.Jwt; +using System.Security.Claims; namespace IRaCIS.Core.Application.Auth { @@ -56,5 +56,5 @@ namespace IRaCIS.Core.Application.Auth } } - + } diff --git a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs index 7b90329e8..efd823af2 100644 --- a/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/IRaCISCHangfireJob.cs @@ -1,16 +1,10 @@ using Hangfire; using Hangfire.Storage; using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; -using SharpCompress.Common; -using ZiggyCreatures.Caching.Fusion; -namespace IRaCIS.Application.Services.BackGroundJob +namespace IRaCIS.Core.Application.Service.BackGroundJob { public interface IIRaCISHangfireJob diff --git a/IRaCIS.Core.Application/BackGroundJob/ObtainTaskAutoCancelJob.cs b/IRaCIS.Core.Application/BackGroundJob/ObtainTaskAutoCancelJob.cs index ebd091615..41d320e6d 100644 --- a/IRaCIS.Core.Application/BackGroundJob/ObtainTaskAutoCancelJob.cs +++ b/IRaCIS.Core.Application/BackGroundJob/ObtainTaskAutoCancelJob.cs @@ -1,11 +1,10 @@ -using IRaCIS.Core.Infra.EFCore; -using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Logging; namespace IRaCIS.Core.Application.BackGroundJob { public interface IObtainTaskAutoCancelJob { - Task CancelQCObtaion(Guid subjectVisitId,DateTime startTime); + Task CancelQCObtaion(Guid subjectVisitId, DateTime startTime); } public class ObtainTaskAutoCancelJob : IObtainTaskAutoCancelJob @@ -13,7 +12,7 @@ namespace IRaCIS.Core.Application.BackGroundJob private readonly IRepository _subjectVisitRepository; private readonly ILogger _logger; - public ObtainTaskAutoCancelJob(IRepository subjectVisitRepository, ILogger logger) + public ObtainTaskAutoCancelJob(IRepository subjectVisitRepository, ILogger logger) { _subjectVisitRepository = subjectVisitRepository; _logger = logger; @@ -30,7 +29,7 @@ namespace IRaCIS.Core.Application.BackGroundJob var success = await _subjectVisitRepository.SaveChangesAsync(); - _logger.LogWarning($"任务建立时间:{startTime} 取消时间:{DateTime.Now} 取消 受试者访视:{ subjectVisitId }success:{success}"); + _logger.LogWarning($"任务建立时间:{startTime} 取消时间:{DateTime.Now} 取消 受试者访视:{subjectVisitId}success:{success}"); } catch (Exception e) { diff --git a/IRaCIS.Core.Application/BaseService.cs b/IRaCIS.Core.Application/BaseService.cs index a4fe57913..8adf71179 100644 --- a/IRaCIS.Core.Application/BaseService.cs +++ b/IRaCIS.Core.Application/BaseService.cs @@ -1,14 +1,13 @@ using AutoMapper; -using IRaCIS.Application.Services.BusinessFilter; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Core.Application.Service.BusinessFilter; +using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Localization; using Panda.DynamicWebApi; using Panda.DynamicWebApi.Attributes; using System.Diagnostics.CodeAnalysis; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application diff --git a/IRaCIS.Core.Application/BusinessFilter/Encryption/AesEncryption.cs b/IRaCIS.Core.Application/BusinessFilter/Encryption/AesEncryption.cs index 8c17165c8..c19d82cf8 100644 --- a/IRaCIS.Core.Application/BusinessFilter/Encryption/AesEncryption.cs +++ b/IRaCIS.Core.Application/BusinessFilter/Encryption/AesEncryption.cs @@ -1,13 +1,9 @@ -using Org.BouncyCastle.Crypto.Engines; +using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.Crypto.Engines; +using Org.BouncyCastle.Crypto.Modes; using Org.BouncyCastle.Crypto.Paddings; using Org.BouncyCastle.Crypto.Parameters; -using Org.BouncyCastle.Crypto; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; -using Org.BouncyCastle.Crypto.Modes; namespace IRaCIS.Core.Application.BusinessFilter; diff --git a/IRaCIS.Core.Application/BusinessFilter/Encryption/EncreptApiResultFilter.cs b/IRaCIS.Core.Application/BusinessFilter/Encryption/EncreptApiResultFilter.cs index 0ff58ed56..e537af43a 100644 --- a/IRaCIS.Core.Application/BusinessFilter/Encryption/EncreptApiResultFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/Encryption/EncreptApiResultFilter.cs @@ -3,11 +3,7 @@ using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Options; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.BusinessFilter; diff --git a/IRaCIS.Core.Application/BusinessFilter/Encryption/EncryptionRequestMiddleware.cs b/IRaCIS.Core.Application/BusinessFilter/Encryption/EncryptionRequestMiddleware.cs index b23917a09..fdcb0222d 100644 --- a/IRaCIS.Core.Application/BusinessFilter/Encryption/EncryptionRequestMiddleware.cs +++ b/IRaCIS.Core.Application/BusinessFilter/Encryption/EncryptionRequestMiddleware.cs @@ -1,13 +1,8 @@ -using DocumentFormat.OpenXml.InkML; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Options; using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.BusinessFilter; diff --git a/IRaCIS.Core.Application/BusinessFilter/Encryption/RSAEncryption.cs b/IRaCIS.Core.Application/BusinessFilter/Encryption/RSAEncryption.cs index c4bd92d6e..dcc610712 100644 --- a/IRaCIS.Core.Application/BusinessFilter/Encryption/RSAEncryption.cs +++ b/IRaCIS.Core.Application/BusinessFilter/Encryption/RSAEncryption.cs @@ -1,14 +1,10 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Org.BouncyCastle.Crypto; +using Org.BouncyCastle.Crypto; using Org.BouncyCastle.Crypto.Encodings; using Org.BouncyCastle.Crypto.Engines; using Org.BouncyCastle.Crypto.Generators; using Org.BouncyCastle.OpenSsl; using Org.BouncyCastle.Security; +using System.Text; namespace IRaCIS.Core.Application.BusinessFilter; diff --git a/IRaCIS.Core.Application/BusinessFilter/GlobalExceptionHandler.cs b/IRaCIS.Core.Application/BusinessFilter/GlobalExceptionHandler.cs index bdd19c962..b8f82f8d5 100644 --- a/IRaCIS.Core.Application/BusinessFilter/GlobalExceptionHandler.cs +++ b/IRaCIS.Core.Application/BusinessFilter/GlobalExceptionHandler.cs @@ -1,12 +1,6 @@ using Microsoft.AspNetCore.Diagnostics; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.Logging; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.BusinessFilter diff --git a/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs b/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs index fada696d2..ec5ea0863 100644 --- a/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs +++ b/IRaCIS.Core.Application/BusinessFilter/LimitUserRequestAuthorization.cs @@ -1,13 +1,11 @@ using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Authentication; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Localization; using Microsoft.Extensions.Options; -using Newtonsoft.Json; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application.Filter; @@ -25,7 +23,7 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter private readonly IOptionsMonitor _verifyConfig; - public LimitUserRequestAuthorization(IFusionCache fusionCache, IUserInfo userInfo, IStringLocalizer localizer ,IOptionsMonitor verifyConfig) + public LimitUserRequestAuthorization(IFusionCache fusionCache, IUserInfo userInfo, IStringLocalizer localizer, IOptionsMonitor verifyConfig) { _fusionCache = fusionCache; _userInfo = userInfo; @@ -55,7 +53,7 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter { context.HttpContext.Response.ContentType = "application/json"; context.HttpContext.Response.StatusCode = StatusCodes.Status200OK; - //---当前请求未从Header/Url取到用户Token,请联系开发者 + //---当前请求未从Header/Url取到用户Token,请联系开发者 //await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AuthTokenMissing"]))); context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AuthTokenMissing"])); @@ -92,7 +90,7 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter context.HttpContext.Response.ContentType = "application/json"; context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden; - context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountAuto_LoginOut"], ApiResponseCodeEnum.AutoLoginOut)); + context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountAuto_LoginOut"], ApiResponseCodeEnum.AutoLoginOut)); } else { @@ -106,7 +104,7 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter //---您的账户在其他地方已登陆,您被迫下线。 context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace)); - + } } diff --git a/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs b/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs index 79c1788cb..c77dacdfa 100644 --- a/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs +++ b/IRaCIS.Core.Application/BusinessFilter/ModelActionFilter .cs @@ -1,5 +1,4 @@ -using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Localization; using Newtonsoft.Json; @@ -11,14 +10,14 @@ namespace IRaCIS.Core.Application.Filter public class ModelActionFilter : ActionFilterAttribute, IActionFilter { - public IStringLocalizer _localizer; - public ModelActionFilter(IStringLocalizer localizer) + public IStringLocalizer _localizer; + public ModelActionFilter(IStringLocalizer localizer) { - _localizer = localizer; - } + _localizer = localizer; + } - public override void OnActionExecuting(ActionExecutingContext context) - { + public override void OnActionExecuting(ActionExecutingContext context) + { if (!context.ModelState.IsValid) { @@ -27,9 +26,9 @@ namespace IRaCIS.Core.Application.Filter .SelectMany(k => context.ModelState[k]!.Errors) .Select(e => e.ErrorMessage) .ToArray(); - + //---提供给接口的参数无效。 - context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["ModelAction_InvalidAPIParameter"] + JsonConvert.SerializeObject( validationErrors))); + context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["ModelAction_InvalidAPIParameter"] + JsonConvert.SerializeObject(validationErrors))); } } } diff --git a/IRaCIS.Core.Application/BusinessFilter/ModelBinding.cs b/IRaCIS.Core.Application/BusinessFilter/ModelBinding.cs index c04d0ba5f..94187d5d8 100644 --- a/IRaCIS.Core.Application/BusinessFilter/ModelBinding.cs +++ b/IRaCIS.Core.Application/BusinessFilter/ModelBinding.cs @@ -1,4 +1,3 @@ -using System; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.AspNetCore.Mvc.ModelBinding; diff --git a/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs b/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs index 011e9ceae..ce2a978eb 100644 --- a/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/ProjectExceptionFilter.cs @@ -1,6 +1,5 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Localization; diff --git a/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs b/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs index d335a9750..daf59c30f 100644 --- a/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs +++ b/IRaCIS.Core.Application/BusinessFilter/UnifiedApiResultFilter.cs @@ -1,9 +1,9 @@ -using Microsoft.AspNetCore.Mvc.Filters; +using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc.Filters; using Microsoft.Extensions.Logging; -namespace IRaCIS.Application.Services.BusinessFilter +namespace IRaCIS.Core.Application.Service.BusinessFilter { /// /// 统一返回前端数据包装,之前在控制器包装,现在修改为动态Api 在ResultFilter这里包装,减少重复冗余代码 @@ -74,7 +74,7 @@ namespace IRaCIS.Application.Services.BusinessFilter //统一在这里记录国际化的日志信息 _logger.LogWarning($"{result.LocalizedInfo}"); } - + } else if (statusCode != 200 && !(objectResult.Value is IResponseOutput)) diff --git a/IRaCIS.Core.Application/GlobalUsings.cs b/IRaCIS.Core.Application/GlobalUsings.cs new file mode 100644 index 000000000..1183f17bd --- /dev/null +++ b/IRaCIS.Core.Application/GlobalUsings.cs @@ -0,0 +1,12 @@ +global using AutoMapper.QueryableExtensions; +global using IRaCIS.Core.Application; +global using IRaCIS.Core.Application.Service; +global using IRaCIS.Core.Domain.Models; +global using IRaCIS.Core.Infra.EFCore; +global using IRaCIS.Core.Infrastructure.Extention; +global using Microsoft.EntityFrameworkCore; +global using System.Linq.Expressions; + + + + diff --git a/IRaCIS.Core.Application/Helper/Attribute/DictionaryTranslateAttribute.cs b/IRaCIS.Core.Application/Helper/Attribute/DictionaryTranslateAttribute.cs index 459557f18..051b72909 100644 --- a/IRaCIS.Core.Application/Helper/Attribute/DictionaryTranslateAttribute.cs +++ b/IRaCIS.Core.Application/Helper/Attribute/DictionaryTranslateAttribute.cs @@ -1,9 +1,4 @@ using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Helper { @@ -19,9 +14,9 @@ namespace IRaCIS.Core.Application.Helper //是否翻译依赖其他属性 - public bool IsTranslateDenpendOtherProperty =>!string.IsNullOrWhiteSpace(DependPropertyName); + public bool IsTranslateDenpendOtherProperty => !string.IsNullOrWhiteSpace(DependPropertyName); - public string DependPropertyName { get; set; }=string.Empty; + public string DependPropertyName { get; set; } = string.Empty; public string DependPropertyValueStr { get; set; } = string.Empty; @@ -33,7 +28,7 @@ namespace IRaCIS.Core.Application.Helper } //针对不同的标准 翻译的字典不一样 - public DictionaryTranslateAttribute(string dicParentCode, CriterionType criterionType ) + public DictionaryTranslateAttribute(string dicParentCode, CriterionType criterionType) { DicParentCode = dicParentCode; @@ -42,7 +37,7 @@ namespace IRaCIS.Core.Application.Helper //针对业务某个属性的值 不一样 用的翻译字典不一样 - public DictionaryTranslateAttribute(string dicParentCode,string dependPropertyName, string dependPropertyValueStr) + public DictionaryTranslateAttribute(string dicParentCode, string dependPropertyName, string dependPropertyValueStr) { DicParentCode = dicParentCode; diff --git a/IRaCIS.Core.Application/Helper/CacheHelper.cs b/IRaCIS.Core.Application/Helper/CacheHelper.cs index 5fb158ed1..33d9cb9cd 100644 --- a/IRaCIS.Core.Application/Helper/CacheHelper.cs +++ b/IRaCIS.Core.Application/Helper/CacheHelper.cs @@ -1,11 +1,4 @@ -using IRaCIS.Core.Domain.Models; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Application.Helper +namespace IRaCIS.Core.Application.Helper { public static class CacheKeys diff --git a/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs b/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs index f4285471f..4229f1885 100644 --- a/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs +++ b/IRaCIS.Core.Application/Helper/ExcelExportHelper.cs @@ -1,7 +1,4 @@ -using DocumentFormat.OpenXml.Drawing.Diagrams; -using DocumentFormat.OpenXml.Spreadsheet; -using DocumentFormat.OpenXml.Wordprocessing; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; using IRaCIS.Core.Application.Helper; @@ -10,14 +7,9 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; using MiniExcelLibs; using MiniExcelLibs.OpenXml; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using NPOI.HSSF.UserModel; using NPOI.XSSF.UserModel; using System.Collections; -using System.ComponentModel; using System.Globalization; -using System.IO; namespace IRaCIS.Core.Application.Service; @@ -68,7 +60,7 @@ public static class ExcelExportHelper { if (DateTime.TryParse(itemValuePair.Value?.ToString(), out DateTime result)) { - itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result ); + itemDic[itemValuePair.Key] = ExportExcelConverterDate.DateTimeInternationalToString(result); } } diff --git a/IRaCIS.Core.Application/Helper/FileConvertHelper.cs b/IRaCIS.Core.Application/Helper/FileConvertHelper.cs index fa6aa2324..51c3a5f65 100644 --- a/IRaCIS.Core.Application/Helper/FileConvertHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileConvertHelper.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Diagnostics; namespace IRaCIS.Core.Application.Helper { diff --git a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs index ed371698a..bfb4e39d3 100644 --- a/IRaCIS.Core.Application/Helper/FileStoreHelper.cs +++ b/IRaCIS.Core.Application/Helper/FileStoreHelper.cs @@ -1,12 +1,7 @@ - - -using Aliyun.OSS; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Hosting; using Newtonsoft.Json.Linq; -using System.Configuration; using System.Globalization; using System.Text.RegularExpressions; @@ -16,7 +11,7 @@ public static class FileStoreHelper { //处理文件名 压缩包,或者目录类的 会带上相对路径 - public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName,bool isChangeToPdfFormat=false) + public static (string TrustedFileNameForFileStorage, string RealName) GetStoreFileName(string fileName, bool isChangeToPdfFormat = false) { //带目录层级,需要后端处理前端的路径 @@ -41,14 +36,14 @@ public static class FileStoreHelper var trustedFileNameForFileStorage = string.Empty; - if (isChangeToPdfFormat==false) + if (isChangeToPdfFormat == false) { - trustedFileNameForFileStorage= Guid.NewGuid().ToString() + fileName; + trustedFileNameForFileStorage = Guid.NewGuid().ToString() + fileName; } else { - trustedFileNameForFileStorage=Guid.NewGuid().ToString() + Path.GetFileNameWithoutExtension(fileName) + ".pdf"; + trustedFileNameForFileStorage = Guid.NewGuid().ToString() + Path.GetFileNameWithoutExtension(fileName) + ".pdf"; } return (trustedFileNameForFileStorage, fileName); @@ -57,7 +52,7 @@ public static class FileStoreHelper //API vue 部署目录 public static string GetIRaCISRootPath(IWebHostEnvironment _hostEnvironment) { - string parentDirectory = Path.GetFullPath(Path.Combine(_hostEnvironment.ContentRootPath, "..")); + string parentDirectory = Path.GetFullPath(Path.Combine(_hostEnvironment.ContentRootPath, "..")); return parentDirectory; @@ -136,10 +131,10 @@ public static class FileStoreHelper { var doc = await _commonDocumentRepository.FirstOrDefaultAsync(t => t.Code == code); - var isEn_US = CultureInfo.CurrentCulture.Name!= StaticData.CultureInfo.zh_CN; + var isEn_US = CultureInfo.CurrentCulture.Name != StaticData.CultureInfo.zh_CN; if (doc == null) { - //---数据库没有找到对应的数据模板文件,请联系系统运维人员。 + //---数据库没有找到对应的数据模板文件,请联系系统运维人员。 throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileNotFound")); } @@ -147,11 +142,11 @@ public static class FileStoreHelper if (!System.IO.File.Exists(filePath)) { - //---数据模板文件存储路径上未找对应文件,请联系系统运维人员。 + //---数据模板文件存储路径上未找对应文件,请联系系统运维人员。 throw new BusinessValidationFailedException(StaticData.International("FileStore_TemplateFileStoragePathInvalid")); } - return (filePath, isEn_US? doc.Name.Trim('/'): doc.NameCN.Trim('/')); + return (filePath, isEn_US ? doc.Name.Trim('/') : doc.NameCN.Trim('/')); } @@ -202,7 +197,7 @@ public static class FileStoreHelper // 获取 入组确认 PD 进展发送邮件Word|PDF 存放路径 - public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid trialSiteId, Guid subjectId,bool isChangeToPdfFormat=false) + public static (string PhysicalPath, string RelativePath, string FileRealName) GetSubjectEnrollConfirmOrPDEmailPath(IWebHostEnvironment _hostEnvironment, string fileName, Guid trialId, Guid trialSiteId, Guid subjectId, bool isChangeToPdfFormat = false) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); @@ -221,19 +216,19 @@ public static class FileStoreHelper } - public static string GetSubjectVisitDicomFolderPhysicalPath(IWebHostEnvironment _hostEnvironment,Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId) + public static string GetSubjectVisitDicomFolderPhysicalPath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid siteId, Guid subjectId, Guid subjectVisitId) { var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); return Path.Combine(rootPath, StaticData.Folder.TrialDataFolder, trialId.ToString(), siteId.ToString(), subjectId.ToString(), subjectVisitId.ToString(), StaticData.Folder.DicomFolder); } - public static (string PhysicalPath, string RelativePath) GetDicomInstanceFilePath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid subjectId, Guid subjectVisitId, Guid studyId, Guid instanceId) + public static (string PhysicalPath, string RelativePath) GetDicomInstanceFilePath(IWebHostEnvironment _hostEnvironment, Guid trialId, Guid subjectId, Guid subjectVisitId, Guid studyId, Guid instanceId) { #region 切换存储前 //var rootPath = FileStoreHelper.GetIRaCISRootDataFolder(_hostEnvironment); #endregion - var rootPath = Path.Combine(FileStoreHelper.GetBestStoreDisk(_hostEnvironment), StaticData.Folder.IRaCISDataFolder) ; + var rootPath = Path.Combine(FileStoreHelper.GetBestStoreDisk(_hostEnvironment), StaticData.Folder.IRaCISDataFolder); @@ -246,7 +241,7 @@ public static class FileStoreHelper Directory.CreateDirectory(path); } - var physicalPath = Path.Combine(path, instanceId.ToString() ); + var physicalPath = Path.Combine(path, instanceId.ToString()); var relativePath = $"/{StaticData.Folder.IRaCISDataFolder}/{StaticData.Folder.TrialDataFolder}/{trialId}/{subjectId}/{subjectVisitId}/{StaticData.Folder.DicomFolder}/{studyId}/{instanceId}"; @@ -260,7 +255,7 @@ public static class FileStoreHelper public static string GetBestStoreDisk(IWebHostEnvironment _hostEnvironment) { - var json = File.ReadAllText( Path.Combine(_hostEnvironment.ContentRootPath, "appsettings.json")); + var json = File.ReadAllText(Path.Combine(_hostEnvironment.ContentRootPath, "appsettings.json")); JObject jsonObject = (JObject.Parse(json, new JsonLoadSettings() { CommentHandling = CommentHandling.Load })).IfNullThrowException(); @@ -274,7 +269,7 @@ public static class FileStoreHelper { //---解析Json文件配置出现问题 - throw new BusinessValidationFailedException(StaticData.International("SysMon_JsonConfig") + e.Message); + throw new BusinessValidationFailedException(StaticData.International("SysMon_JsonConfig") + e.Message); } //默认存储的路径 @@ -318,7 +313,7 @@ public static class FileStoreHelper - + } diff --git a/IRaCIS.Core.Application/Helper/HangfireJobHelper.cs b/IRaCIS.Core.Application/Helper/HangfireJobHelper.cs index 69eaf410d..7b4d669c3 100644 --- a/IRaCIS.Core.Application/Helper/HangfireJobHelper.cs +++ b/IRaCIS.Core.Application/Helper/HangfireJobHelper.cs @@ -1,15 +1,5 @@ using Hangfire; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Domain.Share; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NPOI.SS.Formula.Functions; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Helper { @@ -65,7 +55,7 @@ namespace IRaCIS.Core.Application.Helper } - public static void AddOrUpdateTrialCronJob (string jobId, Guid trialId, EmailBusinessScenario businessScenario, string emailCron) + public static void AddOrUpdateTrialCronJob(string jobId, Guid trialId, EmailBusinessScenario businessScenario, string emailCron) { switch (businessScenario) @@ -88,5 +78,5 @@ namespace IRaCIS.Core.Application.Helper } } } - + diff --git a/IRaCIS.Core.Application/Helper/HolidayHelper.cs b/IRaCIS.Core.Application/Helper/HolidayHelper.cs index 0e6886d3f..cbd3be004 100644 --- a/IRaCIS.Core.Application/Helper/HolidayHelper.cs +++ b/IRaCIS.Core.Application/Helper/HolidayHelper.cs @@ -1,9 +1,4 @@ using RestSharp; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Helper { diff --git a/IRaCIS.Core.Application/Helper/IRCEmailPasswordHelper.cs b/IRaCIS.Core.Application/Helper/IRCEmailPasswordHelper.cs index 64ec7309f..a2c23c1bd 100644 --- a/IRaCIS.Core.Application/Helper/IRCEmailPasswordHelper.cs +++ b/IRaCIS.Core.Application/Helper/IRCEmailPasswordHelper.cs @@ -1,11 +1,4 @@ -using NPOI.SS.Formula.Functions; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Application.Helper +namespace IRaCIS.Core.Application.Helper { public static class IRCEmailPasswordHelper { diff --git a/IRaCIS.Core.Application/Helper/ImageHelper.cs b/IRaCIS.Core.Application/Helper/ImageHelper.cs index 50f0ab4f6..293511f2d 100644 --- a/IRaCIS.Core.Application/Helper/ImageHelper.cs +++ b/IRaCIS.Core.Application/Helper/ImageHelper.cs @@ -1,10 +1,8 @@  using FellowOakDicom.Imaging; -using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp; +using SixLabors.ImageSharp.Formats.Jpeg; using SixLabors.ImageSharp.Processing; -using System.Security.Cryptography; -using System.Text; namespace IRaCIS.Core.Application.Helper; diff --git a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs index 910f35e14..390210a11 100644 --- a/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs +++ b/IRaCIS.Core.Application/Helper/InternationalizationHelper.cs @@ -4,12 +4,6 @@ using IRaCIS.Core.Infrastructure; using Microsoft.Extensions.Configuration; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using static IRaCIS.Core.Application.Service.Common.SystemMonitor; namespace IRaCIS.Core.Application.Helper { @@ -56,7 +50,7 @@ namespace IRaCIS.Core.Application.Helper //日志记录该信息方便自己人看, 返回给客户的是配置的 StaticData.Log_Locoalize_Dic[item.Code] = item.Description; - } + } } else { @@ -65,7 +59,7 @@ namespace IRaCIS.Core.Application.Helper jsonObject[item.Code] = item.Value; StaticData.Zh_CN_Dic[item.Code] = item.Value; - } + } } @@ -74,7 +68,7 @@ namespace IRaCIS.Core.Application.Helper } } - public static async Task AddOrUpdateJsonKeyValueAsync(string key, string value, string valueCN,string description) + public static async Task AddOrUpdateJsonKeyValueAsync(string key, string value, string valueCN, string description) { VerifyFolder(); diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index 76ed3c248..1239cded2 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -1,34 +1,19 @@ -using Aliyun.OSS; -using IRaCIS.Core.Infrastructure; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Options; -using Minio.DataModel.Args; -using Minio; -using SharpCompress.Common; -using System; -using System.Collections.Generic; -using System.Drawing; -using System.IO; -using System.Linq; -using System.Security.AccessControl; -using System.Text; -using System.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Text.Json.Serialization; -using Minio.ApiEndpoints; -using System.Reactive.Linq; -using IRaCIS.Core.Domain.Share; -using static MassTransit.ValidationResultExtensions; -using IRaCIS.Core.Infrastructure.NewtonsoftJson; +using AlibabaCloud.SDK.Sts20150401; +using Aliyun.OSS; +using Amazon; using Amazon.Runtime; using Amazon.S3; using Amazon.S3.Model; -using MassTransit.Caching.Internals; -using MassTransit; -using AlibabaCloud.SDK.Sts20150401; using Amazon.SecurityToken; using Amazon.SecurityToken.Model; -using Amazon; +using IRaCIS.Core.Infrastructure; +using IRaCIS.Core.Infrastructure.NewtonsoftJson; +using MassTransit; +using Microsoft.Extensions.Options; +using Minio; +using Minio.DataModel.Args; +using System.Reactive.Linq; +using System.Runtime.InteropServices; namespace IRaCIS.Core.Application.Helper { @@ -160,7 +145,7 @@ namespace IRaCIS.Core.Application.Helper public Task DeleteFromPrefix(string prefix); - public Task GetObjectStoreTempToken(); + public Task GetObjectStoreTempToken(); } @@ -236,7 +221,7 @@ namespace IRaCIS.Core.Application.Helper { var awsConfig = ObjectStoreServiceOptions.AWS; - var credentials = new SessionAWSCredentials( AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken); + var credentials = new SessionAWSCredentials(AWSTempToken.AccessKeyId, AWSTempToken.SecretAccessKey, AWSTempToken.SessionToken); @@ -244,7 +229,7 @@ namespace IRaCIS.Core.Application.Helper var clientConfig = new AmazonS3Config { RegionEndpoint = RegionEndpoint.USEast1, - UseHttp =true, + UseHttp = true, }; var amazonS3Client = new AmazonS3Client(credentials, clientConfig); @@ -722,7 +707,7 @@ namespace IRaCIS.Core.Application.Helper }; - AliyunOSSTempToken=tempToken; + AliyunOSSTempToken = tempToken; return new ObjectStoreDTO() { ObjectStoreUse = ObjectStoreServiceOptions.ObjectStoreUse, AliyunOSS = tempToken }; } diff --git a/IRaCIS.Core.Application/Helper/SendEmailHelper.cs b/IRaCIS.Core.Application/Helper/SendEmailHelper.cs index 7a223b275..c424a0814 100644 --- a/IRaCIS.Core.Application/Helper/SendEmailHelper.cs +++ b/IRaCIS.Core.Application/Helper/SendEmailHelper.cs @@ -1,9 +1,7 @@ -using DocumentFormat.OpenXml.Spreadsheet; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using MailKit; using MailKit.Security; using MimeKit; -using NPOI.HPSF; namespace IRaCIS.Core.Application.Helper; @@ -44,7 +42,7 @@ public static class SendEmailHelper { //---邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员 - throw new Exception(StaticData.International("SendEmail_SendFail"),new Exception(ex.Message)); + throw new Exception(StaticData.International("SendEmail_SendFail"), new Exception(ex.Message)); } @@ -64,7 +62,7 @@ public static class SendEmailHelper await client.DisconnectAsync(true); } } - + return true; } diff --git a/IRaCIS.Core.Application/Helper/WordTempleteHelper.cs b/IRaCIS.Core.Application/Helper/WordTempleteHelper.cs index 9f605be81..7fc34987b 100644 --- a/IRaCIS.Core.Application/Helper/WordTempleteHelper.cs +++ b/IRaCIS.Core.Application/Helper/WordTempleteHelper.cs @@ -1,11 +1,6 @@ using IRaCIS.Core.Domain.Share; using NPOI.XWPF.UserModel; -using System; -using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Xceed.Document.NET; using Xceed.Words.NET; diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj index 9faf0ffec..bf0e815b4 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.csproj @@ -19,21 +19,6 @@ - - - - - - - - - - - - - - - diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index a645900c5..217a59fc9 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -29,103 +29,20 @@ 签名 - + - 测试加密API 返回的结果 + 统一返回前端数据包装,之前在控制器包装,现在修改为动态Api 在ResultFilter这里包装,减少重复冗余代码 + by zhouhang 2021.09.12 周末 - + - https://www.cnblogs.com/NBDWDYS2214143926/p/13329231.html + 异步版本 - - - - RSA解密 - - 私钥 - 待解密的字符串(Base64) - 解密后的字符串 - - - - - 不生效,不知道为啥 - - - - - 主要为了 处理项目结束 锁库,不允许操作 - - - - - 跳过阅片 - - + + - - - 开始阅片时间 - - - - - - - 开始休息时间 - - - - - - - 写文件导到磁盘 - - 流 - 文件保存路径 - - - - - github 链接:https://github.com/lanceliao/china-holiday-calender?tab=readme-ov-file  - 接口请求参考文档:https://www.koudingke.cn/docs/zh-Hans/net-lib-docs/latest/RestSharp/Usage/Usage - - - - - - oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder - - - - - - - - - - oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder - - - - - - - - - - 删除某个目录的文件 - - - - - - - 利用DocX 库 处理word国际化模板 - - 分配规则 @@ -818,6 +735,122 @@ + + + 数据字典-基础数据维护 + + + + + 数据字典-基础数据维护 + + + + + 添加bool + + + + + + + 获取所有字典的Key + + + + + + 添加字典 的同时 一起添加子项 --New + + + + + + + New 查询条件 + + + + + + + 添加和编辑 + + + + + + + 获取子项数组 + + + + + + 删除字典数据 + + + + 传递父亲 code 字符串 数组 返回多个下拉框数据 + + + + + + + 根据父亲Code 获取单个下拉框数据 + + + + + + + 根据父亲字典分组 获取子项 + + + + + + + 获取标准字典 + + + + + + 获取标准字典 + + + + + + 获取标准指定字典 + + + + + + + 获取所有下拉框 枚举 bool 数据 + + + + + + 获取是和否 + + + + + + + 获取审核状态 + + + + + + ExploreRecommendService @@ -828,6 +861,21 @@ ExploreRecommendService + + + 打包医生官方简历 + + + + + + + + 打包医生的所有附件 + + + + InternationalizationService @@ -871,6 +919,14 @@ + + + Reviewer简历录入 发送验证码 + + + + + PublishLogService @@ -881,6 +937,221 @@ PublishLogService + + + 医生文档关联关系维护 + + + + + 医生文档关联关系维护 + + + + + 删除附件 + + + + + + + 根据医生Id 和 附件类型,获取记录 + + 医生Id + 附件类型 + + + + + 获取单个医生的多种证书附件 + + 医生Id + 类型数组 + + + + + 根据医生Id获取医生附件 + + 医生Id + + + + + 保存多个附件 + + + + + + + 将简历设置为官方简历 + + + + + + + + + 设置简历的语言类型 + + + + 0-未设置,1-中文,2-英文 + + + + + Reviewer列表分页查询 + + + + + 获取可筛选筛选及已经筛选的医生列表 + + + + + 获取提交CRO或者CRO审核的Reviewer列表 + + + 根据状态获取医生列表,入组 相关接口 (提交CRO-1) CRO确认-4 + + + + + 获取项目下医生入组状态列表[Confirmation] + + + + + 添加/更新 医生基本信息 BasicInfo + + + + + 详情、编辑-获取 医生基本信息 BasicInfo + + ReviewerID + + + + + 详情、编辑-获取医生工作信息 Employment + + + + + 添加修改医生标准文件 + + + + + + + 删除医生标准文件 + + + + + + + 获取医生标准文件 + + + + + + + 获取医生入组信息 正在提交的数量 已同意入组项目个数 正在读的 + + + + + Get Statement of Work list.[New] + + + + + Get Ack Statement of Work[New] + + + + + 根据医生Id获取医生教育经历和继续学习经历列表 + + + + + 新增医生教育经历 + + + + + + 添加/更新医生继续学习经历 + + + + 删除医生继续学习经历 + + 医生Id + + + + + 查询-医生科学研究信息 + + 医生Id + + + + + 根据医生Id,获取临床试验经历 界面所有数据 + + + + 添加或更新医生临床经验列表项 + + + + 删除临床经验 + + + + + 更新-GCP和其他临床经验 + + + + + + + 更新其他技能经验 + + + + + 添加休假时间段 + + Status不传 + + + + + 删除休假时间段 + + 记录Id + + + + + 获取休假时间段列表 + + + 影像质控 @@ -991,6 +1262,162 @@ + + + 获取某个月下的某些医生最终确认的工作量,用于计算月度费用 + + + + + 计算月度费用,并调用AddOrUpdateMonthlyPayment和AddOrUpdateMonthlyPaymentDetail方法, + 将费用计算的月度数据及详情保存 + + + + + 保存费用计算的月度数据 + + + + + 保存费用计算的月度详情 + + + + + 获取待计算费用的Reviewer对应的月份列表 + + + + + 查询Reviewer某个月的费用是否被锁定 + + + + + 根据记录Id,删除汇率记录 + + 汇率记录Id + + + + Financials /MonthlyPayment 列表查询接口 + + + + + Financials /MonthlyPaymentDetail 详情查询接口 + + + + + NEW 导出Excel压缩包 数据获取 + + + + + Financials / Payment History 列表查询接口(已经支付锁定的数据,包含调整的)[New] + + + + + Financials / Payment History 详情接口[New] + + + + + Revenues列表接口,收入统计[New] 0是Detail 1是按照项目 2是按照人 3按照月份 + + + + + 收入支出分析接口,按照项目维度分析统计 + + + + + 收入支出分析接口,按照医生维度分析统计 + + + + + 获取劳务费用列表 + + + + + 锁定医生费用,锁定后,无法变更该医生对应月份的费用和工作量[New] + + + + + 添加或更新费用调整[AUTH] + + + + + 删除费用调整记录 + + + + + 获取费用调整列表 + + + + + 获取职称单价列表 + + + + + 获取医生支付信息列表 + + + + + 根据医生Id获取支付信息 + + 医生Id + + + + + 根据rankId 获取ReviewerId,用于当Rank的单价信息改变时,触发费用计算 + + + + + + + 添加或更新项目支付价格信息 + + + + + 获取项目支付价格信息列表 + + + + + 获取项目收入费用信息列表[New] + + + + + 批量添加或更新奖励费用单价 + + + + + 获取所有奖励单价列表-用于计算时,一次性获取所有 + + + + + 分页获取奖励单价列表 + + 受试者随机阅片,任务进行随机编号 @@ -1515,6 +1942,85 @@ + + 分页获取CRO列表 + + + 根据CRO 名称查询所有CRO 列表 + + + 添加CRO信息 + + + 删除CRO信息 + + + 获取所有医院列表 + + + 添加医院 + + + 删除医院信息 + + + 分页获取医院列表 + + + 分页获取研究中心列表 + + + 添加研究中心 + + + 删除研究中心 + + + 分页获取申办方列表 + + + 分页获取申办方列表 + + + 添加申办方 + + + 删除申办方 + + + + 添加菜单 New + + + + + + + 删除菜单 已验证 父节点不允许删除 New + + + + + + + 所有的菜单树 包括禁用的 New + + + + + + 菜单列表 参数都是可传的 根据需要传递 New + + + + + + + 获取某用户类型(角色) 菜单树 勾选情况 New + + + + SystemNoticeService @@ -1548,6 +2054,114 @@ + + 发送验证码 修改邮箱(已经登陆修改) New + + + + 重置密码为 默认密码 + + + + + + + 重置密码发邮件 (未登陆修改) + + + + + + + 验证验证码,没问题就返回用户所有的账户 + + + + + + + + + (未登陆) 设置新密码 + + + + + + + + 修改密码,当前支持旧密码修改密码 + + + + + + 获取用户列表 + + + + + + + 根据用户Id获取用户详细信息[New] + + + xiuga + + + + 添加用户 + + + + + + + 更新用户 + + + + + + + 删除用户 + + + + + + + 禁用或者启用账户 + + + + + + + + 发送MFA 验证邮件 + + + + + + + + 验证MFA 邮件 + + + + + + + + + 用户登陆 + + + + + 验证CRC 是否已提交 已提交 就不允许进行任何操作,如果是IQC 那么还验证是否是当前任务领取人 @@ -4394,6 +5008,80 @@ + + + 临床数据配置 + + + + + 临床数据配置 + + + + + 应用系统临床数据 + + + + + + + + 应用项目临床数据 + + + + + + + + 新增或者修改(系统) + + + + + + + 获取系统临床数据(系统) + + + + + + 删除(系统) + + + + + + + 新增或者修改(项目) + + + + + + + 获取项目的临床数据 + + + + + + + 删除(项目) + + + + + + + 将系统配置添加到项目配置 + + + + 临床数据问题 @@ -4575,6 +5263,118 @@ + + + 阅片临床数据 + + + + + 阅片临床数据 + + + + + 新增或者修改 + + + + + + + 删除 + + + + + + + 获取检查类型临床数据 + + + + + + + 获取CRC上传的文件 + + + + + + + 添加CRC数据类型 + + + + + + 影像阅片临床数据签名 + + + + + 获取下拉菜单 + + + + + + + 获取访视 阅片或任务临床数据 + + + + + + + 获取阅片临床数据列表 + + + + + + + 获取阅片临床数据列表 (在任务列表) + + + + + + + 新增或修改一致性分析临床数据 + + + + + + + 一致性分析临床数据签名 + + + + + + + 一致性分析临床数据签名完设置任务为有效 + + + + + + + 获取单个阅片临床数据的所有文件 + + + + + + + 删除PDF单个文件 + + + + 上传角色 @@ -10237,12 +11037,892 @@ + + + 阅片问题.标准 + + + + + 阅片问题.标准 + + + + + 获取自定义表格问题预览 + + + + + + 获取问题 + + + + + + + 获取表格问题 + + + + + + + 获取系统问题分组 + + + + + + + 获取系统问题 + + + + + + 获取系统标准的其他问题 + + + + + + + 新增修改系统问题 + + + + + + + 删除系统问题 + + + + + + + 获取系统的表格问题 + + + + + + + 获取系统表格其他问题 + + + + + + + 新增修改系统表格问题 + + + + + + 删除系统表格问题 + + + + + + + 新增修改项目问题(项目) + + + + + + + 获取项目问题(项目) + + + + + + 验证计算关系 + + + + + + + + + + 获取问题计算关系 + + + + + + + 获取项目标准的其他问题(项目) + + + + + + + 删除项目问题(项目) + + + + + + + 获取项目问题分组 + + + + + + + 获取项目的表格问题 + + + + + + + 获取项目表格其他问题 + + + + + + + 新增修改想想项目表格问题 + + + + + + + 删除项目表格问题 + + + + + + + 复制一个系统标准到另一系统标准 + + + + + + + + 同步系统标准 + + + + + + + 同步标准到项目新(2022-08-10) + + + + + + + 验证是否要同步标准 + + + + + + + 添加系统数据到项目里面 + + + 获取疗效对照 + + + 全局阅片 + + + IR影像阅片 + + + 裁判 + + + 非Dicom + + + 肿瘤学 + + + 问题 + + + + + 提交全局阅片结果 + + + + + + + 批量提交全局阅片信息 + + + + + + + 保存全局阅片结果 + + + + + + + 获取全局阅片信息 + + + + + + + IR影像阅片 + + + + + 获取阅片的计算数据 + + + + + + + 获取既往病灶的OtherPicture + + + + + + + 提交自定义标记 + + + + + + + 删除自定义标记 + + + + + + + 获取自定义标记 + + + + + + + 获取手册 + + + + + + + 获取任务附加问题 + + + + + + + 提交附加问题 + + + + + + + 维护任务关系 + + + + + + 修改计算问题 + + + + + + + 阅读临床数据 + + + + + + + 添加默认值到任务里面 + + + + + + 根据任务ID获取ReadingTool + + + + + + + 获取关联的阅片任务 + + + + + + + 获取既往任务名称和编号 + + + + + + 获取阅片的受试者信息 + + + + + + + 验证是否为基线访视任务 + + + + + + + + 验证任务是否签名 + + + + + + + + 获取DIcom阅片问题答案 + + + + + + + 获取阅片外层问题 + + + + + + + + + + 获取阅片报告 + + + + + + + 获取表格答案行信息 + + + + (QuestionId) 可为空 + + + + + + 获取表格问题及答案(2022-08-26) + + + + + + + 获取自定义问题以及答案 + + + + + + + 获取表格问题及答案 只返回表格问题(任务和标准) + + + + + + + 获取子元素 + + + + + + + + + + + + + + + 拆分病灶 分裂病灶 + + + + + + 合并病灶 融合 + + + + + + 获取可合并的病灶 + + + + + + + 保存影像质量 + + + + + + + 保存任务问题 带动态稽查参数 + + + 请求类型 + + + + + 修改肿瘤学评估结果 + + + + + + + 删除表格行数据 + + + + + + + 提交表格问题答案 提交病灶 保存病灶 + + + + + + + 提交Dicom阅片信息 + + + + + + + 验证默认问题是否回答 + + + + + + + + 验证访视提交 + + + + + + + 清除跳过阅片的缓存 + + + + + + 设置跳过阅片的缓存 + + + + + + + 获取下一个阅片任务 + + + + + + + 重置阅片任务 + + + + + + + 验证阅片休息时间 + + + + + + 重置阅片时间 登录和解锁调用 + + + + + + 签名提交任务修改状态 + + + + + + + 签名时创建任务关联 + + + + + + 阅片期 -全局和肿瘤学任务的生成 + + + + + + 获取项目标准的裁判问题 + + + + + + + 设置裁判问题的答案分组 + + + + + + + 获取裁判阅片任务信息 + + + + + + 保存裁判问题 + + + + + + + 提交裁判问题 + + + + + + + 判断任务是否是全局访视任务 + + + + + + 触发裁判任务(新) + + + + + + + 计算返回的结果 为True表示不相等 + + + + + + + 添加裁判任务 + + + + + + 提交访视阅片问题 + + + + + + + 保存任务问题 + + + + + + + 获取阅片非Dicom文件 + + + + + + + 获取肿瘤学任务信息 + + + + + + + + 修改肿瘤学阅片信息 + + + + + + + 添加肿瘤学阅片任务 其实这里无非是要判断临床数据是否签名 但是对于添加新的阅片期 其实没有临床数据 可以走之前的逻辑 + + + + + + 提交肿瘤阅片结果 + + + + + + + 获取项目已确认的标准 + + + + + + + 获取项目的阅片问题ECRF预览 + + + SinglePage 单页 + + MultiPage 多页 + + PublicPage 公共 + + + + + + + 项目配置的阅片问题(不包含表格问题) 以及配置的分页 和任务对应的答案 一维表 -- 非dicom 阅片 + + + + + + + + 找子问题 + + + + + + + + 获取系统的阅片问题 + + + + + + + 获取系统 + + + + + + + + 阅片期配置 + + + + + 阅片期配置 + + + + + 新增或者修改 (增加标准搜索,已修改) + + + + + + + 删除 + + + + + + + 设置阅片期配置是否生效 (增加标准搜索,已修改) + + + + + + + 获取选中的计划 (增加标准不影响 因为阅片期设置关联了标准) + + + + + + + 添加对应的阅片计划 (后续生效将计划变为模块) (增加标准不影响 因为阅片期设置关联了标准) + + + + + + + 分页获取 (增加标准搜索,已修改) + + + + + + + 获取单条 + + + + + + + 获取阅片期配置的截至访视的下拉框 (增加标准搜索,已修改) + + + + + + + 获取影像阅片的预览 // 需要清除之前已经选中的 (增加标准搜索,已修改) + + + + + + 生成的阅片模块(在大列表上展示的) 阅片期 + + + + + 生成的阅片模块(在大列表上展示的) 阅片期 + + + + + 获取修改截止访视下拉 + + + + + + + 修改全局阅片截止访视 + + + + + + + 用ef 实现之前视图的功能 + + + + + + + 获取单条详情信息 + + + + + + + 添加阅片的时候 获取访视 //标准参数必传 + + + + + + + 添加阅片期 + + + + + + + 删除 + + + + 快捷键服务 @@ -10323,6 +12003,49 @@ + + + Dashboard统计、全局工作量统计、入组两个维度统计(按照项目、按照人) + + + + + Dashboard统计、全局工作量统计、入组两个维度统计(按照项目、按照人) + + + + 根据项目和医生,分页获取工作量统计[New] + + + 项目入组 医生维度统计[New] + + + 用户参与项目 统计[New] + + + 用户参与项目 列表[New] + + + 读片数分类统计[New] + + + 获取最近几个月份的数据[New] + + + 读片数量排行前几的数据[New] + + + 按Rank统计Reviewer 数量[New] + + + 最近几个季度入组人次[New] type==0 按照月份 + + + 参与项目数排行 [New] + + + 最新工作量 (已确定的)[New] + 项目列表 @@ -10404,7 +12127,7 @@ 项目外部人员 录入流程相关 - + 项目外部人员 录入流程相关 @@ -10416,6 +12139,71 @@ + + + Setting页面 获取项目参与人员列表 + + + + + + Setting页面 为 site 勾选CRC用户列表 + + + Setting页面 项目参与人员勾选列表 + + + + Setting页面 批量添加项目参与人员 + + + + + + 项目参与人员退出 其中IQC退出 回去释放工作量 + + + + 分页获取临床项目列表 默认后台加急状态为3 查所有的 + + + + + + + 获取项目基本信息 + + + + + + + 添加项目 + + + + + + 真删除项目 方便清理测试数据 + 临床试验项目Id + + + + 根据项目Id 获取医生Id,用于触发计算费用 + + + + 分页获取医生参与的临床实验项目列表(查询条件) + + + + + 医生确认入组或拒绝入组 + + 项目Id + 9-拒绝入组,10-确认入组 + + TrialSiteDicomAEService @@ -10426,6 +12214,300 @@ TrialSiteDicomAEService + + + scp 影像推送记录表 + + + + + + + 影像检查列表-患者为维度组织 + + + + + + + 影像检查列表-> 获取患者的检查列表 + + + + + + + 影像访视上传 检查列表 + + + + + + + 提交 患者检查和访视的绑定 + + + + + + + + + + 添加或更新受试者信息[New] + + state:1-访视中,2-出组。0-全部 + + + + 分页获取受试者列表[New] + /// state:1-访视中,2-出组。0-全部 + + + + 计划外访视 获取受试者选择下拉框列表 + + + + 暂时不用 + 获取项目访视计划 + + + 根据项目Id,获取项目访视计划(不分页)[New] + + + + 获取访视计划下拉框列表 + + + + + + 添加或更新访视计划某项 + + + 删除项目计划某一项 废弃 + + + + 修改项目医生的阅片类型 + + + + + + + 修改项目医生启用禁用状态 + + + + + + + 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判 + + + + + + 获取某个项目入组的医生工作量统计列表 + + + + + 获取入组某个项目的医生的最近几个月的工作量详情(带有填充数据) + + + + + 获取来自Reviewer自己的数据,某个月添加的多条 + + + + + 工作量是否存在,用于判断只能添加一条的工作量记录 + + + 查询某个医生是否在某天有某个项目的工作量数据,处理添加来自医生自己的工作量数据 + + + + + 添加或更新工作量 + + + + + 删除工作量 + + + + + 获取工作量详情(用于判断工作量锁定时,调用) + + + + + 添加或更新项目医生项目价格 + + + + + 获取医生项目列表 + + + + + + 为项目筛选医生 提交 【select】 + 项目Id + 医生Id数组 + + + + + 入组流程-向CRO提交医生[Submit] + + + + + 入组流程-CRO确定医生名单 [ Approve] + + + + + 入组流程-后台确认医生入组[Confirm] + + + + + optType 0表示入组,列表没这条数据了, 1表示出组,需要填写出组时间 废弃 + + + + + + + + + + 清理一致性分析任务 + + + + + + + + + + 维护临床数据 --一定要在同步表前同步数据才行 + + + + + + 维护OSS 影像数据 + + + + + + 测试加密API 返回的结果 + + + + + https://www.cnblogs.com/NBDWDYS2214143926/p/13329231.html + + + + + RSA解密 + + 私钥 + 待解密的字符串(Base64) + 解密后的字符串 + + + + + 不生效,不知道为啥 + + + + + 主要为了 处理项目结束 锁库,不允许操作 + + + + + 跳过阅片 + + + + + + + 开始阅片时间 + + + + + + + 开始休息时间 + + + + + + + 写文件导到磁盘 + + 流 + 文件保存路径 + + + + + github 链接:https://github.com/lanceliao/china-holiday-calender?tab=readme-ov-file  + 接口请求参考文档:https://www.koudingke.cn/docs/zh-Hans/net-lib-docs/latest/RestSharp/Usage/Usage + + + + + + oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder + + + + + + + + + + oosFolderPath 不要 "/ "开头 应该: TempFolder/ChildFolder + + + + + + + + + + 删除某个目录的文件 + + + + + + + 利用DocX 库 处理word国际化模板 + + 构造函数注入 @@ -12292,7 +14374,7 @@ TrialSiteSurveyService - + TrialSiteSurveyService @@ -12366,7 +14448,7 @@ - + 驳回 New @@ -13966,2088 +16048,6 @@ 维护 IsFrontTaskNeedSignButNotSign 字段 另外附加评估结果 - - - 统一返回前端数据包装,之前在控制器包装,现在修改为动态Api 在ResultFilter这里包装,减少重复冗余代码 - by zhouhang 2021.09.12 周末 - - - - - 异步版本 - - - - - - - - 数据字典-基础数据维护 - - - - - 数据字典-基础数据维护 - - - - - 添加bool - - - - - - - 获取所有字典的Key - - - - - - 添加字典 的同时 一起添加子项 --New - - - - - - - New 查询条件 - - - - - - - 添加和编辑 - - - - - - - 获取子项数组 - - - - - - 删除字典数据 - - - - 传递父亲 code 字符串 数组 返回多个下拉框数据 - - - - - - - 根据父亲Code 获取单个下拉框数据 - - - - - - - 根据父亲字典分组 获取子项 - - - - - - - 获取标准字典 - - - - - - 获取标准字典 - - - - - - 获取标准指定字典 - - - - - - - 获取所有下拉框 枚举 bool 数据 - - - - - - 获取是和否 - - - - - - - 获取审核状态 - - - - - - - - - 打包医生官方简历 - - - - - - - - 打包医生的所有附件 - - - - - - - Reviewer简历录入 发送验证码 - - - - - - - - 医生文档关联关系维护 - - - - - 医生文档关联关系维护 - - - - - 删除附件 - - - - - - - 根据医生Id 和 附件类型,获取记录 - - 医生Id - 附件类型 - - - - - 获取单个医生的多种证书附件 - - 医生Id - 类型数组 - - - - - 根据医生Id获取医生附件 - - 医生Id - - - - - 保存多个附件 - - - - - - - 将简历设置为官方简历 - - - - - - - - - 设置简历的语言类型 - - - - 0-未设置,1-中文,2-英文 - - - - - Reviewer列表分页查询 - - - - - 获取可筛选筛选及已经筛选的医生列表 - - - - - 获取提交CRO或者CRO审核的Reviewer列表 - - - 根据状态获取医生列表,入组 相关接口 (提交CRO-1) CRO确认-4 - - - - - 获取项目下医生入组状态列表[Confirmation] - - - - - 添加/更新 医生基本信息 BasicInfo - - - - - 详情、编辑-获取 医生基本信息 BasicInfo - - ReviewerID - - - - - 详情、编辑-获取医生工作信息 Employment - - - - - 添加修改医生标准文件 - - - - - - - 删除医生标准文件 - - - - - - - 获取医生标准文件 - - - - - - - 获取医生入组信息 正在提交的数量 已同意入组项目个数 正在读的 - - - - - Get Statement of Work list.[New] - - - - - Get Ack Statement of Work[New] - - - - - 根据医生Id获取医生教育经历和继续学习经历列表 - - - - - 新增医生教育经历 - - - - - - 添加/更新医生继续学习经历 - - - - 删除医生继续学习经历 - - 医生Id - - - - - 查询-医生科学研究信息 - - 医生Id - - - - - 根据医生Id,获取临床试验经历 界面所有数据 - - - - 添加或更新医生临床经验列表项 - - - - 删除临床经验 - - - - - 更新-GCP和其他临床经验 - - - - - - - 更新其他技能经验 - - - - - 添加休假时间段 - - Status不传 - - - - - 删除休假时间段 - - 记录Id - - - - - 获取休假时间段列表 - - - - - - 获取某个月下的某些医生最终确认的工作量,用于计算月度费用 - - - - - 计算月度费用,并调用AddOrUpdateMonthlyPayment和AddOrUpdateMonthlyPaymentDetail方法, - 将费用计算的月度数据及详情保存 - - - - - 保存费用计算的月度数据 - - - - - 保存费用计算的月度详情 - - - - - 获取待计算费用的Reviewer对应的月份列表 - - - - - 查询Reviewer某个月的费用是否被锁定 - - - - - 根据记录Id,删除汇率记录 - - 汇率记录Id - - - - Financials /MonthlyPayment 列表查询接口 - - - - - Financials /MonthlyPaymentDetail 详情查询接口 - - - - - NEW 导出Excel压缩包 数据获取 - - - - - Financials / Payment History 列表查询接口(已经支付锁定的数据,包含调整的)[New] - - - - - Financials / Payment History 详情接口[New] - - - - - Revenues列表接口,收入统计[New] 0是Detail 1是按照项目 2是按照人 3按照月份 - - - - - 收入支出分析接口,按照项目维度分析统计 - - - - - 收入支出分析接口,按照医生维度分析统计 - - - - - 获取劳务费用列表 - - - - - 锁定医生费用,锁定后,无法变更该医生对应月份的费用和工作量[New] - - - - - 添加或更新费用调整[AUTH] - - - - - 删除费用调整记录 - - - - - 获取费用调整列表 - - - - - 获取职称单价列表 - - - - - 获取医生支付信息列表 - - - - - 根据医生Id获取支付信息 - - 医生Id - - - - - 根据rankId 获取ReviewerId,用于当Rank的单价信息改变时,触发费用计算 - - - - - - - 添加或更新项目支付价格信息 - - - - - 获取项目支付价格信息列表 - - - - - 获取项目收入费用信息列表[New] - - - - - 批量添加或更新奖励费用单价 - - - - - 获取所有奖励单价列表-用于计算时,一次性获取所有 - - - - - 分页获取奖励单价列表 - - - - 分页获取CRO列表 - - - 根据CRO 名称查询所有CRO 列表 - - - 添加CRO信息 - - - 删除CRO信息 - - - 获取所有医院列表 - - - 添加医院 - - - 删除医院信息 - - - 分页获取医院列表 - - - 分页获取研究中心列表 - - - 添加研究中心 - - - 删除研究中心 - - - 分页获取申办方列表 - - - 分页获取申办方列表 - - - 添加申办方 - - - 删除申办方 - - - - 添加菜单 New - - - - - - - 删除菜单 已验证 父节点不允许删除 New - - - - - - - 所有的菜单树 包括禁用的 New - - - - - - 菜单列表 参数都是可传的 根据需要传递 New - - - - - - - 获取某用户类型(角色) 菜单树 勾选情况 New - - - - - - 发送验证码 修改邮箱(已经登陆修改) New - - - - 重置密码为 默认密码 - - - - - - - 重置密码发邮件 (未登陆修改) - - - - - - - 验证验证码,没问题就返回用户所有的账户 - - - - - - - - - (未登陆) 设置新密码 - - - - - - - - 修改密码,当前支持旧密码修改密码 - - - - - - 获取用户列表 - - - - - - - 根据用户Id获取用户详细信息[New] - - - xiuga - - - - 添加用户 - - - - - - - 更新用户 - - - - - - - 删除用户 - - - - - - - 禁用或者启用账户 - - - - - - - - 发送MFA 验证邮件 - - - - - - - - 验证MFA 邮件 - - - - - - - - - 用户登陆 - - - - - - - - 临床数据配置 - - - - - 临床数据配置 - - - - - 应用系统临床数据 - - - - - - - - 应用项目临床数据 - - - - - - - - 新增或者修改(系统) - - - - - - - 获取系统临床数据(系统) - - - - - - 删除(系统) - - - - - - - 新增或者修改(项目) - - - - - - - 获取项目的临床数据 - - - - - - - 删除(项目) - - - - - - - 将系统配置添加到项目配置 - - - - - - - 阅片临床数据 - - - - - 阅片临床数据 - - - - - 新增或者修改 - - - - - - - 删除 - - - - - - - 获取检查类型临床数据 - - - - - - - 获取CRC上传的文件 - - - - - - - 添加CRC数据类型 - - - - - - 影像阅片临床数据签名 - - - - - 获取下拉菜单 - - - - - - - 获取访视 阅片或任务临床数据 - - - - - - - 获取阅片临床数据列表 - - - - - - - 获取阅片临床数据列表 (在任务列表) - - - - - - - 新增或修改一致性分析临床数据 - - - - - - - 一致性分析临床数据签名 - - - - - - - 一致性分析临床数据签名完设置任务为有效 - - - - - - - 获取单个阅片临床数据的所有文件 - - - - - - - 删除PDF单个文件 - - - - - - - 阅片问题.标准 - - - - - 阅片问题.标准 - - - - - 获取自定义表格问题预览 - - - - - - 获取问题 - - - - - - - 获取表格问题 - - - - - - - 获取系统问题分组 - - - - - - - 获取系统问题 - - - - - - 获取系统标准的其他问题 - - - - - - - 新增修改系统问题 - - - - - - - 删除系统问题 - - - - - - - 获取系统的表格问题 - - - - - - - 获取系统表格其他问题 - - - - - - - 新增修改系统表格问题 - - - - - - 删除系统表格问题 - - - - - - - 新增修改项目问题(项目) - - - - - - - 获取项目问题(项目) - - - - - - 验证计算关系 - - - - - - - - - - 获取问题计算关系 - - - - - - - 获取项目标准的其他问题(项目) - - - - - - - 删除项目问题(项目) - - - - - - - 获取项目问题分组 - - - - - - - 获取项目的表格问题 - - - - - - - 获取项目表格其他问题 - - - - - - - 新增修改想想项目表格问题 - - - - - - - 删除项目表格问题 - - - - - - - 复制一个系统标准到另一系统标准 - - - - - - - - 同步系统标准 - - - - - - - 同步标准到项目新(2022-08-10) - - - - - - - 验证是否要同步标准 - - - - - - - 添加系统数据到项目里面 - - - - - - 全局阅片 - - - IR影像阅片 - - - 裁判 - - - 非Dicom - - - 肿瘤学 - - - 问题 - - - - - 提交全局阅片结果 - - - - - - - 批量提交全局阅片信息 - - - - - - - 保存全局阅片结果 - - - - - - - 获取全局阅片信息 - - - - - - - IR影像阅片 - - - - - 获取阅片的计算数据 - - - - - - - 获取既往病灶的OtherPicture - - - - - - - 提交自定义标记 - - - - - - - 删除自定义标记 - - - - - - - 获取自定义标记 - - - - - - - 获取手册 - - - - - - - 获取任务附加问题 - - - - - - - 提交附加问题 - - - - - - - 维护任务关系 - - - - - - 修改计算问题 - - - - - - - 阅读临床数据 - - - - - - - 添加默认值到任务里面 - - - - - - 根据任务ID获取ReadingTool - - - - - - - 获取关联的阅片任务 - - - - - - - 获取既往任务名称和编号 - - - - - - 获取阅片的受试者信息 - - - - - - - 验证是否为基线访视任务 - - - - - - - - 验证任务是否签名 - - - - - - - - 获取DIcom阅片问题答案 - - - - - - - 获取阅片外层问题 - - - - - - - - - - 获取阅片报告 - - - - - - - 获取表格答案行信息 - - - - (QuestionId) 可为空 - - - - - - 获取表格问题及答案(2022-08-26) - - - - - - - 获取自定义问题以及答案 - - - - - - - 获取表格问题及答案 只返回表格问题(任务和标准) - - - - - - - 获取子元素 - - - - - - - - - - - - - - - 拆分病灶 分裂病灶 - - - - - - 合并病灶 融合 - - - - - - 获取可合并的病灶 - - - - - - - 保存影像质量 - - - - - - - 保存任务问题 带动态稽查参数 - - - 请求类型 - - - - - 修改肿瘤学评估结果 - - - - - - - 删除表格行数据 - - - - - - - 提交表格问题答案 提交病灶 保存病灶 - - - - - - - 提交Dicom阅片信息 - - - - - - - 验证默认问题是否回答 - - - - - - - - 验证访视提交 - - - - - - - 清除跳过阅片的缓存 - - - - - - 设置跳过阅片的缓存 - - - - - - - 获取下一个阅片任务 - - - - - - - 重置阅片任务 - - - - - - - 验证阅片休息时间 - - - - - - 重置阅片时间 登录和解锁调用 - - - - - - 签名提交任务修改状态 - - - - - - - 签名时创建任务关联 - - - - - - 阅片期 -全局和肿瘤学任务的生成 - - - - - - 获取项目标准的裁判问题 - - - - - - - 设置裁判问题的答案分组 - - - - - - - 获取裁判阅片任务信息 - - - - - - 保存裁判问题 - - - - - - - 提交裁判问题 - - - - - - - 判断任务是否是全局访视任务 - - - - - - 触发裁判任务(新) - - - - - - - 计算返回的结果 为True表示不相等 - - - - - - - 添加裁判任务 - - - - - - 提交访视阅片问题 - - - - - - - 保存任务问题 - - - - - - - 获取阅片非Dicom文件 - - - - - - - 获取肿瘤学任务信息 - - - - - - - - 修改肿瘤学阅片信息 - - - - - - - 添加肿瘤学阅片任务 其实这里无非是要判断临床数据是否签名 但是对于添加新的阅片期 其实没有临床数据 可以走之前的逻辑 - - - - - - 提交肿瘤阅片结果 - - - - - - - 获取项目已确认的标准 - - - - - - - 获取项目的阅片问题ECRF预览 - - - SinglePage 单页 - - MultiPage 多页 - - PublicPage 公共 - - - - - - - 项目配置的阅片问题(不包含表格问题) 以及配置的分页 和任务对应的答案 一维表 -- 非dicom 阅片 - - - - - - - - 找子问题 - - - - - - - - 获取系统的阅片问题 - - - - - - - 获取系统 - - - - - - - - 阅片期配置 - - - - - 阅片期配置 - - - - - 新增或者修改 (增加标准搜索,已修改) - - - - - - - 删除 - - - - - - - 设置阅片期配置是否生效 (增加标准搜索,已修改) - - - - - - - 获取选中的计划 (增加标准不影响 因为阅片期设置关联了标准) - - - - - - - 添加对应的阅片计划 (后续生效将计划变为模块) (增加标准不影响 因为阅片期设置关联了标准) - - - - - - - 分页获取 (增加标准搜索,已修改) - - - - - - - 获取单条 - - - - - - - 获取阅片期配置的截至访视的下拉框 (增加标准搜索,已修改) - - - - - - - 获取影像阅片的预览 // 需要清除之前已经选中的 (增加标准搜索,已修改) - - - - - - 生成的阅片模块(在大列表上展示的) 阅片期 - - - - - 生成的阅片模块(在大列表上展示的) 阅片期 - - - - - 获取修改截止访视下拉 - - - - - - - 修改全局阅片截止访视 - - - - - - - 用ef 实现之前视图的功能 - - - - - - - 获取单条详情信息 - - - - - - - 添加阅片的时候 获取访视 //标准参数必传 - - - - - - - 添加阅片期 - - - - - - - 删除 - - - - - - - Dashboard统计、全局工作量统计、入组两个维度统计(按照项目、按照人) - - - - - Dashboard统计、全局工作量统计、入组两个维度统计(按照项目、按照人) - - - - 根据项目和医生,分页获取工作量统计[New] - - - 项目入组 医生维度统计[New] - - - 用户参与项目 统计[New] - - - 用户参与项目 列表[New] - - - 读片数分类统计[New] - - - 获取最近几个月份的数据[New] - - - 读片数量排行前几的数据[New] - - - 按Rank统计Reviewer 数量[New] - - - 最近几个季度入组人次[New] type==0 按照月份 - - - 参与项目数排行 [New] - - - 最新工作量 (已确定的)[New] - - - - Setting页面 获取项目参与人员列表 - - - - - - Setting页面 为 site 勾选CRC用户列表 - - - Setting页面 项目参与人员勾选列表 - - - - Setting页面 批量添加项目参与人员 - - - - - - 项目参与人员退出 其中IQC退出 回去释放工作量 - - - - 分页获取临床项目列表 默认后台加急状态为3 查所有的 - - - - - - - 获取项目基本信息 - - - - - - - 添加项目 - - - - - - 真删除项目 方便清理测试数据 - 临床试验项目Id - - - - 根据项目Id 获取医生Id,用于触发计算费用 - - - - 分页获取医生参与的临床实验项目列表(查询条件) - - - - - 医生确认入组或拒绝入组 - - 项目Id - 9-拒绝入组,10-确认入组 - - - - - scp 影像推送记录表 - - - - - - - 影像检查列表-患者为维度组织 - - - - - - - 影像检查列表-> 获取患者的检查列表 - - - - - - - 影像访视上传 检查列表 - - - - - - - 提交 患者检查和访视的绑定 - - - - - - - - - - 添加或更新受试者信息[New] - - state:1-访视中,2-出组。0-全部 - - - - 分页获取受试者列表[New] - /// state:1-访视中,2-出组。0-全部 - - - - 计划外访视 获取受试者选择下拉框列表 - - - - 暂时不用 - 获取项目访视计划 - - - 根据项目Id,获取项目访视计划(不分页)[New] - - - - 获取访视计划下拉框列表 - - - - - - 添加或更新访视计划某项 - - - 删除项目计划某一项 废弃 - - - - 修改项目医生的阅片类型 - - - - - - - 修改项目医生启用禁用状态 - - - - - - - 0代表裁判和Tp 都可以 1、代表Tp 2 代表裁判 - - - - - - 获取某个项目入组的医生工作量统计列表 - - - - - 获取入组某个项目的医生的最近几个月的工作量详情(带有填充数据) - - - - - 获取来自Reviewer自己的数据,某个月添加的多条 - - - - - 工作量是否存在,用于判断只能添加一条的工作量记录 - - - 查询某个医生是否在某天有某个项目的工作量数据,处理添加来自医生自己的工作量数据 - - - - - 添加或更新工作量 - - - - - 删除工作量 - - - - - 获取工作量详情(用于判断工作量锁定时,调用) - - - - - 添加或更新项目医生项目价格 - - - - - 获取医生项目列表 - - - - - - 为项目筛选医生 提交 【select】 - 项目Id - 医生Id数组 - - - - - 入组流程-向CRO提交医生[Submit] - - - - - 入组流程-CRO确定医生名单 [ Approve] - - - - - 入组流程-后台确认医生入组[Confirm] - - - - - optType 0表示入组,列表没这条数据了, 1表示出组,需要填写出组时间 废弃 - - - - - - - - - - 清理一致性分析任务 - - - - - - - - - - 维护临床数据 --一定要在同步表前同步数据才行 - - - - - - 维护OSS 影像数据 - - - Reviewer 列表查询参数 diff --git a/IRaCIS.Core.Application/MassTransit/Command/ConsistenCheckCommand.cs b/IRaCIS.Core.Application/MassTransit/Command/ConsistenCheckCommand.cs index 6b24a12c2..a0b10e57f 100644 --- a/IRaCIS.Core.Application/MassTransit/Command/ConsistenCheckCommand.cs +++ b/IRaCIS.Core.Application/MassTransit/Command/ConsistenCheckCommand.cs @@ -1,10 +1,5 @@ using MiniExcelLibs.Attributes; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.MassTransit.Command { diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs index 5cf6ff049..30e8faaab 100644 --- a/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Consumer/ConsistencyCheckConsumer.cs @@ -5,12 +5,7 @@ using IRaCIS.Core.Domain.Share; using MassTransit; using Microsoft.Extensions.Localization; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.MassTransit.Consumer { @@ -286,7 +281,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer //await context.RespondAsync(new //{ - + //}); } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs index 083015b8a..4c02520a6 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskAllocationRuleViewModel.cs @@ -3,12 +3,10 @@ // 生成时间 2022-06-07 13:16:33 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using IRaCIS.Application.Contracts; +using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { @@ -112,18 +110,19 @@ namespace IRaCIS.Core.Application.ViewModel public List CriterionCategoryList => TrialReadingCriterionList.Select(t => - new CriterionReadingCategory() { - EnrollId = EnrollId, - TrialReadingCriterionId = t.TrialReadingCriterionId, + new CriterionReadingCategory() + { + EnrollId = EnrollId, + TrialReadingCriterionId = t.TrialReadingCriterionId, ReadingCategorys = CriterionReadingCategoryList.Where(c => c.TrialReadingCriterionId == t.TrialReadingCriterionId).Select(t => t.ReadingCategory).OrderBy(c => c).ToList() }).ToList(); - //CriterionReadingCategoryList.Count == 0 ? TrialReadingCriterionList.Select(t => new CriterionReadingCategory() { EnrollId = EnrollId, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList() : - // CriterionReadingCategoryList - //.GroupBy(t => new { t.TrialReadingCriterionId, t.EnrollId }) - //.Select(g => new CriterionReadingCategory() { EnrollId = g.Key.EnrollId, TrialReadingCriterionId = g.Key.TrialReadingCriterionId, ReadingCategorys = g.Select(t => t.ReadingCategory).OrderBy(t=>t).ToList() }).ToList(); + //CriterionReadingCategoryList.Count == 0 ? TrialReadingCriterionList.Select(t => new CriterionReadingCategory() { EnrollId = EnrollId, TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList() : + // CriterionReadingCategoryList + //.GroupBy(t => new { t.TrialReadingCriterionId, t.EnrollId }) + //.Select(g => new CriterionReadingCategory() { EnrollId = g.Key.EnrollId, TrialReadingCriterionId = g.Key.TrialReadingCriterionId, ReadingCategorys = g.Select(t => t.ReadingCategory).OrderBy(t=>t).ToList() }).ToList(); } @@ -212,7 +211,7 @@ namespace IRaCIS.Core.Application.ViewModel public class GenerateTaskCommand { public Guid TrialId { get; set; } - + //针对访视产生任务的 有用 public bool IsAssignSubjectToDoctor { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs index 9f73b9a4a..4c7b768ae 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskConsistentRuleViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2022-07-01 15:33:01 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; @@ -81,7 +79,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid DoctorUserId { get; set; } } - public class ConsistentConfirmGenerateCommand: SelfConsistentSimpleQuery + public class ConsistentConfirmGenerateCommand : SelfConsistentSimpleQuery { @@ -104,10 +102,10 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsAutoAllocateGenerateTask { get; set; } } - public class DoctorSelfConsistentSubjectView: ConsistentCommonView + public class DoctorSelfConsistentSubjectView : ConsistentCommonView { public string FirstGlobalVisitName { get; set; } = string.Empty; - public string? BlindSubjectCode { get; set; } + public string? BlindSubjectCode { get; set; } public List VisitTaskList { get; set; } @@ -130,14 +128,14 @@ namespace IRaCIS.Core.Application.ViewModel public int? ValidVisitCount { get; set; } } - public class DoctorGroupConsistentSubjectView: ConsistentCommonView + public class DoctorGroupConsistentSubjectView : ConsistentCommonView { - public List SubjectTaskVisitList => VisitTaskList.GroupBy(t => new { t.SubjectId, t.VisitTaskNum }).Where(g => g.Count() == 2).Select(g => g.First()).OrderBy(t=>t.VisitTaskNum).ToList(); + public List SubjectTaskVisitList => VisitTaskList.GroupBy(t => new { t.SubjectId, t.VisitTaskNum }).Where(g => g.Count() == 2).Select(g => g.First()).OrderBy(t => t.VisitTaskNum).ToList(); public List VisitTaskList { get; set; } = new List(); - public List DoctorUserList { get; set; }=new List(); + public List DoctorUserList { get; set; } = new List(); } public class VisitTaskGroupSimpleDTO @@ -175,10 +173,10 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsClinicalDataSign { get; set; } } - public class VisitTaskSimpleDTO :VisitTaskGroupSimpleDTO + public class VisitTaskSimpleDTO : VisitTaskGroupSimpleDTO { public Guid? Id { get; set; } - + public string TaskCode { get; set; } @@ -289,7 +287,7 @@ namespace IRaCIS.Core.Application.ViewModel public class GetConsistentRuleOut { - public TaskConsistentRuleBasic? ConsistentRuleBasic { get; set; } + public TaskConsistentRuleBasic? ConsistentRuleBasic { get; set; } /// /// 任务展示访视 读片任务显示是否顺序 /// @@ -316,7 +314,7 @@ namespace IRaCIS.Core.Application.ViewModel public string VirtualSiteCode { get; set; } } - public class UpdateTrialSiteCodeCommandView: UpdateTrialSiteCodeCommand + public class UpdateTrialSiteCodeCommandView : UpdateTrialSiteCodeCommand { public DateTime Creatime { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewRuleViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewRuleViewModel.cs index ed3a95de7..3824f7ae2 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewRuleViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewRuleViewModel.cs @@ -3,11 +3,8 @@ // 生成时间 2022-06-29 13:36:46 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { @@ -33,7 +30,7 @@ namespace IRaCIS.Core.Application.ViewModel public List ActualTumorTaskList { get; set; } - + [JsonIgnore] public List GeneratedVisitTaskList { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs index 223664dc6..5a0f5ae97 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/TaskMedicalReviewViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2022-06-29 10:59:50 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel @@ -69,7 +67,7 @@ namespace IRaCIS.Core.Application.ViewModel { if (!ReadingDurationTimeSpan.HasValue) return ""; - else return string.Format("{0}h:{1}m:{2}s", (SignTime - FirstReadingTime)?.Hours, (SignTime - FirstReadingTime)?.Minutes, (SignTime - FirstReadingTime)?.Seconds) + else return string.Format("{0}h:{1}m:{2}s", (SignTime - FirstReadingTime)?.Hours, (SignTime - FirstReadingTime)?.Minutes, (SignTime - FirstReadingTime)?.Seconds) /*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/; } } @@ -102,18 +100,18 @@ namespace IRaCIS.Core.Application.ViewModel public Guid? SubjectId { get; set; } - public Guid? MedicalManagerUserId { get; set; } + public Guid? MedicalManagerUserId { get; set; } - public DateTime? BeginSignTime { get; set; } - public AuditAdvice? AuditAdviceEnum { get; set; } + public DateTime? BeginSignTime { get; set; } + public AuditAdvice? AuditAdviceEnum { get; set; } - public DateTime? EndSignTime { get; set; } + public DateTime? EndSignTime { get; set; } - public bool IsGetBeRead { get; set; } = false; + public bool IsGetBeRead { get; set; } = false; - public bool IsGetNextMedicalReviewTask { get; set; } = false; + public bool IsGetNextMedicalReviewTask { get; set; } = false; - public string SubjectCode { get; set; } = String.Empty; + public string SubjectCode { get; set; } = String.Empty; public string TrialSiteCode { get; set; } = String.Empty; public string TaskName { get; set; } = String.Empty; @@ -133,7 +131,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid? TrialReadingCriterionId { get; set; } - public MedicalReviewDoctorUserIdea? DoctorUserIdeaEnum { get; set; } + public MedicalReviewDoctorUserIdea? DoctorUserIdeaEnum { get; set; } public Arm? ArmEnum { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs index 9f5dbfc37..78604427f 100644 --- a/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Allocation/DTO/VisitTaskViewModel.cs @@ -3,11 +3,9 @@ // 生成时间 2022-06-07 14:10:54 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { @@ -86,9 +84,9 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsClinicalDataSign { get; set; } - public CompleteClinicalDataEnum CompleteClinicalDataEnum => + public CompleteClinicalDataEnum CompleteClinicalDataEnum => (IsNeedClinicalDataSign && IsClinicalDataSign) ? CompleteClinicalDataEnum.Complete : (IsNeedClinicalDataSign && IsClinicalDataSign == false) ? CompleteClinicalDataEnum.NotComplete : CompleteClinicalDataEnum.NA; - + /// @@ -99,7 +97,7 @@ namespace IRaCIS.Core.Application.ViewModel /// /// 任务展示访视 读片任务显示是否顺序 /// - public ReadingOrder IsReadingTaskViewInOrder { get; set; } + public ReadingOrder IsReadingTaskViewInOrder { get; set; } /// @@ -163,7 +161,7 @@ namespace IRaCIS.Core.Application.ViewModel public bool IsCanEditUrgentState { get; set; } - public DateTime? FirstReadingTime { get;set; } + public DateTime? FirstReadingTime { get; set; } public string ReadingDuration { @@ -224,7 +222,7 @@ namespace IRaCIS.Core.Application.ViewModel public int ConsistentClinicalDataCount { get; set; } = 0; - public bool IsReReadingOrBackInfluenceAnalysis { get; set; } + public bool IsReReadingOrBackInfluenceAnalysis { get; set; } } @@ -318,7 +316,7 @@ namespace IRaCIS.Core.Application.ViewModel if (this.SuggesteFinishedTime != null) { var date = DateTime.Now; - var timeSpan = SuggesteFinishedTime.Value- date; + var timeSpan = SuggesteFinishedTime.Value - date; if (timeSpan.TotalDays <= 2) { return 1; @@ -339,12 +337,12 @@ namespace IRaCIS.Core.Application.ViewModel } } - public int UrgentCount { get; set; } + public int UrgentCount { get; set; } - public List UnReadCanReadTaskList { get; set; } = new List(); + public List UnReadCanReadTaskList { get; set; } = new List(); - public List UnReadTaskList { get; set; } = new List(); + public List UnReadTaskList { get; set; } = new List(); } public class IRUnreadTaskView @@ -391,13 +389,13 @@ namespace IRaCIS.Core.Application.ViewModel } - public class GetReadingIQueryableInDto:PageInput + public class GetReadingIQueryableInDto : PageInput { - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - public Guid? SubjectId { get; set; } + public Guid? SubjectId { get; set; } - public Guid TrialReadingCriterionId { get; set; } + public Guid TrialReadingCriterionId { get; set; } public string? SubjectCode { get; set; } = null; @@ -409,7 +407,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid TrialId { get; set; } - public Guid? TrialSiteId { get; set; } + public Guid? TrialSiteId { get; set; } public Guid? SubjectId { get; set; } @@ -435,7 +433,7 @@ namespace IRaCIS.Core.Application.ViewModel public DateTime? BeginSignTime { get; set; } - public DateTime? EndSignTime { get; set; } + public DateTime? EndSignTime { get; set; } public DateTime? BeginRequestReReadingTime { get; set; } public DateTime? EndRequestReReadingTime { get; set; } @@ -553,7 +551,7 @@ namespace IRaCIS.Core.Application.ViewModel public int? SubjectAllocateState { get; set; } - public List ArmList { get; set; }=new List() { }; + public List ArmList { get; set; } = new List() { }; [NotDefault] public Guid TrialReadingCriterionId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs index 1395a4779..e2ff8c31e 100644 --- a/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskAllocationRuleService.cs @@ -6,20 +6,20 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ITaskAllocationRuleService - /// - public interface ITaskAllocationRuleService +{ + /// + /// ITaskAllocationRuleService + /// + public interface ITaskAllocationRuleService { - - //Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule); - - Task AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule); - Task DeleteTaskAllocationRule(Guid taskAllocationRuleId); + //Task> GetTaskAllocationRuleList(TaskAllocationRuleQuery queryTaskAllocationRule); + + Task AddOrUpdateTaskAllocationRule(TaskAllocationRuleAddOrEdit addOrEditTaskAllocationRule); + + Task DeleteTaskAllocationRule(Guid taskAllocationRuleId); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskConsistentRuleService.cs index 8e2cc36fc..46ad1a6b2 100644 --- a/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/Interface/ITaskConsistentRuleService.cs @@ -6,20 +6,20 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ITaskConsistentRuleService - /// - public interface ITaskConsistentRuleService +{ + /// + /// ITaskConsistentRuleService + /// + public interface ITaskConsistentRuleService { - - //Task> GetTaskConsistentRuleList(TaskConsistentRuleQuery inQuery); - - Task AddOrUpdateTaskConsistentRule(TaskConsistentRuleAddOrEdit addOrEditTaskConsistentRule); - Task DeleteTaskConsistentRule(Guid taskConsistentRuleId); + //Task> GetTaskConsistentRuleList(TaskConsistentRuleQuery inQuery); + + Task AddOrUpdateTaskConsistentRule(TaskConsistentRuleAddOrEdit addOrEditTaskConsistentRule); + + Task DeleteTaskConsistentRule(Guid taskConsistentRuleId); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/Allocation/Interface/IVisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/Interface/IVisitTaskHelpeService.cs index f8380bb8f..ce7de3877 100644 --- a/IRaCIS.Core.Application/Service/Allocation/Interface/IVisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/Interface/IVisitTaskHelpeService.cs @@ -18,6 +18,6 @@ namespace IRaCIS.Core.Application.Service Task AddConvertedTask(Guid taskId); - Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId,bool? isManualSelectVisit=null,List? subjectVisitIdList=null); + Task BaseCritrionGenerateVisitTask(Guid trialId, Guid confirmedTrialReadingCriterionId, bool? isManualSelectVisit = null, List? subjectVisitIdList = null); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs index 226e8ac94..098d56b99 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskAllocationRuleService.cs @@ -4,13 +4,12 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Filter; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs index 23fdf23b1..d0d45ccea 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskConsistentRuleService.cs @@ -4,23 +4,16 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Domain.Share; -using System.Linq.Expressions; -using IRaCIS.Core.Infra.EFCore.Common; -using System.Linq; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; -using Medallion.Threading; -using IRaCIS.Core.Infrastructure.Extention; -using System; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using NPOI.SS.Formula.Functions; +using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using Medallion.Threading; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -114,7 +107,7 @@ namespace IRaCIS.Core.Application.Service } #endregion - var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { IsHaveDoubleReadCriterion = t.TrialReadingCriterionList.Any(t => t.IsSigned && t.IsConfirm && t.ReadingType == ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault(); + var trialTaskConfig = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { IsHaveDoubleReadCriterion = t.TrialReadingCriterionList.Any(t => t.IsSigned && t.IsConfirm && t.ReadingType == ReadingMethod.Double), t.VitrualSiteCode }).FirstOrDefault(); return ResponseOutput.Ok(pageList, trialTaskConfig); } diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs index e76863049..b0ae36046 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewRuleService.cs @@ -4,11 +4,10 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Application.Filter; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -21,19 +20,19 @@ namespace IRaCIS.Core.Application.Service IRepository _trialUserRepository) : BaseService, ITaskMedicalReviewRuleService { - + [HttpPost] - public async Task<(List,object)> GetTaskMedicalReviewRuleList(TaskMedicalReviewRuleQuery inQuery) + public async Task<(List, object)> GetTaskMedicalReviewRuleList(TaskMedicalReviewRuleQuery inQuery) { var taskTaskMedicalReviewRuleQueryable = _taskMedicalReviewRuleRepository.Where(t => t.TrialId == inQuery.TrialId) .ProjectTo(_mapper.ConfigurationProvider); - var isHaveMIM = await _trialUserRepository.AnyAsync(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId==inQuery.TrialId); + var isHaveMIM = await _trialUserRepository.AnyAsync(t => t.User.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == inQuery.TrialId); - return (await taskTaskMedicalReviewRuleQueryable.ToListAsync(),new {IsHaveMIM=isHaveMIM}); + return (await taskTaskMedicalReviewRuleQueryable.ToListAsync(), new { IsHaveMIM = isHaveMIM }); } [HttpPost] @@ -43,7 +42,7 @@ namespace IRaCIS.Core.Application.Service { var verifyExp1 = new EntityVerifyExp() { - + VerifyExp = t => t.DoctorUserId == addOrEditTaskTaskMedicalReviewRule.DoctorUserId && t.TrialId == addOrEditTaskTaskMedicalReviewRule.TrialId, //"已有该医生配置,不允许继续增加" VerifyMsg = _localizer["TaskMedicalRule_TaskAlreadyAssigned"] @@ -68,7 +67,7 @@ namespace IRaCIS.Core.Application.Service // return ResponseOutput.NotOk(_localizer["TaskMedicalRule_TaskStarted"]); //} - var success = await _taskMedicalReviewRuleRepository.DeleteFromQueryAsync(t => t.Id == taskMedicalReviewRuleId,true); + var success = await _taskMedicalReviewRuleRepository.DeleteFromQueryAsync(t => t.Id == taskMedicalReviewRuleId, true); return ResponseOutput.Ok(); } diff --git a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs index 393edc9a0..fa37eccdc 100644 --- a/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/TaskMedicalReviewService.cs @@ -4,14 +4,12 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Filter; -using Microsoft.Extensions.Logging; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -26,7 +24,7 @@ namespace IRaCIS.Core.Application.Service IRepository _visitTaskRepository) : BaseService, ITaskMedicalReviewService { - + /// /// PM 医学审核(挑选任务生成后的列表) @@ -41,7 +39,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId) - .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode) || t.VisitTask.Subject.MedicalNo.Contains(inQuery.SubjectCode)) + .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode) || t.VisitTask.Subject.MedicalNo.Contains(inQuery.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName)) .WhereIf(inQuery.IsUrgent != null, t => t.VisitTask.IsUrgent == inQuery.IsUrgent) .WhereIf(inQuery.DoctorUserId != null, t => t.VisitTask.DoctorUserId == inQuery.DoctorUserId) @@ -50,23 +48,23 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.TaskState != null, t => t.VisitTask.TaskState == inQuery.TaskState) .WhereIf(inQuery.ArmEnum != null, t => t.VisitTask.ArmEnum == inQuery.ArmEnum) .WhereIf(inQuery.AuditState != null, t => t.AuditState == inQuery.AuditState) - .WhereIf(inQuery.MedicalManagerUserId != null, t => t.MedicalManagerUserId == inQuery.MedicalManagerUserId) + .WhereIf(inQuery.MedicalManagerUserId != null, t => t.MedicalManagerUserId == inQuery.MedicalManagerUserId) .WhereIf(inQuery.BeginSignTime != null, t => t.VisitTask.SignTime > inQuery.BeginSignTime) .WhereIf(inQuery.EndSignTime != null, t => t.VisitTask.SignTime < inQuery.EndSignTime) - .WhereIf(inQuery.AuditAdviceEnum != null, t => t.AuditAdviceEnum == inQuery.AuditAdviceEnum) + .WhereIf(inQuery.AuditAdviceEnum != null, t => t.AuditAdviceEnum == inQuery.AuditAdviceEnum) - .WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum) - .WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) + .WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum) + .WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) .WhereIf(inQuery.IsInvalid != null, t => t.IsInvalid == inQuery.IsInvalid) .WhereIf(inQuery.IsHaveQuestion != null, t => t.IsHaveQuestion == inQuery.IsHaveQuestion) - + .WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime >= inQuery.BeginAllocateDate) .WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime <= inQuery.EndAllocateDate) .WhereIf(inQuery.BeginAuditSignTime != null, t => t.AuditSignTime >= inQuery.BeginAuditSignTime) .WhereIf(inQuery.EndAuditSignTime != null, t => t.AuditSignTime <= inQuery.EndAuditSignTime) - .ProjectTo(_mapper.ConfigurationProvider); + .ProjectTo(_mapper.ConfigurationProvider); - var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectCode), nameof(TaskMedicalReviewView.ArmEnum) , nameof(TaskMedicalReviewView.VisitTaskNum) }; + var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.AuditState), nameof(TaskMedicalReviewView.SubjectCode), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) }; var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray); return pageList; @@ -82,7 +80,7 @@ namespace IRaCIS.Core.Application.Service public async Task> GetGenerateMedicalReviewTaskList(GenerateMedicalReviewTaskQuery inQuery) { var visitTaskQueryable = _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId) - .Where(t => t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect||t.TaskState==TaskState.Freeze) && t.ReadingTaskState == ReadingTaskState.HaveSigned) + .Where(t => t.IsAnalysisCreate == false && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.ReadingTaskState == ReadingTaskState.HaveSigned) .WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId) @@ -161,16 +159,16 @@ namespace IRaCIS.Core.Application.Service var result = new TaskMedicalReviewView() { }; - if (index+1 == data.CurrentPageData.Count()) // 最后一个 + if (index + 1 == data.CurrentPageData.Count()) // 最后一个 { - throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); - } + throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); + } else if (index == -1 || data.CurrentPageData.Count == 1) // 第一个或者只有一个 { if (data.CurrentPageData[0].Id == inDto.MedicalReviewId) { - throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); - } + throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); + } result = data.CurrentPageData[0]; } else @@ -183,8 +181,8 @@ namespace IRaCIS.Core.Application.Service } else { - throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); - } + throw new BusinessValidationFailedException(_localizer["MedicalReview_Finish"]); + } } @@ -196,34 +194,34 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task>> GetMIMMedicalReviewTaskList(TaskMedicalReviewQuery inQuery) + public async Task>> GetMIMMedicalReviewTaskList(TaskMedicalReviewQuery inQuery) { - var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.Id&&t.VisitTask.TrialReadingCriterionId==inQuery.TrialReadingCriterionId) - + var taskMedicalReviewQueryable = _taskMedicalReviewRepository.Where(t => t.VisitTask.TrialId == inQuery.TrialId && t.MedicalManagerUserId == _userInfo.Id && t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) + .WhereIf(inQuery.IsGetNextMedicalReviewTask, - x=>( - !x.IsInvalid&& x.AuditState== MedicalReviewAuditState.Auditing & - ( x.ReadingMedicalReviewDialogList.Count()!=0&& - x.ReadingMedicalReviewDialogList.Count()>0&& - x.ReadingMedicalReviewDialogList.OrderByDescending(x=>x.CreateTime).FirstOrDefault().UserTypeEnumInt==(int)UserTypeEnum.IndependentReviewer) + x => ( + !x.IsInvalid && x.AuditState == MedicalReviewAuditState.Auditing & + (x.ReadingMedicalReviewDialogList.Count() != 0 && + x.ReadingMedicalReviewDialogList.Count() > 0 && + x.ReadingMedicalReviewDialogList.OrderByDescending(x => x.CreateTime).FirstOrDefault().UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer) ) // 审核中最新回复为IR的 - || (!x.IsInvalid&& x.AuditState==MedicalReviewAuditState.WaitAudit) - ||x.Id == inQuery.Id // 这里必须找传入id 因为要找到这条的索引 获取下一条 - ) + || (!x.IsInvalid && x.AuditState == MedicalReviewAuditState.WaitAudit) + || x.Id == inQuery.Id // 这里必须找传入id 因为要找到这条的索引 获取下一条 + ) .WhereIf(inQuery.SubjectId != null, t => t.VisitTask.SubjectId == inQuery.SubjectId) .WhereIf(inQuery.TrialSiteId != null, t => t.VisitTask.Subject.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.IsUrgent != null, t => t.VisitTask.IsUrgent == inQuery.IsUrgent) .WhereIf(inQuery.AuditState != null, t => t.AuditState == inQuery.AuditState) - .WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum) - .WhereIf(inQuery.TaskState != null, t => t.VisitTask.TaskState == inQuery.TaskState) + .WhereIf(inQuery.DoctorUserIdeaEnum != null, t => t.DoctorUserIdeaEnum == inQuery.DoctorUserIdeaEnum) + .WhereIf(inQuery.TaskState != null, t => t.VisitTask.TaskState == inQuery.TaskState) .WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.VisitTask.Subject.Code.Contains(inQuery.SubjectCode) || t.VisitTask.Subject.MedicalNo.Contains(inQuery.SubjectCode)) .WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.VisitTask.TaskName.Contains(inQuery.TaskName) || t.VisitTask.TaskBlindName.Contains(inQuery.TaskName)) .WhereIf(inQuery.DoctorUserId != null, t => t.VisitTask.DoctorUserId == inQuery.DoctorUserId) .WhereIf(inQuery.ReadingCategory != null, t => t.VisitTask.ReadingCategory == inQuery.ReadingCategory) .WhereIf(inQuery.ReadingTaskState != null, t => t.VisitTask.ReadingTaskState == inQuery.ReadingTaskState) .WhereIf(inQuery.IsInvalid != null, t => t.IsInvalid == inQuery.IsInvalid) - .WhereIf(inQuery.IsGetBeRead,x=>!x.IsInvalid&&x.AuditState!= MedicalReviewAuditState.HaveSigned) + .WhereIf(inQuery.IsGetBeRead, x => !x.IsInvalid && x.AuditState != MedicalReviewAuditState.HaveSigned) .WhereIf(inQuery.TrialReadingCriterionId != null, t => t.VisitTask.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) .WhereIf(inQuery.BeginAuditSignTime != null, t => t.AuditSignTime >= inQuery.BeginAuditSignTime) .WhereIf(inQuery.EndAuditSignTime != null, t => t.AuditSignTime <= inQuery.EndAuditSignTime) @@ -239,10 +237,10 @@ namespace IRaCIS.Core.Application.Service .ProjectTo(_mapper.ConfigurationProvider); - var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectCode), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) }; + var defalutSortArray = new string[] { nameof(TaskMedicalReviewView.SubjectCode), nameof(TaskMedicalReviewView.ArmEnum), nameof(TaskMedicalReviewView.VisitTaskNum) }; var pageList = await taskMedicalReviewQueryable.ToPagedListAsync(inQuery, defalutSortArray); - return ResponseOutput.Ok(pageList, new + return ResponseOutput.Ok(pageList, new { IsConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync() @@ -265,7 +263,7 @@ namespace IRaCIS.Core.Application.Service return ResponseOutput.NotOk(_localizer["TaskMedical_DirtyData"]); } - await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(t => command.MedicalReviewIdList.Contains(t.Id), c => new TaskMedicalReview() { IsInvalid = true },true); + await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(t => command.MedicalReviewIdList.Contains(t.Id), c => new TaskMedicalReview() { IsInvalid = true }, true); return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs index 7d83da129..9e817c927 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskHelpeService.cs @@ -4,20 +4,13 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using AutoMapper; -using MassTransit; -using IRaCIS.Core.Infra.EFCore.Common; -using System.Linq.Expressions; using IRaCIS.Core.Domain.Share.Reading; -using IRaCIS.Core.Application.Service.Reading.Dto; -using System.Runtime.InteropServices; -using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Infra.EFCore.Common; +using MassTransit; +using Microsoft.AspNetCore.Mvc; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application.Service @@ -35,7 +28,7 @@ namespace IRaCIS.Core.Application.Service IRepository _readingJudgeInfoRepository, IRepository _subjectUserRepository, IRepository _readModuleRepository, - + IRepository _readingOncologyTaskInfoRepository, IRepository _trialReadingCriterionRepository, @@ -44,7 +37,7 @@ namespace IRaCIS.Core.Application.Service IRepository _readingConsistentClinicalDataRepository) : BaseService, IVisitTaskHelpeService { - + //查询列表的时候,一致性核查通过未产生任务的 自动产生任务 如果是一致性核查,那么还会自动分配 public async Task GenerateVisitTaskAsync(Guid trialId, List subjectVisitIdList, bool isAssignSubjectToDoctor = false) @@ -136,7 +129,7 @@ namespace IRaCIS.Core.Application.Service var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max(); - var cacheMaxCodeInt =_fusionCache.GetOrDefault(CacheKeys.TrialStudyMaxCode(trialId)); + var cacheMaxCodeInt = _fusionCache.GetOrDefault(CacheKeys.TrialStudyMaxCode(trialId)); int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode; @@ -432,8 +425,8 @@ namespace IRaCIS.Core.Application.Service //CRC 的自动签名 不用管 只用处理PM的就好 var haveSignedCount = _readingClinicalDataRepository - .Where(t => t.TrialId == trialId && t.IsSign - && t.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(x=>x.TrialReadingCriterionId== trialReadingCriterionId) + .Where(t => t.TrialId == trialId && t.IsSign + && t.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(x => x.TrialReadingCriterionId == trialReadingCriterionId) && t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned && t.ReadingId == readingId && t.ClinicalDataTrialSet.UploadRole == UploadRole.PM).Count(); @@ -575,7 +568,7 @@ namespace IRaCIS.Core.Application.Service var dbMaxCode = _visitTaskRepository.Where(t => t.TrialId == trialId).Select(t => t.Code).DefaultIfEmpty().Max(); - var cacheMaxCodeInt =_fusionCache.GetOrDefault(CacheKeys.TrialStudyMaxCode(trialId)); + var cacheMaxCodeInt = _fusionCache.GetOrDefault(CacheKeys.TrialStudyMaxCode(trialId)); int currentMaxCodeInt = cacheMaxCodeInt > dbMaxCode ? cacheMaxCodeInt : dbMaxCode; @@ -1390,13 +1383,13 @@ namespace IRaCIS.Core.Application.Service var firsttask = generateTaskCommand.GenerataConsistentTaskList[0]; var clinicalDataList = _readingClinicalDataRepository.Where(t => t.SubjectId == subjectId && t.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == firsttask.TrialReadingCriterionId) - && t.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.Study + && t.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Study && t.ClinicalDataTrialSet.ClinicalUploadType == ClinicalUploadType.PDF) // crc受试者和访视的临床数据没上传 一致性分析的时候也不用显示 - .Where(x=>x.ClinicalDataTrialSet.UploadRole == UploadRole.PM||x.FileCount>0) + .Where(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.PM || x.FileCount > 0) .Include(t => t.ReadingClinicalDataPDFList).Include(t => t.ClinicalDataTrialSet).ToList(); - + foreach (var clinicalData in clinicalDataList) { var consistnentClinicalData = _mapper.Map(clinicalData); @@ -1424,12 +1417,12 @@ namespace IRaCIS.Core.Application.Service foreach (var task in generateTaskCommand.GenerataConsistentTaskList) { - + var exsitPDF = await _readingClinicalDataRepository - .WhereIf(isReadingTaskViewInOrder== ReadingOrder.Random,t=>t.ReadingId== task.SouceReadModuleId|| t.ReadingId == task.SourceSubjectVisitId) + .WhereIf(isReadingTaskViewInOrder == ReadingOrder.Random, t => t.ReadingId == task.SouceReadModuleId || t.ReadingId == task.SourceSubjectVisitId) .AnyAsync(t => t.TrialId == trialId && - t.SubjectId== task.SubjectId&& + t.SubjectId == task.SubjectId && t.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(c => c.TrialReadingCriterionId == readingCriterionId) && t.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Study diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index d8345c225..07521fc83 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -4,24 +4,17 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Application.Contracts; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infra.EFCore.Common; -using System.Linq.Expressions; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Filter; -using DocumentFormat.OpenXml.Office2010.Word; -using System.Linq.Dynamic.Core; -using System.Linq; -using DocumentFormat.OpenXml.Bibliography; using IRaCIS.Core.Domain.Share.Reading; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; using MassTransit; -using System.Reactive.Subjects; +using Microsoft.AspNetCore.Mvc; +using System.Linq.Dynamic.Core; using Subject = IRaCIS.Core.Domain.Models.Subject; namespace IRaCIS.Core.Application.Service.Allocation; @@ -73,7 +66,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, TaskUrgentRemake = inDto.TaskUrgentRemake, }); - + return await _visitTaskRepository.SaveChangesAsync(); } @@ -145,7 +138,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, .ProjectTo(_mapper.ConfigurationProvider, new { trialReadingCriterionId = inQuery.TrialReadingCriterionId }); - var pageList = await subjectQuery.ToPagedListAsync(inQuery,nameof(SubjectAssignStat.SubjectId)); + var pageList = await subjectQuery.ToPagedListAsync(inQuery, nameof(SubjectAssignStat.SubjectId)); @@ -1205,7 +1198,7 @@ public class VisitTaskService(IRepository _visitTaskRepository, .ToList() }).Where(x => x.UnReadCanReadTaskCount > 0); - var pageList = await visitTaskQuery.ToPagedListAsync(inQuery, nameof(IRUnReadSubjectView.UnReadCanReadTaskCount) ); + var pageList = await visitTaskQuery.ToPagedListAsync(inQuery, nameof(IRUnReadSubjectView.UnReadCanReadTaskCount)); return pageList; } diff --git a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs index 4b1424c80..4beb54f0d 100644 --- a/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Allocation/_MapConfig.cs @@ -1,8 +1,6 @@ using AutoMapper; using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service @@ -59,10 +57,10 @@ namespace IRaCIS.Core.Application.Service : u.Trial.SubjectList.Where(t => subjectIdList.Contains(t.Id) && t.SubjectVisitTaskList.Where(t => isJudgeDoctor ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Any(c => c.DoctorUserId == null)).Count() )) - //.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => - //subjectIdList.Count == 0 ? u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId).SelectMany(t => t.SubjectArmVisitTaskList.Where(t => isJudgeDoctor ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.DoctorUserId == null)).Count() - //: u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId && subjectIdList.Contains(d.SubjectId)).SelectMany(t => t.SubjectArmVisitTaskList.Where(t => isJudgeDoctor ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.DoctorUserId == null)).Count() - // )) + //.ForMember(o => o.WaitApplySelfTaskCount, t => t.MapFrom(u => + //subjectIdList.Count == 0 ? u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId).SelectMany(t => t.SubjectArmVisitTaskList.Where(t => isJudgeDoctor ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.DoctorUserId == null)).Count() + //: u.Trial.SubjectDoctorUserList.Where(d => d.DoctorUserId == u.DoctorUserId && subjectIdList.Contains(d.SubjectId)).SelectMany(t => t.SubjectArmVisitTaskList.Where(t => isJudgeDoctor ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.DoctorUserId == null)).Count() + // )) .ForMember(o => o.WaitApplyTotalTaskCount, t => t.MapFrom(u => subjectIdList.Count == 0 ? u.Trial.VisitTaskList.Where(t => isJudgeDoctor ? t.ArmEnum == Arm.JudgeArm : t.ArmEnum != Arm.JudgeArm).Where(t => t.DoctorUserId == null).Count() @@ -75,7 +73,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.Enroll.DoctorUser)) .ForMember(o => o.CriterionReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Select(t => new TrialCriterionReadingCategory() { EnrollId = t.EnrollId, ReadingCategory = t.ReadingCategory, TrialReadingCriterionId = t.TrialReadingCriterionId }))) .ForMember(o => o.TrialReadingCriterionList, t => t.MapFrom(u => u.Trial.TrialReadingCriterionList.Where(t => t.IsConfirm))) - .ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList())) + .ForMember(o => o.ReadingCategoryList, t => t.MapFrom(u => u.Enroll.EnrollReadingCategoryList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).OrderBy(t => t.ReadingCategory).Select(t => t.ReadingCategory).ToList())) ; CreateMap() @@ -86,25 +84,25 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.AssignedSubjectCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.TrialId == u.TrialId).Select(t => t.SubjectId).Distinct().Count())) .ForMember(o => o.WaitDealTrialTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.TrialId == u.TrialId).Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect).Count())) .ForMember(o => o.WaitDealAllTaskCount, t => t.MapFrom(u => u.DoctorUser.VisitTaskList.Where(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskState == TaskState.Effect).Count())); - - + + CreateMap() .ForMember(o => o.SubjectId, t => t.MapFrom(u => u.Id)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Code)) - .ForMember(o => o.VisitTaskTypeCount, t => t.MapFrom(u => u.SubjectVisitTaskList.Where(t => t.ReadingCategory == ReadingCategory.Visit && t.TrialReadingCriterionId==trialReadingCriterionId && t.TaskState==TaskState.Effect).Select(t => t.VisitTaskNum).Distinct().Count())) + .ForMember(o => o.VisitTaskTypeCount, t => t.MapFrom(u => u.SubjectVisitTaskList.Where(t => t.ReadingCategory == ReadingCategory.Visit && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect).Select(t => t.VisitTaskNum).Distinct().Count())) .ForMember(o => o.GlobalTaskTypeCount, t => t.MapFrom(u => u.SubjectVisitTaskList.Where(t => t.ReadingCategory == ReadingCategory.Global && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect).Select(t => t.VisitTaskNum).Distinct().Count())) .ForMember(o => o.OncologyTaskTypeCount, t => t.MapFrom(u => u.SubjectVisitTaskList.Where(t => t.ReadingCategory == ReadingCategory.Oncology && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect).Select(t => t.VisitTaskNum).Distinct().Count())) .ForMember(o => o.JudgeTaskTypeCount, t => t.MapFrom(u => u.SubjectVisitTaskList.Where(t => t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && t.TaskState == TaskState.Effect).Select(t => t.VisitTaskNum).Distinct().Count())) - .ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.Where(t=>t.TrialReadingCriterionId== trialReadingCriterionId))); + .ForMember(o => o.DoctorUserList, t => t.MapFrom(u => u.SubjectDoctorList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId))); CreateMap() .ForMember(o => o.DoctorUser, t => t.MapFrom(u => u.DoctorUser)); CreateMap().IncludeBase() - .ForMember(o => o.IsHaveReading, t => t.MapFrom(u => u.Subject.SubjectVisitTaskList.Any(t => t.ReadingTaskState != ReadingTaskState.WaitReading && t.TrialReadingCriterionId==u.TrialReadingCriterionId && t.DoctorUserId==u.DoctorUserId && t.TaskState == TaskState.Effect))); + .ForMember(o => o.IsHaveReading, t => t.MapFrom(u => u.Subject.SubjectVisitTaskList.Any(t => t.ReadingTaskState != ReadingTaskState.WaitReading && t.TrialReadingCriterionId == u.TrialReadingCriterionId && t.DoctorUserId == u.DoctorUserId && t.TaskState == TaskState.Effect))); CreateMap(); @@ -127,13 +125,13 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.TrialSiteId, t => t.MapFrom(u => u.Subject.TrialSiteId)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code)) - .ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo)) - + .ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo)) + .ForMember(o => o.UserCode, t => t.MapFrom(u => u.DoctorUser.UserCode)) .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) .ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName)) .ForMember(o => o.UserTypeShortName, t => t.MapFrom(u => u.DoctorUser.UserTypeRole.UserTypeShortName)) - //.ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == u.SouceReadModuleId || c.ReadingId == u.SourceSubjectVisitId)))) + //.ForMember(o => o.IsClinicalDataSigned, t => t.MapFrom(u => u.Subject.ClinicalDataList.Any(c => c.IsSign && (c.ReadingId == u.SouceReadModuleId || c.ReadingId == u.SourceSubjectVisitId)))) ; @@ -145,21 +143,21 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.HistoryReadingDoctorUserList, t => t.MapFrom(u => u.JudgeVisitList)); CreateMap().IncludeBase() - .ForMember(o=>o.IsManualGeneration,t=> t.MapFrom(u => !u.TrialReadingCriterion.IsAutoCreate)) - .ForMember(o => o.IsHaveFeedBack, t => t.MapFrom(u => u.UserFeedBackList.Any(t=>t.State==0))) + .ForMember(o => o.IsManualGeneration, t => t.MapFrom(u => !u.TrialReadingCriterion.IsAutoCreate)) + .ForMember(o => o.IsHaveFeedBack, t => t.MapFrom(u => u.UserFeedBackList.Any(t => t.State == 0))) ; CreateMap().IncludeBase() .ForMember(o => o.IsReReadingOrBackInfluenceAnalysis, t => t.MapFrom(u => u.Subject.IsReReadingOrBackInfluenceAnalysis)); - - CreateMap(); + + CreateMap(); CreateMap(); - + CreateMap() .ForMember(o => o.ReReadingNewTaskCode, t => t.MapFrom(u => u.NewReReadingTask.TaskCode)) @@ -239,12 +237,12 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindTrialSiteCode :*/ u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => /*u.IsAnalysisCreate == true ? u.BlindSubjectCode :*/ u.Subject.Code)) - .ForMember(o => o.GeneratedMedicalReviewCount, t => t.MapFrom(u => u.TaskMedicalReviewList.Count(t=>t.MedicalManagerUserId!=null))) + .ForMember(o => o.GeneratedMedicalReviewCount, t => t.MapFrom(u => u.TaskMedicalReviewList.Count(t => t.MedicalManagerUserId != null))) .ForMember(o => o.MedicalNo, t => t.MapFrom(u => u.Subject.MedicalNo)) .ForMember(o => o.IsGeneratedJudge, t => t.MapFrom(u => u.JudgeVisitTaskId != null)) .ForMember(o => o.ReadingDurationTimeSpan, t => t.MapFrom(u => u.SignTime - u.FirstReadingTime)) - + ; CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs index 478c42c8e..3b4e24f7f 100644 --- a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs @@ -4,12 +4,10 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Application.Helper; -using IRaCIS.Application.Contracts; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -33,7 +31,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrEmpty(queryCommonDocument.Name), t => t.Name.Contains(queryCommonDocument.Name)) .ProjectTo(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id }); - return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument); + return await commonDocumentQueryable.ToPagedListAsync(queryCommonDocument); } @@ -95,7 +93,7 @@ namespace IRaCIS.Core.Application.Service } } - + if (addOrEditCommonDocument.Id == null) //insert { @@ -111,7 +109,7 @@ namespace IRaCIS.Core.Application.Service var filePath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, dbbeforeEntity.Path); - if (File.Exists(filePath) && dbbeforeEntity.Path!=addOrEditCommonDocument.Path) + if (File.Exists(filePath) && dbbeforeEntity.Path != addOrEditCommonDocument.Path) { File.Delete(filePath); } @@ -121,7 +119,7 @@ namespace IRaCIS.Core.Application.Service } - + } @@ -129,9 +127,9 @@ namespace IRaCIS.Core.Application.Service [HttpDelete("{commonDocumentId:guid}")] public async Task DeleteCommonDocument(Guid commonDocumentId) { - var find= await _commonDocumentRepository.FirstOrDefaultNoTrackingAsync(t=>t.Id== commonDocumentId); - - var success = await _commonDocumentRepository.DeleteFromQueryAsync(t => t.Id == commonDocumentId, true,true); + var find = await _commonDocumentRepository.FirstOrDefaultNoTrackingAsync(t => t.Id == commonDocumentId); + + var success = await _commonDocumentRepository.DeleteFromQueryAsync(t => t.Id == commonDocumentId, true, true); if (find != null) { diff --git a/IRaCIS.Core.Application/Service/Common/DTO/CommonDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/CommonDocumentViewModel.cs index 41891c999..0c1e7eb9b 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/CommonDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/CommonDocumentViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2022-03-31 13:18:48 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { @@ -23,7 +21,7 @@ namespace IRaCIS.Core.Application.ViewModel public class CommonDocumentView : CommonDocumentAddOrEdit { - public string FullFilePath { get; set; } = String.Empty; + public string FullFilePath { get; set; } = String.Empty; public DateTime? DeletedTime { get; set; } public DateTime CreateTime { get; set; } public DateTime UpdateTime { get; set; } @@ -33,7 +31,7 @@ namespace IRaCIS.Core.Application.ViewModel ///CommonDocumentQuery 列表查询参数模型 public class CommonDocumentQuery : PageInput { - public CriterionType? CriterionTypeEnum { get; set; } + public CriterionType? CriterionTypeEnum { get; set; } public CommonDocumentFileType? FileTypeEnum { get; set; } public EmailBusinessScenario? BusinessScenarioEnum { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs index 08267c180..ff0c44c9c 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/DictionaryModel.cs @@ -1,5 +1,4 @@ using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure.Extention; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Application.Contracts @@ -92,8 +91,8 @@ namespace IRaCIS.Application.Contracts { public Guid? TrialReadingCriterionId { get; set; } - public Guid? SystemReadingCriterionId { get; set; } - } + public Guid? SystemReadingCriterionId { get; set; } + } public class GetTrialCriterionDictionaryListInDto @@ -118,7 +117,7 @@ namespace IRaCIS.Application.Contracts } - public class BasicDicSelectCopy:BasicDicSelect + public class BasicDicSelectCopy : BasicDicSelect { } @@ -144,12 +143,12 @@ namespace IRaCIS.Application.Contracts public CrterionDictionaryGroup CrterionDictionaryGroup { get; set; } = IRaCIS.Core.Domain.Share.CrterionDictionaryGroup.General; - public bool IsEnumInt => System.Text.RegularExpressions.Regex.IsMatch(Code, @"^[-+]?\d*$") && DataTypeEnum== DicDataTypeEnum.Enum; + public bool IsEnumInt => System.Text.RegularExpressions.Regex.IsMatch(Code, @"^[-+]?\d*$") && DataTypeEnum == DicDataTypeEnum.Enum; } - public class BasicDicQuery:PageInput + public class BasicDicQuery : PageInput { public string? keyInfo { get; set; } @@ -220,7 +219,7 @@ namespace IRaCIS.Application.Contracts public class DicViewModelDTO : AddOrUpdateDicDTO { - + } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs index 52258fa1d..a68164179 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/EmailNoticeConfigViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2022-02-15 11:55:57 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using Newtonsoft.Json; namespace IRaCIS.Core.Application.Contracts { public class TrialSelectEmailNoticeConfigView : EmailNoticeConfigView @@ -127,7 +125,7 @@ namespace IRaCIS.Core.Application.Contracts public List CopyUserTypeList { get; set; } - public SysEmailLevel SystemLevel { get; set; } + public SysEmailLevel SystemLevel { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/ExploreRecommendViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/ExploreRecommendViewModel.cs index c61cb31a8..6bdce82e3 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/ExploreRecommendViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/ExploreRecommendViewModel.cs @@ -3,15 +3,12 @@ // 生成时间 2024-07-02 09:29:36 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// ExploreRecommendView 列表视图模型 - public class ExploreRecommendView: ExploreRecommendAddOrEdit + public class ExploreRecommendView : ExploreRecommendAddOrEdit { - + public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } public Guid UpdateUserId { get; set; } @@ -22,7 +19,7 @@ namespace IRaCIS.Core.Application.ViewModel } ///ExploreRecommendQuery 列表查询参数模型 - public class ExploreRecommendQuery:PageInput + public class ExploreRecommendQuery : PageInput { public string? Version { get; set; } @@ -48,7 +45,7 @@ namespace IRaCIS.Core.Application.ViewModel public string Version { get; set; } public string Title { get; set; } - + public bool IsDeleted { get; set; } public string DownloadUrl { get; set; } public string Path { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs index b2d76c285..b80616b31 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/FrontAuditConfigViewModel.cs @@ -3,16 +3,13 @@ // 生成时间 2022-03-28 16:43:52 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; using IRaCIS.Core.Infra.EFCore.Common; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { /// FrontAuditConfigView 列表视图模型 - public class FrontAuditConfigView:FrontAuditConfig + public class FrontAuditConfigView : FrontAuditConfig { public string ChildrenTypeValue { get; set; } = string.Empty; public string ChildrenTypeValueCN { get; set; } = string.Empty; @@ -43,7 +40,7 @@ namespace IRaCIS.Core.Application.ViewModel public class GetChildrenItem { - + public Guid Id { get; set; } } @@ -74,7 +71,7 @@ namespace IRaCIS.Core.Application.ViewModel /// /// 数据源Guids /// - public List DataSourceGuids { get; set; }=new List(){ }; + public List DataSourceGuids { get; set; } = new List() { }; /// /// 添加对象的Guid @@ -106,7 +103,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid? OptTypeId { get; set; } /// ChildrenTypeId - public Guid? ChildrenTypeId { get; set; } + public Guid? ChildrenTypeId { get; set; } public Guid? ModuleTypeId { get; set; } @@ -131,7 +128,7 @@ namespace IRaCIS.Core.Application.ViewModel - public class FrontAuditConfigDTO: FrontAuditConfigAddOrEdit + public class FrontAuditConfigDTO : FrontAuditConfigAddOrEdit { } @@ -158,8 +155,8 @@ namespace IRaCIS.Core.Application.ViewModel public Guid? ParentId { get; set; } public bool IsEnable { get; set; } public Guid? ModuleTypeId { get; set; } - public Guid? OptTypeId { get; set; } - public Guid? ChildrenTypeId { get; set; } + public Guid? OptTypeId { get; set; } + public Guid? ChildrenTypeId { get; set; } public string ConfigType { get; set; } = string.Empty; @@ -172,7 +169,7 @@ namespace IRaCIS.Core.Application.ViewModel public string EnumType { get; set; } = string.Empty; - public Guid? ObjectTypeId { get; set; } + public Guid? ObjectTypeId { get; set; } public bool? IsShowByTrialConfig { get; set; } @@ -244,7 +241,7 @@ namespace IRaCIS.Core.Application.ViewModel /// 日期类型 /// - public string DateType { get; set; }=string.Empty; + public string DateType { get; set; } = string.Empty; /// @@ -285,7 +282,7 @@ namespace IRaCIS.Core.Application.ViewModel /// public string ForeignKeyEnText { get; set; } = string.Empty; - + /// diff --git a/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs index 53b162923..77d83493e 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/InternationalizationViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2023-06-01 13:38:20 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// InternationalizationView 列表视图模型 @@ -33,7 +30,7 @@ namespace IRaCIS.Core.Application.ViewModel public string? ValueCN { get; set; } - public string? Module { get; set; } + public string? Module { get; set; } //关联版本历史记录表Id public Guid? PublishLogId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs index 5cd098251..6d96ccf9a 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/PublishLogViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2023-06-27 15:47:02 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// PublishLogView 列表视图模型 @@ -19,7 +16,7 @@ namespace IRaCIS.Core.Application.ViewModel } ///PublishLogQuery 列表查询参数模型 - public class PublishLogQuery:PageInput + public class PublishLogQuery : PageInput { public string? Version { get; set; } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/SysMessageModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/SysMessageModel.cs index 24f7f5604..44b29f5f4 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/SysMessageModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/SysMessageModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class SysMessageDTO { diff --git a/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs index 7758d3f5d..172632c61 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/SystemBasicDataViewModel.cs @@ -3,21 +3,17 @@ // 生成时间 2022-02-15 15:46:00 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Share; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; namespace IRaCIS.Core.Application.Contracts { /// SystemBasicDataView 列表视图模型 - public class SystemBasicDataView: SystemBasicDataAddOrEdit + public class SystemBasicDataView : SystemBasicDataAddOrEdit { - + public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } - + } @@ -34,7 +30,7 @@ namespace IRaCIS.Core.Application.Contracts ///SystemBasicDataQuery 列表查询参数模型 - public class SystemBasicDataQuery:PageInput + public class SystemBasicDataQuery : PageInput { /// Name public string? Name { get; set; } @@ -57,7 +53,7 @@ namespace IRaCIS.Core.Application.Contracts public string ValueCN { get; set; } = string.Empty; - public bool IsEnable { get; set; }=true; + public bool IsEnable { get; set; } = true; } diff --git a/IRaCIS.Core.Application/Service/Common/DTO/SystemLogModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/SystemLogModel.cs index 32819a63b..98e1cc543 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/SystemLogModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/SystemLogModel.cs @@ -1,6 +1,4 @@ -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class SystemLogDTO { @@ -22,7 +20,7 @@ namespace IRaCIS.Application.Contracts { public string Keyword { get; set; } = string.Empty; public string LogCategory { get; set; } = string.Empty; - public DateTime? BeginTime { get; set; } + public DateTime? BeginTime { get; set; } public DateTime? EndTime { get; set; } } @@ -42,7 +40,7 @@ namespace IRaCIS.Application.Contracts public Guid? OptUserId { get; set; } - public DateTime? StartDate { get; set; } + public DateTime? StartDate { get; set; } public DateTime? EndDate { get; set; } } @@ -82,7 +80,7 @@ namespace IRaCIS.Application.Contracts public class OptUserDto { - public Guid OptUserId { get; set; } + public Guid OptUserId { get; set; } public string OptUser { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/Common/DevelopService.cs b/IRaCIS.Core.Application/Service/Common/DevelopService.cs index c70b19425..d441ee56d 100644 --- a/IRaCIS.Core.Application/Service/Common/DevelopService.cs +++ b/IRaCIS.Core.Application/Service/Common/DevelopService.cs @@ -1,9 +1,4 @@ using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Common { diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index 5ad938f17..17abed632 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -1,22 +1,18 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; +using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infra.EFCore.Common; -using IP2Region.Net.XDB; -using System.Collections; using System.Text; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 数据字典-基础数据维护 /// [ApiExplorerSettings(GroupName = "Common")] - public class DictionaryService (IRepository _dicRepository, + public class DictionaryService(IRepository _dicRepository, IRepository _doctorDictionaryRepository, IRepository _trialDictionaryRepository, IRepository _doctorRepository, @@ -52,7 +48,7 @@ namespace IRaCIS.Application.Services enumCode.AppendLine("}"); // 返回生成的枚举代码 - var enumStr= enumCode.ToString(); + var enumStr = enumCode.ToString(); return ResponseOutput.Ok(enumStr); @@ -96,11 +92,11 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetAllDictionaryKey() { - var result =await _dicRepository.Where(t => t.ParentId == null).OrderBy(x=>x.Code).Select(x => x.Code).ToListAsync(); + var result = await _dicRepository.Where(t => t.ParentId == null).OrderBy(x => x.Code).Select(x => x.Code).ToListAsync(); return result; - } + } /// /// 添加字典 的同时 一起添加子项 --New @@ -117,10 +113,10 @@ namespace IRaCIS.Application.Services IsVerify = true }; - - if((addBasicDicAndChild.DataTypeEnum == DicDataTypeEnum.Enum || addBasicDicAndChild.DataTypeEnum == DicDataTypeEnum.Bool)) + + if ((addBasicDicAndChild.DataTypeEnum == DicDataTypeEnum.Enum || addBasicDicAndChild.DataTypeEnum == DicDataTypeEnum.Bool)) { - if(addBasicDicAndChild.ChildList.GroupBy(t => t.Code).Where(g => g.Count() > 1).Any()) + if (addBasicDicAndChild.ChildList.GroupBy(t => t.Code).Where(g => g.Count() > 1).Any()) { return ResponseOutput.NotOk(_localizer["Dictionary_RepeateCode"]); } @@ -187,11 +183,11 @@ namespace IRaCIS.Application.Services var verifyExp2 = new EntityVerifyExp() { - VerifyExp = t => t.Code == addOrEditBasic.Code && t.ParentId == addOrEditBasic.ParentId && t.Code==addOrEditBasic.Code, + VerifyExp = t => t.Code == addOrEditBasic.Code && t.ParentId == addOrEditBasic.ParentId && t.Code == addOrEditBasic.Code, VerifyMsg = _localizer["Dictionary_RepeateCode"], - IsVerify = addOrEditBasic.ParentId != null && (addOrEditBasic.DataTypeEnum == DicDataTypeEnum.Enum || addOrEditBasic.DataTypeEnum == DicDataTypeEnum.Bool) + IsVerify = addOrEditBasic.ParentId != null && (addOrEditBasic.DataTypeEnum == DicDataTypeEnum.Enum || addOrEditBasic.DataTypeEnum == DicDataTypeEnum.Bool) }; @@ -236,14 +232,14 @@ namespace IRaCIS.Application.Services //return ResponseOutput.NotOk(_localizer["Dictionary_DictionaryDeletion"]); } - if (await _readingTrialCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id)) - { - await _readingTrialCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id); - //---当前字典在标准中被引用,不允许删除! - //return ResponseOutput.NotOk(_localizer["Dictionary_DictionaryDeletion"]); - } + if (await _readingTrialCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id)) + { + await _readingTrialCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id); + //---当前字典在标准中被引用,不允许删除! + //return ResponseOutput.NotOk(_localizer["Dictionary_DictionaryDeletion"]); + } - if (await _dicRepository.AnyAsync(t => t.ParentId == id)) + if (await _dicRepository.AnyAsync(t => t.ParentId == id)) { //---有子项数据,不允许直接删除! return ResponseOutput.NotOk(_localizer["Dictionary_SubitemDeletion"]); @@ -279,7 +275,7 @@ namespace IRaCIS.Application.Services public async Task>> GetBasicDataSelect(string[] searchArray) { - var searchList = await _dicRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider,new { isEn_Us = _userInfo.IsEn_Us}).ToListAsync(); + var searchList = await _dicRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }).ToListAsync(); return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); @@ -397,45 +393,45 @@ namespace IRaCIS.Application.Services List selectCode = new List(); List criterionDictionList = new List(); - var isSystemCriterion = await _readingQuestionCriterionSystem.AnyAsync(x => x.Id == inDto.ReadingCriterionId); + var isSystemCriterion = await _readingQuestionCriterionSystem.AnyAsync(x => x.Id == inDto.ReadingCriterionId); if (isSystemCriterion) { selectCode = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.ReadingCriterionId).Select(x => x.Code).ToListAsync(); - criterionDictionList = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.ReadingCriterionId).Select(x => new BasicDicSelect() - { - ChildGroup = x.Dictionary.ChildGroup, - Code = x.Dictionary.Code, - DataTypeEnum = x.Dictionary.DataTypeEnum, - ShowOrder = x.Dictionary.ShowOrder, - ParentCode = x.ParentCode, - CrterionDictionaryGroup = x.CrterionDictionaryGroup, - Id = x.DictionaryId, - ParentId = x.Dictionary.ParentId, - Value = x.Dictionary.Value, - ValueCN = x.Dictionary.ValueCN + criterionDictionList = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.ReadingCriterionId).Select(x => new BasicDicSelect() + { + ChildGroup = x.Dictionary.ChildGroup, + Code = x.Dictionary.Code, + DataTypeEnum = x.Dictionary.DataTypeEnum, + ShowOrder = x.Dictionary.ShowOrder, + ParentCode = x.ParentCode, + CrterionDictionaryGroup = x.CrterionDictionaryGroup, + Id = x.DictionaryId, + ParentId = x.Dictionary.ParentId, + Value = x.Dictionary.Value, + ValueCN = x.Dictionary.ValueCN - }).ToListAsync(); - } + }).ToListAsync(); + } else { selectCode = await _trialCriterionDictionaryCodeRepository.Where(x => x.TrialCriterionId == inDto.ReadingCriterionId).Select(x => x.Code).ToListAsync(); - criterionDictionList = await _readingTrialCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.ReadingCriterionId).Select(x => new BasicDicSelect() - { - ChildGroup = x.Dictionary.ChildGroup, - Code = x.Dictionary.Code, - DataTypeEnum = x.Dictionary.DataTypeEnum, - ShowOrder = x.Dictionary.ShowOrder, - ParentCode = x.ParentCode, - CrterionDictionaryGroup = x.CrterionDictionaryGroup, - Id = x.DictionaryId, - ParentId = x.Dictionary.ParentId, - Value = x.Dictionary.Value, - ValueCN = x.Dictionary.ValueCN + criterionDictionList = await _readingTrialCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.ReadingCriterionId).Select(x => new BasicDicSelect() + { + ChildGroup = x.Dictionary.ChildGroup, + Code = x.Dictionary.Code, + DataTypeEnum = x.Dictionary.DataTypeEnum, + ShowOrder = x.Dictionary.ShowOrder, + ParentCode = x.ParentCode, + CrterionDictionaryGroup = x.CrterionDictionaryGroup, + Id = x.DictionaryId, + ParentId = x.Dictionary.ParentId, + Value = x.Dictionary.Value, + ValueCN = x.Dictionary.ValueCN - }).ToListAsync(); - } + }).ToListAsync(); + } var criterionCode = await _dicRepository.Where(x => x.ConfigDictionary.Code == "Reading_eCRF_Criterion").Select(x => x.Code).ToListAsync(); @@ -450,7 +446,7 @@ namespace IRaCIS.Application.Services } - + criterionDictionList = criterionDictionList.Where(x => selectCode.Contains(x.ParentCode)).ToList(); @@ -542,48 +538,48 @@ namespace IRaCIS.Application.Services } else { - List selectCode = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemReadingCriterionId).Select(x => x.Code).ToListAsync(); + List selectCode = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemReadingCriterionId).Select(x => x.Code).ToListAsync(); - var criterionCode = await _dicRepository.Where(x => x.ConfigDictionary.Code == "Reading_eCRF_Criterion").Select(x => x.Code).ToListAsync(); + var criterionCode = await _dicRepository.Where(x => x.ConfigDictionary.Code == "Reading_eCRF_Criterion").Select(x => x.Code).ToListAsync(); - foreach (var item in criterionCode) - { - if (result.ContainsKey(item)) - { - result[item] = new List(); - } - } + foreach (var item in criterionCode) + { + if (result.ContainsKey(item)) + { + result[item] = new List(); + } + } - var criterionDictionList = await _readingSystemCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.SystemReadingCriterionId).Select(x => new BasicDicSelect() - { - ChildGroup = x.Dictionary.ChildGroup, - Code = x.Dictionary.Code, - Description = x.Dictionary.Description, - DataTypeEnum = x.Dictionary.DataTypeEnum, - ShowOrder = x.Dictionary.ShowOrder, - ParentCode = x.ParentCode, - Id = x.DictionaryId, - CrterionDictionaryGroup = x.CrterionDictionaryGroup, - ParentId = x.Dictionary.ParentId, - Value = x.Dictionary.Value, - ValueCN = x.Dictionary.ValueCN + var criterionDictionList = await _readingSystemCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.SystemReadingCriterionId).Select(x => new BasicDicSelect() + { + ChildGroup = x.Dictionary.ChildGroup, + Code = x.Dictionary.Code, + Description = x.Dictionary.Description, + DataTypeEnum = x.Dictionary.DataTypeEnum, + ShowOrder = x.Dictionary.ShowOrder, + ParentCode = x.ParentCode, + Id = x.DictionaryId, + CrterionDictionaryGroup = x.CrterionDictionaryGroup, + ParentId = x.Dictionary.ParentId, + Value = x.Dictionary.Value, + ValueCN = x.Dictionary.ValueCN - }).ToListAsync(); + }).ToListAsync(); - criterionDictionList = criterionDictionList.Where(x => selectCode.Contains(x.ParentCode)).ToList(); + criterionDictionList = criterionDictionList.Where(x => selectCode.Contains(x.ParentCode)).ToList(); - var criterionDic = criterionDictionList.GroupBy(x => x.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); + var criterionDic = criterionDictionList.GroupBy(x => x.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); - foreach (var item in criterionDic) - { - result[item.Key] = item.Value; - } + foreach (var item in criterionDic) + { + result[item.Key] = item.Value; + } - return result; + return result; - } + } } diff --git a/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs index 3a18b40e9..b77f5bdbe 100644 --- a/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/EmailNoticeConfigService.cs @@ -5,7 +5,6 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Mvc; using System.Text.RegularExpressions; @@ -18,13 +17,13 @@ namespace IRaCIS.Core.Application.Contracts public class EmailNoticeConfigService(IRepository _emailNoticeConfigrepository, IRepository _emailNoticeUserTypeRepository) : BaseService, IEmailNoticeConfigService { - + [HttpPost] public async Task> GetEmailNoticeConfigList(EmailNoticeConfigQuery inQuery) { var emailNoticeConfigQueryable = _emailNoticeConfigrepository .WhereIf(inQuery.SystemLevel == null, t => t.SystemLevel == SysEmailLevel.not_sys) - .WhereIf(inQuery.SystemLevel!=null, t =>t.SystemLevel == inQuery.SystemLevel) + .WhereIf(inQuery.SystemLevel != null, t => t.SystemLevel == inQuery.SystemLevel) .WhereIf(inQuery.IsDistinguishCriteria != null, t => t.IsDistinguishCriteria == inQuery.IsDistinguishCriteria) .WhereIf(inQuery.CriterionTypeEnum != null, t => t.CriterionTypeEnum == inQuery.CriterionTypeEnum) .WhereIf(inQuery.BusinessScenarioEnum != null, t => t.BusinessScenarioEnum == inQuery.BusinessScenarioEnum) @@ -48,8 +47,8 @@ namespace IRaCIS.Core.Application.Contracts // 匹配所有占位符的正则表达式,允许包含空格的占位符 var regex = new Regex(@"\{\s*\d+\s*\}"); - if (regex.Matches($"{addOrEditEmailNoticeConfig.EmailTopic}{addOrEditEmailNoticeConfig.EmailTopicCN}{addOrEditEmailNoticeConfig.EmailHtmlContent}{addOrEditEmailNoticeConfig.EmailHtmlContentCN}" ) - .Any(t=>t.Value.Contains(" "))) + if (regex.Matches($"{addOrEditEmailNoticeConfig.EmailTopic}{addOrEditEmailNoticeConfig.EmailTopicCN}{addOrEditEmailNoticeConfig.EmailHtmlContent}{addOrEditEmailNoticeConfig.EmailHtmlContentCN}") + .Any(t => t.Value.Contains(" "))) { //邮件模板占位符不允许有空格,请核查占位符的地方 return ResponseOutput.NotOk("EmailNoticeConfig_ContainEmpty"); @@ -98,7 +97,7 @@ namespace IRaCIS.Core.Application.Contracts } - var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false,verifyExp1); + var entity = await _emailNoticeConfigrepository.UpdateFromDTOAsync(addOrEditEmailNoticeConfig, true, false, verifyExp1); return ResponseOutput.Ok(entity.Id.ToString()); diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index fcb0823f4..91e2206a8 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -1,29 +1,14 @@ -using DocumentFormat.OpenXml.Office2010.ExcelAc; -using DocumentFormat.OpenXml.Presentation; -using DocumentFormat.OpenXml.Spreadsheet; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.DTO; -using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using MiniExcelLibs; -using MiniExcelLibs.OpenXml; -using NPOI.HPSF; -using NPOI.HSSF.UserModel; -using NPOI.SS.Formula.Functions; using NPOI.XSSF.UserModel; -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Common { @@ -87,7 +72,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialUserList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialMaintenanceDTO)); @@ -133,7 +118,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + @@ -188,7 +173,7 @@ namespace IRaCIS.Core.Application.Service.Common var exportInfo = data; exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSiteUserSummary_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialSiteUserSummaryDto)); @@ -220,7 +205,7 @@ namespace IRaCIS.Core.Application.Service.Common var query = _trialRepository.AsQueryable() - .WhereIf(inQuery.TrialIdList.Count()>0, o => inQuery.TrialIdList.Contains(o.Id)) + .WhereIf(inQuery.TrialIdList.Count() > 0, o => inQuery.TrialIdList.Contains(o.Id)) .WhereIf(inQuery.SponsorId != null, o => o.SponsorId == inQuery.SponsorId) .WhereIf(!string.IsNullOrEmpty(inQuery.Code), o => o.TrialCode.Contains(inQuery.Code)) @@ -314,7 +299,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialList_Export, exportInfo, exportInfo.TrialCode, _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TrialToBeDoneDto)); @@ -348,7 +333,7 @@ namespace IRaCIS.Core.Application.Service.Common [FromServices] IRepository _trialRepository ) { - var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); + var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId) @@ -433,7 +418,7 @@ namespace IRaCIS.Core.Application.Service.Common var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException(); - exportInfo.List=list; + exportInfo.List = list; exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); @@ -491,7 +476,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialCRCUploadImageList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO)); @@ -550,7 +535,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCVisitImageList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(CRCVisitExportDTO)); @@ -600,7 +585,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialQCImageChanllengeList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(QCChanllengeExportDto)); } @@ -644,7 +629,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectExportDTO)); @@ -720,7 +705,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + var (memoryStream, fileName) = await ExcelExportHelper.DataExport_NpoiTestAsync(StaticData.Export.TrialSubjectProgressList_Export, exportInfo, /*"", */_commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SubjectProgressDto)); @@ -866,7 +851,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyUploadMonitor_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyMonitorExportDto)); @@ -903,7 +888,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectReadingPeriodList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadPeriodExportDto)); @@ -993,7 +978,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyExportDTO)); } @@ -1034,7 +1019,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSubjectVisitCheckList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PMKCheckEXportDTO)); } @@ -1087,7 +1072,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto)); } @@ -1153,7 +1138,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReReadingTaskExportDto)); } @@ -1213,7 +1198,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialMedicalReviewList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(TaskMedicalReviewExportDto)); } @@ -1298,7 +1283,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.CriterionName = await _readingQuestionCriterionTrialRepository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync(); exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialSelfAnalysisList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(SelftAnalysisExport)); } @@ -1402,7 +1387,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.CriterionName = await _readingQuestionCriterionTrialRepository.Where(u => u.TrialId == queryVisitTask.TrialId && u.IsConfirm && u.Id == queryVisitTask.TrialReadingCriterionId).Select(t => t.CriterionName).FirstOrDefaultAsync(); exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(newList, _userInfo.TimeZoneId); ; exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialGroupAnalysisList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(GroupAnalysisExport)); } @@ -1680,7 +1665,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.OverallTumorEvaluation_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(OverallTumorEvaluationExport), criterion.CriterionType); @@ -1740,7 +1725,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list.Where(t => t.ReadingCategory != ReadingCategory.Global).ToList(), _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1EvaluationOfTumorEfficacy_Export, exportInfo, $"{exportInfo.ResearchProgramNo}_{exportInfo.CriterionName}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1EvaluationOfTumorEfficacyExport), criterion.CriterionType); @@ -1829,7 +1814,7 @@ namespace IRaCIS.Core.Application.Service.Common list = DealJudgeMark(criterion.ArbitrationRule, list); exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(exportList, _userInfo.TimeZoneId); exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.RECIST1Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(RECIST1Point1DetailedOfEvaluatedLesionExport), criterion.CriterionType); @@ -1864,7 +1849,7 @@ namespace IRaCIS.Core.Application.Service.Common exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(exportList, _userInfo.TimeZoneId); ; exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId); - + return await ExcelExportHelper.DataExportAsync(StaticData.Export.PCWG3Point1DetailedOfEvaluatedLesion_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(PCWG3DetailedOfEvaluatedLesionExport), criterion.CriterionType); diff --git a/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs b/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs index bccf65ff2..8040f8a90 100644 --- a/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExploreRecommendService.cs @@ -4,11 +4,10 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { /// @@ -47,7 +46,7 @@ namespace IRaCIS.Core.Application.Service VerifyExp = u => u.IsDeleted == addOrEditExploreRecommend.IsDeleted && u.ExploreType == addOrEditExploreRecommend.ExploreType, // "当前类型浏览器启用版本只允许有一个" - VerifyMsg = _localizer["ExploreRecommend_OnlyOneTypePerType"] , + VerifyMsg = _localizer["ExploreRecommend_OnlyOneTypePerType"], IsVerify = addOrEditExploreRecommend.IsDeleted == false }; @@ -62,18 +61,18 @@ namespace IRaCIS.Core.Application.Service [HttpDelete("{exploreRecommendId:guid}")] public async Task DeleteExploreRecommend(Guid exploreRecommendId) { - var success = await _exploreRecommendRepository.DeleteFromQueryAsync(t => t.Id == exploreRecommendId, true,true); + var success = await _exploreRecommendRepository.DeleteFromQueryAsync(t => t.Id == exploreRecommendId, true, true); return ResponseOutput.Ok(); } [AllowAnonymous] - public async Task > GetExploreRecommentInfo() + public async Task> GetExploreRecommentInfo() { var result = await _exploreRecommendRepository.Where(t => t.IsDeleted == false).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - if (result .Count==0) + if (result.Count == 0) { //"系统浏览器版本推荐未维护,请联系维护人员" throw new QueryBusinessObjectNotExistException(_localizer["ExploreRecommend_NoExporeRecord"]); } diff --git a/IRaCIS.Core.Application/Service/Common/FileService.cs b/IRaCIS.Core.Application/Service/Common/FileService.cs index 912a8c41d..90f0b29d2 100644 --- a/IRaCIS.Core.Application/Service/Common/FileService.cs +++ b/IRaCIS.Core.Application/Service/Common/FileService.cs @@ -1,12 +1,10 @@ using IRaCIS.Application.Interfaces; -using System.Text; -using Microsoft.Extensions.Hosting; -using Microsoft.Extensions.Logging; -using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Hosting; +using System.Text; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public class FileService( IDoctorService _doctorService, diff --git a/IRaCIS.Core.Application/Service/Common/Interface/ICommonDocumentService.cs b/IRaCIS.Core.Application/Service/Common/Interface/ICommonDocumentService.cs index ef38e62c5..798474c74 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/ICommonDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/ICommonDocumentService.cs @@ -6,19 +6,19 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ICommonDocumentService - /// - public interface ICommonDocumentService +{ + /// + /// ICommonDocumentService + /// + public interface ICommonDocumentService { - - Task> GetCommonDocumentList(CommonDocumentQuery queryCommonDocument); - - Task AddOrUpdateCommonDocument(CommonDocumentAddOrEdit addOrEditCommonDocument); + + Task> GetCommonDocumentList(CommonDocumentQuery queryCommonDocument); + + Task AddOrUpdateCommonDocument(CommonDocumentAddOrEdit addOrEditCommonDocument); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IDictionaryService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IDictionaryService.cs index 0a2b34f91..7054cfc80 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/IDictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/IDictionaryService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { @@ -12,7 +9,7 @@ namespace IRaCIS.Application.Interfaces /// /// /// - Task GetBoolValueState(bool value); + Task GetBoolValueState(bool value); /// /// 获取审核状态 @@ -21,7 +18,7 @@ namespace IRaCIS.Application.Interfaces /// /// /// - Task GetAuditState(Guid trial, T childCode); + Task GetAuditState(Guid trial, T childCode); /// /// 获取枚举翻译 diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IExploreRecommendService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IExploreRecommendService.cs index 2dc5556b2..47e940895 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/IExploreRecommendService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/IExploreRecommendService.cs @@ -6,19 +6,19 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// IExploreRecommendService - /// - public interface IExploreRecommendService +{ + /// + /// IExploreRecommendService + /// + public interface IExploreRecommendService { - Task> GetExploreRecommendList(ExploreRecommendQuery inQuery); - - Task AddOrUpdateExploreRecommend(ExploreRecommendAddOrEdit addOrEditExploreRecommend); + Task> GetExploreRecommendList(ExploreRecommendQuery inQuery); + + Task AddOrUpdateExploreRecommend(ExploreRecommendAddOrEdit addOrEditExploreRecommend); + + Task DeleteExploreRecommend(Guid exploreRecommendId); - Task DeleteExploreRecommend(Guid exploreRecommendId); - } -} +} diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IFileService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IFileService.cs index 10c6c072a..abc9c6bb8 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/IFileService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/IFileService.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Interfaces +namespace IRaCIS.Application.Interfaces { public interface IFileService { diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IFrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IFrontAuditConfigService.cs index b8c0cabab..dc7a0ad11 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/IFrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/IFrontAuditConfigService.cs @@ -6,20 +6,20 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// IFrontAuditConfigService - /// - public interface IFrontAuditConfigService +{ + /// + /// IFrontAuditConfigService + /// + public interface IFrontAuditConfigService { - - Task> GetFrontAuditConfigList(FrontAuditConfigQuery queryFrontAuditConfig); - - Task AddOrUpdateFrontAuditConfig(FrontAuditConfigAddOrEdit addOrEditFrontAuditConfig); - Task DeleteFrontAuditConfig(Guid frontAuditConfigId); + Task> GetFrontAuditConfigList(FrontAuditConfigQuery queryFrontAuditConfig); + + Task AddOrUpdateFrontAuditConfig(FrontAuditConfigAddOrEdit addOrEditFrontAuditConfig); + + Task DeleteFrontAuditConfig(Guid frontAuditConfigId); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/Common/Interface/ILogService.cs b/IRaCIS.Core.Application/Service/Common/Interface/ILogService.cs index 706b3a0f8..16f8a24f1 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/ILogService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/ILogService.cs @@ -1,7 +1,4 @@ -using System; -using IRaCIS.Application.Contracts; -using System.Collections.Generic; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IMessageService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IMessageService.cs index ddaf0c27e..cf27da4ba 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/IMessageService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/IMessageService.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs b/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs index 600cff5a7..78b1bc5a1 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/IPublishLogService.cs @@ -6,19 +6,19 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// IPublishLogService - /// - public interface IPublishLogService +{ + /// + /// IPublishLogService + /// + public interface IPublishLogService { - Task> GetPublishLogList(PublishLogQuery inQuery); - - Task AddOrUpdatePublishLog(PublishLogAddOrEdit addOrEditPublishLog); + Task> GetPublishLogList(PublishLogQuery inQuery); + + Task AddOrUpdatePublishLog(PublishLogAddOrEdit addOrEditPublishLog); + + Task DeletePublishLog(Guid publishLogId); - Task DeletePublishLog(Guid publishLogId); - } -} +} diff --git a/IRaCIS.Core.Application/Service/Common/Interface/ISystemBasicDataService.cs b/IRaCIS.Core.Application/Service/Common/Interface/ISystemBasicDataService.cs index c0b884446..a36f159bc 100644 --- a/IRaCIS.Core.Application/Service/Common/Interface/ISystemBasicDataService.cs +++ b/IRaCIS.Core.Application/Service/Common/Interface/ISystemBasicDataService.cs @@ -6,20 +6,20 @@ namespace IRaCIS.Core.Application.Contracts -{ - /// - /// ISystemBasicDataService - /// - public interface ISystemBasicDataService +{ + /// + /// ISystemBasicDataService + /// + public interface ISystemBasicDataService { - - Task> GetSystemBasicDataList(SystemBasicDataQuery querySystemBasicData); - - Task AddOrUpdateSystemBasicData(SystemBasicDataAddOrEdit addOrEditSystemBasicData); - Task DeleteSystemBasicData(Guid systemBasicDataId); + Task> GetSystemBasicDataList(SystemBasicDataQuery querySystemBasicData); + + Task AddOrUpdateSystemBasicData(SystemBasicDataAddOrEdit addOrEditSystemBasicData); + + Task DeleteSystemBasicData(Guid systemBasicDataId); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs b/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs index ae9823627..0a4663b0d 100644 --- a/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs +++ b/IRaCIS.Core.Application/Service/Common/InternationalizationService.cs @@ -4,13 +4,11 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application.Service @@ -19,9 +17,9 @@ namespace IRaCIS.Core.Application.Service /// InternationalizationService /// [ApiExplorerSettings(GroupName = "Common")] - public class InternationalizationService (IRepository _internationalizationRepository) : BaseService, IInternationalizationService + public class InternationalizationService(IRepository _internationalizationRepository) : BaseService, IInternationalizationService { - + /// /// 前端国际化内容接口 @@ -140,7 +138,7 @@ namespace IRaCIS.Core.Application.Service await _internationalizationRepository.SaveChangesAsync(); //清理缓存 - await _fusionCache.SetAsync>(CacheKeys.FrontInternational, new List(), TimeSpan.FromDays(1)); + await _fusionCache.SetAsync>(CacheKeys.FrontInternational, new List(), TimeSpan.FromDays(1)); return ResponseOutput.Ok(); } @@ -181,7 +179,7 @@ namespace IRaCIS.Core.Application.Service else { //清理缓存 - await _fusionCache.SetAsync>(CacheKeys.FrontInternational, new List(), TimeSpan.FromDays(1)); + await _fusionCache.SetAsync>(CacheKeys.FrontInternational, new List(), TimeSpan.FromDays(1)); } return ResponseOutput.Ok(entity.Id.ToString()); diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index c9b05b161..a0f71c036 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -1,29 +1,15 @@ -using IRaCIS.Core.Domain.Share; -using MimeKit; -using IRaCIS.Core.Application.Helper; -using MailKit; -using Microsoft.AspNetCore.Hosting; +using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Auth; -using AutoMapper; -using IRaCIS.Application.Contracts; -using Microsoft.Extensions.Options; -using Medallion.Threading; -using System.Text.RegularExpressions; +using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using DocumentFormat.OpenXml.Spreadsheet; -using IRaCIS.Core.Application.Service.Reading.Dto; -using NPOI.SS.Formula.Functions; -using Microsoft.AspNetCore.Mvc.ViewFeatures; -using IRaCIS.Core.Domain.Models; -using DocumentFormat.OpenXml.Office2013.Excel; -using IRaCIS.Core.Application.Contracts; -using DocumentFormat.OpenXml.Vml; -using System.Net.Mail; -using IP2Region.Net.XDB; -using NPOI.SS.Formula.Eval; -using System.Linq; +using MailKit; +using Medallion.Threading; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.Options; +using MimeKit; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public interface IMailVerificationService { @@ -72,7 +58,7 @@ namespace IRaCIS.Application.Services { private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue; - + private async Task GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario scenario, MimeMessage messageToSend, Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailFunc) { @@ -818,7 +804,7 @@ namespace IRaCIS.Application.Services var emailType = await _dictionaryRepository.Where(t => t.Parent.Code == "Email_BusinessScenario" && t.ParentId != null && t.Code == ((int)EmailBusinessScenario.TrialFeedBack).ToString()).Select(t => _userInfo.IsEn_Us ? t.Value : t.ValueCN).FirstOrDefaultAsync(); - var info = await _trialRepository.Where(t => t.Id == feedBack.TrialId).Select(t => new { t.ResearchProgramNo, t.TrialCode }).FirstNotNullAsync(); + var info = await _trialRepository.Where(t => t.Id == feedBack.TrialId).Select(t => new { t.ResearchProgramNo, t.TrialCode }).FirstNotNullAsync(); Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input => { diff --git a/IRaCIS.Core.Application/Service/Common/PublishLogService.cs b/IRaCIS.Core.Application/Service/Common/PublishLogService.cs index 7619bb4a1..86b35a4c0 100644 --- a/IRaCIS.Core.Application/Service/Common/PublishLogService.cs +++ b/IRaCIS.Core.Application/Service/Common/PublishLogService.cs @@ -4,12 +4,10 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Application.Contracts; using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -45,7 +43,7 @@ namespace IRaCIS.Core.Application.Service if (!Version.TryParse(addOrEditPublishLog.Version, out version)) { //"版本号不符合要求" - return ResponseOutput.NotOk(_localizer["PublishLog_NotValidVersion"] ); + return ResponseOutput.NotOk(_localizer["PublishLog_NotValidVersion"]); } var verifyExp1 = new EntityVerifyExp() @@ -61,9 +59,9 @@ namespace IRaCIS.Core.Application.Service VerifyExp = u => u.IsCurrentVersion == addOrEditPublishLog.IsCurrentVersion, //"当前发布版本只允许有一个" - VerifyMsg = _localizer["PublishLog_OnlyOneCurrentVersion"] , + VerifyMsg = _localizer["PublishLog_OnlyOneCurrentVersion"], - IsVerify=addOrEditPublishLog.IsCurrentVersion==true + IsVerify = addOrEditPublishLog.IsCurrentVersion == true }; var entity = await _publishLogRepository.InsertOrUpdateAsync(addOrEditPublishLog, true, verifyExp1, verifyExp2); @@ -88,7 +86,7 @@ namespace IRaCIS.Core.Application.Service if (result == null) { //"系统当前版本未标记,请联系维护人员" - throw new QueryBusinessObjectNotExistException(_localizer["PublishLog_NoCurrentVersion"] ); + throw new QueryBusinessObjectNotExistException(_localizer["PublishLog_NoCurrentVersion"]); } return result; diff --git a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs index 108f6f5ab..0885a6c04 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemBasicDataService.cs @@ -28,7 +28,7 @@ namespace IRaCIS.Core.Application.Services var systemBasicDataQueryable = _systemBasicDataRepository.Where(t => t.ParentId == null) .ProjectTo(_mapper.ConfigurationProvider); - return await systemBasicDataQueryable.ToPagedListAsync(inQuery,nameof(SystemBasicDataView.Code)); + return await systemBasicDataQueryable.ToPagedListAsync(inQuery, nameof(SystemBasicDataView.Code)); } @@ -47,7 +47,7 @@ namespace IRaCIS.Core.Application.Services [HttpGet("{parentId:guid}")] public async Task> GetChildList(Guid parentId) { - return await _systemBasicDataRepository.Where(t => t.ParentId == parentId&&t.IsEnable).OrderBy(t => t.Code).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + return await _systemBasicDataRepository.Where(t => t.ParentId == parentId && t.IsEnable).OrderBy(t => t.Code).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); } @@ -63,7 +63,7 @@ namespace IRaCIS.Core.Application.Services else { - var entity =await _systemBasicDataRepository.Where(t => t.Id == addOrEditSystemBasicData.Id,true).FirstOrDefaultAsync(); + var entity = await _systemBasicDataRepository.Where(t => t.Id == addOrEditSystemBasicData.Id, true).FirstOrDefaultAsync(); _mapper.Map(addOrEditSystemBasicData, entity); await _systemBasicDataRepository.SaveChangesAsync(); @@ -80,7 +80,7 @@ namespace IRaCIS.Core.Application.Services [HttpDelete("{systemBasicDataId:guid}")] public async Task DeleteSystemBasicData(Guid systemBasicDataId) { - var success = await _systemBasicDataRepository.DeleteFromQueryAsync(x=>x.Id== systemBasicDataId); + var success = await _systemBasicDataRepository.DeleteFromQueryAsync(x => x.Id == systemBasicDataId); await _systemBasicDataRepository.SaveChangesAsync(); return ResponseOutput.Result(true); } @@ -95,7 +95,7 @@ namespace IRaCIS.Core.Application.Services public async Task>> GetBasicDataSelect(string[] searchArray) { - var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo(_mapper.ConfigurationProvider,new { _userInfo.IsEn_Us}).ToListAsync(); + var searchList = await _systemBasicDataRepository.Where(t => searchArray.Contains(t.Parent.Code) && t.ParentId != null).ProjectTo(_mapper.ConfigurationProvider, new { _userInfo.IsEn_Us }).ToListAsync(); return searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.ToList()); diff --git a/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs b/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs index 1a24df5fc..138dd1875 100644 --- a/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs +++ b/IRaCIS.Core.Application/Service/Common/SystemMonitor.cs @@ -1,23 +1,7 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Hosting; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; -using Microsoft.Extensions.Configuration.Json; -using IRaCIS.Core.Infrastructure.Extention; -using SharpCompress.Common; -using System.Text.Json; -using System.Text.Json.Nodes; -using System.Text.Encodings.Web; -using Newtonsoft.Json.Linq; -using Newtonsoft.Json; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Helper; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json.Linq; namespace IRaCIS.Core.Application.Service.Common { @@ -63,7 +47,7 @@ namespace IRaCIS.Core.Application.Service.Common { //---解析Json文件配置出现问题 - throw new BusinessValidationFailedException(_localizer["SysMon_JsonConfig"]+e.Message); + throw new BusinessValidationFailedException(_localizer["SysMon_JsonConfig"] + e.Message); } //默认存储的路径 diff --git a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs index 8cd80d6a8..932be43f8 100644 --- a/IRaCIS.Core.Application/Service/Common/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Common/_MapConfig.cs @@ -2,8 +2,6 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service { @@ -71,7 +69,7 @@ namespace IRaCIS.Core.Application.Service CreateMap().ReverseMap(); CreateMap().ReverseMap(); - + CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs index 598a16889..d93db3b63 100644 --- a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs @@ -1,12 +1,9 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 医生文档关联关系维护 @@ -14,7 +11,7 @@ namespace IRaCIS.Application.Services [ApiExplorerSettings(GroupName = "Reviewer")] public class AttachmentService(IRepository _attachmentrepository) : BaseService, IAttachmentService { - + /// /// 删除附件 @@ -22,7 +19,7 @@ namespace IRaCIS.Application.Services /// /// - public async Task DeleteAttachment([FromBody]AttachementCommand param) + public async Task DeleteAttachment([FromBody] AttachementCommand param) { //var attachment = _doctorAttachmentApp.GetDetailById(id); //string file = HostingEnvironment.MapPath(attachment.Path); @@ -37,7 +34,7 @@ namespace IRaCIS.Application.Services // File.Delete(temp); //} - var success =await _attachmentrepository.BatchDeleteNoTrackingAsync(a => a.Id == param.Id); + var success = await _attachmentrepository.BatchDeleteNoTrackingAsync(a => a.Id == param.Id); return ResponseOutput.Result(success); } @@ -52,7 +49,7 @@ namespace IRaCIS.Application.Services public async Task> GetAttachmentByType(Guid doctorId, string type) { var attachmentList = await _attachmentrepository.Where(a => a.DoctorId == doctorId && a.Type.Equals(type)).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); + attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return attachmentList; } @@ -64,11 +61,11 @@ namespace IRaCIS.Application.Services /// 类型数组 /// [HttpPost("{doctorId:guid}")] - public async Task> GetAttachmentByTypes(Guid doctorId, string[] types) + public async Task> GetAttachmentByTypes(Guid doctorId, string[] types) { - var attachmentList =await _attachmentrepository.Where(a => a.DoctorId == doctorId && types.Contains(a.Type)).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); + var attachmentList = await _attachmentrepository.Where(a => a.DoctorId == doctorId && types.Contains(a.Type)).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return attachmentList; } @@ -81,8 +78,8 @@ namespace IRaCIS.Application.Services [HttpGet("{doctorId:guid}")] public async Task> GetAttachments(Guid doctorId) { - var attachmentList =await _attachmentrepository.Where(a => a.DoctorId == doctorId).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); + var attachmentList = await _attachmentrepository.Where(a => a.DoctorId == doctorId).OrderBy(s => s.Type).ThenBy(m => m.CreateTime).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + attachmentList.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return attachmentList; } @@ -91,8 +88,8 @@ namespace IRaCIS.Application.Services public async Task GetDetailById(Guid attachmentId) { var attachment = await _attachmentrepository.FirstOrDefaultAsync(a => a.Id == attachmentId).IfNullThrowException(); - var temp= _mapper.Map(attachment); - temp.FullPath = temp.Path + "?access_token=" + _userInfo.UserToken; + var temp = _mapper.Map(attachment); + temp.FullPath = temp.Path + "?access_token=" + _userInfo.UserToken; return temp; } @@ -129,12 +126,12 @@ namespace IRaCIS.Application.Services //因为界面现实的列表用了 接口返回的列表,所以要把返回的模型对应的字段也要更改 var attach = attachments.First(t => t.Id == reUpload.Id); attach.CreateTime = DateTime.Now; - + //重传的时候,发现 相同语言的官方简历数量为2 那么将重传的简历设置为非官方 if (attachments.Count(t => t.Language == reUpload.Language && t.IsOfficial) == 2) { - await _attachmentrepository.BatchUpdateNoTrackingAsync(t => t.Id == reUpload.Id, u => new Attachment() + await _attachmentrepository.BatchUpdateNoTrackingAsync(t => t.Id == reUpload.Id, u => new Attachment() { Path = reUpload.Path, CreateTime = DateTime.Now, @@ -167,7 +164,7 @@ namespace IRaCIS.Application.Services var list = _mapper.Map>(attachments).ToList(); - list.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); + list.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); return list; } @@ -177,7 +174,7 @@ namespace IRaCIS.Application.Services var newAttachment = _mapper.Map(attachment); //如果这个医生不存在 这个语言的官方简历 就设置为官方简历 - if (! await _attachmentrepository.AnyAsync(t => t.Type == "Resume" && t.DoctorId == attachment.DoctorId && t.Language == attachment.Language && t.IsOfficial)) + if (!await _attachmentrepository.AnyAsync(t => t.Type == "Resume" && t.DoctorId == attachment.DoctorId && t.Language == attachment.Language && t.IsOfficial)) { newAttachment.IsOfficial = true; @@ -210,17 +207,17 @@ namespace IRaCIS.Application.Services /// /// /// - + [HttpPost("{doctorId:guid}/{attachmentId:guid}/{language}")] public async Task SetOfficial(Guid doctorId, Guid attachmentId, int language) { - var resumeList = await _attachmentrepository.Where(t => t.DoctorId == doctorId && t.Type == "Resume" && t.Language == language,true).ToListAsync(); + var resumeList = await _attachmentrepository.Where(t => t.DoctorId == doctorId && t.Type == "Resume" && t.Language == language, true).ToListAsync(); foreach (var item in resumeList) { if (item.Id == attachmentId) item.IsOfficial = true; else item.IsOfficial = false; } - + return ResponseOutput.Result(await _attachmentrepository.SaveChangesAsync()); } @@ -231,11 +228,11 @@ namespace IRaCIS.Application.Services /// /// 0-未设置,1-中文,2-英文 /// - + [HttpPost("{doctorId:guid}/{attachmentId:guid}/{language}")] public async Task SetLanguage(Guid doctorId, Guid attachmentId, int language) { - bool result =await _attachmentrepository.BatchUpdateNoTrackingAsync(t => t.Id == attachmentId, a => new Attachment + bool result = await _attachmentrepository.BatchUpdateNoTrackingAsync(t => t.Id == attachmentId, a => new Attachment { Language = language, IsOfficial = false diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs index 1eb34fc03..d9e6caae0 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs @@ -21,7 +21,7 @@ public Guid DoctorId { get; set; } public string Type { get; set; } = string.Empty; public string Path { get; set; } = string.Empty; - public string FullPath => Path; + public string FullPath => Path; public string FileName { get; set; } = string.Empty; } @@ -51,7 +51,7 @@ public Guid DoctorId { get; set; } public string Type { get; set; } = string.Empty; public string Path { get; set; } = string.Empty; - public string FullPath => Path; + public string FullPath => Path; public string FileName { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorAccountRegisterModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorAccountRegisterModel.cs index 456a61b78..50134c423 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorAccountRegisterModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorAccountRegisterModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class DoctorAccountRegisterModel : DoctorAccountLoginDTO { diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs index c9c49cfde..6a7d53d27 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/DoctorModel.cs @@ -1,10 +1,5 @@ -using System; -using System.Collections.Generic; - -using IRaCIS.Core.Infrastructure.Extention; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; -using System.Linq; namespace IRaCIS.Application.Contracts { @@ -141,9 +136,9 @@ namespace IRaCIS.Application.Contracts public List TitleIdList { get; set; } = new List(); public Guid? DepartmentId { get; set; } public Guid? SpecialityId { get; set; } - public Guid? PositionId { get; set; } + public Guid? PositionId { get; set; } public Guid? RankId { get; set; } - public Guid? HospitalId { get; set; } + public Guid? HospitalId { get; set; } //合作状态 public ContractorStatusEnum? ContractorStatus { get; set; } @@ -203,7 +198,7 @@ namespace IRaCIS.Application.Contracts public class ConfirmationReviewerDTO : DoctorOptDTO { - public int DoctorTrialState { get; set; } + public int DoctorTrialState { get; set; } public string OptUserName { get; set; } = string.Empty; public DateTime? OptTime { get; set; } public string? OptTimeStr => OptTime?.ToString("yyyy-MM-dd HH:mm:ss"); @@ -308,7 +303,7 @@ namespace IRaCIS.Application.Contracts public class DoctorBasicInfoCommand : DoctorBasicInfo { - + //职称 public List TitleIds { get; set; } = new List(); } @@ -342,11 +337,11 @@ namespace IRaCIS.Application.Contracts //职称 public List TitleIds => DoctorDicViewDtos.Select(t => t.Id).ToList(); - - public List TitleList=> DoctorDicViewDtos.Select(t => t.Value).ToList(); - - public List TitleCNList=> DoctorDicViewDtos.Select(t => t.ValueCN).ToList(); - + + public List TitleList => DoctorDicViewDtos.Select(t => t.Value).ToList(); + + public List TitleCNList => DoctorDicViewDtos.Select(t => t.ValueCN).ToList(); + #region ef select //[JsonIgnore] //public List TempObjList { get; set; } @@ -403,7 +398,7 @@ namespace IRaCIS.Application.Contracts public string FileName { get; set; } = string.Empty; public string TrialCode { get; set; } = string.Empty; public string FilePath { get; set; } = string.Empty; - public string FullPath { get { return FilePath; } } + public string FullPath { get { return FilePath; } } public DateTime CreateTime { get; set; } } @@ -784,12 +779,12 @@ namespace IRaCIS.Application.Contracts public DateTime CreateTime { get; set; } - + } - public class GetDoctorCriterionFileInDto + public class GetDoctorCriterionFileInDto { - public Guid DoctorId { get; set; } + public Guid DoctorId { get; set; } /// /// 文件类型 @@ -828,7 +823,7 @@ namespace IRaCIS.Application.Contracts { public string KeyWord { get; set; } = String.Empty; - public Guid? CroId { get; set; } + public Guid? CroId { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/EducationModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/EducationModel.cs index f9fdbdee8..470e389d9 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/EducationModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/EducationModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class EducationCommand { @@ -28,7 +25,7 @@ namespace IRaCIS.Application.Contracts public class EducationInfoViewModel : EducationCommand { public DateTime? CreateTime { get; set; } - public string BeginDateStr => BeginDate.ToString("yyyy-MM"); + public string BeginDateStr => BeginDate.ToString("yyyy-MM"); public string EndDateStr => EndDate.ToString("yyyy-MM"); } @@ -36,9 +33,9 @@ namespace IRaCIS.Application.Contracts { public Guid? Id { get; set; } public Guid DoctorId { get; set; } - + public DateTime BeginDate { get; set; } - + public DateTime EndDate { get; set; } public string Training { get; set; } = String.Empty; @@ -72,7 +69,7 @@ namespace IRaCIS.Application.Contracts } - public class PostgraduateViewModel: PostgraduateCommand + public class PostgraduateViewModel : PostgraduateCommand { public DateTime? CreateTime { get; set; } public string BeginDateStr => BeginDate.ToString("yyyy-MM"); @@ -81,9 +78,9 @@ namespace IRaCIS.Application.Contracts } public class DoctorEducationExperienceDTO { - public IEnumerable EducationList=new List(); + public IEnumerable EducationList = new List(); - public IEnumerable PostgraduateList = new List(); + public IEnumerable PostgraduateList = new List(); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/HolidayModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/HolidayModel.cs index 8635d431a..6c6a372ea 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/HolidayModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/HolidayModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class VacationCommand { diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs index d5a61a587..e34b22a11 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/ResearchPublicationModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class ResearchPublicationDTO { diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/TrialExperienceModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/TrialExperienceModel.cs index 4ed924c61..d8bd3e174 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/TrialExperienceModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/TrialExperienceModel.cs @@ -25,7 +25,7 @@ } - public class TrialExperienceListDTO: TrialExperienceCommand + public class TrialExperienceListDTO : TrialExperienceCommand { public string Phase { get; set; } = String.Empty; @@ -58,7 +58,7 @@ public Guid? GCPId { get; set; } - public string OtherClinicalExperience { get; set; }=String.Empty; + public string OtherClinicalExperience { get; set; } = String.Empty; public string OtherClinicalExperienceCN { get; set; } = String.Empty; public string Type { get; set; } = string.Empty; @@ -74,7 +74,7 @@ public Guid Id { get; set; } public int GCP { get; set; } - public Guid? GCPId { get; set; } + public Guid? GCPId { get; set; } } public class ClinicalExperienceCommand diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs index 12d447cb8..be410634e 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DoctorListService.cs @@ -1,20 +1,19 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; -using System.Linq.Dynamic.Core; -using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Mvc; +using System.Linq.Dynamic.Core; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Reviewer")] - public class DoctorListService ( + public class DoctorListService( IRepository _doctorRepository, IRepository _enrollRepository, IRepository _enrollDetailRepository, IRepository _trialRepository) : BaseService, IDoctorListQueryService { - + /// /// Reviewer列表分页查询 @@ -66,7 +65,7 @@ namespace IRaCIS.Application.Services ReviewerSelectionQueryDTO inQuery) { //项目配置需要的医生过滤 2表示混合 - var trialConfig = await _trialRepository.Where(s => s.Id == inQuery.TrialId).Select(t=>new { t.AttendedReviewerTypeEnumList ,t.TrialType} ).FirstOrDefaultAsync().IfNullThrowException(); + var trialConfig = await _trialRepository.Where(s => s.Id == inQuery.TrialId).Select(t => new { t.AttendedReviewerTypeEnumList, t.TrialType }).FirstOrDefaultAsync().IfNullThrowException(); //var nation = trialConfig.AttendedReviewerType; // 临床项目经验 多选 @@ -78,15 +77,15 @@ namespace IRaCIS.Application.Services var guidList = inQuery.ReadingTypeIdList.Concat(inQuery.SubspecialityIdList).Concat(inQuery.TitleIdList); var query = _doctorRepository/*.WhereIf(nation != AttendedReviewerType.USAndCN, t => t.Nation ==(int) nation)*/ - + .WhereIf(inQuery.DepartmentId != null, t => t.DepartmentId == inQuery.DepartmentId) .WhereIf(inQuery.SpecialityId != null, t => t.SpecialityId == inQuery.SpecialityId) - .WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual ==true) + .WhereIf(trialConfig.TrialType == TrialType.NoneOfficial, t => t.IsVirtual == true) .WhereIf(trialConfig.TrialType != TrialType.NoneOfficial, t => t.IsVirtual == false) .WhereIf(inQuery.HospitalId != null, t => t.HospitalId == inQuery.HospitalId) .WhereIf(inQuery.PositionId != null, t => t.PositionId == inQuery.PositionId) .WhereIf(inQuery.RankId != null, t => t.RankId == inQuery.RankId) - .WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus ) + .WhereIf(inQuery.ContractorStatus != null, t => t.CooperateStatus == inQuery.ContractorStatus) .WhereIf(inQuery.InformationConfirmed != null, t => t.ResumeStatus == inQuery.InformationConfirmed) .WhereIf(inQuery.AcceptingNewTrial != null, t => t.AcceptingNewTrial == inQuery.AcceptingNewTrial) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ChineseName.Contains(inQuery.Name) || (t.LastName + t.FirstName).Contains(inQuery.Name)) @@ -101,7 +100,7 @@ namespace IRaCIS.Application.Services var result = await query.ToPagedListAsync(inQuery); //是否已申请 申请时间 申请人 - var doctorStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume) + var doctorStateList = await _enrollDetailRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus == EnrollStatus.HasApplyDownloadResume) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); result.CurrentPageData.ToList().ForEach(doctor => @@ -150,7 +149,7 @@ namespace IRaCIS.Application.Services .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - + doctorPageList.CurrentPageData.ToList().ForEach(u => { @@ -181,7 +180,7 @@ namespace IRaCIS.Application.Services var opt = enrollCommitList.FirstOrDefault(t => t.DoctorId == u.Id); if (opt != null) { - + u.SubmmitTime = opt.OptTime; u.SubmmitUserName = opt.OptUserName; } @@ -240,7 +239,7 @@ namespace IRaCIS.Application.Services { - var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup) + var doctorQuery = _enrollRepository.Where(x => x.TrialId == inQuery.TrialId && x.EnrollStatus >= EnrollStatus.InviteIntoGroup) .ProjectTo(_mapper.ConfigurationProvider); var doctorPageList = await doctorQuery.ToPagedListAsync(inQuery); diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs index 50cdd9746..2536fd9c4 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs @@ -1,12 +1,10 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Mvc; -using System.Linq.Expressions; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Reviewer")] public class DoctorService( @@ -20,7 +18,7 @@ namespace IRaCIS.Application.Services IRepository _trialExtRepository ) : BaseService, IDoctorService { - + @@ -36,7 +34,7 @@ namespace IRaCIS.Application.Services { Expression> verifyExp = t => t.Phone == basicInfoModel.Phone || t.EMail == basicInfoModel.EMail; - //---current phone or email number already existed + //---current phone or email number already existed var verifyPair = new KeyValuePair>, string>(verifyExp, _localizer["Doctor_DupPhoneOrEmail"]); if (basicInfoModel.Id == Guid.Empty || basicInfoModel.Id == null) @@ -47,13 +45,13 @@ namespace IRaCIS.Application.Services //验证用户手机号 if (await _doctorRepository.AnyAsync(t => t.Phone == doctor.Phone)) { - //---The current phone number already existed! + //---The current phone number already existed! return ResponseOutput.NotOk(_localizer["Doctor_DupPhone"], new DoctorBasicInfoCommand()); } if (await _doctorRepository.AnyAsync(t => t.EMail == doctor.EMail)) { - //---The current email already existed! + //---The current email already existed! return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new DoctorBasicInfoCommand()); } @@ -84,13 +82,13 @@ namespace IRaCIS.Application.Services var phone = updateModel.Phone.Trim(); if ((await _doctorRepository.FirstOrDefaultAsync(t => t.Phone == phone && t.Id != updateModel.Id)) != null) { - //---The current phone number already existed! + //---The current phone number already existed! return ResponseOutput.NotOk(_localizer["Doctor_DupPhone"], new DoctorBasicInfoCommand()); } var email = updateModel.EMail.Trim(); if (await _doctorRepository.AnyAsync(t => t.EMail == email && t.Id != updateModel.Id)) { - //---The current email already existed! + //---The current email already existed! return ResponseOutput.NotOk(_localizer["Doctor_DupEmail"], new DoctorBasicInfoCommand()); } @@ -461,7 +459,7 @@ namespace IRaCIS.Application.Services public async Task AddDoctorCriterionFile(AddDoctorCriterionFileDto inDto) { - if (await _doctorCriterionFileRepository.AnyAsync(x => inDto.IsEnable && x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.TrialId==inDto.TrialId &&x.TrialReadingCriterionId==inDto.TrialReadingCriterionId && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id)) + if (await _doctorCriterionFileRepository.AnyAsync(x => inDto.IsEnable && x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id)) { //-----------当前标准已添加过此类型文件 throw new BusinessValidationFailedException(_localizer["Doctor_StandardDuplicateFileTypeError"]); diff --git a/IRaCIS.Core.Application/Service/Doctor/EducationService.cs b/IRaCIS.Core.Application/Service/Doctor/EducationService.cs index 5f12ce29d..db17face0 100644 --- a/IRaCIS.Core.Application/Service/Doctor/EducationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/EducationService.cs @@ -1,20 +1,17 @@  -using IRaCIS.Application.Interfaces; using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Reviewer")] public class EducationService( IRepository _postgraduateRepository, IRepository _educationRepository) : BaseService, IEducationService { - + /// /// 根据医生Id获取医生教育经历和继续学习经历列表 /// @@ -81,7 +78,7 @@ namespace IRaCIS.Application.Services } - + [HttpDelete, Route("{doctorId:guid}")] public async Task DeleteEducationInfo(Guid id) { @@ -90,7 +87,7 @@ namespace IRaCIS.Application.Services return ResponseOutput.Result(success); } /// 添加/更新医生继续学习经历 - + [HttpPost] public async Task AddOrUpdatePostgraduateInfo(PostgraduateCommand postgraduateViewModel) { @@ -114,7 +111,7 @@ namespace IRaCIS.Application.Services //} #endregion - var entity = await _postgraduateRepository.InsertOrUpdateAsync(postgraduateViewModel, true); + var entity = await _postgraduateRepository.InsertOrUpdateAsync(postgraduateViewModel, true); return ResponseOutput.Ok(entity.Id); } /// @@ -122,7 +119,7 @@ namespace IRaCIS.Application.Services /// /// 医生Id /// - + [HttpDelete("{doctorId:guid}")] public async Task DeletePostgraduateInfo(Guid doctorId) { diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IAttachmentService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IAttachmentService.cs index f93c4786e..03c7b9fcd 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IAttachmentService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IAttachmentService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; - -using IRaCIS.Application.Contracts; - -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { @@ -12,7 +7,7 @@ namespace IRaCIS.Application.Interfaces Task> SaveAttachments(IEnumerable attachmentList); - Task> AddAttachment(AttachmentDTO attachment); + Task> AddAttachment(AttachmentDTO attachment); Task DeleteAttachment(AttachementCommand param); Task GetDetailById(Guid attachmentId); Task> GetAttachmentByType(Guid doctorId, string type); diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorAccountService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorAccountService.cs index 44d21496f..7be0e8e6e 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorAccountService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorAccountService.cs @@ -1,7 +1,4 @@ -using System; - -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorListQueryService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorListQueryService.cs index 8c8faf99e..a187c3571 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorListQueryService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorListQueryService.cs @@ -7,7 +7,7 @@ namespace IRaCIS.Application.Interfaces /// /// 医生多条件查询 /// - Task> GetDoctorSearchList(DoctorSearchDTO param); + Task> GetDoctorSearchList(DoctorSearchDTO param); /// /// 筛选医生列表 @@ -15,18 +15,18 @@ namespace IRaCIS.Application.Interfaces /// /// // - Task> GetSelectionReviewerList( - ReviewerSelectionQueryDTO doctorSearchModel); + Task> GetSelectionReviewerList( + ReviewerSelectionQueryDTO doctorSearchModel); /// /// //入组 相关接口 (提交CRO-1) CRO确认-4 /// - Task> GetSubmissionOrApprovalReviewerList( - ReviewerSubmissionQueryDTO doctorIntoGroupSearchModel); + Task> GetSubmissionOrApprovalReviewerList( + ReviewerSubmissionQueryDTO doctorIntoGroupSearchModel); //医生确认状态列表 - Task> GetConfirmationReviewerList( - ReviewerConfirmationQueryDTO trialIdPageModel); + Task> GetConfirmationReviewerList( + ReviewerConfirmationQueryDTO trialIdPageModel); } } diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorService.cs index cffc2524c..6cd2c9d01 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IDoctorService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { @@ -21,7 +18,7 @@ namespace IRaCIS.Application.Interfaces /// /// /// - Task> AddOrUpdateDoctorBasicInfo(DoctorBasicInfoCommand addBasicInfoParam); + Task> AddOrUpdateDoctorBasicInfo(DoctorBasicInfoCommand addBasicInfoParam); #endregion diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IEducationService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IEducationService.cs index 958fdaed3..5c1fbaa2c 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IEducationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IEducationService.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IResearchPublicationService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IResearchPublicationService.cs index ba983dede..dcc200590 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IResearchPublicationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IResearchPublicationService.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/ITrialExperienceService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/ITrialExperienceService.cs index bb803c376..68c679246 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/ITrialExperienceService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/ITrialExperienceService.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Doctor/Interface/IVacationService.cs b/IRaCIS.Core.Application/Service/Doctor/Interface/IVacationService.cs index 834864a99..3f7b10dcf 100644 --- a/IRaCIS.Core.Application/Service/Doctor/Interface/IVacationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/Interface/IVacationService.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; - -using IRaCIS.Application.Contracts; - -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { @@ -12,7 +7,7 @@ namespace IRaCIS.Application.Interfaces Task AddOrUpdateVacation(VacationCommand vacationViewModel); Task DeleteVacation(Guid id); Task> GetVacationList(Guid doctorId, int pageIndex, int pageSize); - + /// 判断当前时间是否在休假 Task OnVacation(Guid reviewerId); } diff --git a/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs b/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs index 97a0f2ef4..a536251d0 100644 --- a/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/ResearchPublicationService.cs @@ -1,13 +1,13 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Reviewer")] public class ResearchPublicationService(IRepository _researchPublicationRepository) : BaseService, IResearchPublicationService { - + /// /// 查询-医生科学研究信息 @@ -23,7 +23,7 @@ namespace IRaCIS.Application.Services return doctorScientificResearchInfo!; } - + [HttpPost] public async Task AddOrUpdateResearchPublication(ResearchPublicationDTO param) { diff --git a/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs b/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs index 6fd328a0b..34416fc6f 100644 --- a/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/TrialExperienceService.cs @@ -1,8 +1,8 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Reviewer")] public class TrialExperienceService( @@ -12,7 +12,7 @@ namespace IRaCIS.Application.Services IRepository _attachmentRepository ) : BaseService, ITrialExperienceService { - + /// @@ -40,7 +40,7 @@ namespace IRaCIS.Application.Services trialExperience.ExpiryDateStr = attachment.ExpiryDate == null ? "" : attachment.ExpiryDate.Value.ToString("yyyy-MM-dd HH:mm"); trialExperience.Path = attachment.Path; - trialExperience.GCPFullPath = attachment.Path + "?access_token=" + _userInfo.UserToken; + trialExperience.GCPFullPath = attachment.Path + "?access_token=" + _userInfo.UserToken; trialExperience.Type = attachment.Type; trialExperience.FileName = attachment.FileName; trialExperience.GCPId = attachment.Id; @@ -56,10 +56,10 @@ namespace IRaCIS.Application.Services .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); return doctorClinicalTrialExperienceList; - + } /// 添加或更新医生临床经验列表项 - + [HttpPost] public async Task AddOrUpdateTrialExperience(TrialExperienceCommand trialExperienceViewModel) { @@ -114,7 +114,7 @@ namespace IRaCIS.Application.Services /// /// 删除临床经验 /// - + [HttpDelete, Route("{doctorId:guid}")] public async Task DeleteTrialExperience(Guid doctorId) { @@ -126,7 +126,7 @@ namespace IRaCIS.Application.Services /// /// /// - + [HttpPost] public async Task UpdateGcpExperience(GCPExperienceCommand updateGCPExperienceParam) { @@ -135,12 +135,12 @@ namespace IRaCIS.Application.Services var successs = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == updateGCPExperienceParam.Id, u => new Doctor() { GCP = updateGCPExperienceParam.GCP, - GCPId = (updateGCPExperienceParam.GCP==0||updateGCPExperienceParam.GCPId==null)?Guid.Empty: updateGCPExperienceParam.GCPId!.Value + GCPId = (updateGCPExperienceParam.GCP == 0 || updateGCPExperienceParam.GCPId == null) ? Guid.Empty : updateGCPExperienceParam.GCPId!.Value }); - if (updateGCPExperienceParam.GCP == 0 ) + if (updateGCPExperienceParam.GCP == 0) { - await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.DoctorId == updateGCPExperienceParam.Id && a.Type=="GCP"); + await _attachmentRepository.BatchDeleteNoTrackingAsync(a => a.DoctorId == updateGCPExperienceParam.Id && a.Type == "GCP"); } return ResponseOutput.Result(successs, updateGCPExperienceParam.GCPId.ToString()); @@ -150,7 +150,7 @@ namespace IRaCIS.Application.Services /// /// 更新其他技能经验 /// - + [HttpPost] public async Task UpdateOtherExperience(ClinicalExperienceCommand updateOtherClinicalExperience) { diff --git a/IRaCIS.Core.Application/Service/Doctor/VacationService.cs b/IRaCIS.Core.Application/Service/Doctor/VacationService.cs index dff6bd463..ea79cba2d 100644 --- a/IRaCIS.Core.Application/Service/Doctor/VacationService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/VacationService.cs @@ -1,15 +1,14 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - [ ApiExplorerSettings(GroupName = "Reviewer")] - public class VacationService (IRepository _vacationRepository) : BaseService, IVacationService + [ApiExplorerSettings(GroupName = "Reviewer")] + public class VacationService(IRepository _vacationRepository) : BaseService, IVacationService { - + /// /// 添加休假时间段 /// @@ -19,7 +18,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task AddOrUpdateVacation(VacationCommand param) { - if (param.Id == Guid.Empty|| param.Id ==null) + if (param.Id == Guid.Empty || param.Id == null) { var result = await _vacationRepository.AddAsync(_mapper.Map(param)); @@ -47,7 +46,7 @@ namespace IRaCIS.Application.Services /// /// 记录Id /// - + [HttpDelete("{holidayId:guid}")] public async Task DeleteVacation(Guid holidayId) { @@ -67,8 +66,8 @@ namespace IRaCIS.Application.Services var query = _vacationRepository.Where(u => u.DoctorId == doctorId) .ProjectTo(_mapper.ConfigurationProvider); - return await query.ToPagedListAsync(new PageInput() { PageIndex = pageIndex,PageSize=pageSize },nameof(VacationCommand.StartDate)); - + return await query.ToPagedListAsync(new PageInput() { PageIndex = pageIndex, PageSize = pageSize }, nameof(VacationCommand.StartDate)); + } [NonDynamicMethod] diff --git a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs index 692e9c4f0..c841db91e 100644 --- a/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Doctor/_MapConfig.cs @@ -2,7 +2,6 @@ using AutoMapper.EquivalencyExpression; using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts.Pay; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service @@ -84,7 +83,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.User.UserName)); CreateMap().IncludeMembers(t => t.Hospital).Include() - .ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t=>t.DoctorUserId!=null).Select(c=>c.DoctorUser.UserName).FirstOrDefault())) + .ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault())) .ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value)) .ForMember(d => d.DepartmentCN, u => u.MapFrom(s => s.Department.ValueCN)) .ForMember(d => d.Position, u => u.MapFrom(s => s.Position.Value)) @@ -118,7 +117,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.DoctorDicViewDtos, t => t.MapFrom(u => u.DoctorDicRelationList.Where(t => t.KeyName == StaticData.Title).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder))); CreateMap() - .ForMember(t=>t.ParentCode,u=>u.MapFrom(c=>c.Parent.Code)); + .ForMember(t => t.ParentCode, u => u.MapFrom(c => c.Parent.Code)); //CreateMap(); CreateMap() @@ -155,8 +154,8 @@ namespace IRaCIS.Core.Application.Service #endregion - + } } - + } diff --git a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs index 1082bfa7f..00f433f3d 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/SystemDocumentViewModel.cs @@ -3,10 +3,6 @@ // 生成时间 2022-01-05 09:17:10 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts @@ -18,9 +14,9 @@ namespace IRaCIS.Core.Application.Contracts public DateTime CreateTime { get; set; } public DateTime UpdateTime { get; set; } - public string FileType { get; set; } = string.Empty; + public string FileType { get; set; } = string.Empty; - public List NeedConfirmedUserTypeList { get; set; }=new List(); + public List NeedConfirmedUserTypeList { get; set; } = new List(); } public class UnionDocumentView : SystemDocumentAddOrEdit @@ -31,11 +27,11 @@ namespace IRaCIS.Core.Application.Contracts public bool IsSystemDoc { get; set; } - public string FileType { get; set; } = string.Empty; + public string FileType { get; set; } = string.Empty; } - public class TrialSignDocView:UnionDocumentWithConfirmInfoView + public class TrialSignDocView : UnionDocumentWithConfirmInfoView { public string TrialCode { get; set; } public string ResearchProgramNo { get; set; } @@ -45,9 +41,9 @@ namespace IRaCIS.Core.Application.Contracts } - public class UnionDocumentWithConfirmInfoView: UnionDocumentView + public class UnionDocumentWithConfirmInfoView : UnionDocumentView { - + public DateTime? ConfirmTime { get; set; } @@ -60,7 +56,7 @@ namespace IRaCIS.Core.Application.Contracts public string RealName { get; set; } = string.Empty; - public Guid UserTypeId { get; set; } + public Guid UserTypeId { get; set; } public string UserTypeShortName { get; set; } = string.Empty; } @@ -73,7 +69,7 @@ namespace IRaCIS.Core.Application.Contracts public string RealName { get; set; } = string.Empty; } - public class DocumentUnionWithUserStatView: UnionDocumentView + public class DocumentUnionWithUserStatView : UnionDocumentView { public int? DocumentUserCount { get; set; } public int? DocumentConfirmedUserCount { get; set; } @@ -97,7 +93,7 @@ namespace IRaCIS.Core.Application.Contracts } - + @@ -131,7 +127,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid? FileTypeId { get; set; } - public string TrialCode { get; set;} = string.Empty; + public string TrialCode { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; @@ -140,7 +136,7 @@ namespace IRaCIS.Core.Application.Contracts } - public class TrialUserDocUnionQuery: PageInput + public class TrialUserDocUnionQuery : PageInput { [NotDefault] public Guid TrialId { get; set; } @@ -156,7 +152,7 @@ namespace IRaCIS.Core.Application.Contracts public class UserConfirmCommand { - + [NotDefault] public Guid DocumentId { get; set; } @@ -168,14 +164,14 @@ namespace IRaCIS.Core.Application.Contracts public class DocumentTrialUnionQuery : TrialUserDocUnionQuery { - + public Guid? UserTypeId { get; set; } public Guid? UserId { get; set; } - public bool? IsConfirmed { get; set; } + public bool? IsConfirmed { get; set; } - public bool? IsDeleted { get; set; } - } + public bool? IsDeleted { get; set; } + } /// SystemDocumentAddOrEdit 列表查询参数模型 public class SystemDocumentAddOrEdit @@ -194,7 +190,7 @@ namespace IRaCIS.Core.Application.Contracts public class AddOrEditSystemDocument : SystemDocumentAddOrEdit { - public List NeedConfirmedUserTypeIdList { get; set; }=new List(); + public List NeedConfirmedUserTypeIdList { get; set; } = new List(); } } diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentUserConfirmViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentUserConfirmViewModel.cs index 8bd7c33a1..0875044eb 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentUserConfirmViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentUserConfirmViewModel.cs @@ -3,8 +3,6 @@ // 生成时间 2022-01-05 09:17:10 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using System.Collections.Generic; namespace IRaCIS.Core.Application.Contracts { /// TrialDocumentUserConfirmView 列表视图模型 @@ -28,7 +26,7 @@ namespace IRaCIS.Core.Application.Contracts - + public class NeedConfirmedUserTypeView @@ -39,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts } - + } diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs index 487809bb1..eae1fc362 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialDocumentViewModel.cs @@ -4,7 +4,6 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Infrastructure.Extention; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts @@ -14,7 +13,7 @@ namespace IRaCIS.Core.Application.Contracts { public string FullFilePath { get; set; } = String.Empty; - public bool IsSomeUserSigned{get;set;} + public bool IsSomeUserSigned { get; set; } public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } @@ -33,8 +32,8 @@ namespace IRaCIS.Core.Application.Contracts ///TrialDocumentQuery 列表查询参数模型 public class TrialDocumentQuery : PageInput { - public bool? IsDeleted { get; set; } - public Guid? FileTypeId { get; set; } + public bool? IsDeleted { get; set; } + public Guid? FileTypeId { get; set; } public Guid? UserTypeId { get; set; } @@ -63,7 +62,7 @@ namespace IRaCIS.Core.Application.Contracts } - public class AddOrEditTrialDocument: TrialDocumentAddOrEdit + public class AddOrEditTrialDocument : TrialDocumentAddOrEdit { public List NeedConfirmedUserTypeIdList { get; set; } = new List(); @@ -71,7 +70,7 @@ namespace IRaCIS.Core.Application.Contracts - + } diff --git a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs index 432e065bf..321c33568 100644 --- a/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs +++ b/IRaCIS.Core.Application/Service/Document/DTO/TrialEmailNoticeConfigViewModel.cs @@ -3,11 +3,8 @@ // 生成时间 2022-10-20 11:52:31 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using Newtonsoft.Json; namespace IRaCIS.Core.Application.ViewModel { diff --git a/IRaCIS.Core.Application/Service/Document/EmailSendService.cs b/IRaCIS.Core.Application/Service/Document/EmailSendService.cs index 134cf278a..fc6081944 100644 --- a/IRaCIS.Core.Application/Service/Document/EmailSendService.cs +++ b/IRaCIS.Core.Application/Service/Document/EmailSendService.cs @@ -1,24 +1,7 @@ -using DocumentFormat.OpenXml.EMMA; -using DocumentFormat.OpenXml.Spreadsheet; -using IRaCIS.Application.Contracts; -using IRaCIS.Application.Interfaces; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using MailKit; using Microsoft.Extensions.Options; -using Microsoft.VisualBasic; -using MimeKit; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Net.Mail; -using System.Text; -using System.Threading.Tasks; -using static IRaCIS.Core.Domain.Share.StaticData; namespace IRaCIS.Core.Application.Service { @@ -31,7 +14,7 @@ namespace IRaCIS.Core.Application.Service Task SendTrialQCQuestionEmailAsync(Guid trialId); Task SendTrialImageQuestionAsync(Guid trialId); - Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null); + Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func topicAndHtmlFunc, Guid? siteId = null, Guid? trialReadingCriterionId = null); } public class EmailSendService( @@ -42,9 +25,9 @@ namespace IRaCIS.Core.Application.Service IRepository _trialSiteUserRepository, IOptionsMonitor _SystemEmailSendConfig) : BaseService, IEmailSendService { - - public static string EmailNamePlaceholder => StaticData. EmailSend.EmailNamePlaceholder; + + public static string EmailNamePlaceholder => StaticData.EmailSend.EmailNamePlaceholder; @@ -87,30 +70,30 @@ namespace IRaCIS.Core.Application.Service if (isEnrollment == true) { - Func topicAndHtmlFunc = trialEmailConfig => + Func topicAndHtmlFunc = trialEmailConfig => { var topicStr = string.Format(isEn_us ? trialEmailConfig.EmailTopic : trialEmailConfig.EmailTopicCN, taskInfo.ResearchProgramNo, taskInfo.SubjectCode); var htmlBodyStr = string.Format(isEn_us ? trialEmailConfig.EmailHtmlContent : trialEmailConfig.EmailHtmlContentCN, EmailNamePlaceholder, taskInfo.ResearchProgramNo, taskInfo.SubjectCode, resultStr); - - return (topicStr, htmlBodyStr, isEn_us, null); + + return (topicStr, htmlBodyStr, isEn_us, null); }; await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId); } else { - Func topicAndHtmlFunc = trialEmailConfig => + Func topicAndHtmlFunc = trialEmailConfig => { var topicStr = string.Format(isEn_us ? trialEmailConfig.EmailTopic : trialEmailConfig.EmailTopicCN, taskInfo.ResearchProgramNo, taskInfo.SubjectCode, taskInfo.VisitName); var htmlBodyStr = string.Format(isEn_us ? trialEmailConfig.EmailHtmlContent : trialEmailConfig.EmailHtmlContentCN, EmailNamePlaceholder, taskInfo.ResearchProgramNo, taskInfo.SubjectCode, taskInfo.VisitName, resultStr); - - return (topicStr, htmlBodyStr, isEn_us, null); + + return (topicStr, htmlBodyStr, isEn_us, null); }; await SendTrialEmailAsync(taskInfo.TrialId, businessScenarioEnum, topicAndHtmlFunc, taskInfo.TrialSiteId); @@ -127,7 +110,7 @@ namespace IRaCIS.Core.Application.Service public async Task SendTrialImageQCTaskEmailAsync(Guid trialId) { var isEn_us = false; - var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync(); + var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync(); //找到 该项目的IQC 用户Id var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync(); @@ -158,12 +141,12 @@ namespace IRaCIS.Core.Application.Service if (sendStat != null && (sendStat.ToBeClaimedCount > 0 || sendStat.ToBeReviewedCount > 0)) { - Func topicAndHtmlFunc = trialEmailConfig => + Func topicAndHtmlFunc = trialEmailConfig => { var topicStr = string.Format(isEn_us ? trialEmailConfig.EmailTopic : trialEmailConfig.EmailTopicCN, trialInfo.ResearchProgramNo); var htmlBodyStr = string.Format(isEn_us ? trialEmailConfig.EmailHtmlContent : trialEmailConfig.EmailHtmlContentCN, user.FullName, DateTime.Now, sendStat.ToBeClaimedCount, sendStat.ToBeReviewedCount, _SystemEmailSendConfig.CurrentValue.SiteUrl); - + return (topicStr, htmlBodyStr, false, userId); }; @@ -180,7 +163,7 @@ namespace IRaCIS.Core.Application.Service public async Task SendTrialQCQuestionEmailAsync(Guid trialId) { var isEn_us = false; - var trialInfo =await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync(); + var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync(); //找到 该项目的IQC 用户Id var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.User.FullName }).ToListAsync(); @@ -210,15 +193,15 @@ namespace IRaCIS.Core.Application.Service if (sendStat != null && (sendStat.ToBeDealedCount > 0 || sendStat.ReUploadTobeDealedCount > 0)) { - Func topicAndHtmlFunc = trialEmailConfig => + Func topicAndHtmlFunc = trialEmailConfig => { var topicStr = string.Format(isEn_us ? trialEmailConfig.EmailTopic : trialEmailConfig.EmailTopicCN, trialInfo.ResearchProgramNo); var htmlBodyStr = string.Format(isEn_us ? trialEmailConfig.EmailHtmlContent : trialEmailConfig.EmailHtmlContentCN, user.FullName, DateTime.Now, sendStat.ToBeDealedCount - sendStat.ReUploadTobeDealedCount, sendStat.ReUploadTobeDealedCount, _SystemEmailSendConfig.CurrentValue.SiteUrl); - - - return (topicStr, htmlBodyStr, false, userId); + + + return (topicStr, htmlBodyStr, false, userId); }; await SendTrialEmailAsync(trialId, EmailBusinessScenario.QCQuestion, topicAndHtmlFunc); @@ -235,7 +218,7 @@ namespace IRaCIS.Core.Application.Service { var isEn_us = false; - var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync(); + var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync(); //找到 该项目的CRC 用户Id var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.User.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.User.FullName }).ToListAsync(); @@ -262,13 +245,13 @@ namespace IRaCIS.Core.Application.Service if (sendStat != null && (sendStat.ToBeDealedCount > 0)) { - Func topicAndHtmlFunc = trialEmailConfig => + Func topicAndHtmlFunc = trialEmailConfig => { var topicStr = string.Format(isEn_us ? trialEmailConfig.EmailTopic : trialEmailConfig.EmailTopicCN, trialInfo.ResearchProgramNo); var htmlBodyStr = string.Format(isEn_us ? trialEmailConfig.EmailHtmlContent : trialEmailConfig.EmailHtmlContentCN, user.FullName, DateTime.Now, sendStat.ToBeDealedCount, _SystemEmailSendConfig.CurrentValue.SiteUrl); - - return (topicStr, htmlBodyStr, isEn_us, userId); + + return (topicStr, htmlBodyStr, isEn_us, userId); }; await SendTrialEmailAsync(trialId, EmailBusinessScenario.ImageQuestion, topicAndHtmlFunc); @@ -279,34 +262,34 @@ namespace IRaCIS.Core.Application.Service - public async Task SendTrialEmailAsync(Guid trialId, EmailBusinessScenario businessScenario, Func topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null, Func emailAttachFunc=null) + public async Task SendTrialEmailAsync(Guid trialId, EmailBusinessScenario businessScenario, Func topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null, Func emailAttachFunc = null) { - var (trialEmailConfig, sendEmailConfig) = await BuildEmailConfig(trialId, businessScenario, topicAndHtmlFunc, trialSiteId, trialReadingCriterionId); + var (trialEmailConfig, sendEmailConfig) = await BuildEmailConfig(trialId, businessScenario, topicAndHtmlFunc, trialSiteId, trialReadingCriterionId); if (sendEmailConfig != null) { - + await SendEmailHelper.SendEmailAsync(sendEmailConfig); } } - public async Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null) + public async Task<(TrialEmailNoticeConfig?, SMTPEmailConfig?)> BuildEmailConfig(Guid trialId, EmailBusinessScenario businessScenario, Func topicAndHtmlFunc, Guid? trialSiteId = null, Guid? trialReadingCriterionId = null) { //找到配置 var trialEmailConfig = await _trialEmailNoticeConfigRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionId && t.BusinessScenarioEnum == businessScenario, ignoreQueryFilters: true) .Include(t => t.TrialEmailNoticeUserList).Include(t => t.TrialEmailBlackUserList).FirstOrDefaultAsync(); - if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false || trialEmailConfig.IsEnable==false) + if (trialEmailConfig == null || trialEmailConfig.IsAutoSend == false || trialEmailConfig.IsEnable == false) { - return (null,null); + return (null, null); } else { var sendEmailConfig = new SMTPEmailConfig(); - var (topicStr, htmlBodyStr, isEn_us, onlyToUserId) = topicAndHtmlFunc(trialEmailConfig); + var (topicStr, htmlBodyStr, isEn_us, onlyToUserId) = topicAndHtmlFunc(trialEmailConfig); sendEmailConfig.TopicDescription = topicStr; @@ -422,7 +405,7 @@ namespace IRaCIS.Core.Application.Service // }); //} - return (trialEmailConfig,sendEmailConfig) ; + return (trialEmailConfig, sendEmailConfig); } diff --git a/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs index 8f61c2dec..4b4c530e4 100644 --- a/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/Interface/ISystemDocumentService.cs @@ -3,7 +3,6 @@ // 生成时间 2022-01-05 09:17:00 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Core.Application.Contracts { /// @@ -30,5 +29,5 @@ namespace IRaCIS.Core.Application.Contracts - } + } } diff --git a/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs index b3fce366c..839017e20 100644 --- a/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/Interface/ITrialDocumentService.cs @@ -4,11 +4,6 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.AspNetCore.Mvc; - namespace IRaCIS.Core.Application.Contracts { public interface ITrialDocumentService diff --git a/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs index b30ba64fb..9ca955b2b 100644 --- a/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/Interface/ITrialEmailNoticeConfigService.cs @@ -5,32 +5,31 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share.Common; namespace IRaCIS.Core.Application.Interfaces { - /// - /// ITrialEmailNoticeConfigService - /// - public interface ITrialEmailNoticeConfigService - { + /// + /// ITrialEmailNoticeConfigService + /// + public interface ITrialEmailNoticeConfigService + { - Task> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery); + Task> GetTrialEmailNoticeConfigList(TrialEmailNoticeConfigQuery inQuery); - Task AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig); + Task AddOrUpdateTrialEmailNoticeConfig(TrialEmailNoticeConfigAddOrEdit addOrEditTrialEmailNoticeConfig); - Task DeleteTrialEmailNoticeConfig(Guid trialEmailNoticeConfigId); + Task DeleteTrialEmailNoticeConfig(Guid trialEmailNoticeConfigId); - Task BaseBusinessScenarioSendEmailAsync(Guid visitTaskId, bool? isMedicalReviewAndSuggestApplyReReading = null, EmailStoreSendMode emailStoreMode = EmailStoreSendMode.StoreLocalSend, string sendFileRelativePath=""); + Task BaseBusinessScenarioSendEmailAsync(Guid visitTaskId, bool? isMedicalReviewAndSuggestApplyReReading = null, EmailStoreSendMode emailStoreMode = EmailStoreSendMode.StoreLocalSend, string sendFileRelativePath = ""); - } + } - public class EmailStoreSendDto - { - public EmailStoreSendMode EmailStoreSendMode { get; set; } = EmailStoreSendMode.StoreLocalSend; + public class EmailStoreSendDto + { + public EmailStoreSendMode EmailStoreSendMode { get; set; } = EmailStoreSendMode.StoreLocalSend; - public string SendFileRelativePath { get; set; } + public string SendFileRelativePath { get; set; } } } diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index cd4f3c8a0..eb9de5564 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -4,10 +4,9 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Contracts; +using Microsoft.AspNetCore.Mvc; using User = IRaCIS.Core.Domain.Models.User; -using DocumentFormat.OpenXml.Office2010.Word; namespace IRaCIS.Core.Application.Services { @@ -21,7 +20,7 @@ namespace IRaCIS.Core.Application.Services IRepository _systemDocConfirmedUserRepository) : BaseService, ISystemDocumentService { - + @@ -49,9 +48,9 @@ namespace IRaCIS.Core.Application.Services var entity = _mapper.Map(addOrEditSystemDocument); - if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name,true)) + if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name, true)) { - //---系统中已存在同类型的同名文件。 + //---系统中已存在同类型的同名文件。 return ResponseOutput.NotOk(_localizer["SystemD_DuplicateFile"]); } @@ -67,10 +66,10 @@ namespace IRaCIS.Core.Application.Services if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name && t.Id != addOrEditSystemDocument.Id, true)) { - //---系统中已存在同类型的同名文件。 + //---系统中已存在同类型的同名文件。 return ResponseOutput.NotOk(_localizer["SystemD_DuplicateFile"]); } - + _mapper.Map(addOrEditSystemDocument, document); @@ -132,7 +131,7 @@ namespace IRaCIS.Core.Application.Services return ResponseOutput.NotOk(_localizer["SystemD_CannotDeleteSignedFile"]); } - var success = await _systemDocumentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentId,true,true); + var success = await _systemDocumentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentId, true, true); return ResponseOutput.Result(true); } @@ -163,10 +162,10 @@ namespace IRaCIS.Core.Application.Services SignViewMinimumMinutes = sysDoc.SignViewMinimumMinutes, Name = sysDoc.Name, Path = sysDoc.Path, - FileType = _userInfo.IsEn_Us? sysDoc.FileType.Value: sysDoc.FileType.ValueCN, + FileType = _userInfo.IsEn_Us ? sysDoc.FileType.Value : sysDoc.FileType.ValueCN, UpdateTime = sysDoc.UpdateTime, - FullFilePath = sysDoc.Path , + FullFilePath = sysDoc.Path, ConfirmUserId = confirm.ConfirmUserId, ConfirmTime = confirm.ConfirmTime, @@ -176,9 +175,9 @@ namespace IRaCIS.Core.Application.Services UserTypeShortName = user.UserTypeRole.UserTypeShortName }; - return await query.WhereIf(inQuery.IsSigned==true,t=>t.ConfirmTime!=null) + return await query.WhereIf(inQuery.IsSigned == true, t => t.ConfirmTime != null) .WhereIf(inQuery.IsSigned == false, t => t.ConfirmTime == null) - .ToPagedListAsync(inQuery); + .ToPagedListAsync(inQuery); diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 4d5f238a7..08ff3ce9a 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -4,14 +4,10 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; - using IRaCIS.Core.Application.Contracts; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Application.Filter; -using System.Linq; +using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Services { @@ -34,7 +30,7 @@ namespace IRaCIS.Core.Application.Services { - + /// /// Setting 界面的 项目所有文档列表 @@ -221,10 +217,10 @@ namespace IRaCIS.Core.Application.Services var trialId = inQuery.TrialId; - var trialInfo = await ( _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); + var trialInfo = await (_trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); //系统文档查询 - var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId,ignoreQueryFilters:true) + var systemDocumentQueryable = from needConfirmedUserType in _systemDocNeedConfirmedUserTypeRepository.Where(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId, ignoreQueryFilters: true) .WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime) .WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id))) @@ -355,7 +351,7 @@ namespace IRaCIS.Core.Application.Services /// /// [HttpPost] - public async Task>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery) + public async Task>> GetDocumentConfirmList(DocumentTrialUnionQuery inQuery) { @@ -392,7 +388,7 @@ namespace IRaCIS.Core.Application.Services #endregion - var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId,ignoreQueryFilters:true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); + var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync()); var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId) @@ -464,7 +460,7 @@ namespace IRaCIS.Core.Application.Services FullFilePath = needConfirmEdUserType.SystemDocument.Path }; - var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t=>!(t.IsDeleted == true && t.ConfirmUserId == null)) + var unionQuery = trialDocQuery.Union(systemDocQuery).IgnoreQueryFilters().Where(t => !(t.IsDeleted == true && t.ConfirmUserId == null)) .WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name)) .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId) .WhereIf(inQuery.IsConfirmed == true, t => t.ConfirmTime != null) @@ -485,7 +481,7 @@ namespace IRaCIS.Core.Application.Services .CountAsync(); - return ResponseOutput.Ok (result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr }); + return ResponseOutput.Ok(result, new { NeedSignCount = needSignTrialDocCount + needSignSystemDocCount, NeedSignTrialDocCount = needSignTrialDocCount, NeedSignSystemDocCount = needSignSystemDocCount, TrialStatusStr = trialInfo.TrialStatusStr }); } diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index 06d10cccc..606ce504a 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -4,30 +4,20 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Helper; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore.Common; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Filter; -using MiniSoftware; -using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Share.Common; -using System.IO; -using System.Linq; -using Spire.Doc; -using Microsoft.AspNetCore.Http; -using System; -using System.Runtime.InteropServices; -using SharpCompress.Common; -using DocumentFormat.OpenXml.Bibliography; -using System.Linq.Dynamic.Core; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; +using Spire.Doc; +using System.Linq.Dynamic.Core; +using System.Runtime.InteropServices; namespace IRaCIS.Core.Application.Service { @@ -55,7 +45,7 @@ namespace IRaCIS.Core.Application.Service IEmailSendService _emailSendService) : BaseService, ITrialEmailNoticeConfigService { - + /// /// 获取项目邮箱 @@ -361,7 +351,7 @@ namespace IRaCIS.Core.Application.Service //有序 - if (taskInfo.IsReadingTaskViewInOrder==ReadingOrder.InOrder) + if (taskInfo.IsReadingTaskViewInOrder == ReadingOrder.InOrder) { diff --git a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs index 1c00c3be8..af525da59 100644 --- a/IRaCIS.Core.Application/Service/Document/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Document/_MapConfig.cs @@ -3,9 +3,6 @@ using AutoMapper.EquivalencyExpression; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Domain.Share; -using System.Globalization; namespace IRaCIS.Core.Application.Service { @@ -18,22 +15,22 @@ namespace IRaCIS.Core.Application.Service var isEn_Us = false; CreateMap() - .ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value: s.FileType.ValueCN)) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); + .ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN)) + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap() - .ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN )) - .ForMember(d => d.IsSomeUserSigned, u => u.MapFrom(s => s.TrialDocConfirmedUserList.Any(t=>t.ConfirmTime!=null))) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path )); + .ForMember(d => d.FileType, u => u.MapFrom(s => isEn_Us ? s.FileType.Value : s.FileType.ValueCN)) + .ForMember(d => d.IsSomeUserSigned, u => u.MapFrom(s => s.TrialDocConfirmedUserList.Any(t => t.ConfirmTime != null))) + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap() .ForMember(d => d.IsSystemDoc, u => u.MapFrom(s => true)) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path )); + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap() .ForMember(d => d.IsSystemDoc, u => u.MapFrom(s => false)) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path )); + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap().ForMember(d => d.UserTypeShortName, t => t.MapFrom(c => c.UserTypeRole.UserTypeShortName)); CreateMap().ForMember(d => d.UserTypeShortName, t => t.MapFrom(c => c.UserTypeRole.UserTypeShortName)); @@ -50,13 +47,13 @@ namespace IRaCIS.Core.Application.Service //CreateMap() // .ForMember(d => d.UserName, c => c.MapFrom(t => t.User.UserName)) // .ForMember(d => d.RealName, c => c.MapFrom(t => t.User.LastName + " / " + t.User.FirstName)); - + CreateMap(); CreateMap(); - + CreateMap() @@ -75,7 +72,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() - + .ForMember(d => d.TrialCriterionName, c => c.MapFrom(t => t.TrialReadingCriterion.CriterionName)) .ForMember(d => d.TrialEmailNoticeUserList, c => c.MapFrom(t => t.TrialEmailNoticeUserList)); @@ -86,7 +83,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.Email, c => c.MapFrom(t => t.User.EMail)) .ForMember(d => d.RealName, c => c.MapFrom(t => t.User.FullName)) .ForMember(d => d.UserName, c => c.MapFrom(t => t.User.UserName)); - + CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Financial/CalculateService.cs b/IRaCIS.Core.Application/Service/Financial/CalculateService.cs index f70222f81..4684eead2 100644 --- a/IRaCIS.Core.Application/Service/Financial/CalculateService.cs +++ b/IRaCIS.Core.Application/Service/Financial/CalculateService.cs @@ -1,15 +1,10 @@ -using AutoMapper; -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts.Pay; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; -using System.Linq.Expressions; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public class CalculateService( IRepository _paymentRepository, @@ -26,12 +21,12 @@ namespace IRaCIS.Application.Services IRepository _enrollRepository) : BaseService, ICalculateService { - + /// /// 获取某个月下的某些医生最终确认的工作量,用于计算月度费用 /// - private async Task< List> GetFinalConfirmedWorkloadAndPayPriceList(CalculateDoctorAndMonthDTO calculateFeeParam) + private async Task> GetFinalConfirmedWorkloadAndPayPriceList(CalculateDoctorAndMonthDTO calculateFeeParam) { Expression> workloadLambda = x => true; @@ -109,13 +104,13 @@ namespace IRaCIS.Application.Services { if (i == 0 && volumeRewardPriceList[i].Min != 0) { - //---Volume reward data error. + //---Volume reward data error. return ResponseOutput.NotOk(_localizer["Cal_VolDataErr"]); } if (i > 0) { if (volumeRewardPriceList[i - 1].Max + 1 != volumeRewardPriceList[i].Min) - //---Volume reward data error. + //---Volume reward data error. return ResponseOutput.NotOk(_localizer["Cal_VolDataErr"]); } } @@ -133,25 +128,25 @@ namespace IRaCIS.Application.Services var allDoctorIds = allDoctorList.Select(x => x.DoctorId).Distinct().ToList(); var listTrialId = allDoctorList.Select(x => x.TrialId).Distinct().ToList(); - var trialDoctorlist= await (from enroll in _enrollRepository.Where(x=> listTrialId.Contains(x.TrialId)|| allDoctorIds.Contains(x.DoctorId)) - join price in _trialPaymentRepository.Where() on enroll.TrialId equals price.TrialId - select new DoctorPrice() - { - IsNewTrial = price.IsNewTrial, - AdjustmentMultiple = enroll.AdjustmentMultiple, - TrialId=enroll.TrialId, - DoctorId = enroll.DoctorId, - Training=enroll.Training, - Adjudication=enroll.Adjudication, - Adjudication24H=enroll.Adjudication24H, - Adjudication48H= enroll.Adjudication48H, - Downtime=enroll.Downtime, - Global=enroll.Global, - RefresherTraining=enroll.RefresherTraining, - Timepoint= enroll.Timepoint, - Timepoint24H=enroll.Timepoint24H, - Timepoint48H=enroll.Timepoint48H, - }).ToListAsync(); + var trialDoctorlist = await (from enroll in _enrollRepository.Where(x => listTrialId.Contains(x.TrialId) || allDoctorIds.Contains(x.DoctorId)) + join price in _trialPaymentRepository.Where() on enroll.TrialId equals price.TrialId + select new DoctorPrice() + { + IsNewTrial = price.IsNewTrial, + AdjustmentMultiple = enroll.AdjustmentMultiple, + TrialId = enroll.TrialId, + DoctorId = enroll.DoctorId, + Training = enroll.Training, + Adjudication = enroll.Adjudication, + Adjudication24H = enroll.Adjudication24H, + Adjudication48H = enroll.Adjudication48H, + Downtime = enroll.Downtime, + Global = enroll.Global, + RefresherTraining = enroll.RefresherTraining, + Timepoint = enroll.Timepoint, + Timepoint24H = enroll.Timepoint24H, + Timepoint48H = enroll.Timepoint48H, + }).ToListAsync(); foreach (var doctor in param.NeedCalculateReviewers) @@ -179,16 +174,16 @@ namespace IRaCIS.Application.Services if (doctordata != null) { - item.Training = doctordata.Training??0; - item.Adjudication = doctordata.Adjudication??0; - item.AdjudicationIn24H = doctordata.Adjudication24H??0; - item.AdjudicationIn48H = doctordata.Adjudication48H??0; - item.Downtime = doctordata.Downtime??0; - item.Global = doctordata.Global??0; - item.RefresherTraining = doctordata.RefresherTraining??0; - item.Timepoint = doctordata.Timepoint??0; - item.TimepointIn24H = doctordata.Timepoint24H??0; - item.TimepointIn48H = doctordata.Timepoint48H??0; + item.Training = doctordata.Training ?? 0; + item.Adjudication = doctordata.Adjudication ?? 0; + item.AdjudicationIn24H = doctordata.Adjudication24H ?? 0; + item.AdjudicationIn48H = doctordata.Adjudication48H ?? 0; + item.Downtime = doctordata.Downtime ?? 0; + item.Global = doctordata.Global ?? 0; + item.RefresherTraining = doctordata.RefresherTraining ?? 0; + item.Timepoint = doctordata.Timepoint ?? 0; + item.TimepointIn24H = doctordata.Timepoint24H ?? 0; + item.TimepointIn48H = doctordata.Timepoint48H ?? 0; item.PersonalAdditional = 0; } ++codeOrder; @@ -275,7 +270,7 @@ namespace IRaCIS.Application.Services PaymentType = "Timepoint Regular", Count = item.Timepoint, BasePrice = item.TimepointPrice, - PersonalAdditional = doctordata!=null?0: item.PersonalAdditional, + PersonalAdditional = doctordata != null ? 0 : item.PersonalAdditional, TrialAdditional = doctordata != null ? 0 : item.TimepointPrice * (item.AdjustmentMultiple - 1) + (item.TrialAdditional == null ? 0 : (decimal)item.TrialAdditional), PaymentId = Guid.Empty, DoctorId = item.DoctorId, @@ -540,7 +535,7 @@ namespace IRaCIS.Application.Services // detail.PersonalAdditional = 0; // detail.TrialAdditional = 0; //} - + detail.PaymentId = result.Data; } await AddOrUpdateMonthlyPaymentDetail(paymentDetailList, result.Data); @@ -570,13 +565,13 @@ namespace IRaCIS.Application.Services foreach (var reviewer in needUpdatePayment) { - await _paymentRepository.BatchUpdateNoTrackingAsync(u => u.YearMonth == yearMonth && - !u.IsLock && u.DoctorId == reviewer.ReviewerId, t => new Payment() - { - AdjustmentUSD = reviewer.AdjustUSD, - AdjustmentCNY = reviewer.AdjustCNY + await _paymentRepository.BatchUpdateNoTrackingAsync(u => u.YearMonth == yearMonth && + !u.IsLock && u.DoctorId == reviewer.ReviewerId, t => new Payment() + { + AdjustmentUSD = reviewer.AdjustUSD, + AdjustmentCNY = reviewer.AdjustCNY - }); + }); } } @@ -604,8 +599,8 @@ namespace IRaCIS.Application.Services //payment.BankTransferCNY = bankTransferCNY; payment.YearMonthDate = DateTime.Parse(payment.YearMonth); - payment =await _paymentRepository.AddAsync(payment); - success =await _paymentRepository.SaveChangesAsync(); + payment = await _paymentRepository.AddAsync(payment); + success = await _paymentRepository.SaveChangesAsync(); return ResponseOutput.Result(success, payment.Id); } else @@ -613,7 +608,7 @@ namespace IRaCIS.Application.Services // 如果是 当月计算的工作量费用 和 调整费用都为0,则删除该行记录 if (addOrUpdateModel.PaymentUSD == 0 && paymentModel.AdjustmentUSD == 0) { - success =await _paymentRepository.BatchDeleteNoTrackingAsync(u => u.Id == paymentModel.Id); + success = await _paymentRepository.BatchDeleteNoTrackingAsync(u => u.Id == paymentModel.Id); //_paymentDetailRepository.Delete(u=>u.PaymentId==paymentModel.Id); } else diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/AwardPriceModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/AwardPriceModel.cs index 2dfffd2fc..d860bea26 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/AwardPriceModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/AwardPriceModel.cs @@ -1,10 +1,6 @@ -using System; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Interfaces +namespace IRaCIS.Application.Interfaces { - public class AwardPriceDTO: AwardPriceCalculateDTO + public class AwardPriceDTO : AwardPriceCalculateDTO { public Guid Id { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/CalculateModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/CalculateModel.cs index 4d82f7425..1d287c21d 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/CalculateModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/CalculateModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class CalculateNeededDTO { diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/ExchangeRateModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/ExchangeRateModel.cs index a56b4c166..9cc31565b 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/ExchangeRateModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/ExchangeRateModel.cs @@ -1,11 +1,9 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class ExchangeRateCommand { public Guid? Id { get; set; } - public string YearMonth { get; set; }=String.Empty; + public string YearMonth { get; set; } = String.Empty; public decimal Rate { get; set; } public DateTime UpdateTime { get; set; } diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/PaymentAdjustmentModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/PaymentAdjustmentModel.cs index 1a399238d..0b0da6bb2 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/PaymentAdjustmentModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/PaymentAdjustmentModel.cs @@ -1,13 +1,10 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts.Pay +namespace IRaCIS.Application.Contracts.Pay { public class PaymentAdjustmentCommand { - public Guid? Id { get; set; } + public Guid? Id { get; set; } public Guid ReviewerId { get; set; } - public DateTime YearMonth { get; set; } + public DateTime YearMonth { get; set; } public decimal AdjustPaymentUSD { get; set; } public decimal AdjustPaymentCNY { get; set; } public string Note { get; set; } = string.Empty; @@ -17,15 +14,15 @@ namespace IRaCIS.Application.Contracts.Pay { public Guid Id { get; set; } public Guid ReviewerId { get; set; } - public string YearMonth { get; set; }=String.Empty; - public DateTime YearMonthDate { get; set; } + public string YearMonth { get; set; } = String.Empty; + public DateTime YearMonthDate { get; set; } public bool IsLock { get; set; } public decimal AdjustPaymentUSD { get; set; } public decimal AdjustPaymentCNY { get; set; } public string Note { get; set; } = String.Empty; } - public class PaymentAdjustmentDetailDTO: PaymentAdjustmentDTO + public class PaymentAdjustmentDetailDTO : PaymentAdjustmentDTO { public string ReviewerCode { get; set; } = String.Empty; public string FirstName { get; set; } = String.Empty; @@ -34,11 +31,11 @@ namespace IRaCIS.Application.Contracts.Pay public string ChineseName { get; set; } = String.Empty; } - public class PaymentAdjustmentQueryDTO:PageInput + public class PaymentAdjustmentQueryDTO : PageInput { public string TrialCode { get; set; } = string.Empty; public string Reviewer { get; set; } = string.Empty; - public DateTime BeginMonth { get; set; } + public DateTime BeginMonth { get; set; } public DateTime EndMonth { get; set; } } diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/PaymentDetailModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/PaymentDetailModel.cs index ae8aaa057..ce7d66944 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/PaymentDetailModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/PaymentDetailModel.cs @@ -1,6 +1,4 @@ -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts.Pay +namespace IRaCIS.Application.Contracts.Pay { public class PaymentDetailDTO { @@ -71,7 +69,7 @@ namespace IRaCIS.Application.Contracts.Pay public class LockPaymentDTO { - public List ReviewerIdList { get; set; }=new List(); + public List ReviewerIdList { get; set; } = new List(); public DateTime Month { get; set; } public bool IsLock { get; set; } = true; @@ -92,7 +90,7 @@ namespace IRaCIS.Application.Contracts.Pay - + public class ReviewerPaymentUSD diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/PaymentModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/PaymentModel.cs index 3b70b23fd..15c25799e 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/PaymentModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/PaymentModel.cs @@ -1,12 +1,8 @@ -using System; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class PaymentDTO { - public PageOutput CostList { get; set; }=new PageOutput(); + public PageOutput CostList { get; set; } = new PageOutput(); public decimal ExchangeRate { get; set; } } public class PaymentModel @@ -100,7 +96,8 @@ namespace IRaCIS.Application.Contracts public decimal GrossProfit => RevenusUSD - PaymentUSD; public decimal GrossProfitMargin { - get { + get + { if (RevenusUSD == 0) return 0; else @@ -145,10 +142,11 @@ namespace IRaCIS.Application.Contracts public decimal PaymentUSD { get; set; } public decimal RevenusUSD { get; set; } public decimal GrossProfit => RevenusUSD - PaymentUSD; - + public decimal GrossProfitMargin { - get { + get + { if (RevenusUSD == 0) return 0; else diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/RankPriceModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/RankPriceModel.cs index 4e39bdc04..5db8de36b 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/RankPriceModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/RankPriceModel.cs @@ -1,7 +1,4 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class RankPriceDTO { @@ -42,7 +39,7 @@ namespace IRaCIS.Application.Contracts public decimal Downtime { get; set; } public decimal RefresherTraining { get; set; } - + } public class RankPriceQueryDTO : PageInput { diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/ReviewerPayInfoModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/ReviewerPayInfoModel.cs index 12e7de8be..e882d31ff 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/ReviewerPayInfoModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/ReviewerPayInfoModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class ReviewerPayInfoQueryDTO { diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/TrialPaymentPriceModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/TrialPaymentPriceModel.cs index f05cc3bc8..3d0968273 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/TrialPaymentPriceModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/TrialPaymentPriceModel.cs @@ -1,7 +1,4 @@ -using IRaCIS.Core.Domain.Share; -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class DtoDoctorList @@ -24,14 +21,14 @@ namespace IRaCIS.Application.Contracts public DateTime? CreateTime { get; set; } public string SowName { get; set; } = String.Empty; public string SowPath { get; set; } = String.Empty; - public string SowFullPath => SowPath; + public string SowFullPath => SowPath; public decimal AdjustmentMultiple { get; set; } = 1; - public string DoctorsNames{ get; set; }=String.Empty; + public string DoctorsNames { get; set; } = String.Empty; public string ReviewMode { get; set; } = String.Empty; - + } public class TrialPaymentPriceCommand diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceModel.cs b/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceModel.cs index afe5207cc..3d5e4b9b5 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceModel.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceModel.cs @@ -1,11 +1,8 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class TrialRevenuesPriceDTO { - + public Guid TrialId { get; set; } public decimal Timepoint { get; set; } public decimal TimepointIn24H { get; set; } @@ -14,7 +11,7 @@ namespace IRaCIS.Application.Contracts public decimal AdjudicationIn24H { get; set; } public decimal AdjudicationIn48H { get; set; } public decimal RefresherTraining { get; set; } - + public decimal Global { get; set; } public decimal Training { get; set; } public decimal Downtime { get; set; } @@ -25,9 +22,9 @@ namespace IRaCIS.Application.Contracts public Guid Id { get; set; } public string TrialCode { get; set; } = String.Empty; public string Indication { get; set; } = string.Empty; - public int Expedited { get; set; } + public int Expedited { get; set; } public string ReviewMode { get; set; } = String.Empty; - public string Cro { get; set; } = String.Empty; + public string Cro { get; set; } = String.Empty; } public class TrialRevenuesPriceQueryDTO : PageInput { diff --git a/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceVerificationDTO.cs b/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceVerificationDTO.cs index 4492ed0e8..31c00bbd9 100644 --- a/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceVerificationDTO.cs +++ b/IRaCIS.Core.Application/Service/Financial/DTO/TrialRevenuesPriceVerificationDTO.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace IRaCIS.Core.Application.Contracts +namespace IRaCIS.Core.Application.Contracts { public class RevenusVerifyQueryDTO { diff --git a/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs b/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs index 15eee0c51..5e4456da5 100644 --- a/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs +++ b/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs @@ -1,13 +1,9 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Financial")] @@ -16,7 +12,7 @@ namespace IRaCIS.Application.Services IRepository _paymentRepository) : BaseService, IExchangeRateService { - + [NonDynamicMethod] public async Task AddOrUpdateExchangeRate(ExchangeRateCommand model) @@ -26,7 +22,7 @@ namespace IRaCIS.Application.Services var existItem = await _exchangeRateRepository.FirstOrDefaultAsync(u => u.YearMonth == model.YearMonth); if (existItem != null) { - //---The exchange rate of the same month already existed. + //---The exchange rate of the same month already existed. return ResponseOutput.NotOk(_localizer["ExR_SameMthExist"]); } var rate = _mapper.Map(model); @@ -57,7 +53,7 @@ namespace IRaCIS.Application.Services /// 根据记录Id,删除汇率记录 /// /// 汇率记录Id - + [HttpDelete("{id:guid}")] public async Task DeleteExchangeRate(Guid id) { @@ -72,7 +68,7 @@ namespace IRaCIS.Application.Services var success = await _exchangeRateRepository.BatchDeleteNoTrackingAsync(t => t.Id == id); - return ResponseOutput.Ok(success); + return ResponseOutput.Ok(success); } @@ -99,7 +95,7 @@ namespace IRaCIS.Application.Services { var yearMonth = inQuery.SearchMonth?.ToString("yyyy-MM"); - + var exchangeRateQueryable = _exchangeRateRepository.AsQueryable() .WhereIf(inQuery.SearchMonth != null, o => o.YearMonth == yearMonth) .ProjectTo(_mapper.ConfigurationProvider); diff --git a/IRaCIS.Core.Application/Service/Financial/FinancialService.cs b/IRaCIS.Core.Application/Service/Financial/FinancialService.cs index f8bce7db3..de7969409 100644 --- a/IRaCIS.Core.Application/Service/Financial/FinancialService.cs +++ b/IRaCIS.Core.Application/Service/Financial/FinancialService.cs @@ -1,15 +1,14 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts.Pay; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; -using System.Linq.Expressions; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; using System.Linq.Dynamic.Core; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - [ ApiExplorerSettings(GroupName = "Financial")] + [ApiExplorerSettings(GroupName = "Financial")] public class FinancialService( IRepository _paymentRepository, IRepository _doctorPayInfoRepository, @@ -26,11 +25,11 @@ namespace IRaCIS.Application.Services IRepository _doctorWorkloadRepository) : BaseService, IPaymentService { - + /// /// Financials /MonthlyPayment 列表查询接口 /// - [NonDynamicMethod] + [NonDynamicMethod] public async Task> GetMonthlyPaymentList(MonthlyPaymentQueryDTO inQuery) { //var year = queryParam.StatisticsDate.Year; @@ -174,57 +173,57 @@ namespace IRaCIS.Application.Services detailList = await (from pay in _paymentDetailRepository.Where(t => t.PaymentId == paymentId) - join enroll in _enrollRepository.Where() on new { pay.DoctorId, pay.TrialId } equals new { enroll.DoctorId, enroll.TrialId } - join price in _trialPaymentPriceRepository.Where() on pay.TrialId equals price.TrialId - orderby pay.ShowCodeOrder - orderby pay.ShowTypeOrder - select new PaymentDetailDTO() - { - Id=pay.Id, - ShowCodeOrder = pay.ShowCodeOrder, - ShowTypeOrder = pay.ShowTypeOrder, - PaymentUSD = pay.PaymentUSD, - BasePrice = pay.BasePrice, - PersonalAdditional = pay.PersonalAdditional, - TrialAdditional = pay.TrialAdditional, - TrialCode = pay.TrialCode, - PaymentCNY = pay.PaymentCNY, - DoctorId = pay.DoctorId, - ExchangeRate = pay.ExchangeRate, - IsNewTrial = price.IsNewTrial, - NewPersonalAdditional= enroll.AdjustmentMultiple, + join enroll in _enrollRepository.Where() on new { pay.DoctorId, pay.TrialId } equals new { enroll.DoctorId, enroll.TrialId } + join price in _trialPaymentPriceRepository.Where() on pay.TrialId equals price.TrialId + orderby pay.ShowCodeOrder + orderby pay.ShowTypeOrder + select new PaymentDetailDTO() + { + Id = pay.Id, + ShowCodeOrder = pay.ShowCodeOrder, + ShowTypeOrder = pay.ShowTypeOrder, + PaymentUSD = pay.PaymentUSD, + BasePrice = pay.BasePrice, + PersonalAdditional = pay.PersonalAdditional, + TrialAdditional = pay.TrialAdditional, + TrialCode = pay.TrialCode, + PaymentCNY = pay.PaymentCNY, + DoctorId = pay.DoctorId, + ExchangeRate = pay.ExchangeRate, + IsNewTrial = price.IsNewTrial, + NewPersonalAdditional = enroll.AdjustmentMultiple, - }).ToListAsync(); + }).ToListAsync(); } //费用调整 //_payAdjustmentRepository.Where(t => t.YearMonth == yearMonthStr && t.ReviewerId == reviewerId) var adjList = - await (from costAdjustment in _payAdjustmentRepository.Where(t => t.YearMonth == yearMonthStr&& t.ReviewerId == paymentId) - join enroll in _enrollRepository.Where() on new { costAdjustment.ReviewerId, costAdjustment.TrialId } equals new { ReviewerId= enroll.DoctorId, enroll.TrialId } - join price in _trialPaymentPriceRepository.Where() on costAdjustment.TrialId equals price.TrialId + await (from costAdjustment in _payAdjustmentRepository.Where(t => t.YearMonth == yearMonthStr && t.ReviewerId == paymentId) + join enroll in _enrollRepository.Where() on new { costAdjustment.ReviewerId, costAdjustment.TrialId } equals new { ReviewerId = enroll.DoctorId, enroll.TrialId } + join price in _trialPaymentPriceRepository.Where() on costAdjustment.TrialId equals price.TrialId - select new PaymentDetailDTO() - { - Id=costAdjustment.Id, - TrialCode = "Adjustment", - PaymentCNY = costAdjustment.AdjustmentCNY, - PaymentUSD = costAdjustment.AdjustmentUSD, - DoctorId = costAdjustment.ReviewerId, - ExchangeRate = costAdjustment.ExchangeRate, - AdjustmentView = new AdjustmentDTO() - { - AdjustPaymentUSD = costAdjustment.AdjustmentUSD, - AdjustPaymentCNY = costAdjustment.AdjustmentCNY, - Note = costAdjustment.Note - }, - IsNewTrial = price.IsNewTrial, - NewPersonalAdditional = enroll.AdjustmentMultiple, + select new PaymentDetailDTO() + { + Id = costAdjustment.Id, + TrialCode = "Adjustment", + PaymentCNY = costAdjustment.AdjustmentCNY, + PaymentUSD = costAdjustment.AdjustmentUSD, + DoctorId = costAdjustment.ReviewerId, + ExchangeRate = costAdjustment.ExchangeRate, + AdjustmentView = new AdjustmentDTO() + { + AdjustPaymentUSD = costAdjustment.AdjustmentUSD, + AdjustPaymentCNY = costAdjustment.AdjustmentCNY, + Note = costAdjustment.Note + }, + IsNewTrial = price.IsNewTrial, + NewPersonalAdditional = enroll.AdjustmentMultiple, + + }).ToListAsync(); - }).ToListAsync(); - detailList.AddRange(adjList); @@ -239,7 +238,7 @@ namespace IRaCIS.Application.Services returnModel.DetailList = detailList; - + var doctorId = returnModel.DetailList.FirstOrDefault()?.DoctorId; var query = from doctor in _doctorRepository.AsQueryable() @@ -258,7 +257,7 @@ namespace IRaCIS.Application.Services YearMonth = yearMonthStr }; - returnModel.DoctorInfo =(await query.FirstOrDefaultAsync()).IfNullThrowException(); + returnModel.DoctorInfo = (await query.FirstOrDefaultAsync()).IfNullThrowException(); return returnModel; } @@ -272,7 +271,7 @@ namespace IRaCIS.Application.Services List result = new List(); foreach (var t in manyReviewers) { - result.Add(await GetMonthlyPaymentDetailList(t.PaymentId, t.ReviewerId, t.YearMonth)); + result.Add(await GetMonthlyPaymentDetailList(t.PaymentId, t.ReviewerId, t.YearMonth)); } @@ -374,7 +373,7 @@ namespace IRaCIS.Application.Services ChineseName = doctor.ChineseName, FirstName = doctor.FirstName, LastName = doctor.LastName, - FullName= doctor.FullName, + FullName = doctor.FullName, ReviewerCode = doctor.ReviewerCode, PaymentUSD = monthlyPay.PaymentUSD, PaymentCNY = monthlyPay.PaymentCNY, @@ -543,7 +542,7 @@ namespace IRaCIS.Application.Services } List incomeList = new List(); - IQueryable? query=null ; + IQueryable? query = null; var propName = string.Empty; var count = 0; @@ -1212,7 +1211,7 @@ namespace IRaCIS.Application.Services result.ForEach(t => { - t.TaxCNY =GetTax2(t.PaymentCNY); + t.TaxCNY = GetTax2(t.PaymentCNY); t.ActuallyPaidCNY = t.PaymentCNY - t.TaxCNY; t.BankTransferCNY = t.PaymentCNY - t.TaxCNY; @@ -1244,8 +1243,8 @@ namespace IRaCIS.Application.Services { IsLock = true }); - await _doctorWorkloadRepository.BatchUpdateNoTrackingAsync(u => reviewerIds.Contains(u.DoctorId) && u.YearMonth == yearMonth, - t => new Workload { IsLock = true }); + await _doctorWorkloadRepository.BatchUpdateNoTrackingAsync(u => reviewerIds.Contains(u.DoctorId) && u.YearMonth == yearMonth, + t => new Workload { IsLock = true }); return ResponseOutput.Result(paymentLockSuccess || adjustmentLockSuccess); } diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/ICalculateService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/ICalculateService.cs index 0e4ab8eea..c22272470 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/ICalculateService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/ICalculateService.cs @@ -1,7 +1,4 @@ using IRaCIS.Application.Contracts; -using System; -using System.Collections.Generic; -using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/IDoctorPayInfoService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/IDoctorPayInfoService.cs index 87aae6d3d..bd561083e 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/IDoctorPayInfoService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/IDoctorPayInfoService.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; - -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/IExchangeRateService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/IExchangeRateService.cs index de5b56b9d..5aa9278cf 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/IExchangeRateService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/IExchangeRateService.cs @@ -1,6 +1,4 @@ using IRaCIS.Application.Contracts; -using System; -using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentAdjustmentService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentAdjustmentService.cs index 4cf964082..e12dea225 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentAdjustmentService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentAdjustmentService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts.Pay; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts.Pay; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentService.cs index 8ddbf2b4d..e3131498e 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/IPaymentService.cs @@ -1,8 +1,5 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts.Pay; -using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/IRankPriceService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/IRankPriceService.cs index 93ddbdbc5..640d522ca 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/IRankPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/IRankPriceService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { @@ -11,7 +8,7 @@ namespace IRaCIS.Application.Interfaces Task> GetRankPriceList(RankPriceQueryDTO queryParam); - Task DeleteRankPrice( Guid id); + Task DeleteRankPrice(Guid id); Task> GetRankDic(); } diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/ITrialPaymentPriceService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/ITrialPaymentPriceService.cs index 6ce2a42c0..c34586826 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/ITrialPaymentPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/ITrialPaymentPriceService.cs @@ -1,5 +1,4 @@ using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Application.Interfaces { @@ -12,10 +11,10 @@ namespace IRaCIS.Application.Interfaces /// /// 上传入组后的Ack-SOW /// - Task UploadTrialSOW( TrialSOWPathDTO trialSowPath); + Task UploadTrialSOW(TrialSOWPathDTO trialSowPath); - Task DeleteTrialSOW( DeleteSowPathDTO trialSowPath); + Task DeleteTrialSOW(DeleteSowPathDTO trialSowPath); } } diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceService.cs index f4d0c44f0..4cbf3c086 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceService.cs @@ -1,6 +1,4 @@ using IRaCIS.Application.Contracts; -using System; -using IRaCIS.Core.Infrastructure.Extention; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceVerificationService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceVerificationService.cs index 19355c7fe..08be1b80d 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceVerificationService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/ITrialRevenuesPriceVerificationService.cs @@ -1,6 +1,5 @@  using IRaCIS.Core.Application.Contracts; -using System.Collections.Generic; diff --git a/IRaCIS.Core.Application/Service/Financial/Interface/IVolumeRewardService.cs b/IRaCIS.Core.Application/Service/Financial/Interface/IVolumeRewardService.cs index fa25acd57..cfda7dd91 100644 --- a/IRaCIS.Core.Application/Service/Financial/Interface/IVolumeRewardService.cs +++ b/IRaCIS.Core.Application/Service/Financial/Interface/IVolumeRewardService.cs @@ -1,7 +1,4 @@ -using System.Collections.Generic; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Interfaces +namespace IRaCIS.Application.Interfaces { public interface IVolumeRewardService { diff --git a/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs b/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs index fac88fa52..3b2b50760 100644 --- a/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs +++ b/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs @@ -1,11 +1,10 @@ -using AutoMapper; +using IRaCIS.Application.Contracts.Pay; using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts.Pay; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Financial")] public class PaymentAdjustmentService( @@ -15,7 +14,7 @@ namespace IRaCIS.Application.Services IRepository _paymentRepository) : BaseService, IPaymentAdjustmentService { - + /// /// 添加或更新费用调整[AUTH] @@ -52,7 +51,7 @@ namespace IRaCIS.Application.Services { if (payment.IsLock) { - //---Doctor payment has confirmed lock + //---Doctor payment has confirmed lock return ResponseOutput.NotOk(_localizer["PayAdj_DocPymtLock"]); } } diff --git a/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs b/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs index a661c1d64..0d94ea88b 100644 --- a/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs @@ -1,16 +1,11 @@ -using AutoMapper; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - [ ApiExplorerSettings(GroupName = "Financial")] + [ApiExplorerSettings(GroupName = "Financial")] public class RankPriceService( IRepository _rankPriceRepository, IRepository _reviewerPayInfoRepository) @@ -21,7 +16,7 @@ namespace IRaCIS.Application.Services [NonDynamicMethod] public async Task AddOrUpdateRankPrice(RankPriceCommand addOrUpdateModel, Guid userId) { - if (addOrUpdateModel.Id == Guid.Empty|| addOrUpdateModel.Id ==null) + if (addOrUpdateModel.Id == Guid.Empty || addOrUpdateModel.Id == null) { var rankPrice = _mapper.Map(addOrUpdateModel); rankPrice = await _rankPriceRepository.AddAsync(rankPrice); @@ -37,11 +32,11 @@ namespace IRaCIS.Application.Services } else { - var success =await _rankPriceRepository.BatchUpdateNoTrackingAsync(t => t.Id == addOrUpdateModel.Id, u => new RankPrice() + var success = await _rankPriceRepository.BatchUpdateNoTrackingAsync(t => t.Id == addOrUpdateModel.Id, u => new RankPrice() { UpdateUserId = userId, UpdateTime = DateTime.Now, - RefresherTraining=addOrUpdateModel.RefresherTraining, + RefresherTraining = addOrUpdateModel.RefresherTraining, RankName = addOrUpdateModel.RankName, Timepoint = addOrUpdateModel.Timepoint, TimepointIn24H = addOrUpdateModel.TimepointIn24H, @@ -60,7 +55,7 @@ namespace IRaCIS.Application.Services } } - + [HttpDelete("{id:guid}")] public async Task DeleteRankPrice(Guid id) { @@ -84,7 +79,7 @@ namespace IRaCIS.Application.Services { var rankPriceQueryable = _rankPriceRepository.ProjectTo(_mapper.ConfigurationProvider); return await rankPriceQueryable.ToPagedListAsync(inQuery); - + } diff --git a/IRaCIS.Core.Application/Service/Financial/ReviewerPayInfoService.cs b/IRaCIS.Core.Application/Service/Financial/ReviewerPayInfoService.cs index 9d6e44b58..99beb1bb8 100644 --- a/IRaCIS.Core.Application/Service/Financial/ReviewerPayInfoService.cs +++ b/IRaCIS.Core.Application/Service/Financial/ReviewerPayInfoService.cs @@ -1,16 +1,11 @@ -using AutoMapper; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using System.Linq.Expressions; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - [ ApiExplorerSettings(GroupName = "Financial")] + [ApiExplorerSettings(GroupName = "Financial")] public class ReviewerPayInfoService( IRepository _doctorPayInfoRepository, IRepository _doctorRepository, @@ -18,7 +13,7 @@ namespace IRaCIS.Application.Services IRepository _hospitalRepository) : BaseService, IReviewerPayInfoService { - + [NonDynamicMethod] public async Task AddOrUpdateReviewerPayInfo(ReviewerPayInfoCommand addOrUpdateModel, Guid userId) { @@ -28,7 +23,7 @@ namespace IRaCIS.Application.Services { await _doctorPayInfoRepository.InsertFromDTOAsync(addOrUpdateModel); - + } else//update { @@ -50,7 +45,7 @@ namespace IRaCIS.Application.Services var doctorQueryable = from doctor in _doctorRepository.AsQueryable() .WhereIf(inQuery.HospitalId != null, o => o.HospitalId == inQuery.HospitalId) .WhereIf(!string.IsNullOrEmpty(inQuery.SearchName), - u => u.ChineseName.Contains(inQuery.SearchName)|| (u.LastName+ u.FirstName).Contains(inQuery.SearchName)) + u => u.ChineseName.Contains(inQuery.SearchName) || (u.LastName + u.FirstName).Contains(inQuery.SearchName)) join hospitalItem in _hospitalRepository.AsQueryable() on doctor.HospitalId equals hospitalItem.Id into gt from hospital in gt.DefaultIfEmpty() join trialPayInfo in _doctorPayInfoRepository.Where() @@ -80,8 +75,8 @@ namespace IRaCIS.Application.Services }; return await doctorQueryable.ToPagedListAsync(inQuery); - - + + } diff --git a/IRaCIS.Core.Application/Service/Financial/TrialPaymentPriceService.cs b/IRaCIS.Core.Application/Service/Financial/TrialPaymentPriceService.cs index 39ecf3a16..fc76bdb08 100644 --- a/IRaCIS.Core.Application/Service/Financial/TrialPaymentPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/TrialPaymentPriceService.cs @@ -1,11 +1,9 @@ -using AutoMapper; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Financial")] public class TrialPaymentPriceService( @@ -16,7 +14,7 @@ namespace IRaCIS.Application.Services IRepository _trialRepository) : BaseService, ITrialPaymentPriceService { - + /// /// 添加或更新项目支付价格信息 diff --git a/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs b/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs index a1bd960b4..6322f80b9 100644 --- a/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs @@ -1,14 +1,9 @@ -using AutoMapper; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using System.Linq.Expressions; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Financial")] public class TrialRevenuesPriceService( diff --git a/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceVerificationService.cs b/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceVerificationService.cs index 08af91223..110c145c9 100644 --- a/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceVerificationService.cs +++ b/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceVerificationService.cs @@ -1,16 +1,13 @@ using IRaCIS.Application.Interfaces; -using IRaCIS.Core.Domain.Models; -using System.Linq.Expressions; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Application.Contracts; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Services { /// /// Financial---项目收入价格验证 /// - [ ApiExplorerSettings(GroupName = "Financial")] + [ApiExplorerSettings(GroupName = "Financial")] public class TrialRevenuesPriceVerificationService( IRepository _trialRevenuesPriceVerificationRepository, IRepository _trialRepository, @@ -18,11 +15,11 @@ namespace IRaCIS.Core.Application.Services IRepository _paymentRepository) : BaseService, ITrialRevenuesPriceVerificationService { - + [HttpPost] public async Task GetAnalysisVerifyList(RevenusVerifyQueryDTO param) { - AnalysisVerifyResultDTO result=new AnalysisVerifyResultDTO(); + AnalysisVerifyResultDTO result = new AnalysisVerifyResultDTO(); result.RevenuesVerifyList = await GetRevenuesVerifyList(param); @@ -30,7 +27,7 @@ namespace IRaCIS.Core.Application.Services var eDate = new DateTime(param.EndDate.Year, param.EndDate.Month, 1); eDate = eDate.AddMonths(1).AddSeconds(-1); - Expression> paymentLambda = x => x.YearMonthDate >= bDate && x.YearMonthDate <= eDate&&!x.IsLock; + Expression> paymentLambda = x => x.YearMonthDate >= bDate && x.YearMonthDate <= eDate && !x.IsLock; var query = from payment in _paymentRepository.Where(paymentLambda) join doctor in _doctorRepository.AsQueryable() on payment.DoctorId equals doctor.Id @@ -49,7 +46,7 @@ namespace IRaCIS.Core.Application.Services ReviewerNameCNList = g.Select(t => t.ReviewerNameCN).ToList(), ReviewerCodeList = g.Select(t => t.ReviewerCode).ToList() - }).OrderBy(t=>t.YearMonth).ToList(); + }).OrderBy(t => t.YearMonth).ToList(); return result; } @@ -63,20 +60,20 @@ namespace IRaCIS.Core.Application.Services Expression> trialRevenuesPriceVerificationLambda = x => x.WorkLoadDate >= bDate && x.WorkLoadDate <= eDate; var query = (from trialVerify in _trialRevenuesPriceVerificationRepository.Where(trialRevenuesPriceVerificationLambda) - join trail in _trialRepository.AsQueryable() on trialVerify.TrialId equals trail.Id - select new RevenusVerifyDTO - { - TrialCode = trail.TrialCode, - Timepoint = trialVerify.Timepoint, - TimepointIn24H = trialVerify.TimepointIn24H, - TimepointIn48H = trialVerify.TimepointIn48H, - Adjudication = trialVerify.Adjudication, - AdjudicationIn24H = trialVerify.AdjudicationIn24H, - AdjudicationIn48H = trialVerify.AdjudicationIn48H, - Global = trialVerify.Global, - Downtime = trialVerify.Downtime, - Training = trialVerify.Training - }).Distinct(); + join trail in _trialRepository.AsQueryable() on trialVerify.TrialId equals trail.Id + select new RevenusVerifyDTO + { + TrialCode = trail.TrialCode, + Timepoint = trialVerify.Timepoint, + TimepointIn24H = trialVerify.TimepointIn24H, + TimepointIn48H = trialVerify.TimepointIn48H, + Adjudication = trialVerify.Adjudication, + AdjudicationIn24H = trialVerify.AdjudicationIn24H, + AdjudicationIn48H = trialVerify.AdjudicationIn48H, + Global = trialVerify.Global, + Downtime = trialVerify.Downtime, + Training = trialVerify.Training + }).Distinct(); return await query.ToListAsync(); @@ -85,7 +82,7 @@ namespace IRaCIS.Core.Application.Services //废弃 - [Obsolete] + [Obsolete] public async Task> GetRevenuesVerifyResultList(RevenusVerifyQueryDTO param) { var bDate = new DateTime(param.BeginDate.Year, param.BeginDate.Month, 1); diff --git a/IRaCIS.Core.Application/Service/Financial/VolumeRewardService.cs b/IRaCIS.Core.Application/Service/Financial/VolumeRewardService.cs index 2592e34a8..c5a253063 100644 --- a/IRaCIS.Core.Application/Service/Financial/VolumeRewardService.cs +++ b/IRaCIS.Core.Application/Service/Financial/VolumeRewardService.cs @@ -1,28 +1,22 @@ -using AutoMapper; -using AutoMapper.QueryableExtensions; -using IRaCIS.Application.Interfaces; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - [ ApiExplorerSettings(GroupName = "Financial")] - public class VolumeRewardService (IRepository _volumeRewardRepository) : BaseService, IVolumeRewardService + [ApiExplorerSettings(GroupName = "Financial")] + public class VolumeRewardService(IRepository _volumeRewardRepository) : BaseService, IVolumeRewardService { - + /// /// 批量添加或更新奖励费用单价 /// [NonDynamicMethod] public async Task AddOrUpdateVolumeRewardPriceList(IEnumerable addOrUpdateModel) { - await _volumeRewardRepository.BatchDeleteNoTrackingAsync(t => t.Id != Guid.Empty); + await _volumeRewardRepository.BatchDeleteNoTrackingAsync(t => t.Id != Guid.Empty); var temp = _mapper.Map>(addOrUpdateModel); - + await _volumeRewardRepository.AddRangeAsync(temp); var success = await _volumeRewardRepository.SaveChangesAsync(); @@ -48,7 +42,7 @@ namespace IRaCIS.Application.Services var awardPriceQueryable = _volumeRewardRepository.ProjectTo(_mapper.ConfigurationProvider); return await awardPriceQueryable.ToPagedListAsync(inQuery); - + } } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Financial/_MapConfig.cs b/IRaCIS.Core.Application/Service/Financial/_MapConfig.cs index 16d342ddc..17e9f3de4 100644 --- a/IRaCIS.Core.Application/Service/Financial/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Financial/_MapConfig.cs @@ -2,7 +2,6 @@ using IRaCIS.Application.Contracts; using IRaCIS.Application.Contracts.Pay; using IRaCIS.Application.Interfaces; -using IRaCIS.Core.Domain.Models; namespace IRaCIS.Core.Application.Service { @@ -55,8 +54,8 @@ namespace IRaCIS.Core.Application.Service ; - + } } - + } diff --git a/IRaCIS.Core.Application/Service/Fixed/CriterionAdditionalAssessment.cs b/IRaCIS.Core.Application/Service/Fixed/CriterionAdditionalAssessment.cs index 54ba91882..fad30fa39 100644 --- a/IRaCIS.Core.Application/Service/Fixed/CriterionAdditionalAssessment.cs +++ b/IRaCIS.Core.Application/Service/Fixed/CriterionAdditionalAssessment.cs @@ -1,13 +1,6 @@ -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share.Reading; using MassTransit; -using NPOI.POIFS.NIO; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomArchiveResult.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomArchiveResult.cs index 9eb0b06ba..ee86c9dfb 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomArchiveResult.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomArchiveResult.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; - -namespace IRaCIS.Core.Application.Contracts.Dicom.DTO +namespace IRaCIS.Core.Application.Contracts.Dicom.DTO { public sealed class DicomArchiveResult { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs index ffbb1dca4..a95065a2d 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomInstanceModel.cs @@ -1,10 +1,8 @@ -using IRaCIS.Core.Domain.Share; - -namespace IRaCIS.Core.Application.Contracts +namespace IRaCIS.Core.Application.Contracts { public class DicomInstanceDTO { - public Guid Id { get; set;} + public Guid Id { get; set; } public Guid StudyId { get; set; } public Guid SeriesId { get; set; } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs index 159da3d4e..6717099d1 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DicomSeriesModel.cs @@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public int SeriesNumber { get; set; } public DateTime? SeriesTime { get; set; } public string Modality { get; set; } = String.Empty; - public string Description { get; set; }=String.Empty; + public string Description { get; set; } = String.Empty; public int InstanceCount { get; set; } public string NoneDicomFileFirstFile { get; set; } = String.Empty; @@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public Guid SubjectId { get; set; } public Guid SubjectVisitId { get; set; } - + public Guid CreateUserId { get; set; } public DateTime CreateTime { get; set; } public Guid UpdateUserId { get; set; } @@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public bool IsReading { get; set; } = true; - public List InstanceInfoList { get; set; }=new List(); + public List InstanceInfoList { get; set; } = new List(); public bool IsExistMutiFrames => InstanceInfoList.Any(t => t.NumberOfFrames > 1); @@ -49,7 +49,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public string? WindowCenter => InstanceInfoList.FirstOrDefault()?.WindowCenter; public string? WindowWidth => InstanceInfoList.FirstOrDefault()?.WindowWidth; - public string ImageResizePath { get; set; } + public string ImageResizePath { get; set; } } public class StudyInstanceInfo @@ -81,7 +81,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public Guid? StudyId { get; set; } - public List KeyFramesList{ get; set; }=new List { }; + public List KeyFramesList { get; set; } = new List { }; public Guid? SeriesId { get; set; } @@ -91,7 +91,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO public decimal RowIndex { get; set; } [JsonIgnore] public string WindowCenter { get; set; } - [JsonIgnore] + [JsonIgnore] public string WindowWidth { get; set; } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs index 40e97d11b..36d9fa60c 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/DownloadAndUploadDTO.cs @@ -1,11 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Web; - -namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO +namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO { public class SubjectImageUploadDTO { @@ -62,7 +55,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO } - public class SubjectCRCImageUploadedStudyDto: SubjectCRCImageUploadedDto + public class SubjectCRCImageUploadedStudyDto : SubjectCRCImageUploadedDto { public bool IsDicom => DicomStudyList.Count() > 0; } @@ -86,7 +79,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO - public List DicomStudyList { get; set; }=new List(); + public List DicomStudyList { get; set; } = new List(); public List NoneDicomStudyList { get; set; } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageLabelModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageLabelModel.cs index 419304ed6..d1d52e190 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageLabelModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageLabelModel.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace IRaCIS.Core.Application.Contracts.Dicom.DTO +namespace IRaCIS.Core.Application.Contracts.Dicom.DTO { public class ImageLabelDTO { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageShareModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageShareModel.cs index a3e118071..b099f749d 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageShareModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/ImageShareModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Core.Application.Contracts.Dicom.DTO +namespace IRaCIS.Core.Application.Contracts.Dicom.DTO { public class ImageShareCommand { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/StudyStatusDetailModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/StudyStatusDetailModel.cs index b8e56430d..7be45617a 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/StudyStatusDetailModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/StudyStatusDetailModel.cs @@ -1,13 +1,11 @@ -using System; - -namespace IRaCIS.Core.Application.Contracts.Dicom.DTO +namespace IRaCIS.Core.Application.Contracts.Dicom.DTO { public class StudyStatusDetailDTO { public Guid Id { get; set; } public Guid StudyId { get; set; } public int Status { get; set; } - public string OptUserName { get; set; }=string.Empty; + public string OptUserName { get; set; } = string.Empty; public DateTime OptTime { get; set; } public string Note { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/SystemAnonymizationViewModel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/SystemAnonymizationViewModel.cs index 55da414b5..308e8ea6f 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/SystemAnonymizationViewModel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/SystemAnonymizationViewModel.cs @@ -3,24 +3,22 @@ // 生成时间 2022-03-03 15:28:20 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// SystemAnonymizationView 列表视图模型 - public class SystemAnonymizationView: SystemAnonymizationAddOrEdit + public class SystemAnonymizationView : SystemAnonymizationAddOrEdit { - + public Guid CreateUserId { get; set; } public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } - + public DateTime CreateTime { get; set; } } ///SystemAnonymizationQuery 列表查询参数模型 - public class SystemAnonymizationQuery:PageInput + public class SystemAnonymizationQuery : PageInput { public string Group { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index 31f02fd6f..a7bc9e3f9 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -1,12 +1,7 @@ using IRaCIS.Core.Application.Service.ImageAndDoc.DTO; using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs index 575fed204..02ec09b63 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs @@ -1,17 +1,14 @@ -using IRaCIS.Core.Application.Contracts.Dicom; -using IRaCIS.Core.Domain.Share; -using System.Text; +using FellowOakDicom; +using FellowOakDicom.Imaging.Codec; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts.Dicom; using IRaCIS.Core.Application.Helper; -using Microsoft.AspNetCore.Hosting; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Medallion.Threading; -using FellowOakDicom; -using FellowOakDicom.Imaging.Codec; +using Microsoft.AspNetCore.Hosting; using System.Data; -using IRaCIS.Core.Domain.Models; -using FellowOakDicom.Network; -using DocumentFormat.OpenXml.Drawing.Charts; +using System.Text; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application.Services diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 8baae9c30..171c01ae8 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -1,30 +1,19 @@ -using Amazon.Runtime.EventStreams.Internal; -using DocumentFormat.OpenXml.EMMA; -using FellowOakDicom; -using IRaCIS.Application.Contracts; +using FellowOakDicom; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Service.ImageAndDoc.DTO; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Infrastructure.Extention; using MassTransit; using MassTransit.Initializers; -using MathNet.Numerics; using Medallion.Threading; using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; -using System; -using System.Collections.Generic; -using System.Collections.Immutable; using System.Data; using System.IO.Compression; -using System.Linq; using System.Text; -using System.Threading.Tasks; using System.Web; using ZiggyCreatures.Caching.Fusion; @@ -758,7 +747,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { //要根据标准阅片顺序,确定是否查询单个任务的,还是查询所有的 - var criterionInfo= await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) .Select(t => new { t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); @@ -767,7 +756,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc var isAnalysisCreate = false; //医学审核查看下载按钮,这个时候需要知道医生 - if (inQuery.VisitTaskId != null ) + if (inQuery.VisitTaskId != null) { var info = await _visitTaskRepository.Where(t => t.Id == inQuery.VisitTaskId).Select(t => new { t.DoctorUserId, t.IsAnalysisCreate }).FirstNotNullAsync(); @@ -778,7 +767,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc var query = _visitTaskRepository.Where(t => t.SubjectId == inQuery.SubjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect) //满足 有序,或者随机只看到当前任务的dicom 非dicom检查 - .WhereIf(criterionInfo.IsReadingTaskViewInOrder!=ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null,t=>t.Id==inQuery.VisitTaskId) + .WhereIf(criterionInfo.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom && inQuery.VisitTaskId != null, t => t.Id == inQuery.VisitTaskId) .ProjectTo(_mapper.ConfigurationProvider); //这里过滤是否是一致性分析的 @@ -848,7 +837,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task GetIRReadingDownloadStudyInfo(IRDownloadQuery inQuery) { var info = await _readingQuestionCriterionTrialRepository.Where(t => t.Id == inQuery.TrialReadingCriterionId) - .Select(t => new { t.IsImageFilter, t.CriterionModalitys, t.TrialId,t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); + .Select(t => new { t.IsImageFilter, t.CriterionModalitys, t.TrialId, t.IsReadingTaskViewInOrder }).FirstNotNullAsync(); var isQueryDicom = inQuery.DicomStudyIdList.Count > 0; var isQueryNoneDicom = inQuery.NoneDicomStudyIdList.Count > 0; @@ -933,7 +922,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc await _trialImageDownloadRepository.AddAsync(preDownloadInfo, true); - return ResponseOutput.Ok(result, new { PreDownloadId= preDownloadInfo.Id,info.IsReadingTaskViewInOrder } ); + return ResponseOutput.Ok(result, new { PreDownloadId = preDownloadInfo.Id, info.IsReadingTaskViewInOrder }); } /// diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs index 2422493ce..b023c8ca0 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs @@ -1,10 +1,9 @@ -using IRaCIS.Core.Application.Contracts.Dicom.DTO; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Core.Application.Auth; +using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Configuration; -using IRaCIS.Core.Application.Auth; namespace IRaCIS.Core.Application.Services { @@ -15,7 +14,7 @@ namespace IRaCIS.Core.Application.Services ITokenService _tokenService) : BaseService, IImageShareService { - + [HttpPost] public async Task CreateImageShare(ImageShareCommand imageShareCommand) @@ -46,7 +45,7 @@ namespace IRaCIS.Core.Application.Services if (!studyIds.Any()) { - //---当前检查没有影像可以分享。 + //---当前检查没有影像可以分享。 return ResponseOutput.NotOk(_localizer["ISS_NoImgToShare"]); } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs index c724678fc..8e656b8c4 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/InstanceService.cs @@ -1,7 +1,7 @@ -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Helper; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using System.Linq.Dynamic.Core; namespace IRaCIS.Core.Application.Services diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IDicomArchiveService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IDicomArchiveService.cs index 92332cb06..a4dca0f18 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IDicomArchiveService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IDicomArchiveService.cs @@ -4,7 +4,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom { public interface IDicomArchiveService { - Task<(Guid StudyId, string StudyCode)> ArchiveDicomStreamAsync(Stream dicomStream, DicomTrialSiteSubjectInfo addtionalInfo, List seriesInstanceUidList, List instanceUidList); + Task<(Guid StudyId, string StudyCode)> ArchiveDicomStreamAsync(Stream dicomStream, DicomTrialSiteSubjectInfo addtionalInfo, List seriesInstanceUidList, List instanceUidList); //ICollection GetArchivedStudyList(List archivedStudyIds); Task DicomDBDataSaveChange(); diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IStudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IStudyService.cs index d2e9efa5a..643154f4c 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IStudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/IStudyService.cs @@ -1,5 +1,4 @@ -using IRaCIS.Core.Application.Contracts; -using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/ISystemAnonymizationService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/ISystemAnonymizationService.cs index 3beb86ab5..000b8cc93 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/ISystemAnonymizationService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/Interface/ISystemAnonymizationService.cs @@ -5,20 +5,20 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ISystemAnonymizationService - /// - public interface ISystemAnonymizationService +{ + /// + /// ISystemAnonymizationService + /// + public interface ISystemAnonymizationService { - - Task> GetSystemAnonymizationList(SystemAnonymizationQuery querySystemAnonymization); - - Task AddOrUpdateSystemAnonymization(SystemAnonymizationAddOrEdit addOrEditSystemAnonymization); - Task DeleteSystemAnonymization(Guid systemAnonymizationId); + Task> GetSystemAnonymizationList(SystemAnonymizationQuery querySystemAnonymization); + + Task AddOrUpdateSystemAnonymization(SystemAnonymizationAddOrEdit addOrEditSystemAnonymization); + + Task DeleteSystemAnonymization(Guid systemAnonymizationId); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs index 4615730d7..2598b9407 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/NoneDicomStudyService.cs @@ -3,13 +3,11 @@ // 生成时间 2021-12-06 10:54:55 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Filter; -using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Domain.Share; using Medallion.Threading; -using IRaCIS.Core.Application.Service.Reading.Dto; +using Microsoft.AspNetCore.Mvc; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs index 2f83daf31..d25951c82 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SeriesService.cs @@ -1,8 +1,7 @@ using IRaCIS.Core.Application.Contracts.Dicom.DTO; - -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Authorization; using IRaCIS.Core.Application.Helper; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Services { @@ -13,7 +12,7 @@ namespace IRaCIS.Core.Application.Services IRepository _instanceRepository ) : BaseService { - + @@ -30,7 +29,7 @@ namespace IRaCIS.Core.Application.Services var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber) .ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime) - .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames,t.InstanceNumber,t.HtmlPath }).ToListAsync();//.GroupBy(u => u.SeriesId); + .Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath }).ToListAsync();//.GroupBy(u => u.SeriesId); foreach (var series in seriesList) { @@ -44,7 +43,7 @@ namespace IRaCIS.Core.Application.Services Path = k.Path, InstanceNumber = k.InstanceNumber, - }).ToList(); + }).ToList(); } #region 暂时废弃 @@ -124,7 +123,7 @@ namespace IRaCIS.Core.Application.Services #region 切换磁盘存储后 - var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path); + var physicalPath = FileStoreHelper.GetPhysicalFilePath(_hostEnvironment, path); //不存在,去其他路径找 if (!File.Exists(physicalPath)) @@ -152,7 +151,7 @@ namespace IRaCIS.Core.Application.Services } } - + #endregion diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 85bab0591..5f5193d92 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -1,20 +1,12 @@ using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Services; -using System.Linq.Expressions; -using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Infrastructure; -using DocumentFormat.OpenXml.Presentation; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Application.Filter; -using Microsoft.AspNetCore.Http; -using Newtonsoft.Json; -using System.Threading; -using Medallion.Threading; -using DocumentFormat.OpenXml.Drawing.Diagrams; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Service.ImageAndDoc.DTO; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; +using Medallion.Threading; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application.Service.ImageAndDoc @@ -164,13 +156,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc studyMonitor.FailedFileCount = incommand.FailedFileCount; studyMonitor.IsSuccess = incommand.FailedFileCount == 0; studyMonitor.RecordPath = incommand.RecordPath; - studyMonitor.FileSize = incommand.Study.SeriesList.SelectMany(t=>t.InstanceList).Sum(t => t.FileSize); + studyMonitor.FileSize = incommand.Study.SeriesList.SelectMany(t => t.InstanceList).Sum(t => t.FileSize); var studyId = IdentifierHelper.CreateGuid(incommand.Study.StudyInstanceUid, incommand.TrialId.ToString()); var findStudy = await _dicomstudyRepository.FirstOrDefaultAsync(t => t.Id == studyId); studyMonitor.StudyId = studyId; - studyMonitor.StudyCode = findStudy?.StudyCode??""; + studyMonitor.StudyCode = findStudy?.StudyCode ?? ""; studyMonitor.IsDicomReUpload = findStudy != null; diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/SystemAnonymizationService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/SystemAnonymizationService.cs index 9307cadc8..4eddcbfe5 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/SystemAnonymizationService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/SystemAnonymizationService.cs @@ -6,7 +6,6 @@ using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs index 863fa4c51..9ba437828 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/_MapConfig.cs @@ -1,12 +1,9 @@ using AutoMapper; -using DocumentFormat.OpenXml.EMMA; -using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Service.ImageAndDoc.DTO; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; namespace IRaCIS.Core.Application.Service { @@ -139,7 +136,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.IsImageFilter, u => u.MapFrom(s => s.TrialReadingCriterion.IsImageFilter)) .ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys)) .ForMember(d => d.SubjectCode, u => u.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code)) - .ForMember(d => d.DicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.StudyList)) + .ForMember(d => d.DicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.StudyList)) .ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList)) ; @@ -147,7 +144,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUser.FullName)) .ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUser.UserTypeEnum)) .ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUser.UserName)); - + } } diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs index e35d07230..59ceefc6c 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -2,14 +2,7 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Domain.Share; -using Newtonsoft.Json; -using Newtonsoft.Json.Converters; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Inspection.DTO { @@ -181,8 +174,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public class SetNeedReuploadDto { - public Guid trialId { get; set; } - public Guid qcChallengeId { get; set; } + public Guid trialId { get; set; } + public Guid qcChallengeId { get; set; } } public class SetVisitUrgentDto @@ -195,7 +188,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public class UpdateTrialStateDto { - public Guid trialId {get; set; } + public Guid trialId { get; set; } public string trialStatusStr { get; set; } public string? reason { get; set; } @@ -204,7 +197,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO { public Guid trialId { get; set; } public Guid subjectVisitId { get; set; } - + public AuditStateEnum auditState { get; set; } } @@ -250,7 +243,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO } - public class SetCheckPassDt + public class SetCheckPassDt { public string ManualPassReason { get; set; } = string.Empty; @@ -260,7 +253,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public class ObtainOrCancelQCTaskDto { - public Guid trialId { get; set; } + public Guid trialId { get; set; } public Guid subjectVisitId { get; set; } public bool obtaionOrCancel { get; set; } } @@ -270,7 +263,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO /// /// 阅片临床数据ID /// - public Guid ReadingClinicalDataId { get; set; } + public Guid ReadingClinicalDataId { get; set; } [NotDefault] public Guid TrialReadingCriterionId { get; set; } @@ -290,16 +283,16 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO /// 稽查泛型Dto /// /// 泛型 - public class DataInspectionDto + public class DataInspectionDto { public T Data { get; set; } - + public SignDTO? SignInfo { get; set; } - + } #region Qc @@ -342,14 +335,14 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO #endregion - - + + /// /// 用户 签名某个文档 Dto /// public class TrialDocumentConfirmDTO : InspectionBase, IInspectionDTO, ISignDTO - { + { public UserConfirmCommand OptCommand { get; set; } } @@ -416,21 +409,21 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO public class UpdateTrialState { - public Guid trialId { get; set; } - public string trialStatusStr { get; set; } - public string reason { get; set; } + public Guid trialId { get; set; } + public string trialStatusStr { get; set; } + public string reason { get; set; } } public class AbandonTrial { - public Guid trialId { get; set; } - public bool isAbandon { get; set; } + public Guid trialId { get; set; } + public bool isAbandon { get; set; } } public class GetDataInspectionDto : PageInput { - + /// /// 项目iD @@ -445,7 +438,7 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO /// /// 受试者 /// - public string SubjectInfo { get; set; } = string.Empty; + public string SubjectInfo { get; set; } = string.Empty; /// /// @@ -491,10 +484,10 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO /// public string RoleName { get; set; } = string.Empty; - /// - /// 是否有签名 - /// - public bool? IsSign { get; set; } + /// + /// 是否有签名 + /// + public bool? IsSign { get; set; } /// /// 批次Id diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionViewModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionViewModel.cs index 858d8bd08..30910a036 100644 --- a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionViewModel.cs @@ -1,4 +1,3 @@ -using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel; diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 8f9b8b527..7a9cf2450 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -4,21 +4,18 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share.Management; +using IRaCIS.Core.Infra.EFCore.Common; using MassTransit; +using Microsoft.AspNetCore.Mvc; using Microsoft.Data.SqlClient; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Domain.Share.Management; -using System.Text.Json.Nodes; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.EntityFrameworkCore; using Npgsql; -using IRaCIS.Core.Infra.EFCore.Common; namespace IRaCIS.Core.Application.Service { @@ -609,7 +606,7 @@ namespace IRaCIS.Core.Application.Service { jsonDataValueDic[item.Key] = string.Join(",", _frontAuditConfigRepository._dbContext.Database.SqlQueryRaw - (sql, new NpgsqlParameter("@para",para)).ToList()); + (sql, new NpgsqlParameter("@para", para)).ToList()); } else { diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 4b885987f..5a528e5ea 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -2,7 +2,6 @@ using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Application.Service.Inspection.Interface; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infrastructure; using Panda.DynamicWebApi.Attributes; @@ -23,7 +22,7 @@ namespace IRaCIS.Core.Application.Service.Inspection IRepository _visitTaskRepository, IRepository _frontAuditConfigRepository) : BaseService, IInspectionService { - + @@ -45,7 +44,7 @@ namespace IRaCIS.Core.Application.Service.Inspection from leftrial in trialtemp.DefaultIfEmpty() - join trialSite in _trialSiteRepository.Where().IgnoreQueryFilters() on data.TrialSiteId equals trialSite.Id into trialSitetemp + join trialSite in _trialSiteRepository.Where().IgnoreQueryFilters() on data.TrialSiteId equals trialSite.Id into trialSitetemp from lefttrialSite in trialSitetemp.DefaultIfEmpty() @@ -126,9 +125,9 @@ namespace IRaCIS.Core.Application.Service.Inspection //CreateUserName = leftuser.UserName, //RoleName = leftusertype.UserTypeShortName, - CreateUserRealName=data.CreateUserRealName, + CreateUserRealName = data.CreateUserRealName, CreateUserName = data.CreateUserName, - RoleName=data.RoleName, + RoleName = data.RoleName, //UserFirstName = leftuser.FirstName, @@ -136,16 +135,16 @@ namespace IRaCIS.Core.Application.Service.Inspection ExperimentName = leftrial.ExperimentName, //SubjectCode = leftvisttask.BlindSubjectCode.IsNullOrEmpty()? leftsubject.Code: leftvisttask.BlindSubjectCode, - SubjectCode = leftvisttask.IsAnalysisCreate? leftvisttask.BlindSubjectCode: leftsubject.Code , + SubjectCode = leftvisttask.IsAnalysisCreate ? leftvisttask.BlindSubjectCode : leftsubject.Code, SiteCode = lefttrialSite.TrialSiteCode, ResearchProgramNo = leftrial.ResearchProgramNo, ObjectTypeId = data.ObjectTypeId, Description = leftfrontAuditConfig.Description, - DescriptionCN=leftfrontAuditConfig.DescriptionCN, + DescriptionCN = leftfrontAuditConfig.DescriptionCN, ModuleTypeName = leftmoduleTypec.Value, - ModuleTypeNameCN=leftmoduleTypec.ValueCN, + ModuleTypeNameCN = leftmoduleTypec.ValueCN, SignText = lefttrialSign.SignText, Identification = leftfrontAuditConfig.Identification, @@ -161,13 +160,13 @@ namespace IRaCIS.Core.Application.Service.Inspection ObjectRelationParentId = data.ObjectRelationParentId, GeneralId = data.GeneralId, - TrialReadingCriterionId=data.TrialReadingCriterionId, + TrialReadingCriterionId = data.TrialReadingCriterionId, TrialReadingCriterionName = data.TrialReadingCriterion.CriterionName }; query = query.WhereIf(inQuery.TrialSiteId != null, x => x.TrialSiteId == inQuery.TrialSiteId) //.Where(x => (x.TrialId == dto.TrialId) || (x.TrialId == null && x.CreateTime >= trialData.CreateTime && x.CreateTime <= trialData.TrialFinishTime)) - .Where(x => x.TrialId == inQuery.TrialId ) + .Where(x => x.TrialId == inQuery.TrialId) #region 废弃 // .WhereIf(dto.BatchId != null && dto.ObjectRelationParentId == null && dto.GeneralId == null, x => x.BatchId == dto.BatchId) @@ -189,18 +188,18 @@ namespace IRaCIS.Core.Application.Service.Inspection .WhereIf(inQuery.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) - .WhereIf(!inQuery.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(inQuery.TaskName) || x.BlindName.Contains(inQuery.TaskName)) + .WhereIf(!inQuery.TaskName.IsNullOrEmpty(), x => x.TaskName.Contains(inQuery.TaskName) || x.BlindName.Contains(inQuery.TaskName)) .WhereIf(!inQuery.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(inQuery.SubjectInfo)) - .WhereIf(!inQuery.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(inQuery.RoleName)) - //.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo) - //.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false) - .WhereIf(inQuery.StartTime != null, x => x.CreateTime >= inQuery.StartTime) + .WhereIf(!inQuery.RoleName.IsNullOrEmpty(), x => x.RoleName.Contains(inQuery.RoleName)) + //.WhereIf(dto.VisitPlanInfo != null&& dto.VisitPlanInfo!=(decimal) 1.11, x => x.VisitNum == dto.VisitPlanInfo) + //.WhereIf(dto.VisitPlanInfo != (decimal)1.11,x=>x.InPlan!=null&& x.InPlan==false) + .WhereIf(inQuery.StartTime != null, x => x.CreateTime >= inQuery.StartTime) .WhereIf(inQuery.EndTime != null, x => x.CreateTime <= inQuery.EndTime) .WhereIf(inQuery.ModuleType != null, x => x.ModuleTypeId == inQuery.ModuleType) - .WhereIf(!inQuery.Description.IsNullOrEmpty(), x => x.Description.Contains(inQuery.Description)|| x.DescriptionCN.Contains(inQuery.Description)) + .WhereIf(!inQuery.Description.IsNullOrEmpty(), x => x.Description.Contains(inQuery.Description) || x.DescriptionCN.Contains(inQuery.Description)) .WhereIf(!inQuery.OpByUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.OpByUserName)) .WhereIf(!inQuery.CreateUserName.IsNullOrEmpty(), x => x.CreateUserName.Contains(inQuery.CreateUserName) || x.CreateUserRealName.Contains(inQuery.CreateUserName)) - + //.WhereIf(!dto.SubjectInfo.IsNullOrEmpty(), x => x.SubjectCode.Contains(dto.SubjectInfo)) .WhereIf(inQuery.IsSign != null, x => x.IsSign == inQuery.IsSign); #endregion @@ -213,7 +212,7 @@ namespace IRaCIS.Core.Application.Service.Inspection { query = query.Where(x => x.InPlan == false); } - return await query.ToPagedListAsync(inQuery, nameof(GetDataInspectionOutDto.CreateTime) ); + return await query.ToPagedListAsync(inQuery, nameof(GetDataInspectionOutDto.CreateTime)); } diff --git a/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs index 74c0d7c9b..2aca6d8de 100644 --- a/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs @@ -1,10 +1,5 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Service.Inspection.DTO; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Inspection.Interface { @@ -13,11 +8,11 @@ namespace IRaCIS.Core.Application.Service.Inspection.Interface Task> GetInspectionList(GetDataInspectionDto dto); - + Task AddSignRecordAsync(SignDTO signDTO); - Task RecordSing(SignDTO SignInfo); + Task RecordSing(SignDTO SignInfo); Task CompletedSign(Guid signId, IResponseOutput response); diff --git a/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs b/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs index efa0b9bb9..73fb85dc3 100644 --- a/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Inspection/_MapConfig.cs @@ -1,12 +1,6 @@ using AutoMapper; -using AutoMapper.EquivalencyExpression; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service { @@ -14,14 +8,14 @@ namespace IRaCIS.Core.Application.Service { public InspectionConfig() { - + CreateMap(); CreateMap(); - - + + diff --git a/IRaCIS.Core.Application/Service/Institution/CROService.cs b/IRaCIS.Core.Application/Service/Institution/CROService.cs index b7ca6a4f8..f1502e2b7 100644 --- a/IRaCIS.Core.Application/Service/Institution/CROService.cs +++ b/IRaCIS.Core.Application/Service/Institution/CROService.cs @@ -1,16 +1,15 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Institution")] public class CroService( IRepository _croRepository, IRepository _trialRepository) : BaseService, ICroService { - + /// 分页获取CRO列表 [HttpPost] diff --git a/IRaCIS.Core.Application/Service/Institution/DTO/CROCompanyModel.cs b/IRaCIS.Core.Application/Service/Institution/DTO/CROCompanyModel.cs index ceb163eab..2448eca2c 100644 --- a/IRaCIS.Core.Application/Service/Institution/DTO/CROCompanyModel.cs +++ b/IRaCIS.Core.Application/Service/Institution/DTO/CROCompanyModel.cs @@ -1,7 +1,4 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class CROCompanyDTO { diff --git a/IRaCIS.Core.Application/Service/Institution/DTO/HospitalModel.cs b/IRaCIS.Core.Application/Service/Institution/DTO/HospitalModel.cs index 3bf266668..0fd275dee 100644 --- a/IRaCIS.Core.Application/Service/Institution/DTO/HospitalModel.cs +++ b/IRaCIS.Core.Application/Service/Institution/DTO/HospitalModel.cs @@ -1,7 +1,4 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class HospitalDTO : HospitalCommand { diff --git a/IRaCIS.Core.Application/Service/Institution/DTO/SiteModel.cs b/IRaCIS.Core.Application/Service/Institution/DTO/SiteModel.cs index 55213b696..5d428eb92 100644 --- a/IRaCIS.Core.Application/Service/Institution/DTO/SiteModel.cs +++ b/IRaCIS.Core.Application/Service/Institution/DTO/SiteModel.cs @@ -1,11 +1,8 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { - public class SiteDTO: SiteCommand + public class SiteDTO : SiteCommand { - public DateTime CreateTime { get; set; } + public DateTime CreateTime { get; set; } } public class SiteCommand @@ -24,7 +21,7 @@ namespace IRaCIS.Application.Contracts public string AliasName { get; set; } = string.Empty; public string City { get; set; } = string.Empty; public string Country { get; set; } = string.Empty; - public Guid? HospitalId { get; set; } + public Guid? HospitalId { get; set; } public string DirectorName { get; set; } = string.Empty; public string DirectorPhone { get; set; } = string.Empty; public string ContactName { get; set; } = string.Empty; @@ -48,14 +45,14 @@ namespace IRaCIS.Application.Contracts } - public class TrialSiteInQuery:PageInput + public class TrialSiteInQuery : PageInput { public string? TrialSiteName { get; set; } public string? TrialCode { get; set; } } - public class TrialSiteAddView + public class TrialSiteAddView { public Guid TrialSiteId { get; set; } public string TrialCode { get; set; } diff --git a/IRaCIS.Core.Application/Service/Institution/DTO/SponsorModel.cs b/IRaCIS.Core.Application/Service/Institution/DTO/SponsorModel.cs index 489530317..efea062fb 100644 --- a/IRaCIS.Core.Application/Service/Institution/DTO/SponsorModel.cs +++ b/IRaCIS.Core.Application/Service/Institution/DTO/SponsorModel.cs @@ -1,9 +1,6 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { - public class SponsorDTO:SponsorCommand + public class SponsorDTO : SponsorCommand { } diff --git a/IRaCIS.Core.Application/Service/Institution/HospitalService.cs b/IRaCIS.Core.Application/Service/Institution/HospitalService.cs index e44ec03c5..95f6a562f 100644 --- a/IRaCIS.Core.Application/Service/Institution/HospitalService.cs +++ b/IRaCIS.Core.Application/Service/Institution/HospitalService.cs @@ -1,11 +1,8 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Infrastructure; -using Microsoft.Data.Sqlite; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Institution")] public class HospitalService( @@ -13,7 +10,7 @@ namespace IRaCIS.Application.Services IRepository _doctorRepository, IRepository _siteRepository) : BaseService, IHospitalService { - + /// 获取所有医院列表 public async Task> GetHospitalList() @@ -51,7 +48,7 @@ namespace IRaCIS.Application.Services //手动绑 if (hospitalCommand.SiteId != null) { - await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospitalCommand.SiteId, u => new Site() { HospitalId = hospital.Id}); + await _siteRepository.BatchUpdateNoTrackingAsync(t => t.Id == hospitalCommand.SiteId, u => new Site() { HospitalId = hospital.Id }); } return ResponseOutput.Ok(hospital.Id.ToString()); diff --git a/IRaCIS.Core.Application/Service/Institution/Interface/ICROService.cs b/IRaCIS.Core.Application/Service/Institution/Interface/ICROService.cs index 94b1d7c45..6ddf74f02 100644 --- a/IRaCIS.Core.Application/Service/Institution/Interface/ICROService.cs +++ b/IRaCIS.Core.Application/Service/Institution/Interface/ICROService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { diff --git a/IRaCIS.Core.Application/Service/Institution/Interface/IHospitalService.cs b/IRaCIS.Core.Application/Service/Institution/Interface/IHospitalService.cs index c3694a93b..16081d32d 100644 --- a/IRaCIS.Core.Application/Service/Institution/Interface/IHospitalService.cs +++ b/IRaCIS.Core.Application/Service/Institution/Interface/IHospitalService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { @@ -10,8 +7,8 @@ namespace IRaCIS.Application.Interfaces /// 获取医院列表 Task> GetHospitalList(); Task> GetHospitalPageList(HospitalQueryDTO queryModel); - Task AddOrUpdateHospital(HospitalCommand model); - Task DeleteHospital(Guid hospitalId); + Task AddOrUpdateHospital(HospitalCommand model); + Task DeleteHospital(Guid hospitalId); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Institution/Interface/ISiteService.cs b/IRaCIS.Core.Application/Service/Institution/Interface/ISiteService.cs index 2d392e5ba..bb3c60ca4 100644 --- a/IRaCIS.Core.Application/Service/Institution/Interface/ISiteService.cs +++ b/IRaCIS.Core.Application/Service/Institution/Interface/ISiteService.cs @@ -1,14 +1,11 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { public interface ISiteService { Task> GetSiteList(SiteQueryParam queryModel); - Task> GetAllSiteList(); + Task> GetAllSiteList(); Task AddOrUpdateSite(SiteCommand AddModel); Task DeleteSite(Guid researchCenterId); diff --git a/IRaCIS.Core.Application/Service/Institution/Interface/ISponsorService.cs b/IRaCIS.Core.Application/Service/Institution/Interface/ISponsorService.cs index ae84df631..60193d15a 100644 --- a/IRaCIS.Core.Application/Service/Institution/Interface/ISponsorService.cs +++ b/IRaCIS.Core.Application/Service/Institution/Interface/ISponsorService.cs @@ -1,15 +1,12 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { public interface ISponsorService { Task> GetSponsorList(SponsorQueryDTO queryParam); - Task> GetAllSponsorList(Guid? sponsorId); - Task AddOrUpdateSponsor(SponsorCommand model); - Task DeleteSponsor(Guid sponsorId); + Task> GetAllSponsorList(Guid? sponsorId); + Task AddOrUpdateSponsor(SponsorCommand model); + Task DeleteSponsor(Guid sponsorId); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Institution/SiteService.cs b/IRaCIS.Core.Application/Service/Institution/SiteService.cs index cc20b12b8..79cf88f4d 100644 --- a/IRaCIS.Core.Application/Service/Institution/SiteService.cs +++ b/IRaCIS.Core.Application/Service/Institution/SiteService.cs @@ -1,14 +1,11 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; using Medallion.Threading; -using IRaCIS.Core.Domain.Models; -using System.Security.Policy; +using Microsoft.AspNetCore.Mvc; using Site = IRaCIS.Core.Domain.Models.Site; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Institution")] public class SiteService( @@ -18,7 +15,7 @@ namespace IRaCIS.Application.Services IRepository _trialSiteRepository, IRepository _hospitalRepository) : BaseService, ISiteService { - + /// 分页获取研究中心列表 [HttpPost] @@ -58,7 +55,7 @@ namespace IRaCIS.Application.Services TrialSiteName = t.TrialSiteName }); - return await query.ToPagedListAsync(inQuery, nameof(TrialSiteAddView.TrialCode)); + return await query.ToPagedListAsync(inQuery, nameof(TrialSiteAddView.TrialCode)); } /// 添加研究中心 diff --git a/IRaCIS.Core.Application/Service/Institution/SponsorService.cs b/IRaCIS.Core.Application/Service/Institution/SponsorService.cs index 941d88eb3..5e078d393 100644 --- a/IRaCIS.Core.Application/Service/Institution/SponsorService.cs +++ b/IRaCIS.Core.Application/Service/Institution/SponsorService.cs @@ -1,40 +1,38 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - [ ApiExplorerSettings(GroupName = "Institution")] + [ApiExplorerSettings(GroupName = "Institution")] public class SponsorService( IRepository _sponsorRepository, IRepository _trialRepository) : BaseService, ISponsorService { - + /// 分页获取申办方列表 - [HttpPost] + [HttpPost] public async Task> GetSponsorList(SponsorQueryDTO inQuery) { - + var sponsorQueryable = _sponsorRepository - .WhereIf(!string.IsNullOrWhiteSpace(inQuery.SponsorName),t => t.SponsorName.Contains(inQuery.SponsorName)|| t.SponsorNameCN.Contains(inQuery.SponsorName)) + .WhereIf(!string.IsNullOrWhiteSpace(inQuery.SponsorName), t => t.SponsorName.Contains(inQuery.SponsorName) || t.SponsorNameCN.Contains(inQuery.SponsorName)) .WhereIf(!string.IsNullOrEmpty(inQuery.SponsorCode), t => t.SponsorCode.Contains(inQuery.SponsorCode)) .ProjectTo(_mapper.ConfigurationProvider); return await sponsorQueryable.ToPagedListAsync(inQuery); - + } /// 分页获取申办方列表 - public async Task> GetAllSponsorList(Guid? trialId) + public async Task> GetAllSponsorList(Guid? trialId) { var sponsorQueryable = _sponsorRepository .WhereIf(trialId == null, t => t.IsTrialLevel == false) .WhereIf(trialId != null, t => t.IsTrialLevel == false || t.TrialId == trialId) - .ProjectTo(_mapper.ConfigurationProvider,new { isEn_Us= _userInfo.IsEn_Us}); + .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }); return await sponsorQueryable.ToListAsync(); } @@ -43,7 +41,7 @@ namespace IRaCIS.Application.Services { var exp = new EntityVerifyExp() { - VerifyExp = h => (h.SponsorName.Equals(sponsorCommand.SponsorName)|| h.SponsorNameCN.Equals(sponsorCommand.SponsorNameCN)) && h.IsTrialLevel == false, + VerifyExp = h => (h.SponsorName.Equals(sponsorCommand.SponsorName) || h.SponsorNameCN.Equals(sponsorCommand.SponsorNameCN)) && h.IsTrialLevel == false, //---已经存在同名的申办方,请确认。 VerifyMsg = _localizer["Sponsor_DupName"] }; @@ -52,14 +50,14 @@ namespace IRaCIS.Application.Services return ResponseOutput.Ok(sponsor.Id.ToString()); - - + + } /// 删除申办方 [HttpDelete("{sponsorId:guid}")] - - public async Task DeleteSponsor(Guid sponsorId) + + public async Task DeleteSponsor(Guid sponsorId) { if (await _trialRepository.AnyAsync(t => t.SponsorId == sponsorId)) { @@ -69,6 +67,6 @@ namespace IRaCIS.Application.Services var success = await _sponsorRepository.BatchDeleteNoTrackingAsync(x => x.Id == sponsorId); return ResponseOutput.Result(success); - } + } } } diff --git a/IRaCIS.Core.Application/Service/Institution/_MapConfig.cs b/IRaCIS.Core.Application/Service/Institution/_MapConfig.cs index 2cf5b19a2..fc7143ce4 100644 --- a/IRaCIS.Core.Application/Service/Institution/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Institution/_MapConfig.cs @@ -1,6 +1,5 @@ using AutoMapper; using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Models; namespace IRaCIS.Core.Application.Service { @@ -18,10 +17,10 @@ namespace IRaCIS.Core.Application.Service CreateMap().ReverseMap(); CreateMap(); CreateMap() - .ForMember(t => t.CROName, c => c.MapFrom(d => isEn_Us ? d.CROName : d.CRONameCN)); + .ForMember(t => t.CROName, c => c.MapFrom(d => isEn_Us ? d.CROName : d.CRONameCN)); CreateMap() - .ForMember(t=>t.SponsorName,c=>c.MapFrom(d=> isEn_Us?d.SponsorName:d.SponsorNameCN)); + .ForMember(t => t.SponsorName, c => c.MapFrom(d => isEn_Us ? d.SponsorName : d.SponsorNameCN)); CreateMap(); @@ -35,5 +34,5 @@ namespace IRaCIS.Core.Application.Service // .ForMember(o => o.InstitutionName, t => t.MapFrom(u => u.SiteName)); } } - + } diff --git a/IRaCIS.Core.Application/Service/Management/DTO/MenuModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/MenuModel.cs index afdf67140..b141119e8 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/MenuModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/MenuModel.cs @@ -1,6 +1,6 @@ namespace IRaCIS.Application.Contracts { - public class MenuCommand + public class MenuCommand { public Guid? MenuId { get; set; } @@ -41,7 +41,7 @@ public string Meta { get; set; } = string.Empty; - public string Note { get; set; } + public string Note { get; set; } public string Redirect { get; set; } = string.Empty; @@ -61,11 +61,11 @@ { public Guid? ParentId { get; set; } - public string? MenuType { get; set; } + public string? MenuType { get; set; } - public bool? IsEnable { get; set; } + public bool? IsEnable { get; set; } - public bool? IsCache { get; set; } + public bool? IsCache { get; set; } public bool? IsDisplay { get; set; } @@ -75,20 +75,20 @@ } - public class MenuFunctionDTO:MenuCommand + public class MenuFunctionDTO : MenuCommand { - public List Children { get; set; }=new List(); + public List Children { get; set; } = new List(); - public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - public DateTime UpdateTime { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } } public class RoleMenuFunctionSelectDTO { public Guid RoleId { get; set; } - public List MenuFunctionId { get; set; }=new List(); + public List MenuFunctionId { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/Management/DTO/RoleModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/RoleModel.cs index c34b4695f..aeb3861c4 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/RoleModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/RoleModel.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class RoleDTO { @@ -25,6 +23,6 @@ namespace IRaCIS.Application.Contracts public class RoleCommand : RoleDTO { - + } } diff --git a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs index 48be64dc5..b26eacd72 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/SystemNoticeViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2022-04-25 09:46:34 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Domain.Share.Management; @@ -26,7 +23,7 @@ namespace IRaCIS.Core.Application.ViewModel public string CreateUserName { get; set; } - + public DateTime UpdateTime { get; set; } public Guid UpdateUserId { get; set; } @@ -48,12 +45,12 @@ namespace IRaCIS.Core.Application.ViewModel } } - public List NoticeUserTypeList { get; set; } + public List NoticeUserTypeList { get; set; } } ///SystemNoticeQuery 列表查询参数模型 - public class SystemNoticeQuery:PageInput + public class SystemNoticeQuery : PageInput { public string NoticeContent { get; set; } = string.Empty; @@ -94,15 +91,15 @@ namespace IRaCIS.Core.Application.ViewModel } /// SystemNoticeAddOrEdit 列表查询参数模型 - public class SystemNoticeAddOrEdit: SystemNoticeBasicInfo + public class SystemNoticeAddOrEdit : SystemNoticeBasicInfo { - + public Guid[] NoticeUserTypeIdList { get; set; } } - public class SystemNoticeReadDTO: SystemNoticeBasicInfo + public class SystemNoticeReadDTO : SystemNoticeBasicInfo { public DateTime CreateTime { get; set; } public Guid CreateUserId { get; set; } @@ -111,7 +108,7 @@ namespace IRaCIS.Core.Application.ViewModel public string FullFilePath { get; set; } - public bool IsRead { get; set; } + public bool IsRead { get; set; } public Guid? PublishedUserId { get; set; } diff --git a/IRaCIS.Core.Application/Service/Management/DTO/TreeNode.cs b/IRaCIS.Core.Application/Service/Management/DTO/TreeNode.cs index 3d5e440d6..0b4100071 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/TreeNode.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/TreeNode.cs @@ -6,12 +6,12 @@ public Guid Id { get; set; } public string KeyName { get; set; } = string.Empty; public string Type { get; set; } = string.Empty; - public List Children { get; set; }=new List(); + public List Children { get; set; } = new List(); } - public class MenuTreeNodeSelect: MenuCommand + public class MenuTreeNodeSelect : MenuCommand { - + public List Children { get; set; } = new List(); public bool IsSelect { get; set; } = false; } @@ -22,5 +22,5 @@ public List Children { get; set; } = new List(); } - + } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs index 63f864ece..5c4cba71b 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserFeedBackViewModel.cs @@ -3,11 +3,8 @@ // 生成时间 2024-07-30 10:39:12 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { /// UserFeedBackView 列表视图模型 @@ -51,7 +48,7 @@ namespace IRaCIS.Core.Application.ViewModel public string? SubejctAndVisitKeyInfo { get; set; } - public UserTypeEnum? UserTypeEnum { get; set; } + public UserTypeEnum? UserTypeEnum { get; set; } public string? FeedBackUserKeyInfo { get; set; } diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs index 9f63e6b84..e8f78bfc0 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserLogViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2023-07-04 16:10:46 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// UserLogView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index 6b63943e2..f2f7c8824 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Core.Infrastructure.Extention; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; @@ -13,7 +10,7 @@ namespace IRaCIS.Application.Contracts public Guid Id { get; set; } public string UserType { get; set; } = string.Empty; - public UserTypeEnum UserTypeEnum { get; set; } + public UserTypeEnum UserTypeEnum { get; set; } public string Description { get; set; } = string.Empty; } @@ -28,7 +25,7 @@ namespace IRaCIS.Application.Contracts public class LoginReturnDTO { public UserBasicInfo BasicInfo { get; set; } = new UserBasicInfo(); - public string JWTStr { get; set; }=string.Empty; + public string JWTStr { get; set; } = string.Empty; public bool IsMFA { get; set; } = false; @@ -44,18 +41,18 @@ namespace IRaCIS.Application.Contracts public int? Sex { get; set; } // 1-男 2-女 - /// - /// LastLoginIP - /// - public string LastLoginIP { get; set; } = string.Empty; + /// + /// LastLoginIP + /// + public string LastLoginIP { get; set; } = string.Empty; - public UserTypeEnum UserTypeEnum { get; set; } + public UserTypeEnum UserTypeEnum { get; set; } - /// - /// 上一次修改密码的时间 - /// - public DateTime? LastChangePassWordTime { get; set; } - public bool IsTestUser { get; set; } + /// + /// 上一次修改密码的时间 + /// + public DateTime? LastChangePassWordTime { get; set; } + public bool IsTestUser { get; set; } public bool IsAdmin { get; set; } = false; public string UserTypeShortName { get; set; } = string.Empty; public bool PasswordChanged { get; set; } @@ -72,7 +69,7 @@ namespace IRaCIS.Application.Contracts public int LoginState { get; set; } = 0; - } + } public class MenuFuncTreeNodeView { @@ -89,7 +86,7 @@ namespace IRaCIS.Application.Contracts public string path { get; set; } = string.Empty; public Meta meta { get; set; } = new Meta(); public bool hidden { get; set; } - public List Childrens { get; set; }=new List(); + public List Childrens { get; set; } = new List(); } public class Meta @@ -141,7 +138,7 @@ namespace IRaCIS.Application.Contracts public string Phone { get; set; } = string.Empty; public string EMail { get; set; } = string.Empty; public Guid UserTypeId { get; set; } = Guid.Empty; - + public string UserCode { get; set; } = string.Empty; public bool IsZhiZhun { get; set; } @@ -159,7 +156,7 @@ namespace IRaCIS.Application.Contracts //public string OrganizationType { get; set; } = String.Empty; //public Guid OrganizationId { get; set; } public string OrganizationName { get; set; } = string.Empty; - + public string DepartmentName { get; set; } = String.Empty; @@ -186,11 +183,11 @@ namespace IRaCIS.Application.Contracts //public string FirstName { get; set; } //public string LastName { get; set; } } - + public class EditPasswordCommand { public string NewUserName { get; set; } = string.Empty; - + public string NewPassWord { get; set; } = string.Empty; public string OldPassWord { get; set; } = string.Empty; } @@ -205,7 +202,7 @@ namespace IRaCIS.Application.Contracts public string UserRealName { get; set; } = string.Empty; - public string UserType { get; set; } = string.Empty; + public string UserType { get; set; } = string.Empty; } public class UserListQueryDTO : PageInput @@ -218,7 +215,7 @@ namespace IRaCIS.Application.Contracts public bool? IsTestUser { get; set; } - public bool ? IsZhiZhun { get; set; } + public bool? IsZhiZhun { get; set; } public UserStateEnum? UserState { get; set; } public DateTime? BeginCreateTime { get; set; } @@ -238,7 +235,7 @@ namespace IRaCIS.Application.Contracts { [JsonIgnore] public Guid testGuid { get; set; } - public bool CanEditUserType { get; set; } + public bool CanEditUserType { get; set; } public DateTime CreateTime { get; set; } @@ -254,13 +251,13 @@ namespace IRaCIS.Application.Contracts public class UserIdRoleNameList { public Guid UserId { get; set; } - public IEnumerable RoleList { get; set; }=new List(); + public IEnumerable RoleList { get; set; } = new List(); } public class AllowAnonymousResetPasswordCommand { - public string Email { get; set; } = string.Empty; + public string Email { get; set; } = string.Empty; public string VerificationCode { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Management/Interface/IMenuService.cs b/IRaCIS.Core.Application/Service/Management/Interface/IMenuService.cs index 7f001dcea..89f7c517d 100644 --- a/IRaCIS.Core.Application/Service/Management/Interface/IMenuService.cs +++ b/IRaCIS.Core.Application/Service/Management/Interface/IMenuService.cs @@ -1,6 +1,6 @@ using IRaCIS.Application.Contracts; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public interface IMenuService { diff --git a/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs b/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs index 5f7610ddb..330ddefd6 100644 --- a/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs +++ b/IRaCIS.Core.Application/Service/Management/Interface/ISystemNoticeService.cs @@ -6,20 +6,20 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ISystemNoticeService - /// - public interface ISystemNoticeService +{ + /// + /// ISystemNoticeService + /// + public interface ISystemNoticeService { - - Task> GetSystemNoticeList(SystemNoticeQuery querySystemNotice); - - Task AddOrUpdateSystemNotice(SystemNoticeAddOrEdit addOrEditSystemNotice); - Task DeleteSystemNotice(Guid systemNoticeId); + Task> GetSystemNoticeList(SystemNoticeQuery querySystemNotice); + + Task AddOrUpdateSystemNotice(SystemNoticeAddOrEdit addOrEditSystemNotice); + + Task DeleteSystemNotice(Guid systemNoticeId); + - } -} +} diff --git a/IRaCIS.Core.Application/Service/Management/Interface/IUserService.cs b/IRaCIS.Core.Application/Service/Management/Interface/IUserService.cs index a5b037a4f..dd3778899 100644 --- a/IRaCIS.Core.Application/Service/Management/Interface/IUserService.cs +++ b/IRaCIS.Core.Application/Service/Management/Interface/IUserService.cs @@ -1,7 +1,7 @@ using IRaCIS.Application.Contracts; using IRaCIS.Core.Domain.Share; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public interface IUserService { @@ -12,14 +12,14 @@ namespace IRaCIS.Application.Services Task> Login(string userName, string password); Task VerifyMFACodeAsync(Guid userId, string Code); - Task SendMFAEmail(Guid userId, int mfaType=0); - Task GetUserBasicInfo(Guid userId,string pwd); + Task SendMFAEmail(Guid userId, int mfaType = 0); + Task GetUserBasicInfo(Guid userId, string pwd); Task ModifyPassword(EditPasswordCommand editPwModel); Task ResetPassword(Guid userId); - + Task UpdateUser(UserCommand model); Task UpdateUserState(Guid userId, UserStateEnum state); - + //Task SendVerificationCode(string emailOrPhone, VerifyType verificationType, bool isReviewer = false); //Task SetNewPassword(ResetPasswordCommand resetPwdModel); } diff --git a/IRaCIS.Core.Application/Service/Management/MenuService.cs b/IRaCIS.Core.Application/Service/Management/MenuService.cs index 65bb7a1f1..d7c0aece4 100644 --- a/IRaCIS.Core.Application/Service/Management/MenuService.cs +++ b/IRaCIS.Core.Application/Service/Management/MenuService.cs @@ -1,16 +1,15 @@ using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Management")] public class MenuService( IRepository _menuRepository, IRepository _userTypeMenuRepository) : BaseService, IMenuService { - + /// /// 添加菜单 New @@ -91,7 +90,7 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk(_localizer["Menu_ChildExist"]); } - var success =await _menuRepository.BatchDeleteNoTrackingAsync(u => u.Id == menuId); + var success = await _menuRepository.BatchDeleteNoTrackingAsync(u => u.Id == menuId); return ResponseOutput.Result(success); } @@ -134,7 +133,7 @@ namespace IRaCIS.Application.Services .WhereIf(menuQueyDTO.IsInTabDisplay != null, t => t.IsInTabDisplay == menuQueyDTO.IsInTabDisplay) .WhereIf(menuQueyDTO.MenuType != null, t => t.MenuType == menuQueyDTO.MenuType) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(t=>t.ShowOrder).ToListAsync(); + .ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.ShowOrder).ToListAsync(); } diff --git a/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs b/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs index 0b6ae8323..70115f57b 100644 --- a/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs +++ b/IRaCIS.Core.Application/Service/Management/SystemNoticeService.cs @@ -4,17 +4,16 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { /// /// SystemNoticeService /// [ApiExplorerSettings(GroupName = "Management")] - public class SystemNoticeService (IRepository _systemNoticeRepository) : BaseService, ISystemNoticeService + public class SystemNoticeService(IRepository _systemNoticeRepository) : BaseService, ISystemNoticeService { @@ -30,7 +29,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.NoticeLevelEnum != null, t => t.NoticeLevelEnum == inQuery.NoticeLevelEnum) .WhereIf(inQuery.NoticeModeEnum != null, t => t.NoticeModeEnum == inQuery.NoticeModeEnum) .WhereIf(inQuery.NoticeStateEnum != null && inQuery.NoticeStateEnum != Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == inQuery.NoticeStateEnum) - .WhereIf(inQuery.NoticeModeEnum != null && inQuery.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && t.EndDate !=null && t.EndDate < appDateTimeNow) + .WhereIf(inQuery.NoticeModeEnum != null && inQuery.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HaveExpired, t => t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && t.EndDate != null && t.EndDate < appDateTimeNow) .WhereIf(inQuery.NoticeTypeEnum != null, t => t.NoticeTypeEnum == inQuery.NoticeTypeEnum) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.FileName), t => t.FileName.Contains(inQuery.FileName)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.NoticeContent), t => t.NoticeContent.Contains(inQuery.NoticeContent)) @@ -74,7 +73,7 @@ namespace IRaCIS.Core.Application.Service _mapper.Map(addOrEditSystemNotice, systemNotice); - + await _systemNoticeRepository.SaveChangesAsync(); @@ -117,7 +116,7 @@ namespace IRaCIS.Core.Application.Service var appDateTimeNow = DateTime.Now; var systemNoticeQueryable = _systemNoticeRepository - .Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum==Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished) + .Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished) .WhereIf(inQuery.ApplicableProjectEnum != null, t => t.ApplicableProjectEnum == inQuery.ApplicableProjectEnum) .WhereIf(inQuery.NoticeLevelEnum != null, t => t.NoticeLevelEnum == inQuery.NoticeLevelEnum) .WhereIf(inQuery.NoticeModeEnum != null, t => t.NoticeModeEnum == inQuery.NoticeModeEnum) @@ -139,7 +138,7 @@ namespace IRaCIS.Core.Application.Service var query = _systemNoticeRepository .Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id)) - .Where(t=>t.EndDate==null || t.EndDate != null && t.EndDate > appDateTimeNow) + .Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > appDateTimeNow) .ProjectTo(_mapper.ConfigurationProvider, new { token = _userInfo.UserToken, userId = _userInfo.Id }); return await query.ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs index 89ace6dec..82064f011 100644 --- a/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserFeedBackService.cs @@ -4,28 +4,26 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Newtonsoft.Json; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using MailKit; -using IRaCIS.Application.Services; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; namespace IRaCIS.Core.Application.Service { /// /// UserFeedBackService /// [ApiExplorerSettings(GroupName = "Management")] - public class UserFeedBackService (IRepository _userFeedBackRepository, + public class UserFeedBackService(IRepository _userFeedBackRepository, IRepository _visitTaskRepository, IRepository _subjectVisitRepository, IRepository _subjectRepository) : BaseService, IUserFeedBackService { - + [HttpPost] public async Task> GetUserFeedBackList(UserFeedBackQuery inQuery) @@ -42,7 +40,7 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inQuery.EndCreatime != null, t => t.CreateTime == inQuery.EndCreatime) .WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUser.UserTypeEnum == inQuery.UserTypeEnum) - .WhereIf(!string.IsNullOrEmpty(inQuery.FeedBackUserKeyInfo), t => t.CreateUser.FullName.Contains(inQuery.FeedBackUserKeyInfo)|| t.CreateUser.UserName.Contains(inQuery.FeedBackUserKeyInfo)) + .WhereIf(!string.IsNullOrEmpty(inQuery.FeedBackUserKeyInfo), t => t.CreateUser.FullName.Contains(inQuery.FeedBackUserKeyInfo) || t.CreateUser.UserName.Contains(inQuery.FeedBackUserKeyInfo)) .WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription)) .WhereIf(!string.IsNullOrEmpty(inQuery.TrialKeyInfo), t => t.Trial.ExperimentName.Contains(inQuery.TrialKeyInfo) || t.Trial.TrialCode.Contains(inQuery.TrialKeyInfo)) .WhereIf(!string.IsNullOrEmpty(inQuery.SubejctAndVisitKeyInfo), t => t.Subject.Code.Contains(inQuery.SubejctAndVisitKeyInfo) || t.SubjectVisit.VisitName.Contains(inQuery.SubejctAndVisitKeyInfo)) diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 9048c5581..e80888e33 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -1,25 +1,20 @@ -using IRaCIS.Application.Contracts; +using IP2Region.Net.Abstractions; +using IRaCIS.Application.Contracts; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using System.Text.RegularExpressions; -using Microsoft.AspNetCore.Mvc; -using Panda.DynamicWebApi.Attributes; -using Microsoft.AspNetCore.Authorization; -using Microsoft.Extensions.Options; -using Microsoft.Extensions.Caching.Memory; -using Microsoft.Identity.Client; -using static IRaCIS.Core.Domain.Share.StaticData; -using IRaCIS.Core.Application.ViewModel; using Medallion.Threading; -using IRaCIS.Core.Application.Contracts; -using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Helper; -using IP2Region.Net.Abstractions; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Panda.DynamicWebApi.Attributes; +using System.Text.RegularExpressions; using ZiggyCreatures.Caching.Fusion; +using LoginReturnDTO = IRaCIS.Application.Contracts.LoginReturnDTO; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Management")] public class UserService( diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index 189191b3c..be56a315f 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -3,10 +3,8 @@ // 生成时间 2021-11-03 09:38:11 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Application.Contracts; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts { @@ -16,7 +14,7 @@ namespace IRaCIS.Core.Application.Contracts [ApiExplorerSettings(GroupName = "Management")] public class UserTypeRoleService(IRepository _userTypeRepository, IRepository _userRepository) : BaseService, IUserTypeService { - + [HttpPost] public async Task> GetUserTypeRoleList(UserTypeQuery userTypeQuery) { @@ -24,7 +22,7 @@ namespace IRaCIS.Core.Application.Contracts var userTypeRoleQueryable = _userTypeRepository .WhereIf(!string.IsNullOrWhiteSpace(userTypeQuery.SearchFilter), t => t.Description.Contains(userTypeQuery.SearchFilter!) || t.UserTypeName.Contains(userTypeQuery.SearchFilter!) || t.UserTypeShortName.Contains(userTypeQuery.SearchFilter!)) - .WhereIf(userTypeQuery.GroupId!=null,t=>t.UserTypeGroupList.Any(t=>t.DictionaryId== userTypeQuery.GroupId)) + .WhereIf(userTypeQuery.GroupId != null, t => t.UserTypeGroupList.Any(t => t.DictionaryId == userTypeQuery.GroupId)) .OrderBy(t => t.UserTypeEnum).ProjectTo(_mapper.ConfigurationProvider); return await userTypeRoleQueryable.ToListAsync(); @@ -37,11 +35,11 @@ namespace IRaCIS.Core.Application.Contracts var verifyExp1 = new EntityVerifyExp() { - VerifyExp = u => u.UserTypeEnum == addOrEditUserTypeRole.UserTypeEnum , - + VerifyExp = u => u.UserTypeEnum == addOrEditUserTypeRole.UserTypeEnum, + VerifyMsg = "已存在该用户类型的角色。" }; - + var entity = new UserType(); if (addOrEditUserTypeRole.Id == null) @@ -50,7 +48,7 @@ namespace IRaCIS.Core.Application.Contracts //entity.UserTypeEnum = userTypeServiceRepository.Select(t => t.UserTypeEnum).DefaultIfEmpty().Max() + 1; - await _userTypeRepository.InsertFromDTOAsync(addOrEditUserTypeRole,false, verifyExp1); + await _userTypeRepository.InsertFromDTOAsync(addOrEditUserTypeRole, false, verifyExp1); } else @@ -58,7 +56,7 @@ namespace IRaCIS.Core.Application.Contracts if (addOrEditUserTypeRole.MenuIds.Count > 0) { - entity = _userTypeRepository.Where(t => t.Id == addOrEditUserTypeRole.Id, true).Include(t => t.UserTypeMenuList).Include(t=>t.UserTypeGroupList).FirstOrDefault().IfNullThrowException(); + entity = _userTypeRepository.Where(t => t.Id == addOrEditUserTypeRole.Id, true).Include(t => t.UserTypeMenuList).Include(t => t.UserTypeGroupList).FirstOrDefault().IfNullThrowException(); } else @@ -73,7 +71,7 @@ namespace IRaCIS.Core.Application.Contracts var success = await _userTypeRepository.SaveChangesAsync(); - return ResponseOutput.Ok( entity.Id.ToString()); + return ResponseOutput.Ok(entity.Id.ToString()); } @@ -81,7 +79,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpDelete("{userTypeId:guid}")] public async Task DeleteUserTypeRole(Guid userTypeId) { - if ( await _userRepository.AnyAsync(t => t.UserTypeId == userTypeId)) + if (await _userRepository.AnyAsync(t => t.UserTypeId == userTypeId)) { //---该用户类型中已存在用户,不能删除 return ResponseOutput.NotOk(_localizer["UserType_InUse"]); @@ -107,13 +105,13 @@ namespace IRaCIS.Core.Application.Contracts if (userTypeSelectEnum == UserTypeSelectEnum.ExternalUser) { - userTypeEnums = new List() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.CPM, UserTypeEnum.SMM, UserTypeEnum.CMM, UserTypeEnum.EA , UserTypeEnum.MC }; + userTypeEnums = new List() { UserTypeEnum.CPM, UserTypeEnum.SPM, UserTypeEnum.CPM, UserTypeEnum.SMM, UserTypeEnum.CMM, UserTypeEnum.EA, UserTypeEnum.MC }; } if (userTypeSelectEnum == UserTypeSelectEnum.InnerUser) { - userTypeEnums = new List() { UserTypeEnum.ClinicalResearchCoordinator, UserTypeEnum.ProjectManager, UserTypeEnum.CRA, UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA ,UserTypeEnum.MW,UserTypeEnum.MC}; + userTypeEnums = new List() { UserTypeEnum.ClinicalResearchCoordinator, UserTypeEnum.ProjectManager, UserTypeEnum.CRA, UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA, UserTypeEnum.MW, UserTypeEnum.MC }; //if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin) //{ @@ -161,7 +159,7 @@ namespace IRaCIS.Core.Application.Contracts { //排除其他组的用户 var query = _userTypeRepository.Where(x => x.UserTypeEnum != UserTypeEnum.SuperAdmin) - .Where(t => !t.UserTypeGroupList.Any(t=> t.Group.Code=="3")) + .Where(t => !t.UserTypeGroupList.Any(t => t.Group.Code == "3")) .OrderBy(t => t.UserTypeShortName).ProjectTo(_mapper.ConfigurationProvider); return await query.ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index d5f865767..fa8d4b269 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -3,7 +3,6 @@ using AutoMapper.EquivalencyExpression; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; namespace IRaCIS.Core.Application.Service { @@ -131,7 +130,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.ExperimentName, c => c.MapFrom(t => t.Trial.ExperimentName)) .ForMember(d => d.TrialCode, c => c.MapFrom(t => t.Trial.TrialCode)) .ForMember(d => d.SubjectCode, c => c.MapFrom(t => t.Subject.Code)) - .ForMember(d => d.TrialSiteCode, c => c.MapFrom(t => t.VisitTask.IsAnalysisCreate? t.VisitTask.BlindTrialSiteCode: t.TrialSite.TrialSiteCode)) + .ForMember(d => d.TrialSiteCode, c => c.MapFrom(t => t.VisitTask.IsAnalysisCreate ? t.VisitTask.BlindTrialSiteCode : t.TrialSite.TrialSiteCode)) .ForMember(d => d.SubjectVisitName, c => c.MapFrom(t => t.SubjectVisit.VisitName)) .ForMember(d => d.FeedBackUserName, c => c.MapFrom(t => t.CreateUser.UserName)) .ForMember(d => d.FeedBackFullName, c => c.MapFrom(t => t.CreateUser.FullName)) diff --git a/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs b/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs index 6ac863684..99516b634 100644 --- a/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs @@ -4,7 +4,6 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service; namespace IRaCIS.Core.Application.Contracts { @@ -20,7 +19,7 @@ namespace IRaCIS.Core.Application.Contracts IRepository _subjectVisitRepository, QCCommon _qCCommon) : BaseService, IClinicalDataService { - + /// @@ -62,10 +61,10 @@ namespace IRaCIS.Core.Application.Contracts [HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{previousHistoryId:guid}")] - public async Task DeletePreviousHistory(Guid previousHistoryId,Guid subjectVisitId) + public async Task DeletePreviousHistory(Guid previousHistoryId, Guid subjectVisitId) { await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId); - await _previousHistoryRepository.DeleteFromQueryAsync(t => t.Id == previousHistoryId,true); + await _previousHistoryRepository.DeleteFromQueryAsync(t => t.Id == previousHistoryId, true); return ResponseOutput.Ok(); } @@ -93,7 +92,7 @@ namespace IRaCIS.Core.Application.Contracts { await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId); - await _previousOtherRepository.DeleteFromQueryAsync(t => t.Id == previousOtherId,true); + await _previousOtherRepository.DeleteFromQueryAsync(t => t.Id == previousOtherId, true); return ResponseOutput.Ok(); } @@ -119,7 +118,7 @@ namespace IRaCIS.Core.Application.Contracts public async Task DeletePreviousSurgery(Guid previousSurgeryId, Guid subjectVisitId) { await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId); - var success = await _previousSurgeryRepository.DeleteFromQueryAsync(t => t.Id == previousSurgeryId,true); + var success = await _previousSurgeryRepository.DeleteFromQueryAsync(t => t.Id == previousSurgeryId, true); return ResponseOutput.Ok(); } @@ -146,7 +145,7 @@ namespace IRaCIS.Core.Application.Contracts { await _qCCommon.VerifyIsCRCSubmmitAsync(_subjectVisitRepository, _userInfo, subjectVisitId); - await _previousPdfRepository.DeleteFromQueryAsync(t => t.Id == previousPDFId,true); + await _previousPdfRepository.DeleteFromQueryAsync(t => t.Id == previousPDFId, true); return ResponseOutput.Ok(); } diff --git a/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyFileViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyFileViewModel.cs index 3d667f734..8dff5482d 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyFileViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyFileViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2021-12-06 10:56:50 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Application.Service.Inspection.DTO; -using Microsoft.AspNetCore.Http; - namespace IRaCIS.Core.Application.Contracts { /// NoneDicomStudyFileView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyViewModel.cs index e0faf6f05..27061e524 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/NoneDicomStudyViewModel.cs @@ -3,16 +3,14 @@ // 生成时间 2021-12-06 10:56:50 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using System.Collections.Generic; namespace IRaCIS.Core.Application.Contracts { /// NoneDicomStudyView 列表视图模型 - public class NoneDicomStudyView:NoneDicomStudyAddOrEdit + public class NoneDicomStudyView : NoneDicomStudyAddOrEdit { public DateTime UpdateTime { get; set; } public string CodeView { get; set; } - + public int FileCount { get; set; } public List NoneDicomStudyFileList { get; set; } = new List(); @@ -20,7 +18,7 @@ namespace IRaCIS.Core.Application.Contracts } - public class TaskDicomStudyView: NoneDicomStudyView + public class TaskDicomStudyView : NoneDicomStudyView { } @@ -43,14 +41,14 @@ namespace IRaCIS.Core.Application.Contracts public class NoneDicomStudyAddOrEdit { public Guid? Id { get; set; } - + public Guid TrialId { get; set; } public Guid SubjectId { get; set; } public Guid SubjectVisitId { get; set; } public string BodyPart { get; set; } = string.Empty; public string Modality { get; set; } = string.Empty; - public DateTime ImageDate { get; set; } + public DateTime ImageDate { get; set; } public string Description { get; set; } = string.Empty; public int Code { get; set; } @@ -68,7 +66,7 @@ namespace IRaCIS.Core.Application.Contracts public class NoneDicomStudyAddReturnDto { - public Guid Id{ get; set; } + public Guid Id { get; set; } public string StudyCode { get; set; } = string.Empty; } diff --git a/IRaCIS.Core.Application/Service/QC/DTO/PreviousOtherViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/PreviousOtherViewModel.cs index 3c3532748..08082cf93 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/PreviousOtherViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/PreviousOtherViewModel.cs @@ -3,8 +3,6 @@ // 生成时间 2021-11-22 11:27:53 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using System.Collections.Generic; namespace IRaCIS.Core.Application.Contracts { /// PreviousOtherView 列表视图模型 @@ -41,13 +39,13 @@ namespace IRaCIS.Core.Application.Contracts public class PreviousOtherAddOrEdit { public Guid? Id { get; set; } - + public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public bool IsPD { get; set; } public Guid? SubjectVisitId { get; set; } public bool IsSubjectLevel { get; set; } = true; - public string Path { get; set; }=String.Empty; + public string Path { get; set; } = String.Empty; public string FileName { get; set; } = String.Empty; public string TreatmentType { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/QC/DTO/PreviousSurgeryViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/PreviousSurgeryViewModel.cs index 568418849..d007c60a3 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/PreviousSurgeryViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/PreviousSurgeryViewModel.cs @@ -38,7 +38,7 @@ namespace IRaCIS.Core.Application.Contracts public class PreviousSurgeryAddOrEdit { public Guid? Id { get; set; } - + public DateTime? OperationTime { get; set; } public Guid? SubjectVisitId { get; set; } public bool IsSubjectLevel { get; set; } = true; @@ -97,7 +97,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid? SubjectId { get; set; } } - + /// PreviousPDFAddOrEdit 列表查询参数模型 public class PreviousPDFAddOrEdit diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs index d97d57b1d..7622ef5ea 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QARecordViewModel.cs @@ -1,5 +1,4 @@ -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; namespace IRaCIS.Core.Application.Contracts.DTO @@ -169,7 +168,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO } - public class GetConsistencyCheckFileInDto:PageInput + public class GetConsistencyCheckFileInDto : PageInput { public Guid TrialId { get; set; } @@ -241,9 +240,9 @@ namespace IRaCIS.Core.Application.Contracts.DTO } - public class ChallengeAndDialog: QCChallengeWithUser + public class ChallengeAndDialog : QCChallengeWithUser { - + public List DialogList { get; set; } = new List(); } @@ -254,8 +253,8 @@ namespace IRaCIS.Core.Application.Contracts.DTO public class TrialVisitQADTO { public bool ExistsManual { get; set; } - public bool IsHaveStudyClinicalData { get; set; } - public SubjectClinicalDataDto SubjectClinicalData { get; set; } = new SubjectClinicalDataDto(); + public bool IsHaveStudyClinicalData { get; set; } + public SubjectClinicalDataDto SubjectClinicalData { get; set; } = new SubjectClinicalDataDto(); public List NoneDicomStudyList { get; set; } = new List(); @@ -391,7 +390,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO public bool IsCompleteClinicalData { get; set; } - } + } public class QASeriesInfoDto { @@ -475,12 +474,13 @@ namespace IRaCIS.Core.Application.Contracts.DTO public List ParamInfoList { - get { + get + { try { - return JsonConvert.DeserializeObject>(ParamInfo); + return JsonConvert.DeserializeObject>(ParamInfo); } - catch (Exception ) + catch (Exception) { return new List(); diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs index 9bef9dc24..ee21b1442 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCListViewModel.cs @@ -1,15 +1,11 @@ using IRaCIS.Core.API._ServiceExtensions.NewtonsoftJson; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; using MiniExcelLibs.Attributes; using Newtonsoft.Json; -using System.ComponentModel; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Web; -using static MassTransit.ValidationResultExtensions; namespace IRaCIS.Core.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs index aa2d550af..7a435886d 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/QCQuestionConfigureViewModel.cs @@ -4,8 +4,6 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; namespace IRaCIS.Core.Application.Contracts { @@ -22,11 +20,11 @@ namespace IRaCIS.Core.Application.Contracts public Guid Id { get; set; } public string QuestionName { get; set; } = String.Empty; - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public bool IsRequired { get; set; } + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + public bool IsRequired { get; set; } public bool IsEnable { get; set; } public string Type { get; set; } = String.Empty; public string ParentTriggerValue { get; set; } @@ -50,11 +48,11 @@ namespace IRaCIS.Core.Application.Contracts public Guid Id { get; set; } public string QuestionName { get; set; } = String.Empty; - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public bool IsRequired { get; set; } + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + public bool IsRequired { get; set; } public bool IsEnable { get; set; } public string Type { get; set; } = String.Empty; public string ParentTriggerValue { get; set; } @@ -63,7 +61,7 @@ namespace IRaCIS.Core.Application.Contracts public int ShowOrder { get; set; } public string ParentQuestionName { get; set; } = String.Empty; - + public int? ParentShowOrder { get; set; } public Guid CreateUserId { get; set; } @@ -73,18 +71,18 @@ namespace IRaCIS.Core.Application.Contracts } ///QCQuestionQuery 列表查询参数模型 - public class QCQuestionQuery:PageInput + public class QCQuestionQuery : PageInput { /// QuestionName public string QuestionName { get; set; } = String.Empty; - /// - /// 语言类型 - /// - public LanguageType? LanguageType { get; set; } + /// + /// 语言类型 + /// + public LanguageType? LanguageType { get; set; } - /// TypeValue - public string Type { get; set; } = String.Empty; + /// TypeValue + public string Type { get; set; } = String.Empty; public bool? IsEnable { get; set; } @@ -101,11 +99,11 @@ namespace IRaCIS.Core.Application.Contracts public Guid? Id { get; set; } public string QuestionName { get; set; } = String.Empty; - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public bool IsRequired { get; set; } + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + public bool IsRequired { get; set; } public bool IsEnable { get; set; } public string Type { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs b/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs index 1903dcdd3..7773d1107 100644 --- a/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs +++ b/IRaCIS.Core.Application/Service/QC/DTO/TrialQCQuestionConfigureViewModel.cs @@ -15,11 +15,11 @@ namespace IRaCIS.Core.Application.Contracts public Guid TrialId { get; set; } public string QuestionName { get; set; } = string.Empty; - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public bool IsRequired { get; set; } + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + public bool IsRequired { get; set; } public bool IsEnable { get; set; } public string Type { get; set; } = string.Empty; public string TypeValue { get; set; } = string.Empty; @@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.Contracts public Guid? Id { get; set; } - public string[] TypeArray { get; set; }=new string[0]; + public string[] TypeArray { get; set; } = new string[0]; } public class TrialQCQuestionSelect @@ -60,12 +60,12 @@ namespace IRaCIS.Core.Application.Contracts public Guid Id { get; set; } public string QuestionName { get; set; } = string.Empty; - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public Guid? ParentId { get; set; } + public Guid? ParentId { get; set; } public int ShowOrder { get; set; } public string TypeValue { get; set; } @@ -84,13 +84,13 @@ namespace IRaCIS.Core.Application.Contracts /// QuestionName public string QuestionName { get; set; } = string.Empty; - /// - /// 语言类型 - /// - public LanguageType? LanguageType { get; set; } + /// + /// 语言类型 + /// + public LanguageType? LanguageType { get; set; } - /// TypeValue - public string Type { get; set; }=String.Empty; + /// TypeValue + public string Type { get; set; } = String.Empty; public bool? IsEnable { get; set; } @@ -100,7 +100,7 @@ namespace IRaCIS.Core.Application.Contracts } /// TrialQCQuestionAddOrEdit 列表查询参数模型 - public class TrialQCQuestionAddOrEdit:TrialQCQuestionConfigureBatchAdd + public class TrialQCQuestionAddOrEdit : TrialQCQuestionConfigureBatchAdd { public Guid TrialId { get; set; } @@ -115,15 +115,15 @@ namespace IRaCIS.Core.Application.Contracts } public class TrialQCQuestionConfigureBatchAdd { - + public Guid? Id { get; set; } public string QuestionName { get; set; } = string.Empty; - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public bool IsRequired { get; set; } + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + public bool IsRequired { get; set; } public bool IsEnable { get; set; } public string Type { get; set; } = string.Empty; public Guid? ParentId { get; set; } diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IClinicalDataService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IClinicalDataService.cs index 808940ca5..2e266c3b3 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/IClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/IClinicalDataService.cs @@ -3,11 +3,6 @@ // 生成时间 2021-11-22 11:29:44 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - namespace IRaCIS.Core.Application.Contracts { public interface IClinicalDataService diff --git a/IRaCIS.Core.Application/Service/QC/Interface/INoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/QC/Interface/INoneDicomStudyService.cs index d4fa2d6b9..f06b6c5df 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/INoneDicomStudyService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/INoneDicomStudyService.cs @@ -3,11 +3,6 @@ // 生成时间 2021-12-06 10:54:55 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Infra.EFCore; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - namespace IRaCIS.Core.Application.Contracts { public interface INoneDicomStudyService @@ -21,6 +16,6 @@ namespace IRaCIS.Core.Application.Contracts //Task UploadNoneDicomFile(IFormCollection formCollection, Guid subjectVisitId, Guid noneDicomStudyId); - + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs index 8c792494e..df26d3ea1 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/IQCListService.cs @@ -20,10 +20,10 @@ namespace IRaCIS.Core.Application.Image.QA Task> GetHistoryChallengeList(Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType); Task> GetQCChallengeCreatorList(Guid trialId); Task> GetQCChallengeDialogList(Guid qaChallengeId); - + Task> GetQCParticipantList(Guid trialId); Task> GetQCQuestionAnswerList(Guid subjectVisitId, Guid trialId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType); - + Task> GetSubjectVisitSelectList(Guid subjectId); Task<(List, object)> GetSubjectVisitUploadedStudyList(Guid subjectVisitId); Task GetUploadInitInfo(Guid subjectVisitId); diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs index f76c8cedb..4b9093508 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/IQCOperationService.cs @@ -2,14 +2,12 @@ using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Image.QA { public interface IQCOperationService - { + { Task CheckBack(Guid subjectVisitId); Task SetNeedReupload(Guid trialId, Guid qcChallengeId); Task QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState); @@ -38,7 +36,7 @@ namespace IRaCIS.Core.Application.Image.QA //Task UploadVisitCheckExcel(IFormFile file, Guid trialId); Task VerifyCanQCPassedOrFailed(Guid subjectVisitId); - + //Task ForwardSVDicomImage(Guid[] subjectVisitIdList); } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/QC/Interface/IQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/Interface/IQCQuestionService.cs index 382f27933..91df0b54c 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/IQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/IQCQuestionService.cs @@ -3,8 +3,6 @@ // 生成时间 2021-11-11 11:04:54 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Infrastructure.Extention; - namespace IRaCIS.Core.Application.Contracts { public interface IQCQuestionService @@ -13,6 +11,6 @@ namespace IRaCIS.Core.Application.Contracts Task DeleteQCQuestionConfigure(Guid qCQuestionConfigureId); Task> GetQCQuestionConfigureList(QCQuestionQuery queryQCQuestionConfigure); - + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs b/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs index 47e64f614..697d1c8da 100644 --- a/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs +++ b/IRaCIS.Core.Application/Service/QC/Interface/ITrialQCQuestionConfigureService.cs @@ -3,8 +3,6 @@ // 生成时间 2021-11-11 11:04:54 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Infrastructure.Extention; - namespace IRaCIS.Core.Application.Contracts { public interface ITrialQCQuestionConfigureService diff --git a/IRaCIS.Core.Application/Service/QC/QCCommon.cs b/IRaCIS.Core.Application/Service/QC/QCCommon.cs index 554cc9362..b8878e421 100644 --- a/IRaCIS.Core.Application/Service/QC/QCCommon.cs +++ b/IRaCIS.Core.Application/Service/QC/QCCommon.cs @@ -1,11 +1,9 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using Microsoft.Extensions.Localization; -using System.Linq.Expressions; namespace IRaCIS.Core.Application.Service { - public class QCCommon: BaseService + public class QCCommon : BaseService { @@ -18,7 +16,7 @@ namespace IRaCIS.Core.Application.Service /// /// /// - public async Task VerifyIsCRCSubmmitAsync(IRepository _subjectVisitRepository, IUserInfo _userInfo, Guid? subjectVisitId = null) + public async Task VerifyIsCRCSubmmitAsync(IRepository _subjectVisitRepository, IUserInfo _userInfo, Guid? subjectVisitId = null) { if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator) { @@ -28,7 +26,7 @@ namespace IRaCIS.Core.Application.Service if (await _subjectVisitRepository.AnyAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && (!t.QCChallengeList.Any(u => u.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload)))) { - //---CRC 已提交影像,不能进行操作。 + //---CRC 已提交影像,不能进行操作。 throw new BusinessValidationFailedException(_localizer["QCCommon_CannotOperate"]); } } @@ -45,7 +43,7 @@ namespace IRaCIS.Core.Application.Service } - public async Task VerifyIsCanQCAsync(IRepository _subjectVisitRepository, IUserInfo _userInfo, SubjectVisit? subjectVisit = null, Guid? subjectVisitId = null) + public async Task VerifyIsCanQCAsync(IRepository _subjectVisitRepository, IUserInfo _userInfo, SubjectVisit? subjectVisit = null, Guid? subjectVisitId = null) { if (subjectVisitId != null) { @@ -60,7 +58,7 @@ namespace IRaCIS.Core.Application.Service - public async Task VerifyStudyImageDataAsync(IRepository _subjectVisitRepository, Guid subjectId, Guid subjectVisitId, DateTime imageDate) + public async Task VerifyStudyImageDataAsync(IRepository _subjectVisitRepository, Guid subjectId, Guid subjectVisitId, DateTime imageDate) { var visitList = await _subjectVisitRepository.Where(t => t.SubjectId == subjectId).Select(t => new { t.VisitNum, t.EarliestScanDate, t.LatestScanDate, t.Id }).ToListAsync(); diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index fd8b3456c..316c62f2e 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -1,15 +1,10 @@ using IRaCIS.Core.Application.Contracts; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Application.Contracts.DTO; -using IRaCIS.Core.Application.Service; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using MassTransit.Initializers; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Image.QA { @@ -29,7 +24,7 @@ namespace IRaCIS.Core.Application.Image.QA IRepository _qcChallengeRepository, IReadingImageTaskService _IReadingImageTaskService) : BaseService, IQCListService { - + @@ -42,7 +37,7 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task>> GetCRCVisitList(CRCVisitSearchDTO inQuery) + public async Task>> GetCRCVisitList(CRCVisitSearchDTO inQuery) { var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); @@ -65,10 +60,10 @@ namespace IRaCIS.Core.Application.Image.QA var defalutSortArray = new string[] { nameof(QCCRCVisitViewModel.IsUrgent) + " desc", nameof(QCCRCVisitViewModel.SubjectCode), nameof(QCCRCVisitViewModel.VisitNum) }; var pageList = await query.ToPagedListAsync(inQuery, defalutSortArray); - var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject ) && x.UploadRole == UploadRole.CRC); + var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + config.IsHaveSubjectClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.Subject) && x.UploadRole == UploadRole.CRC); config.IsHaveVisitClinicalData = await _clinicalDataTrialSet.AnyAsync(x => x.TrialId == inQuery.TrialId && x.IsConfirm && (x.ClinicalDataLevel == ClinicalLevel.SubjectVisit) && x.UploadRole == UploadRole.CRC); - return ResponseOutput.Ok (pageList, config); + return ResponseOutput.Ok(pageList, config); } @@ -81,7 +76,7 @@ namespace IRaCIS.Core.Application.Image.QA [HttpPost] public async Task GetNextCRCChallenge(GetNextCRCChallengeInDto inDto) { - var list =await GetCRCChallengeList(new ChallengeQuery() + var list = await GetCRCChallengeList(new ChallengeQuery() { TrialId = inDto.TrialId, PageIndex = 1, @@ -91,41 +86,41 @@ namespace IRaCIS.Core.Application.Image.QA var pageList = list.Data.CurrentPageData.ToList(); - var data = pageList.Where(x=>x.Id==inDto.QCChallengeId||x.IsClosed==false).ToList(); + var data = pageList.Where(x => x.Id == inDto.QCChallengeId || x.IsClosed == false).ToList(); - if (data.Count > 0) - { + if (data.Count > 0) + { - var index = data.ToList().FindIndex(x => x.Id == inDto.QCChallengeId); + var index = data.ToList().FindIndex(x => x.Id == inDto.QCChallengeId); - var result = new QCCRCChallengeViewModel() { }; + var result = new QCCRCChallengeViewModel() { }; - if (index + 1 == data.Count()) // 最后一个 - { - throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]); - } - else if (index == -1 || data.Count == 1) // 第一个或者只有一个 - { - if (data[0].Id == inDto.QCChallengeId) - { - throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]); - } - result = data[0]; - } - else - { - result = data.Skip(index + 1).Take(1).First(); + if (index + 1 == data.Count()) // 最后一个 + { + throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]); + } + else if (index == -1 || data.Count == 1) // 第一个或者只有一个 + { + if (data[0].Id == inDto.QCChallengeId) + { + throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]); + } + result = data[0]; + } + else + { + result = data.Skip(index + 1).Take(1).First(); - } - return result; + } + return result; - } - else - { - throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]); - } + } + else + { + throw new BusinessValidationFailedException(_localizer["QCList_CRCFinishChallenge"]); + } - } + } @@ -157,10 +152,10 @@ namespace IRaCIS.Core.Application.Image.QA .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) .ProjectTo(_mapper.ConfigurationProvider); - var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent)+ " desc", nameof(QCCRCChallengeViewModel.CreateTime)}); + var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) }); - var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok (pageList, config); + var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + return ResponseOutput.Ok(pageList, config); } @@ -197,7 +192,7 @@ namespace IRaCIS.Core.Application.Image.QA var pageList = await query.ToPagedListAsync(inQuery, new string[] { nameof(QCCRCChallengeViewModel.IsUrgent) + " desc", nameof(QCCRCChallengeViewModel.CreateTime) }); - var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); return (pageList, config); } @@ -208,19 +203,19 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpPost] - public async Task GetNextQCInfo(GetNextQCInfoInDto inDto) - { - var result = await GetQCVisitList(new QCVisitSearchDTO() - { - TrialId = inDto.TrialId, - CurrentActionUserId = _userInfo.Id, - VisitId = inDto.VisitId, - PageIndex = 1, - PageSize = 1, - }); + public async Task GetNextQCInfo(GetNextQCInfoInDto inDto) + { + var result = await GetQCVisitList(new QCVisitSearchDTO() + { + TrialId = inDto.TrialId, + CurrentActionUserId = _userInfo.Id, + VisitId = inDto.VisitId, + PageIndex = 1, + PageSize = 1, + }); - return result.Data.CurrentPageData.Count > 0 ? result.Data.CurrentPageData[0] : null; - } + return result.Data.CurrentPageData.Count > 0 ? result.Data.CurrentPageData[0] : null; + } /// /// QC 访视列表 @@ -233,8 +228,8 @@ namespace IRaCIS.Core.Application.Image.QA var svExpression = QCCommon.GetSubjectVisitFilter(inQuery.VisitPlanArray); var query = _subjectVisitRepository.Where(x => x.TrialId == inQuery.TrialId) - .WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId) - .WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId) + .WhereIf(inQuery.VisitId != null, t => t.Id == inQuery.VisitId) + .WhereIf(inQuery.CurrentActionUserId != null, t => t.CurrentActionUserId == inQuery.CurrentActionUserId) .WhereIf(inQuery.ChallengeState != null, t => t.ChallengeState == inQuery.ChallengeState) .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) .WhereIf(inQuery.SubjectId != null, t => t.Subject.Id == inQuery.SubjectId) @@ -250,8 +245,8 @@ namespace IRaCIS.Core.Application.Image.QA || t.QCChallengeDialogList.Any(t => t.CreateUserId == inQuery.HandleUserId)) .WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent) .Where(t => t.SubmitState != SubmitStateEnum.None) - .WhereIf(inQuery.BeginAuditTime != null, t => t.Trial.QCProcessEnum==TrialQCProcess.SingleAudit? t.PreliminaryAuditTime>= inQuery.BeginAuditTime: - (t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit?t.ReviewAuditTime>= inQuery.BeginAuditTime:true)) + .WhereIf(inQuery.BeginAuditTime != null, t => t.Trial.QCProcessEnum == TrialQCProcess.SingleAudit ? t.PreliminaryAuditTime >= inQuery.BeginAuditTime : + (t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit ? t.ReviewAuditTime >= inQuery.BeginAuditTime : true)) .WhereIf(inQuery.EndAuditTime != null, t => t.Trial.QCProcessEnum == TrialQCProcess.SingleAudit ? t.PreliminaryAuditTime <= inQuery.EndAuditTime : (t.Trial.QCProcessEnum == TrialQCProcess.DoubleAudit ? t.ReviewAuditTime <= inQuery.EndAuditTime : true)) @@ -267,9 +262,9 @@ namespace IRaCIS.Core.Application.Image.QA - var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); - return ResponseOutput.Ok (pageList, config); + return ResponseOutput.Ok(pageList, config); } @@ -299,7 +294,7 @@ namespace IRaCIS.Core.Application.Image.QA .ProjectTo(_mapper.ConfigurationProvider); var pageList = await query.ToPagedListAsync(inQuery); - var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + var config = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); return (pageList, config); } @@ -371,11 +366,11 @@ namespace IRaCIS.Core.Application.Image.QA return new TrialVisitQADTO { - QCQuestionAnswerList = qacheckList, + QCQuestionAnswerList = qacheckList, - IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study), - StudyList = temp.StudyList, - ExistsManual= (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0, + IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study), + StudyList = temp.StudyList, + ExistsManual = (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0, SeriesList = temp.SeriesList, RelationInfo = await GetVisitQCSubjectInfo(subjectVisitId), NoneDicomStudyList = await _noneDicomStudyRepository.Where(t => t.SubjectVisitId == subjectVisitId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(), @@ -521,20 +516,20 @@ namespace IRaCIS.Core.Application.Image.QA /// /// [HttpGet("{subjectVisitId:guid}")] - public async Task<(List,object)> GetSubjectVisitUploadedStudyList(Guid subjectVisitId) + public async Task<(List, object)> GetSubjectVisitUploadedStudyList(Guid subjectVisitId) { var visit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).FirstNotNullAsync(); - var list= await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).OrderBy(t=>t.StudyCode).ToListAsync(); + var list = await _dicomStudyRepository.Where(s => s.SubjectVisitId == subjectVisitId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).OrderBy(t => t.StudyCode).ToListAsync(); - var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t=>t.Trial).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + var config = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.Trial).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); config.IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == visit.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study); - config.IsPacsConnectConfiged= await _subjectVisitRepository.Where(t=>t.Id==subjectVisitId).AnyAsync(t=>t.Trial.IsPACSConnect && t.Subject.TrialSite.TrialSiteDicomAEList.Any()); + config.IsPacsConnectConfiged = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.Trial.IsPACSConnect && t.Subject.TrialSite.TrialSiteDicomAEList.Any()); - return (list, config); + return (list, config); } @@ -640,9 +635,9 @@ namespace IRaCIS.Core.Application.Image.QA //var maxNum = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TaskState == TaskState.Effect && t.SignTime != null && t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.InOrder).MaxAsync(x => (decimal?)x.VisitTaskNum)??0; - var maxNum=await _subjectVisitRepository.Where(t=>t.SubjectId == subjectId && t.SubmitState==SubmitStateEnum.Submitted).MaxAsync(x => (decimal?)x.VisitNum) ?? 0; + var maxNum = await _subjectVisitRepository.Where(t => t.SubjectId == subjectId && t.SubmitState == SubmitStateEnum.Submitted).MaxAsync(x => (decimal?)x.VisitNum) ?? 0; - return await _subjectVisitRepository.Where(t => t.SubjectId == subjectId&&t.VisitNum>= maxNum).OrderBy(T => T.VisitNum).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + return await _subjectVisitRepository.Where(t => t.SubjectId == subjectId && t.VisitNum >= maxNum).OrderBy(T => T.VisitNum).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); } diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index 4b92a49df..bdcad72fe 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -1,21 +1,15 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using System.Data; -using Microsoft.AspNetCore.Authorization; -using Newtonsoft.Json; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Service.Inspection.DTO; -using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Service; +using IRaCIS.Core.Application.Service.Inspection.DTO; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; using Medallion.Threading; -using DocumentFormat.OpenXml.Office2010.Excel; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; +using System.Data; namespace IRaCIS.Core.Application.Image.QA { @@ -43,7 +37,7 @@ namespace IRaCIS.Core.Application.Image.QA IDistributedLockProvider _distributedLockProvider, IReadingClinicalDataService _readingClinicalDataService) : BaseService, IQCOperationService { - + #region QC质疑 以及回复 关闭 @@ -680,7 +674,7 @@ namespace IRaCIS.Core.Application.Image.QA } else { - if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && !t.QCChallengeList.Any(c=>c.ReuploadEnum==QCChanllengeReuploadEnum.QCAgreeUpload)) ) + if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && !t.QCChallengeList.Any(c => c.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload))) { //---提交之后,不允许修改! throw new BusinessValidationFailedException(_localizer["QCOperation_NoModifyAfterSubmit"]); @@ -776,9 +770,9 @@ namespace IRaCIS.Core.Application.Image.QA var succeess2 = await _dicomInstanceRepository.BatchDeleteNoTrackingAsync(t => t.StudyId == id); var success3 = await _dicomSeriesrepository.BatchDeleteNoTrackingAsync(t => t.StudyId == id); - await _scpStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == id,u=>new SCPStudy() { SubjectVisitId=null}); + await _scpStudyRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new SCPStudy() { SubjectVisitId = null }); + - //var success3 = await _dicomSeriesrepository.DeleteFromQueryAsync(t => t.StudyId == id, true); //var success4 = await _repository.BatchDeleteAsync(t => t.StudyId == id); @@ -802,19 +796,19 @@ namespace IRaCIS.Core.Application.Image.QA } - var subjectId=waitDeleteStudyList.Select(t=>t.SubjectId).FirstOrDefault(); + var subjectId = waitDeleteStudyList.Select(t => t.SubjectId).FirstOrDefault(); var patientList = _scpPatientRepository.Where(t => t.SubjectId == subjectId).Select(t => t.Id).ToList(); foreach (var patientId in patientList) { - if (_scpPatientRepository.Where(t=>t.Id== patientId).Any(t => t.SCPStudyList.Count() == t.SCPStudyList.Where(t => t.SubjectVisitId == null).Count())) + if (_scpPatientRepository.Where(t => t.Id == patientId).Any(t => t.SCPStudyList.Count() == t.SCPStudyList.Where(t => t.SubjectVisitId == null).Count())) { await _scpPatientRepository.BatchUpdateNoTrackingAsync(t => t.Id == patientId, u => new SCPPatient() { SubjectId = null }); } } - + await _subjectVisitRepository.SaveChangesAsync(); @@ -1308,7 +1302,7 @@ namespace IRaCIS.Core.Application.Image.QA return ResponseOutput.NotOk(_localizer["QCOperation_MissingBaselineDate"]); } - if (_subjectVisitRepository.Where(t => t.Id == dbSubjectVisit.Id).Any(t => (t.StudyList.Count(t => t.ModalityForEdit == "") > 0 ||t.NoneDicomStudyList.Count(t => t.Modality == "")>0) && t.Trial.TrialReadingCriterionList.Count(t => t.IsImageFilter == true) > 0)) + if (_subjectVisitRepository.Where(t => t.Id == dbSubjectVisit.Id).Any(t => (t.StudyList.Count(t => t.ModalityForEdit == "") > 0 || t.NoneDicomStudyList.Count(t => t.Modality == "") > 0) && t.Trial.TrialReadingCriterionList.Count(t => t.IsImageFilter == true) > 0)) { //有标准配置了影像筛选,该受试者有检查未设置检查类型,不允许提交 return ResponseOutput.NotOk(_localizer["QCOperation_MissingModality"]); @@ -1790,7 +1784,7 @@ namespace IRaCIS.Core.Application.Image.QA { //获取项目配置 - var trialConfig = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification }) + var trialConfig = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.QCProcessEnum, t.IsImageConsistencyVerification }) .FirstOrDefaultAsync().IfNullThrowException(); if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) @@ -2061,12 +2055,12 @@ namespace IRaCIS.Core.Application.Image.QA return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]); } - // if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId) - //.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack)) - // { - // //---该访视为回退访视,不允许修改PD确认状态 - // return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]); - // } + // if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId) + //.AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack)) + // { + // //---该访视为回退访视,不允许修改PD确认状态 + // return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]); + // } dbSubjectVisit.IsEnrollmentConfirm = command.IsEnrollmentConfirm.Value; } diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index 12422d862..4ead671f3 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -4,10 +4,7 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts @@ -20,7 +17,7 @@ namespace IRaCIS.Core.Application.Contracts IRepository _qcQuestionRepository, IRepository _trialQCQuestionRepository) : BaseService, IQCQuestionService { - + /// @@ -37,12 +34,13 @@ namespace IRaCIS.Core.Application.Contracts var initList = await _qcQuestionRepository .WhereIf(trialQCQuestionFilterSelect.TypeArray.Count() > 0, t => trialQCQuestionFilterSelect.TypeArray.Contains(t.Type)) .WhereIf(trialQCQuestionFilterSelect.Id != null, t => t.Id != trialQCQuestionFilterSelect.Id && t.ParentId != trialQCQuestionFilterSelect.Id) - .OrderBy(t => t.ShowOrder).Select(x => new TrialQCQuestionSelect() { + .OrderBy(t => t.ShowOrder).Select(x => new TrialQCQuestionSelect() + { ShowOrder = x.ShowOrder, Id = x.Id, ParentId = x.ParentId, QuestionName = x.QuestionName, - LanguageType=x.LanguageType, + LanguageType = x.LanguageType, TypeValue = x.TypeValue, }).ToListAsync(); @@ -88,13 +86,13 @@ namespace IRaCIS.Core.Application.Contracts { var QCQuestionQueryable = _qcQuestionRepository - .WhereIf(queryQCQuestionConfigure.IsEnable != null,x=>x.IsEnable== queryQCQuestionConfigure.IsEnable) + .WhereIf(queryQCQuestionConfigure.IsEnable != null, x => x.IsEnable == queryQCQuestionConfigure.IsEnable) .WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.QuestionName), t => t.QuestionName.Contains(queryQCQuestionConfigure.QuestionName)) .WhereIf(!string.IsNullOrWhiteSpace(queryQCQuestionConfigure.Type), t => t.Type.Contains(queryQCQuestionConfigure.Type)) - .WhereIf(queryQCQuestionConfigure.LanguageType!=null, t =>t.LanguageType== queryQCQuestionConfigure.LanguageType) - .WhereIf(queryQCQuestionConfigure.IsDefeaultViewParent==true,t=>t.ParentId==null) - .OrderByDescending(x=>x.LanguageType) - .ThenBy(t=>t.ShowOrder) + .WhereIf(queryQCQuestionConfigure.LanguageType != null, t => t.LanguageType == queryQCQuestionConfigure.LanguageType) + .WhereIf(queryQCQuestionConfigure.IsDefeaultViewParent == true, t => t.ParentId == null) + .OrderByDescending(x => x.LanguageType) + .ThenBy(t => t.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider); var defalutSortArray = new string[] { nameof(QCQuestionConfigureView.LanguageType) + " desc", nameof(QCQuestionConfigureView.ShowOrder) }; @@ -125,7 +123,7 @@ namespace IRaCIS.Core.Application.Contracts //---当前任务存在子问题,删除失败 throw new BusinessValidationFailedException(_localizer["QCQuestion_HasChildQuestion"]); } - await _qcQuestionRepository.DeleteFromQueryAsync(t => t.Id == qCQuestionConfigureId,true); + await _qcQuestionRepository.DeleteFromQueryAsync(t => t.Id == qCQuestionConfigureId, true); return ResponseOutput.Ok(); } @@ -143,27 +141,28 @@ namespace IRaCIS.Core.Application.Contracts public async Task> GetQuestionView(QCQuestionViewInDto inDto) { var question = new List(); - if (inDto.TrialId!= null) + if (inDto.TrialId != null) { - question = await _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId&&x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo - (_mapper.ConfigurationProvider, new - { - isEn_Us = _userInfo.IsEn_Us + question = await _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo + (_mapper.ConfigurationProvider, new + { + isEn_Us = _userInfo.IsEn_Us - }).ToListAsync(); + }).ToListAsync(); } else { - question=await _qcQuestionRepository.Where(x=>x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo(_mapper.ConfigurationProvider, new - { - isEn_Us = _userInfo.IsEn_Us + question = await _qcQuestionRepository.Where(x => x.IsEnable).OrderBy(x => x.ShowOrder).ProjectTo(_mapper.ConfigurationProvider, new + { + isEn_Us = _userInfo.IsEn_Us - }).ToListAsync(); + }).ToListAsync(); } var result = question.Where(x => x.ParentId == null).ToList(); - result.ForEach(x => { + result.ForEach(x => + { GetQuestionChild(x, question); }); @@ -178,13 +177,13 @@ namespace IRaCIS.Core.Application.Contracts if (parent.Childrens.Count != 0) { - parent.Childrens.ForEach(x => + parent.Childrens.ForEach(x => { GetQuestionChild(x, dataList); }); } - + } diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index cdcccabef..3d9658067 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -4,13 +4,9 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infrastructure; using MassTransit; -using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts @@ -26,7 +22,7 @@ namespace IRaCIS.Core.Application.Contracts IRepository _trialQCQuestionAnswerRepository, IRepository _qCQuestionRepository) : BaseService, ITrialQCQuestionConfigureService { - + /// /// 清空Qc问题 @@ -51,17 +47,17 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(!string.IsNullOrWhiteSpace(queryTrialQCQuestionConfigure.Type), t => t.Type.Contains(queryTrialQCQuestionConfigure.Type)) .WhereIf(queryTrialQCQuestionConfigure.IsEnable != null, t => t.IsEnable == queryTrialQCQuestionConfigure.IsEnable) .WhereIf(queryTrialQCQuestionConfigure.IsRequired != null, t => t.IsRequired == queryTrialQCQuestionConfigure.IsRequired) - .WhereIf(queryTrialQCQuestionConfigure.LanguageType != null, t => t.LanguageType == queryTrialQCQuestionConfigure.LanguageType) + .WhereIf(queryTrialQCQuestionConfigure.LanguageType != null, t => t.LanguageType == queryTrialQCQuestionConfigure.LanguageType) - .ProjectTo(_mapper.ConfigurationProvider); + .ProjectTo(_mapper.ConfigurationProvider); - var list = await trialQCQuestionQueryable.OrderByDescending(x=>x.LanguageType).ThenBy(t => t.ShowOrder).ToListAsync(); + var list = await trialQCQuestionQueryable.OrderByDescending(x => x.LanguageType).ThenBy(t => t.ShowOrder).ToListAsync(); var isHaveQCQuestion = _trialQCQuestionRepository.Where(t => t.TrialId == queryTrialQCQuestionConfigure.TrialId).Any(); - var signInfo = await _trialRepository.Where(t => t.Id == queryTrialQCQuestionConfigure.TrialId) + var signInfo = await _trialRepository.Where(t => t.Id == queryTrialQCQuestionConfigure.TrialId) .Select(trial => new { trial.QCProcessEnum, @@ -91,10 +87,10 @@ namespace IRaCIS.Core.Application.Contracts .WhereIf(trialQCQuestionFilterSelect.TypeArray.Count() > 0, t => trialQCQuestionFilterSelect.TypeArray.Contains(t.Type)) .WhereIf(trialQCQuestionFilterSelect.Id != null, t => t.Id != trialQCQuestionFilterSelect.Id && t.ParentId != trialQCQuestionFilterSelect.Id) .OrderBy(t => t.ShowOrder).ProjectTo(_mapper.ConfigurationProvider, new - { - isEn_Us = _userInfo.IsEn_Us + { + isEn_Us = _userInfo.IsEn_Us - }).ToListAsync(); + }).ToListAsync(); //父亲的序号肯定要比自己小 if (trialQCQuestionFilterSelect.Id != null) @@ -301,7 +297,7 @@ namespace IRaCIS.Core.Application.Contracts if (addOrEditTrialQCQuestionConfigure.ParentId != null) { var parentShowOrder = await _trialQcQuestionRepository.Where(x => x.Id == addOrEditTrialQCQuestionConfigure.ParentId).Select(x => x.ShowOrder).FirstOrDefaultAsync(); - if(parentShowOrder> addOrEditTrialQCQuestionConfigure.ShowOrder) + if (parentShowOrder > addOrEditTrialQCQuestionConfigure.ShowOrder) { //---父问题的显示序号要比子问题的显示序号小,请确认。 throw new BusinessValidationFailedException(_localizer["TrialConfig_InvalidParentQuestionId"]); diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index e6b935fe5..9d6773f50 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -5,7 +5,6 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.MassTransit.Command; using IRaCIS.Core.Domain.Share; -using static IRaCIS.Core.Application.Contracts.SubjectProgressDto; namespace IRaCIS.Core.Application.Service { @@ -487,13 +486,13 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName)) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path )); + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap() .ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName)) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path )); + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap() .ForMember(d => d.CreateUser, u => u.MapFrom(s => s.CreateUser.FullName)) - .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path )); + .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); @@ -597,13 +596,13 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path)); CreateMap() - .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.NoneDicomFileList)) + .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? s.NoneDicomFileList.Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.NoneDicomFileList)) .ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode)); Guid? visiTaskId = null; CreateMap() - .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? - s.TaskNoneDicomFileList.Where(t=> visiTaskId != null?t.VisitTaskId==visiTaskId:true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) + .ForMember(d => d.NoneDicomStudyFileList, u => u.MapFrom(s => isFilterZip ? + s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true).Where(t => !t.FileType.Contains(StaticData.FileType.Zip)) : s.TaskNoneDicomFileList.Where(t => visiTaskId != null ? t.VisitTaskId == visiTaskId : true))) .ForMember(d => d.CodeView, u => u.MapFrom(s => s.StudyCode)); diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs index 72f656cc0..a5cd9ad35 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2023-03-17 11:59:00 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitFilterViewModel.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitFilterViewModel.cs index 0348c7607..832c0b49f 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitFilterViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitFilterViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2023-03-17 11:58:25 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel @@ -29,8 +26,8 @@ namespace IRaCIS.Core.Application.ViewModel public Guid TrialReadingCriterionId { get; set; } public Guid SubjectVisitId { get; set; } - public ImageFilterState? ImageFilterState { get; set; } - public ImageDeterminationResultState? ImageDeterminationResultState { get; set; } + public ImageFilterState? ImageFilterState { get; set; } + public ImageDeterminationResultState? ImageDeterminationResultState { get; set; } public bool? IsGeneratedTask { get; set; } @@ -42,7 +39,7 @@ namespace IRaCIS.Core.Application.ViewModel } ///SubjectCriteriaEvaluationVisitFilterQuery 列表查询参数模型 - public class SubjectCriteriaEvaluationVisitFilterQuery + public class SubjectCriteriaEvaluationVisitFilterQuery { [NotDefault] public Guid TrialReadingCriterionId { get; set; } @@ -81,7 +78,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid SubjectId { get; set; } - public List SubjectVisitIdList { get; set; }=new List(); + public List SubjectVisitIdList { get; set; } = new List(); } @@ -145,9 +142,9 @@ namespace IRaCIS.Core.Application.ViewModel public class SelctStudySeriesView { - public List StudyList { get; set; }=new List(); + public List StudyList { get; set; } = new List(); - public List SeriesList { get; set; }=new List(); + public List SeriesList { get; set; } = new List(); } public class SelectStudyView diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitStudyFilterViewModel.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitStudyFilterViewModel.cs index 4e62c342c..26fc831df 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitStudyFilterViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/DTO/SubjectCriteriaEvaluationVisitStudyFilterViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2023-03-17 11:58:25 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel { /// SubjectCriteriaEvaluationVisitStudyFilterView 列表视图模型 diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/Interface/ISubjectCriteriaEvaluationService.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/Interface/ISubjectCriteriaEvaluationService.cs index 821834fd6..ed4a29184 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/Interface/ISubjectCriteriaEvaluationService.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/Interface/ISubjectCriteriaEvaluationService.cs @@ -4,13 +4,12 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ISubjectCriteriaEvaluationService - /// - public interface ISubjectCriteriaEvaluationService +{ + /// + /// ISubjectCriteriaEvaluationService + /// + public interface ISubjectCriteriaEvaluationService { @@ -22,4 +21,4 @@ namespace IRaCIS.Core.Application.Interfaces Task AutoSubjectCriteriaEvaluationVisitFilter(Guid subjectId, Guid subjectVisitId, Guid trialReadingCriterionId); } -} +} diff --git a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs index 95e843f46..33b20eb0e 100644 --- a/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs +++ b/IRaCIS.Core.Application/Service/Reading/AdditionalEvaluate/SubjectCriteriaEvaluationService.cs @@ -4,22 +4,13 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Application.Contracts.DTO; -using System.Linq; -using System.Linq.Dynamic.Core; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Contracts; -using DocumentFormat.OpenXml.Spreadsheet; -using Panda.DynamicWebApi.Attributes; using IRaCIS.Core.Domain.Share.Reading; -using System.Runtime.InteropServices; -using DocumentFormat.OpenXml.Bibliography; -using System.Linq.Expressions; -using MathNet.Numerics.Statistics.Mcmc; +using Microsoft.AspNetCore.Mvc; +using Panda.DynamicWebApi.Attributes; +using System.Linq.Dynamic.Core; namespace IRaCIS.Core.Application.Service { @@ -43,7 +34,7 @@ namespace IRaCIS.Core.Application.Service IRepository _visitTaskReReadingRepository) : BaseService, ISubjectCriteriaEvaluationService { - + /// @@ -52,7 +43,7 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task> > GetSubjectCriteriaEvaluationList(SubjectCriteriaEvaluationQuery inQuery) + public async Task>> GetSubjectCriteriaEvaluationList(SubjectCriteriaEvaluationQuery inQuery) { var trialReadingCritionList = _trialReadingCriterionRepository.Where(t => t.TrialId == inQuery.TrialId).ToList(); @@ -84,7 +75,7 @@ namespace IRaCIS.Core.Application.Service var questionIdList = addtionalQustionInfoList.Select(t => t.QuestionId).ToList(); - var subjectCriteriaEvaluationQueryable = from subject in _subjectRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsDeleted==false) + var subjectCriteriaEvaluationQueryable = from subject in _subjectRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsDeleted == false) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.SubjectCode), t => t.Code.Contains(inQuery.SubjectCode)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode)) .WhereIf(inQuery.SubjectStatus != null, t => t.Status == inQuery.SubjectStatus) @@ -105,8 +96,8 @@ namespace IRaCIS.Core.Application.Service Id = subjectCriteriaEvaluation.Id, TrialReadingCriterionId = inQuery.TrialReadingCriterionId, - IsImageFiltering = subject.SubjectCriteriaEvaluationVisitFilterList.Any(t => t.TrialReadingCriterionId== inQuery.TrialReadingCriterionId - && t.ImageFilterState == ImageFilterState.None), + IsImageFiltering = subject.SubjectCriteriaEvaluationVisitFilterList.Any(t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId + && t.ImageFilterState == ImageFilterState.None), IsJoinEvaluation = subjectCriteriaEvaluation.IsJoinEvaluation, @@ -128,7 +119,7 @@ namespace IRaCIS.Core.Application.Service var pageList = await subjectCriteriaEvaluationQueryable .WhereIf(inQuery.IsImageFiltering != null, t => t.IsImageFiltering == inQuery.IsImageFiltering) .WhereIf(inQuery.IsJoinEvaluation != null, t => t.IsJoinEvaluation == inQuery.IsJoinEvaluation) - .ToPagedListAsync(inQuery,nameof(SubjectCriteriaEvaluationView.SubjectCode)); + .ToPagedListAsync(inQuery, nameof(SubjectCriteriaEvaluationView.SubjectCode)); foreach (var item in pageList.CurrentPageData) @@ -215,7 +206,7 @@ namespace IRaCIS.Core.Application.Service - return ResponseOutput.Ok (pageList, addtionalQustionInfoList); + return ResponseOutput.Ok(pageList, addtionalQustionInfoList); } @@ -253,7 +244,7 @@ namespace IRaCIS.Core.Application.Service } - + } @@ -478,9 +469,9 @@ namespace IRaCIS.Core.Application.Service public async Task BatchGenerateTask(BatchGenerateTaskCommand batchGenerateTaskCommand) { - var trakingList= await _subjectCriteriaEvaluationVisitFilterRepository.Where(t => t.SubjectId == batchGenerateTaskCommand.SubjectId + var trakingList = await _subjectCriteriaEvaluationVisitFilterRepository.Where(t => t.SubjectId == batchGenerateTaskCommand.SubjectId && t.TrialReadingCriterionId == batchGenerateTaskCommand.TrialReadingCriterionId - && batchGenerateTaskCommand.SubjectVisitIdList.Contains(t.SubjectVisitId),true).ToListAsync(); + && batchGenerateTaskCommand.SubjectVisitIdList.Contains(t.SubjectVisitId), true).ToListAsync(); foreach (var item in trakingList) { diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs index 0612eb76e..958da7abc 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalAnswerService.cs @@ -4,18 +4,15 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Infra.EFCore.Common; -using IRaCIS.Core.Domain.Share; -using MassTransit; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure.Extention; -using IRaCIS.Core.Application.Service.Reading.Interface; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.Service.Reading.Interface; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -41,7 +38,7 @@ namespace IRaCIS.Core.Application.Service IReadingClinicalDataService _iReadingClinicalDataService) : BaseService, IClinicalAnswerService { - + /// /// CRC签名临床数据 /// @@ -51,11 +48,11 @@ namespace IRaCIS.Core.Application.Service public async Task CRCSignClinicalData(CRCSignClinicalDataInDto inDto) { - await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x =>x.Id==inDto.ReadingClinicalDataId, x => new ReadingClinicalData() - { - IsSign = true, - ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned - }); + await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.ReadingClinicalDataId, x => new ReadingClinicalData() + { + IsSign = true, + ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned + }); await _readingClinicalDataRepository.SaveChangesAsync(); return ResponseOutput.Ok(true); @@ -70,19 +67,19 @@ namespace IRaCIS.Core.Application.Service { await _readingClinicalDataRepository.BatchDeleteNoTrackingAsync(x => x.StudyId == inDto.StudyId); - } + } - /// - /// 添加检查级别临床数据 - /// - /// - /// - public async Task AddStudyClinical(AddStudyClinicalInDto inDto) + /// + /// 添加检查级别临床数据 + /// + /// + /// + public async Task AddStudyClinical(AddStudyClinicalInDto inDto) { var studyInfo = await _dicomStudyRepository.Where(x => x.Id == inDto.StudyId).FirstNotNullAsync(); - List clinicals = await _clinicalDataTrialSetRepository.Where(x => - x.TrialId == studyInfo.TrialId && x.IsConfirm&&x.ClinicalDataLevel== ClinicalLevel.Study).ToListAsync(); + List clinicals = await _clinicalDataTrialSetRepository.Where(x => + x.TrialId == studyInfo.TrialId && x.IsConfirm && x.ClinicalDataLevel == ClinicalLevel.Study).ToListAsync(); List datas = new List(); @@ -99,40 +96,40 @@ namespace IRaCIS.Core.Application.Service }); - }); + }); - await _readingClinicalDataRepository.AddRangeAsync(datas); - await _readingClinicalDataRepository.SaveChangesAsync(); + await _readingClinicalDataRepository.AddRangeAsync(datas); + await _readingClinicalDataRepository.SaveChangesAsync(); - } + } - /// - /// 自动添加CRC临床数据 (不包括检查级别) - /// - /// - /// - public async Task AutoAddCRCClinical(AutoAddClinicalInDto inDto) + /// + /// 自动添加CRC临床数据 (不包括检查级别) + /// + /// + /// + public async Task AutoAddCRCClinical(AutoAddClinicalInDto inDto) { - var dataTrialSetList = await _clinicalDataTrialSetRepository.Where(x =>x.TrialId == inDto.TrialId && x.UploadRole == UploadRole.CRC && x.IsConfirm) - .IgnoreAutoIncludes().ToListAsync(); + var dataTrialSetList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.UploadRole == UploadRole.CRC && x.IsConfirm) + .IgnoreAutoIncludes().ToListAsync(); var baseLine = await _subjectVisitRepository.Where(x => x.TrialId == inDto.TrialId) - .WhereIf(inDto.SubjectId!=null,x=>x.SubjectId==inDto.SubjectId) - - .Select(x => new - { + .WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId) - x.SubjectId, - VisitId = x.Id, - x.IsBaseLine, - }).ToListAsync(); - - var clinicalDataList =await _readingClinicalDataRepository - .WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId) - .Where(x =>x.TrialId==inDto.TrialId&&x.ClinicalDataTrialSet.UploadRole== UploadRole.CRC) - .Select(x=>new + .Select(x => new { - ClinicalDataTrialSetId=x.ClinicalDataTrialSetId, - SubjectId=x.SubjectId, + + x.SubjectId, + VisitId = x.Id, + x.IsBaseLine, + }).ToListAsync(); + + var clinicalDataList = await _readingClinicalDataRepository + .WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId) + .Where(x => x.TrialId == inDto.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC) + .Select(x => new + { + ClinicalDataTrialSetId = x.ClinicalDataTrialSetId, + SubjectId = x.SubjectId, x.ReadingId, }).ToListAsync(); @@ -145,76 +142,76 @@ namespace IRaCIS.Core.Application.Service readingClinicalDatas.AddRange( dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.Subject).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.SubjectId == n).Count() == 0) .Select(x => new ReadingClinicalData() - { - ClinicalDataTrialSetId = x.Id, - IsVisit = true, - SubjectId = n, - ReadingId = baseLineVisitId, - TrialId = inDto.TrialId - }).ToList()); + { + ClinicalDataTrialSetId = x.Id, + IsVisit = true, + SubjectId = n, + ReadingId = baseLineVisitId, + TrialId = inDto.TrialId + }).ToList()); - readingClinicalDatas.AddRange( - dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.ImageRead).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.SubjectId == n).Count() == 0) - .Select(x => new ReadingClinicalData() - { - ClinicalDataTrialSetId = x.Id, - IsVisit = false, - SubjectId = n, - ReadingId = default(Guid), - TrialId = inDto.TrialId - }).ToList()); + readingClinicalDatas.AddRange( + dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.ImageRead).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.SubjectId == n).Count() == 0) + .Select(x => new ReadingClinicalData() + { + ClinicalDataTrialSetId = x.Id, + IsVisit = false, + SubjectId = n, + ReadingId = default(Guid), + TrialId = inDto.TrialId + }).ToList()); - readingClinicalDatas.AddRange( - dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.SubjectId == n).Count() == 0) - .Select(x => new ReadingClinicalData() - { - ClinicalDataTrialSetId = x.Id, - IsVisit = false, - SubjectId = n, - ReadingId = default(Guid), - TrialId = inDto.TrialId - }).ToList()); - }); + readingClinicalDatas.AddRange( + dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.OncologyRead).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.SubjectId == n).Count() == 0) + .Select(x => new ReadingClinicalData() + { + ClinicalDataTrialSetId = x.Id, + IsVisit = false, + SubjectId = n, + ReadingId = default(Guid), + TrialId = inDto.TrialId + }).ToList()); + }); baseLine.ForEach(n => { - readingClinicalDatas.AddRange( - dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.ReadingId == n.VisitId).Count() == 0) - .Select(x => new ReadingClinicalData() - { - ClinicalDataTrialSetId = x.Id, - IsVisit = true, - SubjectId = n.SubjectId, - ReadingId = n.VisitId, - TrialId = inDto.TrialId - }).ToList()); + readingClinicalDatas.AddRange( + dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.SubjectVisit).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.ReadingId == n.VisitId).Count() == 0) + .Select(x => new ReadingClinicalData() + { + ClinicalDataTrialSetId = x.Id, + IsVisit = true, + SubjectId = n.SubjectId, + ReadingId = n.VisitId, + TrialId = inDto.TrialId + }).ToList()); + + //readingClinicalDatas.AddRange( + // dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.Study).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.ReadingId == n.VisitId).Count() == 0) + // .Select(x => new ReadingClinicalData() + // { + // ClinicalDataTrialSetId = x.Id, + // IsVisit = true, + // SubjectId = n.SubjectId, + // ReadingId = n.VisitId, + // TrialId = inDto.TrialId + // }).ToList()); + }); - //readingClinicalDatas.AddRange( - // dataTrialSetList.Where(x => x.ClinicalDataLevel == ClinicalLevel.Study).Where(x => clinicalDataList.Where(y => y.ClinicalDataTrialSetId == x.Id && y.ReadingId == n.VisitId).Count() == 0) - // .Select(x => new ReadingClinicalData() - // { - // ClinicalDataTrialSetId = x.Id, - // IsVisit = true, - // SubjectId = n.SubjectId, - // ReadingId = n.VisitId, - // TrialId = inDto.TrialId - // }).ToList()); - }); - await _readingClinicalDataRepository.AddRangeAsync(readingClinicalDatas); await _readingClinicalDataRepository.SaveChangesAsync(); } - /// - /// 获取CRC受试者临床数据 - /// - /// - /// - [HttpPost] + /// + /// 获取CRC受试者临床数据 + /// + /// + /// + [HttpPost] public async Task> GetCRCSubjectClinicalList(GetCRCSubjectClinicalInDto inQuery) { @@ -223,44 +220,45 @@ namespace IRaCIS.Core.Application.Service // TrialId = inDto.TrialId //}) ; - var subjects = await _subjectRepository.Where(x => x.TrialId == inQuery.TrialId).Select(x => new GetCRCSubjectClinicalResultDto() + var subjects = await _subjectRepository.Where(x => x.TrialId == inQuery.TrialId).Select(x => new GetCRCSubjectClinicalResultDto() { SubjectId = x.Id, SubjectCode = x.Code }).ToListAsync(); - var clinicalData= _readingClinicalDataRepository.Where(x=>x.TrialId == inQuery.TrialId&&x.ClinicalDataTrialSet.UploadRole==UploadRole.CRC&&x.ClinicalDataTrialSet.ClinicalDataLevel!= ClinicalLevel.SubjectVisit) - .Where(x=>!x.IsSign) - .WhereIf(inQuery.SubjectId!=null,x=>x.SubjectId==inQuery.SubjectId) - .WhereIf(inQuery.SubjectCode != null, x => x.Subject.Code.Contains(inQuery.SubjectCode??string.Empty)) - .Where(x=> x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject) - .Include(x=>x.ClinicalDataTrialSet).Select(x=>new GetCRCSubjectClinicalOutDto() { - SubjectId=x.SubjectId, - SubjectCode=x.Subject.Code, - TrialId=inQuery.TrialId, - ReadingId= x.ReadingId, - ReadingClinicalDataId=x.Id, - UploadRole = x.ClinicalDataTrialSet.UploadRole, - ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel, - ClinicalUploadType= x.ClinicalDataTrialSet.ClinicalUploadType, - BaseLineVisitId= x.Subject.SubjectVisitList.Where(x=>x.IsBaseLine).Select(x=>x.Id).FirstOrDefault(), + var clinicalData = _readingClinicalDataRepository.Where(x => x.TrialId == inQuery.TrialId && x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.SubjectVisit) + .Where(x => !x.IsSign) + .WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId) + .WhereIf(inQuery.SubjectCode != null, x => x.Subject.Code.Contains(inQuery.SubjectCode ?? string.Empty)) + .Where(x => x.ClinicalDataTrialSet.ClinicalDataLevel != ClinicalLevel.Subject) + .Include(x => x.ClinicalDataTrialSet).Select(x => new GetCRCSubjectClinicalOutDto() + { + SubjectId = x.SubjectId, + SubjectCode = x.Subject.Code, + TrialId = inQuery.TrialId, + ReadingId = x.ReadingId, + ReadingClinicalDataId = x.Id, + UploadRole = x.ClinicalDataTrialSet.UploadRole, + ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel, + ClinicalUploadType = x.ClinicalDataTrialSet.ClinicalUploadType, + BaseLineVisitId = x.Subject.SubjectVisitList.Where(x => x.IsBaseLine).Select(x => x.Id).FirstOrDefault(), ClinicalDataTrialSetId = x.ClinicalDataTrialSet.Id, - ClinicalDataSetEnName= x.ClinicalDataTrialSet.ClinicalDataSetEnName, - ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName, - }); + ClinicalDataSetEnName = x.ClinicalDataTrialSet.ClinicalDataSetEnName, + ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName, + }); - var pageList = await clinicalData.ToPagedListAsync(inQuery, nameof(GetCRCSubjectClinicalOutDto.SubjectCode) ); - // 一次查询报错 分两次写 - pageList.CurrentPageData.ForEach(x => + var pageList = await clinicalData.ToPagedListAsync(inQuery, nameof(GetCRCSubjectClinicalOutDto.SubjectCode)); + // 一次查询报错 分两次写 + pageList.CurrentPageData.ForEach(x => { x.ClinicalDataSetEnName = x.ClinicalDataSetName.LanguageName(x.ClinicalDataSetEnName, _userInfo.IsEn_Us); }); - var clinicalFormData = await _clinicalFormRepository.Where(x => x.TrialId == inQuery.TrialId).ToListAsync(); - pageList.CurrentPageData.ForEach(n => - { - n.ClinicalCount = clinicalFormData.Where(y => y.ClinicalDataTrialSetId == n.ClinicalDataTrialSetId && y.SubjectId == n.SubjectId).Count(); - }); + var clinicalFormData = await _clinicalFormRepository.Where(x => x.TrialId == inQuery.TrialId).ToListAsync(); + pageList.CurrentPageData.ForEach(n => + { + n.ClinicalCount = clinicalFormData.Where(y => y.ClinicalDataTrialSetId == n.ClinicalDataTrialSetId && y.SubjectId == n.SubjectId).Count(); + }); return pageList; } @@ -274,15 +272,16 @@ namespace IRaCIS.Core.Application.Service { var result = new GetClinicalQuestionAnswerListOutDto(); result.AnswerList = new List>(); - result.QuestionList=await _trialClinicalQuestionRepository.Where(x=>x.TrialClinicalId==inDto.ClinicalDataTrialSetId - &&x.ClinicalQuestionType!= ReadingQestionType.Group + result.QuestionList = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.ClinicalDataTrialSetId + && x.ClinicalQuestionType != ReadingQestionType.Group && x.ClinicalQuestionType != ReadingQestionType.Table && x.ClinicalQuestionType != ReadingQestionType.BasicTable - ).OrderByDescending(x=>x.IsCheckDate).ThenBy(x=>x.ShowOrder) + ).OrderByDescending(x => x.IsCheckDate).ThenBy(x => x.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); if (_userInfo.IsEn_Us) { - result.QuestionList.ForEach(x => { + result.QuestionList.ForEach(x => + { x.GroupName = x.GroupEnName; x.QuestionName = x.QuestionEnName; }); @@ -298,16 +297,16 @@ namespace IRaCIS.Core.Application.Service }) .ToListAsync(); - var ClinicalFormIds = answers.OrderBy(x=>x.CheckDate).Select(x => x.ClinicalFormId).Distinct().ToList(); + var ClinicalFormIds = answers.OrderBy(x => x.CheckDate).Select(x => x.ClinicalFormId).Distinct().ToList(); ClinicalFormIds.ForEach(x => { var dic = answers.Where(y => y.ClinicalFormId == x).ToDictionary(x => x.QuestionId.ToString(), x => x.Answer); dic.Add("ClinicalFormId", x.ToString()); - dic.Add("TrialId", inDto.TrialId.ToString()); - dic.Add("SubjectId", inDto.SubjectId.ToString()); - dic.Add("ClinicalDataTrialSetId", inDto.ClinicalDataTrialSetId.ToString()); - - result.AnswerList.Add(dic); + dic.Add("TrialId", inDto.TrialId.ToString()); + dic.Add("SubjectId", inDto.SubjectId.ToString()); + dic.Add("ClinicalDataTrialSetId", inDto.ClinicalDataTrialSetId.ToString()); + + result.AnswerList.Add(dic); }); return result; @@ -366,7 +365,7 @@ namespace IRaCIS.Core.Application.Service { - + ClinicalForm clinicalForm = new ClinicalForm() { }; clinicalForm = new ClinicalForm() { @@ -378,7 +377,7 @@ namespace IRaCIS.Core.Application.Service ReadingId = inDto.ReadingId, }; - if (inDto.ClinicalFormId!=null&&(await _readModuleCriterionFromRepository.AnyAsync(x => x.ClinicalFormId == inDto.ClinicalFormId.Value))) + if (inDto.ClinicalFormId != null && (await _readModuleCriterionFromRepository.AnyAsync(x => x.ClinicalFormId == inDto.ClinicalFormId.Value))) { throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_translation"]); } @@ -394,40 +393,41 @@ namespace IRaCIS.Core.Application.Service { throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_duplicateData"]); } - try + try { - var checkDateQuestionId = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.ClinicalDataTrialSetId && x.IsCheckDate).Select(x => x.Id).FirstNotNullAsync(); + var checkDateQuestionId = await _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.ClinicalDataTrialSetId && x.IsCheckDate).Select(x => x.Id).FirstNotNullAsync(); clinicalForm.CheckDate = DateTime.Parse(inDto.QuestionAnswers.Where(x => x.QuestionId == checkDateQuestionId).Select(x => x.Answer).First()); - } + } catch (Exception) { - + } if (clinicalForm.CheckDate != null) { - if (await _readModuleRepository.AnyAsync(x =>x.SubjectId== inDto.SubjectId&& x.SubjectVisit.LatestScanDate <= clinicalForm.CheckDate && x.IsCRCConfirm)) + if (await _readModuleRepository.AnyAsync(x => x.SubjectId == inDto.SubjectId && x.SubjectVisit.LatestScanDate <= clinicalForm.CheckDate && x.IsCRCConfirm)) { - throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToAddOrUpdate", clinicalForm.CheckDate.Value.ToString("yyyy-MM-dd")]); - } + throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToAddOrUpdate", clinicalForm.CheckDate.Value.ToString("yyyy-MM-dd")]); + } - } + } List clinicalQuestionAnswers = inDto.QuestionAnswers.Select(x => new ClinicalQuestionAnswer() { - Answer=x.Answer, - ClinicalDataTrialSetId=inDto.ClinicalDataTrialSetId, - SubjectId=inDto.SubjectId, - ClinicalFormId= clinicalForm.Id, - QuestionId=x.QuestionId, + Answer = x.Answer, + ClinicalDataTrialSetId = inDto.ClinicalDataTrialSetId, + SubjectId = inDto.SubjectId, + ClinicalFormId = clinicalForm.Id, + QuestionId = x.QuestionId, }).ToList(); List clinicalAnswerRowInfos = new List(); List clinicalTableAnswers = new List(); - inDto.TableQuestionAnswerList.ForEach(x => { + inDto.TableQuestionAnswerList.ForEach(x => + { var questionid = x.QuestionId; for (int i = 0; i < x.TableQuestionAnswers.Count(); i++) @@ -438,25 +438,26 @@ namespace IRaCIS.Core.Application.Service SubjectId = inDto.SubjectId, ClinicalFormId = clinicalForm.Id, QuestionId = questionid, - RowIndex = i+1, + RowIndex = i + 1, }; clinicalAnswerRowInfos.Add(rowInfo); - x.TableQuestionAnswers[i].ForEach(y => { + x.TableQuestionAnswers[i].ForEach(y => + { clinicalTableAnswers.Add(new ClinicalTableAnswer() { - Answer=y.Answer, - ClinicalFormId= clinicalForm.Id, - QuestionId= questionid, - RowId= rowInfo.Id, - TableQuestionId=y.TableQuestionId, - SubjectId= inDto.SubjectId, - + Answer = y.Answer, + ClinicalFormId = clinicalForm.Id, + QuestionId = questionid, + RowId = rowInfo.Id, + TableQuestionId = y.TableQuestionId, + SubjectId = inDto.SubjectId, + }); - }); + }); } }); @@ -495,15 +496,15 @@ namespace IRaCIS.Core.Application.Service if (await _readModuleCriterionFromRepository.AnyAsync(x => x.ClinicalFormId == inDto.ClinicalFormId)) { - throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToDelete"]); - } + throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToDelete"]); + } - await _clinicalFormRepository.BatchDeleteNoTrackingAsync(x => x.Id == inDto.ClinicalFormId); - await _clinicalQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId); - await _clinicalAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId); - await _clinicalTableAnswerRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId); - return ResponseOutput.Ok(true); - } + await _clinicalFormRepository.BatchDeleteNoTrackingAsync(x => x.Id == inDto.ClinicalFormId); + await _clinicalQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId); + await _clinicalAnswerRowInfoRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId); + await _clinicalTableAnswerRepository.BatchDeleteNoTrackingAsync(x => x.ClinicalFormId == inDto.ClinicalFormId); + return ResponseOutput.Ok(true); + } /// /// 获取PM待确认列表 @@ -513,7 +514,7 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task> GetPMConfirmList(GetPMConfirmListInDto inDto) { - return await GetCRCConfirmList(new GetCRCConfirmListInDto() + return await GetCRCConfirmList(new GetCRCConfirmListInDto() { TrialId = inDto.TrialId, IsCRCConfirm = true, @@ -545,7 +546,7 @@ namespace IRaCIS.Core.Application.Service var clinicalDataLevelList = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.UploadRole == UploadRole.CRC && x.ClinicalUploadType == ClinicalUploadType.Structuring).Select(x => x.ClinicalDataLevel).Distinct().ToListAsync(); - var existsCRCStructuring = clinicalDataLevelList.Any(x=>x== ClinicalLevel.OncologyRead|| x == ClinicalLevel.ImageRead); + var existsCRCStructuring = clinicalDataLevelList.Any(x => x == ClinicalLevel.OncologyRead || x == ClinicalLevel.ImageRead); ReadingSetType? readingSetType = null; @@ -560,114 +561,115 @@ namespace IRaCIS.Core.Application.Service var query = _readModuleRepository.Where(x => x.TrialId == inDto.TrialId) - .Where(x=> existsCRCStructuring) - .WhereIf(inDto.ReadModuleId==null,x=>x.TrialReadingCriterion.IsConfirm) + .Where(x => existsCRCStructuring) + .WhereIf(inDto.ReadModuleId == null, x => x.TrialReadingCriterion.IsConfirm) .WhereIf(inDto.ReadModuleId != null, x => x.Id == inDto.ReadModuleId) .WhereIf(inDto.IsCRCConfirm != null, x => x.IsCRCConfirm == inDto.IsCRCConfirm) .WhereIf(inDto.IsPMConfirm != null, x => x.IsPMConfirm == inDto.IsPMConfirm) - .WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode??string.Empty)) + .WhereIf(inDto.SubjectCode != null, x => x.Subject.Code.Contains(inDto.SubjectCode ?? string.Empty)) .WhereIf(inDto.TrialReadingCriterionId != null, x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) - .WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId) + .WhereIf(inDto.SubjectId != null, x => x.SubjectId == inDto.SubjectId) .WhereIf(inDto.StartTime != null, x => x.SubjectVisit.LatestScanDate >= inDto.StartTime) .WhereIf(inDto.EndTime != null, x => x.SubjectVisit.LatestScanDate <= inDto.EndTime) - .WhereIf(readingSetType != null, x => x.ReadingSetType== readingSetType) + .WhereIf(readingSetType != null, x => x.ReadingSetType == readingSetType) .Select(x => new GetCRCConfirmListOutDto() { - + SubjectId = x.SubjectId, - IsNotNeedPMConfirm=x.IsNotNeedPMConfirm, + IsNotNeedPMConfirm = x.IsNotNeedPMConfirm, IsCRCConfirm = x.IsCRCConfirm, - IsCRCApplicationRevoke=x.IsCRCApplicationRevoke, - VisitBlindName=x.SubjectVisit.BlindName, + IsCRCApplicationRevoke = x.IsCRCApplicationRevoke, + VisitBlindName = x.SubjectVisit.BlindName, LatestScanDate = x.SubjectVisit.LatestScanDate, ReadingSetType = x.ReadingSetType, IsPMConfirm = x.IsPMConfirm, SubjectCode = x.Subject.Code, ReadModuleId = x.Id, - ModuleName=x.ModuleName, + ModuleName = x.ModuleName, }); var defalutSortArray = new string[] { nameof(GetCRCConfirmListOutDto.SubjectCode) + " desc", nameof(GetCRCConfirmListOutDto.LatestScanDate) }; - var result = await query.ToPagedListAsync(inDto, defalutSortArray); - - var formList = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId) - .Where(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC) - .WhereIf(inDto.TrialReadingCriterionId!=null, x=>x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(y=>y.TrialReadingCriterionId== inDto.TrialReadingCriterionId)) - .Where(x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead) - .Include(x=>x.ClinicalDataTrialSet) + var result = await query.ToPagedListAsync(inDto, defalutSortArray); + + var formList = await _clinicalFormRepository.Where(x => x.TrialId == inDto.TrialId) + .Where(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC) + .WhereIf(inDto.TrialReadingCriterionId != null, x => x.ClinicalDataTrialSet.TrialClinicalDataSetCriteriaList.Any(y => y.TrialReadingCriterionId == inDto.TrialReadingCriterionId)) + .Where(x => x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead) + .Include(x => x.ClinicalDataTrialSet) .Select(x => new CRCClinicalForm - { - SubjectId=x.SubjectId, - CheckDate = x.CheckDate, - ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel, - ClinicalFormId = x.Id, - ClinicalDataTrialSetId= x.ClinicalDataTrialSet.Id, - ClinicalDataSetName =x.ClinicalDataTrialSet.ClinicalDataSetName, - ClinicalDataSetEnName=x.ClinicalDataTrialSet.ClinicalDataSetEnName, - IsHaveTableQuestion=x.ClinicalDataTrialSet.TrialClinicalQuestionList.Any(y=>y.ClinicalQuestionType== ReadingQestionType.Table|| y.ClinicalQuestionType== ReadingQestionType.BasicTable), - }).ToListAsync(); + { + SubjectId = x.SubjectId, + CheckDate = x.CheckDate, + ClinicalDataLevel = x.ClinicalDataTrialSet.ClinicalDataLevel, + ClinicalFormId = x.Id, + ClinicalDataTrialSetId = x.ClinicalDataTrialSet.Id, + ClinicalDataSetName = x.ClinicalDataTrialSet.ClinicalDataSetName, + ClinicalDataSetEnName = x.ClinicalDataTrialSet.ClinicalDataSetEnName, + IsHaveTableQuestion = x.ClinicalDataTrialSet.TrialClinicalQuestionList.Any(y => y.ClinicalQuestionType == ReadingQestionType.Table || y.ClinicalQuestionType == ReadingQestionType.BasicTable), + }).ToListAsync(); var confirmList = await _readModuleCriterionFromRepository.Where(x => x.TrialId == inDto.TrialId - &&x.ClinicalForm.ClinicalDataTrialSet.UploadRole== UploadRole.CRC - &&(x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataLevel==ClinicalLevel.ImageRead|| x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead)) + && x.ClinicalForm.ClinicalDataTrialSet.UploadRole == UploadRole.CRC + && (x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataLevel == ClinicalLevel.OncologyRead)) .Select(x => new GetCRCBeConfirm - { - CheckDate = x.ClinicalForm.CheckDate ?? default(DateTime), - ClinicalDataSetName = x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataSetName, - ClinicalDataSetEnName = x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataSetEnName, - ClinicalFormId = x.ClinicalFormId, - ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSet.Id, - ReadModuleId=x.ReadModuleId, - IsHaveTableQuestion=x.ClinicalForm.ClinicalDataTrialSet.TrialClinicalQuestionList.Any(y => y.ClinicalQuestionType == ReadingQestionType.Table || y.ClinicalQuestionType == ReadingQestionType.BasicTable) - }).ToListAsync(); - - + { + CheckDate = x.ClinicalForm.CheckDate ?? default(DateTime), + ClinicalDataSetName = x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataSetName, + ClinicalDataSetEnName = x.ClinicalForm.ClinicalDataTrialSet.ClinicalDataSetEnName, + ClinicalFormId = x.ClinicalFormId, + ClinicalDataTrialSetId = x.ClinicalForm.ClinicalDataTrialSet.Id, + ReadModuleId = x.ReadModuleId, + IsHaveTableQuestion = x.ClinicalForm.ClinicalDataTrialSet.TrialClinicalQuestionList.Any(y => y.ClinicalQuestionType == ReadingQestionType.Table || y.ClinicalQuestionType == ReadingQestionType.BasicTable) + }).ToListAsync(); + + result.CurrentPageData.ForEach(x => { if (x.IsCRCConfirm) { - x.ClinicalFormList = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Select(y=>new GetCRCBeConfirmListOutDto() { - CheckDate = y.CheckDate, - ClinicalDataSetName= y.ClinicalDataSetName.LanguageName(y.ClinicalDataSetEnName, _userInfo.IsEn_Us), - ClinicalDataSetEnName= y.ClinicalDataSetEnName, - ClinicalFormId=y.ClinicalFormId, - ClinicalDataTrialSetId=y.ClinicalDataTrialSetId, - IsHaveTableQuestion=y.IsHaveTableQuestion, - }).ToList(); + x.ClinicalFormList = confirmList.Where(y => y.ReadModuleId == x.ReadModuleId).Select(y => new GetCRCBeConfirmListOutDto() + { + CheckDate = y.CheckDate, + ClinicalDataSetName = y.ClinicalDataSetName.LanguageName(y.ClinicalDataSetEnName, _userInfo.IsEn_Us), + ClinicalDataSetEnName = y.ClinicalDataSetEnName, + ClinicalFormId = y.ClinicalFormId, + ClinicalDataTrialSetId = y.ClinicalDataTrialSetId, + IsHaveTableQuestion = y.IsHaveTableQuestion, + }).ToList(); } else { if (x.ReadingSetType == ReadingSetType.ImageReading) { - x.ClinicalFormList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead&&y.CheckDate <= x.LatestScanDate&&y.SubjectId==x.SubjectId) - - .Select(y => new GetCRCBeConfirmListOutDto() - { - CheckDate = y.CheckDate ?? default(DateTime), - ClinicalDataSetName = y.ClinicalDataSetName.LanguageName(y.ClinicalDataSetEnName, _userInfo.IsEn_Us), - ClinicalDataSetEnName = y.ClinicalDataSetEnName, - ClinicalFormId = y.ClinicalFormId, - ClinicalDataTrialSetId = y.ClinicalDataTrialSetId, - IsHaveTableQuestion = y.IsHaveTableQuestion, - }).ToList(); + x.ClinicalFormList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.ImageRead && y.CheckDate <= x.LatestScanDate && y.SubjectId == x.SubjectId) + + .Select(y => new GetCRCBeConfirmListOutDto() + { + CheckDate = y.CheckDate ?? default(DateTime), + ClinicalDataSetName = y.ClinicalDataSetName.LanguageName(y.ClinicalDataSetEnName, _userInfo.IsEn_Us), + ClinicalDataSetEnName = y.ClinicalDataSetEnName, + ClinicalFormId = y.ClinicalFormId, + ClinicalDataTrialSetId = y.ClinicalDataTrialSetId, + IsHaveTableQuestion = y.IsHaveTableQuestion, + }).ToList(); } else { - x.ClinicalFormList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead&&y.CheckDate <= x.LatestScanDate && y.SubjectId == x.SubjectId) + x.ClinicalFormList = formList.Where(y => y.ClinicalDataLevel == ClinicalLevel.OncologyRead && y.CheckDate <= x.LatestScanDate && y.SubjectId == x.SubjectId) .Select(y => new GetCRCBeConfirmListOutDto() - { - CheckDate = y.CheckDate ?? default(DateTime), - ClinicalDataSetName = y.ClinicalDataSetName.LanguageName(y.ClinicalDataSetEnName, _userInfo.IsEn_Us), - ClinicalDataSetEnName = y.ClinicalDataSetEnName, - ClinicalFormId = y.ClinicalFormId, - ClinicalDataTrialSetId = y.ClinicalDataTrialSetId, - IsHaveTableQuestion = y.IsHaveTableQuestion, - }).ToList(); - } - } + { + CheckDate = y.CheckDate ?? default(DateTime), + ClinicalDataSetName = y.ClinicalDataSetName.LanguageName(y.ClinicalDataSetEnName, _userInfo.IsEn_Us), + ClinicalDataSetEnName = y.ClinicalDataSetEnName, + ClinicalFormId = y.ClinicalFormId, + ClinicalDataTrialSetId = y.ClinicalDataTrialSetId, + IsHaveTableQuestion = y.IsHaveTableQuestion, + }).ToList(); + } + } }); return result; - } + } /// /// 获取CRC待确认列表 @@ -681,12 +683,12 @@ namespace IRaCIS.Core.Application.Service { ReadModuleId = inDto.ReadModuleId, TrialId = inDto.TrialId, - PageIndex=1, - PageSize=9999, - + PageIndex = 1, + PageSize = 9999, + })).CurrentPageData.SelectMany(x => x.ClinicalFormList).ToList(); return result.OrderBy(x => x.ClinicalDataSetName).ThenBy(x => x.CheckDate).ToList(); - } + } /// @@ -695,60 +697,61 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task<(List,object)> GetClinicalTableList(GetClinicalTableListInDto inDto) + public async Task<(List, object)> GetClinicalTableList(GetClinicalTableListInDto inDto) { - var readModule=await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); + var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); - var confirmList = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto() - { - ReadModuleId = inDto.ReadModuleId, - TrialId = inDto.TrialId, - PageIndex = 1, - PageSize = 9999, + var confirmList = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto() + { + ReadModuleId = inDto.ReadModuleId, + TrialId = inDto.TrialId, + PageIndex = 1, + PageSize = 9999, - })).CurrentPageData.SelectMany(x => x.ClinicalFormList).ToList(); + })).CurrentPageData.SelectMany(x => x.ClinicalFormList).ToList(); - var clinicalDataTrialSetIds = confirmList.Select(x => x.ClinicalDataTrialSetId).Distinct().ToList(); + var clinicalDataTrialSetIds = confirmList.Select(x => x.ClinicalDataTrialSetId).Distinct().ToList(); var clinicalFormIds = confirmList.Select(x => x.ClinicalFormId).ToList(); - var questionList = await _trialClinicalQuestionRepository.Where(x => clinicalDataTrialSetIds.Contains( x.TrialClinicalId) - && x.ClinicalQuestionType != ReadingQestionType.Group - && x.ClinicalQuestionType != ReadingQestionType.Table + var questionList = await _trialClinicalQuestionRepository.Where(x => clinicalDataTrialSetIds.Contains(x.TrialClinicalId) + && x.ClinicalQuestionType != ReadingQestionType.Group + && x.ClinicalQuestionType != ReadingQestionType.Table && x.ClinicalQuestionType != ReadingQestionType.BasicTable - ).OrderBy(x=>x.TrialClinicalId).ThenBy(x => x.ShowOrder) - .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - var answers = await _clinicalQuestionAnswerRepository.Where(x => clinicalFormIds.Contains(x.ClinicalFormId)) - .Select(x => new - { + ).OrderBy(x => x.TrialClinicalId).ThenBy(x => x.ShowOrder) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var answers = await _clinicalQuestionAnswerRepository.Where(x => clinicalFormIds.Contains(x.ClinicalFormId)) + .Select(x => new + { x.ClinicalDataTrialSetId, - x.ClinicalFormId, - x.ClinicalForm.CheckDate, - x.QuestionId, - x.Answer - }) - .ToListAsync(); - List result = new List(); - clinicalDataTrialSetIds.ForEach(x => { + x.ClinicalFormId, + x.ClinicalForm.CheckDate, + x.QuestionId, + x.Answer + }) + .ToListAsync(); + List result = new List(); + clinicalDataTrialSetIds.ForEach(x => + { GetClinicalTableListOutDto dto = new GetClinicalTableListOutDto(); dto.ModuleName = readModule.ModuleName; dto.ClinicalDataSetName = confirmList.Where(y => y.ClinicalDataTrialSetId == x).Select(y => y.ClinicalDataSetName).First(); dto.QuestionList = questionList.Where(y => y.TrialClinicalId == x).OrderBy(y => y.ShowOrder).ToList(); dto.AnswerList = new List>(); - var ClinicalFormIds= answers.Where(y => y.ClinicalDataTrialSetId == x).OrderBy(x => x.CheckDate).Select(x => x.ClinicalFormId).Distinct().ToList(); - ClinicalFormIds.ForEach(z => - { - var dic = answers.Where(y => y.ClinicalFormId == z).OrderBy(y => y.CheckDate).ToDictionary(x => x.QuestionId.ToString(), x => x.Answer); - dic.Add("ClinicalFormId", z.ToString()); - dic.Add("TrialId", inDto.TrialId.ToString()); - dic.Add("SubjectId", readModule.SubjectId.ToString()); - dic.Add("ClinicalDataTrialSetId", x.ToString()); + var ClinicalFormIds = answers.Where(y => y.ClinicalDataTrialSetId == x).OrderBy(x => x.CheckDate).Select(x => x.ClinicalFormId).Distinct().ToList(); + ClinicalFormIds.ForEach(z => + { + var dic = answers.Where(y => y.ClinicalFormId == z).OrderBy(y => y.CheckDate).ToDictionary(x => x.QuestionId.ToString(), x => x.Answer); + dic.Add("ClinicalFormId", z.ToString()); + dic.Add("TrialId", inDto.TrialId.ToString()); + dic.Add("SubjectId", readModule.SubjectId.ToString()); + dic.Add("ClinicalDataTrialSetId", x.ToString()); - dto.AnswerList.Add(dic); + dto.AnswerList.Add(dic); - }); + }); result.Add(dto); - }); + }); return (result, new { readModule.ModuleName, @@ -763,19 +766,19 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task<(List,object)> GetClinicalDateList(GetCRCBeConfirmListInDto inDto) + public async Task<(List, object)> GetClinicalDateList(GetCRCBeConfirmListInDto inDto) { var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); var confirmList = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto() - { - ReadModuleId = inDto.ReadModuleId, - TrialId = inDto.TrialId, - PageIndex = 1, - PageSize = 9999, + { + ReadModuleId = inDto.ReadModuleId, + TrialId = inDto.TrialId, + PageIndex = 1, + PageSize = 9999, - })).CurrentPageData.SelectMany(x => x.ClinicalFormList).ToList(); + })).CurrentPageData.SelectMany(x => x.ClinicalFormList).ToList(); - var clinicalDataTrialSetIds = confirmList.Select(x => x.ClinicalDataTrialSetId).Distinct().ToList(); + var clinicalDataTrialSetIds = confirmList.Select(x => x.ClinicalDataTrialSetId).Distinct().ToList(); List result = new List(); @@ -791,38 +794,39 @@ namespace IRaCIS.Core.Application.Service }); - return (result,new { + return (result, new + { readModule.ModuleName, }); - } + } - /// - /// CRC 确认临床数据 - /// - /// - /// - [HttpPost] + /// + /// CRC 确认临床数据 + /// + /// + /// + [HttpPost] public async Task CRCConfirmClinical(CRCConfirmClinicalInDto inDto) { var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); - + var confirmlist = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto() { TrialId = inDto.TrialId, - SubjectId= readModule.SubjectId, - IsCRCConfirm=false, + SubjectId = readModule.SubjectId, + IsCRCConfirm = false, TrialReadingCriterionId = readModule.TrialReadingCriterionId, //ReadModuleId = inDto.ReadModuleId, - PageIndex =1, - PageSize=9999, - })).CurrentPageData.ToList(); + PageIndex = 1, + PageSize = 9999, + })).CurrentPageData.ToList(); var presentData = confirmlist.Where(x => x.ReadModuleId == inDto.ReadModuleId).First(); confirmlist = confirmlist.Where(x => x.LatestScanDate <= presentData.LatestScanDate).ToList(); - await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== inDto.ReadModuleId); + await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x => x.ReadModuleId == inDto.ReadModuleId); List needAddList = new List() { @@ -838,16 +842,16 @@ namespace IRaCIS.Core.Application.Service SubjectId = x.SubjectId, TrialId = inDto.TrialId, }); - }); + }); }); foreach (var item in confirmlist) { - await _readModuleRepository.UpdatePartialFromQueryAsync(x =>x.Id==item.ReadModuleId , x => new ReadModule() + await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == item.ReadModuleId, x => new ReadModule() { IsCRCConfirm = true, - IsPMConfirm=item.ClinicalFormList.Count()==0?true:false, - IsNotNeedPMConfirm= item.ClinicalFormList.Count() == 0 ? true : false, + IsPMConfirm = item.ClinicalFormList.Count() == 0 ? true : false, + IsNotNeedPMConfirm = item.ClinicalFormList.Count() == 0 ? true : false, }); } @@ -856,7 +860,7 @@ namespace IRaCIS.Core.Application.Service await _readModuleCriterionFromRepository.SaveChangesAsync(); await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModule.TrialReadingCriterionId); return ResponseOutput.Ok(true); - } + } /// /// CRC 取消确认 @@ -864,30 +868,30 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto) + public async Task CRCCancelConfirmClinical(CRCCancelConfirmClinicalInDto inDto) { - var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); - var dataList = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto() - { - TrialId = inDto.TrialId, - SubjectId = readModule.SubjectId, - TrialReadingCriterionId = readModule.TrialReadingCriterionId, - PageIndex = 1, - PageSize = 9999, - })).CurrentPageData; + var readModule = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); + var dataList = (await this.GetCRCConfirmList(new GetCRCConfirmListInDto() + { + TrialId = inDto.TrialId, + SubjectId = readModule.SubjectId, + TrialReadingCriterionId = readModule.TrialReadingCriterionId, + PageIndex = 1, + PageSize = 9999, + })).CurrentPageData; - var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First(); + var presentData = dataList.Where(x => x.ReadModuleId == inDto.ReadModuleId).First(); if (dataList.Any(x => x.IsCRCConfirm && x.LatestScanDate > presentData.LatestScanDate && x.ReadingSetType == presentData.ReadingSetType)) { - throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToCancel"]); - } + throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToCancel"]); + } - if(presentData.IsPMConfirm) + if (presentData.IsPMConfirm) { - throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToCancelPMConfirmed"]); - } + throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_unableToCancelPMConfirmed"]); + } if (presentData.IsNotNeedPMConfirm) { @@ -905,13 +909,13 @@ namespace IRaCIS.Core.Application.Service IsCRCApplicationRevoke = true, }); } - - //await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== presentData.ReadModuleId); - await _readModuleCriterionFromRepository.SaveChangesAsync(); + //await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x=>x.ReadModuleId== presentData.ReadModuleId); + + await _readModuleCriterionFromRepository.SaveChangesAsync(); return ResponseOutput.Ok(true); - } + } /// /// PM确认临床数据 @@ -925,8 +929,8 @@ namespace IRaCIS.Core.Application.Service var readModuleData = await _readModuleRepository.Where(x => x.Id == inDto.ReadModuleId).FirstNotNullAsync(); if (!readModuleData.IsCRCConfirm) { - throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_PMUnableToOperate"]); - } + throw new BusinessValidationFailedException(_localizer["ClinicalAnswer_PMUnableToOperate"]); + } if (readModuleData.IsCRCApplicationRevoke && inDto.IsConfirm) { @@ -943,8 +947,8 @@ namespace IRaCIS.Core.Application.Service await _readModuleRepository.UpdatePartialFromQueryAsync(x => inDto.ReadModuleId == x.Id, x => new ReadModule() { IsPMConfirm = true, - IsClinicalDataBlind=inDto.IsClinicalDataBlind, - IsClinicalDataComplete=inDto.IsClinicalDataComplete, + IsClinicalDataBlind = inDto.IsClinicalDataBlind, + IsClinicalDataComplete = inDto.IsClinicalDataComplete, }); await _readModuleRepository.SaveChangesAsync(); await _iReadingClinicalDataService.DealVisiTaskClinicalDataSignedAsync(inDto.TrialId, inDto.SubjectId, inDto.ReadModuleId, false, readModuleData.TrialReadingCriterionId); @@ -954,18 +958,18 @@ namespace IRaCIS.Core.Application.Service await _readModuleRepository.UpdatePartialFromQueryAsync(x => inDto.ReadModuleId == x.Id, x => new ReadModule() { IsCRCConfirm = false, - IsCRCApplicationRevoke=false, + IsCRCApplicationRevoke = false, }); await _readModuleRepository.SaveChangesAsync(); await _readModuleCriterionFromRepository.BatchDeleteNoTrackingAsync(x => x.ReadModuleId == inDto.ReadModuleId); } - - - return ResponseOutput.Ok(true); - } - } + + return ResponseOutput.Ok(true); + } + + } } diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalDataSetService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalDataSetService.cs index f99104d8e..eefcc4e36 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalDataSetService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalDataSetService.cs @@ -1,16 +1,11 @@ -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using System.Linq; -using System.Linq.Expressions; -using System; -using MathNet.Numerics.Optimization.LineSearch; +using MassTransit; +using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 临床数据配置 @@ -30,7 +25,7 @@ namespace IRaCIS.Application.Services IRepository _trialClinicalQuestionRepository, IRepository _systemClinicalQuestionRepository) : BaseService { - + /// @@ -44,17 +39,17 @@ namespace IRaCIS.Application.Services { var isNeedVerify = await _clinicalDataSystemSetRepository.AnyAsync(x => x.Id == inDto.SystemClinicalId && (x.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataLevel == ClinicalLevel.OncologyRead) - && x.ClinicalUploadType == ClinicalUploadType.Structuring && x.UploadRole == UploadRole.CRC + && x.ClinicalUploadType == ClinicalUploadType.Structuring && x.UploadRole == UploadRole.CRC ); - if (_systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId).Count() == 0) - { - throw new BusinessValidationFailedException(_localizer["ClinicalComment_dataNotConfigured"]); - } - if (isNeedVerify&&_systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId && x.IsCheckDate).Count() != 1) + if (_systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId).Count() == 0) + { + throw new BusinessValidationFailedException(_localizer["ClinicalComment_dataNotConfigured"]); + } + if (isNeedVerify && _systemClinicalQuestionRepository.Where(x => x.SystemClinicalId == inDto.SystemClinicalId && x.IsCheckDate).Count() != 1) { throw new BusinessValidationFailedException(_localizer["ClinicalDataSet_Apply"]); - + } await _clinicalDataSystemSetRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.SystemClinicalId, x => new ClinicalDataSystemSet() @@ -78,16 +73,16 @@ namespace IRaCIS.Application.Services public async Task ApplyTrialClinical(ApplyTrialClinicalInDto inDto) { - var isNeedVerify = await _clinicalDataTrialSetRepository.AnyAsync(x => x.Id == inDto.TrialClinicalId && (x.ClinicalDataLevel == ClinicalLevel.ImageRead|| x.ClinicalDataLevel==ClinicalLevel.OncologyRead) - && x.ClinicalUploadType == ClinicalUploadType.Structuring && x.UploadRole == UploadRole.CRC - ); + var isNeedVerify = await _clinicalDataTrialSetRepository.AnyAsync(x => x.Id == inDto.TrialClinicalId && (x.ClinicalDataLevel == ClinicalLevel.ImageRead || x.ClinicalDataLevel == ClinicalLevel.OncologyRead) + && x.ClinicalUploadType == ClinicalUploadType.Structuring && x.UploadRole == UploadRole.CRC + ); if (_trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId).Count() == 0) { - throw new BusinessValidationFailedException(_localizer["ClinicalComment_dataNotConfigured"]); - } + throw new BusinessValidationFailedException(_localizer["ClinicalComment_dataNotConfigured"]); + } - if (isNeedVerify&&_trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && x.IsCheckDate).Count() != 1) + if (isNeedVerify && _trialClinicalQuestionRepository.Where(x => x.TrialClinicalId == inDto.TrialClinicalId && x.IsCheckDate).Count() != 1) { throw new BusinessValidationFailedException(_localizer["ClinicalDataSet_Apply"]); @@ -121,11 +116,11 @@ namespace IRaCIS.Application.Services var dictionary = await _dictionaryRepository.Where(x => x.Parent.Code == "ClinicalDataType" && x.Code == indto.ClinicalDataSetEnum.ToString()).FirstNotNullAsync(); indto.ClinicalDataSetName = dictionary.ValueCN; indto.ClinicalDataSetEnName = dictionary.Value; - var existsQuery = _clinicalDataSystemSetRepository + var existsQuery = _clinicalDataSystemSetRepository .WhereIf(indto.Id != null, x => x.Id != indto.Id) - .Where(x => x.ClinicalDataSetName == indto.ClinicalDataSetName||x.ClinicalDataSetEnName==indto.ClinicalDataSetEnName); + .Where(x => x.ClinicalDataSetName == indto.ClinicalDataSetName || x.ClinicalDataSetEnName == indto.ClinicalDataSetEnName); + - if (await existsQuery.AnyAsync()) { @@ -133,7 +128,7 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk(_localizer["ClinicalDataSet_DupTypeFail"]); } - indto.CriterionEnumListStr= $"|{String.Join('|', indto.CriterionEnumList)}|"; + indto.CriterionEnumListStr = $"|{String.Join('|', indto.CriterionEnumList)}|"; var entity = await _clinicalDataSystemSetRepository.InsertOrUpdateAsync(indto); @@ -203,7 +198,7 @@ namespace IRaCIS.Application.Services var existsQuery = _clinicalDataTrialSetRepository .WhereIf(indto.Id != null, x => x.Id != indto.Id) - .Where(x => (x.ClinicalDataSetName == indto.ClinicalDataSetName||x.ClinicalDataSetEnName==indto.ClinicalDataSetEnName) && x.TrialId == indto.TrialId); + .Where(x => (x.ClinicalDataSetName == indto.ClinicalDataSetName || x.ClinicalDataSetEnName == indto.ClinicalDataSetEnName) && x.TrialId == indto.TrialId); if (await existsQuery.AnyAsync()) { @@ -220,7 +215,7 @@ namespace IRaCIS.Application.Services //var entity = _mapper.Map(from); indto.CreateTime = DateTime.Now; - var entity = await _clinicalDataTrialSetRepository.InsertOrUpdateAsync(indto); + var entity = await _clinicalDataTrialSetRepository.InsertOrUpdateAsync(indto); entity.TrialClinicalDataSetCriteriaList = indto.TrialCriterionIdList.Select(t => new TrialClinicalDataSetCriterion() { @@ -256,40 +251,40 @@ namespace IRaCIS.Application.Services { await this.AddTrialClinicalDataTrialSet(inDto.TrialId); Expression> predicate = null; - if (inDto.CriterionIds != null) + if (inDto.CriterionIds != null) { - List criterionTypes = (await _iReadingQuestionCriterionTrialRepository.Where(x => inDto.CriterionIds.Contains(x.Id)).Select(x => x.CriterionType).ToListAsync()) - .Select(x => ((int)x).ToString()).ToList(); - predicate = x =>x.SystemClinicalDataSetId == null; + List criterionTypes = (await _iReadingQuestionCriterionTrialRepository.Where(x => inDto.CriterionIds.Contains(x.Id)).Select(x => x.CriterionType).ToListAsync()) + .Select(x => ((int)x).ToString()).ToList(); + predicate = x => x.SystemClinicalDataSetId == null; foreach (var item in criterionTypes) { - Expression> typeExpression = x =>x.ClinicalDataSystemSet==null|| x.ClinicalDataSystemSet.CriterionEnumListStr.Contains(item); + Expression> typeExpression = x => x.ClinicalDataSystemSet == null || x.ClinicalDataSystemSet.CriterionEnumListStr.Contains(item); predicate = predicate.Or(typeExpression); - } - } - var trialClinicalDataList = await _clinicalDataTrialSetRepository.AsQueryable() + } + } + var trialClinicalDataList = await _clinicalDataTrialSetRepository.AsQueryable() .Where(x => x.TrialId == inDto.TrialId) .WhereIf(inDto.CriterionIds != null, predicate) .WhereIf(inDto.ClinicalDataLevel != null, x => x.ClinicalDataLevel == inDto.ClinicalDataLevel) .WhereIf(inDto.ClinicalUploadType != null, x => x.ClinicalUploadType == inDto.ClinicalUploadType) .WhereIf(inDto.ClinicalDataSetName != String.Empty, x => x.ClinicalDataSetName.Contains(inDto.ClinicalDataSetName)) .ProjectTo(_mapper.ConfigurationProvider, new - { - CriterionIds = inDto.CriterionIds + { + CriterionIds = inDto.CriterionIds - }).ToListAsync(); + }).ToListAsync(); return trialClinicalDataList; } - /// - /// 删除(项目) - /// - /// - /// - [HttpDelete("{id:guid}")] + /// + /// 删除(项目) + /// + /// + /// + [HttpDelete("{id:guid}")] public async Task DeleteClinicalTrialSetData(Guid id) { await _clinicalDataTrialSetRepository.DeleteFromQueryAsync(x => x.Id == id, true); @@ -355,7 +350,7 @@ namespace IRaCIS.Application.Services //不存在的时候,就将系统数据同步到项目临床数据配置 if (!await _clinicalDataTrialSetRepository.AnyAsync(x => x.TrialId == trialId && x.SystemClinicalDataSetId != null)) { - var systemClinicalDataList = await _clinicalDataSystemSetRepository.Where(x=>x.IsApply).AsQueryable().ToListAsync(); + var systemClinicalDataList = await _clinicalDataSystemSetRepository.Where(x => x.IsApply).AsQueryable().ToListAsync(); var systemIds = systemClinicalDataList.Select(x => x.Id).ToList(); var trialSystemClinicalDataSetIds = await _clinicalDataTrialSetRepository.Where(x => x.TrialId == trialId && x.SystemClinicalDataSetId != null).Select(x => x.SystemClinicalDataSetId.Value).ToListAsync(); @@ -365,7 +360,7 @@ namespace IRaCIS.Application.Services var systemDataList = systemClinicalDataList.Where(x => needAddids.Contains(x.Id)).ToList(); var readingCriterionList = _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId).Where(t => t.ReadingQuestionCriterionSystemId != null) - .Select(t => new { t.ReadingQuestionCriterionSystemId, TrialReadingCriterionId = t.Id ,t.CriterionType}).ToList(); + .Select(t => new { t.ReadingQuestionCriterionSystemId, TrialReadingCriterionId = t.Id, t.CriterionType }).ToList(); List dataSets = systemDataList.Select(x => new ClinicalDataTrialSet() @@ -375,7 +370,7 @@ namespace IRaCIS.Application.Services ClinicalDataSetName = x.ClinicalDataSetName, ClinicalDataLevel = x.ClinicalDataLevel, ClinicalUploadType = x.ClinicalUploadType, - ClinicalDataSetEnName=x.ClinicalDataSetEnName, + ClinicalDataSetEnName = x.ClinicalDataSetEnName, UploadRole = x.UploadRole, FileName = x.FileName, Path = x.Path, @@ -385,7 +380,7 @@ namespace IRaCIS.Application.Services //项目不采用 标准枚举字符串的方式 //CriterionEnumListStr=x.CriterionEnumListStr - TrialClinicalDataSetCriteriaList = readingCriterionList.Where(t => x.CriterionEnumList.Contains( (int )t.CriterionType)).Select(c => + TrialClinicalDataSetCriteriaList = readingCriterionList.Where(t => x.CriterionEnumList.Contains((int)t.CriterionType)).Select(c => new TrialClinicalDataSetCriterion() { TrialReadingCriterionId = c.TrialReadingCriterionId }).ToList() }).ToList(); diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs index 4c880a4ac..a84ce53b7 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ClinicalQuestionService.cs @@ -4,14 +4,12 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Infra.EFCore.Common; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; using MassTransit; -using IRaCIS.Core.Domain.Models; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -26,7 +24,7 @@ namespace IRaCIS.Core.Application.Service IRepository _trialClinicalTableQuestionRepository) : BaseService, IClinicalQuestionService { - + /// /// 获取问题计算关系 /// diff --git a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs index 2b1568116..7934e18eb 100644 --- a/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ClinicalData/ReadingClinicalDataService.cs @@ -1,20 +1,13 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Infra.EFCore.Common; -using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Service.Inspection.DTO; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -using Microsoft.Extensions.DependencyInjection; -using System.Linq.Expressions; -using IRaCIS.Core.Infrastructure; using System.Linq.Dynamic.Core; -using Microsoft.Extensions.Logging; -using IRaCIS.Core.Infrastructure.Extention; -using System.Linq; -using NPOI.SS.Formula.Functions; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 阅片临床数据 @@ -39,7 +32,7 @@ namespace IRaCIS.Application.Services IRepository _readingClinicalDataPDFRepository, IRepository _readingConsistentClinicalDataPDFRepository) : BaseService, IReadingClinicalDataService { - + #region 临床数据基本增删改 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs index bb6738c65..7f5c63f40 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalAnswerDto.cs @@ -1,9 +1,4 @@ using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -14,27 +9,27 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class DeleteStudyClinicalInDto - { - public Guid StudyId { get; set; } - } - - public class AddStudyClinicalInDto + public class DeleteStudyClinicalInDto { - public Guid StudyId { get; set; } - } + public Guid StudyId { get; set; } + } - public class AutoAddClinicalInDto + public class AddStudyClinicalInDto { - public Guid? SubjectId { get; set; } + public Guid StudyId { get; set; } + } - //public Guid? VisitId { get; set; } + public class AutoAddClinicalInDto + { + public Guid? SubjectId { get; set; } - public Guid TrialId { get; set; } - } + //public Guid? VisitId { get; set; } + + public Guid TrialId { get; set; } + } - public class GetCRCSubjectClinicalInDto:PageInput + public class GetCRCSubjectClinicalInDto : PageInput { public Guid TrialId { get; set; } @@ -46,25 +41,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetCRCSubjectClinicalOutDto { - public Guid SubjectId { get; set; } + public Guid SubjectId { get; set; } public Guid ReadingClinicalDataId { get; set; } - /// - /// 上传角色 - /// - public UploadRole UploadRole { get; set; } - public Guid TrialId { get; set; } + /// + /// 上传角色 + /// + public UploadRole UploadRole { get; set; } + public Guid TrialId { get; set; } - /// - /// 访视Id 或者模块Id - /// - public Guid ReadingId { get; set; } + /// + /// 访视Id 或者模块Id + /// + public Guid ReadingId { get; set; } - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } public Guid? BaseLineVisitId { get; set; } @@ -75,13 +70,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public ClinicalUploadType ClinicalUploadType { get; set; } public string SubjectCode { get; set; } - public Guid ClinicalDataTrialSetId { get; set; } + public Guid ClinicalDataTrialSetId { get; set; } public string ClinicalDataSetName { get; set; } - public string ClinicalDataSetEnName { get; set; } + public string ClinicalDataSetEnName { get; set; } - public int ClinicalCount { get; set; } = 0; + public int ClinicalCount { get; set; } = 0; } @@ -92,19 +87,19 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string SubjectCode { get; set; } public List ClinicalDataList { get; set; } - } + } - public class GetClinicalQuestionAnswerListInDto + public class GetClinicalQuestionAnswerListInDto { public Guid SubjectId { get; set; } - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - public Guid ClinicalDataTrialSetId { get; set; } + public Guid ClinicalDataTrialSetId { get; set; } } @@ -143,69 +138,69 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string Answer { get; set; } = string.Empty; } - public class GetPMConfirmListInDto: PageInput + public class GetPMConfirmListInDto : PageInput { public Guid TrialId { get; set; } public Guid TrialReadingCriterionId { get; set; } } - public class GetCRCConfirmListInDto:PageInput + public class GetCRCConfirmListInDto : PageInput { public bool? IsCRCConfirm { get; set; } - public bool? IsPMConfirm { get; set; } + public bool? IsPMConfirm { get; set; } public Guid? TrialReadingCriterionId { get; set; } - public Guid? SubjectId { get; set; } + public Guid? SubjectId { get; set; } public DateTime? StartTime { get; set; } public DateTime? EndTime { get; set; } public Guid TrialId { get; set; } - public Guid? ReadModuleId { get; set; } + public Guid? ReadModuleId { get; set; } public string? SubjectCode { get; set; } } public class CRCCancelConfirmClinicalInDto { - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - public Guid ReadModuleId { get; set; } - } + public Guid ReadModuleId { get; set; } + } - public class GetClinicalDateListOutDto - { - public string ClinicalDataSetName { get; set; } - - - public List DateList { get; set; } - } - - - public class GetCRCBeConfirmListInDto + public class GetClinicalDateListOutDto { - public Guid TrialId { get; set; } - - public Guid ReadModuleId { get; set; } - } + public string ClinicalDataSetName { get; set; } - public class GetClinicalTableListInDto - { - public Guid TrialId { get; set; } - - public Guid ReadModuleId { get; set; } - } + public List DateList { get; set; } + } - public class GetClinicalTableListOutDto: GetClinicalQuestionAnswerListOutDto - { - public string ClinicalDataSetName { get; set; } + public class GetCRCBeConfirmListInDto + { + public Guid TrialId { get; set; } + + public Guid ReadModuleId { get; set; } + } + + + public class GetClinicalTableListInDto + { + public Guid TrialId { get; set; } + + public Guid ReadModuleId { get; set; } + } + + + public class GetClinicalTableListOutDto : GetClinicalQuestionAnswerListOutDto + { + public string ClinicalDataSetName { get; set; } /// /// 模块名称 @@ -214,34 +209,34 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class GetCRCBeConfirm: GetCRCBeConfirmListOutDto - { - public Guid ReadModuleId { get; set; } - } - - - public class GetCRCBeConfirmListOutDto + public class GetCRCBeConfirm : GetCRCBeConfirmListOutDto { - public Guid ClinicalDataTrialSetId { get; set; } + public Guid ReadModuleId { get; set; } + } - public Guid ClinicalFormId { get; set; } - public string ClinicalDataSetName { get; set; } + public class GetCRCBeConfirmListOutDto + { + public Guid ClinicalDataTrialSetId { get; set; } - public string ClinicalDataSetEnName { get; set; } + public Guid ClinicalFormId { get; set; } + + public string ClinicalDataSetName { get; set; } + + public string ClinicalDataSetEnName { get; set; } public DateTime CheckDate { get; set; } - public bool IsHaveTableQuestion { get; set; } - } + public bool IsHaveTableQuestion { get; set; } + } - public class CRCConfirmClinicalInDto + public class CRCConfirmClinicalInDto { - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - public Guid SubjectId { get; set; } + public Guid SubjectId { get; set; } - public Guid ReadModuleId { get; set; } + public Guid ReadModuleId { get; set; } /// /// 临床数据是否完整 @@ -258,39 +253,39 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class CRCClinicalForm + public class CRCClinicalForm { - /// - /// 受试者Id - /// - public Guid SubjectId { get; set; } - public DateTime? CheckDate { get; set; } + /// + /// 受试者Id + /// + public Guid SubjectId { get; set; } + public DateTime? CheckDate { get; set; } public Guid ClinicalFormId { get; set; } - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } public Guid ClinicalDataTrialSetId { get; set; } - public string ClinicalDataSetName { get; set; } + public string ClinicalDataSetName { get; set; } - public bool IsHaveTableQuestion { get; set; } + public bool IsHaveTableQuestion { get; set; } - public string ClinicalDataSetEnName { get; set; } - } + public string ClinicalDataSetEnName { get; set; } + } - public class GetCRCConfirmListOutDto + public class GetCRCConfirmListOutDto { - /// - /// 受试者ID - /// - public Guid SubjectId { get; set; } + /// + /// 受试者ID + /// + public Guid SubjectId { get; set; } public bool IsNotNeedPMConfirm { get; set; } = false; public Guid ReadModuleId { get; set; } @@ -304,9 +299,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsPMConfirm { get; set; } - public ReadingSetType ReadingSetType { get; set; } + public ReadingSetType ReadingSetType { get; set; } - public bool IsCRCConfirm { get; set; } = false; + public bool IsCRCConfirm { get; set; } = false; /// @@ -316,17 +311,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string SubjectCode { get; set; } - public bool IsHaveTableQuestion - { - get - { - return ClinicalFormList.Any(x => x.IsHaveTableQuestion); - } - } - /// - /// 最晚拍片日期 - /// - public DateTime? LatestScanDate { get; set; } + public bool IsHaveTableQuestion + { + get + { + return ClinicalFormList.Any(x => x.IsHaveTableQuestion); + } + } + /// + /// 最晚拍片日期 + /// + public DateTime? LatestScanDate { get; set; } public List ClinicalNameList { @@ -339,20 +334,20 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List ClinicalFormList { get; set; } - public int FormCount - { - get - { - return this.ClinicalFormList.Count(); - } - } - } + public int FormCount + { + get + { + return this.ClinicalFormList.Count(); + } + } + } public class DeleteClinicalFormInDto { - public Guid ClinicalFormId { get; set; } - } - public class SubmitClinicalFormInDto + public Guid ClinicalFormId { get; set; } + } + public class SubmitClinicalFormInDto { /// /// VisitId @@ -361,13 +356,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? ClinicalFormId { get; set; } - public string? PicturePath { get; set; } + public string? PicturePath { get; set; } public Guid SubjectId { get; set; } - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - public Guid ClinicalDataTrialSetId { get; set; } + public Guid ClinicalDataTrialSetId { get; set; } public List QuestionAnswers { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs index 180f9eee2..1c29ada12 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalDataServiceViewModel.cs @@ -1,9 +1,4 @@ using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -23,15 +18,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string ClinicalDataSetName { get; set; } - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } /// @@ -44,12 +39,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public UploadRole UploadRole { get; set; } - public DateTime CreateTime { get; set; } + public DateTime CreateTime { get; set; } - /// - /// 是否启用 - /// - public bool IsEnable { get; set; } + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } /// /// 项目ID @@ -107,15 +102,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string ClinicalDataSetName { get; set; } - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } /// /// 上传角色 @@ -156,7 +151,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto - public class ClinicalDataTrialSetView: ClinicalDataTrialSetAddOrEdit + public class ClinicalDataTrialSetView : ClinicalDataTrialSetAddOrEdit { public List TrialCriterionNameList { get; set; } @@ -173,7 +168,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid? SystemClinicalDataSetId { get; set; } - + /// /// 是否来自于系统数据 @@ -240,12 +235,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string ClinicalDataSetName { get; set; } = string.Empty; - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - } + } public class GetTrialClinicalDataSystemIndto { /// @@ -253,15 +248,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string ClinicalDataSetName { get; set; } = String.Empty; - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 临床级别 - /// - public ClinicalLevel? ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel? ClinicalDataLevel { get; set; } /// @@ -293,15 +288,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string ClinicalDataSetName { get; set; } = String.Empty; - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 临床级别 - /// - public ClinicalLevel? ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel? ClinicalDataLevel { get; set; } /// diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs index a9c353b55..aed41b162 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ClinicalQuestionDto.cs @@ -1,11 +1,6 @@ using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -16,74 +11,74 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetTrialClinicalQuestionCalculateRelationInDto { - /// - /// 项目临床数据Id - /// - public Guid TrialClinicalId { get; set; } - } + /// + /// 项目临床数据Id + /// + public Guid TrialClinicalId { get; set; } + } public class GetTrialClinicalQuestionCalculateRelationOutDto { - public Guid QuestionId { get; set; } + public Guid QuestionId { get; set; } - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 自定义计算标记 - /// - public ClinicalCalculateMark? CustomCalculateMark { get; set; } + /// + /// 自定义计算标记 + /// + public ClinicalCalculateMark? CustomCalculateMark { get; set; } - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } - /// - /// 自定义单位 - /// - public string CustomUnit { get; set; } = string.Empty; + /// + /// 自定义单位 + /// + public string CustomUnit { get; set; } = string.Empty; - public List CalculateQuestionList { get; set; } - } + public List CalculateQuestionList { get; set; } + } - public class GetClinicalCalculateQuestionsOutDto + public class GetClinicalCalculateQuestionsOutDto { - public Guid QuestionId { get; set; } + public Guid QuestionId { get; set; } - public string QuestionName { get; set; } + public string QuestionName { get; set; } - public List TableQuestions { get; set; } - } + public List TableQuestions { get; set; } + } - public class GetClinicalCalculateQuestionsInDto + public class GetClinicalCalculateQuestionsInDto { - /// - /// 项目临床数据Id - /// - public Guid TrialClinicalId { get; set; } + /// + /// 项目临床数据Id + /// + public Guid TrialClinicalId { get; set; } /// /// 临床问题类型(分组,单选。) /// public string ClinicalQuestionType { get; set; } = string.Empty; - } - #endregion + } + #endregion - #region 预览 + #region 预览 - public class GetSystemClinicalQuestionPreviewDto + public class GetSystemClinicalQuestionPreviewDto { /// /// 系统临床数据Id @@ -119,17 +114,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List Childrens { get; set; } = new List(); - /// - /// 关联问题 - /// - public List RelationQuestions { get; set; } = new List(); + /// + /// 关联问题 + /// + public List RelationQuestions { get; set; } = new List(); - /// - /// 表格问题 - /// - public List TableQuestions { get; set; } = new List(); + /// + /// 表格问题 + /// + public List TableQuestions { get; set; } = new List(); - public List> TableAnswer { get; set; } + public List> TableAnswer { get; set; } } @@ -226,25 +221,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public int ShowOrder { get; set; } = 0; - /// - /// 是否必填 - /// - public IsRequired IsRequired { get; set; } + /// + /// 是否必填 + /// + public IsRequired IsRequired { get; set; } - /// - /// 关联Value - /// - public string RelevanceValue { get; set; } = string.Empty; + /// + /// 关联Value + /// + public string RelevanceValue { get; set; } = string.Empty; - /// - /// 关联ID - /// - public Guid? RelevanceId { get; set; } + /// + /// 关联ID + /// + public Guid? RelevanceId { get; set; } - /// - /// 父问题Id - /// - public Guid? ParentId { get; set; } + /// + /// 父问题Id + /// + public Guid? ParentId { get; set; } /// /// 父问题触发值 @@ -271,36 +266,36 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string Unit { get; set; } = string.Empty; - /// - /// 自定义计算标记 - /// - public ClinicalCalculateMark? CustomCalculateMark { get; set; } + /// + /// 自定义计算标记 + /// + public ClinicalCalculateMark? CustomCalculateMark { get; set; } - /// - /// 自定义计算问题 - /// - public string CalculateQuestions { get; set; } = "[]"; + /// + /// 自定义计算问题 + /// + public string CalculateQuestions { get; set; } = "[]"; - [NotMapped] - public List CalculateQuestionList - { - get - { + [NotMapped] + public List CalculateQuestionList + { + get + { - try - { - var result = JsonConvert.DeserializeObject>(this.CalculateQuestions); - return result == null ? new List() : result; - } - catch (Exception) - { + try + { + var result = JsonConvert.DeserializeObject>(this.CalculateQuestions); + return result == null ? new List() : result; + } + catch (Exception) + { - return new List(); - } + return new List(); + } - } - } - } + } + } + } /// /// 查询临床数据基类 @@ -433,15 +428,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public int ShowOrder { get; set; } - /// - /// 是否必填 - /// - public IsRequired IsRequired { get; set; } + /// + /// 是否必填 + /// + public IsRequired IsRequired { get; set; } - /// - /// 创建时间 - /// - public DateTime CreateTime { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } /// /// 创建人 @@ -519,7 +514,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid SystemClinicalId { get; set; } } - + /// @@ -543,7 +538,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public class TrialClinicalTableQuestionQuery : ClinicalTableQuestionQueryBase { - + } /// @@ -551,7 +546,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public class SystemClinicalTableQuestionQuery : ClinicalTableQuestionQueryBase { - + } #endregion diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/DefaultShortcutKeyViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/DefaultShortcutKeyViewModel.cs index 1157a2b70..1896c7e6c 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/DefaultShortcutKeyViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/DefaultShortcutKeyViewModel.cs @@ -3,80 +3,77 @@ // 生成时间 2023-02-13 10:38:12 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel -{ - /// DefaultShortcutKeyView 列表视图模型 - public class DefaultShortcutKeyView - { - public Guid Id { get; set; } - public string Keyboardkey { get; set; } - public int ShortcutKeyEnum { get; set; } - public int ImageToolType { get; set; } - public bool AltKey { get; set; } - - public bool CtrlKey { get; set; } - - public bool ShiftKey { get; set; } - - public bool MetaKey { get; set; } +{ + /// DefaultShortcutKeyView 列表视图模型 + public class DefaultShortcutKeyView + { + public Guid Id { get; set; } + public string Keyboardkey { get; set; } + public int ShortcutKeyEnum { get; set; } + public int ImageToolType { get; set; } + public bool AltKey { get; set; } - public string Text { get; set; } + public bool CtrlKey { get; set; } - public string Code { get; set; } = string.Empty; - } + public bool ShiftKey { get; set; } - public class RestoreDefaultShortcutKeyInDto - { - public int ImageToolType { get; set; } - } + public bool MetaKey { get; set; } - public class SetDefaultShortcutKey - { - public int ImageToolType { get; set; } + public string Text { get; set; } - public List ShortcutKeyList { get; set; } - } + public string Code { get; set; } = string.Empty; + } - public class DefaultShortcutKeyItem - { - public string Keyboardkey { get; set; } - public int ShortcutKeyEnum { get; set; } + public class RestoreDefaultShortcutKeyInDto + { + public int ImageToolType { get; set; } + } - public bool AltKey { get; set; } + public class SetDefaultShortcutKey + { + public int ImageToolType { get; set; } + + public List ShortcutKeyList { get; set; } + } + + public class DefaultShortcutKeyItem + { + public string Keyboardkey { get; set; } + public int ShortcutKeyEnum { get; set; } + + public bool AltKey { get; set; } - public string Text { get; set; } + public string Text { get; set; } - public bool CtrlKey { get; set; } + public bool CtrlKey { get; set; } - public bool ShiftKey { get; set; } + public bool ShiftKey { get; set; } - public bool MetaKey { get; set; } - public string Code { get; set; } = string.Empty; - } + public bool MetaKey { get; set; } + public string Code { get; set; } = string.Empty; + } - ///DefaultShortcutKeyQuery 列表查询参数模型 - public class DefaultShortcutKeyQuery - { - public int ImageToolType { get; set; } + ///DefaultShortcutKeyQuery 列表查询参数模型 + public class DefaultShortcutKeyQuery + { + public int ImageToolType { get; set; } - public int? ShortcutKeyEnum { get; set; } - } + public int? ShortcutKeyEnum { get; set; } + } + + /// DefaultShortcutKeyAddOrEdit 列表查询参数模型 + public class DefaultShortcutKeyAddOrEdit + { + public Guid Id { get; set; } + public string Keyboardkey { get; set; } + public int ShortcutKeyEnum { get; set; } + public int ImageToolType { get; set; } + } - /// DefaultShortcutKeyAddOrEdit 列表查询参数模型 - public class DefaultShortcutKeyAddOrEdit - { - public Guid Id { get; set; } - public string Keyboardkey { get; set; } - public int ShortcutKeyEnum { get; set; } - public int ImageToolType { get; set; } - } - } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs index e02ce0652..083383a66 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/GetReadModuleDto.cs @@ -1,11 +1,6 @@ using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -15,12 +10,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? SubjectId { get; set; } - public CompleteClinicalDataEnum? CompleteClinicalData { get; set; } + public CompleteClinicalDataEnum? CompleteClinicalData { get; set; } - /// - /// 项目中心Code - /// - public string? TrialSiteCode { get; set; } + /// + /// 项目中心Code + /// + public string? TrialSiteCode { get; set; } /// /// 受试者Code @@ -221,10 +216,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 状态 /// - public ReadingStatusEnum Status { get; set; } + public ReadingStatusEnum Status { get; set; } } - + public class GetReadModuleResultDto @@ -302,12 +297,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } public class ReadMoudleView - { + { public Guid Id { get; set; } - + public string Name { get; set; } - - public Guid SubjectId { get; set; } + + public Guid SubjectId { get; set; } public ModuleTypeEnum ModuleType { get; set; } @@ -331,7 +326,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string? ReadModuleName { get; set; } - public DateTime CreateTime { get; set; } + public DateTime CreateTime { get; set; } public bool IsVisit { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs index 2c894b22d..9a611b332 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/OrganInfoViewModel.cs @@ -3,9 +3,7 @@ // 生成时间 2022-08-12 14:07:12 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel @@ -36,14 +34,14 @@ namespace IRaCIS.Core.Application.ViewModel public DicDataTypeEnum DataTypeEnum { get; set; } - + public string Value { get; set; } = string.Empty; - + public string ValueCN { get; set; } = string.Empty; - + public string Description { get; set; } = string.Empty; public int ShowOrder { get; set; } @@ -69,8 +67,8 @@ namespace IRaCIS.Core.Application.ViewModel { public Guid? SystemCriterionId { get; set; } - public Guid? TrialCriterionId { get; set; } - } + public Guid? TrialCriterionId { get; set; } + } ///CriterionNidusQuery 列表查询参数模型 public class CriterionNidusQuery @@ -160,14 +158,14 @@ namespace IRaCIS.Core.Application.ViewModel /// public string PartEN { get; set; } = string.Empty; - + /// /// TULOC 英文 /// public string TULOCEN { get; set; } = string.Empty; - + /// @@ -196,18 +194,18 @@ namespace IRaCIS.Core.Application.ViewModel public class GetTrialSelectOrganListInDto { public Guid TrialId { get; set; } - + } public class CriterionNidusData : CriterionNidusSystem - { + { public Guid OriginalId { get; set; } } public class SynchronizeSystemOrganInDto { - [NotDefault] + [NotDefault] public Guid FromCriterionId { get; set; } [NotDefault] public Guid ToCriterionId { get; set; } @@ -219,7 +217,7 @@ namespace IRaCIS.Core.Application.ViewModel public Guid TrialReadingCriterionId { get; set; } - + public Guid? SystemCriterionId { get; set; } } @@ -370,7 +368,7 @@ namespace IRaCIS.Core.Application.ViewModel /// public string TULOCEN { get; set; } = string.Empty; - + /// /// 位置 英文 @@ -380,7 +378,7 @@ namespace IRaCIS.Core.Application.ViewModel } ///OrganInfoQuery 列表查询参数模型 - public class OrganInfoQuery:PageInput + public class OrganInfoQuery : PageInput { /// @@ -467,14 +465,14 @@ namespace IRaCIS.Core.Application.ViewModel /// public string PartEN { get; set; } = string.Empty; - + /// /// TULOC 英文 /// public string TULOCEN { get; set; } = string.Empty; - + /// diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/PreviousPDFViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/PreviousPDFViewModel.cs index 99f29a558..b309f1e01 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/PreviousPDFViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/PreviousPDFViewModel.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace IRaCIS.Core.Application.Service.Reading.Dto +namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -32,7 +26,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid? TrialId { get; set; } - + /// /// 页码 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs index e9824555b..cdba58330 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingCalculateViewModel.cs @@ -3,10 +3,7 @@ // 生成时间 2022-08-22 09:36:37 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; -using System.Reflection.Metadata.Ecma335; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -14,29 +11,29 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetIsSuvMaxLesionInDto { public Guid VisitTaskId { get; set; } - public Guid RowId { get; set; } - } + public Guid RowId { get; set; } + } - public class GetIsSuvMaxLesionOutDto - { - public bool IsSuvMaxLesion { get; set; } - } + public class GetIsSuvMaxLesionOutDto + { + public bool IsSuvMaxLesion { get; set; } + } public class GetCanChooseNotMergeInDto { - public Guid VisitTaskId { get; set; } - } + public Guid VisitTaskId { get; set; } + } - public class GetCanChooseNotMergeOutDto - { - public bool IsCanChooseNotMerge { get; set; } - } + public class GetCanChooseNotMergeOutDto + { + public bool IsCanChooseNotMerge { get; set; } + } - public class GetPPDInfoInDto + public class GetPPDInfoInDto { public Guid VisitTaskId { get; set; } - public Guid QuestionId { get; set; } + public Guid QuestionId { get; set; } public decimal RowIndex { get; set; } @@ -69,7 +66,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid VisitTaskId { get; set; } - + public bool IsChangeOtherTask { get; set; } public ComputationTrigger ComputationTrigger { get; set; } @@ -210,9 +207,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsConvertedTask { get; set; } - public Guid? BeforeConvertedTaskId { get; set; } + public Guid? BeforeConvertedTaskId { get; set; } - public bool IsAnalysisCreate { get; set; } + public bool IsAnalysisCreate { get; set; } public bool? IsSelfAnalysis { get; set; } @@ -221,7 +218,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// TrialReadingCriterionId /// - public Guid TrialReadingCriterionId { get; set; } + public Guid TrialReadingCriterionId { get; set; } public string VisitName { get; set; } @@ -243,7 +240,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Arm ArmEnum { get; set; } - public ComputationTrigger ComputationTrigger { get; set; } + public ComputationTrigger ComputationTrigger { get; set; } /// /// 是否修改其他任务 @@ -306,7 +303,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public decimal FristAddTaskNum { get; set; } - public string? OtherMeasureData { get; set; } + public string? OtherMeasureData { get; set; } public string? MeasureData { get; set; } public List TableQuestionList { get; set; } = new List(); @@ -374,7 +371,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public QuestionType QuestionType { get; set; } - public List ComputationTriggerList { get; set; }=new List(); + public List ComputationTriggerList { get; set; } = new List(); public Func> GetDecimalFun { get; set; } @@ -384,7 +381,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Func> GetStringFun { get; set; } - public Func ChangeAllTaskFun { get; set; } + public Func ChangeAllTaskFun { get; set; } public bool? IsConvertedTask { get; set; } @@ -393,7 +390,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public bool IsBeTransforming { get; set; } = false; - } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs index d9e1ae23e..eb18ccd1f 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingClinicalDataDto.cs @@ -1,23 +1,18 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { - public class SetTaskValidInDto - { + public class SetTaskValidInDto + { public Guid VisitTaskId { get; set; } } public class SignConsistencyAnalysisReadingClinicalDataInDto - { - public Guid ConsistentClinicalDataId { get; set; } + { + public Guid ConsistentClinicalDataId { get; set; } /// /// 是否盲化 @@ -33,114 +28,114 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class AddOrUpdateReadingClinicalDataDto - { + { - public Guid? Id { get; set; } + public Guid? Id { get; set; } - public Guid? StudyId { get; set; } + public Guid? StudyId { get; set; } - /// - /// 项目ID - /// - public Guid TrialId { get; set; } + /// + /// 项目ID + /// + public Guid TrialId { get; set; } - /// - /// 受试者ID - /// - public Guid SubjectId { get; set; } + /// + /// 受试者ID + /// + public Guid SubjectId { get; set; } - /// - /// 阅片ID - /// - public Guid ReadingId { get; set; } + /// + /// 阅片ID + /// + public Guid ReadingId { get; set; } - /// - /// 临床数据类型Id - /// - public Guid ClinicalDataTrialSetId { get; set; } + /// + /// 临床数据类型Id + /// + public Guid ClinicalDataTrialSetId { get; set; } - /// - /// 是否是访视 - /// - public bool IsVisit { get; set; } + /// + /// 是否是访视 + /// + public bool IsVisit { get; set; } - ///// - ///// 是否盲化 - ///// - //public bool IsBlind { get; set; } + ///// + ///// 是否盲化 + ///// + //public bool IsBlind { get; set; } - ///// - ///// 是否完整 - ///// - //public bool IsComplete { get; set; } + ///// + ///// 是否完整 + ///// + //public bool IsComplete { get; set; } - /// - /// 要删除的对象 - /// + /// + /// 要删除的对象 + /// - public List DeleteFileIds { get; set; } = new List(); + public List DeleteFileIds { get; set; } = new List(); - public List AddFileList { get; set; } = new List(); - } + public List AddFileList { get; set; } = new List(); + } - public class GetCRCClinicalDataOutDto - { + public class GetCRCClinicalDataOutDto + { - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// 名称 - /// - public Guid ClinicalDataTrialSetId { get; set; } + /// + /// 名称 + /// + public Guid ClinicalDataTrialSetId { get; set; } - /// - /// 名称 - /// - public string ClinicalDataSetName { get; set; } + /// + /// 名称 + /// + public string ClinicalDataSetName { get; set; } - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 上传方式 - /// - public ClinicalUploadType ClinicalUploadType { get; set; } + /// + /// 上传方式 + /// + public ClinicalUploadType ClinicalUploadType { get; set; } - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } - /// - /// 上传角色 - /// - public UploadRole UploadRole { get; set; } + /// + /// 上传角色 + /// + public UploadRole UploadRole { get; set; } - /// - /// 模板文件名称 - /// - public string FileName { get; set; } + /// + /// 模板文件名称 + /// + public string FileName { get; set; } - /// - /// 文件路径 - /// - public string Path { get; set; } + /// + /// 文件路径 + /// + public string Path { get; set; } - /// - /// 是否盲化 - /// - public bool? IsBlind { get; set; } + /// + /// 是否盲化 + /// + public bool? IsBlind { get; set; } - /// - /// 是否完整 - /// - public bool? IsComplete { get; set; } + /// + /// 是否完整 + /// + public bool? IsComplete { get; set; } public List ClinicalFromList { get; set; } @@ -148,29 +143,29 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List PDFFileList { get; set; } = new List(); - public ClinicalDataTable ClinicalTableData { get; set; } - } + public ClinicalDataTable ClinicalTableData { get; set; } + } - public class ClinicalDataTable - { - public List PreviousHistoryList { get; set; } + public class ClinicalDataTable + { + public List PreviousHistoryList { get; set; } - public List PreviousOtherList { get; set; } + public List PreviousOtherList { get; set; } - public List PreviousSurgeryList { get; set; } + public List PreviousSurgeryList { get; set; } - } + } - public class GetStudyClinicalDataInDto - { - public Guid SubjectVisitId { get; set; } - } + public class GetStudyClinicalDataInDto + { + public Guid SubjectVisitId { get; set; } + } - public class GetCRCClinicalDataInDto - { - public Guid SubjectVisitId { get; set; } + public class GetCRCClinicalDataInDto + { + public Guid SubjectVisitId { get; set; } public Guid TrialId { get; set; } @@ -181,59 +176,59 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsBaseline { get; set; } - public Guid? StudyId { get; set; } + public Guid? StudyId { get; set; } - public bool FilterNoneForm { get; set; } = false; + public bool FilterNoneForm { get; set; } = false; - } + } - /// - /// 是否盲化 - /// - public class SetReadingClinicalDataIsBlind - { - public Guid Id { get; set; } + /// + /// 是否盲化 + /// + public class SetReadingClinicalDataIsBlind + { + public Guid Id { get; set; } - public bool IsBlind { get; set; } - } + public bool IsBlind { get; set; } + } - public class FileDto - { - /// - /// 文件名称 - /// - public string FileName { get; set; } + public class FileDto + { + /// + /// 文件名称 + /// + public string FileName { get; set; } - /// - /// 路径 - /// - public string Path { get; set; } + /// + /// 路径 + /// + public string Path { get; set; } /// /// 大小 /// public int Size { get; set; } = 0; - /// - /// 文件类型 - /// - public string Type { get; set; } = string.Empty; + /// + /// 文件类型 + /// + public string Type { get; set; } = string.Empty; } - public class GetReadingOrTaskClinicalDataListInDto - { + public class GetReadingOrTaskClinicalDataListInDto + { public Guid? TrialReadingCriterionId { get; set; } [NotDefault] - public Guid SubjectId { get; set; } + public Guid SubjectId { get; set; } - [NotDefault] - public Guid TrialId { get; set; } + [NotDefault] + public Guid TrialId { get; set; } - public Guid? ReadingId { get; set; } + public Guid? ReadingId { get; set; } /// /// 临床数据类型Id @@ -249,25 +244,25 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? ReadingClinicalDataId { get; set; } - /// - /// 只获取CRC上传的阅片模块结构化录入 - /// - public bool IsOnlyGetCRCReadModule { get; set; } = false; + /// + /// 只获取CRC上传的阅片模块结构化录入 + /// + public bool IsOnlyGetCRCReadModule { get; set; } = false; /// /// 只查询已经签名的临床数据 /// public bool SelectIsSign { get; set; } = true; - /// - /// 是否查询所有的一致性分析临床数据 (为否只查询PDF) - /// - public bool IsGetAllConsistencyAnalysis { get; set; } = true; + /// + /// 是否查询所有的一致性分析临床数据 (为否只查询PDF) + /// + public bool IsGetAllConsistencyAnalysis { get; set; } = true; } - public class GetConsistencyAnalysisReadingClinicalDataListInDto - { + public class GetConsistencyAnalysisReadingClinicalDataListInDto + { [NotDefault] public Guid SubjectId { get; set; } [NotDefault] @@ -281,11 +276,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 获取访视列表 /// public class GetReadingClinicalDataListIndto - { - [NotDefault] - public Guid SubjectId { get; set; } - [NotDefault] - public Guid ReadingId { get; set; } + { + [NotDefault] + public Guid SubjectId { get; set; } + [NotDefault] + public Guid ReadingId { get; set; } /// /// 临床数据类型Id @@ -298,110 +293,110 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public GetClinicalType? GetClinicalType { get; set; } [NotDefault] - public Guid TrialReadingCriterionId { get; set; } + public Guid TrialReadingCriterionId { get; set; } - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - /// - /// 是否是访视 - /// - public bool IsVisit { get; set; } + /// + /// 是否是访视 + /// + public bool IsVisit { get; set; } - /// - /// 是否是基线 - /// - public bool IsBaseLine { get; set; } - } + /// + /// 是否是基线 + /// + public bool IsBaseLine { get; set; } + } - public class GetReadingClinicalDataPDFListIndto : PageInput - { - public Guid ReadingClinicalDataId { get; set; } - } + public class GetReadingClinicalDataPDFListIndto : PageInput + { + public Guid ReadingClinicalDataId { get; set; } + } - public class GetReadingClinicalDataPDFListOutDto - { - public Guid? Id { get; set; } + public class GetReadingClinicalDataPDFListOutDto + { + public Guid? Id { get; set; } - /// - /// 阅片临床数据ID - /// - public Guid ReadingClinicalDataId { get; set; } + /// + /// 阅片临床数据ID + /// + public Guid ReadingClinicalDataId { get; set; } - /// - /// Path - /// - public string Path { get; set; } + /// + /// Path + /// + public string Path { get; set; } - /// - /// FileName - /// - public string FileName { get; set; } + /// + /// FileName + /// + public string FileName { get; set; } - /// - /// 是否为访视 - /// - public bool IsVisit { get; set; } + /// + /// 是否为访视 + /// + public bool IsVisit { get; set; } - } + } - public class AddOrUpdateReadingClinicalDataPDFDto - { + public class AddOrUpdateReadingClinicalDataPDFDto + { - public Guid? Id { get; set; } + public Guid? Id { get; set; } - /// - /// 阅片临床数据ID - /// - public Guid ReadingClinicalDataId { get; set; } + /// + /// 阅片临床数据ID + /// + public Guid ReadingClinicalDataId { get; set; } - /// - /// Path - /// - public string Path { get; set; } + /// + /// Path + /// + public string Path { get; set; } - /// - /// FileName - /// - public string FileName { get; set; } + /// + /// FileName + /// + public string FileName { get; set; } - /// - /// 是否为访视 - /// - public bool IsVisit { get; set; } - } + /// + /// 是否为访视 + /// + public bool IsVisit { get; set; } + } - public class PMClinicalDataConfirmCommand - { - public Guid Id { get; set; } + public class PMClinicalDataConfirmCommand + { + public Guid Id { get; set; } - /// - /// 是否盲化 - /// - public bool? IsBlind { get; set; } + /// + /// 是否盲化 + /// + public bool? IsBlind { get; set; } - /// - /// 是否完整 - /// - public bool? IsComplete { get; set; } + /// + /// 是否完整 + /// + public bool? IsComplete { get; set; } - } + } - public class GetReadingClinicalDataListOutDto - { + public class GetReadingClinicalDataListOutDto + { - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// 访视Id 或者模块Id - /// - public Guid ReadingId { get; set; } + /// + /// 访视Id 或者模块Id + /// + public Guid ReadingId { get; set; } /// /// CRC是否正在申请撤回 @@ -416,133 +411,133 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string ClinicalDataSetName { get; set; } - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 下拉ID - /// - public Guid ClinicalDataTrialSetId { get; set; } + /// + /// 下拉ID + /// + public Guid ClinicalDataTrialSetId { get; set; } - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } - /// - /// 上传角色 - /// - public UploadRole UploadRole { get; set; } + /// + /// 上传角色 + /// + public UploadRole UploadRole { get; set; } - public Guid SubjectId { get; set; } + public Guid SubjectId { get; set; } - /// - /// 上传方式 - /// - public ClinicalUploadType ClinicalUploadType { get; set; } + /// + /// 上传方式 + /// + public ClinicalUploadType ClinicalUploadType { get; set; } - /// - /// 标准枚举 - /// - public List CriterionEnumList { get; set; } + /// + /// 标准枚举 + /// + public List CriterionEnumList { get; set; } - /// - /// 临床级别名称 - /// - public string ClinicalDataLevelName { get; set; } + /// + /// 临床级别名称 + /// + public string ClinicalDataLevelName { get; set; } - /// - /// 上传方式名称 - /// - public string ClinicalUploadTypeName { get; set; } + /// + /// 上传方式名称 + /// + public string ClinicalUploadTypeName { get; set; } - /// - /// 是否为CRC上传 - /// - public bool IsCRCUpload { get; set; } + /// + /// 是否为CRC上传 + /// + public bool IsCRCUpload { get; set; } - public bool IsNeedMerge { get; set; } = false; + public bool IsNeedMerge { get; set; } = false; - public Guid ReadModuleId { get; set; } + public Guid ReadModuleId { get; set; } - /// - /// 是否签名 - /// - public bool IsSign { get; set; } + /// + /// 是否签名 + /// + public bool IsSign { get; set; } - /// - /// 是否盲化 - /// - public bool? IsBlind { get; set; } + /// + /// 是否盲化 + /// + public bool? IsBlind { get; set; } - /// - /// 是否完整 - /// - public bool? IsComplete { get; set; } + /// + /// 是否完整 + /// + public bool? IsComplete { get; set; } - //临床数据状态 - public ReadingClinicalDataStatus ReadingClinicalDataState { get; set; } + //临床数据状态 + public ReadingClinicalDataStatus ReadingClinicalDataState { get; set; } - /// - /// 文件数量 - /// - public int FileCount { get; set; } - //{ - // get - // { - // return this.FileList.Count(); - // } - //} + /// + /// 文件数量 + /// + public int FileCount { get; set; } + //{ + // get + // { + // return this.FileList.Count(); + // } + //} - public List ClinicalFromList { get; set; } + public List ClinicalFromList { get; set; } - public List FileList { get; set; } = new List(); + public List FileList { get; set; } = new List(); - public ClinicalDataTable ClinicalTableData { get; set; } + public ClinicalDataTable ClinicalTableData { get; set; } - public List TrialClinicalDataSetCriteriaList { get; set; } - } + public List TrialClinicalDataSetCriteriaList { get; set; } + } - public class ClinicalFromData - { - /// - /// 表单Id - /// - public Guid ClinicalFormId { get; set; } + public class ClinicalFromData + { + /// + /// 表单Id + /// + public Guid ClinicalFormId { get; set; } - /// - /// 检查日期 - /// - public DateTime? CheckDate { get; set; } - } + /// + /// 检查日期 + /// + public DateTime? CheckDate { get; set; } + } - public class GetFileDto - { + public class GetFileDto + { - /// - /// Id - /// + /// + /// Id + /// - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Path - /// + /// + /// Path + /// - public string Path { get; set; } + public string Path { get; set; } - /// - /// FileName - /// - - public string FileName { get; set; } + /// + /// FileName + /// + + public string FileName { get; set; } /// @@ -559,99 +554,99 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// 上传时间 /// public DateTime CreateTime { get; set; } - } + } - public class GetTrialClinicalDataSelectIndto - { - /// - /// 项目ID - /// - [NotDefault] - public Guid TrialId { get; set; } + public class GetTrialClinicalDataSelectIndto + { + /// + /// 项目ID + /// + [NotDefault] + public Guid TrialId { get; set; } - /// - /// 阅片期临床数据ID - /// - public Guid? ReadingClinicalDataId { get; set; } + /// + /// 阅片期临床数据ID + /// + public Guid? ReadingClinicalDataId { get; set; } - /// - /// 对象ID - /// - public Guid? ReadingId { get; set; } + /// + /// 对象ID + /// + public Guid? ReadingId { get; set; } - public Guid? SubjectId { get; set; } + public Guid? SubjectId { get; set; } - /// - /// 是否是访视 - /// - public bool IsVisit { get; set; } + /// + /// 是否是访视 + /// + public bool IsVisit { get; set; } - /// - /// 是否是基线 - /// - public bool IsBaseLine { get; set; } + /// + /// 是否是基线 + /// + public bool IsBaseLine { get; set; } - /// - /// 上传角色 - /// - public UploadRole? UploadRole { get; set; } + /// + /// 上传角色 + /// + public UploadRole? UploadRole { get; set; } - public Guid? TrialReadingCriterionId { get; set; } - } + public Guid? TrialReadingCriterionId { get; set; } + } - public class GetTrialClinicalDataSelectOutDto - { + public class GetTrialClinicalDataSelectOutDto + { - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// 名称 - /// - public string ClinicalDataSetName { get; set; } + /// + /// 名称 + /// + public string ClinicalDataSetName { get; set; } - /// - /// 英文名称 - /// - public string ClinicalDataSetEnName { get; set; } = string.Empty; + /// + /// 英文名称 + /// + public string ClinicalDataSetEnName { get; set; } = string.Empty; - /// - /// 临床级别 - /// - public ClinicalLevel ClinicalDataLevel { get; set; } + /// + /// 临床级别 + /// + public ClinicalLevel ClinicalDataLevel { get; set; } - /// - /// 上传方式 - /// - public ClinicalUploadType ClinicalUploadType { get; set; } + /// + /// 上传方式 + /// + public ClinicalUploadType ClinicalUploadType { get; set; } - /// - /// 临床级别名称 - /// - public string ClinicalDataLevelName { get; set; } + /// + /// 临床级别名称 + /// + public string ClinicalDataLevelName { get; set; } - /// - /// 上传方式名称 - /// - public string ClinicalUploadTypeName { get; set; } + /// + /// 上传方式名称 + /// + public string ClinicalUploadTypeName { get; set; } - /// - /// 模板文件名称 - /// - public string FileName { get; set; } + /// + /// 模板文件名称 + /// + public string FileName { get; set; } - /// - /// 文件路径 - /// - public string Path { get; set; } + /// + /// 文件路径 + /// + public string Path { get; set; } - public List CriterionEnumList { get; set; } + public List CriterionEnumList { get; set; } - } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs index 596f14cf0..681b950f4 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingImageTaskViewModel.cs @@ -1,13 +1,6 @@ using IRaCIS.Core.Domain.Share; -using MassTransit; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -37,7 +30,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 文件类型 /// - public string FileType { get; set; }=string.Empty; + public string FileType { get; set; } = string.Empty; public Guid QuestionId { get; set; } public Guid TableQuestionId { get; set; } @@ -91,7 +84,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsCanEditPosition { get; set; } = false; - public string BlindName { get; set; } + public string BlindName { get; set; } public Guid? RowId { get; set; } @@ -119,12 +112,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 序号标记 /// - public string? OrderMark { get; set; } + public string? OrderMark { get; set; } /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 自定义单位 @@ -148,7 +141,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string HighlightAnswer { get; set; } = "[]"; public List HighlightAnswerList { get; set; } = new List(); - + /// /// 问题英文分组 @@ -185,8 +178,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetReadingReportEvaluationOutDto { - public object ReportCalculateResult{ get; set; } - + public object ReportCalculateResult { get; set; } + public GetReportVerifyOutDto CalculateResult { get; set; } public ReadingTaskState ReadingTaskState { get; set; } @@ -196,15 +189,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List LesionCountList { get; set; } = new List(); - } + } public class LesionDto - { - public LesionType? LesionType { get; set; } + { + public LesionType? LesionType { get; set; } public int Count { get; set; } - } + } public class VisitTaskGroupAnswerDto @@ -225,7 +218,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int ShowOrder { get; set; } - + public List QuestionList = new List(); } @@ -270,7 +263,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string QuestionName { get; set; } - + public int ShowOrder { get; set; } @@ -306,98 +299,98 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class GetCanMergeLesionOutDto - { - public Guid RowId { get; set; } + public class GetCanMergeLesionOutDto + { + public Guid RowId { get; set; } public string? OrderMarkName { get; set; } - public Guid? OrganInfoId { get; set; } + public Guid? OrganInfoId { get; set; } - public decimal RowIndex { get; set; } + public decimal RowIndex { get; set; } public string Part { get; set; } - } + } - public class GetCanMergeLesionInDto + public class GetCanMergeLesionInDto { - public Guid RowId { get; set; } - } + public Guid RowId { get; set; } + } public class TableQuestionAnswerInfo { - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// 问题标识 - /// - public QuestionMark? QuestionMark { get; set; } + /// + /// 问题标识 + /// + public QuestionMark? QuestionMark { get; set; } - /// - /// 问题Id - /// + /// + /// 问题Id + /// - public Guid QuestionId { get; set; } + public Guid QuestionId { get; set; } - /// - /// 表格问题Id - /// - public Guid TableQuestionId { get; set; } + /// + /// 表格问题Id + /// + public Guid TableQuestionId { get; set; } - /// - /// 任务Id - /// - public Guid VisitTaskId { get; set; } + /// + /// 任务Id + /// + public Guid VisitTaskId { get; set; } - /// - /// 项目Id - /// - public Guid TrialId { get; set; } + /// + /// 项目Id + /// + public Guid TrialId { get; set; } - /// - /// 行号 - /// - public decimal RowIndex { get; set; } + /// + /// 行号 + /// + public decimal RowIndex { get; set; } - /// - /// 答案 - /// - public string Answer { get; set; } + /// + /// 答案 + /// + public string Answer { get; set; } - /// - /// 创建时间 - /// - public DateTime CreateTime { get; set; } + /// + /// 创建时间 + /// + public DateTime CreateTime { get; set; } - /// - /// 创建人 - /// - public Guid CreateUserId { get; set; } + /// + /// 创建人 + /// + public Guid CreateUserId { get; set; } - /// - /// RowId - /// - public Guid RowId { get; set; } + /// + /// RowId + /// + public Guid RowId { get; set; } - public Guid UpdateUserId { get; set; } - public DateTime UpdateTime { get; set; } + public Guid UpdateUserId { get; set; } + public DateTime UpdateTime { get; set; } - public bool IsDeleted { get; set; } + public bool IsDeleted { get; set; } - public DateTime? DeletedTime { get; set; } + public DateTime? DeletedTime { get; set; } - public Guid? DeleteUserId { get; set; } - } - public class MergeLesionInDto + public Guid? DeleteUserId { get; set; } + } + public class MergeLesionInDto { public Guid VisitTaskId { get; set; } public Guid QuestionId { get; set; } - + /// /// 融合的主病灶 /// @@ -409,7 +402,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List MergeRowIdList { get; set; } - } + } public class SplitLesionInDto { @@ -444,36 +437,36 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetPreviousOtherPicturePathOutDto { - public Guid VisitTaskId { get; set; } + public Guid VisitTaskId { get; set; } public string? PicturePath { get; set; } - public string TaskBlindName { get; set; } = string.Empty; + public string TaskBlindName { get; set; } = string.Empty; - } + } - public class GetPreviousOtherPicturePathInDto + public class GetPreviousOtherPicturePathInDto { - public Guid? RowId { get; set; } + public Guid? RowId { get; set; } public Guid? VisitTaskId { get; set; } - /// - /// 问题类型 - /// - public QuestionType? QuestionType { get; set; } - } + /// + /// 问题类型 + /// + public QuestionType? QuestionType { get; set; } + } - public class GetReadingCalculationDataInDto + public class GetReadingCalculationDataInDto { - /// - /// 任务Id - /// - public Guid VisitTaskId { get; set; } - } + /// + /// 任务Id + /// + public Guid VisitTaskId { get; set; } + } - public class ReadingCustomTagDto + public class ReadingCustomTagDto { public Guid? Id { get; set; } @@ -515,30 +508,30 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int? NumberOfFrames { get; set; } } - public class GetManualListInDto + public class GetManualListInDto { - public Guid TrialId { get; set; } - } + public Guid TrialId { get; set; } + } - public class GetManualListOutDto - { + public class GetManualListOutDto + { - public Guid Id { get; set; } + public Guid Id { get; set; } - /// - /// Name - /// - public string Name { get; set; } = string.Empty; + /// + /// Name + /// + public string Name { get; set; } = string.Empty; - /// - /// Path - /// - public string Path { get; set; } = string.Empty; - } + /// + /// Path + /// + public string Path { get; set; } = string.Empty; + } - public class GetTaskAdditionalQuestionInDto + public class GetTaskAdditionalQuestionInDto { //public Guid TrialReadingCriterionId { get; set; } public Guid VisitTaskId { get; set; } @@ -598,9 +591,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid VisitTaskId { get; set; } - public ComputationTrigger ComputationTrigger { get; set; } + public ComputationTrigger ComputationTrigger { get; set; } - public bool UpdateMark { get; set; } = false; + public bool UpdateMark { get; set; } = false; public List Answers { get; set; } @@ -644,7 +637,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid TrialId { get; set; } - /// + /// /// 分组分类 /// public List? GroupClassifyList { get; set; } @@ -660,15 +653,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid Id { get; set; } - /// - /// CreateTime - /// - public DateTime CreateTime { get; set; } + /// + /// CreateTime + /// + public DateTime CreateTime { get; set; } - /// - /// 第一层的Question - /// - public Guid QuestionId { get; set; } + /// + /// 第一层的Question + /// + public Guid QuestionId { get; set; } /// /// 器官Id @@ -680,15 +673,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid VisitTaskId { get; set; } - /// - /// 标记工具 - /// - public string? MarkTool { get; set; } + /// + /// 标记工具 + /// + public string? MarkTool { get; set; } - /// - /// TrialId - /// - public Guid TrialId { get; set; } + /// + /// TrialId + /// + public Guid TrialId { get; set; } /// /// 首次添加任务ID @@ -738,7 +731,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// MeasureData /// - public string? MeasureData { get; set; } + public string? MeasureData { get; set; } /// /// 是否是当前任务添加 @@ -757,14 +750,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid? MergeRowId { get; set; } - public string? BlindName { get; set; } + public string? BlindName { get; set; } - public string? OrderMark { get; set; } + public string? OrderMark { get; set; } /// /// 截图地址 /// - public string? PicturePath { get; set; } + public string? PicturePath { get; set; } /// /// 第一次添加的任务ID @@ -779,7 +772,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid CreateUserId { get; set; } - + public int? NumberOfFrames { get; set; } @@ -800,13 +793,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 来自于哪个标记 /// - public string? FromMark { get; set; } + public string? FromMark { get; set; } - public string? ReportMark { get; set; } + public string? ReportMark { get; set; } - public string? RowMark { get; set; } + public string? RowMark { get; set; } - } + } public class CopyTableAnswerRowInfo : ReadingTableAnswerRowInfoBase { @@ -854,7 +847,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsCalculate { get; set; } = true; } - public class GetReadingQuestionAndAnswerOutDto: GetReadingTableQuestionOutDto + public class GetReadingQuestionAndAnswerOutDto : GetReadingTableQuestionOutDto { public List QuestionMarkInfoList { get; set; } @@ -870,7 +863,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public ReadingTaskState ReadingTaskState { get; set; } - + } public class GetCustomTableQuestionAnswerInDto @@ -915,7 +908,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int? PageShowOrder { get; set; } - + public List Childrens { get; set; } @@ -929,7 +922,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public class lesionsIndexDto { - + public Guid QuestionId { get; set; } @@ -983,11 +976,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public List Questions { get; set; } - public List> Answers { get; set; } + public List> Answers { get; set; } } - public class TableQuestionTrial:ReadingTableQuestionTrial + public class TableQuestionTrial : ReadingTableQuestionTrial { public List RelationQuestions { get; set; } = new List(); } @@ -1000,10 +993,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 序号标记 /// - public string? OrderMark { get; set; } + public string? OrderMark { get; set; } - - public string? OrderMarkName { get; set; } + + public string? OrderMarkName { get; set; } public string? FromMark { get; set; } @@ -1054,7 +1047,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid? StudyId { get; set; } - public bool IsCanEditPosition { get; set; } + public bool IsCanEditPosition { get; set; } /// /// RowIndex @@ -1072,7 +1065,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public bool IsDicomReading { get; set; } = true; - public string? BlindName { get; set; } + public string? BlindName { get; set; } /// @@ -1093,10 +1086,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// MeasureData /// - public string? MeasureData { get; set; } + public string? MeasureData { get; set; } - public string? OtherMeasureData { get; set; } + public string? OtherMeasureData { get; set; } public int ShowOrder { get; set; } @@ -1126,9 +1119,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public int? OtherNumberOfFrames { get; set; } - public SplitOrMergeType? SplitOrMergeType { get; set; } + public SplitOrMergeType? SplitOrMergeType { get; set; } - } + } public class GetTableAnswerRowInfoInDto { @@ -1170,7 +1163,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// PicturePath /// - public string? PicturePath { get; set; } + public string? PicturePath { get; set; } /// /// NumberOfFrames @@ -1180,14 +1173,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// MeasureData /// - public string? MeasureData { get; set; } + public string? MeasureData { get; set; } public Guid? FirstAddTaskId { get; set; } public QuestionType? QuestionType { get; set; } - public string? OrderMarkName { get; set; } + public string? OrderMarkName { get; set; } /// @@ -1205,9 +1198,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid? OtherStudyId { get; set; } - public string? OtherMarkTool { get; set; } + public string? OtherMarkTool { get; set; } - public string? OtherPicturePath { get; set; } + public string? OtherPicturePath { get; set; } public int? OtherNumberOfFrames { get; set; } public string? OtherMeasureData { get; set; } @@ -1294,14 +1287,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid VisitTaskId { get; set; } - public List AnswerList { get; set; } + public List AnswerList { get; set; } } public class GlobalAnswer { public Guid? QuestionId { get; set; } - + public GlobalAnswerType GlobalAnswerType { get; set; } @@ -1363,9 +1356,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsBaseLine { get; set; } - public decimal VisitNum { get; set; } + public decimal VisitNum { get; set; } - public bool IsHaveChange { get; set; } + public bool IsHaveChange { get; set; } public string VisitRemark { get; set; } = string.Empty; @@ -1409,13 +1402,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid GlobalOrVisitTaskId { get; set; } - /// - /// 任务类型 - /// - public ReadingCategory ReadingCategory { get; set; } + /// + /// 任务类型 + /// + public ReadingCategory ReadingCategory { get; set; } - public Guid RelatedTaskId { get; set; } + public Guid RelatedTaskId { get; set; } public Guid SubjectId { get; set; } @@ -1456,21 +1449,21 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public bool IsFirstChangeTask { get; set; } = false; - /// - /// 融合的PTSeriesId - /// - public Guid? PTSeriesId { get; set; } + /// + /// 融合的PTSeriesId + /// + public Guid? PTSeriesId { get; set; } - /// - /// 融合的CTSeriesId - /// - public Guid? CTSeriesId { get; set; } + /// + /// 融合的CTSeriesId + /// + public Guid? CTSeriesId { get; set; } - /// - /// StudyId - /// - public Guid? OtherStudyId { get; set; } - } + /// + /// StudyId + /// + public Guid? OtherStudyId { get; set; } + } public class GetVisitReadingQuestionOutDto { @@ -1558,10 +1551,10 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string AgreeOrNotAnswer { - get + get { - return this.AgreeOrNot.Select(x => x.Answer).FirstOrDefault()??string.Empty; + return this.AgreeOrNot.Select(x => x.Answer).FirstOrDefault() ?? string.Empty; } } @@ -1572,8 +1565,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List AfterQuestionList { get; set; } - public List LesionCountList { get; set; } = new List(); - } + public List LesionCountList { get; set; } = new List(); + } public class GetGlobalQuestionType { @@ -1585,17 +1578,17 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid? QuestionId { get; set; } - /// - /// 裁判百分比或绝对值的相差值 - /// - public decimal? JudgeDifferenceValue { get; set; } + /// + /// 裁判百分比或绝对值的相差值 + /// + public decimal? JudgeDifferenceValue { get; set; } - /// - /// 裁判百分比或绝对值的相差值匹配规则 - /// - public JudgeDifferenceType JudgeDifferenceType { get; set; } + /// + /// 裁判百分比或绝对值的相差值匹配规则 + /// + public JudgeDifferenceType JudgeDifferenceType { get; set; } - public bool IsHaveChange { get; set; } = false; + public bool IsHaveChange { get; set; } = false; public string VisitAnswer { get; set; } = string.Empty; @@ -1663,12 +1656,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public JudgeTypeEnum JudgeType { get; set; } - public int ShowOrder { get; set; } + public int ShowOrder { get; set; } - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } /// /// 数值类型 @@ -1710,7 +1703,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class ResetReadingTaskOutDto { - + } public class SetSkipReadingCacheInDto @@ -1725,7 +1718,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetNextTaskInDto { - public string SubjectCode { get; set; }=string.Empty; + public string SubjectCode { get; set; } = string.Empty; public Guid TrialId { get; set; } @@ -1771,11 +1764,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid SubjectId { get; set; } - public string SubjectCode { get; set; }=String.Empty; + public string SubjectCode { get; set; } = String.Empty; public bool ExistsManual { get; set; } - public ReadingCategory ReadingCategory { get; set; } + public ReadingCategory ReadingCategory { get; set; } public decimal VisitNum { get; set; } @@ -1792,12 +1785,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsFirstChangeTask { get; set; } = false; - public ReadingTaskState ReadingTaskState { get; set; } + public ReadingTaskState ReadingTaskState { get; set; } - /// - /// 是否是转变的任务(转为IRECIST) - /// - public bool IsConvertedTask { get; set; } = false; + /// + /// 是否是转变的任务(转为IRECIST) + /// + public bool IsConvertedTask { get; set; } = false; } @@ -1843,24 +1836,24 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid ReadingQuestionTrialId { get; set; } - + public List AnswerGroup { get; set; } - /// - /// 裁判百分比或绝对值的相差值 - /// - public decimal? JudgeDifferenceValue { get; set; } + /// + /// 裁判百分比或绝对值的相差值 + /// + public decimal? JudgeDifferenceValue { get; set; } - /// - /// 裁判百分比或绝对值的相差值匹配规则 - /// - public JudgeDifferenceType JudgeDifferenceType { get; set; } + /// + /// 裁判百分比或绝对值的相差值匹配规则 + /// + public JudgeDifferenceType JudgeDifferenceType { get; set; } - public List AnswerCombination { get; set; } + public List AnswerCombination { get; set; } + - public JudgeTypeEnum JudgeType { get; set; } } @@ -1868,22 +1861,22 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid ReadingQuestionTrialId { get; set; } - /// - /// 裁判百分比或绝对值的相差值 - /// - public decimal? JudgeDifferenceValue { get; set; } + /// + /// 裁判百分比或绝对值的相差值 + /// + public decimal? JudgeDifferenceValue { get; set; } - /// - /// 类型 - /// - public string Type { get; set; } = string.Empty; + /// + /// 类型 + /// + public string Type { get; set; } = string.Empty; - /// - /// 裁判百分比或绝对值的相差值匹配规则 - /// - public JudgeDifferenceType JudgeDifferenceType { get; set; } + /// + /// 裁判百分比或绝对值的相差值匹配规则 + /// + public JudgeDifferenceType JudgeDifferenceType { get; set; } - public string QuestionName { get; set; } + public string QuestionName { get; set; } public string PageName { get; set; } @@ -1944,11 +1937,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetJudgeReadingInfoOutDto { - public Guid? JudgeResultTaskId { get; set; } + public Guid? JudgeResultTaskId { get; set; } - public List VisitInfoList { get; set; } - - public List VisitTaskArmList { get; set; } + public List VisitInfoList { get; set; } + + public List VisitTaskArmList { get; set; } public ReadingTaskState ReadingTaskState { get; set; } @@ -1967,16 +1960,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid VisitTaskId { get; set; } - public Guid? ReadModuleVisitId { get; set; } - public string TaskName { get; set; } + public Guid? ReadModuleVisitId { get; set; } + public string TaskName { get; set; } - public string VisitBlindName { get; set; } + public string VisitBlindName { get; set; } - public string TaskBlindName { get; set; } + public string TaskBlindName { get; set; } - public string VisitName { get; set; } + public string VisitName { get; set; } - public decimal VisitTaskNum { get; set; } + public decimal VisitTaskNum { get; set; } public Arm? JudgeResultArm { get; set; } @@ -2039,8 +2032,8 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid VisitId { get; set; } - - + + public List VisitTaskInfoList { get; set; } @@ -2076,7 +2069,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string QuestionName { get; set; } - + /// @@ -2100,7 +2093,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto [NotDefault] public Guid Id { get; set; } - + } public class VerifyVisitTaskDto @@ -2125,12 +2118,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetReportVerifyInDto { - public Guid VisitTaskId { get; set; } + public Guid VisitTaskId { get; set; } - public bool IsConvertTask { get; set; } + public bool IsConvertTask { get; set; } - public Guid? BeforeConvertedTaskId { get; set; } - } + public Guid? BeforeConvertedTaskId { get; set; } + } @@ -2160,37 +2153,37 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public ComputationTrigger ComputationTrigger { get; set; } = ComputationTrigger.CTSave; - public Guid? OrganInfoId { get; set; } + public Guid? OrganInfoId { get; set; } public int? NumberOfFrames { get; set; } - public string? FromMark { get; set; } + public string? FromMark { get; set; } public string? ReportMark { get; set; } /// /// 标记工具 /// - public string? MarkTool { get; set; } + public string? MarkTool { get; set; } public decimal RowIndex { get; set; } /// /// 截图地址 /// - public string? PicturePath { get; set; } + public string? PicturePath { get; set; } /// - /// 任务Id - /// - public Guid VisitTaskId { get; set; } + /// 任务Id + /// + public Guid VisitTaskId { get; set; } /// /// 项目Id /// public Guid TrialId { get; set; } - public string? MeasureData { get; set; } + public string? MeasureData { get; set; } public string? OtherMeasureData { get; set; } @@ -2238,23 +2231,23 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid? OtherStudyId { get; set; } - public string? OtherMarkTool { get; set; } + public string? OtherMarkTool { get; set; } - public string? OtherPicturePath { get; set; } + public string? OtherPicturePath { get; set; } public int? OtherNumberOfFrames { get; set; } - /// - /// 融合的PTSeriesId - /// - public Guid? PTSeriesId { get; set; } + /// + /// 融合的PTSeriesId + /// + public Guid? PTSeriesId { get; set; } - /// - /// 融合的CTSeriesId - /// - public Guid? CTSeriesId { get; set; } + /// + /// 融合的CTSeriesId + /// + public Guid? CTSeriesId { get; set; } - public List AnswerList { get; set; } + public List AnswerList { get; set; } } @@ -2262,7 +2255,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid TableQuestionId { get; set; } - public string Answer { get; set; }=string.Empty; + public string Answer { get; set; } = string.Empty; } public class GetTrialReadingQuestionInDto @@ -2295,7 +2288,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List AnswerList { get; set; } = new List(); - + } public class SaveJudgeTaskDto @@ -2324,16 +2317,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto { public Guid QuestionId { get; set; } - /// - /// 裁判百分比或绝对值的相差值 - /// - public decimal? JudgeDifferenceValue { get; set; } + /// + /// 裁判百分比或绝对值的相差值 + /// + public decimal? JudgeDifferenceValue { get; set; } - /// - /// 裁判百分比或绝对值的相差值匹配规则 - /// - public JudgeDifferenceType JudgeDifferenceType { get; set; } - public string AnswerGroup { get; set; } + /// + /// 裁判百分比或绝对值的相差值匹配规则 + /// + public JudgeDifferenceType JudgeDifferenceType { get; set; } + public string AnswerGroup { get; set; } public string AnswerCombination { get; set; } @@ -2378,16 +2371,16 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public JudgeTypeEnum JudgeType { get; set; } - /// - /// 裁判百分比或绝对值的相差值 - /// - public decimal? JudgeDifferenceValue { get; set; } + /// + /// 裁判百分比或绝对值的相差值 + /// + public decimal? JudgeDifferenceValue { get; set; } - /// - /// 裁判百分比或绝对值的相差值匹配规则 - /// - public JudgeDifferenceType JudgeDifferenceType { get; set; } - } + /// + /// 裁判百分比或绝对值的相差值匹配规则 + /// + public JudgeDifferenceType JudgeDifferenceType { get; set; } + } public class GetSystemReadingQuestionPageDto @@ -2405,7 +2398,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List MultiPage { get; set; } - public List PublicPage{ get; set; } + public List PublicPage { get; set; } } public class TableQuestionDataInfo @@ -2545,15 +2538,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid Id { get; set; } - /// - /// 分组ID - /// - public Guid? GroupId { get; set; } + /// + /// 分组ID + /// + public Guid? GroupId { get; set; } - /// - /// 系统标准Id - /// - public Guid ReadingQuestionCriterionSystemId { get; set; } + /// + /// 系统标准Id + /// + public Guid ReadingQuestionCriterionSystemId { get; set; } /// @@ -2678,7 +2671,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsShowInDicom { get; set; } - + /// /// 序号标记 @@ -2886,7 +2879,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List RelationQuestions { get; set; } - + public List Childrens { get; set; } @@ -2902,7 +2895,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string DataTableColumn { get; set; } = string.Empty; - + /// /// 是否启用 @@ -2924,7 +2917,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string Remark { get; set; } - + /// /// 序号标记 /// @@ -2983,6 +2976,6 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto //public class TrialReadingTableQuestion //{ - + //} } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs index feebe486e..1a0d5600d 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicalReviewDto.cs @@ -1,11 +1,5 @@ -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; +using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -34,19 +28,19 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetNextIRMedicalFeedbackInDto { - /// - /// 项目Id - /// - [NotDefault] - public Guid TrialId { get; set; } + /// + /// 项目Id + /// + [NotDefault] + public Guid TrialId { get; set; } - public Guid TrialReadingCriterionId { get; set; } + public Guid TrialReadingCriterionId { get; set; } - public Guid TaskMedicalReviewId { get; set; } - } + public Guid TaskMedicalReviewId { get; set; } + } - public class GetIRMedicalFeedbackListInDto:PageInput + public class GetIRMedicalFeedbackListInDto : PageInput { /// /// 项目Id @@ -60,7 +54,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? SubjectId { get; set; } - public MedicalReviewAuditState? AuditState { get; set; } + public MedicalReviewAuditState? AuditState { get; set; } public string SubjectCode { get; set; } = string.Empty; @@ -101,7 +95,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public bool IsNotHaveSigned { get; set; } = false; - } + } public class GetIRMedicalFeedbackListOutDto { @@ -182,7 +176,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// /// 任务展示访视 读片任务显示是否顺序 /// - public ReadingOrder IsReadingTaskViewInOrder { get; set; } + public ReadingOrder IsReadingTaskViewInOrder { get; set; } /// @@ -290,7 +284,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - + public class GetMedicalReviewDialogInDto { @@ -303,14 +297,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid TrialId { get; set; } - + public string RequestReReadingReason { get; set; } = string.Empty; public Guid TaskMedicalReviewId { get; set; } - public string Content { get; set; }=string.Empty; + public string Content { get; set; } = string.Empty; /// /// 阅片人是否认同 @@ -335,7 +329,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List FileList { get; set; } = new List(); - + public string FileName { get; set; } = string.Empty; @@ -348,7 +342,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string Content { get; set; } = string.Empty; - + /// /// 是否有问题 /// @@ -371,7 +365,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid TaskMedicalReviewId { get; set; } public Guid VisitTaskId { get; set; } - + public List QuestionAnswerList { get; set; } } @@ -386,7 +380,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public class GetMedicalReviewReadingTaskInDto { - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } public Guid TrialReadingCriterionId { get; set; } @@ -436,11 +430,11 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public bool IsClosedDialog { get; set; } - + public List TaskList { get; set; } = new List(); - + public List QuestionAnswerList { get; set; } = new List(); @@ -507,7 +501,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public AuditAdvice AuditAdviceEnum { get; set; } } - public class MedicalReviewInfo + public class MedicalReviewInfo { public Guid TaskMedicalReviewId { get; set; } @@ -542,7 +536,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsSendMessage { get; set; } } - public class ReadingMedicineQuestion + public class ReadingMedicineQuestion { /// /// 答案 @@ -566,15 +560,15 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string QuestionName { get; set; } - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } /// /// 是否启用 @@ -601,13 +595,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public bool? IsConfirm { get; set; } - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public List Childrens { get; set; } + public List Childrens { get; set; } } public class TaskInfo @@ -640,7 +634,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Arm ArmEnum { get; set; } - + /// /// 评估结果 @@ -694,12 +688,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public string QuestionName { get; set; } - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - public string Answer { get; set; } + public string Answer { get; set; } /// /// 排序 diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs index b231084fa..5867246ff 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingMedicineQuestionViewModel.cs @@ -1,14 +1,12 @@ -using System; using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { - public class ReadingMedicineSystemQuestionView: ReadingMedicineSystemQuestionAddOrEdit + public class ReadingMedicineSystemQuestionView : ReadingMedicineSystemQuestionAddOrEdit { - + /// /// 排序 @@ -17,18 +15,18 @@ namespace IRaCIS.Core.Application.ViewModel } ///ReadingMedicineSystemQuestionQuery 列表查询参数模型 - public class ReadingMedicineSystemQuestionQuery:PageInput + public class ReadingMedicineSystemQuestionQuery : PageInput { public string Type { get; set; } = string.Empty; public string ParentTriggerValue { get; set; } = string.Empty; public string QuestionName { get; set; } = string.Empty; - /// - /// 语言类型 - /// - public LanguageType? LanguageType { get; set; } + /// + /// 语言类型 + /// + public LanguageType? LanguageType { get; set; } - public string TypeValue { get; set; } = string.Empty; + public string TypeValue { get; set; } = string.Empty; public CriterionType? CurrentCriterionType { get; set; } @@ -56,15 +54,15 @@ namespace IRaCIS.Core.Application.ViewModel public string QuestionName { get; set; } - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } /// /// 任务类型 @@ -92,17 +90,17 @@ namespace IRaCIS.Core.Application.ViewModel } - public class AddDefaultQuestionsInDto + public class AddDefaultQuestionsInDto { - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - [NotDefault] - public Guid TrialReadingCriterionId { get; set; } + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } - public LanguageType LanguageType { get; set; } - } + public LanguageType LanguageType { get; set; } + } - public class AddTrialDataFromSystemInDto + public class AddTrialDataFromSystemInDto { public Guid TrialId { get; set; } @@ -193,15 +191,15 @@ namespace IRaCIS.Core.Application.ViewModel /// public string QuestionName { get; set; } - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - /// - /// 是否是必须 - /// - public bool IsRequired { get; set; } + /// + /// 是否是必须 + /// + public bool IsRequired { get; set; } /// /// 排序 @@ -237,12 +235,12 @@ namespace IRaCIS.Core.Application.ViewModel public class ReadingMedicineTrialQuestionView : ReadingMedicineSystemQuestionAddOrEdit { public DateTime CreateTime { get; set; } - + public Guid UpdateUserId { get; set; } public Guid CreateUserId { get; set; } public Guid TrialId { get; set; } public DateTime UpdateTime { get; set; } - + public bool? IsConfirm { get; set; } public int? ParentShowOrder { get; set; } @@ -265,10 +263,10 @@ namespace IRaCIS.Core.Application.ViewModel public class VerifyIsCanConfirmInDto { - public Guid TrialReadingCriterionId { get; set; } - } + public Guid TrialReadingCriterionId { get; set; } + } - public class GetMedicineQuestionPreviewOutDto + public class GetMedicineQuestionPreviewOutDto { public Guid Id { get; set; } @@ -287,15 +285,15 @@ namespace IRaCIS.Core.Application.ViewModel /// public string QuestionName { get; set; } - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } @@ -340,7 +338,7 @@ namespace IRaCIS.Core.Application.ViewModel } ///ReadingMedicineTrialQuestionQuery 列表查询参数模型 - public class ReadingMedicineTrialQuestionQuery:PageInput + public class ReadingMedicineTrialQuestionQuery : PageInput { /// /// 项目Id @@ -356,12 +354,12 @@ namespace IRaCIS.Core.Application.ViewModel public string QuestionName { get; set; } = string.Empty; - /// - /// 语言类型 - /// - public LanguageType? LanguageType { get; set; } + /// + /// 语言类型 + /// + public LanguageType? LanguageType { get; set; } - public string TypeValue { get; set; } = string.Empty; + public string TypeValue { get; set; } = string.Empty; /// /// 任务类型 @@ -382,11 +380,11 @@ namespace IRaCIS.Core.Application.ViewModel public string? ParentTriggerValue { get; set; } = string.Empty; public string QuestionName { get; set; } - /// - /// 语言类型 - /// - public LanguageType LanguageType { get; set; } = LanguageType.Chinese; - public string TypeValue { get; set; } + /// + /// 语言类型 + /// + public LanguageType LanguageType { get; set; } = LanguageType.Chinese; + public string TypeValue { get; set; } public Guid TrialId { get; set; } public bool IsEnable { get; set; } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs index 9c22a8b91..549387b8a 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingPeriodSetViewModel.cs @@ -1,16 +1,11 @@ using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { - public class ReadingPeriodSetAddOrEdit + public class ReadingPeriodSetAddOrEdit { - public Guid? Id { get; set; } + public Guid? Id { get; set; } /// /// 项目ID @@ -54,9 +49,9 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public ReadingSetType ReadingSetType { get; set; } = ReadingSetType.ImageReading; - public List SiteIds { get; set; } = new List(); + public List SiteIds { get; set; } = new List(); - public List SubjectVisitIds { get; set; } = new List(); + public List SubjectVisitIds { get; set; } = new List(); } @@ -318,7 +313,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public ReadingPeriodStatus IsTakeEffect { get; set; } } - public class ReadingPeriodSetQuery:PageInput + public class ReadingPeriodSetQuery : PageInput { /// diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 3cf43f6df..930f964b1 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -1,354 +1,347 @@ using IRaCIS.Core.Domain.Share; -using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { - public class TumorAssessmentView: AddOrUpdateTumorAssessmentInDto - { + public class TumorAssessmentView : AddOrUpdateTumorAssessmentInDto + { } - public class AddOrUpdateTumorAssessmentInDto - { - - public Guid? Id { get; set; } - - /// - /// 标准ID - /// - public Guid CriterionId { get; set; } - - /// - /// 靶病灶 - /// - public TargetAssessment TargetLesion { get; set; } - - /// - /// 非靶病灶 - /// - public NoTargetAssessment NonTargetLesions { get; set; } - - /// - /// 新病灶 - /// - public NewLesionAssessment NewLesion { get; set; } - - /// - /// 整体疗效 - /// - public OverallAssessment OverallEfficacy { get; set; } - - } - - - public class ColumnInfo - { - public string ColumnName { get; set; } - - public string ColumnKey { get; set; } - - public string DictionaryKey { get; set; } - } - - public class GetTumorAssessmentListInDto:PageInput - { - //public Guid CriterionId { get; set; } - - public CriterionType CriterionType { get; set; } - - ///// - ///// 靶病灶 - ///// - //public TargetAssessment? TargetLesion { get; set; } - - ///// - ///// 非靶病灶 - ///// - //public NoTargetAssessment? NonTargetLesions { get; set; } - - ///// - ///// 新病灶 - ///// - //public NewLesionAssessment? NewLesion { get; set; } - - ///// - ///// 整体疗效 - ///// - //public OverallAssessment? OverallEfficacy { get; set; } - } - public class CopySystemCriterionDataInDto - { - public Guid SourceSystemCriterionId { get; set; } - - public Guid NewSystemCriterionId { get; set; } - - public bool IsCopyQuestion { get; set; } - } - - public class EditCriterionDictionaryInDto - { - public Guid Id { get; set; } - - /// - /// 标准字典分组 - /// - public CrterionDictionaryGroup CrterionDictionaryGroup { get; set; } = CrterionDictionaryGroup.General; - } - - public class SetCriterionDictionaryInDto - { - [NotDefault] - public Guid CriterionId { get; set; } - - public string ParentCode { get; set; } - - public List DictionaryIds { get; set; } - } - public class SetAssessTypeInDto - { - - [NotDefault] - public Guid CriterionId { get; set; } - - public string ParentCode { get; set; } - - public List DictionaryList { get; set; } - - } - - public class SetCriterionDictionaryDto - { - public Guid DictionaryId { get; set; } - - /// - /// IsBaseLineUse - /// - public bool IsBaseLineUse { get; set; } = false; - - /// - /// IsBaseUse - /// - public bool IsFollowVisitUse { get; set; } = false; - } - - public class SetDictionaryFollowVisitUseInDto - { - public Guid Id { get; set; } - - public bool IsFollowVisitUse { get; set; } - - } - - public class SetDictionaryBaseLineUseInDto - { - public Guid Id { get; set; } - - public bool IsBaseLineUse { get; set; } - - } - - public class GetAssessTypeInDto + public class AddOrUpdateTumorAssessmentInDto { - - public Guid? SystemCriterionId { get; set; } - public Guid? TrialCriterionId { get; set; } + public Guid? Id { get; set; } - public string ParentCode { get; set; } = string.Empty; - } + /// + /// 标准ID + /// + public Guid CriterionId { get; set; } + + /// + /// 靶病灶 + /// + public TargetAssessment TargetLesion { get; set; } + + /// + /// 非靶病灶 + /// + public NoTargetAssessment NonTargetLesions { get; set; } + + /// + /// 新病灶 + /// + public NewLesionAssessment NewLesion { get; set; } + + /// + /// 整体疗效 + /// + public OverallAssessment OverallEfficacy { get; set; } + + } - public class CriterionDictionaryInfo - { + public class ColumnInfo + { + public string ColumnName { get; set; } + + public string ColumnKey { get; set; } + + public string DictionaryKey { get; set; } + } + + public class GetTumorAssessmentListInDto : PageInput + { + //public Guid CriterionId { get; set; } + + public CriterionType CriterionType { get; set; } + + ///// + ///// 靶病灶 + ///// + //public TargetAssessment? TargetLesion { get; set; } + + ///// + ///// 非靶病灶 + ///// + //public NoTargetAssessment? NonTargetLesions { get; set; } + + ///// + ///// 新病灶 + ///// + //public NewLesionAssessment? NewLesion { get; set; } + + ///// + ///// 整体疗效 + ///// + //public OverallAssessment? OverallEfficacy { get; set; } + } + public class CopySystemCriterionDataInDto + { + public Guid SourceSystemCriterionId { get; set; } + + public Guid NewSystemCriterionId { get; set; } + + public bool IsCopyQuestion { get; set; } + } + + public class EditCriterionDictionaryInDto + { + public Guid Id { get; set; } + + /// + /// 标准字典分组 + /// + public CrterionDictionaryGroup CrterionDictionaryGroup { get; set; } = CrterionDictionaryGroup.General; + } + + public class SetCriterionDictionaryInDto + { + [NotDefault] + public Guid CriterionId { get; set; } + + public string ParentCode { get; set; } + + public List DictionaryIds { get; set; } + } + public class SetAssessTypeInDto + { + + [NotDefault] + public Guid CriterionId { get; set; } + + public string ParentCode { get; set; } + + public List DictionaryList { get; set; } + + } + + public class SetCriterionDictionaryDto + { + public Guid DictionaryId { get; set; } + + /// + /// IsBaseLineUse + /// + public bool IsBaseLineUse { get; set; } = false; + + /// + /// IsBaseUse + /// + public bool IsFollowVisitUse { get; set; } = false; + } + + public class SetDictionaryFollowVisitUseInDto + { + public Guid Id { get; set; } + + public bool IsFollowVisitUse { get; set; } + + } + + public class SetDictionaryBaseLineUseInDto + { + public Guid Id { get; set; } + + public bool IsBaseLineUse { get; set; } + + } + + public class GetAssessTypeInDto + { + + public Guid? SystemCriterionId { get; set; } + + public Guid? TrialCriterionId { get; set; } + + public string ParentCode { get; set; } = string.Empty; + } - public CrterionDictionaryGroup CrterionDictionaryGroup { get; set; } - - public Guid Id { get; set; } - - public Guid DictionaryId { get; set; } - - public int ShowOrder { get; set; } - - public string Description { get; set; } = string.Empty; - - public string Code { get; set; } - - public string ParentCode { get; set; } - - public string ChildGroup { get; set; } - - /// - /// IsBaseUse - /// - public bool IsBaseLineUse { get; set; } = false; + public class CriterionDictionaryInfo + { - /// - /// IsBaseUse - /// - public bool IsFollowVisitUse { get; set; } = false; + public CrterionDictionaryGroup CrterionDictionaryGroup { get; set; } - public string Value { get; set; } = string.Empty; + public Guid Id { get; set; } - public string ValueCN { get; set; } = string.Empty; - } + public Guid DictionaryId { get; set; } + + public int ShowOrder { get; set; } + + public string Description { get; set; } = string.Empty; + + public string Code { get; set; } + + public string ParentCode { get; set; } + + public string ChildGroup { get; set; } + + /// + /// IsBaseUse + /// + public bool IsBaseLineUse { get; set; } = false; - public class GetSystemGlobalInfoOutDto - { - /// - /// 是否必须全局阅片 - /// - public bool IsMustGlobalReading { get; set; } = false; + /// + /// IsBaseUse + /// + public bool IsFollowVisitUse { get; set; } = false; - public List DictionaryList { get; set; } - } - public class GetSystemOncologyInfoOutDto - { - public bool IsOncologyReading { get; set; } + public string Value { get; set; } = string.Empty; - public List DictionaryList { get; set; } - } + public string ValueCN { get; set; } = string.Empty; + } - public class DeleteSystemCriterionDictionaryIndto - { - public Guid Id { get; set; } - } + public class GetSystemGlobalInfoOutDto + { + /// + /// 是否必须全局阅片 + /// + public bool IsMustGlobalReading { get; set; } = false; - public class AddSystemCriterionDictionaryCodeInDto - { - public Guid SystemCriterionId { get; set; } + public List DictionaryList { get; set; } + } + public class GetSystemOncologyInfoOutDto + { + public bool IsOncologyReading { get; set; } - [NotDefault] - public List CodeList { get; set; } - } + public List DictionaryList { get; set; } + } - public class ResetAndAsyncCriterionInDto - { + public class DeleteSystemCriterionDictionaryIndto + { + public Guid Id { get; set; } + + } + + public class AddSystemCriterionDictionaryCodeInDto + { + public Guid SystemCriterionId { get; set; } + + [NotDefault] + public List CodeList { get; set; } + } + + public class ResetAndAsyncCriterionInDto + { public Guid TrialReadingCriterionId { get; set; } } - public class ResetAndAsyncCriterionOutDto - { - - } - - public class SetSystemGlobalInfoInDto - { - [NotDefault] - public Guid SystemCriterionId { get; set; } - - public bool IsMustGlobalReading { get; set; } - - public List DictionaryList { get; set; } - } - - public class SystemGlobalInfo - { - /// - /// DictionaryId - /// - public Guid DictionaryId { get; set; } - - - /// - /// IsBaseLineUse - /// - public bool IsBaseLineUse { get; set; } = false; - - /// - /// IsBaseUse - /// - public bool IsFollowVisitUse { get; set; } = false; - - } - - public class SetSystemOncologyInfoInDto - { - [NotDefault] - public Guid SystemCriterionId { get; set; } - - public bool IsOncologyReading { get; set; } - - public List DictionaryIds { get; set; } - } - - public class GetSystemOncologyInfoInDto - { - [NotDefault] - public Guid SystemCriterionId { get; set; } - } - - public class GetSystemCriterionListOutDto - { - public Guid CriterionId { get; set; } - - public string CriterionName { get; set; } - } - - public class ReadingTableQuestionTrialView:ReadingTableQuestionTrial - { - public int? DependShowOrder { get; set; } - } - - public class ReadingTableQuestionSystemView : ReadingTableQuestionSystem - { - public int? DependShowOrder { get; set; } - - } - - - public class ReadingTableQuestionSystemQuery - { - - - public Guid ReadingQuestionId { get; set; } - - /// - /// 表格问题类型 - /// - public TableQuestionType? TableQuestionType { get; set; } - - } - - - public class ReadingTableQuestionTrialAddOrEdit + public class ResetAndAsyncCriterionOutDto { - /// - /// 自定义计算标记 - /// - public CustomCalculateMark? CustomCalculateMark { get; set; } + } - /// - /// TrialId - /// - public Guid TrialId { get; set; } + public class SetSystemGlobalInfoInDto + { + [NotDefault] + public Guid SystemCriterionId { get; set; } - /// - /// IsDepend - /// - public IsDepend IsDepend { get; set; } + public bool IsMustGlobalReading { get; set; } - /// - /// 自定义计算标记 - /// - public string CalculateQuestions { get; set; } = "[]"; + public List DictionaryList { get; set; } + } - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + public class SystemGlobalInfo + { + /// + /// DictionaryId + /// + public Guid DictionaryId { get; set; } + + + /// + /// IsBaseLineUse + /// + public bool IsBaseLineUse { get; set; } = false; + + /// + /// IsBaseUse + /// + public bool IsFollowVisitUse { get; set; } = false; + + } + + public class SetSystemOncologyInfoInDto + { + [NotDefault] + public Guid SystemCriterionId { get; set; } + + public bool IsOncologyReading { get; set; } + + public List DictionaryIds { get; set; } + } + + public class GetSystemOncologyInfoInDto + { + [NotDefault] + public Guid SystemCriterionId { get; set; } + } + + public class GetSystemCriterionListOutDto + { + public Guid CriterionId { get; set; } + + public string CriterionName { get; set; } + } + + public class ReadingTableQuestionTrialView : ReadingTableQuestionTrial + { + public int? DependShowOrder { get; set; } + } + + public class ReadingTableQuestionSystemView : ReadingTableQuestionSystem + { + public int? DependShowOrder { get; set; } + + } + + + public class ReadingTableQuestionSystemQuery + { + + + public Guid ReadingQuestionId { get; set; } + + /// + /// 表格问题类型 + /// + public TableQuestionType? TableQuestionType { get; set; } + + } + + + public class ReadingTableQuestionTrialAddOrEdit + { + + /// + /// 自定义计算标记 + /// + public CustomCalculateMark? CustomCalculateMark { get; set; } + + /// + /// TrialId + /// + public Guid TrialId { get; set; } + + /// + /// IsDepend + /// + public IsDepend IsDepend { get; set; } + + /// + /// 自定义计算标记 + /// + public string CalculateQuestions { get; set; } = "[]"; + + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 问题分类 @@ -365,109 +358,109 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public ValueUnit? Unit { get; set; } - /// - /// 限制编辑 - /// - public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + /// + /// 限制编辑 + /// + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; - /// - /// 限制显示 - /// - public LimitShow LimitShow { get; set; } = LimitShow.AllShow; + /// + /// 限制显示 + /// + public LimitShow LimitShow { get; set; } = LimitShow.AllShow; - /// - /// 最大答案长度 - /// - public int? MaxAnswerLength { get; set; } + /// + /// 最大答案长度 + /// + public int? MaxAnswerLength { get; set; } - /// - /// 文件类型 - /// - public string FileType { get; set; }=string.Empty; + /// + /// 文件类型 + /// + public string FileType { get; set; } = string.Empty; - /// - /// 自定义单位 - /// - public string CustomUnit { get; set; } = string.Empty; + /// + /// 自定义单位 + /// + public string CustomUnit { get; set; } = string.Empty; - /// - /// 数据来源 - /// - public DataSources? DataSource { get; set; } = DataSources.ManualEntry; - public Guid? Id { get; set; } + /// + /// 数据来源 + /// + public DataSources? DataSource { get; set; } = DataSources.ManualEntry; + public Guid? Id { get; set; } - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; - public Guid ReadingQuestionId { get; set; } - public string Type { get; set; } = string.Empty; - public Guid? ParentId { get; set; } - public string ParentTriggerValue { get; set; } = string.Empty; - public string QuestionName { get; set; } = string.Empty; - public IsRequired IsRequired { get; set; } + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; + public Guid ReadingQuestionId { get; set; } + public string Type { get; set; } = string.Empty; + public Guid? ParentId { get; set; } + public string ParentTriggerValue { get; set; } = string.Empty; + public string QuestionName { get; set; } = string.Empty; + public IsRequired IsRequired { get; set; } - /// - /// 复制病灶的时候 是否复制这个问题 - /// - public bool IsCopy { get; set; } = false; + /// + /// 复制病灶的时候 是否复制这个问题 + /// + public bool IsCopy { get; set; } = false; - public int ShowOrder { get; set; } - public string TypeValue { get; set; } = string.Empty; - public bool IsEnable { get; set; } - public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - public string Remark { get; set; } - public Guid? RelevanceId { get; set; } - public string RelevanceValue { get; set; } = string.Empty; - public int ShowQuestion { get; set; } - public int? MaxRowCount { get; set; } - public string DataTableName { get; set; } = string.Empty; - public string DataTableColumn { get; set; } = string.Empty; + public int ShowOrder { get; set; } + public string TypeValue { get; set; } = string.Empty; + public bool IsEnable { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public string Remark { get; set; } + public Guid? RelevanceId { get; set; } + public string RelevanceValue { get; set; } = string.Empty; + public int ShowQuestion { get; set; } + public int? MaxRowCount { get; set; } + public string DataTableName { get; set; } = string.Empty; + public string DataTableColumn { get; set; } = string.Empty; - /// - /// 表格问题类型 - /// - public TableQuestionType? TableQuestionType { get; set; } + /// + /// 表格问题类型 + /// + public TableQuestionType? TableQuestionType { get; set; } - /// - /// 依赖父问题 - /// - public Guid? DependParentId { get; set; } + /// + /// 依赖父问题 + /// + public Guid? DependParentId { get; set; } - /// - /// 项目标准Id - /// - public Guid TrialCriterionId { get; set; } + /// + /// 项目标准Id + /// + public Guid TrialCriterionId { get; set; } - /// - /// 问题标识 - /// - public QuestionMark? QuestionMark { get; set; } + /// + /// 问题标识 + /// + public QuestionMark? QuestionMark { get; set; } - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - - public List ParentTriggerValueList { get; set; } = new List(); + + public List ParentTriggerValueList { get; set; } = new List(); public List RelevanceValueList { get; set; } = new List(); } - /// ReadingTableQuestionSystemAddOrEdit 列表查询参数模型 - public class ReadingTableQuestionSystemAddOrEdit - { - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + /// ReadingTableQuestionSystemAddOrEdit 列表查询参数模型 + public class ReadingTableQuestionSystemAddOrEdit + { + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 问题分类 @@ -484,80 +477,80 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public DataSources? DataSource { get; set; } = DataSources.ManualEntry; - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } - /// - /// 限制编辑 - /// - public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + /// + /// 限制编辑 + /// + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; - /// - /// 限制显示 - /// - public LimitShow LimitShow { get; set; } = LimitShow.AllShow; + /// + /// 限制显示 + /// + public LimitShow LimitShow { get; set; } = LimitShow.AllShow; - /// - /// 最大答案长度 - /// - public int? MaxAnswerLength { get; set; } + /// + /// 最大答案长度 + /// + public int? MaxAnswerLength { get; set; } - /// - /// 文件类型 - /// - public string FileType { get; set; } = string.Empty; - public Guid? Id { get; set; } - public Guid ReadingQuestionId { get; set; } - public string Type { get; set; } = string.Empty; + /// + /// 文件类型 + /// + public string FileType { get; set; } = string.Empty; + public Guid? Id { get; set; } + public Guid ReadingQuestionId { get; set; } + public string Type { get; set; } = string.Empty; - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; - public Guid? ParentId { get; set; } - public string ParentTriggerValue { get; set; } = string.Empty; - public string QuestionName { get; set; } = string.Empty; - public IsRequired IsRequired { get; set; } - public int ShowOrder { get; set; } - public string TypeValue { get; set; } = string.Empty; - public bool IsEnable { get; set; } - public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - public string Remark { get; set; } - public Guid? RelevanceId { get; set; } - public string RelevanceValue { get; set; } = string.Empty; - public int ShowQuestion { get; set; } - public int? MaxRowCount { get; set; } - public string DataTableName { get; set; } = string.Empty; - public string DataTableColumn { get; set; } = string.Empty; + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; + public Guid? ParentId { get; set; } + public string ParentTriggerValue { get; set; } = string.Empty; + public string QuestionName { get; set; } = string.Empty; + public IsRequired IsRequired { get; set; } + public int ShowOrder { get; set; } + public string TypeValue { get; set; } = string.Empty; + public bool IsEnable { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public string Remark { get; set; } + public Guid? RelevanceId { get; set; } + public string RelevanceValue { get; set; } = string.Empty; + public int ShowQuestion { get; set; } + public int? MaxRowCount { get; set; } + public string DataTableName { get; set; } = string.Empty; + public string DataTableColumn { get; set; } = string.Empty; - /// - /// 表格问题类型 - /// - public TableQuestionType? TableQuestionType { get; set; } + /// + /// 表格问题类型 + /// + public TableQuestionType? TableQuestionType { get; set; } - /// - /// 依赖父问题 - /// - public Guid? DependParentId { get; set; } + /// + /// 依赖父问题 + /// + public Guid? DependParentId { get; set; } - /// - /// 系统标准Id - /// - public Guid SystemCriterionId { get; set; } + /// + /// 系统标准Id + /// + public Guid SystemCriterionId { get; set; } - /// - /// 问题标识 - /// - public QuestionMark? QuestionMark { get; set; } + /// + /// 问题标识 + /// + public QuestionMark? QuestionMark { get; set; } - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; public List ParentTriggerValueList { get; set; } = new List(); @@ -566,285 +559,285 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto } - public class ReadingCriterionPageView - { - public Guid Id { get; set; } - public Guid TrialId { get; set; } - public string PageName { get; set; } - public bool IsEnable { get; set; } - - } - - - public class ReadingCriterionPageQuery - { - /// PageName - public string PageName { get; set; } - - } - - public class SetTrialJudgyInfoInDto : GetTrialJudgyInfoOutDto - { - public Guid TrialReadingCriterionId { get; set; } - } - - public class GetTrialJudgyInfoOutDto - { - public Guid TrialId { get; set; } - - public ReadingOrder IsReadingTaskViewInOrder { get; set; } - - /// - /// 仲裁阅片 - /// - public bool? IsArbitrationReading { get; set; } - - /// - /// 仲裁规则 - /// - public ArbitrationRule ArbitrationRule { get; set; } - } - - public enum NeedSynchronize - { - /// - /// 需要 - /// - Need=0, - - /// - /// 不需要 - /// - NotNeed = 1, - - /// - /// 裁判不相等 - /// - JudgeNotEqual=2, - - } - - public class ReadingQuestionSystemData : ReadingQuestionSystem - { - public Guid OriginalId { get; set; } - } - - public class ReadingTableQuestionSystemData : ReadingTableQuestionSystem - { - public Guid OriginalId { get; set; } - } - - public class ReadingTrialTableQuestionData : ReadingTableQuestionTrial - { - public Guid OriginalId { get; set; } - } - - - public class SynchronizeSystemCriterionInDto - { - public Guid FromSystemCriterionId { get; set; } - public Guid ToSystemCriterionId { get; set; } - } - - public class SynchronizeCriterionInDto - { - [NotDefault] - public Guid TrialReadingCriterionId { get; set; } - } - - public class VerifyeCriterionNeedSynchronizeInDto - { - [NotDefault] - public Guid TrialReadingCriterionId { get; set; } - } - public class GetTrialJudgyInfoInDto - { - [NotDefault] - public Guid TrialId { get; set; } - - [NotDefault] - public Guid TrialReadingCriterionId { get; set; } - } - - - public class ReadingCriterionPageAddOrEdit - { - public Guid? Id { get; set; } - public Guid TrialId { get; set; } - public string PageName { get; set; } - public bool IsEnable { get; set; } - - public int ShowOrder { get; set; } = 0; - public Guid ReadingQuestionCriterionTrialId{ get; set; } - - /// - /// 是否公共分页 - /// - public bool IsPublicPage { get; set; } - - } - - - public class AddOrUpdateReadingQuestionCriterionTrialInDto - { - public Guid? Id { get; set; } - - [NotDefault] - public Guid TrialId { get; set; } - - /// - /// 描述 - /// - public string Description { get; set; } = string.Empty; - - /// - /// 排序 - /// - public int ShowOrder { get; set; } - - /// - /// 标准 - /// - public string CriterionName { get; set; } - - /// - /// 是否启用 - /// - public bool IsEnable { get; set; } - - /// - /// 表单类型 - /// - - public FormType FormType { get; set; } = FormType.SinglePage; - - - /// - /// 修约小数点 - /// - public int? DigitPlaces { get; set; } = 2; - - } - - - public class GetPreviewTheQuestionInDto + public class ReadingCriterionPageView { - [NotDefault] - public Guid Id { get; set; } - } + public Guid Id { get; set; } + public Guid TrialId { get; set; } + public string PageName { get; set; } + public bool IsEnable { get; set; } - public class AddOrUpdateReadingQuestionCriterionSystemInDto + } + + + public class ReadingCriterionPageQuery { - public Guid? Id { get; set; } + /// PageName + public string PageName { get; set; } - /// - /// eCRF报告是否显示在图像页面 - /// - public bool IseCRFShowInDicomReading { get; set; } = false; + } - /// - /// 标准 - /// - public string CriterionName { get; set; } + public class SetTrialJudgyInfoInDto : GetTrialJudgyInfoOutDto + { + public Guid TrialReadingCriterionId { get; set; } + } - /// - /// 描述 - /// - public string Description { get; set; } + public class GetTrialJudgyInfoOutDto + { + public Guid TrialId { get; set; } - /// - /// 是否启用 - /// - public bool IsEnable { get; set; } + public ReadingOrder IsReadingTaskViewInOrder { get; set; } - /// - /// 排序 - /// - public int ShowOrder { get; set; } + /// + /// 仲裁阅片 + /// + public bool? IsArbitrationReading { get; set; } - /// - /// 标准类型 - /// - public CriterionType CriterionType { get; set; } + /// + /// 仲裁规则 + /// + public ArbitrationRule ArbitrationRule { get; set; } + } - /// - /// 是否完成配置 - /// - public bool IsCompleteConfig { get; set; } = false; + public enum NeedSynchronize + { + /// + /// 需要 + /// + Need = 0, + + /// + /// 不需要 + /// + NotNeed = 1, + + /// + /// 裁判不相等 + /// + JudgeNotEqual = 2, + + } + + public class ReadingQuestionSystemData : ReadingQuestionSystem + { + public Guid OriginalId { get; set; } + } + + public class ReadingTableQuestionSystemData : ReadingTableQuestionSystem + { + public Guid OriginalId { get; set; } + } + + public class ReadingTrialTableQuestionData : ReadingTableQuestionTrial + { + public Guid OriginalId { get; set; } + } - /// - /// 表单类型 - /// + public class SynchronizeSystemCriterionInDto + { + public Guid FromSystemCriterionId { get; set; } + public Guid ToSystemCriterionId { get; set; } + } - public FormType FormType { get; set; } = FormType.SinglePage; - } + public class SynchronizeCriterionInDto + { + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } + } - /// - /// - /// - public class ReadingQuestionCriterionSystemViewInDto:PageInput - { - public string CriterionName { get; set; }=String.Empty; - } + public class VerifyeCriterionNeedSynchronizeInDto + { + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } + } + public class GetTrialJudgyInfoInDto + { + [NotDefault] + public Guid TrialId { get; set; } - public class CriterionList - { - public Guid Id { get; set; } - - public string Value { get; set; } - - /// - /// 排序 - /// - public int ShowOrder { get; set; } - } - - public class SetSystemReadingQuestionCriterionIsIsEnable - { - [NotDefault] - public Guid Id { get; set; } - - - public bool IsEnable { get; set; } - } - - public class VerifySystemQuestionIsSetJudgeAnswerInDto - { - [NotDefault] - public Guid Id { get; set; } - } - public class SetSystemReadingQuestionCriterionIsIsCompleteConfig - { - [NotDefault] - public Guid Id { get; set; } + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } + } - public bool IsCompleteConfig { get; set; } - } + public class ReadingCriterionPageAddOrEdit + { + public Guid? Id { get; set; } + public Guid TrialId { get; set; } + public string PageName { get; set; } + public bool IsEnable { get; set; } - /// - /// - /// - public class ReadingQuestionCriterionTrialViewInDto : PageInput - { - [NotDefault] - public Guid TrialId { get; set; } + public int ShowOrder { get; set; } = 0; + public Guid ReadingQuestionCriterionTrialId { get; set; } - public string CriterionName { get; set; } = string.Empty; + /// + /// 是否公共分页 + /// + public bool IsPublicPage { get; set; } - } + } - public class ReadingQuestionTrialView - { + public class AddOrUpdateReadingQuestionCriterionTrialInDto + { + public Guid? Id { get; set; } - public Guid Id { get; set; } + [NotDefault] + public Guid TrialId { get; set; } - /// - /// 分组 - /// - public string GroupName { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } = string.Empty; + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 标准 + /// + public string CriterionName { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + + /// + /// 表单类型 + /// + + public FormType FormType { get; set; } = FormType.SinglePage; + + + /// + /// 修约小数点 + /// + public int? DigitPlaces { get; set; } = 2; + + } + + + public class GetPreviewTheQuestionInDto + { + [NotDefault] + public Guid Id { get; set; } + } + + public class AddOrUpdateReadingQuestionCriterionSystemInDto + { + public Guid? Id { get; set; } + + /// + /// eCRF报告是否显示在图像页面 + /// + public bool IseCRFShowInDicomReading { get; set; } = false; + + /// + /// 标准 + /// + public string CriterionName { get; set; } + + /// + /// 描述 + /// + public string Description { get; set; } + + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + + /// + /// 标准类型 + /// + public CriterionType CriterionType { get; set; } + + /// + /// 是否完成配置 + /// + public bool IsCompleteConfig { get; set; } = false; + + + /// + /// 表单类型 + /// + + public FormType FormType { get; set; } = FormType.SinglePage; + } + + /// + /// + /// + public class ReadingQuestionCriterionSystemViewInDto : PageInput + { + public string CriterionName { get; set; } = String.Empty; + } + + public class CriterionList + { + public Guid Id { get; set; } + + public string Value { get; set; } + + /// + /// 排序 + /// + public int ShowOrder { get; set; } + } + + public class SetSystemReadingQuestionCriterionIsIsEnable + { + [NotDefault] + public Guid Id { get; set; } + + + public bool IsEnable { get; set; } + } + + public class VerifySystemQuestionIsSetJudgeAnswerInDto + { + [NotDefault] + public Guid Id { get; set; } + } + public class SetSystemReadingQuestionCriterionIsIsCompleteConfig + { + [NotDefault] + public Guid Id { get; set; } + + + public bool IsCompleteConfig { get; set; } + } + + /// + /// + /// + public class ReadingQuestionCriterionTrialViewInDto : PageInput + { + [NotDefault] + public Guid TrialId { get; set; } + + public string CriterionName { get; set; } = string.Empty; + + } + + + public class ReadingQuestionTrialView + { + + public Guid Id { get; set; } + + /// + /// 分组 + /// + public string GroupName { get; set; } /// /// 分类算法 @@ -858,44 +851,44 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? GroupId { get; set; } - /// - /// 全局阅片显示类型 - /// - public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; + /// + /// 全局阅片显示类型 + /// + public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; - /// - /// 转化显示类型 - /// - public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; + /// + /// 转化显示类型 + /// + public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; - /// - /// 默认值 - /// - public string DefaultValue { get; set; } = string.Empty; + /// + /// 默认值 + /// + public string DefaultValue { get; set; } = string.Empty; - /// - /// 问题类型 - /// - public TableQuestionType? QuestionGenre { get; set; } + /// + /// 问题类型 + /// + public TableQuestionType? QuestionGenre { get; set; } - /// - /// Parent问题类型 - /// - public TableQuestionType? ParentQuestionGenre { get; set; } + /// + /// Parent问题类型 + /// + public TableQuestionType? ParentQuestionGenre { get; set; } - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; - /// - /// Parent字典code - /// - public string ParentDictionaryCode { get; set; } = string.Empty; + /// + /// Parent字典code + /// + public string ParentDictionaryCode { get; set; } = string.Empty; + + public List HighlightAnswerList { get; set; } = new List(); - public List HighlightAnswerList { get; set; } = new List(); - /// @@ -903,133 +896,133 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public Guid ReadingQuestionCriterionTrialId { get; set; } - /// - /// 是否复制病灶 - /// - public bool IsCopyLesions { get; set; } = false; + /// + /// 是否复制病灶 + /// + public bool IsCopyLesions { get; set; } = false; - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - /// - /// 类型 - /// - public string Type { get; set; } + /// + /// 类型 + /// + public string Type { get; set; } - /// - /// 父问题触发 - /// - public string ParentTriggerValue { get; set; } + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 排序 - /// - public int ShowOrder { get; set; } + /// + /// 排序 + /// + public int ShowOrder { get; set; } - /// - /// 父问题ID - /// - public Guid? ParentId { get; set; } + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } - /// - /// 备注 - /// - public string Remark { get; set; } + /// + /// 备注 + /// + public string Remark { get; set; } - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } - public bool IsEnable { get; set; } + public bool IsEnable { get; set; } - public string ParentQuestionName { get; set; } + public string ParentQuestionName { get; set; } - public int? ParentQuestionShowOrder { get; set; } + public int? ParentQuestionShowOrder { get; set; } - /// - /// 是否是裁判问题 - /// - public bool IsJudgeQuestion { get; set; } + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } - /// - /// 标准分页Id - /// - public Guid? ReadingCriterionPageId { get; set; } + /// + /// 标准分页Id + /// + public Guid? ReadingCriterionPageId { get; set; } - /// - /// 关联ID - /// - public Guid? RelevanceId { get; set; } + /// + /// 关联ID + /// + public Guid? RelevanceId { get; set; } - /// - /// 关联Value - /// - public string RelevanceValue { get; set; } = string.Empty; + /// + /// 关联Value + /// + public string RelevanceValue { get; set; } = string.Empty; - public int? RelevanceShowOrder { get; set; } + public int? RelevanceShowOrder { get; set; } - /// - /// Relevance问题类型 - /// - public TableQuestionType? RelevanceQuestionGenre { get; set; } + /// + /// Relevance问题类型 + /// + public TableQuestionType? RelevanceQuestionGenre { get; set; } - /// - /// Relevance字典code - /// - public string RelevanceDictionaryCode { get; set; } = string.Empty; + /// + /// Relevance字典code + /// + public string RelevanceDictionaryCode { get; set; } = string.Empty; - /// - /// 图片数量 - /// - public int ImageCount { get; set; } = 0; + /// + /// 图片数量 + /// + public int ImageCount { get; set; } = 0; - /// - /// 是否是必须 - /// - public IsRequired IsRequired { get; set; } + /// + /// 是否是必须 + /// + public IsRequired IsRequired { get; set; } - /// - /// 是否显示 - /// - public ShowQuestion ShowQuestion { get; set; } + /// + /// 是否显示 + /// + public ShowQuestion ShowQuestion { get; set; } - /// - /// 最大问题数 - /// - public int? MaxQuestionCount { get; set; } + /// + /// 最大问题数 + /// + public int? MaxQuestionCount { get; set; } - /// - /// 病灶类型 - /// - public LesionType? LesionType { get; set; } + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } - /// - /// 问题类型 - /// - public QuestionType? QuestionType { get; set; } + /// + /// 问题类型 + /// + public QuestionType? QuestionType { get; set; } - /// - /// 是否显示在Dicom阅片中 - /// - public bool IsShowInDicom { get; set; } + /// + /// 是否显示在Dicom阅片中 + /// + public bool IsShowInDicom { get; set; } - /// - /// 序号标记 - /// - public string OrderMark { get; set; } = string.Empty; + /// + /// 序号标记 + /// + public string OrderMark { get; set; } = string.Empty; - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 问题分类 @@ -1047,68 +1040,68 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public ValueUnit? Unit { get; set; } - /// - /// 自定义单位 - /// - public string CustomUnit { get; set; } = string.Empty; + /// + /// 自定义单位 + /// + public string CustomUnit { get; set; } = string.Empty; - /// - /// 自定义计算标记 - /// - public CustomCalculateMark? CustomCalculateMark { get; set; } + /// + /// 自定义计算标记 + /// + public CustomCalculateMark? CustomCalculateMark { get; set; } - /// - /// 自定义计算标记 - /// - public string CalculateQuestions { get; set; } + /// + /// 自定义计算标记 + /// + public string CalculateQuestions { get; set; } - /// - /// 限制编辑 - /// - public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + /// + /// 限制编辑 + /// + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; - /// - /// 限制显示 - /// - public LimitShow LimitShow { get; set; } = LimitShow.AllShow; + /// + /// 限制显示 + /// + public LimitShow LimitShow { get; set; } = LimitShow.AllShow; - /// - /// 最大答案长度 - /// - public int? MaxAnswerLength { get; set; } + /// + /// 最大答案长度 + /// + public int? MaxAnswerLength { get; set; } - /// - /// 文件类型 - /// - public string FileType { get; set; } = string.Empty; + /// + /// 文件类型 + /// + public string FileType { get; set; } = string.Empty; - /// - /// 数据来源 - /// - public DataSources? DataSource { get; set; } = DataSources.ManualEntry; + /// + /// 数据来源 + /// + public DataSources? DataSource { get; set; } = DataSources.ManualEntry; - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - /// - /// 问题英文分组 - /// - public string GroupEnName { get; set; } = string.Empty; + /// + /// 问题英文分组 + /// + public string GroupEnName { get; set; } = string.Empty; - public List ParentTriggerValueList { get; set; } = new List(); + public List ParentTriggerValueList { get; set; } = new List(); public List RelevanceValueList { get; set; } = new List(); public List CalculateQuestionList { get; set; } - } + } - public class ReadingQuestionSystemView - { - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + public class ReadingQuestionSystemView + { + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 问题分类 @@ -1125,528 +1118,528 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public List HighlightAnswerList { get; set; } = new List(); - + /// /// 备注 /// public string Remark { get; set; } - /// - /// 数据来源 - /// - public DataSources? DataSource { get; set; } = DataSources.ManualEntry; + /// + /// 数据来源 + /// + public DataSources? DataSource { get; set; } = DataSources.ManualEntry; - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } - /// - /// 限制编辑 - /// - public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + /// + /// 限制编辑 + /// + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; - /// - /// 限制显示 - /// - public LimitShow LimitShow { get; set; } = LimitShow.AllShow; + /// + /// 限制显示 + /// + public LimitShow LimitShow { get; set; } = LimitShow.AllShow; - /// - /// 最大答案长度 - /// - public int? MaxAnswerLength { get; set; } + /// + /// 最大答案长度 + /// + public int? MaxAnswerLength { get; set; } - /// - /// 文件类型 - /// - public string FileType { get; set; } = string.Empty; + /// + /// 文件类型 + /// + public string FileType { get; set; } = string.Empty; - /// - /// Id - /// - public Guid Id { get; set; } + /// + /// Id + /// + public Guid Id { get; set; } - /// - /// 分组 - /// - public string GroupName { get; set; } + /// + /// 分组 + /// + public string GroupName { get; set; } - public Guid? GroupId { get; set; } + public Guid? GroupId { get; set; } - /// - /// 问题类型 - /// - public TableQuestionType? QuestionGenre { get; set; } + /// + /// 问题类型 + /// + public TableQuestionType? QuestionGenre { get; set; } - /// - /// Parent问题类型 - /// - public TableQuestionType? ParentQuestionGenre { get; set; } + /// + /// Parent问题类型 + /// + public TableQuestionType? ParentQuestionGenre { get; set; } - /// - /// 全局阅片显示类型 - /// - public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; + /// + /// 全局阅片显示类型 + /// + public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; - /// - /// 转化显示类型 - /// - public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; + /// + /// 转化显示类型 + /// + public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; - /// - /// 默认值 - /// - public string DefaultValue { get; set; } = string.Empty; + /// + /// 默认值 + /// + public string DefaultValue { get; set; } = string.Empty; - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; - /// - /// Parent字典code - /// - public string ParentDictionaryCode { get; set; } = string.Empty; + /// + /// Parent字典code + /// + public string ParentDictionaryCode { get; set; } = string.Empty; - /// - /// 关联ID - /// - public Guid? RelevanceId { get; set; } + /// + /// 关联ID + /// + public Guid? RelevanceId { get; set; } - /// - /// 关联Value - /// - public string RelevanceValue { get; set; } = string.Empty; + /// + /// 关联Value + /// + public string RelevanceValue { get; set; } = string.Empty; - /// - /// 系统标准Id - /// - public Guid ReadingQuestionCriterionSystemId { get; set; } + /// + /// 系统标准Id + /// + public Guid ReadingQuestionCriterionSystemId { get; set; } - /// - /// 类型 - /// - public string Type { get; set; } + /// + /// 类型 + /// + public string Type { get; set; } - /// - /// 父问题触发 - /// - public string ParentTriggerValue { get; set; } + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 排序 - /// - public int ShowOrder { get; set; } + /// + /// 排序 + /// + public int ShowOrder { get; set; } - /// - /// 父问题ID - /// - public Guid? ParentId { get; set; } + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } - public string ParentQuestionName { get; set; } + public string ParentQuestionName { get; set; } - public int? ParentQuestionShowOrder { get; set; } + public int? ParentQuestionShowOrder { get; set; } - public int? RelevanceShowOrder { get; set; } + public int? RelevanceShowOrder { get; set; } - /// - /// Relevance问题类型 - /// - public TableQuestionType? RelevanceQuestionGenre { get; set; } + /// + /// Relevance问题类型 + /// + public TableQuestionType? RelevanceQuestionGenre { get; set; } - /// - /// Relevance字典code - /// - public string RelevanceDictionaryCode { get; set; } = string.Empty; + /// + /// Relevance字典code + /// + public string RelevanceDictionaryCode { get; set; } = string.Empty; - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } - //public bool IsEnable { get; set; } + //public bool IsEnable { get; set; } - /// - /// 是否是裁判问题 - /// - public bool IsJudgeQuestion { get; set; } + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } - /// - /// 图片数量 - /// - public int ImageCount { get; set; } + /// + /// 图片数量 + /// + public int ImageCount { get; set; } - /// - /// 是否是必须 - /// - public IsRequired IsRequired { get; set; } + /// + /// 是否是必须 + /// + public IsRequired IsRequired { get; set; } - /// - /// 是否显示 - /// - public ShowQuestion ShowQuestion { get; set; } + /// + /// 是否显示 + /// + public ShowQuestion ShowQuestion { get; set; } - /// - /// 最大问题数 - /// - public int? MaxQuestionCount { get; set; } + /// + /// 最大问题数 + /// + public int? MaxQuestionCount { get; set; } - /// - /// 病灶类型 - /// - public LesionType? LesionType { get; set; } + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } - /// - /// 问题类型 - /// - public QuestionType? QuestionType { get; set; } + /// + /// 问题类型 + /// + public QuestionType? QuestionType { get; set; } - /// - /// 是否显示在Dicom阅片中 - /// - public bool IsShowInDicom { get; set; } + /// + /// 是否显示在Dicom阅片中 + /// + public bool IsShowInDicom { get; set; } - /// - /// 序号标记 - /// - public string OrderMark { get; set; } = string.Empty; + /// + /// 序号标记 + /// + public string OrderMark { get; set; } = string.Empty; - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - /// - /// 问题英文分组 - /// - public string GroupEnName { get; set; } = string.Empty; - } + /// + /// 问题英文分组 + /// + public string GroupEnName { get; set; } = string.Empty; + } - public class GetQuestionCalculateRelationInDto - { - public Guid? TrialReadingCriterionId { get; set; } + public class GetQuestionCalculateRelationInDto + { + public Guid? TrialReadingCriterionId { get; set; } - public Guid? ReadingQuestionId { get; set; } + public Guid? ReadingQuestionId { get; set; } - public bool IsGetAll { get; set; } = false; + public bool IsGetAll { get; set; } = false; - } + } - //public class GetQuestionCalculateRelationOutDto - //{ - // public List CalculateRelationList { get; set; } - //} + //public class GetQuestionCalculateRelationOutDto + //{ + // public List CalculateRelationList { get; set; } + //} - public class CalculateRelationDto - { - public Guid QuestionId { get; set; } + public class CalculateRelationDto + { + public Guid QuestionId { get; set; } - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 自定义计算标记 - /// - public CustomCalculateMark? CustomCalculateMark { get; set; } + /// + /// 自定义计算标记 + /// + public CustomCalculateMark? CustomCalculateMark { get; set; } - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } - /// - /// 自定义单位 - /// - public string CustomUnit { get; set; } = string.Empty; + /// + /// 自定义单位 + /// + public string CustomUnit { get; set; } = string.Empty; - public List CalculateQuestionList { get; set; } - } + public List CalculateQuestionList { get; set; } + } - public class ReadingQuestionTrialViewInDto - { - /// - /// 系统标准Id - /// - [NotDefault] - public Guid ReadingQuestionCriterionTrialId { get; set; } + public class ReadingQuestionTrialViewInDto + { + /// + /// 系统标准Id + /// + [NotDefault] + public Guid ReadingQuestionCriterionTrialId { get; set; } - /// - /// 类型 - /// - public string Type { get; set; } = string.Empty; + /// + /// 类型 + /// + public string Type { get; set; } = string.Empty; - /// - /// 问题名称 - /// - public string QuestionName { get; set; } = string.Empty; + /// + /// 问题名称 + /// + public string QuestionName { get; set; } = string.Empty; - public Guid? ReadingCriterionPageId { get; set; } - } + public Guid? ReadingCriterionPageId { get; set; } + } - /// - /// 获取其他问题返回的Dto - /// - public class CriterionOtherQuestionOutDto - { - public Guid QuestionId { get; set; } + /// + /// 获取其他问题返回的Dto + /// + public class CriterionOtherQuestionOutDto + { + public Guid QuestionId { get; set; } - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; - /// - /// 问题类型 - /// - public TableQuestionType? QuestionGenre { get; set; } + /// + /// 问题类型 + /// + public TableQuestionType? QuestionGenre { get; set; } - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } - public string GroupName { get; set; } + public string GroupName { get; set; } - public Guid? GroupId { get; set; } - } + public Guid? GroupId { get; set; } + } - public class SetTrialQuestionIsIsJudgeQuestionInDto - { - [NotDefault] - public Guid Id { get; set; } + public class SetTrialQuestionIsIsJudgeQuestionInDto + { + [NotDefault] + public Guid Id { get; set; } - /// - /// 是否是裁判问题 - /// - public bool IsJudgeQuestion { get; set; } - } + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } + } - public class GetCalculateQuestionsOutDto - { - public Guid QuestionId { get; set; } + public class GetCalculateQuestionsOutDto + { + public Guid QuestionId { get; set; } - public string QuestionName{ get; set; } + public string QuestionName { get; set; } - public List TableQuestions { get; set; } - } + public List TableQuestions { get; set; } + } - public class CalculateQuestion - { - public Guid QuestionId { get; set; } + public class CalculateQuestion + { + public Guid QuestionId { get; set; } - public string QuestionName { get; set; } - } + public string QuestionName { get; set; } + } - public class GetCalculateTableQuestionsOutDto - { - public Guid QuestionId { get; set; } + public class GetCalculateTableQuestionsOutDto + { + public Guid QuestionId { get; set; } - public string QuestionName { get; set; } - } + public string QuestionName { get; set; } + } - public class GetCalculateTableQuestionsInDto - { - [NotDefault] - public Guid QuestionId { get; set; } + public class GetCalculateTableQuestionsInDto + { + [NotDefault] + public Guid QuestionId { get; set; } - public string Type { get; set; } + public string Type { get; set; } - } + } - public class GetCustomQuestionPreviewInDto - { - [NotDefault] - public Guid TrialReadingCriterionId { get; set; } - } - public class GetCalculateQuestionsInDto - { - [NotDefault] - public Guid TrialCriterionId { get; set; } + public class GetCustomQuestionPreviewInDto + { + [NotDefault] + public Guid TrialReadingCriterionId { get; set; } + } + public class GetCalculateQuestionsInDto + { + [NotDefault] + public Guid TrialCriterionId { get; set; } - public string Type { get; set; } + public string Type { get; set; } - } + } - public class GetTrialGroupNameOutDto - { - public Guid GroupId { get; set; } + public class GetTrialGroupNameOutDto + { + public Guid GroupId { get; set; } - public string GroupName { get; set; } = string.Empty; + public string GroupName { get; set; } = string.Empty; - } - public class GetTrialGroupNameListInDto - { - /// - /// 标准ID - /// - public Guid CriterionId { get; set; } + } + public class GetTrialGroupNameListInDto + { + /// + /// 标准ID + /// + public Guid CriterionId { get; set; } - public Guid? ReadingCriterionPageId { get; set; } - } + public Guid? ReadingCriterionPageId { get; set; } + } - public class GetReadingTableOtherQuestionSystemInDto - { - /// - /// 表格父问题的ID - /// - [NotDefault] - public Guid ReadingQuestionId { get; set; } + public class GetReadingTableOtherQuestionSystemInDto + { + /// + /// 表格父问题的ID + /// + [NotDefault] + public Guid ReadingQuestionId { get; set; } - /// - /// 当前ID - /// - public Guid? Id { get; set; } - } + /// + /// 当前ID + /// + public Guid? Id { get; set; } + } - public class GetTrialCriterionOtherQuestionInDto - { - [NotDefault] - public Guid ReadingQuestionCriterionTrialId { get; set; } - - /// - /// 当前ID - /// - public Guid? Id { get; set; } - - public Guid? ReadingCriterionPageId { get; set; } - } - - public class GetSystemCriterionOtherQuestionInDto - { - [NotDefault] - public Guid ReadingQuestionCriterionSystemId { get; set; } - - /// - /// 当前ID - /// - public Guid? Id { get; set; } - } - - public class ReadingQuestionSystemViewInDto : PageInput - { - /// - /// 系统标准Id - /// - [NotDefault] - public Guid ReadingQuestionCriterionSystemId { get; set; } - - /// - /// 类型 - /// - public string Type { get; set; } = string.Empty; - - /// - /// 问题名称 - /// - public string QuestionName { get; set; } = string.Empty; - } - - public class TrialQuestion - { - public Guid Id { get; set; } - - /// - /// 父问题ID - /// - public Guid? ParentId { get; set; } - - /// - /// 项目标准Id - /// - public Guid ReadingQuestionCriterionTrialId { get; set; } - - /// - /// 系统问题ID - /// - public Guid? ReadingQuestionSystemId { get; set; } - - public Guid? ReadingCriterionPageId { get; set; } - - /// - /// 系统标准的ParentId - /// - public Guid? SystemParentId { get; set; } - - /// - /// 答案分组 - /// - public string AnswerGroup { get; set; } = string.Empty; - - /// - /// 答案组合 - /// - public string AnswerCombination { get; set; } = string.Empty; - - /// - /// 裁判类型 - /// - public JudgeTypeEnum JudgeType { get; set; } - - - /// - /// 关联ID - /// - public Guid? RelevanceId { get; set; } - - /// - /// 关联Value - /// - public string RelevanceValue { get; set; } = string.Empty; - /// - /// 图片数量 - /// - public int ImageCount { get; set; } - } - public class AddOrUpdateReadingQuestionSystemInDto - { - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + public class GetTrialCriterionOtherQuestionInDto + { + [NotDefault] + public Guid ReadingQuestionCriterionTrialId { get; set; } + + /// + /// 当前ID + /// + public Guid? Id { get; set; } + + public Guid? ReadingCriterionPageId { get; set; } + } + + public class GetSystemCriterionOtherQuestionInDto + { + [NotDefault] + public Guid ReadingQuestionCriterionSystemId { get; set; } + + /// + /// 当前ID + /// + public Guid? Id { get; set; } + } + + public class ReadingQuestionSystemViewInDto : PageInput + { + /// + /// 系统标准Id + /// + [NotDefault] + public Guid ReadingQuestionCriterionSystemId { get; set; } + + /// + /// 类型 + /// + public string Type { get; set; } = string.Empty; + + /// + /// 问题名称 + /// + public string QuestionName { get; set; } = string.Empty; + } + + public class TrialQuestion + { + public Guid Id { get; set; } + + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } + + /// + /// 项目标准Id + /// + public Guid ReadingQuestionCriterionTrialId { get; set; } + + /// + /// 系统问题ID + /// + public Guid? ReadingQuestionSystemId { get; set; } + + public Guid? ReadingCriterionPageId { get; set; } + + /// + /// 系统标准的ParentId + /// + public Guid? SystemParentId { get; set; } + + /// + /// 答案分组 + /// + public string AnswerGroup { get; set; } = string.Empty; + + /// + /// 答案组合 + /// + public string AnswerCombination { get; set; } = string.Empty; + + /// + /// 裁判类型 + /// + public JudgeTypeEnum JudgeType { get; set; } + + + /// + /// 关联ID + /// + public Guid? RelevanceId { get; set; } + + /// + /// 关联Value + /// + public string RelevanceValue { get; set; } = string.Empty; + /// + /// 图片数量 + /// + public int ImageCount { get; set; } + } + public class AddOrUpdateReadingQuestionSystemInDto + { + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 问题分类 @@ -1663,13 +1656,13 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public LimitEdit LimitEdit { get; set; } = LimitEdit.None; - /// - /// 限制显示 - /// - public LimitShow LimitShow { get; set; } = LimitShow.AllShow; + /// + /// 限制显示 + /// + public LimitShow LimitShow { get; set; } = LimitShow.AllShow; - - public List HighlightAnswerList { get; set; }= new List(); + + public List HighlightAnswerList { get; set; } = new List(); /// @@ -1677,68 +1670,68 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public int? MaxAnswerLength { get; set; } - /// - /// 文件类型 - /// - public string FileType { get; set; }=string.Empty; + /// + /// 文件类型 + /// + public string FileType { get; set; } = string.Empty; - /// - /// 数据来源 - /// - public DataSources? DataSource { get; set; } = DataSources.ManualEntry; + /// + /// 数据来源 + /// + public DataSources? DataSource { get; set; } = DataSources.ManualEntry; - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } - /// - /// 全局阅片显示类型 - /// - public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; + /// + /// 全局阅片显示类型 + /// + public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; - /// - /// 转化显示类型 - /// - public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; + /// + /// 转化显示类型 + /// + public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; - /// - /// 默认值 - /// - public string DefaultValue { get; set; } = string.Empty; + /// + /// 默认值 + /// + public string DefaultValue { get; set; } = string.Empty; - /// - /// 分组 - /// - public string GroupName { get; set; } + /// + /// 分组 + /// + public string GroupName { get; set; } - public Guid? GroupId { get; set; } + public Guid? GroupId { get; set; } - /// - /// Id - /// - public Guid? Id { get; set; } + /// + /// Id + /// + public Guid? Id { get; set; } - /// - /// 问题类型 - /// - public TableQuestionType? QuestionGenre { get; set; } + /// + /// 问题类型 + /// + public TableQuestionType? QuestionGenre { get; set; } - /// - /// 系统标准Id - /// - public Guid ReadingQuestionCriterionSystemId { get; set; } + /// + /// 系统标准Id + /// + public Guid ReadingQuestionCriterionSystemId { get; set; } - /// - /// 关联ID - /// - public Guid? RelevanceId { get; set; } + /// + /// 关联ID + /// + public Guid? RelevanceId { get; set; } - /// - /// 关联Value - /// - public string RelevanceValue { get; set; } = string.Empty; + /// + /// 关联Value + /// + public string RelevanceValue { get; set; } = string.Empty; /// /// 高亮问题的答案 @@ -1750,103 +1743,103 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string Type { get; set; } - /// - /// 父问题触发 - /// - public string ParentTriggerValue { get; set; } = string.Empty; + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } = string.Empty; - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 排序 - /// - public int ShowOrder { get; set; } = 0; + /// + /// 排序 + /// + public int ShowOrder { get; set; } = 0; - /// - /// 父问题ID - /// - public Guid? ParentId { get; set; } + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } - /// - /// 是否是裁判问题 - /// - public bool IsJudgeQuestion { get; set; } = false; + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } = false; - /// - /// 备注 - /// - public string Remark { get; set; } = string.Empty; + /// + /// 备注 + /// + public string Remark { get; set; } = string.Empty; - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } - public bool IsEnable { get; set; } = false; + public bool IsEnable { get; set; } = false; - /// - /// 是否是必须 - /// - public IsRequired IsRequired { get; set; } + /// + /// 是否是必须 + /// + public IsRequired IsRequired { get; set; } - /// - /// 是否显示 - /// - public ShowQuestion ShowQuestion { get; set; } + /// + /// 是否显示 + /// + public ShowQuestion ShowQuestion { get; set; } - /// - /// 图片数量 - /// - public int ImageCount { get; set; } = 1; + /// + /// 图片数量 + /// + public int ImageCount { get; set; } = 1; - /// - /// 最大问题数 - /// - public int? MaxQuestionCount { get; set; } + /// + /// 最大问题数 + /// + public int? MaxQuestionCount { get; set; } - /// - /// 病灶类型 - /// - public LesionType? LesionType { get; set; } + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } - /// - /// 问题类型 - /// - public QuestionType? QuestionType { get; set; } + /// + /// 问题类型 + /// + public QuestionType? QuestionType { get; set; } - /// - /// 是否显示在Dicom阅片中 - /// - public bool IsShowInDicom { get; set; } = false; + /// + /// 是否显示在Dicom阅片中 + /// + public bool IsShowInDicom { get; set; } = false; - /// - /// 序号标记 - /// - public string OrderMark { get; set; } = string.Empty; + /// + /// 序号标记 + /// + public string OrderMark { get; set; } = string.Empty; - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - /// - /// 问题英文分组 - /// - public string GroupEnName { get; set; } = string.Empty; + /// + /// 问题英文分组 + /// + public string GroupEnName { get; set; } = string.Empty; public List ParentTriggerValueList { get; set; } = new List(); public List RelevanceValueList { get; set; } = new List(); @@ -1854,12 +1847,12 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto - public class AddOrUpdateReadingQuestionTrialInDto - { - /// - /// Id - /// - public Guid? Id { get; set; } + public class AddOrUpdateReadingQuestionTrialInDto + { + /// + /// Id + /// + public Guid? Id { get; set; } public bool IsAdditional { get; set; } @@ -1868,7 +1861,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public string HighlightAnswer { get; set; } = "[]"; - public List HighlightAnswerList { get; set; } = new List(); + public List HighlightAnswerList { get; set; } = new List(); /// /// 分类算法 @@ -1881,162 +1874,162 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid? ClassifyQuestionId { get; set; } public Guid TrialId { get; set; } - /// - /// 是否复制病灶 - /// - public bool IsCopyLesions { get; set; } = false; + /// + /// 是否复制病灶 + /// + public bool IsCopyLesions { get; set; } = false; - /// - /// 全局阅片显示类型 - /// - public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; + /// + /// 全局阅片显示类型 + /// + public GlobalReadingShowType GlobalReadingShowType { get; set; } = GlobalReadingShowType.NotShow; - /// - /// 转化显示类型 - /// - public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; + /// + /// 转化显示类型 + /// + public ConvertShowType ConvertShowType { get; set; } = ConvertShowType.All; - /// - /// 默认值 - /// - public string DefaultValue { get; set; } =string.Empty; + /// + /// 默认值 + /// + public string DefaultValue { get; set; } = string.Empty; - /// - /// 系统标准Id - /// - public Guid ReadingQuestionCriterionTrialId { get; set; } + /// + /// 系统标准Id + /// + public Guid ReadingQuestionCriterionTrialId { get; set; } - /// - /// 问题类型 - /// - public TableQuestionType? QuestionGenre { get; set; } + /// + /// 问题类型 + /// + public TableQuestionType? QuestionGenre { get; set; } - /// - /// 字典code - /// - public string DictionaryCode { get; set; } = string.Empty; + /// + /// 字典code + /// + public string DictionaryCode { get; set; } = string.Empty; - /// - /// 是否是裁判问题 - /// - public bool IsJudgeQuestion { get; set; } = false; + /// + /// 是否是裁判问题 + /// + public bool IsJudgeQuestion { get; set; } = false; - /// - /// 备注 - /// - public string Remark { get; set; } = string.Empty; + /// + /// 备注 + /// + public string Remark { get; set; } = string.Empty; - /// - /// 分组 - /// - public string GroupName { get; set; } + /// + /// 分组 + /// + public string GroupName { get; set; } - public Guid? GroupId { get; set; } + public Guid? GroupId { get; set; } - /// - /// 答案分组 - /// - public string AnswerGroup { get; set; }=String.Empty; + /// + /// 答案分组 + /// + public string AnswerGroup { get; set; } = String.Empty; - /// - /// 类型 - /// - public string Type { get; set; } + /// + /// 类型 + /// + public string Type { get; set; } - /// - /// 父问题触发 - /// - public string ParentTriggerValue { get; set; } = string.Empty; + /// + /// 父问题触发 + /// + public string ParentTriggerValue { get; set; } = string.Empty; - /// - /// 问题名称 - /// - public string QuestionName { get; set; } + /// + /// 问题名称 + /// + public string QuestionName { get; set; } - /// - /// 排序 - /// - public int ShowOrder { get; set; } = 0; + /// + /// 排序 + /// + public int ShowOrder { get; set; } = 0; - /// - /// 父问题ID - /// - public Guid? ParentId { get; set; } + /// + /// 父问题ID + /// + public Guid? ParentId { get; set; } - /// - /// 类型值 - /// - public string TypeValue { get; set; } + /// + /// 类型值 + /// + public string TypeValue { get; set; } - public bool IsEnable { get; set; } = false; + public bool IsEnable { get; set; } = false; - /// - /// 标准分页Id - /// - public Guid? ReadingCriterionPageId { get; set; } + /// + /// 标准分页Id + /// + public Guid? ReadingCriterionPageId { get; set; } - /// - /// 关联ID - /// - public Guid? RelevanceId { get; set; } + /// + /// 关联ID + /// + public Guid? RelevanceId { get; set; } - /// - /// 关联Value - /// - public string RelevanceValue { get; set; } = string.Empty; + /// + /// 关联Value + /// + public string RelevanceValue { get; set; } = string.Empty; - /// - /// 图片数量 - /// - public int ImageCount { get; set; } = 0; + /// + /// 图片数量 + /// + public int ImageCount { get; set; } = 0; - /// - /// 是否是必须 - /// - public IsRequired IsRequired { get; set; } + /// + /// 是否是必须 + /// + public IsRequired IsRequired { get; set; } - /// - /// 是否显示 - /// - public ShowQuestion ShowQuestion { get; set; } + /// + /// 是否显示 + /// + public ShowQuestion ShowQuestion { get; set; } - /// - /// 最大问题数 - /// - public int? MaxQuestionCount { get; set; } + /// + /// 最大问题数 + /// + public int? MaxQuestionCount { get; set; } - /// - /// 病灶类型 - /// - public LesionType? LesionType { get; set; } + /// + /// 病灶类型 + /// + public LesionType? LesionType { get; set; } - /// - /// 问题类型 - /// - public QuestionType? QuestionType { get; set; } + /// + /// 问题类型 + /// + public QuestionType? QuestionType { get; set; } - /// - /// 是否显示在Dicom阅片中 - /// - public bool IsShowInDicom { get; set; } = false; + /// + /// 是否显示在Dicom阅片中 + /// + public bool IsShowInDicom { get; set; } = false; - /// - /// 序号标记 - /// - public string OrderMark { get; set; } = string.Empty; + /// + /// 序号标记 + /// + public string OrderMark { get; set; } = string.Empty; - /// - /// 数值类型 - /// - public ValueOfType? ValueType { get; set; } + /// + /// 数值类型 + /// + public ValueOfType? ValueType { get; set; } /// /// 问题分类 @@ -2053,197 +2046,197 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto /// public DataSources? DataSource { get; set; } = DataSources.ManualEntry; - /// - /// 单位 - /// - public ValueUnit? Unit { get; set; } + /// + /// 单位 + /// + public ValueUnit? Unit { get; set; } - /// - /// 限制编辑 - /// - public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + /// + /// 限制编辑 + /// + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; - /// - /// 限制显示 - /// - public LimitShow LimitShow { get; set; } = LimitShow.AllShow; + /// + /// 限制显示 + /// + public LimitShow LimitShow { get; set; } = LimitShow.AllShow; - /// - /// 最大答案长度 - /// - public int? MaxAnswerLength { get; set; } + /// + /// 最大答案长度 + /// + public int? MaxAnswerLength { get; set; } - /// - /// 文件类型 - /// - public string FileType { get; set; } = string.Empty; + /// + /// 文件类型 + /// + public string FileType { get; set; } = string.Empty; - /// - /// 自定义单位 - /// - public string CustomUnit { get; set; } = string.Empty; + /// + /// 自定义单位 + /// + public string CustomUnit { get; set; } = string.Empty; - /// - /// 自定义计算标记 - /// - public CustomCalculateMark? CustomCalculateMark { get; set; } + /// + /// 自定义计算标记 + /// + public CustomCalculateMark? CustomCalculateMark { get; set; } - /// - /// 自定义计算标记 - /// - public string CalculateQuestions { get; set; } = "[]"; + /// + /// 自定义计算标记 + /// + public string CalculateQuestions { get; set; } = "[]"; - /// - /// 问题英文名称 - /// - public string QuestionEnName { get; set; } = string.Empty; + /// + /// 问题英文名称 + /// + public string QuestionEnName { get; set; } = string.Empty; - /// - /// 问题英文分组 - /// - public string GroupEnName { get; set; } = string.Empty; + /// + /// 问题英文分组 + /// + public string GroupEnName { get; set; } = string.Empty; - public List ParentTriggerValueList { get; set; } = new List(); + public List ParentTriggerValueList { get; set; } = new List(); public List RelevanceValueList { get; set; } = new List(); } - public class GetSystemCriterionSelectDto - { - /// - /// 返回的对象 - /// - public Guid Id { get; set; } + public class GetSystemCriterionSelectDto + { + /// + /// 返回的对象 + /// + public Guid Id { get; set; } - /// - /// 标准 - /// - public string CriterionName { get; set; } + /// + /// 标准 + /// + public string CriterionName { get; set; } - } + } - public class ReadingQuestionCriterionSystemView - { - /// - /// 返回的对象 - /// - public Guid Id { get; set; } + public class ReadingQuestionCriterionSystemView + { + /// + /// 返回的对象 + /// + public Guid Id { get; set; } - /// - /// 标准ID - /// - public Guid CriterionId { get; set; } + /// + /// 标准ID + /// + public Guid CriterionId { get; set; } - /// - /// 标准 - /// - public string CriterionName { get; set; } + /// + /// 标准 + /// + public string CriterionName { get; set; } - public int ShowOrder { get; set; } + public int ShowOrder { get; set; } - /// - /// 是否启用 - /// - public bool IsEnable { get; set; } + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } - /// - /// eCRF报告是否显示在图像页面 - /// - public bool IseCRFShowInDicomReading { get; set; } = false; + /// + /// eCRF报告是否显示在图像页面 + /// + public bool IseCRFShowInDicomReading { get; set; } = false; - /// - /// 标准类型 - /// - public CriterionType CriterionType { get; set; } + /// + /// 标准类型 + /// + public CriterionType CriterionType { get; set; } - /// - /// 是否完成配置 - /// - public bool IsCompleteConfig { get; set; } + /// + /// 是否完成配置 + /// + public bool IsCompleteConfig { get; set; } - public int QuestionCount { get; set; } + public int QuestionCount { get; set; } - /// - /// 描述 - /// - public string Description { get; set; } - public bool IsBeUsed { get; set; } = false; - } + /// + /// 描述 + /// + public string Description { get; set; } + public bool IsBeUsed { get; set; } = false; + } - public class ReadingQuestionCriterionTrialView - { - /// - /// 返回的对象 - /// - public Guid Id { get; set; } + public class ReadingQuestionCriterionTrialView + { + /// + /// 返回的对象 + /// + public Guid Id { get; set; } - /// - /// 系统标准ID - /// - public Guid? ReadingQuestionCriterionSystemId { get; set; } + /// + /// 系统标准ID + /// + public Guid? ReadingQuestionCriterionSystemId { get; set; } - /// - /// 标准 - /// - public string CriterionName { get; set; } + /// + /// 标准 + /// + public string CriterionName { get; set; } - /// - /// 是否启用 - /// - public bool IsEnable { get; set; } + /// + /// 是否启用 + /// + public bool IsEnable { get; set; } - /// - /// 是否完成配置 - /// - public bool IsCompleteConfig { get; set; } + /// + /// 是否完成配置 + /// + public bool IsCompleteConfig { get; set; } - public int QuestionCount { get; set; } + public int QuestionCount { get; set; } - public bool IsBeUsed { get; set; } = false; + public bool IsBeUsed { get; set; } = false; - /// - /// 表单类型 - /// + /// + /// 表单类型 + /// - public FormType FormType { get; set; } + public FormType FormType { get; set; } - /// - /// 描述 - /// - public string Description { get; set; } + /// + /// 描述 + /// + public string Description { get; set; } - /// - /// 修约小数点 - /// - public int? DigitPlaces { get; set; } = 2; + /// + /// 修约小数点 + /// + public int? DigitPlaces { get; set; } = 2; - /// - /// 排序 - /// - public int ShowOrder { get; set; } + /// + /// 排序 + /// + public int ShowOrder { get; set; } - /// - /// 标准类型 - /// - public CriterionType CriterionType { get; set; } + /// + /// 标准类型 + /// + public CriterionType CriterionType { get; set; } - /// - /// 是否是系统数据 - /// - public bool IsSystemData - { - get - { - return this.ReadingQuestionCriterionSystemId != null; - } - } - } + /// + /// 是否是系统数据 + /// + public bool IsSystemData + { + get + { + return this.ReadingQuestionCriterionSystemId != null; + } + } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs index 7e85dbd38..ad9d98931 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/UserWLTemplateViewModel.cs @@ -3,53 +3,50 @@ // 生成时间 2023-05-08 15:20:44 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; namespace IRaCIS.Core.Application.ViewModel -{ - /// UserWLTemplateView 列表视图模型 - public class UserWLTemplateView - { - public Guid Id { get; set; } - public string TemplateName { get; set; } - public Guid UserId { get; set; } - public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - public int WW { get; set; } - public int WL { get; set; } - public int ShowOrder { get; set; } = 0; - public bool IsPitchOn { get; set; } - } +{ + /// UserWLTemplateView 列表视图模型 + public class UserWLTemplateView + { + public Guid Id { get; set; } + public string TemplateName { get; set; } + public Guid UserId { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public int WW { get; set; } + public int WL { get; set; } + public int ShowOrder { get; set; } = 0; + public bool IsPitchOn { get; set; } + } - ///UserWLTemplateQuery 列表查询参数模型 - public class UserWLTemplateQuery - { - /// TemplateName + ///UserWLTemplateQuery 列表查询参数模型 + public class UserWLTemplateQuery + { + /// TemplateName - } + } - public class SetAutoCutNextTaskInDto - { - public bool AutoCutNextTask { get; set; } - } + public class SetAutoCutNextTaskInDto + { + public bool AutoCutNextTask { get; set; } + } + + /// UserWLTemplateAddOrEdit 列表查询参数模型 + public class UserWLTemplateAddOrEdit + { + public Guid? Id { get; set; } + public string TemplateName { get; set; } + public Guid UserId { get; set; } + public DateTime CreateTime { get; set; } + public Guid CreateUserId { get; set; } + public int WW { get; set; } + public int WL { get; set; } + //public int ShowOrder { get; set; } + //public bool IsPitchOn { get; set; } + } - /// UserWLTemplateAddOrEdit 列表查询参数模型 - public class UserWLTemplateAddOrEdit - { - public Guid? Id { get; set; } - public string TemplateName { get; set; } - public Guid UserId { get; set; } - public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - public int WW { get; set; } - public int WL { get; set; } - //public int ShowOrder { get; set; } - //public bool IsPitchOn { get; set; } - } - } diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/VisitTaskDto.cs b/IRaCIS.Core.Application/Service/Reading/Dto/VisitTaskDto.cs index b5f65682c..f322de639 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/VisitTaskDto.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/VisitTaskDto.cs @@ -1,12 +1,7 @@ using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Dto { @@ -231,7 +226,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public bool IsAnalysisCreate { get; set; } - + /// /// 转换之前的任务Id(转化的任务才有该值) @@ -241,7 +236,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto // [Projectable] - public bool IsConvertedTask { get; set; } + public bool IsConvertedTask { get; set; } //[NotMapped] //public List CrterionDictionaryGroup @@ -296,7 +291,7 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto //前序任务需要签名 但是未签名 public bool IsFrontTaskNeedSignButNotSign { get; set; } - + /// /// 裁判结果图片地址 /// diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalAnswerService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalAnswerService.cs index c3decdd72..ea7fd3f4b 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalAnswerService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalAnswerService.cs @@ -1,23 +1,18 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Reading.Interface { - public interface IClinicalAnswerService - { - Task CRCSignClinicalData(CRCSignClinicalDataInDto inDto); + public interface IClinicalAnswerService + { + Task CRCSignClinicalData(CRCSignClinicalDataInDto inDto); - Task DeleteStudyClinical(DeleteStudyClinicalInDto inDto); + Task DeleteStudyClinical(DeleteStudyClinicalInDto inDto); - Task AddStudyClinical(AddStudyClinicalInDto inDto); + Task AddStudyClinical(AddStudyClinicalInDto inDto); - Task AutoAddCRCClinical(AutoAddClinicalInDto inDto); + Task AutoAddCRCClinical(AutoAddClinicalInDto inDto); Task PMConfirmClinical(CRCConfirmClinicalInDto inDto); diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalQuestionService.cs index dc7a489c7..159848bc3 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IClinicalQuestionService.cs @@ -5,7 +5,6 @@ //-------------------------------------------------------------------- using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces { /// @@ -18,8 +17,8 @@ namespace IRaCIS.Core.Application.Interfaces Task SynchronizationQuestion(List inDto); - void FindChildQuestion(ClinicalQuestionPreviewDto item, List questions, List tableQuestions, List answers, List tableAnswers); + void FindChildQuestion(ClinicalQuestionPreviewDto item, List questions, List tableQuestions, List answers, List tableAnswers); } -} +} diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs index dc0d219ab..63722cdaf 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IOrganInfoService.cs @@ -6,25 +6,25 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// IOrganInfoService - /// - public interface IOrganInfoService +{ + /// + /// IOrganInfoService + /// + public interface IOrganInfoService { - - Task> GetOrganInfoList(OrganInfoQuery inQuery); - - Task AddOrUpdateOrganInfo(OrganInfoAddOrEdit addOrEditOrganInfo); - Task DeleteOrganInfo(Guid organInfoId); + Task> GetOrganInfoList(OrganInfoQuery inQuery); + + Task AddOrUpdateOrganInfo(OrganInfoAddOrEdit addOrEditOrganInfo); + + Task DeleteOrganInfo(Guid organInfoId); Task SynchronizeSystemOrganToTrial(SynchronizeSystemOrganToTrialInDto inDto); } -} +} diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadModuleService.cs index 8630bf0c2..c0332f8bc 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadModuleService.cs @@ -4,13 +4,10 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- - -using IRaCIS.Core.Domain.Share; - namespace IRaCIS.Core.Application.Contracts { public interface IReadModuleService { - + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingClinicalDataService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingClinicalDataService.cs index 24c4a39ad..16c618a2c 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingClinicalDataService.cs @@ -7,7 +7,6 @@ using IRaCIS.Core.Application.Service.Inspection.DTO; using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Contracts { @@ -20,15 +19,15 @@ namespace IRaCIS.Core.Application.Contracts Task> GetClinicalDataList(GetReadingOrTaskClinicalDataListInDto inDto); - // Task<(List, object)> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto); + // Task<(List, object)> GetReadingClinicalDataList(GetReadingClinicalDataListIndto inDto); Task> GetStudyClinicalData(GetStudyClinicalDataInDto inDto); - Task> GetCRCClinicalData(GetCRCClinicalDataInDto inDto); + Task> GetCRCClinicalData(GetCRCClinicalDataInDto inDto); - Task DealVisiTaskClinicalDataSignedAsync(Guid trialId, Guid subjectId, Guid readingId, bool isVisit, Guid trialReadingCritrialId); + Task DealVisiTaskClinicalDataSignedAsync(Guid trialId, Guid subjectId, Guid readingId, bool isVisit, Guid trialReadingCritrialId); Task SignConsistencyAnalysisReadingClinicalData(SignConsistencyAnalysisReadingClinicalDataInDto inDto); diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs index 22e12adaa..45c59a834 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingImageTaskService.cs @@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.Contracts Task GetGlobalReadingInfo(GetGlobalReadingInfoInDto inDto); - Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId,QuestionClassify? questionClassify, List? groupClassifyList); + Task> GetReadingQuestion(Guid trialReadingCriterionId, Guid? visitTaskId, QuestionClassify? questionClassify, List? groupClassifyList); Task GetReadingTableQuestion(GetReadingTableQuestionOrAnswerInDto inDto); @@ -41,5 +41,5 @@ namespace IRaCIS.Core.Application.Contracts Task> GetReadingPastResultList(GetReadingPastResultListInDto inDto); - } + } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingMedicineQuestionService.cs index 5015eae36..a9df248ff 100644 --- a/IRaCIS.Core.Application/Service/Reading/Interface/IReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/Interface/IReadingMedicineQuestionService.cs @@ -6,7 +6,6 @@ using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs index d1e69b770..693b94dca 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicalReviewService.cs @@ -1,24 +1,21 @@ - -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infra.EFCore.Common; -using MassTransit; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Panda.DynamicWebApi.Attributes; using IRaCIS.Core.Application.Contracts; -using Newtonsoft.Json; using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Panda.DynamicWebApi.Attributes; namespace IRaCIS.Core.Application.Service -{ - /// - /// 阅片医学审核 - /// - [ ApiExplorerSettings(GroupName = "Reading")] +{ + /// + /// 阅片医学审核 + /// + [ApiExplorerSettings(GroupName = "Reading")] public class ReadingMedicalReviewService( IRepository _readingMedicineTrialQuestionRepository, IRepository _trialRepository, @@ -36,19 +33,19 @@ namespace IRaCIS.Core.Application.Service ITrialEmailNoticeConfigService _trialEmailNoticeConfigService) : BaseService, IReadingMedicalReviewService { - - /// - /// 获取医学审核任务信息 - /// - /// - /// + + /// + /// 获取医学审核任务信息 + /// + /// + /// [HttpPost] - public async Task GetMedicalReviewReadingTask(GetMedicalReviewReadingTaskInDto inDto) - { - MedicalReviewInfo reviewInfo= await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId) + public async Task GetMedicalReviewReadingTask(GetMedicalReviewReadingTaskInDto inDto) + { + MedicalReviewInfo reviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId) .ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); - var taskInfo = await _visitTaskRepository.Where(x => x.Id == reviewInfo.VisitTaskId).Include(x=>x.DoctorUser).Include(x => x.Subject).FirstNotNullAsync(); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == reviewInfo.VisitTaskId).Include(x => x.DoctorUser).Include(x => x.Subject).FirstNotNullAsync(); //if (taskInfo.TaskState != TaskState.Effect) //{ @@ -56,15 +53,15 @@ namespace IRaCIS.Core.Application.Service //} inDto.TrialReadingCriterionId = taskInfo.TrialReadingCriterionId; var medicalReviewInfo = await _readingQuestionCriterionTrial.Where(x => x.Id == taskInfo.TrialReadingCriterionId).Select(x => new GetMedicalReviewReadingTaskOutDto() - { - ReadingType=x.ReadingType, - IsReadingTaskViewInOrder=x.IsReadingTaskViewInOrder, - - }).FirstNotNullAsync(); + { + ReadingType = x.ReadingType, + IsReadingTaskViewInOrder = x.IsReadingTaskViewInOrder, + + }).FirstNotNullAsync(); medicalReviewInfo.MedicalReviewInfo = reviewInfo; - + medicalReviewInfo.VisitTaskId = taskInfo.Id; @@ -79,7 +76,7 @@ namespace IRaCIS.Core.Application.Service medicalReviewInfo.IsExistsClinicalData = clinicalDataList.Count > 0; medicalReviewInfo.ArmEnum = taskInfo.ArmEnum; - medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate?taskInfo.BlindSubjectCode: taskInfo.Subject.Code; + medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate ? taskInfo.BlindSubjectCode : taskInfo.Subject.Code; medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName; medicalReviewInfo.ReadingUser = taskInfo.DoctorUser.FirstName + taskInfo.DoctorUser.LastName; medicalReviewInfo.SubjectId = taskInfo.SubjectId; @@ -91,7 +88,7 @@ namespace IRaCIS.Core.Application.Service medicalReviewInfo.QuestionAnswerList = await this.GetMedicalQuestionAnswer(inDto); - + var result = await _readingMedicineQuestionAnswerRepository.SaveChangesAsync(); #region 取任务 @@ -102,7 +99,7 @@ namespace IRaCIS.Core.Application.Service case ReadingCategory.Oncology: medicalReviewInfo.OncologyInfo = await _iReadingImageTaskService.GetOncologyReadingInfo(new GetOncologyReadingInfoInDto() { - VisitTaskId= taskInfo.Id + VisitTaskId = taskInfo.Id }); break; case ReadingCategory.Judge: @@ -123,12 +120,12 @@ namespace IRaCIS.Core.Application.Service if (medicalReviewInfo.IsReadingTaskViewInOrder == ReadingOrder.InOrder) { medicalReviewInfo.TaskList = await _visitTaskRepository - + .Where(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate) .Where(x => x.TaskState == TaskState.Effect || x.Id == taskInfo.Id) .Where(x => x.SubjectId == taskInfo.SubjectId && x.ArmEnum == taskInfo.ArmEnum - &&x.ReadingCategory== ReadingCategory.Visit + && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && x.DoctorUserId == taskInfo.DoctorUserId && @@ -137,7 +134,7 @@ namespace IRaCIS.Core.Application.Service ).OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo() { TaskId = x.Id, - VisitTaskNum=x.VisitTaskNum, + VisitTaskNum = x.VisitTaskNum, //JudgeTaskId=x.JudgeVisitTaskId, // 在下面赋值 要去已完成的 IsCurrentTask = x.Id == taskInfo.Id, ReadingCategory = x.ReadingCategory, @@ -152,15 +149,15 @@ namespace IRaCIS.Core.Application.Service }).ToListAsync(); - List otherTask = await _visitTaskRepository.Where(x => + List otherTask = await _visitTaskRepository.Where(x => x.SubjectId == taskInfo.SubjectId && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && x.TaskState == TaskState.Effect - &&x.ReadingCategory == ReadingCategory.Visit + && x.ReadingCategory == ReadingCategory.Visit && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis - && x.DoctorUserId != taskInfo.DoctorUserId - && x.ReadingTaskState == ReadingTaskState.HaveSigned + && x.DoctorUserId != taskInfo.DoctorUserId + && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree) .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo() { @@ -206,17 +203,17 @@ namespace IRaCIS.Core.Application.Service }).ToListAsync(); List otherTask = await _visitTaskRepository.Where(x => - x.SouceReadModuleId == taskInfo.SouceReadModuleId + x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.SourceSubjectVisitId == taskInfo.SourceSubjectVisitId && x.DoctorUserId != taskInfo.DoctorUserId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis - && x.ReadingTaskState == ReadingTaskState.HaveSigned + && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ReReadingApplyState != ReReadingApplyState.Agree && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && x.TaskState == TaskState.Effect ) - + .OrderBy(x => x.VisitTaskNum).Select(x => new TaskInfo() { TaskId = x.Id, @@ -241,26 +238,26 @@ namespace IRaCIS.Core.Application.Service }); } - var taskIds = medicalReviewInfo.TaskList.Select(x => x.TaskId).ToList(); + var taskIds = medicalReviewInfo.TaskList.Select(x => x.TaskId).ToList(); - // 找访视 - var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo - { - Answer = x.Answer, - VisitTaskId = x.VisitTaskId, - DictionaryCode = x.ReadingQuestionTrial.DictionaryCode, - ShowOrder = x.ReadingQuestionTrial.ShowOrder, - QuestionGenre = x.ReadingQuestionTrial.QuestionGenre, - QuestionName = x.ReadingQuestionTrial.QuestionName.LanguageName(x.ReadingQuestionTrial.QuestionEnName,_userInfo.IsEn_Us) - }).ToListAsync(); - var globalChangeAnswer = await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.Answer != string.Empty && x.GlobalAnswerType == GlobalAnswerType.Question && x.GlobalVisitTask.TaskState == TaskState.Effect).ToListAsync(); + // 找访视 + var visitTaskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).Select(x => new JudgeQuestionAnswerInfo + { + Answer = x.Answer, + VisitTaskId = x.VisitTaskId, + DictionaryCode = x.ReadingQuestionTrial.DictionaryCode, + ShowOrder = x.ReadingQuestionTrial.ShowOrder, + QuestionGenre = x.ReadingQuestionTrial.QuestionGenre, + QuestionName = x.ReadingQuestionTrial.QuestionName.LanguageName(x.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us) + }).ToListAsync(); + var globalChangeAnswer = await _readingGlobalTaskInfoRepository.Where(x => taskIds.Contains(x.GlobalTaskId) && x.Answer != string.Empty && x.GlobalAnswerType == GlobalAnswerType.Question && x.GlobalVisitTask.TaskState == TaskState.Effect).ToListAsync(); // 找全局阅片 和裁判 var globalTask = await _visitTaskRepository.Where(x => x.SubjectId == taskInfo.SubjectId && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && x.TaskState == TaskState.Effect - && x.ArmEnum== taskInfo.ArmEnum - && (x.ReadingCategory == ReadingCategory.Global||x.ReadingCategory==ReadingCategory.Judge) + && x.ArmEnum == taskInfo.ArmEnum + && (x.ReadingCategory == ReadingCategory.Global || x.ReadingCategory == ReadingCategory.Judge) && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis && x.DoctorUserId == taskInfo.DoctorUserId @@ -274,27 +271,27 @@ namespace IRaCIS.Core.Application.Service }).ToListAsync(); - medicalReviewInfo.TaskList.ForEach(x => + medicalReviewInfo.TaskList.ForEach(x => + { + + var visitGlobalInfo = globalTask.Where(y => y.VisitTaskNum == x.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).FirstOrDefault(); + if (visitGlobalInfo != null) { + x.GlobalTaskId = visitGlobalInfo.Id; + x.GlobalTaskName = visitGlobalInfo.TaskBlindName; + } - var visitGlobalInfo = globalTask.Where(y => y.VisitTaskNum == x.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Global]).FirstOrDefault(); - if (visitGlobalInfo != null) - { - x.GlobalTaskId = visitGlobalInfo.Id; - x.GlobalTaskName = visitGlobalInfo.TaskBlindName; - } + var visitJudgeInfo = globalTask.Where(y => y.VisitTaskNum == x.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge]).FirstOrDefault(); + if (visitJudgeInfo != null) + { + x.JudgeTaskId = visitJudgeInfo.Id; + x.JudgeTaskName = visitJudgeInfo.TaskBlindName; + } - var visitJudgeInfo = globalTask.Where(y => y.VisitTaskNum == x.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge]).FirstOrDefault(); - if (visitJudgeInfo != null) - { - x.JudgeTaskId = visitJudgeInfo.Id; - x.JudgeTaskName = visitJudgeInfo.TaskBlindName; - } - - x.IsGlobalChange = globalChangeAnswer.Any(y => y.TaskId == x.TaskId); - x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList(); - }); + x.IsGlobalChange = globalChangeAnswer.Any(y => y.TaskId == x.TaskId); + x.JudgeQuestionAnswerInfoList = visitTaskAnswer.Where(y => y.VisitTaskId == x.TaskId).OrderBy(y => y.ShowOrder).ToList(); + }); medicalReviewInfo.TaskList.ForEach(x => { @@ -304,9 +301,9 @@ namespace IRaCIS.Core.Application.Service break; } - - + + #endregion return medicalReviewInfo; @@ -319,26 +316,26 @@ namespace IRaCIS.Core.Application.Service var medicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync(); var taskInfo = await _visitTaskRepository.Where(x => x.Id == medicalReview.VisitTaskId).FirstNotNullAsync(); - var questionQuery = from data in _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.IsEnable&&x.ReadingCategory==taskInfo.ReadingCategory&&x.TrialReadingCriterionId==inDto.TrialReadingCriterionId) + var questionQuery = from data in _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsConfirm && x.IsEnable && x.ReadingCategory == taskInfo.ReadingCategory && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) join questionAnswer in _readingMedicineQuestionAnswerRepository.Where(x => x.TaskMedicalReviewId == inDto.TaskMedicalReviewId) on data.Id equals questionAnswer.ReadingMedicineQuestionId into questionAnswerTemp from leftquestionAnswer in questionAnswerTemp.DefaultIfEmpty() select new ReadingMedicineQuestion() { - Id = data.Id, - Type = data.Type, - ParentTriggerValue = data.ParentTriggerValue, - LanguageType = data.LanguageType, - IsEnable = data.IsEnable, - IsConfirm = data.IsConfirm, - QuestionName = data.QuestionName, - IsRequired = data.IsRequired, - ShowOrder = data.ShowOrder, - ParentId = data.ParentId, - TypeValue = data.TypeValue, - Answer = leftquestionAnswer.Answer - }; + Id = data.Id, + Type = data.Type, + ParentTriggerValue = data.ParentTriggerValue, + LanguageType = data.LanguageType, + IsEnable = data.IsEnable, + IsConfirm = data.IsConfirm, + QuestionName = data.QuestionName, + IsRequired = data.IsRequired, + ShowOrder = data.ShowOrder, + ParentId = data.ParentId, + TypeValue = data.TypeValue, + Answer = leftquestionAnswer.Answer + }; - var questionList = await questionQuery.OrderBy(x=>x.ShowOrder).ToListAsync(); + var questionList = await questionQuery.OrderBy(x => x.ShowOrder).ToListAsync(); List medicineQuestionList = questionList.Where(x => x.ParentId == null).ToList(); medicineQuestionList.ForEach(x => @@ -402,11 +399,11 @@ namespace IRaCIS.Core.Application.Service - + var result = await _readingMedicineQuestionAnswerRepository.SaveChangesAsync(); - return ResponseOutput.Result(result); + return ResponseOutput.Result(result); } @@ -441,20 +438,20 @@ namespace IRaCIS.Core.Application.Service AuditAdviceEnum = inDto.AuditAdviceEnum, SaveConclusionTime = DateTime.Now, - }); ; + }); ; - if (inDto.IsSendDialog&& !medicalReview.IsSendMessage && inDto.IsHaveQuestion) + if (inDto.IsSendDialog && !medicalReview.IsSendMessage && inDto.IsHaveQuestion) { - + await _readingMedicalReviewDialogRepository.AddAsync(new ReadingMedicalReviewDialog() { AuditAdviceEnum = inDto.AuditAdviceEnum, TaskMedicalReviewId = inDto.TaskMedicalReviewId, UserTypeShortName = _userInfo.UserTypeShortName, - IsHaveQuestion=inDto.IsHaveQuestion, - Questioning=inDto.Questioning, - VisitTaskId= medicalReview.VisitTaskId, - + IsHaveQuestion = inDto.IsHaveQuestion, + Questioning = inDto.Questioning, + VisitTaskId = medicalReview.VisitTaskId, + UserTypeEnumInt = _userInfo.UserTypeEnumInt, ImagePath = JsonConvert.SerializeObject(inDto.FileList), }); @@ -475,10 +472,10 @@ namespace IRaCIS.Core.Application.Service { await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { - LatestReplyUserId=_userInfo.Id, + LatestReplyUserId = _userInfo.Id, IsClosedDialog = inDto.IsClosedDialog, - MedicalDialogCloseEnum=inDto.MedicalDialogCloseEnum, - DialogCloseReason=inDto.DialogCloseReason, + MedicalDialogCloseEnum = inDto.MedicalDialogCloseEnum, + DialogCloseReason = inDto.DialogCloseReason, }); var taskMedical = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync(); @@ -486,9 +483,9 @@ namespace IRaCIS.Core.Application.Service ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog() { TaskMedicalReviewId = inDto.TaskMedicalReviewId, - VisitTaskId= taskMedical.VisitTaskId, + VisitTaskId = taskMedical.VisitTaskId, UserTypeShortName = _userInfo.UserTypeShortName, - MedicalDialogCloseEnum= inDto.MedicalDialogCloseEnum, + MedicalDialogCloseEnum = inDto.MedicalDialogCloseEnum, Content = inDto.DialogCloseReason, UserTypeEnumInt = _userInfo.UserTypeEnumInt, }; @@ -504,7 +501,7 @@ namespace IRaCIS.Core.Application.Service /// /// [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task SendMedicalReviewDialog(SendMedicalReviewDialogInDto inDto) + public async Task SendMedicalReviewDialog(SendMedicalReviewDialogInDto inDto) { var medicalReviewInfo = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync(); if (medicalReviewInfo.IsInvalid) @@ -525,15 +522,15 @@ namespace IRaCIS.Core.Application.Service Content = inDto.Content, UserTypeEnumInt = _userInfo.UserTypeEnumInt, VisitTaskId = visitTaskId, - AuditAdviceEnum=inDto.AuditAdviceEnum, - - IsHaveQuestion=inDto.IsHaveQuestion, - Questioning=inDto.Questioning, + AuditAdviceEnum = inDto.AuditAdviceEnum, + + IsHaveQuestion = inDto.IsHaveQuestion, + Questioning = inDto.Questioning, }; await _readingMedicalReviewDialogRepository.AddAsync(dialog); - var result=await _readingMedicalReviewDialogRepository.SaveChangesAsync(); + var result = await _readingMedicalReviewDialogRepository.SaveChangesAsync(); return ResponseOutput.Result(result); } @@ -552,25 +549,25 @@ namespace IRaCIS.Core.Application.Service throw new BusinessValidationFailedException(_localizer["MedicalReview_invalid"]); } var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync(); - if (inDto.IsApplyHeavyReading??false) + if (inDto.IsApplyHeavyReading ?? false) { await _visitTaskService.ApplyReReading(new ApplyReReadingCommand() { - IsCopyOrigenalForms = inDto.IsCopyOrigenalForms??false, - IsCopyFollowForms=inDto.IsCopyFollowForms ?? false, + IsCopyOrigenalForms = inDto.IsCopyOrigenalForms ?? false, + IsCopyFollowForms = inDto.IsCopyFollowForms ?? false, RequestReReadingReason = inDto.RequestReReadingReason, RequestReReadingType = RequestReReadingType.DocotorApply, TrialId = inDto.TrialId, TaskIdList = new List() { - visitTaskId + visitTaskId } }); await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(x => !x.IsClosedDialog && x.Id == inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { - LatestReplyUserId=_userInfo.Id, + LatestReplyUserId = _userInfo.Id, IsClosedDialog = true, MedicalDialogCloseEnum = MedicalDialogClose.IRApplyReReading, @@ -578,13 +575,13 @@ namespace IRaCIS.Core.Application.Service IsApplyHeavyReading = true, FileName = inDto.FileName, ImagePath = JsonConvert.SerializeObject(inDto.FileList), - DisagreeReason = inDto.DisagreeReason, + DisagreeReason = inDto.DisagreeReason, }); } await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { - LatestReplyUserId=_userInfo.Id, + LatestReplyUserId = _userInfo.Id, DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum, }); ReadingMedicalReviewDialog dialog = new ReadingMedicalReviewDialog() @@ -592,10 +589,10 @@ namespace IRaCIS.Core.Application.Service TaskMedicalReviewId = inDto.TaskMedicalReviewId, UserTypeShortName = _userInfo.UserTypeShortName, Content = inDto.Content, - ImagePath=JsonConvert.SerializeObject(inDto.FileList), + ImagePath = JsonConvert.SerializeObject(inDto.FileList), UserTypeEnumInt = _userInfo.UserTypeEnumInt, VisitTaskId = visitTaskId, - FileName=inDto.FileName, + FileName = inDto.FileName, DisagreeReason = inDto.DisagreeReason, DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum, IsApplyHeavyReading = inDto.IsApplyHeavyReading, @@ -613,20 +610,22 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task<(List,object)> GetMedicalReviewDialog(GetMedicalReviewDialogInDto inDto) + public async Task<(List, object)> GetMedicalReviewDialog(GetMedicalReviewDialogInDto inDto) { var taskMedicalReview = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).FirstNotNullAsync(); List result = await _readingMedicalReviewDialogRepository.Where(x => x.TaskMedicalReviewId == inDto.TaskMedicalReviewId) .ProjectTo(_mapper.ConfigurationProvider) .OrderBy(x => x.CreateTime).ToListAsync(); - result.ForEach(x => { + result.ForEach(x => + { x.IsCurrentUser = x.CreateUserId == _userInfo.Id; }); - return (result,new { + return (result, new + { - IsIRReply= result.Any(x=>x.UserTypeEnumInt== (int)UserTypeEnum.IndependentReviewer), - taskMedicalReview.IsClosedDialog, - taskMedicalReview.IsHaveQuestion, + IsIRReply = result.Any(x => x.UserTypeEnumInt == (int)UserTypeEnum.IndependentReviewer), + taskMedicalReview.IsClosedDialog, + taskMedicalReview.IsHaveQuestion, }); } @@ -653,13 +652,13 @@ namespace IRaCIS.Core.Application.Service }).FirstNotNullAsync(); - if (taskmedicalReview.SaveQuestionTime == null || taskmedicalReview.SaveConclusionTime==null) + if (taskmedicalReview.SaveQuestionTime == null || taskmedicalReview.SaveConclusionTime == null) { throw new BusinessValidationFailedException(_localizer["MedicalReview_NeedSave"]); } - if (taskmedicalReview.IsHaveQuestion&&!taskmedicalReview.IsClosedDialog) + if (taskmedicalReview.IsHaveQuestion && !taskmedicalReview.IsClosedDialog) { throw new BusinessValidationFailedException(_localizer["MedicalReview_NotClosed"]); @@ -668,7 +667,7 @@ namespace IRaCIS.Core.Application.Service await _taskMedicalReviewRepository.UpdatePartialFromQueryAsync(inDto.TaskMedicalReviewId, x => new TaskMedicalReview() { AuditState = MedicalReviewAuditState.HaveSigned, - AuditSignTime=DateTime.Now, + AuditSignTime = DateTime.Now, }); var result = await _taskMedicalReviewRepository.SaveChangesAsync(); @@ -677,9 +676,9 @@ namespace IRaCIS.Core.Application.Service if (medicalReviewInfo.IsAutoGenerate) { - var allMedicalAuditList= await _taskMedicalReviewRepository.Where(x => medicalReviewInfo.PDRelationTaskIdList.Contains(x.VisitTaskId) && x.IsAutoGenerate && x.IsInvalid==false).ToListAsync(); + var allMedicalAuditList = await _taskMedicalReviewRepository.Where(x => medicalReviewInfo.PDRelationTaskIdList.Contains(x.VisitTaskId) && x.IsAutoGenerate && x.IsInvalid == false).ToListAsync(); - if (allMedicalAuditList.All(t => t.IsApplyHeavyReading == false && t.AuditSignTime!=null && t.AuditState == MedicalReviewAuditState.HaveSigned)) + if (allMedicalAuditList.All(t => t.IsApplyHeavyReading == false && t.AuditSignTime != null && t.AuditState == MedicalReviewAuditState.HaveSigned)) { //自动发送 await _trialEmailNoticeConfigService.BaseBusinessScenarioSendEmailAsync(medicalReviewInfo.VisitTaskId, false); @@ -721,7 +720,7 @@ namespace IRaCIS.Core.Application.Service var visitTaskId = await _taskMedicalReviewRepository.Where(x => x.Id == inDto.TaskMedicalReviewId).Select(x => x.VisitTaskId).FirstOrDefaultAsync(); await _readingMedicalReviewDialogRepository.AddAsync(new ReadingMedicalReviewDialog() { - + TaskMedicalReviewId = inDto.TaskMedicalReviewId, UserTypeShortName = _userInfo.UserTypeShortName, DoctorUserIdeaEnum = inDto.DoctorUserIdeaEnum, @@ -746,54 +745,54 @@ namespace IRaCIS.Core.Application.Service { var list = await GetIRMedicalFeedbackList(new GetIRMedicalFeedbackListInDto() { - TrialId=inDto.TrialId, - TrialReadingCriterionId=inDto.TrialReadingCriterionId, - PageIndex=1, - AuditState= MedicalReviewAuditState.Auditing, - PageSize =99999, + TrialId = inDto.TrialId, + TrialReadingCriterionId = inDto.TrialReadingCriterionId, + PageIndex = 1, + AuditState = MedicalReviewAuditState.Auditing, + PageSize = 99999, }); - var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId); + var index = list.CurrentPageData.ToList().FindIndex(x => x.Id == inDto.TaskMedicalReviewId); - var result = new GetIRMedicalFeedbackListOutDto() { }; + var result = new GetIRMedicalFeedbackListOutDto() { }; - if (index + 1 == list.CurrentPageData.Count()) // 最后一个 - { - throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"]); - } - else if (index == -1 || list.CurrentPageData.Count == 1) // 第一个或者只有一个 - { - if (list.CurrentPageData[0].Id == inDto.TaskMedicalReviewId) - { - throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"]); - } - result = list.CurrentPageData[0]; - } - else - { - result = list.CurrentPageData.Skip(index + 1).Take(1).First(); + if (index + 1 == list.CurrentPageData.Count()) // 最后一个 + { + throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"]); + } + else if (index == -1 || list.CurrentPageData.Count == 1) // 第一个或者只有一个 + { + if (list.CurrentPageData[0].Id == inDto.TaskMedicalReviewId) + { + throw new BusinessValidationFailedException(_localizer["MedicalReview_IRFinish"]); + } + result = list.CurrentPageData[0]; + } + else + { + result = list.CurrentPageData.Skip(index + 1).Take(1).First(); - } - return result; - } + } + return result; + } - /// - /// 获取IR医学审核信息 - /// - /// - /// - [HttpPost] + /// + /// 获取IR医学审核信息 + /// + /// + /// + [HttpPost] public async Task> GetIRMedicalFeedbackList(GetIRMedicalFeedbackListInDto inDto) { var taskMedicalReviewquery = _taskMedicalReviewRepository.Where(x => x.TrialId == inDto.TrialId).Include(x => x.VisitTask) .Where(x => x.VisitTask.DoctorUserId == _userInfo.Id) .Where(x => x.IsHaveQuestion) .WhereIf(!inDto.TaskBlindName.IsNullOrEmpty(), x => x.VisitTask.TaskBlindName == inDto.TaskBlindName) - .WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!) - .WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!) + .WhereIf(inDto.SubjectId != null, x => x.VisitTask.SubjectId == inDto.SubjectId!) + .WhereIf(inDto.IsUrgent != null, x => x.VisitTask.IsUrgent == inDto.IsUrgent!) .WhereIf(inDto.AuditState != null, x => x.AuditState == inDto.AuditState!) - .WhereIf(inDto.IsNotHaveSigned, x => x.AuditState != MedicalReviewAuditState.HaveSigned) - .WhereIf(inDto.ReadingCategory != null, x => x.VisitTask.ReadingCategory == inDto.ReadingCategory!) + .WhereIf(inDto.IsNotHaveSigned, x => x.AuditState != MedicalReviewAuditState.HaveSigned) + .WhereIf(inDto.ReadingCategory != null, x => x.VisitTask.ReadingCategory == inDto.ReadingCategory!) .WhereIf(inDto.AuditAdviceEnum != null, x => x.AuditAdviceEnum == inDto.AuditAdviceEnum!) .WhereIf(inDto.DoctorUserIdeaEnum != null, x => x.DoctorUserIdeaEnum == inDto.DoctorUserIdeaEnum!) .WhereIf(inDto.IsClosedDialog != null, x => x.IsClosedDialog == inDto.IsClosedDialog!) @@ -803,9 +802,9 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inDto.TrialReadingCriterionId != null, x => x.VisitTask.TrialReadingCriterionId == inDto.TrialReadingCriterionId!) .Select(x => new GetIRMedicalFeedbackListOutDto { - TaskState=x.VisitTask.TaskState, + TaskState = x.VisitTask.TaskState, Id = x.Id, - VisitTaskId=x.VisitTaskId, + VisitTaskId = x.VisitTaskId, IsUrgent = x.VisitTask.IsUrgent, AuditState = x.AuditState, SubjectCode = x.VisitTask.BlindSubjectCode == string.Empty ? x.VisitTask.Subject.Code : x.VisitTask.BlindSubjectCode, @@ -815,16 +814,16 @@ namespace IRaCIS.Core.Application.Service LastReplyTime = x.ReadingMedicalReviewDialogList.Max(x => x.CreateTime), AuditAdviceEnum = x.AuditAdviceEnum, DoctorUserIdeaEnum = x.DoctorUserIdeaEnum, - SaveConclusionTime=x.SaveConclusionTime, - IsClosedDialog=x.IsClosedDialog, - IsHaveQuestion=x.IsHaveQuestion, - MedicalDialogCloseEnum=x.MedicalDialogCloseEnum, - IsInvalid=x.IsInvalid, + SaveConclusionTime = x.SaveConclusionTime, + IsClosedDialog = x.IsClosedDialog, + IsHaveQuestion = x.IsHaveQuestion, + MedicalDialogCloseEnum = x.MedicalDialogCloseEnum, + IsInvalid = x.IsInvalid, - SubjectId=x.VisitTask.SubjectId, + SubjectId = x.VisitTask.SubjectId, TrialReadingCriterionId = x.VisitTask.TrialReadingCriterion.Id, - TrialReadingCriterionName =x.VisitTask.TrialReadingCriterion.CriterionName, - ReadingTool= x.VisitTask.TrialReadingCriterion.ReadingTool, + TrialReadingCriterionName = x.VisitTask.TrialReadingCriterion.CriterionName, + ReadingTool = x.VisitTask.TrialReadingCriterion.ReadingTool, IsReadingTaskViewInOrder = x.VisitTask.TrialReadingCriterion.IsReadingTaskViewInOrder, IsReadingShowSubjectInfo = x.VisitTask.TrialReadingCriterion.IsReadingShowSubjectInfo, @@ -835,9 +834,9 @@ namespace IRaCIS.Core.Application.Service }).WhereIf(!inDto.SubjectCode.IsNullOrEmpty(), x => x.SubjectCode == inDto.SubjectCode); - var result=await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState)); + var result = await taskMedicalReviewquery.ToPagedListAsync(inDto, nameof(GetIRMedicalFeedbackListOutDto.AuditState)); return result; } } -} +} diff --git a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs index 700d2a0a9..3610d42c8 100644 --- a/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/MedicalAudit/ReadingMedicineQuestionService.cs @@ -1,12 +1,10 @@ -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infra.EFCore.Common; -using MassTransit; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; -using DocumentFormat.OpenXml.Office2010.Excel; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; using System.Linq.Dynamic.Core; namespace IRaCIS.Core.Application.Service @@ -14,122 +12,122 @@ namespace IRaCIS.Core.Application.Service /// /// 医学审核问题 /// - [ ApiExplorerSettings(GroupName = "Reading")] + [ApiExplorerSettings(GroupName = "Reading")] public class ReadingMedicineQuestionService( - IRepository _readingMedicineTrialQuestionRepository, - IRepository _readingQuestionCriterionTrialRepository, - IRepository _trialRepository, - IRepository _readingMedicineSystemQuestionRepository) : BaseService, IReadingMedicineQuestionService + IRepository _readingMedicineTrialQuestionRepository, + IRepository _readingQuestionCriterionTrialRepository, + IRepository _trialRepository, + IRepository _readingMedicineSystemQuestionRepository) : BaseService, IReadingMedicineQuestionService { - - - - #region 系统 - /// - /// 获取系统的医学审核问题 - /// - /// - /// - [HttpPost] - public async Task> GetReadingMedicineSystemQuestionList(ReadingMedicineSystemQuestionQuery inDto) - { - //避免前端遍历 - var criterionEnum = inDto.TrialReadingCriterionId != null ? _readingQuestionCriterionTrialRepository.Where(t => t.Id == inDto.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefault(): CriterionType.NoCriterion; - var query = _readingMedicineSystemQuestionRepository.AsQueryable() - .WhereIf(!inDto.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inDto.TypeValue)) - .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) - .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName) ) - .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) - .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) - .WhereIf(inDto.CurrentCriterionType!=null,x=>x.CriterionTypeEnum==null||x.CriterionTypeEnum==inDto.CurrentCriterionType) - .WhereIf(inDto.CriterionTypeEnum != null, x => x.CriterionTypeEnum==inDto.CriterionTypeEnum) - .WhereIf(inDto.TrialReadingCriterionId != null, x => x.CriterionTypeEnum== criterionEnum || x.IsGeneral==true) - .WhereIf(inDto.IsGeneral != null, x => x.IsGeneral == inDto.IsGeneral) - .WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType!.Value) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder); + + #region 系统 + + /// + /// 获取系统的医学审核问题 + /// + /// + /// + [HttpPost] + public async Task> GetReadingMedicineSystemQuestionList(ReadingMedicineSystemQuestionQuery inDto) + { + //避免前端遍历 + var criterionEnum = inDto.TrialReadingCriterionId != null ? _readingQuestionCriterionTrialRepository.Where(t => t.Id == inDto.TrialReadingCriterionId).Select(t => t.CriterionType).FirstOrDefault() : CriterionType.NoCriterion; + + var query = _readingMedicineSystemQuestionRepository.AsQueryable() + .WhereIf(!inDto.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inDto.TypeValue)) + .WhereIf(!inDto.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inDto.ParentTriggerValue)) + .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)) + .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) + .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) + .WhereIf(inDto.CurrentCriterionType != null, x => x.CriterionTypeEnum == null || x.CriterionTypeEnum == inDto.CurrentCriterionType) + .WhereIf(inDto.CriterionTypeEnum != null, x => x.CriterionTypeEnum == inDto.CriterionTypeEnum) + .WhereIf(inDto.TrialReadingCriterionId != null, x => x.CriterionTypeEnum == criterionEnum || x.IsGeneral == true) + .WhereIf(inDto.IsGeneral != null, x => x.IsGeneral == inDto.IsGeneral) + .WhereIf(inDto.LanguageType != null, x => x.LanguageType == inDto.LanguageType!.Value) + .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder); var defalutSortArray = new string[] { nameof(ReadingMedicineSystemQuestionView.LanguageType) + " desc", nameof(ReadingMedicineSystemQuestionView.ShowOrder) }; - return await query.ToPagedListAsync(inDto, defalutSortArray); - } + return await query.ToPagedListAsync(inDto, defalutSortArray); + } - /// - /// 获取系统的其他医学审核问题 - /// - /// - /// - [HttpPost] - public async Task> GetReadingMedicineSystemOtherQuestion(GetReadingMedicineSystemOtherQuestionInDto inDto) - { - var types = new List() - { - "select","radio" - }; + /// + /// 获取系统的其他医学审核问题 + /// + /// + /// + [HttpPost] + public async Task> GetReadingMedicineSystemOtherQuestion(GetReadingMedicineSystemOtherQuestionInDto inDto) + { + var types = new List() + { + "select","radio" + }; - var questionList = await _readingMedicineSystemQuestionRepository - .Where(x => types.Contains(x.Type)) - .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) - .WhereIf(inDto.ShowOrder != null, x => x.ShowOrder < inDto.ShowOrder) - .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) - .Select(x => new GetReadingMedicineTrialOtherQuestionOutDto() - { - Id = x.Id, - QuestionName = x.QuestionName, - LanguageType =x.LanguageType, - TypeValue = x.TypeValue, - ReadingCategory = x.ReadingCategory, - }).ToListAsync(); + var questionList = await _readingMedicineSystemQuestionRepository + .Where(x => types.Contains(x.Type)) + .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) + .WhereIf(inDto.ShowOrder != null, x => x.ShowOrder < inDto.ShowOrder) + .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) + .Select(x => new GetReadingMedicineTrialOtherQuestionOutDto() + { + Id = x.Id, + QuestionName = x.QuestionName, + LanguageType = x.LanguageType, + TypeValue = x.TypeValue, + ReadingCategory = x.ReadingCategory, + }).ToListAsync(); - return questionList; - } + return questionList; + } - /// - /// 新增或修改系统医学审核问题 - /// - /// - /// - [HttpPost] - public async Task AddOrUpdateReadingMedicineSystemQuestion(ReadingMedicineSystemQuestionAddOrEdit inDto) - { - var existsQuery = _readingMedicineSystemQuestionRepository - .WhereIf(inDto.Id != null, x => x.Id != inDto.Id) - .Where(x => x.ShowOrder == inDto.ShowOrder); + /// + /// 新增或修改系统医学审核问题 + /// + /// + /// + [HttpPost] + public async Task AddOrUpdateReadingMedicineSystemQuestion(ReadingMedicineSystemQuestionAddOrEdit inDto) + { + var existsQuery = _readingMedicineSystemQuestionRepository + .WhereIf(inDto.Id != null, x => x.Id != inDto.Id) + .Where(x => x.ShowOrder == inDto.ShowOrder); - if (await existsQuery.AnyAsync()) - { + if (await existsQuery.AnyAsync()) + { //---当前问题序号存在重复 - return ResponseOutput.NotOk(_localizer["ReadingMed_QNumDup"]); - } + return ResponseOutput.NotOk(_localizer["ReadingMed_QNumDup"]); + } - //inDto.CriterionEnumStr = $"|{String.Join('|', inDto.CriterionEnumList)}|"; + //inDto.CriterionEnumStr = $"|{String.Join('|', inDto.CriterionEnumList)}|"; - var entity = await _readingMedicineSystemQuestionRepository.InsertOrUpdateAsync(inDto); - await _readingMedicineSystemQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Ok(entity.Id.ToString()); - } + var entity = await _readingMedicineSystemQuestionRepository.InsertOrUpdateAsync(inDto); + await _readingMedicineSystemQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Ok(entity.Id.ToString()); + } - /// - /// 删除系统的医学审核问题 - /// - /// - /// - [HttpDelete("{id:guid}")] - public async Task DeleteReadingMedicineSystemQuestion(Guid id) - { - if (await _readingMedicineSystemQuestionRepository.AnyAsync(x => x.ParentId == id)) - { + /// + /// 删除系统的医学审核问题 + /// + /// + /// + [HttpDelete("{id:guid}")] + public async Task DeleteReadingMedicineSystemQuestion(Guid id) + { + if (await _readingMedicineSystemQuestionRepository.AnyAsync(x => x.ParentId == id)) + { //---此问题存在子问题,请先删除子问题 - return ResponseOutput.NotOk(_localizer["ReadingMed_HasSubQ"]); - } - var success = await _readingMedicineSystemQuestionRepository.DeleteFromQueryAsync(t => t.Id == id); - var result = await _readingMedicineSystemQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Result(result); - } + return ResponseOutput.NotOk(_localizer["ReadingMed_HasSubQ"]); + } + var success = await _readingMedicineSystemQuestionRepository.DeleteFromQueryAsync(t => t.Id == id); + var result = await _readingMedicineSystemQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); + } #endregion @@ -154,314 +152,314 @@ namespace IRaCIS.Core.Application.Service /// /// [HttpPost] - public async Task<(PageOutput, object)> GetReadingMedicineTrialQuestionList(ReadingMedicineTrialQuestionQuery inQuery) - { - var query = _readingMedicineTrialQuestionRepository.AsQueryable() - .Where(x => x.TrialId == inQuery.TrialId && x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) - .WhereIf(!inQuery.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inQuery.TypeValue)) - .WhereIf(!inQuery.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inQuery.ParentTriggerValue)) - .WhereIf(!inQuery.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inQuery.QuestionName)) - .WhereIf(!inQuery.Type.IsNullOrEmpty(), x => x.Type.Contains(inQuery.Type)) - .WhereIf(inQuery.ReadingCategory != null, x => x.ReadingCategory == inQuery.ReadingCategory) - .WhereIf(inQuery.LanguageType != null, x => x.LanguageType == inQuery.LanguageType) - .ProjectTo(_mapper.ConfigurationProvider).OrderByDescending(x=>x.LanguageType).ThenBy(x => x.ShowOrder); + public async Task<(PageOutput, object)> GetReadingMedicineTrialQuestionList(ReadingMedicineTrialQuestionQuery inQuery) + { + var query = _readingMedicineTrialQuestionRepository.AsQueryable() + .Where(x => x.TrialId == inQuery.TrialId && x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) + .WhereIf(!inQuery.TypeValue.IsNullOrEmpty(), x => x.TypeValue.Contains(inQuery.TypeValue)) + .WhereIf(!inQuery.ParentTriggerValue.IsNullOrEmpty(), x => x.ParentTriggerValue.Contains(inQuery.ParentTriggerValue)) + .WhereIf(!inQuery.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inQuery.QuestionName)) + .WhereIf(!inQuery.Type.IsNullOrEmpty(), x => x.Type.Contains(inQuery.Type)) + .WhereIf(inQuery.ReadingCategory != null, x => x.ReadingCategory == inQuery.ReadingCategory) + .WhereIf(inQuery.LanguageType != null, x => x.LanguageType == inQuery.LanguageType) + .ProjectTo(_mapper.ConfigurationProvider).OrderByDescending(x => x.LanguageType).ThenBy(x => x.ShowOrder); - var isConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync(); - var questionList = await query.ToPagedListAsync(inQuery); - return (questionList, new - { + var isConfirmMedicineQuestion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inQuery.TrialReadingCriterionId).Select(x => x.IsConfirmMedicineQuestion).FirstOrDefaultAsync(); + var questionList = await query.ToPagedListAsync(inQuery); + return (questionList, new + { - IsHaveQuestion=(await _readingMedicineTrialQuestionRepository.AsQueryable() + IsHaveQuestion = (await _readingMedicineTrialQuestionRepository.AsQueryable() .Where(x => x.TrialId == inQuery.TrialId && x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId).CountAsync()) > 0, IsConfirmMedicineQuestion = isConfirmMedicineQuestion, - LanguageType=(await _readingMedicineTrialQuestionRepository.FirstOrDefaultAsync(x => x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId&& x.SystemQuestionId != null))?.LanguageType, - //QuestionCount = questionList.Count(), - }); - } + LanguageType = (await _readingMedicineTrialQuestionRepository.FirstOrDefaultAsync(x => x.TrialReadingCriterionId == inQuery.TrialReadingCriterionId && x.SystemQuestionId != null))?.LanguageType, + //QuestionCount = questionList.Count(), + }); + } - /// - /// 获取项目的其他医学审核问题 - /// - /// - /// - [HttpPost] - public async Task> GetReadingMedicineTrialOtherQuestion(GetReadingMedicineTrialOtherQuestionInDto inDto) - { - var types = new List() - { - "select","radio" - }; + /// + /// 获取项目的其他医学审核问题 + /// + /// + /// + [HttpPost] + public async Task> GetReadingMedicineTrialOtherQuestion(GetReadingMedicineTrialOtherQuestionInDto inDto) + { + var types = new List() + { + "select","radio" + }; - var questionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) - .Where(x => types.Contains(x.Type)) - .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) - .WhereIf(inDto.ShowOrder != null, x => x.ShowOrder < inDto.ShowOrder) - .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) - .Select(x => new GetReadingMedicineTrialOtherQuestionOutDto() - { - Id = x.Id, - QuestionName = x.QuestionName, - LanguageType=x.LanguageType, - TypeValue = x.TypeValue, - ReadingCategory = x.ReadingCategory, - }).ToListAsync(); + var questionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) + .Where(x => types.Contains(x.Type)) + .WhereIf(inDto.Id != null, x => x.Id != inDto.Id && x.ParentId != inDto.Id) + .WhereIf(inDto.ShowOrder != null, x => x.ShowOrder < inDto.ShowOrder) + .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) + .Select(x => new GetReadingMedicineTrialOtherQuestionOutDto() + { + Id = x.Id, + QuestionName = x.QuestionName, + LanguageType = x.LanguageType, + TypeValue = x.TypeValue, + ReadingCategory = x.ReadingCategory, + }).ToListAsync(); - return questionList; - } + return questionList; + } - /// - /// - /// 获取预览问题信息 - /// - /// - /// - [HttpPost] - public async Task> GetMedicineQuestionPreview(GetMedicineQuestionPreviewInDto inDto) - { - var trialQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) - .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) + /// + /// + /// 获取预览问题信息 + /// + /// + /// + [HttpPost] + public async Task> GetMedicineQuestionPreview(GetMedicineQuestionPreviewInDto inDto) + { + var trialQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) + .WhereIf(inDto.ReadingCategory != null, x => x.ReadingCategory == inDto.ReadingCategory) - .ProjectTo(_mapper.ConfigurationProvider, new - { - isEn_Us = _userInfo.IsEn_Us + .ProjectTo(_mapper.ConfigurationProvider, new + { + isEn_Us = _userInfo.IsEn_Us - }) - .OrderBy(x => x.ShowOrder).ToListAsync(); + }) + .OrderBy(x => x.ShowOrder).ToListAsync(); - List readingQuestionList = trialQuestionList.Where(x => x.ParentId == null).ToList(); - readingQuestionList.ForEach(x => - { - FindChildQuestion(x, trialQuestionList); - }); + List readingQuestionList = trialQuestionList.Where(x => x.ParentId == null).ToList(); + readingQuestionList.ForEach(x => + { + FindChildQuestion(x, trialQuestionList); + }); - return readingQuestionList; - } + return readingQuestionList; + } - /// - /// 新增或修改项目医学审核问题 - /// - /// - /// - [HttpPost] - [TypeFilter(typeof(TrialResourceFilter))] - public async Task AddOrUpdateReadingMedicineTrialQuestion(ReadingMedicineTrialQuestionAddOrEdit inDto) - { - var existsQuery = _readingMedicineTrialQuestionRepository - .WhereIf(inDto.Id != null, x => x.Id != inDto.Id) - .Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) - .Where(x => x.ShowOrder == inDto.ShowOrder); + /// + /// 新增或修改项目医学审核问题 + /// + /// + /// + [HttpPost] + [TypeFilter(typeof(TrialResourceFilter))] + public async Task AddOrUpdateReadingMedicineTrialQuestion(ReadingMedicineTrialQuestionAddOrEdit inDto) + { + var existsQuery = _readingMedicineTrialQuestionRepository + .WhereIf(inDto.Id != null, x => x.Id != inDto.Id) + .Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) + .Where(x => x.ShowOrder == inDto.ShowOrder); - if (await existsQuery.AnyAsync()) - { + if (await existsQuery.AnyAsync()) + { //---当前问题序号存在重复 - return ResponseOutput.NotOk(_localizer["ReadingMed_QNumDup"]); - } - var entity = await _readingMedicineTrialQuestionRepository.InsertOrUpdateAsync(inDto); - await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Ok(entity.Id.ToString()); + return ResponseOutput.NotOk(_localizer["ReadingMed_QNumDup"]); + } + var entity = await _readingMedicineTrialQuestionRepository.InsertOrUpdateAsync(inDto); + await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Ok(entity.Id.ToString()); - } + } - /// - /// 删除项目的医学审核问题 - /// - /// - /// - [HttpPost] - [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] - public async Task DeleteReadingMedicineTrialQuestion(DeleteReadingMedicineTrialQuestion inDto) - { - if (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.ParentId == inDto.Id)) - { + /// + /// 删除项目的医学审核问题 + /// + /// + /// + [HttpPost] + [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] + public async Task DeleteReadingMedicineTrialQuestion(DeleteReadingMedicineTrialQuestion inDto) + { + if (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.ParentId == inDto.Id)) + { //---此问题存在子问题,请先删除子问题 - return ResponseOutput.NotOk(_localizer["ReadingMed_HasSubQ"]); - } - var success = await _readingMedicineTrialQuestionRepository.DeleteFromQueryAsync(t => t.Id == inDto.Id); - var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Result(result); - } + return ResponseOutput.NotOk(_localizer["ReadingMed_HasSubQ"]); + } + var success = await _readingMedicineTrialQuestionRepository.DeleteFromQueryAsync(t => t.Id == inDto.Id); + var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); + } - #endregion + #endregion - #region 项目 医学审核问题 验证 确认 + #region 项目 医学审核问题 验证 确认 - /// - /// 验证医学审核问题 - /// - /// - /// - /// - public async Task VerifyReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto) - { - var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) - .Select(x => new TrialQuestion() - { - Id = x.Id, - ReadingCategory = x.ReadingCategory, - ParentShowOrder = (int?)x.ParentQuestion.ShowOrder, - ShowOrder = x.ShowOrder, - }).ToListAsync(); - if (readingMedicineQuestionList.Count == 0) - { + /// + /// 验证医学审核问题 + /// + /// + /// + /// + public async Task VerifyReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto) + { + var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) + .Select(x => new TrialQuestion() + { + Id = x.Id, + ReadingCategory = x.ReadingCategory, + ParentShowOrder = (int?)x.ParentQuestion.ShowOrder, + ShowOrder = x.ShowOrder, + }).ToListAsync(); + if (readingMedicineQuestionList.Count == 0) + { //---当前未添加医学审核问题。请先添加医学审核问题,再进行确认。 - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoMedQ"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoMedQ"]); + } - if (readingMedicineQuestionList.Count != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count()) - { + if (readingMedicineQuestionList.Count != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count()) + { //---影像医学审核问题显示序号不能重复。 - throw new BusinessValidationFailedException(_localizer["ReadingMed_MedQNumDup"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_MedQNumDup"]); + } - if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder)) - { + if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder)) + { //---父问题的显示序号要比子问题的显示序号小,请确认。 - throw new BusinessValidationFailedException(_localizer["ReadingMed_ParentNumSmall"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_ParentNumSmall"]); + } - var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new - { - x.IsGlobalReading, - x.IsOncologyReading, - x.IsArbitrationReading, - }).FirstNotNullAsync(); + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new + { + x.IsGlobalReading, + x.IsOncologyReading, + x.IsArbitrationReading, + }).FirstNotNullAsync(); if (!readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Visit)) { - + throw new BusinessValidationFailedException(_localizer["ReadingMed_VisitQNotConfig"]); } if (criterionInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global)) - { + { //---当前标准启用了全局阅片,但未配置全局医学审核问题 - throw new BusinessValidationFailedException(_localizer["ReadingMed_GlobalQNotConfig"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_GlobalQNotConfig"]); + } - if (criterionInfo.IsArbitrationReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge)) - { + if (criterionInfo.IsArbitrationReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge)) + { //---当前标准启用了仲裁阅片,但未配置仲裁医学审核问题 - throw new BusinessValidationFailedException(_localizer["ReadingMed_ArbitrateQNotConfig"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_ArbitrateQNotConfig"]); + } - if (criterionInfo.IsOncologyReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology)) - { + if (criterionInfo.IsOncologyReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology)) + { //---当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题 - throw new BusinessValidationFailedException(_localizer["ReadingMed_TumorQNotConfig"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_TumorQNotConfig"]); + } - return ResponseOutput.Ok(); + return ResponseOutput.Ok(); - } + } - /// - /// 确认医学审核问题 - /// - /// - public async Task ConfirmReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto) - { + /// + /// 确认医学审核问题 + /// + /// + public async Task ConfirmReadingMedicineQuestion(ConfirmReadingMedicineQuestionInDto inDto) + { - var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new - { - x.IsGlobalReading, - x.IsOncologyReading, - x.IsArbitrationReading, - }).FirstNotNullAsync(); - var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) - .Select(x => new TrialQuestion() - { - Id = x.Id, - ReadingCategory = x.ReadingCategory, - ParentShowOrder = (int?)x.ParentQuestion.ShowOrder, - ShowOrder = x.ShowOrder, - }).ToListAsync(); - if (readingMedicineQuestionList.Count == 0) - { + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new + { + x.IsGlobalReading, + x.IsOncologyReading, + x.IsArbitrationReading, + }).FirstNotNullAsync(); + var readingMedicineQuestionList = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId) + .Select(x => new TrialQuestion() + { + Id = x.Id, + ReadingCategory = x.ReadingCategory, + ParentShowOrder = (int?)x.ParentQuestion.ShowOrder, + ShowOrder = x.ShowOrder, + }).ToListAsync(); + if (readingMedicineQuestionList.Count == 0) + { //---当前未添加医学审核问题。请先添加医学审核问题,再进行确认。 - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoMedQ"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoMedQ"]); + } - if (readingMedicineQuestionList.Count != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count()) - { + if (readingMedicineQuestionList.Count != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count()) + { //---影像医学审核问题显示序号不能重复。 - throw new BusinessValidationFailedException(_localizer["ReadingMed_MedQNumDup"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_MedQNumDup"]); + } - if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder)) - { + if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder)) + { //---父问题的显示序号要比子问题的显示序号小,请确认。 - throw new BusinessValidationFailedException(_localizer["ReadingMed_ParentNumSmall"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_ParentNumSmall"]); + } - var trialInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync(); + var trialInfo = await _trialRepository.Where(x => x.Id == inDto.TrialId).FirstNotNullAsync(); - if (criterionInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global)) - { + if (criterionInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global)) + { //---当前标准启用了全局阅片,但未配置全局医学审核问题 - throw new BusinessValidationFailedException(_localizer["ReadingMed_GlobalQNotConfig"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_GlobalQNotConfig"]); + } - if (criterionInfo.IsArbitrationReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge)) - { + if (criterionInfo.IsArbitrationReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge)) + { //---当前标准启用了仲裁阅片,但未配置仲裁医学审核问题 - throw new BusinessValidationFailedException(_localizer["ReadingMed_ArbitrateQNotConfig"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_ArbitrateQNotConfig"]); + } - if (criterionInfo.IsOncologyReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology)) - { + if (criterionInfo.IsOncologyReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology)) + { //---当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题 - throw new BusinessValidationFailedException(_localizer["ReadingMed_TumorQNotConfig"]); - } + throw new BusinessValidationFailedException(_localizer["ReadingMed_TumorQNotConfig"]); + } - await _readingMedicineTrialQuestionRepository.BatchUpdateNoTrackingAsync(x => x.TrialId == inDto.TrialId, x => new ReadingMedicineTrialQuestion() - { - IsConfirm = true - }); + await _readingMedicineTrialQuestionRepository.BatchUpdateNoTrackingAsync(x => x.TrialId == inDto.TrialId, x => new ReadingMedicineTrialQuestion() + { + IsConfirm = true + }); - await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() - { - IsConfirmMedicineQuestion = true - }); + await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial() + { + IsConfirmMedicineQuestion = true + }); - var result = await _trialRepository.SaveChangesAsync(); - return ResponseOutput.Result(result); + var result = await _trialRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); - } + } - #endregion + #endregion - private void FindChildQuestion(GetMedicineQuestionPreviewOutDto trialReadingQuestion, List questionlists) - { - trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.Id).ToList(); - if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0) - { - trialReadingQuestion.Childrens.ForEach(x => - { - this.FindChildQuestion(x, questionlists); - }); - } - } + private void FindChildQuestion(GetMedicineQuestionPreviewOutDto trialReadingQuestion, List questionlists) + { + trialReadingQuestion.Childrens = questionlists.Where(x => x.ParentId == trialReadingQuestion.Id).ToList(); + if (trialReadingQuestion.Childrens != null && trialReadingQuestion.Childrens.Count != 0) + { + trialReadingQuestion.Childrens.ForEach(x => + { + this.FindChildQuestion(x, questionlists); + }); + } + } /// /// 批量删除项目标准医学审核问题 @@ -470,234 +468,236 @@ namespace IRaCIS.Core.Application.Service /// [HttpPost] public async Task BatchDeteteCriterionMedicineQuestion(BatchDeteteCriterionMedicineQuestionInDto inDto) - { + { - var questionlist =await _readingMedicineTrialQuestionRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).ToListAsync(); + var questionlist = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).ToListAsync(); - var count = inDto.Ids.Count; + var count = inDto.Ids.Count; var childids = inDto.Ids.Clone(); while (count > 0) - { - childids = questionlist.Where(x => childids.Contains(x.ParentId ?? default(Guid))).Select(x => x.Id).ToList(); - inDto.Ids.AddRange(childids); - count = childids.Count; + { + childids = questionlist.Where(x => childids.Contains(x.ParentId ?? default(Guid))).Select(x => x.Id).ToList(); + inDto.Ids.AddRange(childids); + count = childids.Count; } await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => inDto.Ids.Contains(x.Id)); - //var result= await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Result(true); + //var result= await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(true); } - /// - /// 一键添加默认医学审核问题 - /// - /// - /// - [HttpPost] - public async Task AddDefaultQuestions(AddDefaultQuestionsInDto inDto) - { - //if (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.LanguageType == inDto.LanguageType && x.SystemQuestionId != null)) - //{ - // await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.LanguageType == inDto.LanguageType && x.SystemQuestionId != null); - //} - //else - //{ - // await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.LanguageType != inDto.LanguageType); - //} + /// + /// 一键添加默认医学审核问题 + /// + /// + /// + [HttpPost] + public async Task AddDefaultQuestions(AddDefaultQuestionsInDto inDto) + { + //if (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.LanguageType == inDto.LanguageType && x.SystemQuestionId != null)) + //{ + // await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.LanguageType == inDto.LanguageType && x.SystemQuestionId != null); + //} + //else + //{ + // await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.LanguageType != inDto.LanguageType); + //} - await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId); - var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); - List needAddCategory = new List() { ReadingCategory.Visit }; - if(criterionInfo.IsGlobalReading) - { - needAddCategory.Add(ReadingCategory.Global); - } - if (criterionInfo.IsArbitrationReading) - { - needAddCategory.Add(ReadingCategory.Judge); - } - if (criterionInfo.IsOncologyReading) - { - needAddCategory.Add(ReadingCategory.Oncology); - } + await _readingMedicineTrialQuestionRepository.BatchDeleteNoTrackingAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId); + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); + List needAddCategory = new List() { ReadingCategory.Visit }; + if (criterionInfo.IsGlobalReading) + { + needAddCategory.Add(ReadingCategory.Global); + } + if (criterionInfo.IsArbitrationReading) + { + needAddCategory.Add(ReadingCategory.Judge); + } + if (criterionInfo.IsOncologyReading) + { + needAddCategory.Add(ReadingCategory.Oncology); + } - var maxOrder = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).OrderByDescending(x => x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync(); - List needList = await _readingMedicineSystemQuestionRepository - .Where(x=>x.IsEnable) - .Where(x=>x.LanguageType==inDto.LanguageType) - .Where(x =>needAddCategory.Contains(x.ReadingCategory) && x.CriterionTypeEnum == criterionInfo.CriterionType) - .Select(x => new TrialDataFromSystem() - { - - ShowOrder = x.ShowOrder, - IsEnable = x.IsEnable, - LanguageType = x.LanguageType, - IsRequired = x.IsRequired, - QuestionName = x.QuestionName, - TrialReadingCriterionId = inDto.TrialReadingCriterionId, - Type = x.Type, - ParentId = x.ParentId, - SystemQuestionId = x.Id, - ReadingCategory = x.ReadingCategory, - TypeValue = x.TypeValue, - TrialId = inDto.TrialId, - }).ToListAsync(); + var maxOrder = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).OrderByDescending(x => x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync(); + List needList = await _readingMedicineSystemQuestionRepository + .Where(x => x.IsEnable) + .Where(x => x.LanguageType == inDto.LanguageType) + .Where(x => needAddCategory.Contains(x.ReadingCategory) && x.CriterionTypeEnum == criterionInfo.CriterionType) + .Select(x => new TrialDataFromSystem() + { - foreach (var item in needAddCategory.Where(x => x != ReadingCategory.Visit).ToList()) - { - if (!needList.Any(x => x.ReadingCategory == item)) - { - needList.AddRange(await _readingMedicineSystemQuestionRepository - .Where(x => x.IsEnable) - .Where(x => x.LanguageType == inDto.LanguageType) - .Where(x => x.ReadingCategory == item && x.IsGeneral) - .Select(x => new TrialDataFromSystem() - { + ShowOrder = x.ShowOrder, + IsEnable = x.IsEnable, + LanguageType = x.LanguageType, + IsRequired = x.IsRequired, + QuestionName = x.QuestionName, + TrialReadingCriterionId = inDto.TrialReadingCriterionId, + Type = x.Type, + ParentId = x.ParentId, + SystemQuestionId = x.Id, + ReadingCategory = x.ReadingCategory, + TypeValue = x.TypeValue, + TrialId = inDto.TrialId, + }).ToListAsync(); - ShowOrder = x.ShowOrder, - IsEnable = x.IsEnable, + foreach (var item in needAddCategory.Where(x => x != ReadingCategory.Visit).ToList()) + { + if (!needList.Any(x => x.ReadingCategory == item)) + { + needList.AddRange(await _readingMedicineSystemQuestionRepository + .Where(x => x.IsEnable) + .Where(x => x.LanguageType == inDto.LanguageType) + .Where(x => x.ReadingCategory == item && x.IsGeneral) + .Select(x => new TrialDataFromSystem() + { - LanguageType = x.LanguageType, - IsRequired = x.IsRequired, - QuestionName = x.QuestionName, - TrialReadingCriterionId = inDto.TrialReadingCriterionId, - Type = x.Type, - ParentId = x.ParentId, - SystemQuestionId = x.Id, - ReadingCategory = x.ReadingCategory, - TypeValue = x.TypeValue, - TrialId = inDto.TrialId, - }).ToListAsync()); - } - } + ShowOrder = x.ShowOrder, + IsEnable = x.IsEnable, + + LanguageType = x.LanguageType, + IsRequired = x.IsRequired, + QuestionName = x.QuestionName, + TrialReadingCriterionId = inDto.TrialReadingCriterionId, + Type = x.Type, + ParentId = x.ParentId, + SystemQuestionId = x.Id, + ReadingCategory = x.ReadingCategory, + TypeValue = x.TypeValue, + TrialId = inDto.TrialId, + }).ToListAsync()); + } + } - needList.ForEach(x => { - x.Id = NewId.NextGuid(); - maxOrder++; - x.ShowOrder = maxOrder; - }); + needList.ForEach(x => + { + x.Id = NewId.NextGuid(); + maxOrder++; + x.ShowOrder = maxOrder; + }); - foreach (var item in needList.Where(x => x.ParentId != null)) - { - var parent = needList.Where(x => x.SystemQuestionId == item.ParentId).FirstOrDefault(); - if (parent == null) - { - item.ParentId = null; - item.ParentTriggerValue = String.Empty; - } - else - { - item.ParentId = parent.Id; - } - } + foreach (var item in needList.Where(x => x.ParentId != null)) + { + var parent = needList.Where(x => x.SystemQuestionId == item.ParentId).FirstOrDefault(); + if (parent == null) + { + item.ParentId = null; + item.ParentTriggerValue = String.Empty; + } + else + { + item.ParentId = parent.Id; + } + } - await _readingMedicineTrialQuestionRepository.AddRangeAsync(_mapper.Map>(needList)); - var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Result(result); + await _readingMedicineTrialQuestionRepository.AddRangeAsync(_mapper.Map>(needList)); + var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); - } + } - /// - /// 验证医学审核问题是否可确认 - /// - /// - /// - /// - [HttpPost] - public async Task VerifyIsCanConfirm(VerifyIsCanConfirmInDto inDto) - { - var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); + /// + /// 验证医学审核问题是否可确认 + /// + /// + /// + /// + [HttpPost] + public async Task VerifyIsCanConfirm(VerifyIsCanConfirmInDto inDto) + { + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstNotNullAsync(); - if (!criterionInfo.IsSigned) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoConfirmed"]); - } - if (!(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Visit))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoVisitQ"]); - } - if (criterionInfo.IsGlobalReading && !(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Global))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoGlobalQ"]); - } - if (criterionInfo.IsArbitrationReading&&!(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Judge))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoJudgeQ"]); - } - if (criterionInfo.IsOncologyReading&& !(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Oncology))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_NoOncologyQ"]); - } - if (!criterionInfo.IsGlobalReading && (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Global))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_HaveGlobalQ"]); - } - if (!criterionInfo.IsArbitrationReading && (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Judge))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_HaveJudgeQ"]); - } - if (!criterionInfo.IsOncologyReading && (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Oncology))) - { - throw new BusinessValidationFailedException(_localizer["ReadingMed_HaveOncologyQ"]); - } - } + if (!criterionInfo.IsSigned) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoConfirmed"]); + } + if (!(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Visit))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoVisitQ"]); + } + if (criterionInfo.IsGlobalReading && !(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Global))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoGlobalQ"]); + } + if (criterionInfo.IsArbitrationReading && !(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Judge))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoJudgeQ"]); + } + if (criterionInfo.IsOncologyReading && !(await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Oncology))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_NoOncologyQ"]); + } + if (!criterionInfo.IsGlobalReading && (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Global))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_HaveGlobalQ"]); + } + if (!criterionInfo.IsArbitrationReading && (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Judge))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_HaveJudgeQ"]); + } + if (!criterionInfo.IsOncologyReading && (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.ReadingCategory == ReadingCategory.Oncology))) + { + throw new BusinessValidationFailedException(_localizer["ReadingMed_HaveOncologyQ"]); + } + } - /// - /// 从系统里面选择问题添加到项目里面 - /// - /// - /// - [HttpPost] - public async Task AddTrialDataFromSystem(AddTrialDataFromSystemInDto inDto) - { - // 直接写?? - var systemList = await _readingMedicineSystemQuestionRepository.Where(x => inDto.SystemQuestionIds.Contains(x.Id)).ToListAsync(); + /// + /// 从系统里面选择问题添加到项目里面 + /// + /// + /// + [HttpPost] + public async Task AddTrialDataFromSystem(AddTrialDataFromSystemInDto inDto) + { + // 直接写?? + var systemList = await _readingMedicineSystemQuestionRepository.Where(x => inDto.SystemQuestionIds.Contains(x.Id)).ToListAsync(); - var maxOrder = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId&&x.TrialReadingCriterionId==inDto.TrialReadingCriterionId).OrderByDescending(x => x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync(); - + var maxOrder = await _readingMedicineTrialQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId).OrderByDescending(x => x.ShowOrder).Select(x => x.ShowOrder).FirstOrDefaultAsync(); - var needList= systemList.Select(x => new TrialDataFromSystem() - { - Id = NewId.NextGuid(), - ShowOrder = x.ShowOrder, - IsEnable = x.IsEnable, - LanguageType = x.LanguageType, - IsRequired = x.IsRequired, - QuestionName = x.QuestionName, - TrialReadingCriterionId=inDto.TrialReadingCriterionId, - Type = x.Type, - ParentId=x.ParentId, - SystemQuestionId=x.Id, - ReadingCategory=x.ReadingCategory, - TypeValue = x.TypeValue, - TrialId=inDto.TrialId, - }).ToList(); - needList.ForEach(x => { - maxOrder++; - x.ShowOrder = maxOrder; - }); + var needList = systemList.Select(x => new TrialDataFromSystem() + { + Id = NewId.NextGuid(), + ShowOrder = x.ShowOrder, + IsEnable = x.IsEnable, + LanguageType = x.LanguageType, + IsRequired = x.IsRequired, + QuestionName = x.QuestionName, + TrialReadingCriterionId = inDto.TrialReadingCriterionId, + Type = x.Type, + ParentId = x.ParentId, + SystemQuestionId = x.Id, + ReadingCategory = x.ReadingCategory, + TypeValue = x.TypeValue, + TrialId = inDto.TrialId, + }).ToList(); - foreach (var item in needList.Where(x => x.ParentId != null)) - { - var parent = needList.Where(x => x.SystemQuestionId == item.ParentId).FirstOrDefault(); - if (parent == null) - { - item.ParentId = null; - item.ParentTriggerValue = String.Empty; - } - else - { - item.ParentId = parent.Id; - } - } + needList.ForEach(x => + { + maxOrder++; + x.ShowOrder = maxOrder; + }); - await _readingMedicineTrialQuestionRepository.AddRangeAsync(_mapper.Map>(needList)); - var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); - return ResponseOutput.Result(result); - } + foreach (var item in needList.Where(x => x.ParentId != null)) + { + var parent = needList.Where(x => x.SystemQuestionId == item.ParentId).FirstOrDefault(); + if (parent == null) + { + item.ParentId = null; + item.ParentTriggerValue = String.Empty; + } + else + { + item.ParentId = parent.Id; + } + } + + await _readingMedicineTrialQuestionRepository.AddRangeAsync(_mapper.Map>(needList)); + var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync(); + return ResponseOutput.Result(result); + } @@ -707,4 +707,4 @@ namespace IRaCIS.Core.Application.Service } -} +} diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/OrganInfoService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/OrganInfoService.cs index 93ae7ef6c..84bf8af6f 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/OrganInfoService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/OrganInfoService.cs @@ -4,14 +4,12 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infra.EFCore.Common; -using MassTransit; -using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -30,7 +28,7 @@ namespace IRaCIS.Core.Application.Service IRepository _readingQuestionCriterionSystemRepository) : BaseService, IOrganInfoService { - + #region 系统器官 @@ -53,8 +51,8 @@ namespace IRaCIS.Core.Application.Service .Where(x => x.SystemCriterionId == inQuery.SystemCriterionId) .WhereIf(inQuery.LesionType != null, x => organs.Contains(x.OrganType)) .WhereIf(inQuery.OrganType != null, x => x.OrganType == inQuery.OrganType) - .OrderBy(x=>x.OrganType) - .ThenBy(x=>x.ShowOrder) + .OrderBy(x => x.OrganType) + .ThenBy(x => x.ShowOrder) .ProjectTo(_mapper.ConfigurationProvider); return await organInfoQueryable.ToListAsync(); } @@ -80,14 +78,14 @@ namespace IRaCIS.Core.Application.Service var organInfoQueryable = _organInfoRepository .Where(x => x.SystemCriterionId == inQuery.SystemCriterionId) - .WhereIf(!inQuery.Part.IsNullOrEmpty() , x => x.Part.Contains(inQuery.Part)) + .WhereIf(!inQuery.Part.IsNullOrEmpty(), x => x.Part.Contains(inQuery.Part)) .WhereIf(!inQuery.TULOC.IsNullOrEmpty(), x => x.TULOC.Contains(inQuery.TULOC)) .WhereIf(!inQuery.TULAT.IsNullOrEmpty(), x => x.TULAT.Contains(inQuery.TULAT)) .WhereIf(inQuery.LesionType != null, x => organs.Contains(x.OrganType)) .WhereIf(inQuery.OrganType != null, x => x.OrganType == inQuery.OrganType) .ProjectTo(_mapper.ConfigurationProvider); - return await organInfoQueryable.ToPagedListAsync(inQuery,new string[] { nameof(OrganInfoView.OrganType) , nameof(OrganInfoView.ShowOrder) }); + return await organInfoQueryable.ToPagedListAsync(inQuery, new string[] { nameof(OrganInfoView.OrganType), nameof(OrganInfoView.ShowOrder) }); } /// @@ -125,26 +123,26 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task> GetReadingOrganList(GetReadingOrganListInDto inDto) { - var trialReadingCriterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync(); + var trialReadingCriterionId = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Select(x => x.TrialReadingCriterionId).FirstOrDefaultAsync(); var isEn = _userInfo.IsEn_Us; var organInfoQueryable = from data in _organInfoRepository.AsQueryable() - - join trialData in _organTrialInfoRepository.AsQueryable().Where( x => x.IsEnable&&x.TrialCriterionId== trialReadingCriterionId) + + join trialData in _organTrialInfoRepository.AsQueryable().Where(x => x.IsEnable && x.TrialCriterionId == trialReadingCriterionId) on data.Id equals trialData.OrganInfoId - join criterionNidus in _criterionNidusTrialRepository.AsQueryable().Where(x=>x.CriterionId== trialReadingCriterionId) + join criterionNidus in _criterionNidusTrialRepository.AsQueryable().Where(x => x.CriterionId == trialReadingCriterionId) on data.OrganType equals criterionNidus.OrganType select new ReadingOrganDto() { Id = trialData.Id, - OrganInfoId= data.Id, - Part =isEn?data.PartEN: data.Part, - TULAT =isEn?data.TULATEN: data.TULAT, - ShowOrder=data.ShowOrder, - Classification= isEn? data.ClassificationEN:data.Classification, - ClassificationEN=data.ClassificationEN, - TULOC =isEn?data.TULOCEN: data.TULOC, + OrganInfoId = data.Id, + Part = isEn ? data.PartEN : data.Part, + TULAT = isEn ? data.TULATEN : data.TULAT, + ShowOrder = data.ShowOrder, + Classification = isEn ? data.ClassificationEN : data.Classification, + ClassificationEN = data.ClassificationEN, + TULOC = isEn ? data.TULOCEN : data.TULOC, Remark = data.Remark, IsLymphNodes = data.IsLymphNodes, IsCanEditPosition = data.IsCanEditPosition, @@ -153,7 +151,7 @@ namespace IRaCIS.Core.Application.Service PartEN = data.PartEN, TULATEN = data.TULATEN, TULOCEN = data.TULOCEN, - LesionType= criterionNidus.LesionType + LesionType = criterionNidus.LesionType }; var organList = await organInfoQueryable.ToListAsync(); @@ -161,7 +159,7 @@ namespace IRaCIS.Core.Application.Service List result = organList.GroupBy(x => new { x.LesionType }).Select(x => new GetReadingOrganListOutDto() { LesionType = x.Key.LesionType, - OrganList = x.OrderBy(y=>y.ShowOrder).ToList() + OrganList = x.OrderBy(y => y.ShowOrder).ToList() }).ToList(); return result; @@ -198,9 +196,9 @@ namespace IRaCIS.Core.Application.Service .WhereIf(inDto.OrganType != null, x => x.OrganType == inDto.OrganType) .WhereIf(inDto.IsLymphNodes != null, x => x.IsLymphNodes == inDto.IsLymphNodes) .WhereIf(inDto.LesionType != null, x => organs.Contains(x.OrganType)) - .WhereIf(!inDto.Part.IsNullOrEmpty(), x => x.Part.Contains(inDto.Part)||x.PartEN.Contains(inDto.Part)) - .WhereIf(!inDto.TULOC.IsNullOrEmpty(), x => x.TULOC.Contains(inDto.TULOC)|| x.TULOCEN.Contains(inDto.TULOC)) - .WhereIf(!inDto.TULAT.IsNullOrEmpty(), x => x.TULAT.Contains(inDto.TULAT)||x.TULATEN.Contains(inDto.TULAT)) + .WhereIf(!inDto.Part.IsNullOrEmpty(), x => x.Part.Contains(inDto.Part) || x.PartEN.Contains(inDto.Part)) + .WhereIf(!inDto.TULOC.IsNullOrEmpty(), x => x.TULOC.Contains(inDto.TULOC) || x.TULOCEN.Contains(inDto.TULOC)) + .WhereIf(!inDto.TULAT.IsNullOrEmpty(), x => x.TULAT.Contains(inDto.TULAT) || x.TULATEN.Contains(inDto.TULAT)) join trialData in _organTrialInfoRepository.WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) .WhereIf(inDto.IsEnable != null, x => x.IsEnable == inDto.IsEnable) @@ -213,9 +211,9 @@ namespace IRaCIS.Core.Application.Service TULAT = data.TULAT, TULOC = data.TULOC, Remark = data.Remark, - ShowOrder=data.ShowOrder, - Classification=data.Classification, - ClassificationEN=data.ClassificationEN, + ShowOrder = data.ShowOrder, + Classification = data.Classification, + ClassificationEN = data.ClassificationEN, IsLymphNodes = data.IsLymphNodes, IsCanEditPosition = data.IsCanEditPosition, IsEnable = trialData.IsEnable, @@ -226,7 +224,7 @@ namespace IRaCIS.Core.Application.Service }; - return await organInfoQueryable.OrderBy(x=>x.OrganType).ThenBy(x=>x.ShowOrder).ToListAsync(); + return await organInfoQueryable.OrderBy(x => x.OrganType).ThenBy(x => x.ShowOrder).ToListAsync(); } @@ -308,9 +306,9 @@ namespace IRaCIS.Core.Application.Service } else { - dicNums = await _criterionNidusRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => ((int)x.LesionType).ToString()).Distinct().ToListAsync(); - } - + dicNums = await _criterionNidusRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => ((int)x.LesionType).ToString()).Distinct().ToListAsync(); + } + var dictionaryId = await _dictionaryRepository.Where(x => x.Code == "LesionType").Select(x => x.Id).FirstOrDefaultAsync(); var result = await _dictionaryRepository.Where(x => x.ParentId == dictionaryId && dicNums.Contains(x.Code)).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); @@ -329,17 +327,17 @@ namespace IRaCIS.Core.Application.Service if (await _readingQuestionCriterionSystemRepository.AnyAsync(x => x.Id == inQuery.CriterionId)) { - return await _criterionNidusRepository + return await _criterionNidusRepository .Where(x => x.CriterionId == inQuery.CriterionId) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - } + } else { - return await _criterionNidusTrialRepository - .Where(x => x.CriterionId == inQuery.CriterionId) - .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - } - + return await _criterionNidusTrialRepository + .Where(x => x.CriterionId == inQuery.CriterionId) + .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + } + } /// @@ -384,7 +382,7 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task SynchronizeSystemOrgan(SynchronizeSystemOrganInDto inDto) { - var organList= await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.FromCriterionId).ToListAsync(); + var organList = await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.FromCriterionId).ToListAsync(); organList.ForEach(x => { @@ -411,7 +409,7 @@ namespace IRaCIS.Core.Application.Service public async Task SynchronizeSystemOrganToTrial(SynchronizeSystemOrganToTrialInDto inDto) { // 选中的标准进行修改 - var readingQuestionCriterionTrial = await _readingQuestionCriterionTrial.Where(x => x.Id==inDto.TrialReadingCriterionId).FirstOrDefaultAsync(); + var readingQuestionCriterionTrial = await _readingQuestionCriterionTrial.Where(x => x.Id == inDto.TrialReadingCriterionId).FirstOrDefaultAsync(); if (readingQuestionCriterionTrial != null) { @@ -423,52 +421,52 @@ namespace IRaCIS.Core.Application.Service inDto.SystemCriterionId = readingQuestionCriterionTrial.ReadingQuestionCriterionSystemId; } await _criterionNidusTrialRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == trialCriterionId); - - List criterionNidusList = await _criterionNidusRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => new CriterionNidusTrial() + + List criterionNidusList = await _criterionNidusRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => new CriterionNidusTrial() { Id = x.Id, CriterionId = trialCriterionId, LesionType = x.LesionType, - - OrganType=x.OrganType, - + + OrganType = x.OrganType, + }).ToListAsync(); criterionNidusList.ForEach(x => x.Id = NewId.NextGuid()); await _criterionNidusTrialRepository.AddRangeAsync(criterionNidusList); await _organTrialInfoRepository.BatchDeleteNoTrackingAsync(x => x.TrialCriterionId == readingQuestionCriterionTrial.Id); - List organTrialInfoList = await _organInfoRepository.Where(x =>x.SystemCriterionId== inDto.SystemCriterionId).Select(x => new OrganTrialInfo() + List organTrialInfoList = await _organInfoRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).Select(x => new OrganTrialInfo() { //OrganType=x.OrganType, Id = x.Id, IsEnable = true, - TrialCriterionId= readingQuestionCriterionTrial.Id, + TrialCriterionId = readingQuestionCriterionTrial.Id, OrganInfoId = x.Id, TrialId = readingQuestionCriterionTrial.TrialId, - TULAT=x.TULAT, - Classification=x.Classification, - ClassificationEN=x.ClassificationEN, - IsCanEditPosition=x.IsCanEditPosition, - Part=x.Part, - IsLymphNodes=x.IsLymphNodes, - PartEN=x.PartEN, - ShowOrder=x.ShowOrder, - TULATEN=x.TULATEN, - TULOC=x.TULOC, - TULOCEN=x.TULOCEN, - OrganType=x.OrganType, - + TULAT = x.TULAT, + Classification = x.Classification, + ClassificationEN = x.ClassificationEN, + IsCanEditPosition = x.IsCanEditPosition, + Part = x.Part, + IsLymphNodes = x.IsLymphNodes, + PartEN = x.PartEN, + ShowOrder = x.ShowOrder, + TULATEN = x.TULATEN, + TULOC = x.TULOC, + TULOCEN = x.TULOCEN, + OrganType = x.OrganType, + }).ToListAsync(); organTrialInfoList.ForEach(x => x.Id = NewId.NextGuid()); await _organTrialInfoRepository.AddRangeAsync(organTrialInfoList); - + await _organTrialInfoRepository.SaveChangesAsync(); } - + return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs index 3e10d2952..030ca5721 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingCriterionService.cs @@ -1,12 +1,11 @@ -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Infra.EFCore.Common; -using MassTransit; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Application.Interfaces; namespace IRaCIS.Core.Application.Service.RC { @@ -29,7 +28,7 @@ namespace IRaCIS.Core.Application.Service.RC IRepository _readingTableQuestionTrialRepository) : BaseService { - + /// @@ -40,7 +39,7 @@ namespace IRaCIS.Core.Application.Service.RC [HttpPost] public async Task DeleteSystemCriterionDictionary(DeleteSystemCriterionDictionaryIndto inDto) { - var criterionDictionaryCode= await _systemCriterionDictionaryCodeRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync(); + var criterionDictionaryCode = await _systemCriterionDictionaryCodeRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync(); await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.ParentCode == criterionDictionaryCode.Code && x.CriterionId == criterionDictionaryCode.SystemCriterionId); @@ -66,7 +65,7 @@ namespace IRaCIS.Core.Application.Service.RC await _systemCriterionDictionaryCodeRepository.BatchDeleteNoTrackingAsync(x => x.SystemCriterionId == inDto.SystemCriterionId); - await _systemCriterionDictionaryCodeRepository.AddRangeAsync(inDto.CodeList.Select(x=> new SystemCriterionDictionaryCode() + await _systemCriterionDictionaryCodeRepository.AddRangeAsync(inDto.CodeList.Select(x => new SystemCriterionDictionaryCode() { SystemCriterionId = inDto.SystemCriterionId, Code = x @@ -89,8 +88,8 @@ namespace IRaCIS.Core.Application.Service.RC { SynchronizeOriginalTime = null, SynchronizeTime = DateTime.Now.AddYears(-20), - IsSigned=false, - ReadingInfoSignTime=null, + IsSigned = false, + ReadingInfoSignTime = null, }); @@ -99,12 +98,12 @@ namespace IRaCIS.Core.Application.Service.RC } - /// - /// 设置系统全局阅片阅片信息 - /// - /// - /// - [HttpPost] + /// + /// 设置系统全局阅片阅片信息 + /// + /// + /// + [HttpPost] [UnitOfWork] public async Task SetSystemGlobalInfo(SetSystemGlobalInfoInDto inDto) { @@ -112,13 +111,13 @@ namespace IRaCIS.Core.Application.Service.RC await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.SystemCriterionId && x.ParentCode == ReadingCommon.CriterionDictionary.GlobalAssess); await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryList.Select(x => new ReadingSystemCriterionDictionary - { + { CriterionId = inDto.SystemCriterionId, DictionaryId = x.DictionaryId, IsSystemCriterion = true, ParentCode = ReadingCommon.CriterionDictionary.GlobalAssess, - IsBaseLineUse=x.IsBaseLineUse, - IsFollowVisitUse=x.IsFollowVisitUse, + IsBaseLineUse = x.IsBaseLineUse, + IsFollowVisitUse = x.IsFollowVisitUse, })); await _readingQuestionCriterionSystemRepository.UpdatePartialFromQueryAsync(inDto.SystemCriterionId, x => new ReadingQuestionCriterionSystem() @@ -160,7 +159,8 @@ namespace IRaCIS.Core.Application.Service.RC public async Task GetSystemOncologyInfo(GetSystemOncologyInfoInDto inDto) { - GetSystemOncologyInfoOutDto result = new GetSystemOncologyInfoOutDto() { + GetSystemOncologyInfoOutDto result = new GetSystemOncologyInfoOutDto() + { IsOncologyReading = await _readingQuestionCriterionSystemRepository.Where(x => x.Id == inDto.SystemCriterionId).Select(x => x.IsOncologyReading).FirstOrDefaultAsync(), DictionaryList = await _readingCriterionDictionaryRepository.AsQueryable().Where(x => x.CriterionId == inDto.SystemCriterionId && x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync() @@ -183,7 +183,7 @@ namespace IRaCIS.Core.Application.Service.RC await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(x => x.CriterionId == inDto.SystemCriterionId && x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess); await _readingCriterionDictionaryRepository.AddRangeAsync(inDto.DictionaryIds.Select(x => new ReadingSystemCriterionDictionary - { + { CriterionId = inDto.SystemCriterionId, DictionaryId = x, IsSystemCriterion = true, @@ -312,7 +312,7 @@ namespace IRaCIS.Core.Application.Service.RC var trialCriterionIds = await _readingQuestionCriterionTrialRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.Id).Select(x => x.Id).ToListAsync(); if (await _readingTaskQuestionAnswer.AnyAsync(x => trialCriterionIds.Contains(x.ReadingQuestionCriterionTrialId))) { - //---此标准在项目里面已被使用,操作失败 + //---此标准在项目里面已被使用,操作失败 return ResponseOutput.NotOk(_localizer["ReadingCriterion_InUse"]); } } @@ -558,13 +558,13 @@ namespace IRaCIS.Core.Application.Service.RC } else { - return await _readingTrialCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.TrialCriterionId - ) - .WhereIf(!inDto.ParentCode.IsNullOrEmpty(), x => x.ParentCode == inDto.ParentCode) - .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ParentCode).ThenBy(x => x.ShowOrder).ToListAsync(); - } + return await _readingTrialCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.TrialCriterionId + ) + .WhereIf(!inDto.ParentCode.IsNullOrEmpty(), x => x.ParentCode == inDto.ParentCode) + .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ParentCode).ThenBy(x => x.ShowOrder).ToListAsync(); + } + - } @@ -576,8 +576,9 @@ namespace IRaCIS.Core.Application.Service.RC [HttpPost] public async Task EditCriterionDictionary(EditCriterionDictionaryInDto inDto) { - await _readingCriterionDictionaryRepository.UpdatePartialFromQueryAsync(inDto.Id,x=>new ReadingSystemCriterionDictionary() { - CrterionDictionaryGroup=inDto.CrterionDictionaryGroup + await _readingCriterionDictionaryRepository.UpdatePartialFromQueryAsync(inDto.Id, x => new ReadingSystemCriterionDictionary() + { + CrterionDictionaryGroup = inDto.CrterionDictionaryGroup }); return await _readingCriterionDictionaryRepository.SaveChangesAsync(); @@ -601,7 +602,7 @@ namespace IRaCIS.Core.Application.Service.RC IsSystemCriterion = true, ParentCode = inDto.ParentCode })); - + await _readingCriterionDictionaryRepository.SaveChangesAsync(); @@ -656,8 +657,8 @@ namespace IRaCIS.Core.Application.Service.RC x.TrialId = trialId; x.ReadingQuestionCriterionSystemId = x.Id; x.Id = NewId.NextGuid(); - - x.IsAutoCreate=x.CriterionType==CriterionType.RECIST1Pointt1_MB?false:true; + + x.IsAutoCreate = x.CriterionType == CriterionType.RECIST1Pointt1_MB ? false : true; // 同步问题暂时注释 //List readingQuestionTrialList = new List(); //SetChildParentQuestion(criterion.Id, trialId, systemQuestionList, readingQuestionTrialList); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 0b2c39afb..1f27e0af8 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -1,15 +1,14 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Panda.DynamicWebApi.Attributes; -using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; using Newtonsoft.Json; -using IRaCIS.Core.Domain.Models; +using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 阅片问题.标准 @@ -51,7 +50,7 @@ namespace IRaCIS.Application.Services //} - + /// @@ -59,7 +58,7 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task<(GetReadingTableQuestionOutDto,bool)> GetCustomTableQuestionPreview(GetCustomQuestionPreviewInDto inDto) + public async Task<(GetReadingTableQuestionOutDto, bool)> GetCustomTableQuestionPreview(GetCustomQuestionPreviewInDto inDto) { List tableAnswers = new List(); List tableAnsweRowInfos = new List(); @@ -71,7 +70,7 @@ namespace IRaCIS.Application.Services TableAnswers = tableAnswers, TableAnsweRowInfos = tableAnsweRowInfos, IsGetallQuestion = true, - IsGetPreview=true + IsGetPreview = true } ), true); @@ -92,13 +91,14 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetCalculateQuestions(GetCalculateQuestionsInDto inDto) { - var result =await _readingQuestionTrialRepository + var result = await _readingQuestionTrialRepository .Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialCriterionId) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) .OrderBy(x => x.ShowOrder) .Select(x => new GetCalculateQuestionsOutDto - (){ + () + { QuestionId = x.Id, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) @@ -107,9 +107,9 @@ namespace IRaCIS.Application.Services var tablequestion = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == inDto.TrialCriterionId && x.Type == "number").Select(x => new { - QuestionId= x.Id, + QuestionId = x.Id, x.ReadingQuestionId, - QuestionName=x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) }).ToListAsync(); @@ -154,7 +154,7 @@ namespace IRaCIS.Application.Services } - + #endregion @@ -169,12 +169,13 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task> GetSystemGroupNameList(GetTrialGroupNameListInDto inDto) { - var result = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.CriterionId && x.Type == ReadingQestionType.Group).OrderBy(t=>t.ShowOrder) - .Select(x => new GetTrialGroupNameOutDto() { - GroupId=x.Id, - GroupName=x.GroupName, - - } ).ToListAsync(); + var result = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.CriterionId && x.Type == ReadingQestionType.Group).OrderBy(t => t.ShowOrder) + .Select(x => new GetTrialGroupNameOutDto() + { + GroupId = x.Id, + GroupName = x.GroupName, + + }).ToListAsync(); return result; } @@ -212,12 +213,12 @@ namespace IRaCIS.Application.Services .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, - DictionaryCode=x.DictionaryCode, - QuestionGenre=x.QuestionGenre, - QuestionName = x.QuestionName.LanguageName(x.QuestionEnName,_userInfo.IsEn_Us), + DictionaryCode = x.DictionaryCode, + QuestionGenre = x.QuestionGenre, + QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), TypeValue = x.TypeValue, GroupName = x.GroupName, - GroupId=x.GroupId, + GroupId = x.GroupId, }).ToListAsync(); return questionList; @@ -233,7 +234,7 @@ namespace IRaCIS.Application.Services { indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList); indto.RelevanceValue = string.Join(',', indto.RelevanceValueList); - indto.HighlightAnswer=JsonConvert.SerializeObject(indto.HighlightAnswerList); + indto.HighlightAnswer = JsonConvert.SerializeObject(indto.HighlightAnswerList); if (indto.Id != null) { var trialIdList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionSystemId == indto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None) @@ -270,12 +271,12 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk(_localizer["ReadingQuestion_ChildrenExist"]); } - if (await _readingQuestionSystemRepository.AnyAsync(x => x.GroupId == id)) - { + if (await _readingQuestionSystemRepository.AnyAsync(x => x.GroupId == id)) + { //---此分组已被引用,请先删除被引用的问题 - return ResponseOutput.NotOk(_localizer["ReadingQuestion_GroupReferenced"]); - } - await _readingQuestionSystemRepository.DeleteFromQueryAsync(t => t.Id == id); + return ResponseOutput.NotOk(_localizer["ReadingQuestion_GroupReferenced"]); + } + await _readingQuestionSystemRepository.DeleteFromQueryAsync(t => t.Id == id); var success = await _readingQuestionSystemRepository.SaveChangesAsync(); return ResponseOutput.Result(success); } @@ -319,8 +320,8 @@ namespace IRaCIS.Application.Services .Select(x => new CriterionOtherQuestionOutDto() { - DictionaryCode=x.DictionaryCode, - QuestionGenre=x.TableQuestionType, + DictionaryCode = x.DictionaryCode, + QuestionGenre = x.TableQuestionType, QuestionId = x.Id, QuestionName = x.QuestionName, TypeValue = x.TypeValue, @@ -380,7 +381,7 @@ namespace IRaCIS.Application.Services { if (await _readingQuestionTrialRepository.AnyAsync(x => x.Id == indto.Id && x.IsJudgeQuestion && x.JudgeType != JudgeTypeEnum.None)) { - //---当前问题已经设置了裁判标准了,修改失败 + //---当前问题已经设置了裁判标准了,修改失败 throw new BusinessValidationFailedException(_localizer["ReadingQuestion_JudgmentSet"]); } } @@ -399,13 +400,13 @@ namespace IRaCIS.Application.Services } indto.ParentTriggerValue = string.Join(',', indto.ParentTriggerValueList); indto.RelevanceValue = string.Join(',', indto.RelevanceValueList); - indto.HighlightAnswer =JsonConvert.SerializeObject(indto.HighlightAnswerList); + indto.HighlightAnswer = JsonConvert.SerializeObject(indto.HighlightAnswerList); if (indto.Id != null) { var relationList = await GetQuestionCalculateRelation(new GetQuestionCalculateRelationInDto() { - IsGetAll=true, + IsGetAll = true, TrialReadingCriterionId = indto.ReadingQuestionCriterionTrialId, }); @@ -425,7 +426,7 @@ namespace IRaCIS.Application.Services { relation.CalculateQuestionList = calculateInfoList; } - + this.VerifyCalculateRelation(relationList, indto.Id.Value, indto.Id.Value); } @@ -442,7 +443,7 @@ namespace IRaCIS.Application.Services { var query = _readingQuestionTrialRepository.AsQueryable() .Where(x => x.ReadingQuestionCriterionTrialId == inDto.ReadingQuestionCriterionTrialId) - .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName)||x.QuestionEnName.Contains(x.QuestionEnName)) + .WhereIf(!inDto.QuestionName.IsNullOrEmpty(), x => x.QuestionName.Contains(inDto.QuestionName) || x.QuestionEnName.Contains(x.QuestionEnName)) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type.Contains(inDto.Type)) .Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId) .ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder); @@ -457,7 +458,7 @@ namespace IRaCIS.Application.Services /// /// /// - private void VerifyCalculateRelation(List relationList,Guid QuestionId,Guid originalId,int count=1) + private void VerifyCalculateRelation(List relationList, Guid QuestionId, Guid originalId, int count = 1) { // 防止有脏数据 循环验证 最多10000次 if (count >= 10000) @@ -466,7 +467,7 @@ namespace IRaCIS.Application.Services throw new BusinessValidationFailedException(_localizer["ReadingQuestion_CircularDependency"]); } - var relation = relationList.Where(x=>x.CalculateQuestionList.Any(y=>y.QuestionId== QuestionId||y.TableQuestionId==QuestionId)).ToList(); + var relation = relationList.Where(x => x.CalculateQuestionList.Any(y => y.QuestionId == QuestionId || y.TableQuestionId == QuestionId)).ToList(); if (relation.Select(x => x.QuestionId).ToList().Contains(originalId)) { @@ -476,11 +477,11 @@ namespace IRaCIS.Application.Services else { - + relation.ForEach(x => { - VerifyCalculateRelation(relationList, x.QuestionId, originalId,count++); + VerifyCalculateRelation(relationList, x.QuestionId, originalId, count++); }); } @@ -497,11 +498,11 @@ namespace IRaCIS.Application.Services if (inDto.TrialReadingCriterionId != null) { return await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId) - .WhereIf(!inDto.IsGetAll,x=>x.DataSource== DataSources.Automatic&&x.Type== "number") + .WhereIf(!inDto.IsGetAll, x => x.DataSource == DataSources.Automatic && x.Type == "number") .Select(x => new CalculateRelationDto() { QuestionId = x.Id, - QuestionName= x.QuestionName, + QuestionName = x.QuestionName, CustomCalculateMark = x.CustomCalculateMark, CalculateQuestionList = x.CalculateQuestionList, ValueType = x.ValueType, @@ -549,8 +550,8 @@ namespace IRaCIS.Application.Services .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, - DictionaryCode=x.DictionaryCode, - QuestionGenre=x.QuestionGenre, + DictionaryCode = x.DictionaryCode, + QuestionGenre = x.QuestionGenre, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), TypeValue = x.TypeValue, GroupName = x.GroupName, @@ -573,12 +574,12 @@ namespace IRaCIS.Application.Services return ResponseOutput.NotOk(_localizer["ReadingQuestion_ChildrenExist"]); } - if (await _readingQuestionTrialRepository.AnyAsync(x => x.GroupId == id)) - { + if (await _readingQuestionTrialRepository.AnyAsync(x => x.GroupId == id)) + { //---此分组已被引用,请先删除被引用的问题 - return ResponseOutput.NotOk(_localizer["ReadingQuestion_GroupReferenced"]); - } - await _readingQuestionTrialRepository.DeleteFromQueryAsync(t => t.Id == id); + return ResponseOutput.NotOk(_localizer["ReadingQuestion_GroupReferenced"]); + } + await _readingQuestionTrialRepository.DeleteFromQueryAsync(t => t.Id == id); var success = await _readingQuestionTrialRepository.SaveChangesAsync(); return ResponseOutput.Result(success); } @@ -595,8 +596,8 @@ namespace IRaCIS.Application.Services .Where(x => x.ReadingCriterionPageId == inDto.ReadingCriterionPageId).OrderBy(t => t.ShowOrder) .Select(x => new GetTrialGroupNameOutDto { - GroupId=x.Id, - GroupName=x.GroupName, + GroupId = x.Id, + GroupName = x.GroupName, }).ToListAsync(); return result; @@ -614,7 +615,7 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task<(List,bool)> GetReadingTableQuestionTrialList(ReadingTableQuestionSystemQuery inDto) + public async Task<(List, bool)> GetReadingTableQuestionTrialList(ReadingTableQuestionSystemQuery inDto) { var readingTableQuestionSystemQueryable = _readingTableQuestionTrialRepository @@ -622,7 +623,7 @@ namespace IRaCIS.Application.Services .Where(x => x.ReadingQuestionId == inDto.ReadingQuestionId).ProjectTo(_mapper.ConfigurationProvider); var result = await readingTableQuestionSystemQueryable.OrderBy(x => x.ShowOrder).ToListAsync(); - return (result,true); + return (result, true); } /// @@ -645,7 +646,7 @@ namespace IRaCIS.Application.Services .Select(x => new CriterionOtherQuestionOutDto() { QuestionId = x.Id, - QuestionGenre=x.TableQuestionType, + QuestionGenre = x.TableQuestionType, DictionaryCode = x.DictionaryCode, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), TypeValue = x.TypeValue, @@ -667,7 +668,7 @@ namespace IRaCIS.Application.Services { var list = await _readingTableQuestionTrialRepository.Where(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder && x.ReadingQuestionId == indto.ReadingQuestionId).ToListAsync(); - if (await _readingTableQuestionTrialRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder && x.ReadingQuestionId==indto.ReadingQuestionId)) + if (await _readingTableQuestionTrialRepository.AnyAsync(x => x.Id != indto.Id && x.ShowOrder == indto.ShowOrder && x.ReadingQuestionId == indto.ReadingQuestionId)) { //---问题编号重复 throw new BusinessValidationFailedException(_localizer["ReadingQuestion_IdDup"]); @@ -682,7 +683,7 @@ namespace IRaCIS.Application.Services { IsGetAll = true, ReadingQuestionId = indto.ReadingQuestionId, - }) ; + }); var relation = relationList.FirstOrDefault(x => x.QuestionId == indto.Id); List calculateInfoList = new List(); @@ -700,10 +701,10 @@ namespace IRaCIS.Application.Services { relation.CalculateQuestionList = calculateInfoList; } - + this.VerifyCalculateRelation(relationList, indto.Id.Value, indto.Id.Value); } - + var entity = await _readingTableQuestionTrialRepository.InsertOrUpdateAsync(indto, true); @@ -712,7 +713,7 @@ namespace IRaCIS.Application.Services } - + /// @@ -842,7 +843,7 @@ namespace IRaCIS.Application.Services x => x.Id, x => NewId.NextGuid() ); - + var newQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == inDto.FromSystemCriterionId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var copyNewQuestionList = newQuestionList.Clone(); @@ -879,8 +880,8 @@ namespace IRaCIS.Application.Services ); - var newtableQuestion =await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.FromSystemCriterionId).ToListAsync(); - + var newtableQuestion = await _readingTableQuestionSystemRepository.Where(x => x.SystemCriterionId == inDto.FromSystemCriterionId).ToListAsync(); + var copyNewTableQuestionList = newtableQuestion.Clone(); @@ -889,7 +890,7 @@ namespace IRaCIS.Application.Services { var tableQuestion = x.Clone(); - + tableQuestion.SystemCriterionId = inDto.ToSystemCriterionId; tableQuestion.Id = tableQuestionRelation[tableQuestion.Id]; tableQuestion.ReadingQuestionId = questionRelation[tableQuestion.ReadingQuestionId]; @@ -924,18 +925,18 @@ namespace IRaCIS.Application.Services /// public async Task SynchronizeCriterion(SynchronizeCriterionInDto inDto) { - var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id==inDto.TrialReadingCriterionId).AsNoTracking().FirstOrDefaultAsync(); + var trialCriterion = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).AsNoTracking().FirstOrDefaultAsync(); if (trialCriterion != null) { if (trialCriterion.ReadingQuestionCriterionSystemId != null) { // 先找到项目系统问题Id和项目问题Id的对应关系 - var questionRelation = _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id).ToDictionary( - x => x.ReadingQuestionSystemId??default(Guid), + var questionRelation = _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id).ToDictionary( + x => x.ReadingQuestionSystemId ?? default(Guid), x => x.Id ); - + // 将系统里面的问题转为项目问题 var newTrialQuestionList = await _readingQuestionSystemRepository.Where(x => x.ReadingQuestionCriterionSystemId == trialCriterion.ReadingQuestionCriterionSystemId) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); @@ -947,7 +948,7 @@ namespace IRaCIS.Application.Services } else { - var newid= NewId.NextGuid(); + var newid = NewId.NextGuid(); questionRelation.Add(x.Id, newid); x.Id = newid; } @@ -964,7 +965,7 @@ namespace IRaCIS.Application.Services var question = x.Clone(); if (question.ParentId != null) { - question.ParentId = questionRelation[question.ParentId??default(Guid)]; + question.ParentId = questionRelation[question.ParentId ?? default(Guid)]; } if (question.GroupId != null) { @@ -981,17 +982,17 @@ namespace IRaCIS.Application.Services needAddDatas.Add(question); }; - await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id&&!x.IsAdditional); + await _readingQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.ReadingQuestionCriterionTrialId == trialCriterion.Id && !x.IsAdditional); await _readingQuestionTrialRepository.AddRangeAsync(needAddDatas); var systemCriterion = await _readingQuestionCriterionSystemRepository.Where(x => x.Id == trialCriterion.ReadingQuestionCriterionSystemId).FirstNotNullAsync(); await _readingQuestionCriterionTrialRepository.BatchUpdateNoTrackingAsync(x => x.Id == trialCriterion.Id, x => new ReadingQuestionCriterionTrial() { SynchronizeTime = DateTime.Now, IsMustGlobalReading = systemCriterion.IsMustGlobalReading, - IseCRFShowInDicomReading=systemCriterion.IseCRFShowInDicomReading, + IseCRFShowInDicomReading = systemCriterion.IseCRFShowInDicomReading, IsGlobalReading = systemCriterion.IsMustGlobalReading ? true : trialCriterion.IsGlobalReading, IsReadingPeriod = systemCriterion.IsMustGlobalReading ? true : trialCriterion.IsReadingPeriod, - }) ; + }); #region 表格问题 @@ -1001,7 +1002,7 @@ namespace IRaCIS.Application.Services var questionIds = needAddDatas.Select(x => x.Id).ToList(); - var tableQuestionRelation = _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId== trialCriterion.Id&&x.SystemTableQuestionId!=null).ToDictionary( + var tableQuestionRelation = _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == trialCriterion.Id && x.SystemTableQuestionId != null).ToDictionary( x => x.SystemTableQuestionId ?? default(Guid), x => x.Id ); @@ -1055,9 +1056,9 @@ namespace IRaCIS.Application.Services await _readingTableQuestionTrialRepository.BatchDeleteNoTrackingAsync(x => x.TrialCriterionId == trialCriterion.Id); await _readingTableQuestionTrialRepository.AddRangeAsync(_mapper.Map>(needAddTableDatas)); - #endregion + #endregion - } + } } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs index e4e3ae03e..2447e382a 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/TumorAssessmentService.cs @@ -1,12 +1,6 @@ -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infra.EFCore.Common; -using MassTransit; -using IRaCIS.Core.Infrastructure; +using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Service.Reading.Dto; -using Panda.DynamicWebApi.Attributes; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.TA { @@ -18,7 +12,7 @@ namespace IRaCIS.Core.Application.Service.TA IRepository _tumorAssessmentIRepository1Point1, IRepository _tumorAssessmentRepository1Point1BM) : BaseService { - + /// diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs index 9c7371891..13c40cd9d 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingGlobalTaskService.cs @@ -1,22 +1,15 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Infra.EFCore.Common; -using Panda.DynamicWebApi.Attributes; -using AutoMapper; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infrastructure; -using Newtonsoft.Json; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; using System.Linq.Dynamic.Core; -using NPOI.SS.Formula.Functions; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - + /// /// 全局阅片 /// @@ -34,8 +27,8 @@ namespace IRaCIS.Application.Services await VerifyTaskIsSign(inDto.GlobalTaskId); await this.SubmitTaskChangeState(inDto.GlobalTaskId); - var globalAnswerList = await _readingGlobalTaskInfoRepository.Where(x => - x.QuestionId!=null &&x.Answer!=string.Empty&& x.Answer != null && + var globalAnswerList = await _readingGlobalTaskInfoRepository.Where(x => + x.QuestionId != null && x.Answer != string.Empty && x.Answer != null && x.GlobalTaskId == inDto.GlobalTaskId).ToListAsync(); foreach (var item in globalAnswerList) @@ -80,16 +73,16 @@ namespace IRaCIS.Application.Services && x.Answer != answer.Answer && answer.Answer != string.Empty && answer.Answer != null , x => new ReadingTaskQuestionAnswer() { - Answer= answer.Answer, - GlobalChangeAnswer = answer.Answer, - IsGlobalChange = true, + Answer = answer.Answer, + GlobalChangeAnswer = answer.Answer, + IsGlobalChange = true, }); } - - + + } } - var answers= inDto.VisitTaskAnswerList.SelectMany(x => x.AnswerList.Select(y => new ReadingGlobalTaskInfo() + var answers = inDto.VisitTaskAnswerList.SelectMany(x => x.AnswerList.Select(y => new ReadingGlobalTaskInfo() { Answer = y.Answer, QuestionId = y.QuestionId, @@ -144,7 +137,7 @@ namespace IRaCIS.Application.Services GlobalAnswerType = x.GlobalAnswerType, TaskId = x.VisitTaskId, TrialId = inDto.TrialId, - CreateTime= createtime, + CreateTime = createtime, }).ToList()); await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading }); @@ -163,7 +156,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task GetGlobalReadingInfo(GetGlobalReadingInfoInDto inDto) { - var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.Subject).FirstNotNullAsync(); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).FirstNotNullAsync(); if (taskInfo.ReadingCategory != ReadingCategory.Global) { throw new BusinessValidationFailedException(_localizer["ReadingGlobal_NotGlobal"]); @@ -174,15 +167,15 @@ namespace IRaCIS.Application.Services ReadingTaskState = taskInfo.ReadingTaskState, }; - - - var otherGlobalTask = await _visitTaskRepository.Where(x => x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate - && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis && x.TaskState == TaskState.Effect && x.DoctorUserId != taskInfo.DoctorUserId - ).FirstOrDefaultAsync(); + + + var otherGlobalTask = await _visitTaskRepository.Where(x => x.SouceReadModuleId == taskInfo.SouceReadModuleId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate + && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis && x.TaskState == TaskState.Effect && x.DoctorUserId != taskInfo.DoctorUserId + ).FirstOrDefaultAsync(); if (otherGlobalTask != null) { result.OtherGlobalTaskId = otherGlobalTask.Id; - } + } result.TaskBlindName = taskInfo.TaskBlindName; if (taskInfo.IsAnalysisCreate) @@ -195,18 +188,18 @@ namespace IRaCIS.Application.Services result.SubjectCode = taskInfo.Subject.Code; } - var judgeInfo = await _visitTaskRepository.Where(x => - x.SubjectId == taskInfo.SubjectId - && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId - && x.TaskState == TaskState.Effect - && x.ArmEnum == taskInfo.ArmEnum - && x.ReadingCategory == ReadingCategory.Judge - && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate - && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis - && x.DoctorUserId == taskInfo.DoctorUserId - && x.ReadingTaskState == ReadingTaskState.HaveSigned - && x.VisitTaskNum == taskInfo.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge] - && x.ReReadingApplyState != ReReadingApplyState.Agree).FirstOrDefaultAsync(); + var judgeInfo = await _visitTaskRepository.Where(x => + x.SubjectId == taskInfo.SubjectId + && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId + && x.TaskState == TaskState.Effect + && x.ArmEnum == taskInfo.ArmEnum + && x.ReadingCategory == ReadingCategory.Judge + && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate + && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis + && x.DoctorUserId == taskInfo.DoctorUserId + && x.ReadingTaskState == ReadingTaskState.HaveSigned + && x.VisitTaskNum == taskInfo.VisitTaskNum + ReadingCommon.TaskNumDic[ReadingCategory.Judge] + && x.ReReadingApplyState != ReReadingApplyState.Agree).FirstOrDefaultAsync(); if (judgeInfo != null) { result.JudgeTaskId = judgeInfo.Id; @@ -217,7 +210,7 @@ namespace IRaCIS.Application.Services // 一致性分析按照doctorId 其他按照分组 - var queruTask = _visitTaskRepository.Where(x => + var queruTask = _visitTaskRepository.Where(x => x.TrialId == taskInfo.TrialId && x.SubjectId == taskInfo.SubjectId && x.ReadingCategory == ReadingCategory.Visit && @@ -248,37 +241,37 @@ namespace IRaCIS.Application.Services VisitNum = x.SourceSubjectVisit.VisitNum, IsBaseLine = x.SourceSubjectVisit.IsBaseLine, VisitId = x.SourceSubjectVisitId!.Value, - LesionCountList=x.LesionList.GroupBy(y=>y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto - { - LesionType = x.Key!.Value, - Count = x.ToList().Count() - }).ToList(), - //CrterionDictionaryGroup= x.CrterionDictionaryGroup, - BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType!=GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) + LesionCountList = x.LesionList.GroupBy(y => y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto + { + LesionType = x.Key!.Value, + Count = x.ToList().Count() + }).ToList(), + //CrterionDictionaryGroup= x.CrterionDictionaryGroup, + BeforeQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType != GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) .Select(y => new GlobalQuestionInfo() { - - JudgeDifferenceValue= y.ReadingQuestionTrial.JudgeDifferenceValue, - QuestionId = y.ReadingQuestionTrialId, + JudgeDifferenceValue = y.ReadingQuestionTrial.JudgeDifferenceValue, + + QuestionId = y.ReadingQuestionTrialId, QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us), - QuestionEnName=y.ReadingQuestionTrial.QuestionEnName, + QuestionEnName = y.ReadingQuestionTrial.QuestionEnName, AnswerGroup = y.ReadingQuestionTrial.AnswerGroup, QuestionType = y.ReadingQuestionTrial.QuestionType, - LimitEdit= y.ReadingQuestionTrial.LimitEdit, - MaxAnswerLength=y.ReadingQuestionTrial.MaxAnswerLength, - FileType=y.ReadingQuestionTrial.FileType, + LimitEdit = y.ReadingQuestionTrial.LimitEdit, + MaxAnswerLength = y.ReadingQuestionTrial.MaxAnswerLength, + FileType = y.ReadingQuestionTrial.FileType, QuestionGenre = y.ReadingQuestionTrial.QuestionGenre, DictionaryCode = y.ReadingQuestionTrial.DictionaryCode, - GlobalReadingShowType=y.ReadingQuestionTrial.GlobalReadingShowType, + GlobalReadingShowType = y.ReadingQuestionTrial.GlobalReadingShowType, AnswerCombination = y.ReadingQuestionTrial.AnswerCombination, JudgeType = y.ReadingQuestionTrial.JudgeType, - ShowOrder= y.ReadingQuestionTrial.ShowOrder, - Type = y.ReadingQuestionTrial.Type, + ShowOrder = y.ReadingQuestionTrial.ShowOrder, + Type = y.ReadingQuestionTrial.Type, TypeValue = y.ReadingQuestionTrial.TypeValue, ValueType = y.ReadingQuestionTrial.ValueType, - IsJudgeQuestion =y.ReadingQuestionTrial.IsJudgeQuestion, - Answer =y.Answer, + IsJudgeQuestion = y.ReadingQuestionTrial.IsJudgeQuestion, + Answer = y.Answer, }).ToList() }).ToListAsync(); var globalQuestionList = await _readingQuestionTrialRepository.Where(x => x.GlobalReadingShowType != GlobalReadingShowType.NotShow && x.ReadingQuestionCriterionTrialId == taskInfo.TrialReadingCriterionId).IgnoreAutoIncludes().ToListAsync(); @@ -299,40 +292,40 @@ namespace IRaCIS.Application.Services { x.BeforeQuestionList.Add(new GlobalQuestionInfo() { - QuestionId = y.Id, - JudgeDifferenceValue=y.JudgeDifferenceValue, - QuestionName = y.QuestionName.LanguageName(y.QuestionEnName, _userInfo.IsEn_Us), - QuestionEnName = y.QuestionEnName, - AnswerGroup = y.AnswerGroup, - QuestionType = y.QuestionType, - LimitEdit = y.LimitEdit, - MaxAnswerLength = y.MaxAnswerLength, - FileType = y.FileType, - QuestionGenre = y.QuestionGenre, - ShowOrder=y.ShowOrder, - DictionaryCode = y.DictionaryCode, - GlobalReadingShowType = y.GlobalReadingShowType, - AnswerCombination = y.AnswerCombination, - JudgeType = y.JudgeType, - Type = y.Type, - TypeValue = y.TypeValue, - ValueType = y.ValueType, - IsJudgeQuestion = y.IsJudgeQuestion, - Answer = string.Empty, + QuestionId = y.Id, + JudgeDifferenceValue = y.JudgeDifferenceValue, + QuestionName = y.QuestionName.LanguageName(y.QuestionEnName, _userInfo.IsEn_Us), + QuestionEnName = y.QuestionEnName, + AnswerGroup = y.AnswerGroup, + QuestionType = y.QuestionType, + LimitEdit = y.LimitEdit, + MaxAnswerLength = y.MaxAnswerLength, + FileType = y.FileType, + QuestionGenre = y.QuestionGenre, + ShowOrder = y.ShowOrder, + DictionaryCode = y.DictionaryCode, + GlobalReadingShowType = y.GlobalReadingShowType, + AnswerCombination = y.AnswerCombination, + JudgeType = y.JudgeType, + Type = y.Type, + TypeValue = y.TypeValue, + ValueType = y.ValueType, + IsJudgeQuestion = y.IsJudgeQuestion, + Answer = string.Empty, - }); + }); - } + } }); - } + } x.BeforeQuestionList = x.BeforeQuestionList.OrderBy(y => y.ShowOrder).ToList(); - }); + }); - var globalReadingQuestion = await _readingGlobalTaskInfoRepository.Where(x => x.GlobalTaskId == inDto.VisitTaskId).ToListAsync(); + var globalReadingQuestion = await _readingGlobalTaskInfoRepository.Where(x => x.GlobalTaskId == inDto.VisitTaskId).ToListAsync(); var criterionType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskInfo.TrialReadingCriterionId).Select(x => x.CriterionType).FirstOrDefaultAsync(); // Before的Answer取自于 上一次全局阅片的结果, 如果没有上一次全局阅片的结果 取访视的答案 @@ -341,7 +334,7 @@ namespace IRaCIS.Application.Services x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && x.SubjectId == taskInfo.SubjectId && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.TaskState == TaskState.Effect && x.VisitTaskNum < taskInfo.VisitTaskNum) .Where(x => x.DoctorUserId == taskInfo.DoctorUserId) - .OrderByDescending(x=>x.VisitTaskNum) + .OrderByDescending(x => x.VisitTaskNum) .FirstOrDefaultAsync(); List? globalAnswers = new List(); @@ -358,13 +351,13 @@ namespace IRaCIS.Application.Services x.BeforeQuestionList.ForEach(y => { - var globalAnswer = globalAnswers.Where(z => z.QuestionId == y.QuestionId&&z.TaskId==x.VisitTaskId).Select(z => z.Answer).FirstOrDefault(); + var globalAnswer = globalAnswers.Where(z => z.QuestionId == y.QuestionId && z.TaskId == x.VisitTaskId).Select(z => z.Answer).FirstOrDefault(); if (!globalAnswer.IsNullOrEmpty()) { - y.Answer = globalAnswer??string.Empty; + y.Answer = globalAnswer ?? string.Empty; y.IsGlobalAnswer = true; } - + }); }); } @@ -372,7 +365,7 @@ namespace IRaCIS.Application.Services result.TaskList.ForEach(x => { x.AfterQuestionList = x.BeforeQuestionList - .GroupJoin( + .GroupJoin( globalReadingQuestion , l => new { a = l.QuestionId, b = x.VisitTaskId } , r => new { a = r.QuestionId, b = r.TaskId } @@ -384,15 +377,15 @@ namespace IRaCIS.Application.Services (lr.global.Select(x => x.Answer).FirstOrDefault().IsNullOrEmpty() && inDto.UsingOriginalData ? lr.question.Answer : lr.global.Select(x => x.Answer).FirstOrDefault() ), - JudgeDifferenceValue= lr.question.JudgeDifferenceValue, - VisitAnswer = lr.question.Answer, - IsHaveChange = lr.global.Any(x=>x.QuestionId!=null&&!x.Answer.IsNullOrEmpty()) ? true : false, + JudgeDifferenceValue = lr.question.JudgeDifferenceValue, + VisitAnswer = lr.question.Answer, + IsHaveChange = lr.global.Any(x => x.QuestionId != null && !x.Answer.IsNullOrEmpty()) ? true : false, QuestionId = lr.question.QuestionId, QuestionName = lr.question.QuestionName.LanguageName(lr.question.QuestionEnName, _userInfo.IsEn_Us), QuestionType = lr.question.QuestionType, - LimitEdit=lr.question.LimitEdit, - MaxAnswerLength=lr.question.MaxAnswerLength, - FileType=lr.question.FileType, + LimitEdit = lr.question.LimitEdit, + MaxAnswerLength = lr.question.MaxAnswerLength, + FileType = lr.question.FileType, QuestionGenre = lr.question.QuestionGenre, DictionaryCode = lr.question.DictionaryCode, GlobalReadingShowType = lr.question.GlobalReadingShowType, @@ -400,10 +393,10 @@ namespace IRaCIS.Application.Services GlobalAnswerType = GlobalAnswerType.Question, AnswerGroup = lr.question.AnswerGroup, AnswerCombination = lr.question.AnswerCombination, - IsJudgeQuestion=lr.question.IsJudgeQuestion, + IsJudgeQuestion = lr.question.IsJudgeQuestion, JudgeType = lr.question.JudgeType, TypeValue = lr.question.TypeValue, - ValueType= lr.question.ValueType, + ValueType = lr.question.ValueType, }).ToList(); @@ -415,7 +408,7 @@ namespace IRaCIS.Application.Services { var agreeOrNotAnswer = globalReadingQuestion.Where(y => y.TaskId == x.VisitTaskId && y.GlobalAnswerType == GlobalAnswerType.AgreeOrNot).Select(x => x.Answer).FirstOrDefault() ?? string.Empty; - if (agreeOrNotAnswer.IsNullOrEmpty()&& lastGlobalTask!=null&& lastGlobalTask.RelatedVisitTaskIdList.Contains(x.VisitTaskId)) + if (agreeOrNotAnswer.IsNullOrEmpty() && lastGlobalTask != null && lastGlobalTask.RelatedVisitTaskIdList.Contains(x.VisitTaskId)) { agreeOrNotAnswer = "1"; } @@ -430,7 +423,7 @@ namespace IRaCIS.Application.Services GlobalAnswerType=GlobalAnswerType.AgreeOrNot, GlobalReadingShowType= GlobalReadingShowType.AllShow, } - + }; questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.UpdateType, QuestionName = "评估更新类型" }); @@ -443,8 +436,8 @@ namespace IRaCIS.Application.Services - - + + questionTypes.Add(new GetGlobalQuestionType() { GlobalAnswerType = GlobalAnswerType.Reason, QuestionName = "全局阅片备注" }); foreach (var item in questionTypes) { @@ -454,7 +447,7 @@ namespace IRaCIS.Application.Services QuestionName = item.QuestionName, Type = "input", GlobalAnswerType = item.GlobalAnswerType, - GlobalReadingShowType= GlobalReadingShowType.AllShow, + GlobalReadingShowType = GlobalReadingShowType.AllShow, }); } @@ -469,8 +462,8 @@ namespace IRaCIS.Application.Services // 找到上一个全局阅片 - - + + result.TaskList.ForEach(x => { foreach (var item in x.AfterQuestionList.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation)) @@ -502,7 +495,7 @@ namespace IRaCIS.Application.Services x.BeforeQuestionList = x.BeforeQuestionList.Where(x => x.QuestionType != QuestionType.SiteVisitForTumorEvaluation).ToList(); - x.AfterQuestionList = x.AfterQuestionList.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation|| x.GlobalAnswerType != GlobalAnswerType.Question).ToList(); + x.AfterQuestionList = x.AfterQuestionList.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation || x.GlobalAnswerType != GlobalAnswerType.Question).ToList(); }); } @@ -514,16 +507,16 @@ namespace IRaCIS.Application.Services List assessTypeList = await _readingTrialCriterionDictionaryRepository.Where(x => x.CriterionId == taskInfo.TrialReadingCriterionId && x.ParentCode == ReadingCommon.CriterionDictionary.GlobalAssess ) - //.WhereIf(isBaseLine,x=>x.IsBaseLineUse) - //.WhereIf(!isBaseLine,x=>x.IsFollowVisitUse) + //.WhereIf(isBaseLine,x=>x.IsBaseLineUse) + //.WhereIf(!isBaseLine,x=>x.IsFollowVisitUse) .Select(x => new CriterionDictionaryInfo() { Id = x.Id, - + DictionaryId = x.DictionaryId, ChildGroup = x.Dictionary.ChildGroup, - IsBaseLineUse=x.IsBaseLineUse, - IsFollowVisitUse=x.IsFollowVisitUse, + IsBaseLineUse = x.IsBaseLineUse, + IsFollowVisitUse = x.IsFollowVisitUse, Code = x.Dictionary.Code, Description = x.Dictionary.Description, ShowOrder = x.Dictionary.ShowOrder, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 7d689472c..0b7c965ee 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -1,33 +1,22 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Infra.EFCore.Common; -using Panda.DynamicWebApi.Attributes; -using AutoMapper; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using Newtonsoft.Json; using Newtonsoft.Json.Linq; -using Microsoft.Extensions.Caching.Memory; -using IRaCIS.Core.Application.Filter; -using DocumentFormat.OpenXml.Drawing; -using DocumentFormat.OpenXml.Drawing.Charts; -using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; -using AutoMapper.QueryableExtensions; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Models; -using Microsoft.Extensions.Options; -using System.Linq; -using NPOI.SS.Formula.Functions; -using static Microsoft.EntityFrameworkCore.DbLoggerCategory; -using IRaCIS.Core.Application.Helper; +using Panda.DynamicWebApi.Attributes; using ZiggyCreatures.Caching.Fusion; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// IR影像阅片 @@ -74,7 +63,7 @@ namespace IRaCIS.Application.Services ITrialEmailNoticeConfigService _trialEmailNoticeConfigService) : BaseService, IReadingImageTaskService { - + #region 计算 @@ -504,10 +493,10 @@ namespace IRaCIS.Application.Services x.TaskState == TaskState.Effect && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit) || x.Id == inDto.VisitTaskId) - .WhereIf(taskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom,x=> (x.VisitTaskNum <= taskInfo.VisitTaskNum && x.ReadingTaskState == ReadingTaskState.HaveSigned)|| x.Id == inDto.VisitTaskId); + .WhereIf(taskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder != ReadingOrder.SubjectRandom, x => (x.VisitTaskNum <= taskInfo.VisitTaskNum && x.ReadingTaskState == ReadingTaskState.HaveSigned) || x.Id == inDto.VisitTaskId); + + - - if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned) { @@ -546,7 +535,7 @@ namespace IRaCIS.Application.Services var self = result.Where(x => x.VisitTaskId == inDto.VisitTaskId).FirstOrDefault(); Random random = new Random(); var otherList = result.Where(x => x.VisitTaskId != inDto.VisitTaskId).OrderBy(x => random.Next()).ToList(); - var newList = new List() { }; + var newList = new List() { }; newList.AddRange(otherList); newList.Add(self); result = newList; @@ -795,7 +784,7 @@ namespace IRaCIS.Application.Services //排除表格问题 var questions = await _readingQuestionTrialRepository .WhereIf(questionClassify != null, x => x.QuestionClassify == questionClassify) - .WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table&& x.Type != ReadingQestionType.BasicTable) + .WhereIf(criterionIdInfo.IseCRFShowInDicomReading, x => x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable) .WhereIf(!criterionIdInfo.IseCRFShowInDicomReading, x => x.IsShowInDicom && x.ReadingQuestionCriterionTrialId == trialReadingCriterionId && x.Type != ReadingQestionType.Table && x.Type != ReadingQestionType.BasicTable) .ProjectTo(_mapper.ConfigurationProvider, new @@ -1161,7 +1150,7 @@ namespace IRaCIS.Application.Services } - var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table|| x.Type== ReadingQestionType.BasicTable).Select(x => x.GroupId).ToList(); + var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table || x.Type == ReadingQestionType.BasicTable).Select(x => x.GroupId).ToList(); qusetionList = qusetionList.Where(x => usedGuropIds.Contains(x.Id) || usedGuropIds.Contains(x.GroupId)).ToList(); } break; @@ -1173,7 +1162,7 @@ namespace IRaCIS.Application.Services } break; } - + } @@ -2704,10 +2693,10 @@ namespace IRaCIS.Application.Services /// /// [HttpPost] - public async Task SetSkipReadingCache(SetSkipReadingCacheInDto inDto ) + public async Task SetSkipReadingCache(SetSkipReadingCacheInDto inDto) { var clearSkipReadingCache = await _fusionCache.GetOrDefaultAsync(CacheKeys.SkipReadingCacheKey(_userInfo.Id)); - if (clearSkipReadingCache == null|| clearSkipReadingCache==string.Empty) + if (clearSkipReadingCache == null || clearSkipReadingCache == string.Empty) { List cacheIds = new List(); cacheIds.Add(inDto.VisitTaskId); @@ -2715,7 +2704,7 @@ namespace IRaCIS.Application.Services } else { - List? cacheIds=JsonConvert.DeserializeObject>(clearSkipReadingCache); + List? cacheIds = JsonConvert.DeserializeObject>(clearSkipReadingCache); cacheIds.Add(inDto.VisitTaskId); await _fusionCache.SetAsync(CacheKeys.SkipReadingCacheKey(_userInfo.Id), JsonConvert.SerializeObject(cacheIds), TimeSpan.FromHours(24)); } @@ -2750,7 +2739,7 @@ namespace IRaCIS.Application.Services #region 跳过阅片 var clearSkipReadingCache = await _fusionCache.GetOrDefaultAsync(CacheKeys.SkipReadingCacheKey(_userInfo.Id)); - + List cacheSkipIds = new List(); if (clearSkipReadingCache != null && clearSkipReadingCache != string.Empty) { @@ -2800,7 +2789,7 @@ namespace IRaCIS.Application.Services var currentSubject = subjectTaskList.Where(x => x.Index >= subjectIndex && !x.ExistReadingApply) // 排除跳过的 - .Where(x=> x.UnReadCanReadTaskList.Select(y => y.Id).Intersect(cacheSkipIds).Count()==0) + .Where(x => x.UnReadCanReadTaskList.Select(y => y.Id).Intersect(cacheSkipIds).Count() == 0) .OrderBy(x => x.Index).FirstOrDefault(); @@ -2811,17 +2800,17 @@ namespace IRaCIS.Application.Services task = currentSubject.UnReadCanReadTaskList .Select(x => new GetReadingTaskDto() - { - ReadingCategory = x.ReadingCategory, - SubjectCode = currentSubject.SubjectCode, - SubjectId = currentSubject.SubjectId, - TaskBlindName = x.TaskBlindName, - VisitNum = x.VisitNum, - ArmEnum = x.ArmEnum, - VisistId = x.VisistId ?? default(Guid), - VisitTaskId = x.Id, - TrialReadingCriterionId = x.TrialReadingCriterionId, - }).FirstOrDefault(); + { + ReadingCategory = x.ReadingCategory, + SubjectCode = currentSubject.SubjectCode, + SubjectId = currentSubject.SubjectId, + TaskBlindName = x.TaskBlindName, + VisitNum = x.VisitNum, + ArmEnum = x.ArmEnum, + VisistId = x.VisistId ?? default(Guid), + VisitTaskId = x.Id, + TrialReadingCriterionId = x.TrialReadingCriterionId, + }).FirstOrDefault(); @@ -2833,7 +2822,7 @@ namespace IRaCIS.Application.Services TrialId = inDto.TrialId, SubjectId = inDto.SubjectId, TrialReadingCriterionId = trialReadingCriterionId!.Value, - SubjectCode=inDto.SubjectCode, + SubjectCode = inDto.SubjectCode, PageIndex = 1, PageSize = 99999, @@ -2858,23 +2847,23 @@ namespace IRaCIS.Application.Services Random random = new Random(); //返回的范围是 0- taskList.Count-1 int randomIndex = random.Next(taskList.Count); - + var visitTaskId = taskList[randomIndex].Id; - task = await _visitTaskRepository.Where(x=>x.Id== visitTaskId).Select(x => new GetReadingTaskDto() - { - VisitTaskId = x.Id, - ArmEnum = x.ArmEnum, - TaskBlindName = x.TaskBlindName, - ReadingCategory = x.ReadingCategory, - VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule == null ? default(Guid) : x.ReadModule.SubjectVisitId, - VisitNum = x.VisitTaskNum, - SubjectId = x.SubjectId, - SubjectCode = x.Subject.Code, - TrialReadingCriterionId = x.TrialReadingCriterionId, - }).FirstOrDefaultAsync(); + task = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => new GetReadingTaskDto() + { + VisitTaskId = x.Id, + ArmEnum = x.ArmEnum, + TaskBlindName = x.TaskBlindName, + ReadingCategory = x.ReadingCategory, + VisistId = x.SourceSubjectVisitId != null ? x.SourceSubjectVisitId.Value : x.ReadModule == null ? default(Guid) : x.ReadModule.SubjectVisitId, + VisitNum = x.VisitTaskNum, + SubjectId = x.SubjectId, + SubjectCode = x.Subject.Code, + TrialReadingCriterionId = x.TrialReadingCriterionId, + }).FirstOrDefaultAsync(); - } + } else { var query = _visitTaskRepository.Where(x => x.TrialId == inDto.TrialId && x.TrialReadingCriterionId == trialReadingCriterionId && x.ReadingTaskState != ReadingTaskState.HaveSigned && x.DoctorUserId == _userInfo.Id @@ -2917,7 +2906,7 @@ namespace IRaCIS.Application.Services task.SubjectCode = await _subjectRepository.Where(x => x.Id == task.SubjectId).Select(x => x.Code).FirstNotNullAsync(); } - await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == task.VisitTaskId&&x.TaskState==TaskState.Effect&&x.ReadingTaskState!=ReadingTaskState.HaveSigned , x => new VisitTask() + await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == task.VisitTaskId && x.TaskState == TaskState.Effect && x.ReadingTaskState != ReadingTaskState.HaveSigned, x => new VisitTask() { FirstReadingTime = DateTime.Now, }); @@ -3039,7 +3028,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task VerifyReadingRestTime() { - var userTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt; + var userTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt; if (userTypeEnum != UserTypeEnum.IndependentReviewer) { return true; @@ -3282,7 +3271,7 @@ namespace IRaCIS.Application.Services { if (taskInfo.ReadingCategory == ReadingCategory.Visit) { - switch(isReadingTaskViewInOrder) + switch (isReadingTaskViewInOrder) { case ReadingOrder.SubjectRandom: @@ -3295,7 +3284,7 @@ namespace IRaCIS.Application.Services x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.ArmEnum == taskInfo.ArmEnum && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis && - x.BlindSubjectCode==taskInfo.BlindSubjectCode && + x.BlindSubjectCode == taskInfo.BlindSubjectCode && x.DoctorUserId == taskInfo.DoctorUserId && x.TaskState == TaskState.Effect && x.Id != taskInfo.Id).Select(x => x.Id).ToListAsync(); @@ -3304,7 +3293,7 @@ namespace IRaCIS.Application.Services relatedVisitTaskIdList.Add(taskInfo.Id); break; } - + } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs index 742ff0a80..f7a8105d2 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingJudgeTaskService.cs @@ -1,21 +1,17 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Infra.EFCore.Common; -using Panda.DynamicWebApi.Attributes; -using AutoMapper; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infrastructure; -using Newtonsoft.Json; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - + /// /// 裁判 /// @@ -43,14 +39,14 @@ namespace IRaCIS.Application.Services QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), PageName = x.ReadingCriterionPage.PageName, TypeValue = x.TypeValue, - QuestionGenre=x.QuestionGenre, - DictionaryCode=x.DictionaryCode, + QuestionGenre = x.QuestionGenre, + DictionaryCode = x.DictionaryCode, JudgeType = x.JudgeType, - Type=x.Type, - Unit= x.Unit, + Type = x.Type, + Unit = x.Unit, ReadingQuestionTrialId = x.Id, - JudgeDifferenceValue= x.JudgeDifferenceValue, - JudgeDifferenceType=x.JudgeDifferenceType, + JudgeDifferenceValue = x.JudgeDifferenceValue, + JudgeDifferenceType = x.JudgeDifferenceType, }).ToListAsync(); @@ -74,9 +70,9 @@ namespace IRaCIS.Application.Services { AnswerGroup = JsonConvert.SerializeObject(inDto.AnswerGroup), AnswerCombination = JsonConvert.SerializeObject(inDto.AnswerCombination), - JudgeDifferenceValue= inDto.JudgeDifferenceValue, - JudgeDifferenceType=inDto.JudgeDifferenceType, - JudgeType = inDto.JudgeType, + JudgeDifferenceValue = inDto.JudgeDifferenceValue, + JudgeDifferenceType = inDto.JudgeDifferenceType, + JudgeType = inDto.JudgeType, }); var result = await _readingQuestionTrialRepository.SaveChangesAsync(); @@ -134,21 +130,11 @@ namespace IRaCIS.Application.Services if (await VerifyIsGlobalVisitTask(taskList[0].Id)) { - var globalVisitTaskIds = await _visitTaskRepository.Where(x=>x.Id== taskList[0].Id).Select(x=>x.RelatedVisitTaskIdList).FirstNotNullAsync(); + var globalVisitTaskIds = await _visitTaskRepository.Where(x => x.Id == taskList[0].Id).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync(); // 找到所有的的任务 - var globalVisitTasks = await _visitTaskRepository.Where(x => globalVisitTaskIds.Contains(x.Id)||x.Id== taskList[0].Id).Select(x => new { - x.Id, - x.ArmEnum, - x.VisitTaskNum, - x.SourceSubjectVisitId, - x.TaskBlindName, - } ).ToListAsync(); - - var globalVisitTwoTaskIds = await _visitTaskRepository.Where(x => x.Id == taskList[1].Id).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync(); - - // 找到所有的的任务 - var globalVisitTwoTasks = await _visitTaskRepository.Where(x => globalVisitTwoTaskIds.Contains(x.Id) || x.Id == taskList[1].Id).Select(x => new { + var globalVisitTasks = await _visitTaskRepository.Where(x => globalVisitTaskIds.Contains(x.Id) || x.Id == taskList[0].Id).Select(x => new + { x.Id, x.ArmEnum, x.VisitTaskNum, @@ -156,7 +142,19 @@ namespace IRaCIS.Application.Services x.TaskBlindName, }).ToListAsync(); - var taskNum = globalVisitTasks.Select(x => x.VisitTaskNum).Distinct().OrderBy(x=>x).ToList(); + var globalVisitTwoTaskIds = await _visitTaskRepository.Where(x => x.Id == taskList[1].Id).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync(); + + // 找到所有的的任务 + var globalVisitTwoTasks = await _visitTaskRepository.Where(x => globalVisitTwoTaskIds.Contains(x.Id) || x.Id == taskList[1].Id).Select(x => new + { + x.Id, + x.ArmEnum, + x.VisitTaskNum, + x.SourceSubjectVisitId, + x.TaskBlindName, + }).ToListAsync(); + + var taskNum = globalVisitTasks.Select(x => x.VisitTaskNum).Distinct().OrderBy(x => x).ToList(); var judgeQuestionAnswer = await _readingTaskQuestionAnswerRepository.Where(x => globalVisitTaskIds.Contains(x.VisitTaskId) && x.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(x => x.ReadingQuestionTrial.ShowOrder) @@ -267,7 +265,7 @@ namespace IRaCIS.Application.Services judgeInfo.VisitInfoList.Add(judgeReadingInfoDto); } - + break; case ReadingCategory.Global: @@ -300,14 +298,14 @@ namespace IRaCIS.Application.Services ArmEnum = item.ArmEnum, VisitTaskId = item.VisitTaskId, GlobalVisitTaskId = taskList[0].Id, - JudgeQuestionList = item.AfterQuestionList.Where(x => x.GlobalAnswerType== GlobalAnswerType.Question).Select(x => new JudgeQuestion() + JudgeQuestionList = item.AfterQuestionList.Where(x => x.GlobalAnswerType == GlobalAnswerType.Question).Select(x => new JudgeQuestion() { Answer = x.Answer, QuestionId = x.QuestionId!.Value, QuestionName = x.QuestionName, - QuestionGenre=x.QuestionGenre, - DictionaryCode=x.DictionaryCode, + QuestionGenre = x.QuestionGenre, + DictionaryCode = x.DictionaryCode, }).ToList() }; @@ -322,11 +320,11 @@ namespace IRaCIS.Application.Services }); } - + judgeReadingQuestion.JudgeQuestionList.Add(new JudgeQuestion() { - Answer = item.AfterQuestionList.Where(x => x.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault()??string.Empty, + Answer = item.AfterQuestionList.Where(x => x.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty, QuestionType = JudgeReadingQuestionType.VisitRemark, QuestionName = "", }); @@ -337,14 +335,14 @@ namespace IRaCIS.Application.Services var rTwoJudge = new JudgeReadingQuestion() { ArmEnum = twoItem.ArmEnum, - + VisitTaskId = twoItem.VisitTaskId, GlobalVisitTaskId = taskList[1].Id, JudgeQuestionList = twoItem.AfterQuestionList.Where(x => x.GlobalAnswerType == GlobalAnswerType.Question).Select(x => new JudgeQuestion() { Answer = x.Answer, - QuestionId = x.QuestionId==null?default(Guid): x.QuestionId.Value, + QuestionId = x.QuestionId == null ? default(Guid) : x.QuestionId.Value, QuestionName = x.QuestionName, QuestionGenre = x.QuestionGenre, DictionaryCode = x.DictionaryCode, @@ -365,11 +363,11 @@ namespace IRaCIS.Application.Services } - + rTwoJudge.JudgeQuestionList.Add(new JudgeQuestion() { - Answer = twoItem.AfterQuestionList.Where(x => x.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault()??string.Empty, + Answer = twoItem.AfterQuestionList.Where(x => x.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty, QuestionType = JudgeReadingQuestionType.VisitRemark, QuestionName = "", }); @@ -405,7 +403,7 @@ namespace IRaCIS.Application.Services { JudgeResultTaskId = inDto.JudgeResultTaskId, JudgeResultRemark = inDto.JudgeResultRemark, - JudgeResultImagePath = string.Join(',',inDto.JudgeResultImagePathList), + JudgeResultImagePath = string.Join(',', inDto.JudgeResultImagePathList), }); var result = await _visitTaskRepository.SaveChangesAsync(); @@ -432,19 +430,19 @@ namespace IRaCIS.Application.Services SignTime = DateTime.Now, JudgeResultImagePath = string.Join(',', inDto.JudgeResultImagePathList), }); - var result = await _visitTaskRepository.SaveChangesAsync(); + var result = await _visitTaskRepository.SaveChangesAsync(); - // 需要判断是否添加肿瘤学任务 - var taskInfo = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); + // 需要判断是否添加肿瘤学任务 + var taskInfo = await _visitTaskRepository.Where(x => x.JudgeVisitTaskId == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); if (taskInfo.ReadingCategory == ReadingCategory.Visit) { - var oncologModule = await _readModuleRepository - .Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId &&x.TrialReadingCriterionId==taskInfo.TrialReadingCriterionId&& x.ModuleType == ModuleTypeEnum.Oncology).FirstOrDefaultAsync(); - if (!taskInfo.TrialReadingCriterion.IsGlobalReading&&oncologModule != null) + var oncologModule = await _readModuleRepository + .Where(x => x.SubjectVisitId == taskInfo.SourceSubjectVisitId && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && x.ModuleType == ModuleTypeEnum.Oncology).FirstOrDefaultAsync(); + if (!taskInfo.TrialReadingCriterion.IsGlobalReading && oncologModule != null) { - await AddOncologyTask(oncologModule.Id); - } + await AddOncologyTask(oncologModule.Id); + } } else if (taskInfo.ReadingCategory == ReadingCategory.Global) @@ -457,15 +455,15 @@ namespace IRaCIS.Application.Services var visitId = await _readModuleRepository.Where(x => x.Id == taskInfo.SouceReadModuleId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync(); var oncologModule = await _readModuleRepository.Where(x => x.SubjectVisitId == visitId && x.ModuleType == ModuleTypeEnum.Oncology - &&x.TrialReadingCriterionId== taskInfo.TrialReadingCriterionId + && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId ).FirstOrDefaultAsync(); - if (oncologModule != null) - { - await AddOncologyTask(oncologModule.Id); - } + if (oncologModule != null) + { + await AddOncologyTask(oncologModule.Id); + } - } + } @@ -534,12 +532,12 @@ namespace IRaCIS.Application.Services else { isGroupAnalysis = true; - visitTaskids = await _visitTaskRepository.Where(x => x.TaskState == TaskState.Effect && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId + visitTaskids = await _visitTaskRepository.Where(x => x.TaskState == TaskState.Effect && x.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && x.TrialReadingCriterionId == visitTask.TrialReadingCriterionId && x.SouceReadModuleId == visitTask.SouceReadModuleId && x.ReadingCategory != ReadingCategory.Judge && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.Id).ToListAsync(); } - + } else @@ -559,13 +557,13 @@ namespace IRaCIS.Application.Services } else { - foreach (var item in visitTaskids.Where(x=>x!=visitTask.Id)) + foreach (var item in visitTaskids.Where(x => x != visitTask.Id)) { - var armEnum = await _visitTaskRepository.Where(x => x.Id == item).Select(x=>x.ArmEnum).FirstNotNullAsync(); + var armEnum = await _visitTaskRepository.Where(x => x.Id == item).Select(x => x.ArmEnum).FirstNotNullAsync(); await VerifyJudgeResult(visitTask, new List() { visitTask.Id, item }, armEnum); } } - + @@ -573,7 +571,7 @@ namespace IRaCIS.Application.Services } - private async Task VerifyJudgeResult(VisitTask visitTask,List visitTaskids,Arm? groupArm = null) + private async Task VerifyJudgeResult(VisitTask visitTask, List visitTaskids, Arm? groupArm = null) { var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == visitTask.TrialReadingCriterionId).Select(x => new { @@ -605,8 +603,8 @@ namespace IRaCIS.Application.Services && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == visitTask.TrialReadingCriterionId && x.IsAnalysisCreate == false - && x.SubjectId == visitTask.SubjectId - && x.ReadingCategory == ReadingCategory.Visit && x.VisitTaskNum <= visitTask.VisitTaskNum).Select(x => x.Id).ToListAsync(); + && x.SubjectId == visitTask.SubjectId + && x.ReadingCategory == ReadingCategory.Visit && x.VisitTaskNum <= visitTask.VisitTaskNum).Select(x => x.Id).ToListAsync(); var globalVisitQuestionQuery = from questionAnswer in _readingTaskQuestionAnswerRepository.Where(x => GlobalVisitTaskIds.Contains(x.VisitTaskId)) @@ -619,8 +617,8 @@ namespace IRaCIS.Application.Services AnswerCombination = question.AnswerCombination, JudgeType = question.JudgeType, QuestionId = question.Id, - JudgeDifferenceValue=question.JudgeDifferenceValue, - JudgeDifferenceType=question.JudgeDifferenceType, + JudgeDifferenceValue = question.JudgeDifferenceValue, + JudgeDifferenceType = question.JudgeDifferenceType, VisitTaskId = questionAnswer.VisitTaskId, }; var globalVisitAnswerlist = await globalVisitQuestionQuery.ToListAsync(); @@ -629,15 +627,15 @@ namespace IRaCIS.Application.Services foreach (var item in taskNums) { - List groupTasks = globalVisitAnswerlist.Where(x => x.VisitTaskNum == item).GroupBy(x => new {x.JudgeDifferenceValue,x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto + List groupTasks = globalVisitAnswerlist.Where(x => x.VisitTaskNum == item).GroupBy(x => new { x.JudgeDifferenceValue, x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto { QuestionId = x.Key.QuestionId, AnswerGroup = x.Key.AnswerGroup, AnswerCombination = x.Key.AnswerCombination, JudgeType = x.Key.JudgeType, - JudgeDifferenceValue=x.Key.JudgeDifferenceValue, - JudgeDifferenceType = x.Key.JudgeDifferenceType, - TaskAnswerList = x.Select(y => y.Answer).ToList(), + JudgeDifferenceValue = x.Key.JudgeDifferenceValue, + JudgeDifferenceType = x.Key.JudgeDifferenceType, + TaskAnswerList = x.Select(y => y.Answer).ToList(), }).ToList(); noteEqual = noteEqual || ComputeJudgeResult(groupTasks); } @@ -654,22 +652,22 @@ namespace IRaCIS.Application.Services AnswerCombination = question.AnswerCombination, JudgeType = question.JudgeType, QuestionId = question.Id, - JudgeDifferenceValue=question.JudgeDifferenceValue, - JudgeDifferenceType = question.JudgeDifferenceType, - VisitTaskId = questionAnswet.VisitTaskId, + JudgeDifferenceValue = question.JudgeDifferenceValue, + JudgeDifferenceType = question.JudgeDifferenceType, + VisitTaskId = questionAnswet.VisitTaskId, }; var questionAnswerlist = await query.ToListAsync(); // 将答案进行分组 - List groupTasks = questionAnswerlist.GroupBy(x => new {x.JudgeDifferenceValue,x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto + List groupTasks = questionAnswerlist.GroupBy(x => new { x.JudgeDifferenceValue, x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto { QuestionId = x.Key.QuestionId, AnswerGroup = x.Key.AnswerGroup, AnswerCombination = x.Key.AnswerCombination, JudgeType = x.Key.JudgeType, - JudgeDifferenceValue=x.Key.JudgeDifferenceValue, - JudgeDifferenceType = x.Key.JudgeDifferenceType, - TaskAnswerList = x.Select(y => y.Answer).ToList(), + JudgeDifferenceValue = x.Key.JudgeDifferenceValue, + JudgeDifferenceType = x.Key.JudgeDifferenceType, + TaskAnswerList = x.Select(y => y.Answer).ToList(), }).ToList(); noteEqual = ComputeJudgeResult(groupTasks); } @@ -710,16 +708,16 @@ namespace IRaCIS.Application.Services twoItem.AfterQuestionList.Where(x => x.QuestionId != null && x.IsJudgeQuestion).ToList() ).ToList(); - List globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination,x.JudgeDifferenceValue,x.JudgeDifferenceType }).Select(x => new GroupTaskAnswerDto + List globalGroupTasks = newlist.GroupBy(x => new { x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination, x.JudgeDifferenceValue, x.JudgeDifferenceType }).Select(x => new GroupTaskAnswerDto { QuestionId = x.Key.QuestionId!.Value, AnswerGroup = x.Key.AnswerGroup, AnswerCombination = x.Key.AnswerCombination, JudgeType = x.Key.JudgeType, TaskAnswerList = x.Select(y => y.Answer).ToList(), - JudgeDifferenceValue= x.Key.JudgeDifferenceValue, - JudgeDifferenceType = x.Key.JudgeDifferenceType, - }).ToList(); + JudgeDifferenceValue = x.Key.JudgeDifferenceValue, + JudgeDifferenceType = x.Key.JudgeDifferenceType, + }).ToList(); noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks); } @@ -762,9 +760,9 @@ namespace IRaCIS.Application.Services AnswerCombination = question.AnswerCombination, JudgeType = question.JudgeType, QuestionId = question.Id, - JudgeDifferenceValue=question.JudgeDifferenceValue, - JudgeDifferenceType = question.JudgeDifferenceType, - }; + JudgeDifferenceValue = question.JudgeDifferenceValue, + JudgeDifferenceType = question.JudgeDifferenceType, + }; var visitTaskQuestions = await query.ToListAsync(); @@ -772,15 +770,15 @@ namespace IRaCIS.Application.Services lastTask.AfterQuestionList.Where(x => x.QuestionId != null).ToList() ).ToList(); - List globalGroupTasks = newlist.GroupBy(x => new {x.JudgeDifferenceValue,x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto + List globalGroupTasks = newlist.GroupBy(x => new { x.JudgeDifferenceValue, x.JudgeDifferenceType, x.QuestionId, x.AnswerGroup, x.JudgeType, x.AnswerCombination }).Select(x => new GroupTaskAnswerDto { QuestionId = x.Key.QuestionId!.Value, AnswerGroup = x.Key.AnswerGroup, AnswerCombination = x.Key.AnswerCombination, JudgeType = x.Key.JudgeType, - JudgeDifferenceValue=x.Key.JudgeDifferenceValue, - JudgeDifferenceType = x.Key.JudgeDifferenceType, - TaskAnswerList = x.Select(y => y.Answer).ToList(), + JudgeDifferenceValue = x.Key.JudgeDifferenceValue, + JudgeDifferenceType = x.Key.JudgeDifferenceType, + TaskAnswerList = x.Select(y => y.Answer).ToList(), }).ToList(); noteEqual = noteEqual || ComputeJudgeResult(globalGroupTasks); } @@ -822,7 +820,7 @@ namespace IRaCIS.Application.Services IsGroupDiffArm2 = true }); } - + await _visitTaskRepository.SaveChangesAsync(); } @@ -853,7 +851,7 @@ namespace IRaCIS.Application.Services if (visitTask.IsAnalysisCreate) { - + if (groupArm == null) { @@ -902,8 +900,8 @@ namespace IRaCIS.Application.Services } else if (noteEqual) { - break; - } + break; + } else { var taskAnswer1 = item.TaskAnswerList[0]; diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs index 1574583dc..fbe86c065 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingNoDicomTaskService.cs @@ -1,15 +1,12 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Infra.EFCore.Common; -using Panda.DynamicWebApi.Attributes; -using IRaCIS.Core.Application.Contracts; -using MassTransit; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Domain.Models; -using DocumentFormat.OpenXml.EMMA; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; +using MassTransit; +using Microsoft.AspNetCore.Mvc; +using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs index e4e374694..cb84c01a6 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingOncologyTaskService.cs @@ -1,21 +1,17 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Infra.EFCore.Common; -using Panda.DynamicWebApi.Attributes; -using AutoMapper; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Infrastructure; -using Newtonsoft.Json; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; +using Newtonsoft.Json; +using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { - + /// /// 肿瘤学 /// @@ -32,7 +28,7 @@ namespace IRaCIS.Application.Services [HttpPost] public async Task GetOncologyReadingInfo(GetOncologyReadingInfoInDto inDto) { - var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x=>x.TrialReadingCriterion).FirstNotNullAsync(); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); if (taskInfo.ReadingCategory != ReadingCategory.Oncology) { @@ -58,16 +54,16 @@ namespace IRaCIS.Application.Services Guid? judgeResultTaskId = null; if (taskInfo.ReadingTaskState == ReadingTaskState.HaveSigned && relatedVisitTaskIdList.Count() > 0) { - judgeResultTaskId = await _visitTaskRepository.Where(x => x.Id == relatedVisitTaskIdList[0]).Select(x => x.JudgeResultTaskId).FirstOrDefaultAsync(); + judgeResultTaskId = await _visitTaskRepository.Where(x => x.Id == relatedVisitTaskIdList[0]).Select(x => x.JudgeResultTaskId).FirstOrDefaultAsync(); // 说明是裁判 取裁判结果 if (judgeResultTaskId != null) { - globalOrVisitTaskInfo = await _visitTaskRepository.Where(x =>x.Id== judgeResultTaskId).FirstNotNullAsync(); + globalOrVisitTaskInfo = await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).FirstNotNullAsync(); } else { - globalOrVisitTaskInfo = await _visitTaskRepository.Where(x => x.Id == relatedVisitTaskIdList[0]).FirstNotNullAsync(); + globalOrVisitTaskInfo = await _visitTaskRepository.Where(x => x.Id == relatedVisitTaskIdList[0]).FirstNotNullAsync(); } @@ -80,26 +76,26 @@ namespace IRaCIS.Application.Services // 访视 (decimal)(taskInfo.VisitTaskNum - ReadingCommon.TaskNumDic[ReadingCategory.Oncology]) - }; + }; - - globalOrVisitTaskInfo = await _visitTaskRepository + + globalOrVisitTaskInfo = await _visitTaskRepository .Where(x => x.SubjectId == taskInfo.SubjectId && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId && - taskNums.Contains(x.VisitTaskNum) && + taskNums.Contains(x.VisitTaskNum) && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis && x.VisitTaskNum < taskInfo.VisitTaskNum ) - .WhereIf(taskInfo.TrialReadingCriterion.IsGlobalReading, x=>x.ReadingCategory == ReadingCategory.Global) - .WhereIf(!taskInfo.TrialReadingCriterion.IsGlobalReading, x => x.ReadingCategory == ReadingCategory.Visit) - .OrderByDescending(x=>x.VisitTaskNum).ThenBy(x => x.ArmEnum) + .WhereIf(taskInfo.TrialReadingCriterion.IsGlobalReading, x => x.ReadingCategory == ReadingCategory.Global) + .WhereIf(!taskInfo.TrialReadingCriterion.IsGlobalReading, x => x.ReadingCategory == ReadingCategory.Visit) + .OrderByDescending(x => x.VisitTaskNum).ThenBy(x => x.ArmEnum) .FirstNotNullAsync(); } - + // 最后取哪组的数据 @@ -125,23 +121,23 @@ namespace IRaCIS.Application.Services throw new BusinessValidationFailedException(_localizer["ReadingOncology_Abnormal"]); } } - + //visitTask = await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).FirstNotNullAsync(); - visitTaskIdList= await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).Select(x=>x.RelatedVisitTaskIdList).FirstNotNullAsync(); + visitTaskIdList = await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).Select(x => x.RelatedVisitTaskIdList).FirstNotNullAsync(); globalOrVisitTaskInfo = await _visitTaskRepository.Where(x => x.Id == judgeResultTaskId).FirstNotNullAsync(); - } + } - result.RelatedTaskId = globalOrVisitTaskInfo!.JudgeVisitTaskId ?? globalOrVisitTaskInfo.Id; + result.RelatedTaskId = globalOrVisitTaskInfo!.JudgeVisitTaskId ?? globalOrVisitTaskInfo.Id; result.ReadingCategory = globalOrVisitTaskInfo.ReadingCategory; - result.GlobalOrVisitTaskId = globalOrVisitTaskInfo.Id; + result.GlobalOrVisitTaskId = globalOrVisitTaskInfo.Id; result.SubjectId = globalOrVisitTaskInfo.SubjectId; - List globalVisits=new List(); + List globalVisits = new List(); if (result.ReadingCategory == ReadingCategory.Global) { @@ -155,61 +151,61 @@ namespace IRaCIS.Application.Services else { // 按照全局那边的查询法 - globalVisits =await _visitTaskRepository.Where(x => - x.TrialId == globalOrVisitTaskInfo.TrialId && - x.SubjectId == globalOrVisitTaskInfo.SubjectId && - x.ReadingCategory == ReadingCategory.Visit && - x.TrialReadingCriterionId == globalOrVisitTaskInfo.TrialReadingCriterionId && - x.ReadingTaskState == ReadingTaskState.HaveSigned && - x.IsAnalysisCreate == globalOrVisitTaskInfo.IsAnalysisCreate && - x.ArmEnum == globalOrVisitTaskInfo.ArmEnum && - x.IsSelfAnalysis == globalOrVisitTaskInfo.IsSelfAnalysis && - x.DoctorUserId == globalOrVisitTaskInfo.DoctorUserId && - x.TaskState == TaskState.Effect && - x.VisitTaskNum <= globalOrVisitTaskInfo.VisitTaskNum) - .OrderBy(x => x.VisitTaskNum).Select(x => new GlobalVisitInfo() - { - VisitName = x.TaskName, - BlindName = x.TaskBlindName, - VisitTaskId = x.Id, - IsConvertedTask = x.IsConvertedTask, - IsFirstChangeTask = x.IsConvertedTask && x.BeforeConvertedTaskId != null, - ArmEnum = globalOrVisitTaskInfo.ArmEnum, - VisitNum = x.SourceSubjectVisit.VisitNum, - IsBaseLine = x.SourceSubjectVisit.IsBaseLine, - VisitId = x.SourceSubjectVisitId!.Value, - LesionCountList = x.LesionList.GroupBy(y => y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto - { - LesionType = x.Key!.Value, - Count = x.ToList().Count() - }).ToList(), - //CrterionDictionaryGroup= x.CrterionDictionaryGroup, - AfterQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType != GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) - .Select(y => new GlobalQuestionInfo() - { + globalVisits = await _visitTaskRepository.Where(x => + x.TrialId == globalOrVisitTaskInfo.TrialId && + x.SubjectId == globalOrVisitTaskInfo.SubjectId && + x.ReadingCategory == ReadingCategory.Visit && + x.TrialReadingCriterionId == globalOrVisitTaskInfo.TrialReadingCriterionId && + x.ReadingTaskState == ReadingTaskState.HaveSigned && + x.IsAnalysisCreate == globalOrVisitTaskInfo.IsAnalysisCreate && + x.ArmEnum == globalOrVisitTaskInfo.ArmEnum && + x.IsSelfAnalysis == globalOrVisitTaskInfo.IsSelfAnalysis && + x.DoctorUserId == globalOrVisitTaskInfo.DoctorUserId && + x.TaskState == TaskState.Effect && + x.VisitTaskNum <= globalOrVisitTaskInfo.VisitTaskNum) + .OrderBy(x => x.VisitTaskNum).Select(x => new GlobalVisitInfo() + { + VisitName = x.TaskName, + BlindName = x.TaskBlindName, + VisitTaskId = x.Id, + IsConvertedTask = x.IsConvertedTask, + IsFirstChangeTask = x.IsConvertedTask && x.BeforeConvertedTaskId != null, + ArmEnum = globalOrVisitTaskInfo.ArmEnum, + VisitNum = x.SourceSubjectVisit.VisitNum, + IsBaseLine = x.SourceSubjectVisit.IsBaseLine, + VisitId = x.SourceSubjectVisitId!.Value, + LesionCountList = x.LesionList.GroupBy(y => y.ReadingQuestionTrial.LesionType).Select(x => new LesionDto + { + LesionType = x.Key!.Value, + Count = x.ToList().Count() + }).ToList(), + //CrterionDictionaryGroup= x.CrterionDictionaryGroup, + AfterQuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.GlobalReadingShowType != GlobalReadingShowType.NotShow).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) + .Select(y => new GlobalQuestionInfo() + { - QuestionId = y.ReadingQuestionTrialId, - QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us), - QuestionEnName = y.ReadingQuestionTrial.QuestionEnName, - AnswerGroup = y.ReadingQuestionTrial.AnswerGroup, - QuestionType = y.ReadingQuestionTrial.QuestionType, - LimitEdit = y.ReadingQuestionTrial.LimitEdit, - MaxAnswerLength = y.ReadingQuestionTrial.MaxAnswerLength, - FileType = y.ReadingQuestionTrial.FileType, - QuestionGenre = y.ReadingQuestionTrial.QuestionGenre, - DictionaryCode = y.ReadingQuestionTrial.DictionaryCode, - GlobalReadingShowType = y.ReadingQuestionTrial.GlobalReadingShowType, - AnswerCombination = y.ReadingQuestionTrial.AnswerCombination, - JudgeType = y.ReadingQuestionTrial.JudgeType, - ShowOrder = y.ReadingQuestionTrial.ShowOrder, - Type = y.ReadingQuestionTrial.Type, - TypeValue = y.ReadingQuestionTrial.TypeValue, - ValueType = y.ReadingQuestionTrial.ValueType, - IsJudgeQuestion = y.ReadingQuestionTrial.IsJudgeQuestion, - Answer = y.Answer, - }).ToList() - }).ToListAsync(); - } + QuestionId = y.ReadingQuestionTrialId, + QuestionName = y.ReadingQuestionTrial.QuestionName.LanguageName(y.ReadingQuestionTrial.QuestionEnName, _userInfo.IsEn_Us), + QuestionEnName = y.ReadingQuestionTrial.QuestionEnName, + AnswerGroup = y.ReadingQuestionTrial.AnswerGroup, + QuestionType = y.ReadingQuestionTrial.QuestionType, + LimitEdit = y.ReadingQuestionTrial.LimitEdit, + MaxAnswerLength = y.ReadingQuestionTrial.MaxAnswerLength, + FileType = y.ReadingQuestionTrial.FileType, + QuestionGenre = y.ReadingQuestionTrial.QuestionGenre, + DictionaryCode = y.ReadingQuestionTrial.DictionaryCode, + GlobalReadingShowType = y.ReadingQuestionTrial.GlobalReadingShowType, + AnswerCombination = y.ReadingQuestionTrial.AnswerCombination, + JudgeType = y.ReadingQuestionTrial.JudgeType, + ShowOrder = y.ReadingQuestionTrial.ShowOrder, + Type = y.ReadingQuestionTrial.Type, + TypeValue = y.ReadingQuestionTrial.TypeValue, + ValueType = y.ReadingQuestionTrial.ValueType, + IsJudgeQuestion = y.ReadingQuestionTrial.IsJudgeQuestion, + Answer = y.Answer, + }).ToList() + }).ToListAsync(); + } // 找到对应的访视 List oncologyVisits = await _visitTaskRepository.Where(x => visitTaskIdList.Contains(x.Id)) @@ -217,9 +213,9 @@ namespace IRaCIS.Application.Services { VisitName = x.SourceSubjectVisit.VisitName, IsBaseLine = x.SourceSubjectVisit.IsBaseLine, - VisitNum=x.SourceSubjectVisit.VisitNum, + VisitNum = x.SourceSubjectVisit.VisitNum, - VisitTaskId = x.Id, + VisitTaskId = x.Id, // QuestionList = x.ReadingTaskQuestionAnswerList.Where(y => y.ReadingQuestionTrial.IsJudgeQuestion).OrderBy(y => y.ReadingQuestionTrial.ShowOrder) //.Select(y => new OncologyQuestion() //{ @@ -229,7 +225,7 @@ namespace IRaCIS.Application.Services //}).ToList() }).ToListAsync(); - var oncologyReadingQuestions = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == inDto.VisitTaskId).Include(x=>x.VisitTask).ToListAsync(); + var oncologyReadingQuestions = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == inDto.VisitTaskId).Include(x => x.VisitTask).ToListAsync(); // 上一次肿瘤学阅片 var lastOncologyTask = await _visitTaskRepository.Where(x => @@ -241,56 +237,56 @@ namespace IRaCIS.Application.Services && x.VisitTaskNum < taskInfo.VisitTaskNum ).OrderByDescending(x => x.VisitTaskNum).FirstOrDefaultAsync(); - List lastOncologyAnswerList= new List(); + List lastOncologyAnswerList = new List(); - if (lastOncologyTask != null&& taskInfo.TaskState==TaskState.Effect&&taskInfo.ReadingTaskState!=ReadingTaskState.HaveSigned) + if (lastOncologyTask != null && taskInfo.TaskState == TaskState.Effect && taskInfo.ReadingTaskState != ReadingTaskState.HaveSigned) { - lastOncologyAnswerList= await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == lastOncologyTask.Id).Include(x => x.VisitTask).ToListAsync(); + lastOncologyAnswerList = await _readingOncologyTaskInfoRepository.Where(x => x.OncologyTaskId == lastOncologyTask.Id).Include(x => x.VisitTask).ToListAsync(); - } + } - oncologyVisits.ForEach(x => + oncologyVisits.ForEach(x => { var oncologyData = oncologyReadingQuestions.Where(y => y.VisitTaskId == x.VisitTaskId).FirstOrDefault(); /// 根据任务编号匹配 不区分 r1 r2 var lastOncologyData = lastOncologyAnswerList.Where(y => y.VisitTask.VisitTaskNum == x.VisitNum).FirstOrDefault(); var evaluationResult = string.Empty; - var evaluationReason = string.Empty; - if (oncologyData != null && !oncologyData.EvaluationResult.IsNullOrEmpty()) + var evaluationReason = string.Empty; + if (oncologyData != null && !oncologyData.EvaluationResult.IsNullOrEmpty()) { evaluationResult = oncologyData.EvaluationResult; } else if (lastOncologyData != null && !lastOncologyData.EvaluationResult.IsNullOrEmpty()) { - evaluationResult = lastOncologyData.EvaluationResult; - } + evaluationResult = lastOncologyData.EvaluationResult; + } - if (oncologyData != null && !oncologyData.EvaluationReason.IsNullOrEmpty()) - { - evaluationReason = oncologyData.EvaluationReason; - } - else if (lastOncologyData != null && !lastOncologyData.EvaluationReason.IsNullOrEmpty()) - { - evaluationReason = lastOncologyData.EvaluationReason; - } + if (oncologyData != null && !oncologyData.EvaluationReason.IsNullOrEmpty()) + { + evaluationReason = oncologyData.EvaluationReason; + } + else if (lastOncologyData != null && !lastOncologyData.EvaluationReason.IsNullOrEmpty()) + { + evaluationReason = lastOncologyData.EvaluationReason; + } - x.EvaluationResult = evaluationResult; - x.EvaluationReason = evaluationReason; + x.EvaluationResult = evaluationResult; + x.EvaluationReason = evaluationReason; - x.QuestionList = globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(x => x.GlobalAnswerType == GlobalAnswerType.Question) + x.QuestionList = globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(x => x.GlobalAnswerType == GlobalAnswerType.Question) .Select(y => new OncologyQuestion { QuestionId = y.QuestionId ?? default(Guid), QuestionName = y.QuestionName, - QuestionGenre=y.QuestionGenre, - DictionaryCode=y.DictionaryCode, + QuestionGenre = y.QuestionGenre, + DictionaryCode = y.DictionaryCode, Answer = y.Answer }).ToList(); - x.IsHaveChange = result.ReadingCategory == ReadingCategory.Visit?false: globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Any(y => y.IsHaveChange); + x.IsHaveChange = result.ReadingCategory == ReadingCategory.Visit ? false : globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Any(y => y.IsHaveChange); x.VisitRemark = result.ReadingCategory == ReadingCategory.Visit ? string.Empty : globalVisits.Where(y => x.VisitTaskId == y.VisitTaskId).SelectMany(y => y.AfterQuestionList).Where(y => y.GlobalAnswerType == GlobalAnswerType.Reason).Select(x => x.Answer).FirstOrDefault() ?? string.Empty; }); @@ -343,7 +339,7 @@ namespace IRaCIS.Application.Services await _readingOncologyTaskInfoRepository.AddRangeAsync(readingOncologies); - var relatedVisitTaskIdList=new List(); + var relatedVisitTaskIdList = new List(); relatedVisitTaskIdList.Add(inDto.RelatedTaskId); var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList); @@ -352,7 +348,7 @@ namespace IRaCIS.Application.Services await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask() { RelatedVisitTaskIds = relatedVisitTaskIds - }) ; + }); var result = await _readingOncologyTaskInfoRepository.SaveChangesAsync(); @@ -377,7 +373,7 @@ namespace IRaCIS.Application.Services var readModuleInfo = await _readModuleRepository.Where(x => x.Id == oncologModuleId && x.ModuleType == ModuleTypeEnum.Oncology).FirstOrDefaultAsync(); - + // 如果当前是肿瘤学 @@ -386,21 +382,21 @@ namespace IRaCIS.Application.Services // 先找到对应的全局阅片模块Id var isGlobalReading = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModuleInfo.TrialReadingCriterionId).Select(x => x.IsGlobalReading).FirstOrDefaultAsync(); - var globalOrVisitTaskId = default(Guid); + var globalOrVisitTaskId = default(Guid); var globalreadModule = await _readModuleRepository.Where(x => x.SubjectVisitId == readModuleInfo.SubjectVisitId && - x.TrialReadingCriterionId== readModuleInfo.TrialReadingCriterionId&& - x.ModuleType == ModuleTypeEnum.Global).Include(x=>x.SubjectVisit).FirstOrDefaultAsync(); - // 获取系统配置 - var readingType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModuleInfo.TrialReadingCriterionId).Select(x => x.ReadingType).FirstOrDefaultAsync(); - if (globalreadModule != null&& isGlobalReading) + x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId && + x.ModuleType == ModuleTypeEnum.Global).Include(x => x.SubjectVisit).FirstOrDefaultAsync(); + // 获取系统配置 + var readingType = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModuleInfo.TrialReadingCriterionId).Select(x => x.ReadingType).FirstOrDefaultAsync(); + if (globalreadModule != null && isGlobalReading) { // 找到一个全局阅片任务是否有裁判任务 globalOrVisitTaskId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModule.Id && x.TaskState == TaskState.Effect - && x.ReadingCategory == ReadingCategory.Global - && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.Id).FirstOrDefaultAsync(); + && x.ReadingCategory == ReadingCategory.Global + && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.Id).FirstOrDefaultAsync(); - var judgeVisitTaskId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModule.Id && x.TaskState == TaskState.Effect + var judgeVisitTaskId = await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModule.Id && x.TaskState == TaskState.Effect && x.ReadingCategory == ReadingCategory.Global && x.ReadingTaskState == ReadingTaskState.HaveSigned).Select(x => x.JudgeVisitTaskId).FirstOrDefaultAsync(); @@ -414,7 +410,7 @@ namespace IRaCIS.Application.Services } } - + // 判断阅片是否完成 if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SouceReadModuleId == globalreadModule.Id && x.TaskState == TaskState.Effect && x.ReadingCategory == ReadingCategory.Global @@ -430,42 +426,43 @@ namespace IRaCIS.Application.Services } } - else { + else + { var visitTask = await _visitTaskRepository.Where(x => x.SourceSubjectVisitId == readModuleInfo.SubjectVisitId && x.TaskState == TaskState.Effect - && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId - && x.ReadingCategory==ReadingCategory.Visit - && x.ReadingTaskState == ReadingTaskState.HaveSigned).FirstNotNullAsync(); + && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId + && x.ReadingCategory == ReadingCategory.Visit + && x.ReadingTaskState == ReadingTaskState.HaveSigned).FirstNotNullAsync(); globalOrVisitTaskId = visitTask.Id; var judgeVisitTaskId = visitTask.JudgeVisitTaskId; - // 要判断是否为老裁判任务的Id - if (judgeVisitTaskId != null) - { - // 如果不存在有效的裁判 - if (!(await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId && x.TaskState == TaskState.Effect))) - { - judgeVisitTaskId = null; - } - } + // 要判断是否为老裁判任务的Id + if (judgeVisitTaskId != null) + { + // 如果不存在有效的裁判 + if (!(await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId && x.TaskState == TaskState.Effect))) + { + judgeVisitTaskId = null; + } + } - // 判断阅片是否完成 - if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SourceSubjectVisitId == readModuleInfo.SubjectVisitId && x.TaskState == TaskState.Effect - && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId - ).CountAsync() == (int)readingType)) - { + // 判断阅片是否完成 + if (judgeVisitTaskId == null && (await _visitTaskRepository.Where(x => x.SourceSubjectVisitId == readModuleInfo.SubjectVisitId && x.TaskState == TaskState.Effect + && x.ReadingTaskState == ReadingTaskState.HaveSigned && !x.IsAnalysisCreate && x.TrialReadingCriterionId == readModuleInfo.TrialReadingCriterionId + ).CountAsync() == (int)readingType)) + { - finishReading = true; - } - else if (judgeVisitTaskId != null && (await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId.Value && x.JudgeResultTaskId != null && x.ReadingTaskState == ReadingTaskState.HaveSigned))) - { - finishReading = true; - } + finishReading = true; + } + else if (judgeVisitTaskId != null && (await _visitTaskRepository.AnyAsync(x => x.Id == judgeVisitTaskId.Value && x.JudgeResultTaskId != null && x.ReadingTaskState == ReadingTaskState.HaveSigned))) + { + finishReading = true; + } + + } - } - if (finishReading) { @@ -475,7 +472,7 @@ namespace IRaCIS.Application.Services SubjectId = readModuleInfo.SubjectId, ReadingId = readModuleInfo.Id, TrialId = readModuleInfo.TrialId, - TrialReadingCriterionId= readModuleInfo.TrialReadingCriterionId, + TrialReadingCriterionId = readModuleInfo.TrialReadingCriterionId, }); @@ -495,7 +492,7 @@ namespace IRaCIS.Application.Services ReadingCategory = ReadingCategory.Oncology, }); - var originalVisit = await _visitTaskRepository.Where(x =>x.Id==globalOrVisitTaskId + var originalVisit = await _visitTaskRepository.Where(x => x.Id == globalOrVisitTaskId ).OrderByDescending(x => x.VisitTaskNum).ThenBy(x => x.ArmEnum).FirstNotNullAsync(); var originalVisitId = default(Guid); @@ -509,12 +506,12 @@ namespace IRaCIS.Application.Services { originalVisitId = originalVisit.Id; - } + } await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand() { - OriginalVisitId= originalVisitId, + OriginalVisitId = originalVisitId, ReadingCategory = GenerateTaskCategory.Oncology, TrialId = readModuleInfo.TrialId, ReadingGenerataTaskList = needReadList diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs index 1af3c7979..756612de3 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingTaskQuestionService.cs @@ -1,11 +1,11 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using IRaCIS.Core.Application.Contracts; +using Microsoft.AspNetCore.Mvc; using Panda.DynamicWebApi.Attributes; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// @@ -63,7 +63,7 @@ namespace IRaCIS.Application.Services var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); - var result=await GetReadingTableQuestion(new GetReadingTableQuestionOrAnswerInDto() + var result = await GetReadingTableQuestion(new GetReadingTableQuestionOrAnswerInDto() { TrialReadingCriterionId = inDto.ReadingQuestionCriterionTrialId, @@ -114,7 +114,7 @@ namespace IRaCIS.Application.Services LesionType = data.LesionType, QuestionGenre = data.QuestionGenre, DictionaryCode = data.DictionaryCode, - GroupId=data.GroupId, + GroupId = data.GroupId, ShowOrder = data.ShowOrder, RelevanceId = data.RelevanceId, IsShowInDicom = data.IsShowInDicom, @@ -232,15 +232,16 @@ namespace IRaCIS.Application.Services var questionIds = qusetionList.Select(x => x.Id).ToList(); var tableQuestionList = await _readingTableQuestionSystemRepository.Where(x => questionIds.Contains(x.ReadingQuestionId)) - .ProjectTo(_mapper.ConfigurationProvider,new { - isEn_Us=_userInfo.IsEn_Us, + .ProjectTo(_mapper.ConfigurationProvider, new + { + isEn_Us = _userInfo.IsEn_Us, }).OrderBy(x => x.ShowOrder).ToListAsync(); var groupList = new List(); //qusetionList = qusetionList.Where(x => x.ParentId == null).ToList(); - groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group ).ToList(); + groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); groupList.ForEach(x => { this.FindSystemChildQuestion(x, qusetionList, tableQuestionList); @@ -270,7 +271,7 @@ namespace IRaCIS.Application.Services Childrens = new List(), ShowOrder = x.ShowOrder, GroupName = string.Empty, - + Id = x.Id, Type = x.Type, DictionaryCode = x.DictionaryCode, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs index 6c5ec1635..91382f726 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadModuleService.cs @@ -1,18 +1,13 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Infra.EFCore.Common; -using System.Linq.Dynamic.Core; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Domain.Models; -using Microsoft.Identity.Client; -using NPOI.SS.Formula.Functions; +using MassTransit; +using Microsoft.AspNetCore.Mvc; +using System.Linq.Dynamic.Core; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 生成的阅片模块(在大列表上展示的) 阅片期 @@ -572,7 +567,7 @@ namespace IRaCIS.Application.Services }); - var readMouduleQuery = _readModuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId==inQuery.TrialReadingCriterionId) + var readMouduleQuery = _readModuleRepository.Where(t => t.TrialId == inQuery.TrialId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId) .Select(rm => new ReadModuleView() { Id = rm.Id, diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs index fdd2ebc2f..a0d6d8a9a 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingPeriod/ReadingPeriodSetService.cs @@ -1,13 +1,12 @@ -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Service.Reading.Dto; -using MassTransit; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Filter; +using MassTransit; +using Microsoft.AspNetCore.Mvc; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// 阅片期配置 @@ -27,7 +26,7 @@ namespace IRaCIS.Application.Services IRepository _subjectRepository) : BaseService { - + diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs index 51422bb21..bd3ca637e 100644 --- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/ShortcutKeyService.cs @@ -4,10 +4,8 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { /// @@ -18,7 +16,7 @@ namespace IRaCIS.Core.Application.Service IRepository _dictionaryRepository, IRepository _shortcutKeyRepository) : BaseService { - + /// diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs index cdabedfd7..06c46e64a 100644 --- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs @@ -4,58 +4,56 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { - /// - /// 用户WL模板 - /// - [ApiExplorerSettings(GroupName = "Reading")] + /// + /// 用户WL模板 + /// + [ApiExplorerSettings(GroupName = "Reading")] public class UserWLTemplateService( - IRepository _userWLTemplateRepository, - IRepository _userRepository) : BaseService + IRepository _userWLTemplateRepository, + IRepository _userRepository) : BaseService { - - /// - /// 获取模板 - /// - /// - /// - public async Task> GetUserWLTemplateList(UserWLTemplateQuery inQuery) - { - var userWLTemplateQueryable = _userWLTemplateRepository - .Where(x=>x.UserId==_userInfo.Id) - .ProjectTo(_mapper.ConfigurationProvider); - return await userWLTemplateQueryable.ToListAsync(); - } - /// - /// 新增修改模板 - /// - /// - /// - public async Task AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate) - { - addOrEditUserWLTemplate.UserId = _userInfo.Id; - if (addOrEditUserWLTemplate.Id == null) - { - var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.Id).CountAsync(); - if (count >= 10) - { + /// + /// 获取模板 + /// + /// + /// + public async Task> GetUserWLTemplateList(UserWLTemplateQuery inQuery) + { + var userWLTemplateQueryable = _userWLTemplateRepository + .Where(x => x.UserId == _userInfo.Id) + .ProjectTo(_mapper.ConfigurationProvider); + return await userWLTemplateQueryable.ToListAsync(); + } + + /// + /// 新增修改模板 + /// + /// + /// + public async Task AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate) + { + addOrEditUserWLTemplate.UserId = _userInfo.Id; + if (addOrEditUserWLTemplate.Id == null) + { + var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.Id).CountAsync(); + if (count >= 10) + { throw new BusinessValidationFailedException(_localizer["UserWLTS_MaxTemplate"]); } } - if(await _userWLTemplateRepository.AnyAsync(x=> x.UserId == _userInfo.Id&&x.TemplateName== addOrEditUserWLTemplate.TemplateName&&x.Id!= addOrEditUserWLTemplate.Id)) - { + if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.Id && x.TemplateName == addOrEditUserWLTemplate.TemplateName && x.Id != addOrEditUserWLTemplate.Id)) + { throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]); } @@ -65,53 +63,53 @@ namespace IRaCIS.Core.Application.Service } var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); - return ResponseOutput.Ok(entity.Id.ToString()); - } + return ResponseOutput.Ok(entity.Id.ToString()); + } - /// - /// 删除模板 - /// - /// - /// - [HttpDelete("{userWLTemplateId:guid}")] - public async Task DeleteUserWLTemplate(Guid userWLTemplateId) - { - var success = await _userWLTemplateRepository.DeleteFromQueryAsync(t => t.Id == userWLTemplateId, true); - return ResponseOutput.Ok(); - } + /// + /// 删除模板 + /// + /// + /// + [HttpDelete("{userWLTemplateId:guid}")] + public async Task DeleteUserWLTemplate(Guid userWLTemplateId) + { + var success = await _userWLTemplateRepository.DeleteFromQueryAsync(t => t.Id == userWLTemplateId, true); + return ResponseOutput.Ok(); + } - /// - /// 获取自动切换任务配置 - /// - /// - [HttpPost] - public async Task GetAutoCutNextTask() - { + /// + /// 获取自动切换任务配置 + /// + /// + [HttpPost] + public async Task GetAutoCutNextTask() + { - return await _userRepository.Where(x=>x.Id==_userInfo.Id).Select(x => new - { - AutoCutNextTask = x.AutoCutNextTask - }).FirstNotNullAsync(); - } + return await _userRepository.Where(x => x.Id == _userInfo.Id).Select(x => new + { + AutoCutNextTask = x.AutoCutNextTask + }).FirstNotNullAsync(); + } - /// - /// 设置自动切换任务 - /// - /// - /// - [HttpPost] - public async Task SetAutoCutNextTask(SetAutoCutNextTaskInDto inDto) - { - await _userRepository.UpdatePartialNowNoQueryAsync(_userInfo.Id, x => new User() - { + /// + /// 设置自动切换任务 + /// + /// + /// + [HttpPost] + public async Task SetAutoCutNextTask(SetAutoCutNextTaskInDto inDto) + { + await _userRepository.UpdatePartialNowNoQueryAsync(_userInfo.Id, x => new User() + { - AutoCutNextTask = inDto.AutoCutNextTask - }); + AutoCutNextTask = inDto.AutoCutNextTask + }); - await _userRepository.SaveChangesAsync (); + await _userRepository.SaveChangesAsync(); - return ResponseOutput.Ok(); - } - } + return ResponseOutput.Ok(); + } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 8987cd594..77d7ac97a 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -1,9 +1,7 @@ using AutoMapper; using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Infra.EFCore.Common; namespace IRaCIS.Core.Application.Service @@ -87,7 +85,7 @@ namespace IRaCIS.Core.Application.Service .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(d => d.QuestionMark, u => u.MapFrom(s => s.ReadingTableQuestionTrial == null ? null : s.ReadingTableQuestionTrial.QuestionMark)); CreateMap(); @@ -164,7 +162,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.OriginalId, u => u.MapFrom(s => s.Id)); - + //.ForMember(dest => dest.Instance, opt => opt.Ignore()) //.ForMember(dest => dest.ReadingQuestionTrial, opt => opt.Ignore()); @@ -283,17 +281,17 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(d => d.QuestionCount, u => u.MapFrom(s => s.ReadingQuestionSystemList.Count())); //.ForMember(d => d.IsEnable, u => u.MapFrom(s => s.Dictionary.IsEnable)) //.ForMember(d => d.ShowOrder, u => u.MapFrom(s => s.Dictionary.ShowOrder)); CreateMap(); - + CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName)) .ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionSystem == null ? string.Empty : s.ParentReadingQuestionSystem.QuestionName)) .ForMember(d => d.ParentQuestionShowOrder, u => u.MapFrom(s => s.ParentReadingQuestionSystem.ShowOrder)) @@ -307,14 +305,14 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(d => d.QuestionCount, u => u.MapFrom(s => s.ReadingQuestionTrialList.Count())); CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(d => d.GroupName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupName : s.GroupInfo.GroupName)) .ForMember(d => d.GroupEnName, u => u.MapFrom(s => s.GroupInfo == null ? s.GroupEnName : s.GroupInfo.GroupEnName)) .ForMember(d => d.ParentQuestionName, u => u.MapFrom(s => s.ParentReadingQuestionTrial == null ? string.Empty : s.ParentReadingQuestionTrial.QuestionName)) @@ -328,7 +326,7 @@ namespace IRaCIS.Core.Application.Service #region IR阅片 CreateMap() - + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)) .ForMember(x => x.Id, y => y.MapFrom(z => z.Id)); @@ -341,7 +339,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(x => x.ParentShowOrder, y => y.MapFrom(n => n.ParentQuestion.ShowOrder)); @@ -351,7 +349,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()); CreateMap() - + .ForMember(x => x.ParentShowOrder, y => y.MapFrom(n => n.ParentQuestion.ShowOrder)); CreateMap(); diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs index bd60587f5..a5afc62b0 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Dto/CriterionCalculateDto.cs @@ -1,9 +1,4 @@ using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.ViewModel { @@ -14,34 +9,34 @@ namespace IRaCIS.Core.Application.ViewModel public class CalculateTargetLesionStatusInDto { - public Guid VisitTaskId { get; set;} + public Guid VisitTaskId { get; set; } public Guid QuestionId { get; set; } - public decimal RowNumber { get; set; } + public decimal RowNumber { get; set; } - } + } - public class GetSplitPPdOutDto - { - public Guid RowId { get; set; } + public class GetSplitPPdOutDto + { + public Guid RowId { get; set; } public string RowIndex { get; set; } - public decimal AllPPD { get; set; } + public decimal AllPPD { get; set; } - public decimal AllLDi { get; set; } + public decimal AllLDi { get; set; } - public decimal AllSDi { get; set; } - } + public decimal AllSDi { get; set; } + } - public class GetSplitPPdInDto + public class GetSplitPPdInDto { - public Guid VisitTaskId { get; set; } - } + public Guid VisitTaskId { get; set; } + } - public class ReadingTaskQuestionAnswerDto : ReadingTaskQuestionAnswer + public class ReadingTaskQuestionAnswerDto : ReadingTaskQuestionAnswer { public QuestionType QuestionType { get; set; } } @@ -59,7 +54,7 @@ namespace IRaCIS.Core.Application.ViewModel /// /// 靶病灶是否为IUPD或者ICPD /// - public bool NewTargetLesionAssessmentIsIUorIC { get; set; } + public bool NewTargetLesionAssessmentIsIUorIC { get; set; } } @@ -71,7 +66,7 @@ namespace IRaCIS.Core.Application.ViewModel public string Answer { get; set; } = string.Empty; - + } public class VisitStudyTime @@ -103,7 +98,7 @@ namespace IRaCIS.Core.Application.ViewModel /// public DateTime? StudyTime { get; set; } - + } public class AddTaskLesionAnswerFromLastTaskOutDto @@ -264,7 +259,7 @@ namespace IRaCIS.Core.Application.ViewModel /// /// 当有“存在”或“太小”状态的非淋巴结新靶病灶 /// - public bool ExixtsOrLessNoLymphTarget{ get; set; } + public bool ExixtsOrLessNoLymphTarget { get; set; } } /// @@ -303,7 +298,7 @@ namespace IRaCIS.Core.Application.ViewModel ///// //public class NewLesionAfterTriggeringiRECSITAssessmentDto //{ - + //} public class IRECISTNewNoTargetLesionDto diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs index fc8163325..4af1b8d73 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/GeneralCalculateService.cs @@ -3,11 +3,7 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; using MassTransit; using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -57,11 +53,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task LogRecord(ReadingCalculateDto inDto,string lesionName, LesionType lesionType) + public async Task LogRecord(ReadingCalculateDto inDto, string lesionName, LesionType lesionType) { // 这里是记录日志 不需要国际化 - var criterionInfo =await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync(); - var taskInfo= await _visitTaskRepository.Where(x=>x.Id==inDto.VisitTaskId).Include(x=>x.Subject).Include(x=>x.DoctorUser).FirstNotNullAsync(); + var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync(); + var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync(); //错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据: @@ -85,7 +81,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate lesionInfo.TableRowInfoList.OrderBy(x => x.RowIndex).ForEach(x => { builder.AppendLine(@$"【病灶编号】:【{x.RowIndex.ToString()}】, - 【病灶长径】:【{x.TableQuestionList.Where(y=>y.QuestionMark==QuestionMark.MajorAxis).Select(y=>y.Answer).FirstIsNullReturnEmpty()}】, + 【病灶长径】:【{x.TableQuestionList.Where(y => y.QuestionMark == QuestionMark.MajorAxis).Select(y => y.Answer).FirstIsNullReturnEmpty()}】, 【病灶短径】:【{x.TableQuestionList.Where(y => y.QuestionMark == QuestionMark.ShortAxis).Select(y => y.Answer).FirstIsNullReturnEmpty()}】, 【病灶状态】:【{x.TableQuestionList.Where(y => y.QuestionMark == QuestionMark.State).Select(y => y.Answer).FirstIsNullReturnEmpty()}】"); @@ -122,7 +118,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate LesionType = x.LesionType, QuestionId = x.Id, QuesionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), - OrderMark=x.OrderMark, + OrderMark = x.OrderMark, QuestionType = x.QuestionType, ValueType = x.ValueType, }).ToListAsync(); @@ -136,7 +132,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestion = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == visitTaskId).Include(x => x.ReadingTableQuestionTrial).Select(x => new TableQuestionInfo() { Answer = x.Answer, - AnswerId=x.Id, + AnswerId = x.Id, QuestionMark = x.ReadingTableQuestionTrial.QuestionMark, TableQuestionId = x.TableQuestionId, QuestionId = x.QuestionId, @@ -159,7 +155,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate RowIndex = x.RowIndex, MeasureData = x.MeasureData, OtherMeasureData = x.OtherMeasureData, - FristAddTaskNum =x.FristAddTaskNum, + FristAddTaskNum = x.FristAddTaskNum, TableQuestionList = tableQuestion.Where(y => y.QuestionId == item.QuestionId && y.RowId == x.Id).ToList(), }).ToList(); @@ -169,20 +165,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - ReadingCalculateDto readingData = new ReadingCalculateDto() - { - SubjectId = visitTask.SubjectId, - TaskBlindName = visitTask.TaskBlindName, - IsConvertedTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => x.IsConvertedTask).FirstOrDefaultAsync(), - BeforeConvertedTaskId = visitTask.BeforeConvertedTaskId, - VisitTaskId = visitTaskId, - SubjectVisitId = visitTask.SourceSubjectVisitId!.Value, - QuestionInfo = questionInfos, - CriterionId = visitTask.TrialReadingCriterionId, - TrialId = visitTask.TrialId, - IsAnalysisCreate = visitTask.IsAnalysisCreate, - IsSelfAnalysis = visitTask.IsSelfAnalysis, - IsBaseLine = subjectVisit!.IsBaseLine, + ReadingCalculateDto readingData = new ReadingCalculateDto() + { + SubjectId = visitTask.SubjectId, + TaskBlindName = visitTask.TaskBlindName, + IsConvertedTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Select(x => x.IsConvertedTask).FirstOrDefaultAsync(), + BeforeConvertedTaskId = visitTask.BeforeConvertedTaskId, + VisitTaskId = visitTaskId, + SubjectVisitId = visitTask.SourceSubjectVisitId!.Value, + QuestionInfo = questionInfos, + CriterionId = visitTask.TrialReadingCriterionId, + TrialId = visitTask.TrialId, + IsAnalysisCreate = visitTask.IsAnalysisCreate, + IsSelfAnalysis = visitTask.IsSelfAnalysis, + IsBaseLine = subjectVisit!.IsBaseLine, DoctorUserId = visitTask.DoctorUserId, TrialReadingCriterionId = visitTask.TrialReadingCriterionId, BaseLineTaskId = baseLinetaskId, @@ -190,7 +186,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate VisitName = subjectVisit.VisitName, BlindName = subjectVisit.BlindName, VisitTaskNum = visitTask.VisitTaskNum, - DigitPlaces= criterionInfo.DigitPlaces??2, + DigitPlaces = criterionInfo.DigitPlaces ?? 2, }; return readingData; @@ -207,9 +203,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var originalTask = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); - var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == beforeConvertedTaskId &&x.ReadingQuestionTrial.QuestionType!=QuestionType.AdjustReason && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync(); + var taskAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == beforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType != QuestionType.AdjustReason && x.ReadingQuestionTrial.Type != "calculation").IgnoreAutoIncludes().AsNoTracking().ToListAsync(); - taskAnswer.ForEach(x => { + taskAnswer.ForEach(x => + { x.VisitTaskId = visitTaskId; @@ -223,7 +220,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { x.VisitTaskId = visitTaskId; x.IsCurrentTaskAdd = false; - x.FristAddTaskId = x.FristAddTaskId== beforeConvertedTaskId? visitTaskId : x.FristAddTaskId; + x.FristAddTaskId = x.FristAddTaskId == beforeConvertedTaskId ? visitTaskId : x.FristAddTaskId; x.Id = NewId.NextGuid(); }); @@ -295,7 +292,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate addrowInfo.ForEach(x => { - + if (needRowIds.Contains(x.Id)) { index++; @@ -303,11 +300,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.RowMark = otherLesionQuestion.OrderMark + x.RowIndex.GetLesionMark(); var fristAddTaskId = x.FristAddTaskId.Clone(); x.FromMark = fristAddTaskId == beforeConvertedTaskId ? string.Empty : x.RowMark; - x.FristAddTaskId = fristAddTaskId == beforeConvertedTaskId? visitTaskId: fristAddTaskId; + x.FristAddTaskId = fristAddTaskId == beforeConvertedTaskId ? visitTaskId : fristAddTaskId; x.QuestionId = otherLesionQuestion.Id; x.OrderMark = otherLesionQuestion.OrderMark; x.ReportMark = x.RowMark; - + } @@ -347,7 +344,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswer); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); } - + /// /// 获取阅片报告任务List /// @@ -355,47 +352,47 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task> GetReadingReportTaskList(Guid visitTaskId) { - var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x=>x.TrialReadingCriterion).FirstNotNullAsync(); + var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).Include(x => x.TrialReadingCriterion).FirstNotNullAsync(); var isAdditionalQuestionId = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == visitTaskInfo.TrialReadingCriterionId && x.IsAdditional).IgnoreQueryFilters().Select(x => x.Id).ToListAsync(); var taskquery = _visitTaskRepository - .Where(x => (x.SubjectId == visitTaskInfo.SubjectId - && (x.TaskState == TaskState.Effect||x.TaskState==TaskState.Freeze) + .Where(x => (x.SubjectId == visitTaskInfo.SubjectId + && (x.TaskState == TaskState.Effect || x.TaskState == TaskState.Freeze) && x.IsAnalysisCreate == visitTaskInfo.IsAnalysisCreate && x.DoctorUserId == visitTaskInfo.DoctorUserId && x.IsSelfAnalysis == visitTaskInfo.IsSelfAnalysis && x.VisitTaskNum <= visitTaskInfo.VisitTaskNum && x.ArmEnum == visitTaskInfo.ArmEnum && x.TrialReadingCriterionId == visitTaskInfo.TrialReadingCriterionId - && x.ReadingCategory == ReadingCategory.Visit && x.ReadingTaskState == ReadingTaskState.HaveSigned) ||x.Id == visitTaskId + && x.ReadingCategory == ReadingCategory.Visit && x.ReadingTaskState == ReadingTaskState.HaveSigned) || x.Id == visitTaskId ); - if(visitTaskInfo.ReadingTaskState==ReadingTaskState.HaveSigned) + if (visitTaskInfo.ReadingTaskState == ReadingTaskState.HaveSigned) { - taskquery = _visitTaskRepository.Where(x => visitTaskInfo.ReportRelatedTaskIdList.Contains(x.Id)||x.Id==visitTaskInfo.Id); + taskquery = _visitTaskRepository.Where(x => visitTaskInfo.ReportRelatedTaskIdList.Contains(x.Id) || x.Id == visitTaskInfo.Id); } if (visitTaskInfo.TrialReadingCriterion.IsReadingTaskViewInOrder != ReadingOrder.InOrder) { - taskquery = _visitTaskRepository.Where(x => x.Id == visitTaskInfo.Id); + taskquery = _visitTaskRepository.Where(x => x.Id == visitTaskInfo.Id); } - + var taskInfoList = await taskquery.OrderBy(x => x.VisitTaskNum).Select(x => new VisitTaskInfo() { BlindName = x.TaskBlindName, IsBaseLine = x.SourceSubjectVisit.IsBaseLine, VisitTaskId = x.Id, - TaskState= x.TaskState, + TaskState = x.TaskState, TaskName = x.TaskName, - LatestScanDate= x.SourceSubjectVisit!=null?x.SourceSubjectVisit.LatestScanDate : null, + LatestScanDate = x.SourceSubjectVisit != null ? x.SourceSubjectVisit.LatestScanDate : null, VisitTaskNum = x.VisitTaskNum, - IsConvertedTask=x.IsConvertedTask, - BeforeConvertedTaskId=x.BeforeConvertedTaskId, + IsConvertedTask = x.IsConvertedTask, + BeforeConvertedTaskId = x.BeforeConvertedTaskId, //CrterionDictionaryGroup = x.CrterionDictionaryGroup, IsCurrentTask = x.Id == visitTaskId, - - }).OrderBy(x=>x.VisitTaskNum).ThenByDescending(x=>x.TaskState).ToListAsync(); + + }).OrderBy(x => x.VisitTaskNum).ThenByDescending(x => x.TaskState).ToListAsync(); taskInfoList.ForEach(x => @@ -407,7 +404,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var isHaveAdditionalTaskIds = await _readingTaskQuestionAnswerRepository.Where(x => taskIds.Contains(x.VisitTaskId) && isAdditionalQuestionId.Contains(x.ReadingQuestionTrialId)).Select(x => x.VisitTaskId).Distinct().ToListAsync(); - taskInfoList.ForEach(x => { + taskInfoList.ForEach(x => + { x.IsHaveAdditionalQuestion = isHaveAdditionalTaskIds.Contains(x.VisitTaskId); }); return taskInfoList; diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs index fbcc768da..03a0b8631 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/General/ReadingCalculateService.cs @@ -1,10 +1,9 @@ -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Application.ViewModel; - namespace IRaCIS.Core.Application.Service.ReadingCalculate { [ApiExplorerSettings(GroupName = "Image")] @@ -121,59 +120,59 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - /// - /// 获取阅片的计算数据 - /// - /// - /// - [HttpPost] - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - var service = await this.GetService(inDto.VisitTaskId); + /// + /// 获取阅片的计算数据 + /// + /// + /// + [HttpPost] + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + var service = await this.GetService(inDto.VisitTaskId); - return await service.GetReadingCalculationData(inDto); - } + return await service.GetReadingCalculationData(inDto); + } - /// - /// 将上一次的访视病灶添加到这一次 - /// - /// - /// - public async Task AddTaskLesionAnswerFromLastTask(AddTaskLesionAnswerFromLastTaskInDto inDto) + /// + /// 将上一次的访视病灶添加到这一次 + /// + /// + /// + public async Task AddTaskLesionAnswerFromLastTask(AddTaskLesionAnswerFromLastTaskInDto inDto) { var service = await this.GetService(inDto.VisitTaskId); var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); - var result = new AddTaskLesionAnswerFromLastTaskOutDto(); - var readingTaskState = visitTaskInfo.ReadingTaskState; - if (service != null && visitTaskInfo.SourceSubjectVisitId != null) + var result = new AddTaskLesionAnswerFromLastTaskOutDto(); + var readingTaskState = visitTaskInfo.ReadingTaskState; + if (service != null && visitTaskInfo.SourceSubjectVisitId != null) { if (readingTaskState == ReadingTaskState.WaitReading) { if (visitTaskInfo.ReadingCategory == ReadingCategory.Visit) { - result = await service.AddTaskLesionAnswerFromLastTask(inDto); - await service.CalculateTask(new CalculateTaskInDto() - { - IsChangeOtherTask = false, - VisitTaskId = inDto.VisitTaskId, - ComputationTrigger = ComputationTrigger.InitialCalculation, - }); - } + result = await service.AddTaskLesionAnswerFromLastTask(inDto); + await service.CalculateTask(new CalculateTaskInDto() + { + IsChangeOtherTask = false, + VisitTaskId = inDto.VisitTaskId, + ComputationTrigger = ComputationTrigger.InitialCalculation, + }); + } } } - if (readingTaskState == ReadingTaskState.WaitReading) - { - await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask() - { - ReadingTaskState = ReadingTaskState.Reading, - },true); - } + if (readingTaskState == ReadingTaskState.WaitReading) + { + await _visitTaskRepository.UpdatePartialFromQueryAsync(inDto.VisitTaskId, x => new VisitTask() + { + ReadingTaskState = ReadingTaskState.Reading, + }, true); + } - return result; + return result; - } + } /// /// 获取报告验证的信息(这里每个标准可能不一样 返回用object) @@ -213,7 +212,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 这里统一处理字典 - Dictionary> dictionaryGroup = result.VisitTaskList.ToDictionary(x => x.VisitTaskId, x => x.CrterionDictionaryGroup); + Dictionary> dictionaryGroup = result.VisitTaskList.ToDictionary(x => x.VisitTaskId, x => x.CrterionDictionaryGroup); result.TaskQuestions.ForEach(y => { @@ -245,13 +244,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } }); - item.Childrens.ForEach(x => { + item.Childrens.ForEach(x => + { SetCrterionDictionaryGroup(x, dictionaryGroup); }); } - + /// @@ -274,5 +274,5 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - + } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index c1886e69c..6a570721d 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -1,16 +1,11 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; -using Microsoft.Extensions.Logging; using IRaCIS.Core.Infrastructure; using MassTransit; -using System.Linq; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Logging; using System.Text; namespace IRaCIS.Core.Application.Service.ReadingCalculate @@ -32,22 +27,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository, ILogger _logger) : BaseService, ICriterionCalculateService { - - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } - #region 临时对象 单个请求的生命周期 避免重复查询数据库 + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } - private List visitTaskAnswerList; + #region 临时对象 单个请求的生命周期 避免重复查询数据库 + + private List visitTaskAnswerList; /// /// 获取Sod的值 @@ -98,23 +93,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetReadingReportEvaluation(GetReadingReportEvaluationInDto indto) { GetReadingReportEvaluationOutDto result = new GetReadingReportEvaluationOutDto(); - var isConvertTask = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync(); - var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); - result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto() + var isConvertTask = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync(); + var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); + result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto() { VisitTaskId = indto.VisitTaskId, - IsConvertTask= isConvertTask, - BeforeConvertedTaskId =visitTaskInfo.BeforeConvertedTaskId, - }); + IsConvertTask = isConvertTask, + BeforeConvertedTaskId = visitTaskInfo.BeforeConvertedTaskId, + }); - - - result.ReadingTaskState = visitTaskInfo.ReadingTaskState; + + + result.ReadingTaskState = visitTaskInfo.ReadingTaskState; var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(indto.VisitTaskId); result.VisitTaskList = taskInfoList; @@ -122,12 +117,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList(); var criterionId = visitTaskInfo.TrialReadingCriterionId; - var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId&&x.ShowQuestion!= ShowQuestion.Hide) - .WhereIf(isConvertTask,x=>x.ConvertShowType==ConvertShowType.All||x.ConvertShowType==ConvertShowType.AfterShow) - .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) - .ToListAsync(); + var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide) + .WhereIf(isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.AfterShow) + .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) + .ToListAsync(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); - var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto { @@ -135,7 +130,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Count = x.ToList().Count() }).ToList(); - var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() + var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() { QuestionId = x.Key.QuestionId, Rowindexs = x.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList() @@ -144,14 +139,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); - var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new - { - x.TaskId, - x.GlobalVisitTask.VisitTaskNum, - x.QuestionId, - x.Answer - }).ToListAsync(); - var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new + { + x.TaskId, + x.GlobalVisitTask.VisitTaskNum, + x.QuestionId, + x.Answer + }).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); @@ -168,10 +163,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, + GroupId = x.GroupId, QuestionType = x.QuestionType, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -182,8 +177,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, - ReportLayType= ReportLayType.Group, + CustomUnit = x.CustomUnit, + ReportLayType = ReportLayType.Group, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, }).ToList(); @@ -191,12 +186,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 分组 foreach (var item in questions) { - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -209,7 +204,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -221,17 +216,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { - var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); - var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answer==null?string.Empty:answer.Answer, - IsGlobalChange = globalAnswer == null ? false : true, - GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, - TaskName = task.TaskName, + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = globalAnswer == null ? false : true, + GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, + TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, - + }); } @@ -260,8 +255,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty, ReportLayType = ReportLayType.Lesions, ReportMark = rowinfo != null ? rowinfo.ReportMark : string.Empty, - - }) ; + + }); } @@ -276,7 +271,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Type = x.Type, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, - RowId=row.RowId, + RowId = row.RowId, IsShowInDicom = question.IsShowInDicom, DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, @@ -313,13 +308,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate switch (tableQuestion.QuestionMark) { case QuestionMark.Organ: - taskQuestionAnswer.Answer= organInfo.TULOCEN; + taskQuestionAnswer.Answer = organInfo.TULOCEN; break; case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -330,7 +325,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Part: taskQuestionAnswer.Answer = organInfo.PartEN; - + break; } @@ -346,7 +341,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -407,7 +402,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { await ReadingCalculate(readingData, new List() { type.Value }); } - + } @@ -433,7 +428,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetReportVerify(GetReportVerifyInDto inDto) { var tumorEvaluate = string.Empty; - var readingCalculateDto= await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId); + var readingCalculateDto = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId); if (!inDto.IsConvertTask) { @@ -442,14 +437,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } else if (inDto.BeforeConvertedTaskId != null) { - tumorEvaluate = await GetConvertingTumor(readingCalculateDto); - } + tumorEvaluate = await GetConvertingTumor(readingCalculateDto); + } else { - tumorEvaluate = await GetIRECSITTargetLesionEvaluate(readingCalculateDto); - } + tumorEvaluate = await GetIRECSITTargetLesionEvaluate(readingCalculateDto); + } - return new GetReportVerifyOutDto() + return new GetReportVerifyOutDto() { TumorEvaluate = tumorEvaluate, IsExistDisease = await this.GetReportIsExistDisease(inDto.VisitTaskId), @@ -464,7 +459,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task ReadingCalculate(ReadingCalculateDto inDto,List? calculateType=null) + public async Task ReadingCalculate(ReadingCalculateDto inDto, List? calculateType = null) { #region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果 @@ -563,13 +558,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate //IRECIST整体肿瘤评估 new ReadingCalculateData (){QuestionType=QuestionType.Tumor,GetStringFun=GetIRECSITTargetLesionEvaluate,IsConvertedTask=true}, - + }; // 过滤转化的 - calculateList = calculateList.Where(x => x.IsConvertedTask == inDto.IsConvertedTask||x.IsConvertedTask==null).ToList(); + calculateList = calculateList.Where(x => x.IsConvertedTask == inDto.IsConvertedTask || x.IsConvertedTask == null).ToList(); if (inDto.IsConvertedTask) { @@ -579,16 +574,16 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate List questionTypes = calculateList.Where(x => x.IsBeTransforming).Select(x => x.QuestionType).ToList(); // 排除这几个 且不为正在转化的 - calculateList = calculateList.Where(x => !(questionTypes.Contains(x.QuestionType)&& x.IsBeTransforming == false)).ToList(); + calculateList = calculateList.Where(x => !(questionTypes.Contains(x.QuestionType) && x.IsBeTransforming == false)).ToList(); } else { calculateList = calculateList.Where(x => x.IsBeTransforming == false).ToList(); - } + } - } + } // 没有靶病灶只计算最后几个 if (inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).Sum(x => x.TableRowInfoList.Count()) == 0) @@ -605,17 +600,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate QuestionType.Tumor, QuestionType.ExistDisease, QuestionType.NewTargetLesion, - QuestionType.NewNoTargetLesion, - QuestionType.OtherNewTargetLesion, + QuestionType.NewNoTargetLesion, + QuestionType.OtherNewTargetLesion, QuestionType.IRECISTNewTargetLesion, QuestionType.NewLesionEvaluation, - }; + }; // 没有靶病灶就删除其他几个答案的值 var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList(); - var isNeedDeleteIds = inDto.QuestionInfo.Where(x =>x.QuestionType!=null&& isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList(); + var isNeedDeleteIds = inDto.QuestionInfo.Where(x => x.QuestionType != null && isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList(); await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && isNeedDeleteIds.Contains(x.ReadingQuestionTrialId), x => new ReadingTaskQuestionAnswer { @@ -627,7 +622,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList(); - + } @@ -681,7 +676,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate else { - item.Answer = value==null?"": value.Value.ToString(); + item.Answer = value == null ? "" : value.Value.ToString(); } } else if (calculate.GetStringFun != null) @@ -713,13 +708,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - + needAddList.Add(new ReadingTaskQuestionAnswerDto() { Answer = item.Answer, - QuestionType= calculate.QuestionType, + QuestionType = calculate.QuestionType, ReadingQuestionTrialId = item.QuestionId, }); } @@ -737,7 +732,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - + @@ -752,8 +747,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 新靶病灶为IUPD或者ICPD var newTargetLesionIsIUorIC = needAddList.Any(x => x.QuestionType == QuestionType.NewTargetLesion && (x.Answer.EqEnum(NewTargetLesionAssessment.iUPD) || x.Answer.EqEnum(NewTargetLesionAssessment.iCPD))); - - + + needAddList.ForEach(x => { @@ -838,17 +833,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }).ToListAsync(); - var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId + var unableEvaluateRowIds = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.State ).Where(x => - (x.ReadingQuestionTrial.LesionType==LesionType.TargetLesion && x.Answer == TargetState.UnableEvaluate.GetEnumInt()) - || (x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.Answer == NewLesionState.UnableEvaluate.GetEnumInt()) - || (x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions && x.Answer == NoTargetState.UnableEvaluate.GetEnumInt()) - || (x.ReadingQuestionTrial.LesionType == LesionType.NewTargetLesion && x.Answer == NewTargetLesionState.NotEvaluable.GetEnumInt()) - || (x.ReadingQuestionTrial.LesionType == LesionType.NewNonTargetLesion && x.Answer == NewNoTargetLesionState.NotEvaluable.GetEnumInt()) - || (x.ReadingQuestionTrial.LesionType == LesionType.OtherPreviousNewLesion && x.Answer == OtherPreviousNewLesionState.NotEvaluable.GetEnumInt()) - || (x.ReadingQuestionTrial.LesionType == LesionType.TriggeringIRECSIT && x.Answer == NewLesionAfterTriggeringiRECSITState.NotEvaluable.GetEnumInt()) - ) + (x.ReadingQuestionTrial.LesionType == LesionType.TargetLesion && x.Answer == TargetState.UnableEvaluate.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NewLesions && x.Answer == NewLesionState.UnableEvaluate.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NonTargetLesions && x.Answer == NoTargetState.UnableEvaluate.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NewTargetLesion && x.Answer == NewTargetLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.NewNonTargetLesion && x.Answer == NewNoTargetLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.OtherPreviousNewLesion && x.Answer == OtherPreviousNewLesionState.NotEvaluable.GetEnumInt()) + || (x.ReadingQuestionTrial.LesionType == LesionType.TriggeringIRECSIT && x.Answer == NewLesionAfterTriggeringiRECSITState.NotEvaluable.GetEnumInt()) + ) .Select(x => x.RowId).Distinct().ToListAsync(); @@ -887,7 +882,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - + #region 将上一次的访视病灶添加到这一次 @@ -907,7 +902,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 判断当前任务是否是基线 if (taskinfo.SourceSubjectVisitId != baseLineVisitId) { - + // 判断当前任务是是否有表格问题答案 if (!(await _readingTableQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == visitTaskId))) { @@ -997,7 +992,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); } - + } } @@ -1375,17 +1370,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var lastTaskId = await GetLastVisitTaskId(inDto); // 靶病灶评估为IUPD或者ICPD - var targetLesionIsIUorIC = await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == lastTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion && (x.Answer==TargetAssessment.iUPD.GetEnumInt()|| x.Answer==TargetAssessment.iCPD.GetEnumInt())); + var targetLesionIsIUorIC = await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == lastTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion && (x.Answer == TargetAssessment.iUPD.GetEnumInt() || x.Answer == TargetAssessment.iCPD.GetEnumInt())); if (!targetLesionIsIUorIC) { return string.Empty; } - + var compareTaskSOD = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == compareTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SOD).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0(); var value = await GetSODData(inDto); - if (value == null || inDto.IsBaseLine|| !inDto.IsConvertedTask||inDto.BeforeConvertedTaskId!=null) + if (value == null || inDto.IsBaseLine || !inDto.IsConvertedTask || inDto.BeforeConvertedTaskId != null) { return string.Empty; } @@ -1465,7 +1460,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var lastTaskId = await GetLastVisitTaskId(inDto); // 新靶病灶为IUPD或者ICPD - var newTargetLesionIsIUorIC = await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == lastTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.NewTargetLesion && (x.Answer==NewTargetLesionAssessment.iUPD.GetEnumInt() || x.Answer==NewTargetLesionAssessment.iCPD.GetEnumInt())); + var newTargetLesionIsIUorIC = await _readingTaskQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == lastTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.NewTargetLesion && (x.Answer == NewTargetLesionAssessment.iUPD.GetEnumInt() || x.Answer == NewTargetLesionAssessment.iCPD.GetEnumInt())); if (!newTargetLesionIsIUorIC) { return string.Empty; @@ -1554,7 +1549,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { // 找到所有访视任务的Id - var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate && + var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == inDto.calculateDto.TrialReadingCriterionId && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == inDto.calculateDto.ArmEnum).Select(x => x.Id).ToListAsync(); @@ -1597,7 +1592,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// private async Task GetBaseLineSOD(ReadingCalculateDto inDto) { - if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate==inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum)) + if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum)) { return 0; } @@ -1606,9 +1601,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && - x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect && + x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect && x.IsAnalysisCreate == inDto.IsAnalysisCreate - &&x.DoctorUserId==inDto.DoctorUserId + && x.DoctorUserId == inDto.DoctorUserId && x.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ArmEnum == inDto.ArmEnum) .Select(x => x.Id).FirstOrDefaultAsync(); @@ -1659,7 +1654,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate && x.VisitTask.IsAnalysisCreate == inDto.IsAnalysisCreate && x.VisitTask.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId - && x.VisitTask.VisitTaskNum new VisitTaskAnswerInfo { @@ -1677,7 +1672,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate visitTaskAnswerList.Add(new VisitTaskAnswerInfo() { VisitTaskId = inDto.VisitTaskId, - BlindName=inDto.TaskBlindName, + BlindName = inDto.TaskBlindName, QuestionId = visitTaskAnswerList[0].QuestionId, VisitName = inDto.VisitName, SOD = (await GetSODData(inDto)).ToString().IsNullOrEmptyReturn0(), @@ -1726,7 +1721,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// 获取比较任务Id 需要之前一次访视为IUPD或者ICPD /// /// - private async Task GetCompareTaskId(ReadingCalculateDto inDto,QuestionType questionType) + private async Task GetCompareTaskId(ReadingCalculateDto inDto, QuestionType questionType) { var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).FirstNotNullAsync(); var lastTaskId = await GetLastVisitTaskId(inDto); @@ -1773,13 +1768,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate compareTaskList.ForEach(y => { - y.TargetAssessmentIsIUorIC = answers.Any(x =>x.VisitTaskId==y.VisitTaskId && x.QuestionType == QuestionType.TargetLesion && (x.Answer == TargetAssessment.iUPD.GetEnumInt() || x.Answer == TargetAssessment.iCPD.GetEnumInt())); + y.TargetAssessmentIsIUorIC = answers.Any(x => x.VisitTaskId == y.VisitTaskId && x.QuestionType == QuestionType.TargetLesion && (x.Answer == TargetAssessment.iUPD.GetEnumInt() || x.Answer == TargetAssessment.iCPD.GetEnumInt())); y.NewTargetLesionAssessmentIsIUorIC = answers.Any(x => x.VisitTaskId == y.VisitTaskId && x.QuestionType == QuestionType.NewTargetLesion && (x.Answer == NewTargetLesionAssessment.iUPD.GetEnumInt() || x.Answer == NewTargetLesionAssessment.iCPD.GetEnumInt())); }); } - + Guid? compareTaskId = null; - if(compareTaskList.Count()==0) + if (compareTaskList.Count() == 0) { return compareTaskId; } @@ -1787,7 +1782,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { case QuestionType.TargetLesion: - for (int i = compareTaskList.Count()-1; i>=0; i--) + for (int i = compareTaskList.Count() - 1; i >= 0; i--) { if (i == 0) { @@ -1877,7 +1872,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList(); var lastVisitTaskId = await GetLastVisitTaskId(inDto); var targetLesionQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.TargetLesion).Select(x => x.QuestionId).FirstOrDefault(); - + var sodQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SOD).Select(x => x.QuestionId).FirstOrDefault(); IRECISTTargetLesionDto resultData = new IRECISTTargetLesionDto() { @@ -1926,7 +1921,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { - + resultData.NoTargetLymphLoss = resultData.NoTargetLymphLoss && item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault() == NoTargetState.Loss.GetEnumInt(); } @@ -1974,20 +1969,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = TargetAssessment.iUPD; } // else if (有任一靶病灶为NE状态) - else if(resultData.HaveNeLesion) - { + else if (resultData.HaveNeLesion) + { // 靶病灶疗效为 NE result = TargetAssessment.NE; - } + } // else if (所有非淋巴结靶病灶消失,径线总和为0 mm && 所有淋巴结靶病灶的短径缩小到 < 10 mm && 非靶病灶中淋巴结病灶全部消失) - else if (resultData.AllLesionVanish&&resultData.AllMinorAxisLessThan10&& resultData.NoTargetLymphLoss) + else if (resultData.AllLesionVanish && resultData.AllMinorAxisLessThan10 && resultData.NoTargetLymphLoss) { // 靶病灶疗效为 iCR result = TargetAssessment.iCR; } // else if (与基线期SOD相比减小≥30 %||(所有非淋巴结靶病灶消失,径线总和为0 mm && 所有淋巴结靶病灶的短径缩小到 < 10 mm&&非靶病灶中有淋巴结病灶为非消失)) - else if (resultData.BaseLineLessThan30||(resultData.AllLesionVanish && resultData.AllMinorAxisLessThan10 && !resultData.NoTargetLymphLoss)) - { + else if (resultData.BaseLineLessThan30 || (resultData.AllLesionVanish && resultData.AllMinorAxisLessThan10 && !resultData.NoTargetLymphLoss)) + { // 靶病灶疗效为 iPR result = TargetAssessment.iPR; } @@ -2192,7 +2187,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate .Select(x => x.Answer).FirstOrDefaultAsync()) ?? string.Empty, //与触发iRECIS任务iSod增加大于5mm - ISODAdd5mm = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ComparedTriggeringiSODChange).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5, + ISODAdd5mm = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ComparedTriggeringiSODChange).Sum(x => x.Answer.IsNullOrEmptyReturn0()) >= 5, //有"存在"状态的新靶病灶 HaveExixtsState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)), @@ -2214,20 +2209,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate data.AllVanish = data.AllVanish && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Loss)); - data.ExixtsLymphTarget = data.ExixtsLymphTarget || + data.ExixtsLymphTarget = data.ExixtsLymphTarget || ( item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)) && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes)) ); - data.ExixtsOrLessNoLymphTarget = data.ExixtsOrLessNoLymphTarget || + data.ExixtsOrLessNoLymphTarget = data.ExixtsOrLessNoLymphTarget || ( - + ( - item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)) + item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)) || item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.TooSmall)) ) - + && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes)) ); @@ -2237,26 +2232,26 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate NewTargetLesionAssessment? result = NewTargetLesionAssessment.ND; // if(所有新靶病灶消失或一直不存在任何新靶病灶) - if(data.NotExistsNewTargetLesion||data.AllVanish) - { + if (data.NotExistsNewTargetLesion || data.AllVanish) + { // 疗效为 ND result = NewTargetLesionAssessment.ND; - } + } // else if (上一访视新靶病灶评估为“iUPD” && 与触发iRECIS任务iSod增加大于5mm) - else if (data.LastTaskNewTargetLesion.EqEnum(NewTargetLesionAssessment.iUPD)&&data.ISODAdd5mm) - { + else if (data.LastTaskNewTargetLesion.EqEnum(NewTargetLesionAssessment.iUPD) && data.ISODAdd5mm) + { // 疗效为 iCPD result = NewTargetLesionAssessment.iCPD; } // else if (上一访视新靶病灶评估为“iCPD”&& (当有“存在”状态的淋巴结新靶病灶||当有“存在”或“太小”状态的非淋巴结新靶病灶)) - else if (data.LastTaskNewTargetLesion.EqEnum(NewTargetLesionAssessment.iCPD) &&( data.ExixtsLymphTarget || data.ExixtsOrLessNoLymphTarget)) - { + else if (data.LastTaskNewTargetLesion.EqEnum(NewTargetLesionAssessment.iCPD) && (data.ExixtsLymphTarget || data.ExixtsOrLessNoLymphTarget)) + { // 疗效为 iCPD result = NewTargetLesionAssessment.iCPD; } // else if (当有“存在”状态的淋巴结新靶病灶||当有“存在”或“太小”状态的非淋巴结新靶病灶) - else if ( data.HaveExixtsState||data.ExixtsOrLessNoLymphTarget) - { + else if (data.HaveExixtsState || data.ExixtsOrLessNoLymphTarget) + { // 疗效为 iUPD result = NewTargetLesionAssessment.iUPD; } @@ -2273,7 +2268,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - return result==null?string.Empty: result.Value.GetEnumInt(); + return result == null ? string.Empty : result.Value.GetEnumInt(); } #endregion @@ -2329,7 +2324,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate .Select(x => x.Answer).FirstOrDefaultAsync()) ?? string.Empty, //当前访视的新靶病灶评估 - NewTargetLesion = inDto.QuestionInfo.Where(x=>x.QuestionId== newTargetLesionQuestionId).Select(x=>x.Answer).FirstIsNullReturnEmpty(), + NewTargetLesion = inDto.QuestionInfo.Where(x => x.QuestionId == newTargetLesionQuestionId).Select(x => x.Answer).FirstIsNullReturnEmpty(), // 任一新非靶病灶状态为“增大” ExixtsEnlargementState = tableQuestion.SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.Progression)), @@ -2344,35 +2339,35 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate NewNoTargetLesionAssessment result = NewNoTargetLesionAssessment.ND; // if(所有新非靶病灶消失或一直不存在任何新非靶病灶时评估为该结果) - if(data.NotExistsNewNoTargetLesion|| data.AllVanish) - { + if (data.NotExistsNewNoTargetLesion || data.AllVanish) + { // 疗效为 ND result = NewNoTargetLesionAssessment.ND; - } + } // else if (上一访视新非靶病灶评估为“iUPD” && 满足任一新非靶病灶状态为“增大”) - else if(data.LastTaskNewNoTargetLesion.EqEnum(NewNoTargetLesionAssessment.iUPD)&& data.ExixtsEnlargementState) - { + else if (data.LastTaskNewNoTargetLesion.EqEnum(NewNoTargetLesionAssessment.iUPD) && data.ExixtsEnlargementState) + { // 疗效为 iCPD result = NewNoTargetLesionAssessment.iCPD; } // else if (上一访视新非靶病灶评估为“iCPD”&& 有"存在"状态的新非靶病灶) else if (data.LastTaskNewNoTargetLesion.EqEnum(NewNoTargetLesionAssessment.iCPD) && data.HaveExixtsState) - { + { // 疗效为 iCPD result = NewNoTargetLesionAssessment.iCPD; } // else if (当有存在状态的新非靶病灶) else if (data.HaveExixtsState) - { + { // 疗效为 iUPD result = NewNoTargetLesionAssessment.iUPD; } // else if (至少有一个新非靶病无法评估) - else if(data.ExixtsUnevaluableState) - { + else if (data.ExixtsUnevaluableState) + { // 疗效为 NE result = NewNoTargetLesionAssessment.NE; - } + } else { // 错误级别日志:项目、标准、受试者、阅片人、任务。当前新非靶病灶的病灶数据输出: @@ -2416,7 +2411,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.OtherPreviousNewLesion).SelectMany(x => x.TableRowInfoList).ToList(); var lastVisitTaskId = await GetLastVisitTaskId(inDto); - + IRECISTOtherNewTargetLesionDto data = new IRECISTOtherNewTargetLesionDto() { // 不存在其他既往新病灶记录 @@ -2602,59 +2597,59 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate LastTaskNewLesioniCPD = lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewLesionEvaluation && x.Answer.EqEnum(NewLesionAssessment.iCPD)), // 存在触发iRECIST后新病灶 - ExistxIRECISTNewLesion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TriggeringIRECSIT).SelectMany(x => x.TableRowInfoList).SelectMany(x=>x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Exist)||x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Equivocal))), + ExistxIRECISTNewLesion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TriggeringIRECSIT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Exist) || x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Equivocal))), }; // if(新靶病灶为ND && 新非靶病灶为ND && 其它既往新病灶为ND && 不存在触发iRECIST后新病灶) - if(inDto.QuestionInfo.Any(x=>x.QuestionType==QuestionType.NewTargetLesion&&x.Answer.EqEnum(NewTargetLesionAssessment.ND)) + if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.ND)) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.ND)) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.ND)) && !data.ExistxIRECISTNewLesion) - { + { // 疗效为 ND result = NewLesionAssessment.ND; - } + } // else if (新靶病灶为iCPD||新非靶病灶为iCPD) - else if(inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iCPD)) + else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iCPD)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iCPD))) { // 疗效为 iCPD result = NewLesionAssessment.iCPD; } - // else if (前一访视新病灶评估为iCPD && (新靶病灶评估为iCPD或iUPD || 新非靶病灶评估为iCPD或iUPD || 其它既往新病灶评估为iUPD || 触发iRECIST后新病灶评估为是)) - else if (data.LastTaskNewLesioniCPD && + // else if (前一访视新病灶评估为iCPD && (新靶病灶评估为iCPD或iUPD || 新非靶病灶评估为iCPD或iUPD || 其它既往新病灶评估为iUPD || 触发iRECIST后新病灶评估为是)) + else if (data.LastTaskNewLesioniCPD && ( - inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && (x.Answer.EqEnum(NewTargetLesionAssessment.iCPD)|| x.Answer.EqEnum(NewTargetLesionAssessment.iUPD))) - || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && (x.Answer.EqEnum(NewNoTargetLesionAssessment.iCPD)|| x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD))) - || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD)) - || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes)) - ) + inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && (x.Answer.EqEnum(NewTargetLesionAssessment.iCPD) || x.Answer.EqEnum(NewTargetLesionAssessment.iUPD))) + || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && (x.Answer.EqEnum(NewNoTargetLesionAssessment.iCPD) || x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD))) + || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD)) + || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes)) ) - { + ) + { // 疗效为 iCPD result = NewLesionAssessment.iCPD; } - // else if (前一访视新病灶评估为iUPD && 新靶病灶上个访视评估为NE或ND,本次访视评估为iUPD) - else if (data.LastTaskNewLesioniUPD && - lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion &&( x.Answer.EqEnum(NewTargetLesionAssessment.NE)|| x.Answer.EqEnum(NewTargetLesionAssessment.ND))) + // else if (前一访视新病灶评估为iUPD && 新靶病灶上个访视评估为NE或ND,本次访视评估为iUPD) + else if (data.LastTaskNewLesioniUPD && + lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && (x.Answer.EqEnum(NewTargetLesionAssessment.NE) || x.Answer.EqEnum(NewTargetLesionAssessment.ND))) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD)) ) - { + { // 疗效为 iCPD result = NewLesionAssessment.iCPD; } - // else if (前一访视新病灶评估为iUPD && 新非靶病灶上个访视评估为NE或ND,本次访视评估为iUPD) - else if (data.LastTaskNewLesioniUPD - && lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && (x.Answer.EqEnum(NewNoTargetLesionAssessment.NE)|| x.Answer.EqEnum(NewNoTargetLesionAssessment.ND))) + // else if (前一访视新病灶评估为iUPD && 新非靶病灶上个访视评估为NE或ND,本次访视评估为iUPD) + else if (data.LastTaskNewLesioniUPD + && lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && (x.Answer.EqEnum(NewNoTargetLesionAssessment.NE) || x.Answer.EqEnum(NewNoTargetLesionAssessment.ND))) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD)) ) { // 疗效为 iCPD result = NewLesionAssessment.iCPD; } - // else if (前一访视新病灶评估为iUPD && 其它既往新病灶上个访视评估为NE、ND或疑似,本次访视评估为iUPD) - else if (data.LastTaskNewLesioniUPD - && lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && (x.Answer.EqEnum(OtherPreviousNewLesionAssessment.NE)|| x.Answer.EqEnum(OtherPreviousNewLesionAssessment.ND) || x.Answer.EqEnum(OtherPreviousNewLesionAssessment.Equivocal))) + // else if (前一访视新病灶评估为iUPD && 其它既往新病灶上个访视评估为NE、ND或疑似,本次访视评估为iUPD) + else if (data.LastTaskNewLesioniUPD + && lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && (x.Answer.EqEnum(OtherPreviousNewLesionAssessment.NE) || x.Answer.EqEnum(OtherPreviousNewLesionAssessment.ND) || x.Answer.EqEnum(OtherPreviousNewLesionAssessment.Equivocal))) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD)) ) { @@ -2662,21 +2657,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.iCPD; } // else if (前一访视新病灶评估为iUPD && 触发iRECIST后新病灶评估上个访视评估为NE或否或疑似,本次访视评估为是) - else if(data.LastTaskNewLesioniUPD - && lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && (x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.NE)|| x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.No) || x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Equivocal))) + else if (data.LastTaskNewLesioniUPD + && lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && (x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.NE) || x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.No) || x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Equivocal))) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes)) ) - { + { // 疗效为 iCPD result = NewLesionAssessment.iCPD; } - // else if (新靶病灶评估为iUPD || 新非靶病灶评估为iUPD || 其它既往新病灶评估为iUPD || 触发iRECIST后新病灶评估为是) - else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD)) + // else if (新靶病灶评估为iUPD || 新非靶病灶评估为iUPD || 其它既往新病灶评估为iUPD || 触发iRECIST后新病灶评估为是) + else if (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewTargetLesion && x.Answer.EqEnum(NewTargetLesionAssessment.iUPD)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewNoTargetLesion && x.Answer.EqEnum(NewNoTargetLesionAssessment.iUPD)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.iUPD)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Yes)) ) - { + { // 疗效为 iUPD result = NewLesionAssessment.iUPD; } @@ -2686,7 +2681,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.NE)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.NE)) ) - { + { // 疗效为 NE result = NewLesionAssessment.NE; } @@ -2695,7 +2690,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.OtherNewTargetLesion && x.Answer.EqEnum(OtherPreviousNewLesionAssessment.Equivocal)) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITAssessment.Equivocal)) ) - { + { // 疗效为 疑似 result = NewLesionAssessment.Suspected; } @@ -2718,82 +2713,82 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】"); builder.AppendLine($"【任务Id】:【{taskInfo.Id}】"); builder.AppendLine($"【病灶类型】:【新病灶】"); - builder.AppendLine($"【新靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewTargetLesion).Select(x=>x.Answer).FirstIsNullReturnEmpty()}】"); + builder.AppendLine($"【新靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】"); builder.AppendLine($"【新非靶病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewNoTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】"); builder.AppendLine($"【其它既往新病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.OtherNewTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】"); builder.AppendLine($"【触发iRECIST后新病灶评估】:【{inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.IRECISTNewTargetLesion).Select(x => x.Answer).FirstIsNullReturnEmpty()}】"); _logger.LogError(builder.ToString()); - + } return result == null ? string.Empty : ((NewLesionAssessment)result).GetEnumInt(); } - #endregion + #endregion - #region 获取新病灶评估 - /// - /// 获取新病灶评估 - /// - /// - /// - public async Task GetNewLesionIRECSITEvaluate(ReadingCalculateDto inDto) - { + #region 获取新病灶评估 + /// + /// 获取新病灶评估 + /// + /// + /// + public async Task GetNewLesionIRECSITEvaluate(ReadingCalculateDto inDto) + { // 逻辑改了 现在转变后全部都是NA; return NewLesionAssessment.NA.GetEnumInt(); - //NewLesionAssessment result = NewLesionAssessment.No; - //if (inDto.IsBaseLine) - //{ - // return NewLesionAssessment.NA.GetEnumInt(); - //} + //NewLesionAssessment result = NewLesionAssessment.No; + //if (inDto.IsBaseLine) + //{ + // return NewLesionAssessment.NA.GetEnumInt(); + //} - //var newTargetQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewTargetLesion).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); + //var newTargetQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewTargetLesion).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); - //var newNonTargetQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewNonTargetLesion).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); + //var newNonTargetQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewNonTargetLesion).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); - //var OtherPreviousNewLesionQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.OtherPreviousNewLesion).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); + //var OtherPreviousNewLesionQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.OtherPreviousNewLesion).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); - //var triggeringQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TriggeringIRECSIT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); + //var triggeringQuestions = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TriggeringIRECSIT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList).ToList(); - //// 当前访视存在至少一个明确新病灶 - //if (newTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)) - // || newNonTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.Exist)) - // || OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Exists)) - // || triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Exist)) + //// 当前访视存在至少一个明确新病灶 + //if (newTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.Exist)) + // || newNonTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.Exist)) + // || OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Exists)) + // || triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Exist)) - // ) - //{ - // result = NewLesionAssessment.Yes; - //} - ////只要有任何一个新病灶状态为“无法评估” - //else if (newTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.NotEvaluable)) - // || newNonTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.NotEvaluable)) - // || OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.NotEvaluable)) - // || triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.NotEvaluable)) + // ) + //{ + // result = NewLesionAssessment.Yes; + //} + ////只要有任何一个新病灶状态为“无法评估” + //else if (newTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewTargetLesionState.NotEvaluable)) + // || newNonTargetQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewNoTargetLesionState.NotEvaluable)) + // || OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.NotEvaluable)) + // || triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.NotEvaluable)) - // ) - //{ - // result = NewLesionAssessment.NE; - //} - ////当前访视不存在明确新病灶且存在至少一个疑似新病灶 - //else if ( (!OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Exists)) && OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Equivocal))) - // || (!triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Exist)) && triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Equivocal))) + // ) + //{ + // result = NewLesionAssessment.NE; + //} + ////当前访视不存在明确新病灶且存在至少一个疑似新病灶 + //else if ( (!OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Exists)) && OtherPreviousNewLesionQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(OtherPreviousNewLesionState.Equivocal))) + // || (!triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Exist)) && triggeringQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NewLesionAfterTriggeringiRECSITState.Equivocal))) - // ) - //{ - // result = NewLesionAssessment.Suspected; - //} + // ) + //{ + // result = NewLesionAssessment.Suspected; + //} - //else - //{ - // result = NewLesionAssessment.No; - //} - //return result.GetEnumInt(); + //else + //{ + // result = NewLesionAssessment.No; + //} + //return result.GetEnumInt(); } #endregion @@ -2884,9 +2879,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // if(上一访视整体肿瘤评估评估为iCPD && 靶病灶评估、非靶病灶评估或新病灶评估任一项为iCPD或iCPD) if (lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.Tumor && x.Answer.EqEnum(OverallAssessment.iCPD)) - && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && (x.Answer.EqEnum(TargetAssessment.iCPD)||x.Answer.EqEnum(TargetAssessment.iUPD))) + && (inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && (x.Answer.EqEnum(TargetAssessment.iCPD) || x.Answer.EqEnum(TargetAssessment.iUPD))) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NoTargetLesion && (x.Answer.EqEnum(NoTargetAssessment.iCPD) || x.Answer.EqEnum(NoTargetAssessment.iUPD))) - || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewLesionEvaluation&& (x.Answer.EqEnum(NewLesionAssessment.iCPD) || x.Answer.EqEnum(NewLesionAssessment.iUPD))))) + || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.NewLesionEvaluation && (x.Answer.EqEnum(NewLesionAssessment.iCPD) || x.Answer.EqEnum(NewLesionAssessment.iUPD))))) { // 疗效为 iCPD result = OverallAssessment.iCPD; @@ -2896,7 +2891,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate else if (lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.Tumor && x.Answer.EqEnum(OverallAssessment.iUPD)) && ( ( - lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion &&x.Answer.EqEnum(TargetAssessment.iUPD)) + lastTaskCalculateDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iUPD)) && inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.TargetLesion && x.Answer.EqEnum(TargetAssessment.iCPD)) ) || @@ -3131,170 +3126,170 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// public async Task GetConvertingTargetLesionEvaluate(ReadingCalculateDto inDto) - { - var beforeConvertedAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.BeforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).Select(x => x.Answer).FirstOrDefaultAsync(); - - Dictionary answerConverDic = new Dictionary() - { - {TargetAssessment.SD.GetEnumInt(),TargetAssessment.iSD.GetEnumInt() }, - {TargetAssessment.PR.GetEnumInt(),TargetAssessment.iPR.GetEnumInt() }, - {TargetAssessment.PD.GetEnumInt(),TargetAssessment.iUPD.GetEnumInt() }, - {TargetAssessment.CR.GetEnumInt(), TargetAssessment.iCR.GetEnumInt() }, - }; - - try - { - return answerConverDic[beforeConvertedAnswer]; - - } - catch (Exception) - { - - return beforeConvertedAnswer==null?string.Empty: beforeConvertedAnswer; - - } - - } - #endregion - - - - #region 获取转化的非靶病灶评估 - - /// - /// 获取转化的非靶病灶评估 - /// - /// - /// - public async Task GetConvertingNoTargetLesionEvaluate(ReadingCalculateDto inDto) { - var beforeConvertedAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.BeforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.NoTargetLesion).Select(x => x.Answer).FirstOrDefaultAsync(); + var beforeConvertedAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.BeforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.TargetLesion).Select(x => x.Answer).FirstOrDefaultAsync(); - Dictionary answerConverDic = new Dictionary() - { - {NoTargetAssessment.NN.GetEnumInt(),NoTargetAssessment.iNN.GetEnumInt() }, - {NoTargetAssessment.PD.GetEnumInt(),NoTargetAssessment.iUPD.GetEnumInt() }, - {NoTargetAssessment.CR.GetEnumInt(), NoTargetAssessment.iCR.GetEnumInt() }, - }; + Dictionary answerConverDic = new Dictionary() + { + {TargetAssessment.SD.GetEnumInt(),TargetAssessment.iSD.GetEnumInt() }, + {TargetAssessment.PR.GetEnumInt(),TargetAssessment.iPR.GetEnumInt() }, + {TargetAssessment.PD.GetEnumInt(),TargetAssessment.iUPD.GetEnumInt() }, + {TargetAssessment.CR.GetEnumInt(), TargetAssessment.iCR.GetEnumInt() }, + }; - try - { - return answerConverDic[beforeConvertedAnswer]; + try + { + return answerConverDic[beforeConvertedAnswer]; - } - catch (Exception) - { + } + catch (Exception) + { return beforeConvertedAnswer == null ? string.Empty : beforeConvertedAnswer; } - } - #endregion - #region 获取转化的整体肿瘤评估 + } + #endregion - /// - /// 获取转化的整体肿瘤评估 - /// - /// - /// - public async Task GetConvertingTumor(ReadingCalculateDto inDto) - { - var beforeConvertedAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.BeforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).Select(x => x.Answer).FirstOrDefaultAsync(); - Dictionary answerConverDic = new Dictionary() - { - {OverallAssessment.NN.GetEnumInt(),OverallAssessment.iNN.GetEnumInt() }, - {OverallAssessment.PD.GetEnumInt(),OverallAssessment.iUPD.GetEnumInt() }, - {OverallAssessment.CR.GetEnumInt(), OverallAssessment.iCR.GetEnumInt() }, - {OverallAssessment.SD.GetEnumInt(), OverallAssessment.iSD.GetEnumInt() }, - {OverallAssessment.PR.GetEnumInt(), OverallAssessment.iPR.GetEnumInt() }, - }; - try - { - return answerConverDic[beforeConvertedAnswer]; + #region 获取转化的非靶病灶评估 - } - catch (Exception) - { + /// + /// 获取转化的非靶病灶评估 + /// + /// + /// + public async Task GetConvertingNoTargetLesionEvaluate(ReadingCalculateDto inDto) + { + var beforeConvertedAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.BeforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.NoTargetLesion).Select(x => x.Answer).FirstOrDefaultAsync(); + + Dictionary answerConverDic = new Dictionary() + { + {NoTargetAssessment.NN.GetEnumInt(),NoTargetAssessment.iNN.GetEnumInt() }, + {NoTargetAssessment.PD.GetEnumInt(),NoTargetAssessment.iUPD.GetEnumInt() }, + {NoTargetAssessment.CR.GetEnumInt(), NoTargetAssessment.iCR.GetEnumInt() }, + }; + + try + { + return answerConverDic[beforeConvertedAnswer]; + + } + catch (Exception) + { return beforeConvertedAnswer == null ? string.Empty : beforeConvertedAnswer; } - } - #endregion - #endregion + } + #endregion + + #region 获取转化的整体肿瘤评估 + + /// + /// 获取转化的整体肿瘤评估 + /// + /// + /// + public async Task GetConvertingTumor(ReadingCalculateDto inDto) + { + var beforeConvertedAnswer = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.BeforeConvertedTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.Tumor).Select(x => x.Answer).FirstOrDefaultAsync(); + + Dictionary answerConverDic = new Dictionary() + { + {OverallAssessment.NN.GetEnumInt(),OverallAssessment.iNN.GetEnumInt() }, + {OverallAssessment.PD.GetEnumInt(),OverallAssessment.iUPD.GetEnumInt() }, + {OverallAssessment.CR.GetEnumInt(), OverallAssessment.iCR.GetEnumInt() }, + {OverallAssessment.SD.GetEnumInt(), OverallAssessment.iSD.GetEnumInt() }, + {OverallAssessment.PR.GetEnumInt(), OverallAssessment.iPR.GetEnumInt() }, + }; + + try + { + return answerConverDic[beforeConvertedAnswer]; + + } + catch (Exception) + { + + return beforeConvertedAnswer == null ? string.Empty : beforeConvertedAnswer; + + } + } + #endregion + #endregion - #region 获取靶病灶评估 - /// - /// 获取靶病灶评估 - /// - /// - /// - /// 靶病灶疗效评估算法-20230306确认版本: - ///if(基线没有靶病灶) - ///{ - /// 靶病灶疗效为 ND - ///}else - ///{ - /// 初始化靶病灶疗效为 SD - /// - /// if (与基线期SOD相比减小≥30 %) - /// { - /// 靶病灶疗效为 PR - /// - /// } - /// - ///if (非淋巴结靶病灶长径之和 == 0 并且所有淋巴结靶病灶的短径 < 10且淋巴结非靶病灶全部消失) - /// { - /// 靶病灶疗效为 CR - /// - /// } - /// - ///if (有被评估为NE的单个靶病灶) - /// { - /// 靶病灶疗效为 NE - /// - /// } - /// - ///if (最低点SOD > 0) - ///{ - /// if(比整体访视期间最低点SOD增加≥20 % 且与整个访视期间最低点相比增加的值≥5 mm) - /// { - /// 靶病灶疗效为 PD - /// - /// } - ///} - ///else - ///{ - /// //进入该分支最低点SOD=0 - /// if (当前访视SOD > 0 且与整个访视期间最低点相比增加的值≥5 mm) - /// { - /// 靶病灶疗效为PD - /// - /// } - ///} - /// - ///if(上次访视点评估是CR) - /// { - /// if (当前访视点淋巴结病灶,至少一个淋巴结靶病灶短径≥10 mm 并且该淋巴结靶病灶短径绝对增加值≥5 mm) - /// { - /// 靶病灶疗效为 PD - /// - /// } - /// if (当前访视点非淋巴结病灶至少一个非淋巴结靶病灶的长径>0 mm。) - /// { - /// 靶病灶疗效为 PD - /// - /// } - ///} - ///} - /// - /// - public async Task GetTargetLesionEvaluate(ReadingCalculateDto inDto) + #region 获取靶病灶评估 + /// + /// 获取靶病灶评估 + /// + /// + /// + /// 靶病灶疗效评估算法-20230306确认版本: + ///if(基线没有靶病灶) + ///{ + /// 靶病灶疗效为 ND + ///}else + ///{ + /// 初始化靶病灶疗效为 SD + /// + /// if (与基线期SOD相比减小≥30 %) + /// { + /// 靶病灶疗效为 PR + /// + /// } + /// + ///if (非淋巴结靶病灶长径之和 == 0 并且所有淋巴结靶病灶的短径 < 10且淋巴结非靶病灶全部消失) + /// { + /// 靶病灶疗效为 CR + /// + /// } + /// + ///if (有被评估为NE的单个靶病灶) + /// { + /// 靶病灶疗效为 NE + /// + /// } + /// + ///if (最低点SOD > 0) + ///{ + /// if(比整体访视期间最低点SOD增加≥20 % 且与整个访视期间最低点相比增加的值≥5 mm) + /// { + /// 靶病灶疗效为 PD + /// + /// } + ///} + ///else + ///{ + /// //进入该分支最低点SOD=0 + /// if (当前访视SOD > 0 且与整个访视期间最低点相比增加的值≥5 mm) + /// { + /// 靶病灶疗效为PD + /// + /// } + ///} + /// + ///if(上次访视点评估是CR) + /// { + /// if (当前访视点淋巴结病灶,至少一个淋巴结靶病灶短径≥10 mm 并且该淋巴结靶病灶短径绝对增加值≥5 mm) + /// { + /// 靶病灶疗效为 PD + /// + /// } + /// if (当前访视点非淋巴结病灶至少一个非淋巴结靶病灶的长径>0 mm。) + /// { + /// 靶病灶疗效为 PD + /// + /// } + ///} + ///} + /// + /// + public async Task GetTargetLesionEvaluate(ReadingCalculateDto inDto) { var tableQuestion = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).SelectMany(x => x.TableRowInfoList).ToList(); if (inDto.IsBaseLine) @@ -3376,7 +3371,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 淋巴结非靶病灶状态全部为消失 - resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss&& item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault()== NoTargetState.Loss.GetEnumInt(); + resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss && item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault() == NoTargetState.Loss.GetEnumInt(); } } @@ -3386,10 +3381,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 淋巴结的短径 - resultData.DiameterLessThan10 = resultData.DiameterLessThan10&&(item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10; + resultData.DiameterLessThan10 = resultData.DiameterLessThan10 && (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10; var shortIsBigger10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() >= 10; - resultData.CurrenShortBigger10= resultData.CurrenShortBigger10|| shortIsBigger10; + resultData.CurrenShortBigger10 = resultData.CurrenShortBigger10 || shortIsBigger10; if (shortIsBigger10) { @@ -3402,7 +3397,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 当前访视点非淋巴结病灶至少一个非淋巴结靶病灶的长径 - resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0|| (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0; + resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0 || (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0; } } @@ -3467,7 +3462,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { //if (当前访视点淋巴结病灶,至少一个淋巴结靶病灶短径≥10 mm 并且该淋巴结靶病灶短径绝对增加值≥5 mm) // 换句话说 就是 短径≥10 的病灶 和 短径增加值≥5的病灶 的交集数量大于0 - if (resultData.ShortBigger10Indexs.Intersect(resultData.AddFiveIndexs).ToList().Count()>0) + if (resultData.ShortBigger10Indexs.Intersect(resultData.AddFiveIndexs).ToList().Count() > 0) { //靶病灶疗效为 PD result = TargetAssessment.PD; @@ -3561,7 +3556,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestions = tableRows.SelectMany(x => x.TableQuestionList).ToList(); //任意单个病灶 / 病灶组评估为“显著增大” - if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(NoTargetState.Increase)|| x.Answer.EqEnum(NoTargetState.IUPD)))) + if (tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(NoTargetState.Increase) || x.Answer.EqEnum(NoTargetState.IUPD)))) { result = NoTargetAssessment.PD; } @@ -3581,11 +3576,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NoTargetAssessment.NN; } //所有单个病灶/病灶组状态评估状态为“消失” - else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State)>0) + else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss)) == tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) > 0) { result = NoTargetAssessment.CR; } - + // 基线时没有非靶病灶 else if (tableQuestions.Count() == 0) { diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs index 427663129..0e9228a24 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IVUSCalculateService.cs @@ -1,17 +1,9 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using IRaCIS.Core.Infrastructure; -using MassTransit; -using System.Linq; -using System.Text; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -32,22 +24,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository, ILogger _logger) : BaseService, ICriterionCalculateService { - - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } - #region 临时对象 单个请求的生命周期 避免重复查询数据库 + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } - private List visitTaskAnswerList; + #region 临时对象 单个请求的生命周期 避免重复查询数据库 + + private List visitTaskAnswerList; /// /// 获取Sod的值 @@ -98,23 +90,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetReadingReportEvaluation(GetReadingReportEvaluationInDto indto) { GetReadingReportEvaluationOutDto result = new GetReadingReportEvaluationOutDto(); - var isConvertTask = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync(); - var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); - result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto() + var isConvertTask = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync(); + var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); + result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto() { VisitTaskId = indto.VisitTaskId, - IsConvertTask= isConvertTask, - BeforeConvertedTaskId =visitTaskInfo.BeforeConvertedTaskId, - }); + IsConvertTask = isConvertTask, + BeforeConvertedTaskId = visitTaskInfo.BeforeConvertedTaskId, + }); - - - result.ReadingTaskState = visitTaskInfo.ReadingTaskState; + + + result.ReadingTaskState = visitTaskInfo.ReadingTaskState; var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(indto.VisitTaskId); result.VisitTaskList = taskInfoList; @@ -122,12 +114,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList(); var criterionId = visitTaskInfo.TrialReadingCriterionId; - var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId&&x.ShowQuestion!= ShowQuestion.Hide) - .WhereIf(isConvertTask,x=>x.ConvertShowType==ConvertShowType.All||x.ConvertShowType==ConvertShowType.AfterShow) - .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) - .ToListAsync(); + var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide) + .WhereIf(isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.AfterShow) + .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) + .ToListAsync(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); - var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto { @@ -135,7 +127,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Count = x.ToList().Count() }).ToList(); - var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() + var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() { QuestionId = x.Key.QuestionId, Rowindexs = x.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList() @@ -144,14 +136,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); - var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new - { - x.TaskId, - x.GlobalVisitTask.VisitTaskNum, - x.QuestionId, - x.Answer - }).ToListAsync(); - var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new + { + x.TaskId, + x.GlobalVisitTask.VisitTaskNum, + x.QuestionId, + x.Answer + }).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); @@ -168,10 +160,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, + GroupId = x.GroupId, QuestionType = x.QuestionType, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -182,8 +174,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, - ReportLayType= ReportLayType.Group, + CustomUnit = x.CustomUnit, + ReportLayType = ReportLayType.Group, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, }).ToList(); @@ -191,12 +183,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 分组 foreach (var item in questions) { - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -209,7 +201,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -221,17 +213,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { - var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); - var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answer==null?string.Empty:answer.Answer, - IsGlobalChange = globalAnswer == null ? false : true, - GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, - TaskName = task.TaskName, + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = globalAnswer == null ? false : true, + GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, + TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, - + }); } @@ -260,8 +252,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty, ReportLayType = ReportLayType.Lesions, ReportMark = rowinfo != null ? rowinfo.ReportMark : string.Empty, - - }) ; + + }); } @@ -276,7 +268,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Type = x.Type, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, - RowId=row.RowId, + RowId = row.RowId, IsShowInDicom = question.IsShowInDicom, DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, @@ -313,13 +305,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate switch (tableQuestion.QuestionMark) { case QuestionMark.Organ: - taskQuestionAnswer.Answer= organInfo.TULOCEN; + taskQuestionAnswer.Answer = organInfo.TULOCEN; break; case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -330,7 +322,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Part: taskQuestionAnswer.Answer = organInfo.PartEN; - + break; } @@ -346,7 +338,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -406,7 +398,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { await ReadingCalculate(readingData, new List() { type.Value }); } - + } @@ -431,9 +423,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new GetReportVerifyOutDto() + return new GetReportVerifyOutDto() { - TumorEvaluate =string.Empty, + TumorEvaluate = string.Empty, IsExistDisease = string.Empty, }; @@ -470,7 +462,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 总动脉粥样硬化体积(NTAV) new ReadingCalculateData (){QuestionType=QuestionType.NTAV,GetDecimalNullFun=GetNTAV}, - + }; @@ -480,7 +472,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate calculateList = calculateList.Where(x => calculateType.Contains(x.QuestionType)).ToList(); } - + foreach (var calculate in calculateList) { @@ -489,57 +481,57 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item != null) { //计算答案 - - #region 计算答案 - if (calculate.GetDecimalFun != null) - { - item.Answer = (await calculate.GetDecimalFun(inDto)).ToString(); - } - else if (calculate.GetDecimalNullFun != null) - { - var value = await calculate.GetDecimalNullFun(inDto); - item.Answer = value == null ? string.Empty : value.Value.ToString(); - } - else if (calculate.GetStringFun != null) - { - item.Answer = await calculate.GetStringFun(inDto); - } - #endregion - // 修改修约小数位数 + #region 计算答案 + if (calculate.GetDecimalFun != null) + { + item.Answer = (await calculate.GetDecimalFun(inDto)).ToString(); - List valueOfTypes = new List() { + } + else if (calculate.GetDecimalNullFun != null) + { + var value = await calculate.GetDecimalNullFun(inDto); + item.Answer = value == null ? string.Empty : value.Value.ToString(); + } + else if (calculate.GetStringFun != null) + { + item.Answer = await calculate.GetStringFun(inDto); + } + #endregion + // 修改修约小数位数 + + List valueOfTypes = new List() { ValueOfType.Decimals, ValueOfType.Percentage }; - if (inDto.DigitPlaces != -1) + if (inDto.DigitPlaces != -1) + { + try { - try + + if (valueOfTypes.Contains(item.ValueType)) { - - if (valueOfTypes.Contains(item.ValueType)) - { - item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString()); - } - } - catch (Exception) - { - - + item.Answer = decimal.Round(decimal.Parse(item.Answer ?? "0"), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString()); } } - - - - needAddList.Add(new ReadingTaskQuestionAnswer() + catch (Exception) { - Answer = item.Answer, - ReadingQuestionTrialId = item.QuestionId, - }); - } + + + } + } + + + + needAddList.Add(new ReadingTaskQuestionAnswer() + { + Answer = item.Answer, + ReadingQuestionTrialId = item.QuestionId, + }); + } } @@ -589,7 +581,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return null; } - return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList) + return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.MatchValues).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList) .Where(x => x.QuestionMark == QuestionMark.ElasticArea).Select(x => x.Answer.IsNullOrEmptyReturn0()).Sum(); } @@ -641,7 +633,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var eEMLumenSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMLumenSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var eEMSum = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EEMSum).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); - + if (eEMSum == 0) { return null; @@ -661,8 +653,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var result = await GetNTAVEEMLumenSumOrRetraceImageCount(inDto); - var medianFrame= inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.MedianFrame).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); - if (result == null|| medianFrame==0) + var medianFrame = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.MedianFrame).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); + if (result == null || medianFrame == 0) { return null; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs index 5961869b0..d5dc5048f 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ICriterionCalculateService.cs @@ -1,11 +1,5 @@ using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.ViewModel; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service { @@ -60,8 +54,8 @@ namespace IRaCIS.Core.Application.Service /// Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto); - - } + + } } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs index a3f1bd3df..a4d78c656 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IGeneralCalculateService.cs @@ -1,10 +1,5 @@ using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service { diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs index 81624907a..6d04c80e7 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/ILuganoCalculateService.cs @@ -1,26 +1,21 @@ using IRaCIS.Core.Application.ViewModel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.ReadingCalculate.Interface { - public interface ILuganoCalculateService - { - /// - /// 计算靶病灶状态 - /// - /// - /// - Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto); + public interface ILuganoCalculateService + { + /// + /// 计算靶病灶状态 + /// + /// + /// + Task CalculateTargetLesionStatus(CalculateTargetLesionStatusInDto inDto); - /// - /// 计算靶病灶融合后状态 - /// - /// - /// - Task CalculateMergeTargetLesionStatus(CalculateTargetLesionStatusInDto inDto); - } + /// + /// 计算靶病灶融合后状态 + /// + /// + /// + Task CalculateMergeTargetLesionStatus(CalculateTargetLesionStatusInDto inDto); + } } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs index f34bef539..728046725 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/Interface/IReadingCalculateService.cs @@ -1,10 +1,5 @@ using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.ViewModel; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service { @@ -59,5 +54,5 @@ namespace IRaCIS.Core.Application.Service /// Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto); - } + } } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs index 20f5d2406..b40c22e63 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoCalculateService.cs @@ -1,22 +1,12 @@ -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; - using IRaCIS.Core.Infrastructure; using MassTransit; -using System.Reflection.Metadata.Ecma335; -using System.Linq; -using NPOI.SS.Formula.Functions; -using DocumentFormat.OpenXml.Drawing.Charts; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; -using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -40,7 +30,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository) : BaseService, ICriterionCalculateService, ILuganoCalculateService { - + /// /// 获取阅片的计算数据 @@ -51,7 +41,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId); readingData.ComputationTrigger = ComputationTrigger.LiverBloodPool; - var baseLinePET5PS = 0m; + var baseLinePET5PS = 0m; if (!readingData.IsBaseLine) { var baseLineTaskId = await GetBaseLineTaskId(readingData); @@ -62,9 +52,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { BaseLinePET5PS = baseLinePET5PS, //计算的5ps评分 - CalculatePET5PS=await GetPET5PS(readingData), + CalculatePET5PS = await GetPET5PS(readingData), - }; + }; } #region 临时对象 单个请求的生命周期 避免重复查询数据库 @@ -1223,13 +1213,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.VisitTaskId == inDto.VisitTaskId && //x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD && x.QuestionId == targetQuestion.Id) - .Select(x => new { + .Select(x => new + { x.RowId, x.RowIndex, x.Answer, x.ReadingTableQuestionTrial.QuestionMark, }).ToListAsync(); - var answerList = ppdAnswerList.Select(x => new { + var answerList = ppdAnswerList.Select(x => new + { x.RowId, x.RowIndex, Answer = x.Answer.IsNullOrEmptyReturn0(), @@ -1361,7 +1353,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var item in rowIndexList) { - var lowPPD = await this.GetLowPPDInfo(new GetPPDInfoInDto() { + var lowPPD = await this.GetLowPPDInfo(new GetPPDInfoInDto() + { VisitTaskId = visitTaskId, QuestionId = questionId, @@ -1428,7 +1421,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMarkName = x.OrderMarkName, }).ToListAsync(); - questionMarkList.ForEach(x => { + questionMarkList.ForEach(x => + { x.Id = NewId.NextGuid(); }); @@ -2085,7 +2079,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var splenicBottomAnswer = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicBottomPosition).Select(x => x.Answer).FirstOrDefault(); decimal? spleenLength = null; - if (splenicTopAnswer != null && splenicBottomAnswer != null&& splenicTopAnswer != string.Empty && splenicBottomAnswer != string.Empty) + if (splenicTopAnswer != null && splenicBottomAnswer != null && splenicTopAnswer != string.Empty && splenicBottomAnswer != string.Empty) { spleenLength = splenicTopAnswer.IsNullOrEmptyReturn0() - splenicBottomAnswer.IsNullOrEmptyReturn0(); if (spleenLength < 0) @@ -2381,7 +2375,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 脾脏状态 SplenicStatus = await GetSplenicStatus(inDto), - }; + }; } @@ -2501,31 +2495,31 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - // 先在数据库查这几个值 - List needSearchTypes = new List() - { - QuestionType.SUVmax, - QuestionType.PET5PS, - }; + // 先在数据库查这几个值 + List needSearchTypes = new List() + { + QuestionType.SUVmax, + QuestionType.PET5PS, + }; - var dataBaseDataList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && needSearchTypes.Contains(x.ReadingQuestionTrial.QuestionType)).Select(x => new - { - x.Answer, - x.ReadingQuestionTrial.QuestionType - }).ToListAsync(); + var dataBaseDataList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && needSearchTypes.Contains(x.ReadingQuestionTrial.QuestionType)).Select(x => new + { + x.Answer, + x.ReadingQuestionTrial.QuestionType + }).ToListAsync(); - // 数据库中最大SUVmax - var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty(); + // 数据库中最大SUVmax + var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty(); - // 如果不是保存肝脏血池和纵隔血池 - if (inDto.ComputationTrigger != ComputationTrigger.InitialCalculation && inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool&& dataBaseSUVmax == (await GetSuvMax(inDto)).ToString()) + // 如果不是保存肝脏血池和纵隔血池 + if (inDto.ComputationTrigger != ComputationTrigger.InitialCalculation && inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool && dataBaseSUVmax == (await GetSuvMax(inDto)).ToString()) { - return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty(); + return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty(); - } + } @@ -2643,8 +2637,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetUptakeChange(ReadingCalculateDto inDto) { - var existPET = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ExistPET).Select(x => x.Answer).FirstOrDefault(); - if (await ImageQualityIsUnableFuse(inDto)|| existPET.EqEnum(ReadingYesOrNo.No)) + var existPET = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ExistPET).Select(x => x.Answer).FirstOrDefault(); + if (await ImageQualityIsUnableFuse(inDto) || existPET.EqEnum(ReadingYesOrNo.No)) { if (inDto.IsBaseLine) { @@ -2652,14 +2646,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } else { - return SUVChangeVSBaseline.NotEvaluable.GetEnumInt(); - } - - } + return SUVChangeVSBaseline.NotEvaluable.GetEnumInt(); + } - //PET5ps评分改变时,才计算 + } - List needSearchTypes = new List() + //PET5ps评分改变时,才计算 + + List needSearchTypes = new List() { QuestionType.PET5PS, QuestionType.UptakeChange, @@ -2687,7 +2681,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return SUVChangeVSBaseline.NA.GetEnumInt(); } - + var result = SUVChangeVSBaseline.NotEvaluable; var baseLineTaskId = await GetBaseLineTaskId(inDto); @@ -2700,20 +2694,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLinePET5PSValue = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstOrDefaultAsync(); - var baseLinePET5PS = baseLinePET5PSValue.IsNullOrEmptyReturn0(); + var baseLinePET5PS = baseLinePET5PSValue.IsNullOrEmptyReturn0(); - - - // 基线为NE或者X 为空 - if (baseLinePET5PSValue.EqEnum(PET5PSScore.X) || baseLinePET5PSValue.EqEnum(PET5PSScore.NE)) - { - return string.Empty; - } - //本访视PET评分>基线PET评分 - else if (PET5PS > baseLinePET5PS) + + // 基线为NE或者X 为空 + if (baseLinePET5PSValue.EqEnum(PET5PSScore.X) || baseLinePET5PSValue.EqEnum(PET5PSScore.NE)) + { + return string.Empty; + } + + //本访视PET评分>基线PET评分 + else if (PET5PS > baseLinePET5PS) { result = SUVChangeVSBaseline.Increase; } @@ -2900,7 +2894,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetEvidenceFocalFDG(ReadingCalculateDto inDto) { - if (await ImageQualityIsUnableFuse(inDto)|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt())) + if (await ImageQualityIsUnableFuse(inDto) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt())) { if (inDto.IsBaseLine) { @@ -2908,12 +2902,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } else { - return FDGAffinityFociInBM.NE.GetEnumInt(); - } + return FDGAffinityFociInBM.NE.GetEnumInt(); + } } else { - return inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EvidenceFocalFDG).Select(x => x.Answer).FirstOrDefault()??string.Empty; + return inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EvidenceFocalFDG).Select(x => x.Answer).FirstOrDefault() ?? string.Empty; } } #endregion @@ -2949,23 +2943,24 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestions = rowInfo.SelectMany(x => x.TableQuestionList).ToList(); - var maxSuv = tableQuestions.Where(x => x.QuestionMark == QuestionMark.SUVmax).Select(x =>new { - x.RowIndex, - Answer= x.Answer.IsNullOrEmptyReturn0(), - - - }).OrderByDescending(x=>x.Answer).FirstOrDefault(); - if (maxSuv == null|| maxSuv.Answer == 0m) + var maxSuv = tableQuestions.Where(x => x.QuestionMark == QuestionMark.SUVmax).Select(x => new + { + x.RowIndex, + Answer = x.Answer.IsNullOrEmptyReturn0(), + + + }).OrderByDescending(x => x.Answer).FirstOrDefault(); + if (maxSuv == null || maxSuv.Answer == 0m) { return "NE"; } else { var orderMark = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).FirstOrDefault()!.OrderMark; - return orderMark+ maxSuv.RowIndex.GetLesionMark(); + return orderMark + maxSuv.RowIndex.GetLesionMark(); } - + } #endregion @@ -3007,7 +3002,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // VisitTaskId=inDto.VisitTaskId, //}); - var existPet=await _dicomStudyRepository.Where(x => x.TrialId == inDto.TrialId && x.SubjectVisitId == inDto.SubjectVisitId).AnyAsync(x => x.Modalities.Contains("PT")); + var existPet = await _dicomStudyRepository.Where(x => x.TrialId == inDto.TrialId && x.SubjectVisitId == inDto.SubjectVisitId).AnyAsync(x => x.Modalities.Contains("PT")); return existPet ? ReadingYesOrNo.Yes.GetEnumInt() : ReadingYesOrNo.No.GetEnumInt(); } @@ -3043,143 +3038,143 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate return CalculationGetImgOncology(cTandMRIData, fDGPETData, lastFDGPETData); - } + } - /// - /// 计算整体肿瘤评估 【测试】 - /// - /// CT/MRI总体评估 - /// FDG-PET总体评估 - /// 上一次 FDG-PET总体评估 - /// - public string CalculationGetImgOncology(string? cTandMRIData,string? fDGPETData,string? lastFDGPETData) + /// + /// 计算整体肿瘤评估 【测试】 + /// + /// CT/MRI总体评估 + /// FDG-PET总体评估 + /// 上一次 FDG-PET总体评估 + /// + public string CalculationGetImgOncology(string? cTandMRIData, string? fDGPETData, string? lastFDGPETData) { - List data = new List() { + List data = new List() { //1、ND NE NE/NA ND new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.ND }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.ND }), + }, //2、ND/PD/CR/NE/PR/SD PMD PMD/CMR/PMR/NMR/NE/NA PMD/PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), - Column3=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), + Column3=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), + }, //3、ND/PD/CR/NE/PR/SD NE PMD PMD/PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), - Column2=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), + Column2=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), + }, //4、PD NE CMR/PMR/NMR/NE/NA PMD/PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD}), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD}), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), + }, //5、NE NE NE/NA NE new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NE }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NE }), + }, //6、CR、PR、SD、NE、ND、PD CMR CMR/PMR/NMR/PMD/NE/NA CMR/CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), + }, //7、CR NE NE/NA CMR/CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), + }, //8、CR、PR、SD、NE、ND NE CMR CMR/CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), + }, //9、ND/PD/CR/NE/PR/SD PMR PMD/CMR/PMR/NMR/NE PMR/PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE,FDGPETOverallAssessment.NA, }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE,FDGPETOverallAssessment.NA, }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), + }, //10、PR NE NE/NA PMR/PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), + }, //11、CR/PR/SD/NE/ND NE PMR PMR/PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), + }, //12、ND/PD/CR/NE/PR/SD NMR PMD/CMR/PMR/NMR/NE NMR/SD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR, FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR, FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), + }, //13、CR/PR/SD/ND/NE NE NMR NMR/SD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR, CTMRIOverallAssessment.PR, CTMRIOverallAssessment.SD, CTMRIOverallAssessment.ND, CTMRIOverallAssessment.NE }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR, CTMRIOverallAssessment.PR, CTMRIOverallAssessment.SD, CTMRIOverallAssessment.ND, CTMRIOverallAssessment.NE }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), + }, //14、SD NE NE NMR/SD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), - }, - }; + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), + }, + }; - var resultdata = data.Where(x => - (x.NotEq.Contains(1) ? !x.Column1.Contains(cTandMRIData) : x.Column1.Contains(cTandMRIData) || x.Column1.Count() == 0) && - (x.NotEq.Contains(2) ? !x.Column2.Contains(fDGPETData) : x.Column2.Contains(fDGPETData) || x.Column2.Count() == 0) && - (x.NotEq.Contains(3) ? !x.Column3.Contains(lastFDGPETData) : x.Column3.Contains(lastFDGPETData) || x.Column3.Count() == 0)) - .Select(x => x.Column4.FirstOrDefault()) - .FirstOrDefault(); - return resultdata ?? string.Empty; - } + var resultdata = data.Where(x => + (x.NotEq.Contains(1) ? !x.Column1.Contains(cTandMRIData) : x.Column1.Contains(cTandMRIData) || x.Column1.Count() == 0) && + (x.NotEq.Contains(2) ? !x.Column2.Contains(fDGPETData) : x.Column2.Contains(fDGPETData) || x.Column2.Count() == 0) && + (x.NotEq.Contains(3) ? !x.Column3.Contains(lastFDGPETData) : x.Column3.Contains(lastFDGPETData) || x.Column3.Count() == 0)) + .Select(x => x.Column4.FirstOrDefault()) + .FirstOrDefault(); + return resultdata ?? string.Empty; + } - #endregion + #endregion - #region 获取基线脾脏长度 - /// - /// 获取基线脾脏长度 - /// - /// - /// - public async Task GetBaseLineSpleenLength(ReadingCalculateDto inDto) + #region 获取基线脾脏长度 + /// + /// 获取基线脾脏长度 + /// + /// + /// + public async Task GetBaseLineSpleenLength(ReadingCalculateDto inDto) { var baseLineTaskId = await GetBaseLineTaskId(inDto); @@ -3198,7 +3193,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetSplenoncusDiameterChange(ReadingCalculateDto inDto) { - + if (inDto.IsBaseLine) { return "NA"; @@ -3207,7 +3202,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineTaskId = await GetBaseLineTaskId(inDto); var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var baseLineSpleenLength = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0(); - + return (presentSpleenLength - baseLineSpleenLength).ToString(); @@ -3252,7 +3247,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 当前访视淋巴结靶病灶的状态全部变为“消失” - eqCR = eqCR && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(TargetState.Loss)|| x.Answer.EqEnum(TargetState.TooSmall))); + eqCR = eqCR && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(TargetState.Loss) || x.Answer.EqEnum(TargetState.TooSmall))); } } // 1、与基线相比SPD变化的百分比 ≥50%,; @@ -3278,7 +3273,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (baseLineSPD > 0) { - eqPR = (presentSPD - baseLineSPD) / baseLineSPD <=- 0.5m; + eqPR = (presentSPD - baseLineSPD) / baseLineSPD <= -0.5m; } } @@ -3294,15 +3289,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { result = TargetAssessment.PD; } - + //当前访视存在至少一个状态为“不可评估”的靶病灶。 else if ( tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(TargetState.UnableEvaluate))) { result = TargetAssessment.NE; } - //当前访视非淋巴结靶病灶全部消失 && (当前访视淋巴结靶病灶的状态全部变为“消失” 或者 "太小" ) - else if (eqCR) + //当前访视非淋巴结靶病灶全部消失 && (当前访视淋巴结靶病灶的状态全部变为“消失” 或者 "太小" ) + else if (eqCR) { result = TargetAssessment.CR; } @@ -3355,7 +3350,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NoTargetAssessment.NE; } //所有单个病灶/病灶组状态评估状态为“消失” - else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State)>0) + else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss)) == tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) > 0) { result = NoTargetAssessment.CR; } @@ -3409,7 +3404,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.Suspected; } - + else { result = NewLesionAssessment.No; @@ -3447,7 +3442,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 脾脏评估 var spleenEvaluation = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicEvaluation).Select(x => x.Answer).FirstOrDefault(); - + return CalculationCTMRIEvaluation(targetEvaluation, noTargetEvaluation, existsNewTarget, liverEvaluation, spleenEvaluation); } @@ -3461,259 +3456,259 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// 脾脏评估 /// [HttpPost] - public string CalculationCTMRIEvaluation(string? targetEvaluation,string? noTargetEvaluation,string? existsNewTarget,string? liverEvaluation,string? spleenEvaluation) + public string CalculationCTMRIEvaluation(string? targetEvaluation, string? noTargetEvaluation, string? existsNewTarget, string? liverEvaluation, string? spleenEvaluation) { - List data = new List() { + List data = new List() { //ND ND 否/疑似 正常 正常 ND new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No, NewLesionAssessment.Suspected }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No, NewLesionAssessment.Suspected }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), + }, //PD 任一结果 任一结果 任一结果 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PD }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { }), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PD }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { }), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 PD 任一结果 任一结果 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), - Column3=ReadingCommon.EnumToString(new List() {}), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), + Column3=ReadingCommon.EnumToString(new List() {}), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 任一结果 是 任一结果 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 任一结果 任一结果 显著增大 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 任一结果 任一结果 任一结果 显著增大 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() {}), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() {}), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //CR CR/ND 否 正常 正常 CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR, NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR, NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), + }, //ND CR 否 正常 正常 CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), + }, //NE 非PD 否/疑似/无法评估 非显著增大 非显著增大 NE new CalculationDto(){ - NotEq=new List(){ 2,4,5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.NE }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected, NewLesionAssessment.NE}), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 2,4,5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.NE }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected, NewLesionAssessment.NE}), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //ND NE 否/疑似/无法评估(不为是) 正常/稳定/无法评估/部分缓解(非显著增大) 正常/稳定/无法评估/部分缓解(非显著增大) NE new CalculationDto(){ - NotEq=new List(){ 3,4,5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 3,4,5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //ND ND 无法评估 正常/稳定/无法评估/部分缓解(非显著增大) 正常/稳定/无法评估/部分缓解(非显著增大) NE new CalculationDto(){ - NotEq=new List(){ 4,5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 4,5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //ND ND 否/疑似 无法评估 正常/稳定/无法评估/部分缓解(非显著增大) NE new CalculationDto(){ - NotEq=new List(){ 5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.NotEvaluable }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.NotEvaluable }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, // ND ND 否/疑似 正常/稳定 NE NE new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //1 PR CR或PR/SD或NE或ND 否/疑似/无法评估NE 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.PRSD,NoTargetAssessment.NE,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected,NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.PRSD,NoTargetAssessment.NE,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected,NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //2 CR (PR/SD)或者NE 否/疑似/无法评估 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PRSD,NoTargetAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected ,NewLesionAssessment.NE}), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable}), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PRSD,NoTargetAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected ,NewLesionAssessment.NE}), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable}), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //3 CR CR/ND 疑似/无法评估 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //4 CR CR/ND 否 稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //5 CR CR/ND 否 正常 部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, // 6 ND CR 疑似/无法评估 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, // 7 ND CR 否 稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, // 8 ND CR 否 正常 部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, - new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { }), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), - }, - }; + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, + new CalculationDto(){ + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { }), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), + }, + }; - var index = data.FindIndex(x => - (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && - (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && - (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && - (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && - (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) - ; - var result = data.Where(x => - (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && - (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && - (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && - (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && - (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) - .Select(x => x.Column6.FirstOrDefault()) - .FirstOrDefault(); - return result ?? string.Empty; - } + var index = data.FindIndex(x => + (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && + (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && + (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && + (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && + (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) + ; + var result = data.Where(x => + (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && + (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && + (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && + (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && + (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) + .Select(x => x.Column6.FirstOrDefault()) + .FirstOrDefault(); + return result ?? string.Empty; + } - #endregion + #endregion - /// - /// 保留小数 - /// - /// - /// - /// - public string ReserveDecimal (decimal answer, int digitPlaces) + /// + /// 保留小数 + /// + /// + /// + /// + public string ReserveDecimal(decimal answer, int digitPlaces) { - return decimal.Round(answer, digitPlaces).ToString(); + return decimal.Round(answer, digitPlaces).ToString(); } #region 脾脏评估 - ///// - ///// 获取脾脏评估 - ///// - ///// - ///// - //public async Task GetSplenicEvaluation(ReadingCalculateDto inDto) - //{ + ///// + ///// 获取脾脏评估 + ///// + ///// + ///// + //public async Task GetSplenicEvaluation(ReadingCalculateDto inDto) + //{ - //} - #endregion + //} + #endregion - #endregion + #endregion } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs index c48ff184b..59ff882a3 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/LuganoWithoutPETCalculateService.cs @@ -1,22 +1,12 @@ -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; - using IRaCIS.Core.Infrastructure; using MassTransit; -using System.Reflection.Metadata.Ecma335; -using System.Linq; -using NPOI.SS.Formula.Functions; -using DocumentFormat.OpenXml.Drawing.Charts; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Service.ReadingCalculate.Interface; -using DocumentFormat.OpenXml.Office2016.Drawing.ChartDrawing; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -40,7 +30,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository) : BaseService, ICriterionCalculateService, ILuganoCalculateService { - + /// /// 获取阅片的计算数据 /// @@ -50,7 +40,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(inDto.VisitTaskId); readingData.ComputationTrigger = ComputationTrigger.LiverBloodPool; - var baseLinePET5PS = 0m; + var baseLinePET5PS = 0m; if (!readingData.IsBaseLine) { var baseLineTaskId = await GetBaseLineTaskId(readingData); @@ -61,9 +51,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { BaseLinePET5PS = baseLinePET5PS, //计算的5ps评分 - CalculatePET5PS=await GetPET5PS(readingData), + CalculatePET5PS = await GetPET5PS(readingData), - }; + }; } #region 临时对象 单个请求的生命周期 避免重复查询数据库 @@ -1222,13 +1212,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.VisitTaskId == inDto.VisitTaskId && //x.ReadingTableQuestionTrial.QuestionMark == QuestionMark.PPD && x.QuestionId == targetQuestion.Id) - .Select(x => new { + .Select(x => new + { x.RowId, x.RowIndex, x.Answer, x.ReadingTableQuestionTrial.QuestionMark, }).ToListAsync(); - var answerList = ppdAnswerList.Select(x => new { + var answerList = ppdAnswerList.Select(x => new + { x.RowId, x.RowIndex, Answer = x.Answer.IsNullOrEmptyReturn0(), @@ -1360,7 +1352,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var item in rowIndexList) { - var lowPPD = await this.GetLowPPDInfo(new GetPPDInfoInDto() { + var lowPPD = await this.GetLowPPDInfo(new GetPPDInfoInDto() + { VisitTaskId = visitTaskId, QuestionId = questionId, @@ -1427,7 +1420,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMarkName = x.OrderMarkName, }).ToListAsync(); - questionMarkList.ForEach(x => { + questionMarkList.ForEach(x => + { x.Id = NewId.NextGuid(); }); @@ -2084,7 +2078,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var splenicBottomAnswer = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicBottomPosition).Select(x => x.Answer).FirstOrDefault(); decimal? spleenLength = null; - if (splenicTopAnswer != null && splenicBottomAnswer != null&& splenicTopAnswer != string.Empty && splenicBottomAnswer != string.Empty) + if (splenicTopAnswer != null && splenicBottomAnswer != null && splenicTopAnswer != string.Empty && splenicBottomAnswer != string.Empty) { spleenLength = splenicTopAnswer.IsNullOrEmptyReturn0() - splenicBottomAnswer.IsNullOrEmptyReturn0(); if (spleenLength < 0) @@ -2380,7 +2374,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 脾脏状态 SplenicStatus = await GetSplenicStatus(inDto), - }; + }; } @@ -2500,31 +2494,31 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - // 先在数据库查这几个值 - List needSearchTypes = new List() - { - QuestionType.SUVmax, - QuestionType.PET5PS, - }; + // 先在数据库查这几个值 + List needSearchTypes = new List() + { + QuestionType.SUVmax, + QuestionType.PET5PS, + }; - var dataBaseDataList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && needSearchTypes.Contains(x.ReadingQuestionTrial.QuestionType)).Select(x => new - { - x.Answer, - x.ReadingQuestionTrial.QuestionType - }).ToListAsync(); + var dataBaseDataList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && needSearchTypes.Contains(x.ReadingQuestionTrial.QuestionType)).Select(x => new + { + x.Answer, + x.ReadingQuestionTrial.QuestionType + }).ToListAsync(); - // 数据库中最大SUVmax - var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty(); + // 数据库中最大SUVmax + var dataBaseSUVmax = dataBaseDataList.Where(x => x.QuestionType == QuestionType.SUVmax).Select(x => x.Answer).FirstIsNullReturnEmpty(); - // 如果不是保存肝脏血池和纵隔血池 - if (inDto.ComputationTrigger != ComputationTrigger.InitialCalculation && inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool&& dataBaseSUVmax == (await GetSuvMax(inDto)).ToString()) + // 如果不是保存肝脏血池和纵隔血池 + if (inDto.ComputationTrigger != ComputationTrigger.InitialCalculation && inDto.ComputationTrigger != ComputationTrigger.LiverBloodPool && inDto.ComputationTrigger != ComputationTrigger.MediastinalPool && dataBaseSUVmax == (await GetSuvMax(inDto)).ToString()) { - return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty(); + return dataBaseDataList.Where(x => x.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstIsNullReturnEmpty(); - } + } @@ -2642,8 +2636,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetUptakeChange(ReadingCalculateDto inDto) { - var existPET = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ExistPET).Select(x => x.Answer).FirstOrDefault(); - if (await ImageQualityIsUnableFuse(inDto)|| existPET.EqEnum(ReadingYesOrNo.No)) + var existPET = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.ExistPET).Select(x => x.Answer).FirstOrDefault(); + if (await ImageQualityIsUnableFuse(inDto) || existPET.EqEnum(ReadingYesOrNo.No)) { if (inDto.IsBaseLine) { @@ -2651,14 +2645,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } else { - return SUVChangeVSBaseline.NotEvaluable.GetEnumInt(); - } - - } + return SUVChangeVSBaseline.NotEvaluable.GetEnumInt(); + } - //PET5ps评分改变时,才计算 + } - List needSearchTypes = new List() + //PET5ps评分改变时,才计算 + + List needSearchTypes = new List() { QuestionType.PET5PS, QuestionType.UptakeChange, @@ -2686,7 +2680,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return SUVChangeVSBaseline.NA.GetEnumInt(); } - + var result = SUVChangeVSBaseline.NotEvaluable; var baseLineTaskId = await GetBaseLineTaskId(inDto); @@ -2699,20 +2693,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLinePET5PSValue = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.PET5PS).Select(x => x.Answer).FirstOrDefaultAsync(); - var baseLinePET5PS = baseLinePET5PSValue.IsNullOrEmptyReturn0(); + var baseLinePET5PS = baseLinePET5PSValue.IsNullOrEmptyReturn0(); - - - // 基线为NE或者X 为空 - if (baseLinePET5PSValue.EqEnum(PET5PSScore.X) || baseLinePET5PSValue.EqEnum(PET5PSScore.NE)) - { - return string.Empty; - } - //本访视PET评分>基线PET评分 - else if (PET5PS > baseLinePET5PS) + + // 基线为NE或者X 为空 + if (baseLinePET5PSValue.EqEnum(PET5PSScore.X) || baseLinePET5PSValue.EqEnum(PET5PSScore.NE)) + { + return string.Empty; + } + + //本访视PET评分>基线PET评分 + else if (PET5PS > baseLinePET5PS) { result = SUVChangeVSBaseline.Increase; } @@ -2899,7 +2893,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetEvidenceFocalFDG(ReadingCalculateDto inDto) { - if (await ImageQualityIsUnableFuse(inDto)|| inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt())) + if (await ImageQualityIsUnableFuse(inDto) || inDto.QuestionInfo.Any(x => x.QuestionType == QuestionType.ExistPET && x.Answer == ReadingYesOrNo.No.GetEnumInt())) { if (inDto.IsBaseLine) { @@ -2907,12 +2901,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } else { - return FDGAffinityFociInBM.NE.GetEnumInt(); - } + return FDGAffinityFociInBM.NE.GetEnumInt(); + } } else { - return inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EvidenceFocalFDG).Select(x => x.Answer).FirstOrDefault()??string.Empty; + return inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.EvidenceFocalFDG).Select(x => x.Answer).FirstOrDefault() ?? string.Empty; } } #endregion @@ -2948,23 +2942,24 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestions = rowInfo.SelectMany(x => x.TableQuestionList).ToList(); - var maxSuv = tableQuestions.Where(x => x.QuestionMark == QuestionMark.SUVmax).Select(x =>new { - x.RowIndex, - Answer= x.Answer.IsNullOrEmptyReturn0(), - - - }).OrderByDescending(x=>x.Answer).FirstOrDefault(); - if (maxSuv == null|| maxSuv.Answer == 0m) + var maxSuv = tableQuestions.Where(x => x.QuestionMark == QuestionMark.SUVmax).Select(x => new + { + x.RowIndex, + Answer = x.Answer.IsNullOrEmptyReturn0(), + + + }).OrderByDescending(x => x.Answer).FirstOrDefault(); + if (maxSuv == null || maxSuv.Answer == 0m) { return "NE"; } else { var orderMark = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.TargetLesion).FirstOrDefault()!.OrderMark; - return orderMark+ maxSuv.RowIndex.GetLesionMark(); + return orderMark + maxSuv.RowIndex.GetLesionMark(); } - + } #endregion @@ -3006,7 +3001,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // VisitTaskId=inDto.VisitTaskId, //}); - var existPet=await _dicomStudyRepository.Where(x => x.TrialId == inDto.TrialId && x.SubjectVisitId == inDto.SubjectVisitId).AnyAsync(x => x.Modalities.Contains("PT")); + var existPet = await _dicomStudyRepository.Where(x => x.TrialId == inDto.TrialId && x.SubjectVisitId == inDto.SubjectVisitId).AnyAsync(x => x.Modalities.Contains("PT")); return existPet ? ReadingYesOrNo.Yes.GetEnumInt() : ReadingYesOrNo.No.GetEnumInt(); } @@ -3042,143 +3037,143 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate return CalculationGetImgOncology(cTandMRIData, fDGPETData, lastFDGPETData); - } + } - /// - /// 计算整体肿瘤评估 【测试】 - /// - /// CT/MRI总体评估 - /// FDG-PET总体评估 - /// 上一次 FDG-PET总体评估 - /// - public string CalculationGetImgOncology(string? cTandMRIData,string? fDGPETData,string? lastFDGPETData) + /// + /// 计算整体肿瘤评估 【测试】 + /// + /// CT/MRI总体评估 + /// FDG-PET总体评估 + /// 上一次 FDG-PET总体评估 + /// + public string CalculationGetImgOncology(string? cTandMRIData, string? fDGPETData, string? lastFDGPETData) { - List data = new List() { + List data = new List() { //1、ND NE NE/NA ND new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.ND }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.ND }), + }, //2、ND/PD/CR/NE/PR/SD PMD PMD/CMR/PMR/NMR/NE/NA PMD/PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), - Column3=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), + Column3=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), + }, //3、ND/PD/CR/NE/PR/SD NE PMD PMD/PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), - Column2=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD}), + Column2=ReadingCommon.EnumToString(new List() {FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), + }, //4、PD NE CMR/PMR/NMR/NE/NA PMD/PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD}), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD}), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMDPD }), + }, //5、NE NE NE/NA NE new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NE }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NE }), + }, //6、CR、PR、SD、NE、ND、PD CMR CMR/PMR/NMR/PMD/NE/NA CMR/CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), + }, //7、CR NE NE/NA CMR/CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), + }, //8、CR、PR、SD、NE、ND NE CMR CMR/CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.CMR,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.CMRCR }), + }, //9、ND/PD/CR/NE/PR/SD PMR PMD/CMR/PMR/NMR/NE PMR/PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE,FDGPETOverallAssessment.NA, }), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND, CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR,FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE,FDGPETOverallAssessment.NA, }), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), + }, //10、PR NE NE/NA PMR/PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), + }, //11、CR/PR/SD/NE/ND NE PMR PMR/PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMR}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.PMRPR }), + }, //12、ND/PD/CR/NE/PR/SD NMR PMD/CMR/PMR/NMR/NE NMR/SD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR, FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND,CTMRIOverallAssessment.PD,CTMRIOverallAssessment.CR,CTMRIOverallAssessment.NE,CTMRIOverallAssessment.PR,CTMRIOverallAssessment.SD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.PMD, FDGPETOverallAssessment.CMR, FDGPETOverallAssessment.PMR, FDGPETOverallAssessment.NMR, FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), + }, //13、CR/PR/SD/ND/NE NE NMR NMR/SD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR, CTMRIOverallAssessment.PR, CTMRIOverallAssessment.SD, CTMRIOverallAssessment.ND, CTMRIOverallAssessment.NE }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), - }, + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR, CTMRIOverallAssessment.PR, CTMRIOverallAssessment.SD, CTMRIOverallAssessment.ND, CTMRIOverallAssessment.NE }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NMR}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), + }, //14、SD NE NE NMR/SD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), - Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), - Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), - }, - }; + Column1=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), + Column2=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { FDGPETOverallAssessment.NE, FDGPETOverallAssessment.NA,}), + Column4=ReadingCommon.EnumToString(new List() { ImagingOverallAssessment_Lugano.NMRSD }), + }, + }; - var resultdata = data.Where(x => - (x.NotEq.Contains(1) ? !x.Column1.Contains(cTandMRIData) : x.Column1.Contains(cTandMRIData) || x.Column1.Count() == 0) && - (x.NotEq.Contains(2) ? !x.Column2.Contains(fDGPETData) : x.Column2.Contains(fDGPETData) || x.Column2.Count() == 0) && - (x.NotEq.Contains(3) ? !x.Column3.Contains(lastFDGPETData) : x.Column3.Contains(lastFDGPETData) || x.Column3.Count() == 0)) - .Select(x => x.Column4.FirstOrDefault()) - .FirstOrDefault(); - return resultdata ?? string.Empty; - } + var resultdata = data.Where(x => + (x.NotEq.Contains(1) ? !x.Column1.Contains(cTandMRIData) : x.Column1.Contains(cTandMRIData) || x.Column1.Count() == 0) && + (x.NotEq.Contains(2) ? !x.Column2.Contains(fDGPETData) : x.Column2.Contains(fDGPETData) || x.Column2.Count() == 0) && + (x.NotEq.Contains(3) ? !x.Column3.Contains(lastFDGPETData) : x.Column3.Contains(lastFDGPETData) || x.Column3.Count() == 0)) + .Select(x => x.Column4.FirstOrDefault()) + .FirstOrDefault(); + return resultdata ?? string.Empty; + } - #endregion + #endregion - #region 获取基线脾脏长度 - /// - /// 获取基线脾脏长度 - /// - /// - /// - public async Task GetBaseLineSpleenLength(ReadingCalculateDto inDto) + #region 获取基线脾脏长度 + /// + /// 获取基线脾脏长度 + /// + /// + /// + public async Task GetBaseLineSpleenLength(ReadingCalculateDto inDto) { var baseLineTaskId = await GetBaseLineTaskId(inDto); @@ -3197,7 +3192,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetSplenoncusDiameterChange(ReadingCalculateDto inDto) { - + if (inDto.IsBaseLine) { return "NA"; @@ -3206,7 +3201,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineTaskId = await GetBaseLineTaskId(inDto); var presentSpleenLength = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var baseLineSpleenLength = (await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId == baseLineTaskId && x.ReadingQuestionTrial.QuestionType == QuestionType.SpleenLength).Select(x => x.Answer).FirstOrDefaultAsync()).IsNullOrEmptyReturn0(); - + return (presentSpleenLength - baseLineSpleenLength).ToString(); @@ -3251,7 +3246,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 当前访视淋巴结靶病灶的状态全部变为“消失” - eqCR = eqCR && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(TargetState.Loss)|| x.Answer.EqEnum(TargetState.TooSmall))); + eqCR = eqCR && item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.State && (x.Answer.EqEnum(TargetState.Loss) || x.Answer.EqEnum(TargetState.TooSmall))); } } // 1、与基线相比SPD变化的百分比 ≥50%,; @@ -3277,7 +3272,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (baseLineSPD > 0) { - eqPR = (presentSPD - baseLineSPD) / baseLineSPD <=- 0.5m; + eqPR = (presentSPD - baseLineSPD) / baseLineSPD <= -0.5m; } } @@ -3293,15 +3288,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { result = TargetAssessment.PD; } - + //当前访视存在至少一个状态为“不可评估”的靶病灶。 else if ( tableQuestions.Any(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(TargetState.UnableEvaluate))) { result = TargetAssessment.NE; } - //当前访视非淋巴结靶病灶全部消失 && (当前访视淋巴结靶病灶的状态全部变为“消失” 或者 "太小" ) - else if (eqCR) + //当前访视非淋巴结靶病灶全部消失 && (当前访视淋巴结靶病灶的状态全部变为“消失” 或者 "太小" ) + else if (eqCR) { result = TargetAssessment.CR; } @@ -3354,7 +3349,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NoTargetAssessment.NE; } //所有单个病灶/病灶组状态评估状态为“消失” - else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State)>0) + else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss)) == tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) > 0) { result = NoTargetAssessment.CR; } @@ -3408,7 +3403,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.Suspected; } - + else { result = NewLesionAssessment.No; @@ -3446,7 +3441,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 脾脏评估 var spleenEvaluation = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SplenicEvaluation).Select(x => x.Answer).FirstOrDefault(); - + return CalculationCTMRIEvaluation(targetEvaluation, noTargetEvaluation, existsNewTarget, liverEvaluation, spleenEvaluation); } @@ -3460,259 +3455,259 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// 脾脏评估 /// [HttpPost] - public string CalculationCTMRIEvaluation(string? targetEvaluation,string? noTargetEvaluation,string? existsNewTarget,string? liverEvaluation,string? spleenEvaluation) + public string CalculationCTMRIEvaluation(string? targetEvaluation, string? noTargetEvaluation, string? existsNewTarget, string? liverEvaluation, string? spleenEvaluation) { - List data = new List() { + List data = new List() { //ND ND 否/疑似 正常 正常 ND new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No, NewLesionAssessment.Suspected }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No, NewLesionAssessment.Suspected }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.ND }), + }, //PD 任一结果 任一结果 任一结果 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PD }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { }), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PD }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { }), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 PD 任一结果 任一结果 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), - Column3=ReadingCommon.EnumToString(new List() {}), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), + Column3=ReadingCommon.EnumToString(new List() {}), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 任一结果 是 任一结果 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 任一结果 任一结果 显著增大 任一结果 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //任一结果 任一结果 任一结果 任一结果 显著增大 PD new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() {}), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), - }, + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() {}), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PD }), + }, //CR CR/ND 否 正常 正常 CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR, NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR, NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), + }, //ND CR 否 正常 正常 CR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.CR }), + }, //NE 非PD 否/疑似/无法评估 非显著增大 非显著增大 NE new CalculationDto(){ - NotEq=new List(){ 2,4,5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.NE }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected, NewLesionAssessment.NE}), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 2,4,5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.NE }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PD }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected, NewLesionAssessment.NE}), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //ND NE 否/疑似/无法评估(不为是) 正常/稳定/无法评估/部分缓解(非显著增大) 正常/稳定/无法评估/部分缓解(非显著增大) NE new CalculationDto(){ - NotEq=new List(){ 3,4,5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 3,4,5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Yes }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //ND ND 无法评估 正常/稳定/无法评估/部分缓解(非显著增大) 正常/稳定/无法评估/部分缓解(非显著增大) NE new CalculationDto(){ - NotEq=new List(){ 4,5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 4,5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Increase }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //ND ND 否/疑似 无法评估 正常/稳定/无法评估/部分缓解(非显著增大) NE new CalculationDto(){ - NotEq=new List(){ 5}, - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.NotEvaluable }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + NotEq=new List(){ 5}, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.NotEvaluable }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Increase }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, // ND ND 否/疑似 正常/稳定 NE NE new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization }), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization }), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.NE }), + }, //1 PR CR或PR/SD或NE或ND 否/疑似/无法评估NE 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.PRSD,NoTargetAssessment.NE,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected,NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.PR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.PRSD,NoTargetAssessment.NE,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected,NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //2 CR (PR/SD)或者NE 否/疑似/无法评估 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PRSD,NoTargetAssessment.NE }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected ,NewLesionAssessment.NE}), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable}), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.PRSD,NoTargetAssessment.NE }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No,NewLesionAssessment.Suspected ,NewLesionAssessment.NE}), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable}), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //3 CR CR/ND 疑似/无法评估 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //4 CR CR/ND 否 稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, //5 CR CR/ND 否 正常 部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.CR }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR,NoTargetAssessment.ND }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission ,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, // 6 ND CR 疑似/无法评估 正常/稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), - Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.Suspected, NewLesionAssessment.NE }), + Column4=ReadingCommon.EnumToString(new List() { LiverAssessment.Normal,LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, // 7 ND CR 否 稳定/NE 正常/部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Stabilization,LiverAssessment.NotEvaluable}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Normal,SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, // 8 ND CR 否 正常 部分缓解/稳定/NE PR new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), - Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), - Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), - Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), - Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), - }, - new CalculationDto(){ - Column1=ReadingCommon.EnumToString(new List() { }), - Column2=ReadingCommon.EnumToString(new List() { }), - Column3=ReadingCommon.EnumToString(new List() { }), - Column4=ReadingCommon.EnumToString(new List() { }), - Column5=ReadingCommon.EnumToString(new List() { }), - Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), - }, - }; + Column1=ReadingCommon.EnumToString(new List() { TargetAssessment.ND }), + Column2=ReadingCommon.EnumToString(new List() { NoTargetAssessment.CR }), + Column3=ReadingCommon.EnumToString(new List() { NewLesionAssessment.No }), + Column4=ReadingCommon.EnumToString(new List() {LiverAssessment.Normal}), + Column5=ReadingCommon.EnumToString(new List() { SpleenAssessment.Remission,SpleenAssessment.Stabilization,SpleenAssessment.NotEvaluable }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.PR }), + }, + new CalculationDto(){ + Column1=ReadingCommon.EnumToString(new List() { }), + Column2=ReadingCommon.EnumToString(new List() { }), + Column3=ReadingCommon.EnumToString(new List() { }), + Column4=ReadingCommon.EnumToString(new List() { }), + Column5=ReadingCommon.EnumToString(new List() { }), + Column6=ReadingCommon.EnumToString(new List() { CTMRIOverallAssessment.SD }), + }, + }; - var index = data.FindIndex(x => - (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && - (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && - (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && - (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && - (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) - ; - var result = data.Where(x => - (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && - (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && - (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && - (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && - (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) - .Select(x => x.Column6.FirstOrDefault()) - .FirstOrDefault(); - return result ?? string.Empty; - } + var index = data.FindIndex(x => + (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && + (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && + (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && + (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && + (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) + ; + var result = data.Where(x => + (x.NotEq.Contains(1) ? !x.Column1.Contains(targetEvaluation) : x.Column1.Contains(targetEvaluation) || x.Column1.Count() == 0) && + (x.NotEq.Contains(2) ? !x.Column2.Contains(noTargetEvaluation) : x.Column2.Contains(noTargetEvaluation) || x.Column2.Count() == 0) && + (x.NotEq.Contains(3) ? !x.Column3.Contains(existsNewTarget) : x.Column3.Contains(existsNewTarget) || x.Column3.Count() == 0) && + (x.NotEq.Contains(4) ? !x.Column4.Contains(liverEvaluation) : x.Column4.Contains(liverEvaluation) || x.Column4.Count() == 0) && + (x.NotEq.Contains(5) ? !x.Column5.Contains(spleenEvaluation) : x.Column5.Contains(spleenEvaluation) || x.Column5.Count() == 0)) + .Select(x => x.Column6.FirstOrDefault()) + .FirstOrDefault(); + return result ?? string.Empty; + } - #endregion + #endregion - /// - /// 保留小数 - /// - /// - /// - /// - public string ReserveDecimal (decimal answer, int digitPlaces) + /// + /// 保留小数 + /// + /// + /// + /// + public string ReserveDecimal(decimal answer, int digitPlaces) { - return decimal.Round(answer, digitPlaces).ToString(); + return decimal.Round(answer, digitPlaces).ToString(); } #region 脾脏评估 - ///// - ///// 获取脾脏评估 - ///// - ///// - ///// - //public async Task GetSplenicEvaluation(ReadingCalculateDto inDto) - //{ + ///// + ///// 获取脾脏评估 + ///// + ///// + ///// + //public async Task GetSplenicEvaluation(ReadingCalculateDto inDto) + //{ - //} - #endregion + //} + #endregion - #endregion + #endregion } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs index e27fb4721..b026787e9 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/OCTCalculateService.cs @@ -1,17 +1,9 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using IRaCIS.Core.Infrastructure; -using MassTransit; -using System.Linq; -using System.Text; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -32,22 +24,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository, ILogger _logger) : BaseService, ICriterionCalculateService { - - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } - #region 临时对象 单个请求的生命周期 避免重复查询数据库 + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } - private List visitTaskAnswerList; + #region 临时对象 单个请求的生命周期 避免重复查询数据库 + + private List visitTaskAnswerList; /// /// 获取Sod的值 @@ -98,23 +90,23 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetReadingReportEvaluation(GetReadingReportEvaluationInDto indto) { GetReadingReportEvaluationOutDto result = new GetReadingReportEvaluationOutDto(); - var isConvertTask = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync(); - var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); - result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto() + var isConvertTask = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).Select(x => x.IsConvertedTask).FirstNotNullAsync(); + var visitTaskInfo = await _visitTaskRepository.Where(x => x.Id == indto.VisitTaskId).FirstNotNullAsync(); + result.CalculateResult = await this.GetReportVerify(new GetReportVerifyInDto() { VisitTaskId = indto.VisitTaskId, - IsConvertTask= isConvertTask, - BeforeConvertedTaskId =visitTaskInfo.BeforeConvertedTaskId, - }); + IsConvertTask = isConvertTask, + BeforeConvertedTaskId = visitTaskInfo.BeforeConvertedTaskId, + }); - - - result.ReadingTaskState = visitTaskInfo.ReadingTaskState; + + + result.ReadingTaskState = visitTaskInfo.ReadingTaskState; var taskInfoList = await _generalCalculateService.GetReadingReportTaskList(indto.VisitTaskId); result.VisitTaskList = taskInfoList; @@ -122,12 +114,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var visitTaskIds = taskInfoList.Select(x => x.VisitTaskId).ToList(); var criterionId = visitTaskInfo.TrialReadingCriterionId; - var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId&&x.ShowQuestion!= ShowQuestion.Hide) - .WhereIf(isConvertTask,x=>x.ConvertShowType==ConvertShowType.All||x.ConvertShowType==ConvertShowType.AfterShow) - .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) - .ToListAsync(); + var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide) + .WhereIf(isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.AfterShow) + .WhereIf(!isConvertTask, x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow) + .ToListAsync(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); - var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto { @@ -135,7 +127,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Count = x.ToList().Count() }).ToList(); - var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() + var lesionsIndexs = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).GroupBy(x => new { x.QuestionId }).Select(x => new lesionsIndexDto() { QuestionId = x.Key.QuestionId, Rowindexs = x.Select(x => x.RowIndex).Distinct().OrderBy(x => x).ToList() @@ -144,14 +136,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); - var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new - { - x.TaskId, - x.GlobalVisitTask.VisitTaskNum, - x.QuestionId, - x.Answer - }).ToListAsync(); - var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new + { + x.TaskId, + x.GlobalVisitTask.VisitTaskNum, + x.QuestionId, + x.Answer + }).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); @@ -168,10 +160,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, + GroupId = x.GroupId, QuestionType = x.QuestionType, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -182,8 +174,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, - ReportLayType= ReportLayType.Group, + CustomUnit = x.CustomUnit, + ReportLayType = ReportLayType.Group, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, }).ToList(); @@ -191,12 +183,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 分组 foreach (var item in questions) { - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -209,7 +201,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -221,17 +213,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { - var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); - var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answer==null?string.Empty:answer.Answer, - IsGlobalChange = globalAnswer == null ? false : true, - GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, - TaskName = task.TaskName, + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = globalAnswer == null ? false : true, + GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, + TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, - + }); } @@ -260,8 +252,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty, ReportLayType = ReportLayType.Lesions, ReportMark = rowinfo != null ? rowinfo.ReportMark : string.Empty, - - }) ; + + }); } @@ -276,7 +268,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Type = x.Type, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, - RowId=row.RowId, + RowId = row.RowId, IsShowInDicom = question.IsShowInDicom, DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, @@ -313,13 +305,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate switch (tableQuestion.QuestionMark) { case QuestionMark.Organ: - taskQuestionAnswer.Answer= organInfo.TULOCEN; + taskQuestionAnswer.Answer = organInfo.TULOCEN; break; case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -330,7 +322,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Part: taskQuestionAnswer.Answer = organInfo.PartEN; - + break; } @@ -346,7 +338,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -407,7 +399,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { await ReadingCalculate(readingData, new List() { type.Value }); } - + } @@ -432,9 +424,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new GetReportVerifyOutDto() + return new GetReportVerifyOutDto() { - TumorEvaluate =string.Empty, + TumorEvaluate = string.Empty, IsExistDisease = string.Empty, }; @@ -585,7 +577,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetAllMinFCT(ReadingCalculateDto inDto) { - + var allMinFCT = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.FCT).SelectMany(x => x.TableRowInfoList).SelectMany(x => x.TableQuestionList) .Where(x => x.QuestionMark == QuestionMark.MinFCT).Select(x => x.Answer.IsNullOrEmptyReturn0()).MinOrDefault(); if (allMinFCT == 0) @@ -608,7 +600,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return null; } - return allMinFCT.Average();; + return allMinFCT.Average(); ; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs index d390359c2..9aa5061e7 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/PCWG3CalculateService.cs @@ -1,15 +1,10 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; - using IRaCIS.Core.Infrastructure; using MassTransit; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -30,33 +25,33 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository) : BaseService, ICriterionCalculateService { - + private List siteVisitForTumorList; - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } - #region 删除病灶获取起始病灶序号 - /// - /// 删除病灶获取起始病灶序号 - /// - /// - public async Task GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto) + #region 删除病灶获取起始病灶序号 + /// + /// 删除病灶获取起始病灶序号 + /// + /// + public async Task GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto) { var rowInfo = await _readingTableAnswerRowInfoRepository.Where(x => x.Id == inDto.RowId).Include(x => x.ReadingQuestionTrial).FirstNotNullAsync(); if (rowInfo.ReadingQuestionTrial.LesionType == LesionType.NewLesions) { - var minIndex= await _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == rowInfo.QuestionId && x.VisitTaskId == inDto.VisitTaskId).OrderBy(x => x.RowIndex).Select(x=>x.RowIndex).FirstOrDefaultAsync(); + var minIndex = await _readingTableAnswerRowInfoRepository.Where(x => x.QuestionId == rowInfo.QuestionId && x.VisitTaskId == inDto.VisitTaskId).OrderBy(x => x.RowIndex).Select(x => x.RowIndex).FirstOrDefaultAsync(); return (int)minIndex; } else @@ -64,7 +59,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate return 1; } - + } #endregion @@ -98,7 +93,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var criterionId = visitTaskInfo.TrialReadingCriterionId; var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide) //.Where(x => x.LesionType != LesionType.BaselineLesions) - .Where(x=>x.QuestionType!=QuestionType.TherapeuticEffectEvaluationGroup) + .Where(x => x.QuestionType != QuestionType.TherapeuticEffectEvaluationGroup) .ToListAsync(); // 新病灶 @@ -107,7 +102,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)) - .Where(x => x.ReadingQuestionTrialId != questionNewLesions.Id||x.VisitTaskId== visitTaskInfo.Id) + .Where(x => x.ReadingQuestionTrialId != questionNewLesions.Id || x.VisitTaskId == visitTaskInfo.Id) .ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)) .Where(x => x.QuestionId != questionNewLesions.Id || x.VisitTaskId == visitTaskInfo.Id) @@ -133,10 +128,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, + GroupId = x.GroupId, QuestionType = x.QuestionType, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -146,9 +141,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), ShowOrder = x.ShowOrder, ValueType = x.ValueType, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, Unit = x.Unit, - ReportLayType=ReportLayType.Group, + ReportLayType = ReportLayType.Group, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, }).ToList(); @@ -157,10 +152,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var item in questions) { // 问题 - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), @@ -175,7 +170,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -206,7 +201,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var rowlist = tableAnsweRowInfos.Where(x => x.QuestionId == question.QuestionId).OrderBy(x => x.RowIndex).ToList(); - question.Childrens = rowlist.OrderBy(x=>x.RowIndex).Select(x => new ReadingReportDto() + question.Childrens = rowlist.OrderBy(x => x.RowIndex).Select(x => new ReadingReportDto() { QuestionName = question.OrderMark + x.RowIndex.GetLesionMark(), SplitOrMergeLesionName = x.MergeName.IsNullOrEmpty() ? x.SplitName : x.MergeName, @@ -215,9 +210,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IsCanEditPosition = x.IsCanEditPosition, RowIndex = x.RowIndex, BlindName = x.BlindName, - RowId =x.Id, + RowId = x.Id, ReportLayType = ReportLayType.Lesions, - FristAddTaskNum= x.FristAddTaskNum, + FristAddTaskNum = x.FristAddTaskNum, }).ToList(); @@ -240,10 +235,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate RowIndex = row.RowIndex, ShowOrder = x.ShowOrder, ValueType = x.ValueType, - RowId=row.RowId, + RowId = row.RowId, Unit = x.Unit, ReportLayType = ReportLayType.TableQuestion, - FristAddTaskNum= row.FristAddTaskNum, + FristAddTaskNum = row.FristAddTaskNum, }).ToList(); @@ -366,7 +361,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId && x.IsAnalysisCreate == taskinfo.IsAnalysisCreate && - x.DoctorUserId ==taskinfo.DoctorUserId && + x.DoctorUserId == taskinfo.DoctorUserId && x.IsSelfAnalysis == taskinfo.IsSelfAnalysis && x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum ).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync(); @@ -402,7 +397,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { x.SplitRowId = tableRowAnswers.Where(y => y.OriginalId == x.SplitRowId).Select(y => y.Id).FirstOrDefault(); x.MergeRowId = tableRowAnswers.Where(y => y.OriginalId == x.MergeRowId).Select(y => y.Id).FirstOrDefault(); - + }); List notNeedCopyMarks = new List() @@ -428,13 +423,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { // 新病灶外层问题 var newLesionQuestion = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.NewLesions && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync(); - + // 既往病灶外层问题 var alwaysNewLesionsQuestion = await _readingQuestionTrialRepository.Where(x => x.LesionType == LesionType.AlwaysNewLesions && x.ReadingQuestionCriterionTrialId == taskinfo.TrialReadingCriterionId).FirstNotNullAsync(); - + // 新病灶表格问题 var newLesionTableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == newLesionQuestion.Id).ToListAsync(); - + // 既往病灶表格问题 var alwaysNewLesionsTableQuestions = await _readingTableQuestionTrialRepository.Where(x => x.ReadingQuestionId == alwaysNewLesionsQuestion.Id).ToListAsync(); @@ -449,17 +444,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ); }); - foreach (var item in tableRowAnswers.Where(x => x.QuestionId == newLesionQuestion.Id).OrderBy(x=>x.RowIndex)) + foreach (var item in tableRowAnswers.Where(x => x.QuestionId == newLesionQuestion.Id).OrderBy(x => x.RowIndex)) { - + item.QuestionId = alwaysNewLesionsQuestion.Id; - + foreach (var tableAnswer in tableAnswers.Where(y => y.RowId == item.Id)) { tableAnswer.QuestionId = alwaysNewLesionsQuestion.Id; tableAnswer.TableQuestionId = alwaysTableQuestionIdDic[tableAnswer.TableQuestionId]; - + } } @@ -470,7 +465,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate throw new BusinessValidationFailedException(_localizer["ReadingCalculate_Abnormal"]); } - + var addList = _mapper.Map>(tableRowAnswers); @@ -558,7 +553,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate calculateList = calculateList.Where(x => calculateType.Contains(x.QuestionType)).ToList(); } - + foreach (var calculate in calculateList) { @@ -572,7 +567,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate #region 计算答案 - + switch (calculate.QuestionType) { @@ -581,7 +576,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate break; case QuestionType.NewLesionsCount: - + if (inDto.VisitTaskNum >= 1) { item.Answer = (await calculate.GetIntFun(inDto)).ToString(); @@ -592,7 +587,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } break; case QuestionType.AlwaysNewLesionsCount: - if (inDto.VisitTaskNum >1) + if (inDto.VisitTaskNum > 1) { item.Answer = (await calculate.GetIntFun(inDto)).ToString(); } @@ -606,9 +601,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate item.Answer = (await calculate.GetIntFun(inDto)).ToString(); - if (item.Answer=="-1") + if (item.Answer == "-1") { - item.Answer = nameof(YesOrNoOrNa.NA); + item.Answer = nameof(YesOrNoOrNa.NA); } break; case QuestionType.DaysBetween: @@ -618,7 +613,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate item.Answer = await calculate.GetStringFun(inDto); break; default: - item.Answer =string.Empty; + item.Answer = string.Empty; break; } @@ -635,13 +630,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (valueOfTypes.Contains(item.ValueType)) { - item.Answer = decimal.Round(decimal.Parse(item.Answer.IsNullOrEmpty() ? "0": item.Answer), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString()); + item.Answer = decimal.Round(decimal.Parse(item.Answer.IsNullOrEmpty() ? "0" : item.Answer), inDto.DigitPlaces).ToString("F" + inDto.DigitPlaces.ToString()); } } catch (Exception) { - + } needAddList.Add(new ReadingTaskQuestionAnswer() { @@ -701,12 +696,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate .Sum(x => x.TableQuestionList.Where(y => y.QuestionMark == QuestionMark.LesionNumber).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0())); } - catch + catch { return 0; } - + } #endregion @@ -720,7 +715,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetNewLesionsCount(ReadingCalculateDto inDto) { return inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList) - .Where(x=>x.TableQuestionList.Any(y=>y.QuestionMark==QuestionMark.State&&y.Answer== EvaluationOfState.Exists.GetEnumInt())) + .Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt())) .Count(); } @@ -756,7 +751,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var result = 0; var findindex = taskList.OrderBy(x => x.VisitTaskNum).ToList().FindIndex(x => x.VisitTaskId == inDto.VisitTaskId); - + if (findindex < 3) { return -1; @@ -769,12 +764,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = inDto.QuestionInfo.Where(x => x.LesionType == LesionType.AlwaysNewLesions).SelectMany(x => x.TableRowInfoList) .Where(x => x.FristAddTaskNum >= twoindex.VisitTaskNum && x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt())).Count(); - //+ inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList) - // .Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt())) - // .Count(); + //+ inDto.QuestionInfo.Where(x => x.LesionType == LesionType.NewLesions).SelectMany(x => x.TableRowInfoList) + // .Where(x => x.TableQuestionList.Any(y => y.QuestionMark == QuestionMark.State && y.Answer == EvaluationOfState.Exists.GetEnumInt())) + // .Count(); } - - + + return result; @@ -797,11 +792,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); var taskList = await GetSiteVisitForTumorList(inDto); - var lastTask = taskList.Where(x => x.VisitTaskNum < taskinfo.VisitTaskNum&&x.VisitTaskId!=inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var lastTask = taskList.Where(x => x.VisitTaskNum < taskinfo.VisitTaskNum && x.VisitTaskId != inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); if (lastTask != null) { var thisTask = taskList.FirstOrDefault(); - if (thisTask!=null&& thisTask.StudyTime != null && lastTask.StudyTime != null) + if (thisTask != null && thisTask.StudyTime != null && lastTask.StudyTime != null) { return (int)Math.Floor((thisTask.StudyTime.Value - lastTask.StudyTime.Value).TotalDays); } @@ -810,7 +805,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate return -1; } - + } else { @@ -830,7 +825,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// public async Task GetSiteVisitForTumorEvaluation(ReadingCalculateDto inDto) { - if(inDto.IsBaseLine) + if (inDto.IsBaseLine) { return VisitTumorEvaluation.NA.GetEnumInt(); } @@ -840,7 +835,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { return string.Empty; } - var isPD= await ChangeLastTaskSiteVisitForTumorEvaluation(inDto); + var isPD = await ChangeLastTaskSiteVisitForTumorEvaluation(inDto); var newLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var baseLineLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.BaseLineLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); var alwaysNewLesionsCount = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.AlwaysNewLesionsCount).Select(x => x.Answer).FirstOrDefault().IsNullOrEmptyReturn0(); @@ -848,7 +843,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (isPD) { return VisitTumorEvaluation.PD.GetEnumInt(); - }else if (newLesionsCount == 0 && + } + else if (newLesionsCount == 0 && baseLineLesionsCount == 0 && alwaysNewLesionsCount == 0) { @@ -868,8 +864,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task ChangeLastTaskSiteVisitForTumorEvaluation(ReadingCalculateDto inDto) { var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); - var taskList =await GetSiteVisitForTumorList(inDto); - var lastTask = taskList.Where(x => x.VisitTaskNum < taskinfo.VisitTaskNum&&x.VisitTaskId!=inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var taskList = await GetSiteVisitForTumorList(inDto); + var lastTask = taskList.Where(x => x.VisitTaskNum < taskinfo.VisitTaskNum && x.VisitTaskId != inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); var baseLineTask = taskList.OrderBy(x => x.VisitTaskNum).FirstOrDefault(); var newLesionsCountQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.NewLesionsCount).Select(x => x.QuestionId).FirstOrDefault(); @@ -884,7 +880,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var firstVisit = taskList.FirstOrDefault(); - if (baseLineTask!=null&&baseLineTask.StudyTime != null) + if (baseLineTask != null && baseLineTask.StudyTime != null) { //基线后第二个访视(应满足访视间隔6周以上,否则顺延) var secondVisit = taskList.Where(x => x.VisitTaskNum >= 2 && x.StudyTime >= baseLineTask.StudyTime.Value.AddDays(42)).FirstOrDefault(); @@ -920,22 +916,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var thisVisitTask = taskList.LastOrDefault(); - if (thisVisitTask!=null &&thisVisitTask.StudyTime!=null&&lastTask.StudyTime!=null&& - - + if (thisVisitTask != null && thisVisitTask.StudyTime != null && lastTask.StudyTime != null && + + lastTasknewLesionsCount >= 2 && thisVisitTaskNewLesionsCount >= 2 && lastTask.StudyTime.Value.AddDays(42) <= thisVisitTask.StudyTime) { isPDResult = true; } } } - + } if (isPDResult) { var visitForTumorEvaluationQuestionId = inDto.QuestionInfo.Where(x => x.QuestionType == QuestionType.SiteVisitForTumorEvaluation).Select(x => x.QuestionId).FirstOrDefault(); - - if(lastTask!=null) + + if (lastTask != null) { await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == lastTask.VisitTaskId && x.ReadingQuestionTrialId == visitForTumorEvaluationQuestionId, x => new ReadingTaskQuestionAnswer { @@ -964,14 +960,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var taskinfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).FirstNotNullAsync(); siteVisitForTumorList = await _visitTaskRepository.Where(x => (x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId && - x.DoctorUserId== taskinfo.DoctorUserId&& - x.IsAnalysisCreate==inDto.IsAnalysisCreate&& + x.DoctorUserId == taskinfo.DoctorUserId && + x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum <= taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum - )||x.Id== inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).Select(x => new SiteVisitForTumor() + ) || x.Id == inDto.VisitTaskId).OrderByDescending(x => x.VisitTaskNum).Select(x => new SiteVisitForTumor() { VisitTaskId = x.Id, VisitTaskNum = x.VisitTaskNum, - SubjectVisitId=x.SourceSubjectVisitId, + SubjectVisitId = x.SourceSubjectVisitId, }).ToListAsync(); var visitIds = siteVisitForTumorList.Select(x => x.SubjectVisitId).ToList(); @@ -984,9 +980,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }).ToListAsync(); visitStudies.AddRange( - await _noneDicomStudyRepository.Where(x => visitIds.Contains(x.SubjectVisitId)&&x.Modality== "BoneScan").Select(x => new VisitStudyTime() { - SubjectVisitId = x.SubjectVisitId, - StudyTime = x.ImageDate + await _noneDicomStudyRepository.Where(x => visitIds.Contains(x.SubjectVisitId) && x.Modality == "BoneScan").Select(x => new VisitStudyTime() + { + SubjectVisitId = x.SubjectVisitId, + StudyTime = x.ImageDate }).ToListAsync() ); @@ -1008,8 +1005,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new GetReportVerifyOutDto() { - + return new GetReportVerifyOutDto() + { + }; } @@ -1037,7 +1035,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate string errorMassage = string.Empty; - var rowAnswerList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId &&x.ReadingQuestionTrial.LesionType!=LesionType.BaselineLesions&& (x.MeasureData == string.Empty || x.MeasureData == null)) + var rowAnswerList = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == inDto.VisitTaskId && x.ReadingQuestionTrial.LesionType != LesionType.BaselineLesions && (x.MeasureData == string.Empty || x.MeasureData == null)) .Select(x => new { x.ReadingQuestionTrial.OrderMark, @@ -1065,7 +1063,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (measureDataList.Count() > 0) { - errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)]+","; + errorMassage += _localizer["ReadingCalculate_NoMarker", string.Join(',', measureDataList)] + ","; } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs index 4d9ab1931..256fe8a4c 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1CalculateService.cs @@ -1,15 +1,10 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; - using IRaCIS.Core.Infrastructure; using MassTransit; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -30,22 +25,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository) : BaseService, ICriterionCalculateService { - - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } - #region 临时对象 单个请求的生命周期 避免重复查询数据库 + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } - private List visitTaskAnswerList; + #region 临时对象 单个请求的生命周期 避免重复查询数据库 + + private List visitTaskAnswerList; /// /// 获取Sod的值 @@ -96,21 +91,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var questionList = await _readingQuestionTrialRepository.Where(x => x.ReadingQuestionCriterionTrialId == criterionId && x.ShowQuestion != ShowQuestion.Hide).ToListAsync(); var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == criterionId).OrderBy(x => x.ShowOrder).ToListAsync(); var tableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == indto.VisitTaskId).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); - result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto - { - LesionType = x.Key!.Value, - Count = x.ToList().Count() - }).ToList(); - var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + result.LesionCountList = tableAnsweRowInfos.GroupBy(x => x.LesionType).Select(x => new LesionDto + { + LesionType = x.Key!.Value, + Count = x.ToList().Count() + }).ToList(); + var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); - var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new - { - x.TaskId, - x.GlobalVisitTask.VisitTaskNum, - x.QuestionId, - x.Answer - }).ToListAsync(); - var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new + { + x.TaskId, + x.GlobalVisitTask.VisitTaskNum, + x.QuestionId, + x.Answer + }).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); @@ -127,10 +122,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, + GroupId = x.GroupId, QuestionType = x.QuestionType, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -141,21 +136,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, - ReportLayType= ReportLayType.Group, - HighlightAnswer=x.HighlightAnswer, - HighlightAnswerList=x.HighlightAnswerList, + CustomUnit = x.CustomUnit, + ReportLayType = ReportLayType.Group, + HighlightAnswer = x.HighlightAnswer, + HighlightAnswerList = x.HighlightAnswerList, }).ToList(); // 分组 foreach (var item in questions) { - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -168,7 +163,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -180,17 +175,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { - var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); - var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answer==null?string.Empty:answer.Answer, - IsGlobalChange = globalAnswer == null ? false : true, - GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, - TaskName = task.TaskName, + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = globalAnswer == null ? false : true, + GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, + TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, - + }); } @@ -225,7 +220,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Type = x.Type, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, - RowId=row.RowId, + RowId = row.RowId, IsShowInDicom = question.IsShowInDicom, DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, @@ -262,13 +257,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate switch (tableQuestion.QuestionMark) { case QuestionMark.Organ: - taskQuestionAnswer.Answer= organInfo.TULOCEN; + taskQuestionAnswer.Answer = organInfo.TULOCEN; break; case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -279,7 +274,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Part: taskQuestionAnswer.Answer = organInfo.PartEN; - + break; } @@ -295,7 +290,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -345,7 +340,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task TestCalculate(Guid visitTaskId, QuestionType type) { ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId); - await ReadingCalculate(readingData,new List() { type}); + await ReadingCalculate(readingData, new List() { type }); } @@ -385,7 +380,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task ReadingCalculate(ReadingCalculateDto inDto,List? calculateType=null) + public async Task ReadingCalculate(ReadingCalculateDto inDto, List? calculateType = null) { #region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果 @@ -458,7 +453,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList(); - var isNeedDeleteIds = inDto.QuestionInfo.Where(x =>x.QuestionType!=null&& isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList(); + var isNeedDeleteIds = inDto.QuestionInfo.Where(x => x.QuestionType != null && isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList(); await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && isNeedDeleteIds.Contains(x.ReadingQuestionTrialId), x => new ReadingTaskQuestionAnswer { @@ -470,7 +465,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList(); - + } @@ -524,7 +519,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate else { - item.Answer = value==null?string.Empty: value.Value.ToString(); + item.Answer = value == null ? string.Empty : value.Value.ToString(); } } else if (calculate.GetStringFun != null) @@ -556,7 +551,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - + needAddList.Add(new ReadingTaskQuestionAnswer() @@ -692,7 +687,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - + #region 将上一次的访视病灶添加到这一次 @@ -718,9 +713,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId && - x.IsAnalysisCreate== taskinfo.IsAnalysisCreate&& + x.IsAnalysisCreate == taskinfo.IsAnalysisCreate && x.DoctorUserId == taskinfo.DoctorUserId && - x.IsSelfAnalysis== taskinfo.IsSelfAnalysis && + x.IsSelfAnalysis == taskinfo.IsSelfAnalysis && x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum ).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync(); @@ -748,7 +743,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.SeriesId = null; x.InstanceId = null; x.MeasureData = string.Empty; - x.PicturePath= string.Empty; + x.PicturePath = string.Empty; }); tableRowAnswers.ForEach(x => @@ -778,20 +773,20 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }); - - var addList= _mapper.Map>(tableRowAnswers); - + + var addList = _mapper.Map>(tableRowAnswers); + await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); - addList.ForEach(x => - { - x.MergeRow = null; - x.SplitRow = null; + addList.ForEach(x => + { + x.MergeRow = null; + x.SplitRow = null; - }); - await _readingTableQuestionAnswerRepository.SaveChangesAsync(); + }); + await _readingTableQuestionAnswerRepository.SaveChangesAsync(); } } @@ -1224,7 +1219,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { // 找到所有访视任务的Id - var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate && + var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == inDto.calculateDto.TrialReadingCriterionId && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == inDto.calculateDto.ArmEnum).Select(x => x.Id).ToListAsync(); @@ -1267,7 +1262,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// private async Task GetBaseLineSOD(ReadingCalculateDto inDto) { - if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate==inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum)) + if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum)) { return 0; } @@ -1276,9 +1271,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && - x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect && + x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect && x.IsAnalysisCreate == inDto.IsAnalysisCreate - &&x.DoctorUserId==inDto.DoctorUserId + && x.DoctorUserId == inDto.DoctorUserId && x.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ArmEnum == inDto.ArmEnum) .Select(x => x.Id).FirstOrDefaultAsync(); @@ -1328,7 +1323,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate visitTaskAnswerList = await _readingTaskQuestionAnswerRepository.Where(x => x.VisitTaskId != inDto.VisitTaskId && x.VisitTask.ReadingCategory == ReadingCategory.Visit && x.VisitTask.IsAnalysisCreate == inDto.IsAnalysisCreate && x.VisitTask.IsSelfAnalysis == inDto.IsSelfAnalysis - &&x.VisitTask.VisitTaskNum new VisitTaskAnswerInfo @@ -1347,7 +1342,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate visitTaskAnswerList.Add(new VisitTaskAnswerInfo() { VisitTaskId = inDto.VisitTaskId, - BlindName=inDto.TaskBlindName, + BlindName = inDto.TaskBlindName, QuestionId = visitTaskAnswerList[0].QuestionId, VisitName = inDto.VisitName, SOD = (await GetSODData(inDto)).ToString().IsNullOrEmptyReturn0(), @@ -1379,7 +1374,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.TaskState == TaskState.Effect && x.IsAnalysisCreate == inDto.IsAnalysisCreate - && x.SourceSubjectVisitId == lastVisitId && x.ArmEnum==inDto.ArmEnum).Select(x => x.Id).FirstOrDefaultAsync(); + && x.SourceSubjectVisitId == lastVisitId && x.ArmEnum == inDto.ArmEnum).Select(x => x.Id).FirstOrDefaultAsync(); return LastVisitTaskId; } @@ -1535,7 +1530,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 淋巴结非靶病灶状态全部为消失 - resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss&& item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault()== NoTargetState.Loss.GetEnumInt(); + resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss && item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault() == NoTargetState.Loss.GetEnumInt(); } } @@ -1545,10 +1540,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 淋巴结的短径 - resultData.DiameterLessThan10 = resultData.DiameterLessThan10&&(item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10; + resultData.DiameterLessThan10 = resultData.DiameterLessThan10 && (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10; var shortIsBigger10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() >= 10; - resultData.CurrenShortBigger10= resultData.CurrenShortBigger10|| shortIsBigger10; + resultData.CurrenShortBigger10 = resultData.CurrenShortBigger10 || shortIsBigger10; if (shortIsBigger10) { @@ -1561,7 +1556,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 当前访视点非淋巴结病灶至少一个非淋巴结靶病灶的长径 - resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0|| (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0; + resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0 || (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0; } } @@ -1626,7 +1621,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { //if (当前访视点淋巴结病灶,至少一个淋巴结靶病灶短径≥10 mm 并且该淋巴结靶病灶短径绝对增加值≥5 mm) // 换句话说 就是 短径≥10 的病灶 和 短径增加值≥5的病灶 的交集数量大于0 - if (resultData.ShortBigger10Indexs.Intersect(resultData.AddFiveIndexs).ToList().Count()>0) + if (resultData.ShortBigger10Indexs.Intersect(resultData.AddFiveIndexs).ToList().Count() > 0) { //靶病灶疗效为 PD result = TargetAssessment.PD; @@ -1740,11 +1735,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NoTargetAssessment.NN; } //所有单个病灶/病灶组状态评估状态为“消失” - else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State)>0) + else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss)) == tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) > 0) { result = NoTargetAssessment.CR; } - + // 基线时没有非靶病灶 else if (tableQuestions.Count() == 0) { @@ -1800,7 +1795,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.Suspected; } - + else { result = NewLesionAssessment.No; diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs index 9cf6d2df6..32ae2662f 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/RECIST1Point1_BMCalculateService.cs @@ -1,15 +1,10 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; - using IRaCIS.Core.Infrastructure; using MassTransit; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -30,22 +25,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository) : BaseService, ICriterionCalculateService { - - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } - #region 临时对象 单个请求的生命周期 避免重复查询数据库 + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } - private List visitTaskAnswerList; + #region 临时对象 单个请求的生命周期 避免重复查询数据库 + + private List visitTaskAnswerList; /// /// 获取Sod的值 @@ -99,14 +94,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); - var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new - { - x.TaskId, - x.GlobalVisitTask.VisitTaskNum, - x.QuestionId, - x.Answer - }).ToListAsync(); - var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new + { + x.TaskId, + x.GlobalVisitTask.VisitTaskNum, + x.QuestionId, + x.Answer + }).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); @@ -123,10 +118,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { QuestionId = x.Id, GroupName = x.GroupName, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, + GroupId = x.GroupId, QuestionType = x.QuestionType, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -137,8 +132,8 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, - ReportLayType= ReportLayType.Group, + CustomUnit = x.CustomUnit, + ReportLayType = ReportLayType.Group, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, }).ToList(); @@ -146,12 +141,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 分组 foreach (var item in questions) { - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName, QuestionId = x.Id, IsShowInDicom = x.IsShowInDicom, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, @@ -164,7 +159,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -176,17 +171,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { - var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); - var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { - Answer = answer==null?string.Empty:answer.Answer, - IsGlobalChange = globalAnswer == null ? false : true, - GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, - TaskName = task.TaskName, + Answer = answer == null ? string.Empty : answer.Answer, + IsGlobalChange = globalAnswer == null ? false : true, + GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, + TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, - + }); } @@ -221,7 +216,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate Type = x.Type, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, - RowId=row.RowId, + RowId = row.RowId, IsShowInDicom = question.IsShowInDicom, DataSource = x.DataSource, DictionaryCode = x.DictionaryCode, @@ -258,13 +253,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate switch (tableQuestion.QuestionMark) { case QuestionMark.Organ: - taskQuestionAnswer.Answer= organInfo.TULOCEN; + taskQuestionAnswer.Answer = organInfo.TULOCEN; break; case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -275,7 +270,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Part: taskQuestionAnswer.Answer = organInfo.PartEN; - + break; } @@ -291,7 +286,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate case QuestionMark.Location: if (organInfo.IsCanEditPosition) { - + } else { @@ -341,7 +336,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate public async Task TestCalculate(Guid visitTaskId, QuestionType type) { ReadingCalculateDto readingData = await _generalCalculateService.GetReadingCalculateDto(visitTaskId); - await ReadingCalculate(readingData,new List() { type}); + await ReadingCalculate(readingData, new List() { type }); } @@ -381,7 +376,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// /// /// - public async Task ReadingCalculate(ReadingCalculateDto inDto,List? calculateType=null) + public async Task ReadingCalculate(ReadingCalculateDto inDto, List? calculateType = null) { #region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果 @@ -454,7 +449,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var isNeedDeleteTypes = calculateList.Where(x => !questionTypes.Contains(x.QuestionType)).Select(x => x.QuestionType).ToList(); - var isNeedDeleteIds = inDto.QuestionInfo.Where(x =>x.QuestionType!=null&& isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList(); + var isNeedDeleteIds = inDto.QuestionInfo.Where(x => x.QuestionType != null && isNeedDeleteTypes.Contains(x.QuestionType.Value)).Select(x => x.QuestionId).ToList(); await _readingTaskQuestionAnswerRepository.BatchUpdateNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId && isNeedDeleteIds.Contains(x.ReadingQuestionTrialId), x => new ReadingTaskQuestionAnswer { @@ -466,7 +461,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate calculateList = calculateList.Where(x => questionTypes.Contains(x.QuestionType)).ToList(); - + } @@ -520,7 +515,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate else { - item.Answer = value==null?string.Empty: value.ToString(); + item.Answer = value == null ? string.Empty : value.ToString(); } } else if (calculate.GetStringFun != null) @@ -552,7 +547,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } } - + needAddList.Add(new ReadingTaskQuestionAnswer() @@ -698,7 +693,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate } - + #region 将上一次的访视病灶添加到这一次 @@ -724,9 +719,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var LastVisitTaskId = await _visitTaskRepository.Where(x => x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == taskinfo.TrialReadingCriterionId && - x.IsAnalysisCreate== taskinfo.IsAnalysisCreate&& + x.IsAnalysisCreate == taskinfo.IsAnalysisCreate && x.DoctorUserId == taskinfo.DoctorUserId && - x.IsSelfAnalysis== taskinfo.IsSelfAnalysis && + x.IsSelfAnalysis == taskinfo.IsSelfAnalysis && x.SubjectId == taskinfo.SubjectId && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.VisitTaskNum < taskinfo.VisitTaskNum && x.TaskState == TaskState.Effect && x.ArmEnum == taskinfo.ArmEnum ).OrderByDescending(x => x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync(); @@ -754,7 +749,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.SeriesId = null; x.InstanceId = null; x.MeasureData = string.Empty; - x.PicturePath= string.Empty; + x.PicturePath = string.Empty; }); tableRowAnswers.ForEach(x => @@ -784,10 +779,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }); - - var addList= _mapper.Map>(tableRowAnswers); - + + var addList = _mapper.Map>(tableRowAnswers); + await _readingTableAnswerRowInfoRepository.AddRangeAsync(addList); await _readingTableQuestionAnswerRepository.AddRangeAsync(tableAnswers); await _readingTableQuestionAnswerRepository.SaveChangesAsync(); @@ -1223,7 +1218,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { // 找到所有访视任务的Id - var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate && + var visitTaskIds = await _visitTaskRepository.Where(x => x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == inDto.calculateDto.TrialReadingCriterionId && x.TaskState == TaskState.Effect && x.ReadingTaskState == ReadingTaskState.HaveSigned && x.ArmEnum == inDto.calculateDto.ArmEnum).Select(x => x.Id).ToListAsync(); @@ -1266,7 +1261,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate /// private async Task GetBaseLineSOD(ReadingCalculateDto inDto) { - if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate==inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum)) + if (await _visitTaskRepository.AnyAsync(x => x.Id == inDto.VisitTaskId && x.SourceSubjectVisit.IsBaseLine && x.IsAnalysisCreate == inDto.IsAnalysisCreate && x.ArmEnum == inDto.ArmEnum)) { return 0; } @@ -1275,9 +1270,9 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var baseLineTaskId = await _visitTaskRepository.Where(x => x.SubjectId == inDto.SubjectId && x.ReadingCategory == ReadingCategory.Visit && x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && - x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect && + x.SourceSubjectVisit.IsBaseLine && x.TaskState == TaskState.Effect && x.IsAnalysisCreate == inDto.IsAnalysisCreate - &&x.DoctorUserId==inDto.DoctorUserId + && x.DoctorUserId == inDto.DoctorUserId && x.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ArmEnum == inDto.ArmEnum) .Select(x => x.Id).FirstOrDefaultAsync(); @@ -1328,7 +1323,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate && x.VisitTask.IsAnalysisCreate == inDto.IsAnalysisCreate && x.VisitTask.IsSelfAnalysis == inDto.IsSelfAnalysis && x.ReadingQuestionCriterionTrialId == inDto.TrialReadingCriterionId - && x.VisitTask.VisitTaskNum new VisitTaskAnswerInfo { @@ -1346,7 +1341,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate visitTaskAnswerList.Add(new VisitTaskAnswerInfo() { VisitTaskId = inDto.VisitTaskId, - BlindName=inDto.TaskBlindName, + BlindName = inDto.TaskBlindName, QuestionId = visitTaskAnswerList[0].QuestionId, VisitName = inDto.VisitName, SOD = (await GetSODData(inDto)).ToString().IsNullOrEmptyReturn0(), @@ -1378,7 +1373,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate x.TrialReadingCriterionId == inDto.TrialReadingCriterionId && x.TaskState == TaskState.Effect && x.IsAnalysisCreate == inDto.IsAnalysisCreate - && x.SourceSubjectVisitId == lastVisitId && x.ArmEnum==inDto.ArmEnum).Select(x => x.Id).FirstOrDefaultAsync(); + && x.SourceSubjectVisitId == lastVisitId && x.ArmEnum == inDto.ArmEnum).Select(x => x.Id).FirstOrDefaultAsync(); return LastVisitTaskId; } @@ -1468,7 +1463,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate PresentSod = (await GetSODData(inDto)) ?? 0, //非淋巴结靶病灶长径之和 decimal - SumOfDiameter = (await GetSumOfDiameter(inDto))??0, + SumOfDiameter = (await GetSumOfDiameter(inDto)) ?? 0, //所有淋巴结靶病灶的短径小于10mm bool DiameterLessThan10 = true, @@ -1528,7 +1523,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 淋巴结非靶病灶状态全部为消失 - resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss&& item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault()== NoTargetState.Loss.GetEnumInt(); + resultData.NonTargetStateIsLoss = resultData.NonTargetStateIsLoss && item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.State).Select(x => x.Answer).FirstOrDefault() == NoTargetState.Loss.GetEnumInt(); } } @@ -1538,10 +1533,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 淋巴结的短径 - resultData.DiameterLessThan10 = resultData.DiameterLessThan10&&(item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10; + resultData.DiameterLessThan10 = resultData.DiameterLessThan10 && (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() < 10; var shortIsBigger10 = (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.ShortAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() >= 10; - resultData.CurrenShortBigger10= resultData.CurrenShortBigger10|| shortIsBigger10; + resultData.CurrenShortBigger10 = resultData.CurrenShortBigger10 || shortIsBigger10; if (shortIsBigger10) { @@ -1554,7 +1549,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate if (item.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsLymph && !x.Answer.EqEnum(YesOrNoOrNa.Yes))) { // 当前访视点非淋巴结病灶至少一个非淋巴结靶病灶的长径 - resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0|| (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0; + resultData.CurrentMajoreBigger0 = resultData.CurrentMajoreBigger0 || (item.TableQuestionList.Where(x => x.QuestionMark == QuestionMark.MajorAxis).Select(x => x.Answer).FirstOrDefault()).IsNullOrEmptyReturn0() > 0; } } @@ -1727,11 +1722,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NoTargetAssessment.NN; } //所有单个病灶/病灶组状态评估状态为“消失” - else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss))== tableQuestions.Count(x=> x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State)>0) + else if (tableQuestions.Count(x => x.QuestionMark == QuestionMark.State && x.Answer.EqEnum(NoTargetState.Loss)) == tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) && tableQuestions.Count(x => x.QuestionMark == QuestionMark.State) > 0) { result = NoTargetAssessment.CR; } - + // 基线时没有非靶病灶 else if (tableQuestions.Count() == 0) { @@ -1787,7 +1782,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate result = NewLesionAssessment.Suspected; } - + else { result = NewLesionAssessment.No; diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs index 8ef89e0b5..052233762 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/SelfDefineCalculateService.cs @@ -1,15 +1,9 @@ using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using Panda.DynamicWebApi.Attributes; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Extensions.Caching.Memory; - -using IRaCIS.Core.Infrastructure; using MassTransit; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service.ReadingCalculate { @@ -31,28 +25,28 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IRepository _readingTaskQuestionAnswerRepository) : BaseService, ICriterionCalculateService { - - private List siteVisitForTumorList = new List() ; - /// - /// 获取阅片的计算数据 - /// - /// - /// - public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) - { - return new - { - }; - } + private List siteVisitForTumorList = new List(); - #region 删除病灶获取起始病灶序号 - /// - /// 删除病灶获取起始病灶序号 - /// - /// - public async Task GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto) + /// + /// 获取阅片的计算数据 + /// + /// + /// + public async Task GetReadingCalculationData(GetReadingCalculationDataInDto inDto) + { + return new + { + }; + } + + #region 删除病灶获取起始病灶序号 + /// + /// 删除病灶获取起始病灶序号 + /// + /// + public async Task GetDeleteLesionStatrIndex(DeleteReadingRowAnswerInDto inDto) { return 1; @@ -101,14 +95,14 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate var answers = await _readingTaskQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var tableAnswers = await _readingTableQuestionAnswerRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); - var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new - { - x.TaskId, - x.GlobalVisitTask.VisitTaskNum, - x.QuestionId, - x.Answer - }).ToListAsync(); - var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); + var globalanswerList = await _readingGlobalTaskInfoRepository.Where(x => visitTaskIds.Contains(x.TaskId) && x.GlobalVisitTask.TaskState == TaskState.Effect && x.Answer != string.Empty).Select(x => new + { + x.TaskId, + x.GlobalVisitTask.VisitTaskNum, + x.QuestionId, + x.Answer + }).ToListAsync(); + var alltableAnsweRowInfos = await _readingTableAnswerRowInfoRepository.Where(x => visitTaskIds.Contains(x.VisitTaskId)).ToListAsync(); var organIds = alltableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList(); var organInfos = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync(); @@ -127,22 +121,22 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate GroupName = x.GroupName.LanguageName(x.GroupEnName, _userInfo.IsEn_Us), IsShowInDicom = x.IsShowInDicom, Type = x.Type, - GroupId=x.GroupId, - GroupEnName=x.GroupEnName, + GroupId = x.GroupId, + GroupEnName = x.GroupEnName, QuestionType = x.QuestionType, - DataSource= x.DataSource, + DataSource = x.DataSource, LesionType = x.LesionType, QuestionGenre = x.QuestionGenre, DictionaryCode = x.DictionaryCode, - LimitEdit= x.LimitEdit, - MaxAnswerLength=x.MaxAnswerLength, - FileType=x.FileType, + LimitEdit = x.LimitEdit, + MaxAnswerLength = x.MaxAnswerLength, + FileType = x.FileType, TypeValue = x.TypeValue, QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us), ShowOrder = x.ShowOrder, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Group, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -151,7 +145,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate // 分组 foreach (var item in questions) { - item.Childrens = questionList.Where(x => x.GroupId==item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() + item.Childrens = questionList.Where(x => x.GroupId == item.QuestionId).OrderBy(x => x.ShowOrder).Select(x => new ReadingReportDto() { GroupName = x.GroupName.LanguageName(x.GroupEnName, _userInfo.IsEn_Us), QuestionId = x.Id, @@ -160,10 +154,10 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate LesionType = x.LesionType, DataSource = x.DataSource, QuestionGenre = x.QuestionGenre, - GroupEnName=x.GroupEnName, + GroupEnName = x.GroupEnName, LimitEdit = x.LimitEdit, - MaxAnswerLength=x.MaxAnswerLength, - FileType=x.FileType, + MaxAnswerLength = x.MaxAnswerLength, + FileType = x.FileType, DictionaryCode = x.DictionaryCode, Type = x.Type, QuestionType = x.QuestionType, @@ -172,7 +166,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate OrderMark = x.OrderMark, ValueType = x.ValueType, Unit = x.Unit, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, ReportLayType = ReportLayType.Question, HighlightAnswer = x.HighlightAnswer, HighlightAnswerList = x.HighlightAnswerList, @@ -184,15 +178,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate foreach (var task in taskInfoList) { - var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); + var globalAnswer = globalanswerList.Where(x => x.TaskId == task.VisitTaskId && x.QuestionId == question.QuestionId).OrderByDescending(x => x.VisitTaskNum).FirstOrDefault(); - var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); + var answer = answers.Where(x => x.VisitTaskId == task.VisitTaskId && x.ReadingQuestionTrialId == question.QuestionId).FirstOrDefault(); question.Answer.Add(new TaskQuestionAnswer() { Answer = answer == null ? string.Empty : answer.Answer, - IsGlobalChange = globalAnswer == null ? false : true, - GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, - TaskName = task.TaskName, + IsGlobalChange = globalAnswer == null ? false : true, + GlobalChangeAnswer = globalAnswer == null ? string.Empty : globalAnswer.Answer, + TaskName = task.TaskName, VisitTaskId = task.VisitTaskId, }); @@ -215,17 +209,17 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate QuestionName = question.OrderMark + rowoindex.GetLesionMark(), RowId = rowinfo?.Id, IsShowInDicom = question.IsShowInDicom, - SplitOrMergeLesionName = rowinfo!=null? (rowinfo.MergeName.IsNullOrEmpty() ? rowinfo.SplitName : rowinfo.MergeName):string.Empty, - SplitOrMergeType = rowinfo != null ? (rowinfo.SplitOrMergeType):null, + SplitOrMergeLesionName = rowinfo != null ? (rowinfo.MergeName.IsNullOrEmpty() ? rowinfo.SplitName : rowinfo.MergeName) : string.Empty, + SplitOrMergeType = rowinfo != null ? (rowinfo.SplitOrMergeType) : null, LesionType = question.LesionType, - IsCanEditPosition = rowinfo != null ? (rowinfo.IsCanEditPosition):false, + IsCanEditPosition = rowinfo != null ? (rowinfo.IsCanEditPosition) : false, RowIndex = rowoindex, BlindName = rowinfo != null ? rowinfo.BlindName : string.Empty, ReportLayType = ReportLayType.Lesions, }); } - + foreach (var row in question.Childrens) @@ -240,18 +234,18 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate IsShowInDicom = question.IsShowInDicom, DataSource = x.DataSource, LimitEdit = x.LimitEdit, - MaxAnswerLength=x.MaxAnswerLength, - FileType=x.FileType, + MaxAnswerLength = x.MaxAnswerLength, + FileType = x.FileType, LesionType = question.LesionType, TableQuestionType = x.TableQuestionType, DictionaryCode = x.DictionaryCode, QuestionMark = x.QuestionMark, TypeValue = x.TypeValue, RowIndex = row.RowIndex, - RowId=row.RowId, + RowId = row.RowId, ShowOrder = x.ShowOrder, ValueType = x.ValueType, - CustomUnit=x.CustomUnit, + CustomUnit = x.CustomUnit, Unit = x.Unit, ReportLayType = ReportLayType.TableQuestion, }).ToList(); @@ -363,11 +357,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate { var visitTaskId = inDto.VisitTaskId; var taskinfo = await _visitTaskRepository.Where(x => x.Id == visitTaskId).FirstNotNullAsync(); - var isReadingTaskViewInOrder =await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync(); + var isReadingTaskViewInOrder = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == taskinfo.TrialReadingCriterionId).Select(x => x.IsReadingTaskViewInOrder).FirstOrDefaultAsync(); var baseLineVisitId = await _subjectVisitRepository.Where(x => x.SubjectId == taskinfo.SubjectId && x.IsBaseLine).Select(x => x.Id).FirstOrDefaultAsync(); // 判断当前任务是否是基线 - if (taskinfo.SourceSubjectVisitId != baseLineVisitId&& isReadingTaskViewInOrder == ReadingOrder.InOrder) + if (taskinfo.SourceSubjectVisitId != baseLineVisitId && isReadingTaskViewInOrder == ReadingOrder.InOrder) { // 判断当前任务是是否有表格问题答案 if (!(await _readingTableQuestionAnswerRepository.AnyAsync(x => x.VisitTaskId == visitTaskId))) @@ -383,7 +377,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate - var copyTableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == LastVisitTaskId&&x.ReadingQuestionTrial.IsCopyLesions).Select(x => new CopyTableAnswerDto() + var copyTableAnswers = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == LastVisitTaskId && x.ReadingQuestionTrial.IsCopyLesions).Select(x => new CopyTableAnswerDto() { Answer = x.Answer, QuestionId = x.QuestionId, @@ -391,11 +385,11 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate QuestionMark = x.ReadingTableQuestionTrial.QuestionMark, TableQuestionId = x.TableQuestionId, RowIndex = x.RowIndex, - IsCopy=x.ReadingTableQuestionTrial.IsCopy, + IsCopy = x.ReadingTableQuestionTrial.IsCopy, TrialId = x.TrialId, }).ToListAsync(); - var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == LastVisitTaskId&&x.ReadingQuestionTrial.IsCopyLesions).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var tableRowAnswers = await _readingTableAnswerRowInfoRepository.Where(x => x.VisitTaskId == LastVisitTaskId && x.ReadingQuestionTrial.IsCopyLesions).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); tableRowAnswers.ForEach(x => @@ -416,12 +410,12 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate }); - + var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer { Id = NewId.NextGuid(), - Answer = x.IsCopy ? x.Answer:string.Empty , + Answer = x.IsCopy ? x.Answer : string.Empty, QuestionId = x.QuestionId, RowIndex = x.RowIndex, RowId = tableRowAnswers.Where(y => y.OriginalId == x.RowId).Select(x => x.Id).FirstOrDefault(), @@ -488,27 +482,28 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate //var tableQuestionList = await _readingTableQuestionTrialRepository.Where(x => x.TrialCriterionId == inDto.CriterionId && x.CustomCalculateMark != null).ToListAsync(); - + } - - + + public async Task GetReportVerify(GetReportVerifyInDto inDto) { - return new GetReportVerifyOutDto() { - + return new GetReportVerifyOutDto() + { + }; } public async Task VerifyVisitTaskQuestions(VerifyVisitTaskQuestionsInDto inDto) { - + } } } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index 6dd3f284d..81c8e615e 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -4,9 +4,8 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System.ComponentModel.DataAnnotations; -using System.Text.Json.Serialization; using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts { @@ -365,9 +364,9 @@ namespace IRaCIS.Core.Application.Contracts public string? PreliminaryUserName { get; set; } - public string? ReviewerUserName { get; set; } + public string? ReviewerUserName { get; set; } - } + } public class CopyTrialSiteSurveyDTO { diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/Interface/ITrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/Interface/ITrialSiteSurveyService.cs index 526f29ca7..211a5d897 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/Interface/ITrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/Interface/ITrialSiteSurveyService.cs @@ -3,7 +3,6 @@ // 生成时间 2021-12-23 13:20:59 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Application.Services; using IRaCIS.Core.Application.Auth; using Microsoft.AspNetCore.Mvc; diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs index d8600897f..b1e5b829a 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteEquipmentSurveyService.cs @@ -4,9 +4,9 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts { @@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Contracts IRepository _trialSiteEquipmentSurveyRepository, IRepository _trialSiteSurveyRepository) : BaseService, ITrialSiteEquipmentSurveyService { - + [HttpGet("{trialSiteSurveyId:guid}")] @@ -26,7 +26,7 @@ namespace IRaCIS.Core.Application.Contracts { var trialSiteEquipmentSurveyQueryable = _trialSiteEquipmentSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId) .WhereIf(!string.IsNullOrEmpty(scannerType), t => t.ScannerType.Contains(scannerType!)) - .ProjectTo(_mapper.ConfigurationProvider,new { isEn_Us = _userInfo.IsEn_Us }); + .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }); return await trialSiteEquipmentSurveyQueryable.ToListAsync(); } @@ -59,7 +59,7 @@ namespace IRaCIS.Core.Application.Contracts await _trialSiteEquipmentSurveyRepository.DeleteFromQueryAsync(t => t.Id == trialSiteEquipmentSurveyId); var success = await _trialSiteEquipmentSurveyRepository.SaveChangesAsync(); - return ResponseOutput.Result(success); + return ResponseOutput.Result(success); } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 4b6af2576..5a92b82ad 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -3,27 +3,21 @@ // 生成时间 2021-12-23 13:20:59 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Share; -using System.Text.RegularExpressions; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Application.Services; -using IRaCIS.Core.Application.Auth; using IRaCIS.Application.Contracts; -using Microsoft.AspNetCore.Authorization; -using MailKit.Security; -using MimeKit; -using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Application.Service; +using IRaCIS.Core.Application.Auth; using IRaCIS.Core.Application.Filter; -using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.VisualBasic; -using DocumentFormat.OpenXml.Spreadsheet; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; using Medallion.Threading; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Options; -using NPOI.SS.Formula.Functions; +using Microsoft.VisualBasic; +using MimeKit; using Newtonsoft.Json; +using System.Text.RegularExpressions; namespace IRaCIS.Core.Application.Contracts { @@ -531,7 +525,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpGet("{trialId:guid}")] public async Task GetTrialSurveyInitInfo(Guid trialId) { - var info = await _trialRepository.Where(t => t.Id == trialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + var info = await _trialRepository.Where(t => t.Id == trialId).IgnoreQueryFilters().ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); return info; } @@ -749,7 +743,7 @@ namespace IRaCIS.Core.Application.Contracts private async Task GenerateAccountAsync(List needGenerateList, Guid trialId) { - var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); + var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); foreach (var item in needGenerateList) { @@ -903,7 +897,7 @@ namespace IRaCIS.Core.Application.Contracts { - var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); + var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); //判断是否有系统账号 foreach (var item in list) diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs index 74de0f00d..006d0dd6a 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteUserSurveyService.cs @@ -3,11 +3,10 @@ // 生成时间 2021-12-23 13:20:59 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using IRaCIS.Application.Contracts; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Contracts { @@ -21,7 +20,7 @@ namespace IRaCIS.Core.Application.Contracts IRepository _userRepository, IRepository _trialSiteSurveyRepository) : BaseService, ITrialSiteUserSurveyService { - + [HttpPost] public async Task> GetTrialSiteUserSurveyList(TrialSiteUserSurverQuery inquery) @@ -53,7 +52,7 @@ namespace IRaCIS.Core.Application.Contracts { var trialId = _trialSiteSurveyRepository.Where(t => t.Id == addOrEditTrialSiteUserSurvey.TrialSiteSurveyId, false, true).Select(t => t.TrialId).FirstOrDefault(); - var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); + var trialType = _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault(); var item = addOrEditTrialSiteUserSurvey; @@ -142,7 +141,7 @@ namespace IRaCIS.Core.Application.Contracts await _trialSiteUserSurveyRepository.DeleteFromQueryAsync(t => t.Id == trialSiteUserSurveyId); var success = await _trialSiteUserSurveyRepository.SaveChangesAsync(); - return ResponseOutput.Result(success); + return ResponseOutput.Result(success); } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs b/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs index e3ac8eb6a..fdf43fac5 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/_MapConfig.cs @@ -1,7 +1,5 @@ using AutoMapper; using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.AutoMapper { @@ -42,13 +40,13 @@ namespace IRaCIS.Core.Application.AutoMapper //列表 CreateMap() - .ForMember(t => t.EquipmentType, u => u.MapFrom(d => isEn_Us? d.EquipmentType.Value: d.EquipmentType.ValueCN)); + .ForMember(t => t.EquipmentType, u => u.MapFrom(d => isEn_Us ? d.EquipmentType.Value : d.EquipmentType.ValueCN)); CreateMap() .ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName)) - .ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName )) + .ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName)) .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)); CreateMap(); diff --git a/IRaCIS.Core.Application/Service/Stat/DTO/StatisticsViewModel.cs b/IRaCIS.Core.Application/Service/Stat/DTO/StatisticsViewModel.cs index b94104803..e195388cb 100644 --- a/IRaCIS.Core.Application/Service/Stat/DTO/StatisticsViewModel.cs +++ b/IRaCIS.Core.Application/Service/Stat/DTO/StatisticsViewModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class EnrollStatByReviewerDTO @@ -53,16 +48,16 @@ namespace IRaCIS.Application.Contracts public int EnrollCount { get; set; } - public List ReviewerNameCNList=new List(); + public List ReviewerNameCNList = new List(); - public List ReviewerNameList=new List(); + public List ReviewerNameList = new List(); } #region 参与项目统计 - public class ParticipateQueryDto:PageInput + public class ParticipateQueryDto : PageInput { public string UserInfo { get; set; } = string.Empty; public string OrganizationName { get; set; } = string.Empty; @@ -132,7 +127,7 @@ namespace IRaCIS.Application.Contracts public int Global { get; set; } public int RefresherTraining { get; set; } - + public int PersonalTotal { get; set; } } @@ -154,14 +149,14 @@ namespace IRaCIS.Application.Contracts public class StatisticsWorkloadQueryParam : PageInput { - public Guid? CroId { get; set; } + public Guid? CroId { get; set; } public string TrialCode { get; set; } = string.Empty; public string Reviewer { get; set; } = string.Empty; public DateTime BeginDate { get; set; } = DateTime.Now; public DateTime EndDate { get; set; } = DateTime.Now; public int StatType { get; set; } - public Guid? HospitalId { get; set; } + public Guid? HospitalId { get; set; } } public class RevenuesStatQueryDTO : PageInput @@ -273,7 +268,7 @@ namespace IRaCIS.Application.Contracts } - + public class TrialDataRankDTO { diff --git a/IRaCIS.Core.Application/Service/Stat/IStatisticsService.cs b/IRaCIS.Core.Application/Service/Stat/IStatisticsService.cs index c597a3221..178151356 100644 --- a/IRaCIS.Core.Application/Service/Stat/IStatisticsService.cs +++ b/IRaCIS.Core.Application/Service/Stat/IStatisticsService.cs @@ -1,13 +1,10 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Application.Interfaces { public interface IStatisticsService { - Task> GetWorkloadByTrialAndReviewer(StatisticsWorkloadQueryParam param); + Task> GetWorkloadByTrialAndReviewer(StatisticsWorkloadQueryParam param); PageOutput GetEnrollStatByTrial(EnrollStatByTrialQueryDTO param); @@ -35,7 +32,7 @@ namespace IRaCIS.Application.Interfaces List GetTrialCountRank(int topCount); /// 最新工作量 (已确定的) - List GetLatestWorkLoadList( int searchCount); + List GetLatestWorkLoadList(int searchCount); #endregion Task> GetEnrollStatByReviewer(EnrollStatByReviewerQueryDTO enrollTrialStatisticsQueryParam); diff --git a/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs b/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs index 1f0fe1c43..ffc6ae49b 100644 --- a/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs +++ b/IRaCIS.Core.Application/Service/Stat/StatisticsService.cs @@ -1,12 +1,10 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Domain.Share; -using System.Linq.Expressions; +using Microsoft.AspNetCore.Mvc; using System.Linq.Dynamic.Core; -using Microsoft.AspNetCore.Mvc; - -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { /// /// Dashboard统计、全局工作量统计、入组两个维度统计(按照项目、按照人) /// @@ -24,7 +22,7 @@ namespace IRaCIS.Application.Services IRepository _userRepository, IRepository _userTrialRepository) : BaseService, IStatisticsService { - + /// 根据项目和医生,分页获取工作量统计[New] [HttpPost] diff --git a/IRaCIS.Core.Application/Service/Stat/_MapConfig.cs b/IRaCIS.Core.Application/Service/Stat/_MapConfig.cs index 38ef2f0fe..7c495572a 100644 --- a/IRaCIS.Core.Application/Service/Stat/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Stat/_MapConfig.cs @@ -1,6 +1,4 @@ using AutoMapper; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Models; namespace IRaCIS.Core.Application.Service { @@ -8,8 +6,8 @@ namespace IRaCIS.Core.Application.Service { public StatConfig() { - + } } - + } diff --git a/IRaCIS.Core.Application/Service/Third-partyProject/DTO/UltrasonicDicomViewModel.cs b/IRaCIS.Core.Application/Service/Third-partyProject/DTO/UltrasonicDicomViewModel.cs index 1e998cb50..655cb829e 100644 --- a/IRaCIS.Core.Application/Service/Third-partyProject/DTO/UltrasonicDicomViewModel.cs +++ b/IRaCIS.Core.Application/Service/Third-partyProject/DTO/UltrasonicDicomViewModel.cs @@ -1,16 +1,11 @@ using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO { - - public class TrialListDTO_UltrasonicDicom: TrialBaseInfoDto + + public class TrialListDTO_UltrasonicDicom : TrialBaseInfoDto { public DateTime CreateTime { get; set; } @@ -48,7 +43,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO } public class VisitTaskDTO_UltrasonicDicom { - public Guid Id { get;set; } + public Guid Id { get; set; } public Guid SubjectId { get; set; } public Guid TrialSiteId { get; set; } @@ -78,7 +73,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO public class UpdateTaskImageStateCommand { [NotDefault] - public Guid VisitTaskId { get; set; } + public Guid VisitTaskId { get; set; } public int ImageStudyState { get; set; } } @@ -97,7 +92,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject.DTO public string StudyCode { get; set; } - public List ModalitySeriesList => SeriesModalityList.GroupBy(t=>t.Modality).Select(g=>new ModalitySeriesIdList() { Modality= g.Key,SeriesIdList=g.Select(t=>t.SeriesId).ToList() }).ToList(); + public List ModalitySeriesList => SeriesModalityList.GroupBy(t => t.Modality).Select(g => new ModalitySeriesIdList() { Modality = g.Key, SeriesIdList = g.Select(t => t.SeriesId).ToList() }).ToList(); public List SeriesModalityList { get; set; } diff --git a/IRaCIS.Core.Application/Service/Third-partyProject/UltrasonicDicomService.cs b/IRaCIS.Core.Application/Service/Third-partyProject/UltrasonicDicomService.cs index e03d132b2..485449ad8 100644 --- a/IRaCIS.Core.Application/Service/Third-partyProject/UltrasonicDicomService.cs +++ b/IRaCIS.Core.Application/Service/Third-partyProject/UltrasonicDicomService.cs @@ -1,19 +1,11 @@ -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Service.Third_partyProject.DTO; -using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Medallion.Threading; using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Text; -using System.Threading.Tasks; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application.Service.Third_partyProject @@ -26,7 +18,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject IRepository _dictionaryRepository, IRepository _visitTaskRepository) : BaseService { - + /// /// 项目列表 @@ -381,7 +373,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject } finally { - await _fusionCache.RemoveAsync(CacheKeys.TrialStudyUidUploading(incommand.TrialId,incommand.Study.StudyInstanceUid)); + await _fusionCache.RemoveAsync(CacheKeys.TrialStudyUidUploading(incommand.TrialId, incommand.Study.StudyInstanceUid)); } diff --git a/IRaCIS.Core.Application/Service/Third-partyProject/_MapConfig.cs b/IRaCIS.Core.Application/Service/Third-partyProject/_MapConfig.cs index 2b0f49dee..a269893af 100644 --- a/IRaCIS.Core.Application/Service/Third-partyProject/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Third-partyProject/_MapConfig.cs @@ -1,13 +1,5 @@ using AutoMapper; -using AutoMapper.EquivalencyExpression; -using DocumentFormat.OpenXml.Spreadsheet; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Service.Third_partyProject.DTO; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service { @@ -24,9 +16,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(o => o.UserName, t => t.MapFrom(u => u.DoctorUser.UserName)) .ForMember(o => o.FullName, t => t.MapFrom(u => u.DoctorUser.FullName)) .ForMember(o => o.TrialReadingCriterionName, t => t.MapFrom(u => u.TrialReadingCriterion.CriterionName)) - .ForMember(o => o.StudyInstanceUidList, t => t.MapFrom(u => u.SourceSubjectVisit.StudyList.Select(t=>t.StudyInstanceUid))) + .ForMember(o => o.StudyInstanceUidList, t => t.MapFrom(u => u.SourceSubjectVisit.StudyList.Select(t => t.StudyInstanceUid))) + - ; } } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs index cd9cbd134..7c3233b4d 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/DicomAEViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2024-03-22 15:44:37 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs index b5fae16a9..cae21c2cb 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs @@ -1,7 +1,4 @@ -using IRaCIS.Application.Contracts; -using System.ComponentModel.DataAnnotations; - -namespace IRaCIS.Core.Application.Contracts; +namespace IRaCIS.Core.Application.Contracts; public class SignDTO { @@ -23,7 +20,7 @@ public class SignDTO public Guid? SubjectVisitId { get; set; } - + } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs index c0affbebf..b04039f7e 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/PersonalWorkstationViewModel.cs @@ -1,9 +1,7 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Web; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts { @@ -107,7 +105,7 @@ namespace IRaCIS.Core.Application.Contracts public int? ToBeApprovalCount { get; set; } } - public class GetPMClinicalDataToBeDoneListOutDto: TrialBaseInfoDto + public class GetPMClinicalDataToBeDoneListOutDto : TrialBaseInfoDto { public int? ToBeApprovalCount { get; set; } } @@ -280,7 +278,7 @@ namespace IRaCIS.Core.Application.Contracts public string? PM_EMail { get; set; } - public List TrialIdList { get; set; }=new List(); + public List TrialIdList { get; set; } = new List(); } public class TrialToBeDoneDto : TrialBaseInfoDto @@ -353,7 +351,7 @@ namespace IRaCIS.Core.Application.Contracts public List? IR_ReadingCriterionList { get; set; } - public List? IR_PMEmailList { get; set; } + public List? IR_PMEmailList { get; set; } public int? IR_TotalReadCount { get; set; } @@ -425,7 +423,7 @@ namespace IRaCIS.Core.Application.Contracts public int? SPM_SiteSurveryCount { get; set; } public int? SPM_ReviewerApprovalCount { get; set; } - + public int? SPM_ReReadingApprovalCount { get; set; } @@ -453,7 +451,7 @@ namespace IRaCIS.Core.Application.Contracts #endregion - public int? TotalCount => TrialWaitSignDocCount + SysWaitSignDocCount + public int? TotalCount => TrialWaitSignDocCount + SysWaitSignDocCount + PM_SiteSurveryCount + PM_CheckCount + PM_ReviewerSelectCount + PM_ReReadingApprovalCount /*+ PM_ClinicalDataCount*/ + CRC_ImageSubmitCount + CRC_ImageQuestionCount + CRC_CheckQuestionCount + CRC_ImageReUploadCount /*+ CRC_ClinicalDataTobeDoneCount + CRC_ClinialDataTobeConfirmCount*/ + SPM_SiteSurveryCount + SPM_ReviewerApprovalCount + SPM_ReReadingApprovalCount @@ -464,7 +462,7 @@ namespace IRaCIS.Core.Application.Contracts public bool IsHaveSysDocNeedNeedSign { get; set; } //public List TrialNeedSignList { get; set; }=new List(); - + } //public class TrialDocNeedSign: TrialBaseInfoDto diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs index 0a9cb953d..25e24ea92 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialConfigDTO.cs @@ -1,10 +1,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Domain.Share.Reading; -using System; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using System.Text; namespace IRaCIS.Core.Application.Contracts { @@ -74,15 +71,15 @@ namespace IRaCIS.Core.Application.Contracts public class ConfigTrialProcessInfoVerificationInDto { - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } - public List TrialCriterionIds { get; set; } = new List(); + public List TrialCriterionIds { get; set; } = new List(); - public List ClinicalDataTrialSetIds { get; set; } = new List(); - } + public List ClinicalDataTrialSetIds { get; set; } = new List(); + } - public class TrialProcessConfig + public class TrialProcessConfig { public List CriterionIds { get; set; } = new List(); @@ -270,7 +267,7 @@ namespace IRaCIS.Core.Application.Contracts public ReadingTaskViewMethod ReadingTaskViewEnum { get; set; } - public ReadingOrder IsReadingTaskViewInOrder { get; set; } + public ReadingOrder IsReadingTaskViewInOrder { get; set; } /// /// 阅片是否显示受试者信息 @@ -356,7 +353,7 @@ namespace IRaCIS.Core.Application.Contracts public class GetTrialReadingInfoOutDto { - public string TrialModalitys { get; set;} + public string TrialModalitys { get; set; } public bool IsImageFilter { get; set; } @@ -386,12 +383,12 @@ namespace IRaCIS.Core.Application.Contracts /// public bool IsUrgent { get; set; } = false; - public bool IsSystemSetOncology { get; set; } = false; + public bool IsSystemSetOncology { get; set; } = false; - /// - /// 阅片平台 - /// - public int ImagePlatform { get; set; } = 1; + /// + /// 阅片平台 + /// + public int ImagePlatform { get; set; } = 1; /// /// 修约小数点 @@ -432,7 +429,7 @@ namespace IRaCIS.Core.Application.Contracts public bool IsReadingShowPreviousResults { get; set; } //读片任务显示是否顺序 - public ReadingOrder IsReadingTaskViewInOrder { get; set; } + public ReadingOrder IsReadingTaskViewInOrder { get; set; } public List GlobalAssessTypeIds { get; set; } @@ -944,7 +941,7 @@ namespace IRaCIS.Core.Application.Contracts public bool IsImageIabeled { get; set; } //读片任务显示是否顺序 - public ReadingOrder IsReadingTaskViewInOrder { get; set; } + public ReadingOrder IsReadingTaskViewInOrder { get; set; } /// /// IR阅片是否显示受试者信息 @@ -992,7 +989,7 @@ namespace IRaCIS.Core.Application.Contracts /// public bool IsUrgent { get; set; } = false; - public List TrialCriterionAdditionalAssessmentTypeList { get; set; }=new List(); + public List TrialCriterionAdditionalAssessmentTypeList { get; set; } = new List(); } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialExternalUserViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialExternalUserViewModel.cs index 13355c066..019bf74b8 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialExternalUserViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialExternalUserViewModel.cs @@ -4,11 +4,8 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- using IRaCIS.Core.Domain.Share; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Application.Contracts.DTO; using Newtonsoft.Json; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { @@ -37,8 +34,8 @@ namespace IRaCIS.Core.Application.ViewModel get { if (InviteState == TrialExternalUserStateEnum.HasSend && ExpireTime != null && ExpireTime < DateTime.Now) - { - return TrialExternalUserStateEnum.OverTime; + { + return TrialExternalUserStateEnum.OverTime; } else { @@ -75,7 +72,7 @@ namespace IRaCIS.Core.Application.ViewModel } /// TrialExternalUserAddOrEdit 列表查询参数模型 - public class TrialExternalUserAddOrEdit + public class TrialExternalUserAddOrEdit { public Guid? Id { get; set; } @@ -105,7 +102,7 @@ namespace IRaCIS.Core.Application.ViewModel } - public class TrialExternalUserAddAndSendEmail: TrialExternalUserAddOrEdit + public class TrialExternalUserAddAndSendEmail : TrialExternalUserAddOrEdit { public bool IsSendEmail { get; set; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialResearchCenter.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialResearchCenter.cs index 70e7a607a..328114a11 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialResearchCenter.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialResearchCenter.cs @@ -1,7 +1,4 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { public class TrialResearchCenterDTO { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteDicomAEViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteDicomAEViewModel.cs index 568583c26..adae19b1d 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteDicomAEViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteDicomAEViewModel.cs @@ -3,9 +3,6 @@ // 生成时间 2024-07-02 16:53:52 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs index ec296769e..8c44c703c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialSiteViewModel.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts.DTO @@ -131,7 +129,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO public string SiteCode { get; set; } = String.Empty; public string City { get; set; } = String.Empty; public string Country { get; set; } = String.Empty; - public Guid? HospitalId { get; set; } + public Guid? HospitalId { get; set; } public string HospitalName { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialUserPreparationViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialUserPreparationViewModel.cs index 6bd5705cd..c60ee649f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialUserPreparationViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialUserPreparationViewModel.cs @@ -3,15 +3,12 @@ // 生成时间 2022-03-24 13:22:20 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.ViewModel { /// TrialUserPreparation View 列表视图模型 - public class TrialUserPreparationView + public class TrialUserPreparationView { public Guid UserId { get; set; } public Guid TrialId { get; set; } @@ -46,16 +43,16 @@ namespace IRaCIS.Core.Application.ViewModel public class JoinCommand { - public UserJoinTrialCommand TrialUserInfo { get; set; } + public UserJoinTrialCommand TrialUserInfo { get; set; } //public TrialUserPreparationEdit JoinInfo { get; set; } } - public class UserJoinTrialCommand + public class UserJoinTrialCommand { [NotDefault] - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } [NotDefault] public Guid UserId { get; set; } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialViewModel.cs index 93469cbcf..c1b3c9ba1 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/TrialViewModel.cs @@ -1,7 +1,5 @@ -using IRaCIS.Core.Infrastructure.Extention; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using Newtonsoft.Json; -using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Application.Contracts { @@ -28,7 +26,7 @@ namespace IRaCIS.Application.Contracts public string ProjectCycle { get; set; } = string.Empty; public int ExpectedPatients { get; set; } public decimal TimePointsPerPatient { get; set; } - public int? GRRReviewers { get; set; } + public int? GRRReviewers { get; set; } public int TotalReviewers { get; set; } public int? Expedited { get; set; } @@ -55,7 +53,7 @@ namespace IRaCIS.Application.Contracts public List DeclarationTypeEnumList { get; set; } public List AttendedReviewerTypeEnumList { get; set; } - public string DeclarationTypes { get; set; }=string.Empty; + public string DeclarationTypes { get; set; } = string.Empty; public string AttendedReviewerTypes { get; set; } = string.Empty; @@ -63,7 +61,7 @@ namespace IRaCIS.Application.Contracts } - public class QuestionTypeDto + public class QuestionTypeDto { public Guid DictionaryId { get; set; } @@ -76,7 +74,7 @@ namespace IRaCIS.Application.Contracts public class TrialSelectDTO { - public Guid Id { get; set; } + public Guid Id { get; set; } public Guid TrialId => Id; @@ -88,7 +86,7 @@ namespace IRaCIS.Application.Contracts public string ResearchProgramNo { get; set; } = string.Empty; - public string CriterionName { get; set;} = string.Empty; + public string CriterionName { get; set; } = string.Empty; } @@ -104,7 +102,7 @@ namespace IRaCIS.Application.Contracts [JsonIgnore] public List DictionaryList { get; set; } = new List(); - + public List ModalityList => DictionaryList.Where(t => t.ParentCode == StaticData.Modality).OrderBy(t => t.ShowOrder).Select(t => t.Value).ToList(); public List ModalityIds => DictionaryList.Where(t => t.ParentCode == StaticData.Modality).OrderBy(t => t.ShowOrder).Select(t => t.Id).ToList(); @@ -118,7 +116,7 @@ namespace IRaCIS.Application.Contracts public List ReviewTypeIds => DictionaryList.Where(t => t.ParentCode == StaticData.ReviewType).OrderBy(t => t.ShowOrder).Select(t => t.Id).ToList(); - public List ReviewTypeList => DictionaryList.Where(t => t.ParentCode == StaticData.ReviewType).OrderBy(t => t.ShowOrder).Select(t => t.Value).ToList(); + public List ReviewTypeList => DictionaryList.Where(t => t.ParentCode == StaticData.ReviewType).OrderBy(t => t.ShowOrder).Select(t => t.Value).ToList(); //public string ReviewType { get; set; } = string.Empty; @@ -135,11 +133,11 @@ namespace IRaCIS.Application.Contracts public int EnrollStatus { get; set; } - + public string ReviewMode { get; set; } = string.Empty; - public int ReadingType { get; set; } + public int ReadingType { get; set; } public string CRO { get; set; } = string.Empty; @@ -169,7 +167,7 @@ namespace IRaCIS.Application.Contracts public int TrialMaxState { get; set; } - + } @@ -191,7 +189,7 @@ namespace IRaCIS.Application.Contracts { //public Guid? DeclarationTypeId { get; set; } - public List DeclarationTypeEnumList { get; set; }=new List(); + public List DeclarationTypeEnumList { get; set; } = new List(); public List AttendedReviewerTypeEnumList { get; set; } = new List(); @@ -199,12 +197,12 @@ namespace IRaCIS.Application.Contracts public Guid? SponsorId { get; set; } public Guid? CROId { get; set; } - + public string ResearchProgramNo { get; set; } = String.Empty; public string ExperimentName { get; set; } = String.Empty; - public List ModalityIds { get; set; }=new List(); + public List ModalityIds { get; set; } = new List(); public List CriterionIds { get; set; } = new List(); public List ReviewTypeIds { get; set; } = new List(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs index e0c620b3e..4fbea926c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs @@ -1,11 +1,9 @@ -using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Domain.Share; using MiniExcelLibs.Attributes; using Newtonsoft.Json; -using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Helper; -using System; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs index 1de70d035..9ee9ed587 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialConfigService.cs @@ -1,6 +1,4 @@ using IRaCIS.Core.Application.Contracts; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Application.Service.Reading.Dto; namespace IRaCIS.Application.Interfaces @@ -10,7 +8,7 @@ namespace IRaCIS.Application.Interfaces Task TrialReadingInfoSign(TrialReadingInfoSignInDto inDto); Task UpdateTrialState(Guid trialId, string trialStatusStr, string? reason); Task AbandonTrial(Guid trialId, bool isAbandon); - Task GetTrialConfigInfo(Guid trialId); + Task GetTrialConfigInfo(Guid trialId); Task ConfigTrialBasicInfo(BasicTrialConfig trialConfig); @@ -27,5 +25,5 @@ namespace IRaCIS.Application.Interfaces - } + } } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialExternalUserService.cs index c47159393..db575651f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialExternalUserService.cs @@ -6,20 +6,20 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ITrialExternalUserService - /// - public interface ITrialExternalUserService +{ + /// + /// ITrialExternalUserService + /// + public interface ITrialExternalUserService { - - Task> GetTrialExternalUserList(TrialExternalUserQuery queryTrialExternalUser); - - Task AddOrUpdateTrialExternalUser(TrialExternalUserAddAndSendEmail addOrEditTrialExternalUser); - Task DeleteTrialExternalUser(Guid trialExternalUserId, bool isSystemUser, - Guid systemUserId); + Task> GetTrialExternalUserList(TrialExternalUserQuery queryTrialExternalUser); - } -} + Task AddOrUpdateTrialExternalUser(TrialExternalUserAddAndSendEmail addOrEditTrialExternalUser); + + Task DeleteTrialExternalUser(Guid trialExternalUserId, bool isSystemUser, + Guid systemUserId); + + } +} diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialSiteDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialSiteDicomAEService.cs index c6c6fc713..8416d487f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialSiteDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/Interface/ITrialSiteDicomAEService.cs @@ -6,19 +6,19 @@ using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Interfaces -{ - /// - /// ITrialSiteDicomAEService - /// - public interface ITrialSiteDicomAEService +{ + /// + /// ITrialSiteDicomAEService + /// + public interface ITrialSiteDicomAEService { - Task> GetTrialSiteDicomAEList(TrialSiteDicomAEQuery inQuery); - - Task AddOrUpdateTrialSiteDicomAE(TrialSiteDicomAEAddOrEdit addOrEditTrialSiteDicomAE); + Task> GetTrialSiteDicomAEList(TrialSiteDicomAEQuery inQuery); + + Task AddOrUpdateTrialSiteDicomAE(TrialSiteDicomAEAddOrEdit addOrEditTrialSiteDicomAE); + + Task DeleteTrialSiteDicomAE(Guid trialSiteDicomAEId); - Task DeleteTrialSiteDicomAE(Guid trialSiteDicomAEId); - } -} +} diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 8c2b58a6e..7eefc3b49 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -1,17 +1,10 @@ -using DocumentFormat.OpenXml.Office2010.ExcelAc; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.Service.Reading.Interface; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Infrastructure.Extention; -using MathNet.Numerics; using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore.Metadata.Internal; -using System.Linq; using System.Linq.Dynamic.Core; namespace IRaCIS.Core.Application @@ -24,7 +17,7 @@ namespace IRaCIS.Core.Application IClinicalAnswerService _clinicalAnswerService, IRepository _systemNoticeRepository) : BaseService { - + @@ -629,7 +622,7 @@ namespace IRaCIS.Core.Application .Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) .Where(u => u.SubmitState == SubmitStateEnum.ToSubmit).Count(), - }).Where(x => x.ToBeDealedCount > 0); + }).Where(x => x.ToBeDealedCount > 0); @@ -683,7 +676,7 @@ namespace IRaCIS.Core.Application //待领取量 - ToBeClaimedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState!=AuditStateEnum.QCFailed) + ToBeClaimedCount = t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed && t.AuditState != AuditStateEnum.QCFailed) .Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count(), //待审核通过,统计从已领取到QC提交之间的 已领取 待审核 审核中 (审核完成 领取人就会清理 所以只用查询当前领取人是自己的就好了) @@ -781,7 +774,7 @@ namespace IRaCIS.Core.Application { - var newQuery = _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) + var newQuery = _trialReadingCriterionRepository.Where(t => t.IsSigned && t.IsConfirm && t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Select(c => new IRImageReadingToBeDoneDto() { TrialId = c.TrialId, @@ -806,7 +799,7 @@ namespace IRaCIS.Core.Application .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 //.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum)) - .Where(t => c.IsAutoCreate==false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) + .Where(t => c.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)) .Count(), @@ -886,7 +879,7 @@ namespace IRaCIS.Core.Application #endregion - var defalutSortArray = new string[] { nameof(IRImageReadingToBeDoneDto.TrialCode) ,nameof(IRImageReadingToBeDoneDto.UrgentCount) + " desc", nameof(IRImageReadingToBeDoneDto.UnReadCount) + " desc" }; + var defalutSortArray = new string[] { nameof(IRImageReadingToBeDoneDto.TrialCode), nameof(IRImageReadingToBeDoneDto.UrgentCount) + " desc", nameof(IRImageReadingToBeDoneDto.UnReadCount) + " desc" }; var result = await newQuery.ToPagedListAsync(inQuery, defalutSortArray); @@ -1016,13 +1009,13 @@ namespace IRaCIS.Core.Application CriterionName = g.Key.CriterionName, TrialReadingCriterionId = g.Key.TrialReadingCriterionId, - UrgentCount = g.Where(u => u.VisitTask.IsUrgent ).Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned ).Count(), + UrgentCount = g.Where(u => u.VisitTask.IsUrgent).Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned).Count(), ToBeReplyedCount = g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count(), ToBeReviewedCount = g.Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() - }).Where(t => t.ToBeReviewedCount +t.ToBeReplyedCount > 0); + }).Where(t => t.ToBeReviewedCount + t.ToBeReplyedCount > 0); #endregion @@ -1129,9 +1122,9 @@ namespace IRaCIS.Core.Application .CountAsync(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId); var signedTrialCount = await _trialDocumentRepository.AsQueryable(true) - .Where(t=>t.Trial.TrialUserList.Any(t=>t.UserId==_userInfo.Id)) + .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) - .Where(t => t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime!=null)).CountAsync(); + .Where(t => t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)).CountAsync(); var signedSysDocCont = await _systemDocumentRepository .Where(t => t.IsDeleted == false && t.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.Id && t.ConfirmTime != null)) @@ -1164,7 +1157,7 @@ namespace IRaCIS.Core.Application //} - //防止生成sql生成GETDATE() 时区导致的问题 + //防止生成sql生成GETDATE() 时区导致的问题 var appDateTimeNow = DateTime.Now; var record = new UserToBeDoneRecord() @@ -1173,20 +1166,20 @@ namespace IRaCIS.Core.Application IsHaveSysDocNeedNeedSign = needSignSysDocCont > 0, //TrialNeedSignList= trialNeedSignList, - SysWaitSignDocCount = needSignSysDocCont, - TrialWaitSignDocCount = needSignTrialCount , + SysWaitSignDocCount = needSignSysDocCont, + TrialWaitSignDocCount = needSignTrialCount, - TrialSignedDocCount=signedTrialCount, - SysSignedDocCount=signedSysDocCont, + TrialSignedDocCount = signedTrialCount, + SysSignedDocCount = signedSysDocCont, - SysNoticeUnReadCount= await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished + SysNoticeUnReadCount = await _systemNoticeRepository.Where(t => t.NoticeUserTypeList.Any(t => t.UserTypeId == _userInfo.UserTypeId) && t.NoticeStateEnum == Domain.Share.Management.SystemNotice_NoticeStateEnum.HavePublished && !t.NoticeUserReadList.Any(t => t.CreateUserId == _userInfo.Id)) .Where(t => t.EndDate == null || t.EndDate != null && t.EndDate > appDateTimeNow) .CountAsync(), #region PM - PM_SiteSurveryCount = isPM ? siteSurveyCount : 0, + PM_SiteSurveryCount = isPM ? siteSurveyCount : 0, PM_CheckCount = isPM ? await _trialRepository .Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id)) @@ -1325,17 +1318,17 @@ namespace IRaCIS.Core.Application //.WhereIf(g.Key.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum)) .Where(t => c.IsAutoCreate ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count()>0).CountAsync() + .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() > 0).CountAsync() : 0, IR_MedicalReviewCount = isIR ? await _taskMedicalReviewRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.VisitTask.DoctorUserId == _userInfo.Id) - .GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId} ) - .Where(g=>g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM && u.AuditState == MedicalReviewAuditState.Auditing).Count()>0).CountAsync() : 0, + .GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId }) + .Where(g => g.Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.MIM && u.AuditState == MedicalReviewAuditState.Auditing).Count() > 0).CountAsync() : 0, + - #endregion #region MIM @@ -1343,7 +1336,7 @@ namespace IRaCIS.Core.Application MIM_MedicalReviewCount = isMIM ? await _taskMedicalReviewRepository .Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id)) .Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id) - .GroupBy(t => new { t.TrialId ,t.VisitTask.TrialReadingCriterionId} ) + .GroupBy(t => new { t.TrialId, t.VisitTask.TrialReadingCriterionId }) .Select(g => new { TrialId = g.Key, @@ -1382,7 +1375,7 @@ namespace IRaCIS.Core.Application .WhereIf(!string.IsNullOrEmpty(inQuery.ResearchProgramNo), o => o.ResearchProgramNo.Contains(inQuery.ResearchProgramNo)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName)) .WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id && t.IsDeleted == false) && t.IsDeleted == false) - .WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t=>t.CriterionType==inQuery.CriterionType && t.IsSigned && t.IsConfirm)) + .WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm)) .WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.User.EMail.Contains(inQuery.PM_EMail) && (t.User.UserTypeEnum == UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM))) .Select(t => new TrialToBeDoneDto() { @@ -1409,64 +1402,64 @@ namespace IRaCIS.Core.Application SPM_ReviewerSelectApprovalCount = isSPMOrCPM ? t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count() : 0, MIM_UrgentCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id) - .Where(u=>u.VisitTask.IsUrgent && + .Where(u => u.VisitTask.IsUrgent && u.AuditState != MedicalReviewAuditState.HaveSigned).Count() : 0, MIM_PendingResponseCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id) .Where(u => u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IndependentReviewer && u.AuditState == MedicalReviewAuditState.Auditing).Count() : 0, MIM_PendingReviewCount = isMIM ? t.TaskMedicalReviewList.Where(t => t.IsClosedDialog == false && t.VisitTask.TaskState == TaskState.Effect && t.IsInvalid == false && t.MedicalManagerUserId == _userInfo.Id) - .Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer ).Count() : 0, - - CRC_UrgentCount = isCRC? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id) &&t.IsUrgent).Count() : 0, + .Where(u => u.AuditState != MedicalReviewAuditState.HaveSigned && u.LatestReplyUser.UserTypeEnum != UserTypeEnum.IndependentReviewer).Count() : 0, - CRC_CheckQuestionCount=isCRC? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) + CRC_UrgentCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id) && t.IsUrgent).Count() : 0, + + CRC_CheckQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)) .Where(u => u.CheckState == CheckStateEnum.CVIng && u.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply).Count() : 0, - CRC_QCQuestionCount=isCRC? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).SelectMany(c => c.QCChallengeList) - .Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0, + CRC_QCQuestionCount = isCRC ? t.SubjectVisitList.Where(c => c.TrialSite.CRCUserList.Any(u => u.UserId == _userInfo.Id)).SelectMany(c => c.QCChallengeList) + .Where(u => u.IsClosed == false && (u.LatestReplyUser.UserTypeEnum == UserTypeEnum.IQC || u.LatestReplyUserId == null)).Count() : 0, //待审核 审核中 加急的数量 - IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent ).Count() : 0, + IQC_UrgentCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit && t.IsUrgent).Count() : 0, - //审核未完成 - IQC_AuditToBeDealedCount= isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0, + //审核未完成 + IQC_AuditToBeDealedCount = isIQC ? t.SubjectVisitList.Where(u => u.CurrentActionUserId == _userInfo.Id && t.QCProcessEnum != TrialQCProcess.NotAudit).Count() : 0, //质疑待处理 - IQC_QuestionToBeDealedCount= isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList) + IQC_QuestionToBeDealedCount = isIQC ? t.SubjectVisitList.SelectMany(c => c.QCChallengeList) .Where(u => u.CreateUserId == _userInfo.Id && u.IsClosed == false && u.LatestReplyUser.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Count() : 0, //待领取 - IQC_ToBeClaimedCount= isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed) + IQC_ToBeClaimedCount = isIQC ? t.SubjectVisitList.Where(t => t.SubmitState == SubmitStateEnum.Submitted && t.AuditState != AuditStateEnum.QCPassed) .Where(u => u.CurrentActionUserId == null && (u.PreliminaryAuditUserId == null || (u.PreliminaryAuditUserId != _userInfo.Id && u.ReviewAuditUserId == null))).Count() : 0, - IR_ReadingCriterionList =isIR ? t.TrialReadingCriterionList.Where(t=>t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t=>t.CriterionName).ToList():null, + IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null, - IR_PMEmailList= isIR ? t.TrialUserList.Where(t=>t.User.UserTypeEnum==UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.User.EMail).Select(t => t.User.EMail).ToList() : null, + IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.User.UserTypeEnum == UserTypeEnum.ProjectManager || t.User.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.User.EMail).Select(t => t.User.EMail).ToList() : null, - IR_TotalReadCount= isIR ? t.VisitTaskList.Where(t=>t.DoctorUserId==_userInfo.Id && t.TaskState==TaskState.Effect && t.ReadingTaskState==ReadingTaskState.HaveSigned).Count():0, + IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.Id && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0, - - IR_UnReadCount= isIR ?t.VisitTaskList + + IR_UnReadCount = isIR ? t.VisitTaskList .Where(c => c.DoctorUserId == _userInfo.Id && c.ReadingTaskState != ReadingTaskState.HaveSigned && c.TaskState == TaskState.Effect && c.TrialReadingCriterion.IsSigned) // 前序 不存在 未一致性核查未通过的 .Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum > sv.VisitNum)) //前序 不存在 未生成任务的访视 .Where(t => t.TrialReadingCriterion.IsAutoCreate == false ? !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(d => d.TrialReadingCriterionId == t.TrialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum) : true) - - .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() :0, - IR_UrgentCount= isIR ? t.VisitTaskList.Where(t=>t.SourceSubjectVisit.IsUrgent).Count() : 0, + .Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)).Count() : 0, - }) ; + IR_UrgentCount = isIR ? t.VisitTaskList.Where(t => t.SourceSubjectVisit.IsUrgent).Count() : 0, + + }); //.ProjectTo(_mapper.ConfigurationProvider, new { userTypeEnumInt = _userInfo.UserTypeEnumInt, userId = _userInfo.Id }); - var result = await query.ToPagedListAsync(inQuery,nameof(TrialToBeDoneDto.CreateTime)); + var result = await query.ToPagedListAsync(inQuery, nameof(TrialToBeDoneDto.CreateTime)); return ResponseOutput.Ok(result); } diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs index 070ad041b..a899318c4 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialConfigService.cs @@ -1,28 +1,18 @@ using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Contracts; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Http; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; -using Panda.DynamicWebApi.Attributes; -using IRaCIS.Core.Infra.EFCore.Common; -using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -using MassTransit; using IRaCIS.Core.Application.Filter; -using static IRaCIS.Core.Domain.Share.StaticData; -using IRaCIS.Core.Application.Service; -using DocumentFormat.OpenXml.Office.CustomUI; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Application.Contracts; -using SixLabors.ImageSharp.Formats.Tiff.Compression.Decompressors; -using Newtonsoft.Json; -using Microsoft.Extensions.Options; using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Application.Interfaces; +using IRaCIS.Core.Application.Service.Reading.Dto; +using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infra.EFCore.Common; +using IRaCIS.Core.Infrastructure; +using MassTransit; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Newtonsoft.Json; +using Panda.DynamicWebApi.Attributes; using ZiggyCreatures.Caching.Fusion; namespace IRaCIS.Core.Application @@ -53,7 +43,7 @@ namespace IRaCIS.Core.Application IRepository _trialStateChangeRepository, IRepository _readingTableQuestionTrialRepository) : BaseService, ITrialConfigService { - + /// /// 阅片信息签名验证接口 @@ -1204,7 +1194,7 @@ namespace IRaCIS.Core.Application } await _fusionCache.SetAsync(CacheKeys.Trial(trial.Id.ToString()), trialStatusStr, TimeSpan.FromDays(7)); - + await _trialRepository.SaveChangesAsync(); return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs index 93c5b906c..0a88235d8 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialDicomAEService.cs @@ -4,15 +4,11 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; +using FellowOakDicom.Network; +using FellowOakDicom.Network.Client; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using FellowOakDicom.Network.Client; -using FellowOakDicom.Network; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Share; -using DocumentFormat.OpenXml.InkML; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { /// @@ -24,7 +20,7 @@ namespace IRaCIS.Core.Application.Service IRepository _trialRepository) : BaseService, IDicomAEService { - + [HttpPost] public async Task>> GetDicomAEList(DicomAEQuery inQuery) { @@ -68,12 +64,12 @@ namespace IRaCIS.Core.Application.Service VerifyExp = u => u.IP == addOrEditDicomAE.IP && u.Port == addOrEditDicomAE.Port && u.TrialId == addOrEditDicomAE.TrialId, //"不允许添加相同的IP和端口的记录" - VerifyMsg = _localizer["TrialDicomAE_RepeatIPAndPort"] + VerifyMsg = _localizer["TrialDicomAE_RepeatIPAndPort"] }; var verifyExp2 = new EntityVerifyExp() { - VerifyExp = u => u.CalledAE == addOrEditDicomAE.CalledAE , + VerifyExp = u => u.CalledAE == addOrEditDicomAE.CalledAE, //"AE名称不能与其他项目相同" VerifyMsg = _localizer["TrialDicomAE_RepeatCalledAE"] diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs index 77462d233..c1a55357f 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialExternalUserService.cs @@ -4,20 +4,15 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Service; +using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Application.Helper; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Domain.Share; -using MimeKit; -using MailKit.Security; -using Microsoft.AspNetCore.Authorization; -using Panda.DynamicWebApi.Attributes; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Application.Services; -using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Infrastructure; using Medallion.Threading; -using IRaCIS.Core.Application.Helper; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { @@ -34,7 +29,7 @@ namespace IRaCIS.Core.Application.Service IMailVerificationService _mailVerificationService, IDistributedLockProvider _distributedLockProvider) : BaseService, ITrialExternalUserService { - + @@ -100,7 +95,7 @@ namespace IRaCIS.Core.Application.Service var existUser = await _userRepository.FirstOrDefaultAsync(t => t.EMail == addOrEditTrialExternalUser.Email && t.UserTypeId == addOrEditTrialExternalUser.UserTypeId); - var trialType = await _trialRepository.Where(t => t.Id == addOrEditTrialExternalUser.TrialId).Select(t => t.TrialType).FirstOrDefaultAsync(); + var trialType = await _trialRepository.Where(t => t.Id == addOrEditTrialExternalUser.TrialId).Select(t => t.TrialType).FirstOrDefaultAsync(); if (existUser != null) { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index f414ee2b0..781688393 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -1,18 +1,11 @@ using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; +using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Contracts.DTO; -using IRaCIS.Application.Interfaces; -using IRaCIS.Core.Application.Service; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Core.Application.Contracts; -using DocumentFormat.OpenXml.Office2010.ExcelAc; -using IRaCIS.Core.Domain.Models; - -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Trial")] public class TrialMaintenanceService( @@ -22,13 +15,13 @@ namespace IRaCIS.Application.Services IRepository _subjectVisitRepository, IRepository _trialRepository) : BaseService, ITrialMaintenanceService { - + [HttpGet] - public async Task> GetTrialUserList(Guid trialId) + public async Task> GetTrialUserList(Guid trialId) { - return await _trialUseRepository.Where(t => t.TrialId == trialId, ignoreQueryFilters: true) - .Select(t => new TrialUserBasicInfo() { FullName = t.User.FullName, UserId = t.UserId, UserTypeId = t.User.UserTypeId, UserName = t.User.UserName }) - .ToListAsync(); + return await _trialUseRepository.Where(t => t.TrialId == trialId, ignoreQueryFilters: true) + .Select(t => new TrialUserBasicInfo() { FullName = t.User.FullName, UserId = t.UserId, UserTypeId = t.User.UserTypeId, UserName = t.User.UserName }) + .ToListAsync(); } /// @@ -68,7 +61,7 @@ namespace IRaCIS.Application.Services .WhereIf(inQuery.UserTypeId != null, t => t.User.UserTypeId == inQuery.UserTypeId) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.User.FullName).Contains(inQuery.UserRealName)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.OrganizationName), t => t.User.OrganizationName.Contains(inQuery.OrganizationName)) - .ProjectTo(_mapper.ConfigurationProvider,new { trialSiteId =inQuery.TrialSiteId}); + .ProjectTo(_mapper.ConfigurationProvider, new { trialSiteId = inQuery.TrialSiteId }); return await query.ToPagedListAsync(inQuery); @@ -81,7 +74,7 @@ namespace IRaCIS.Application.Services { var trialType = _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => t.TrialType).FirstOrDefault(); - var userTypeEnums = new List() { UserTypeEnum.ClinicalResearchCoordinator, UserTypeEnum.CRA, UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA, UserTypeEnum.MW, UserTypeEnum.MC }; + var userTypeEnums = new List() { UserTypeEnum.ClinicalResearchCoordinator, UserTypeEnum.CRA, UserTypeEnum.IQC, UserTypeEnum.APM, UserTypeEnum.MIM, UserTypeEnum.QA, UserTypeEnum.MW, UserTypeEnum.MC }; //if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SuperAdmin) { @@ -99,7 +92,7 @@ namespace IRaCIS.Application.Services .WhereIf(trialType == TrialType.NoneOfficial, t => t.IsTestUser == true || (t.IsTestUser == false && t.IsZhiZhun)) - .Where(t=>userTypeEnums.Contains(t.UserTypeEnum)) + .Where(t => userTypeEnums.Contains(t.UserTypeEnum)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.FullName).Contains(inQuery.UserRealName)) @@ -158,8 +151,8 @@ namespace IRaCIS.Application.Services { if (await _trialSiteUserRepository.AnyAsync(t => t.UserId == trialUser.UserId && t.TrialId == trialUser.TrialId)) { - // ----人员已加入现场维护 - return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]); + // ----人员已加入现场维护 + return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]); } if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.IQC) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index 194884c9f..eacae4402 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -1,20 +1,16 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Filter; -using Microsoft.AspNetCore.Mvc; -using Panda.DynamicWebApi.Attributes; -using IRaCIS.Core.Infrastructure; -using Microsoft.Extensions.Options; -using static IRaCIS.Core.Domain.Share.StaticData; -using Microsoft.AspNetCore.Authorization; -using System.Linq.Expressions; -using System.Linq; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Application.Helper; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; +using Panda.DynamicWebApi.Attributes; using ZiggyCreatures.Caching.Fusion; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Trial")] @@ -36,7 +32,7 @@ namespace IRaCIS.Application.Services ) : BaseService, ITrialService { - + public bool TrialExpeditedChange { get; set; } = false; @@ -422,7 +418,7 @@ namespace IRaCIS.Application.Services /// 临床试验项目Id [AllowAnonymous] [HttpDelete, Route("{trialId:guid}")] - public async Task DeleteTrial(Guid trialId, [FromServices]IRepository _repository) + public async Task DeleteTrial(Guid trialId, [FromServices] IRepository _repository) { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteDicomAEService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteDicomAEService.cs index 632b9b1cc..db5e5bd00 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteDicomAEService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteDicomAEService.cs @@ -4,10 +4,9 @@ // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 //-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Service { /// @@ -17,7 +16,7 @@ namespace IRaCIS.Core.Application.Service public class TrialSiteDicomAEService(IRepository _trialSiteDicomAERepository) : BaseService, ITrialSiteDicomAEService { - + [HttpPost] public async Task> GetTrialSiteDicomAEList(TrialSiteDicomAEQuery inQuery) @@ -25,7 +24,7 @@ namespace IRaCIS.Core.Application.Service var trialSiteDicomAEQueryable = - _trialSiteDicomAERepository.Where(t=>t.TrialSiteId==inQuery.TrialSiteId) + _trialSiteDicomAERepository.Where(t => t.TrialSiteId == inQuery.TrialSiteId) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.IP), t => t.IP.Contains(inQuery.IP)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Port), t => t.Port.Contains(inQuery.Port)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Description), t => t.Description.Contains(inQuery.Description)) @@ -46,18 +45,18 @@ namespace IRaCIS.Core.Application.Service { var verifyExp1 = new EntityVerifyExp() { - VerifyExp = u => u.CallingAE == addOrEditTrialSiteDicomAE.CallingAE && u.TrialId == addOrEditTrialSiteDicomAE.TrialId + VerifyExp = u => u.CallingAE == addOrEditTrialSiteDicomAE.CallingAE && u.TrialId == addOrEditTrialSiteDicomAE.TrialId && u.TrialSiteId == addOrEditTrialSiteDicomAE.TrialSiteId, //"不允许添加相同的记录" - VerifyMsg = _localizer["TrialSiteDicomAE_RepeatRecord"] + VerifyMsg = _localizer["TrialSiteDicomAE_RepeatRecord"] }; var verifyExp2 = new EntityVerifyExp() { - VerifyExp = u => u.CallingAE == addOrEditTrialSiteDicomAE.CallingAE && u.TrialId == addOrEditTrialSiteDicomAE.TrialId && u.TrialSiteId!=addOrEditTrialSiteDicomAE.TrialSiteId, + VerifyExp = u => u.CallingAE == addOrEditTrialSiteDicomAE.CallingAE && u.TrialId == addOrEditTrialSiteDicomAE.TrialId && u.TrialSiteId != addOrEditTrialSiteDicomAE.TrialSiteId, // "其他中心已有该CallingAE" - VerifyMsg = _localizer["TrialSiteDicomAE_OtherSiteExistCallingAE"] + VerifyMsg = _localizer["TrialSiteDicomAE_OtherSiteExistCallingAE"] }; diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs index 66f63f1f2..4fc6bec86 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialSiteService.cs @@ -1,15 +1,10 @@ using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Filter; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts.DTO; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.Service; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Application.Interfaces; -using System.Linq; +using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Core.Application.Services { @@ -22,7 +17,7 @@ namespace IRaCIS.Core.Application.Services IRepository _visitTaskRepository, IRepository _trialRepository) : BaseService, ITrialSiteService { - + @@ -62,7 +57,7 @@ namespace IRaCIS.Core.Application.Services .WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.User.FullName).Contains(inQuery.UserKeyInfo) || k.User.UserName.Contains(inQuery.UserKeyInfo) || k.User.EMail.Contains(inQuery.UserKeyInfo))) - .ProjectTo(_mapper.ConfigurationProvider ,new { isEn_Us = _userInfo.IsEn_Us }); + .ProjectTo(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us }); var result = await siteStatQuery.ToPagedListAsync(inQuery); @@ -94,7 +89,7 @@ namespace IRaCIS.Core.Application.Services .WhereIf(!string.IsNullOrWhiteSpace(inQuery.AliasName), t => t.AliasName.Contains(inQuery.AliasName)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.City), t => t.City.Contains(inQuery.City)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Country), t => t.Country.Contains(inQuery.Country)) - .ProjectTo(_mapper.ConfigurationProvider, new { trialId = inQuery.TrialId , isEn_Us =_userInfo.IsEn_Us}); + .ProjectTo(_mapper.ConfigurationProvider, new { trialId = inQuery.TrialId, isEn_Us = _userInfo.IsEn_Us }); return await siteQueryable.ToPagedListAsync(inQuery); @@ -104,9 +99,9 @@ namespace IRaCIS.Core.Application.Services public async Task> GetTrialSiteSelectList(string? siteName) { - var list= _siteRepository - .WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName)) - .Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us? t.SiteName:t.SiteNameCN, AliasName = t.AliasName }).ToList(); + var list = _siteRepository + .WhereIf(!string.IsNullOrWhiteSpace(siteName), t => t.SiteName.Contains(siteName) || t.SiteNameCN.Contains(siteName) || t.AliasName.Contains(siteName)) + .Select(t => new TrialSiteSelect() { SiteId = t.Id, SiteName = _userInfo.IsEn_Us ? t.SiteName : t.SiteNameCN, AliasName = t.AliasName }).ToList(); return list; } @@ -124,7 +119,7 @@ namespace IRaCIS.Core.Application.Services foreach (var item in addArray) { - if (item.IsDeleted==false) + if (item.IsDeleted == false) { item.EnabledTime = DateTime.Now; } @@ -166,11 +161,11 @@ namespace IRaCIS.Core.Application.Services if (await _subjectRepository.AnyAsync(t => t.TrialSiteId == trialSiteId && t.TrialId == trialId)) { - //---The subjects has been added to this site, and couldn't be disable. + //---The subjects has been added to this site, and couldn't be disable. return ResponseOutput.NotOk(_localizer["TrialSite_ParticipantJoined"]); } - + } @@ -178,11 +173,11 @@ namespace IRaCIS.Core.Application.Services { if (await _trialSiteRepository.AnyAsync(t => t.Id != editTrialSiteCommand.Id && t.TrialSiteCode == editTrialSiteCommand.TrialSiteCode && t.TrialId == editTrialSiteCommand.TrialId)) { - //---Code is not allowed to be repeated + //---Code is not allowed to be repeated return ResponseOutput.NotOk(_localizer["TrialSite_CodeDuplicate"]); } - if(!string.IsNullOrEmpty(editTrialSiteCommand.TrialSiteCode) && await _trialRepository.AnyAsync(t=>t.Id==trialId && t.VitrualSiteCode == editTrialSiteCommand.TrialSiteCode,true) ) + if (!string.IsNullOrEmpty(editTrialSiteCommand.TrialSiteCode) && await _trialRepository.AnyAsync(t => t.Id == trialId && t.VitrualSiteCode == editTrialSiteCommand.TrialSiteCode, true)) { return ResponseOutput.NotOk(_localizer["TrialSite_CodeDuplicate2"]); } @@ -194,9 +189,9 @@ namespace IRaCIS.Core.Application.Services if (editTrialSiteCommand.IsDeleted) { dbEntity.EnabledTime = null; - + } - else if (editTrialSiteCommand.IsDeleted==false && dbEntity.EnabledTime==null) + else if (editTrialSiteCommand.IsDeleted == false && dbEntity.EnabledTime == null) { dbEntity.EnabledTime = DateTime.Now; } @@ -231,12 +226,12 @@ namespace IRaCIS.Core.Application.Services { - await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.Id == id, u => new TrialSiteUser() { IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null }, true, true); + await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.Id == id, u => new TrialSiteUser() { IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null }, true, true); //删除又启用改授权时间 if (isDelete == false) { - await _trialSiteUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new TrialSiteUser() { CreateTime = DateTime.Now }); + await _trialSiteUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new TrialSiteUser() { CreateTime = DateTime.Now }); } ////不跟踪 @@ -244,7 +239,7 @@ namespace IRaCIS.Core.Application.Services // .SetProperty(t=>t.DeletedTime,u=> isDelete ? DateTime.Now : null) // .SetProperty(t=>t.CreateTime,u=>isDelete?u.CreateTime:DateTime.Now)); - + return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs index 7666c65a7..82efb13f1 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig.cs @@ -1,11 +1,9 @@ using AutoMapper; using AutoMapper.EquivalencyExpression; -using DocumentFormat.OpenXml.Spreadsheet; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service @@ -77,9 +75,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.ReviewMode, u => u.MapFrom(s => isEn_Us ? s.ReviewMode.Value : s.ReviewMode.ValueCN)) //.ForMember(d => d.ReviewType, u => u.MapFrom(s => s.ReviewType.Value)) .ForMember(d => d.IsLocked, u => u.MapFrom(s => s.WorkloadList.Any(u => u.DataFrom == (int)WorkLoadFromStatus.FinalConfirm))) - .ForMember(d => d.UserFeedBackUnDealedCount, u => u.MapFrom(s => s.UserFeedBackList.Count(t=>t.State==0))) + .ForMember(d => d.UserFeedBackUnDealedCount, u => u.MapFrom(s => s.UserFeedBackList.Count(t => t.State == 0))) + - //.ForMember(d => d.SiteCount, u => u.MapFrom(s => userTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator ? s.TrialSiteUserList.Count(k => k.UserId == userId) : s.TrialSiteList.Count())) //.ForMember(d => d.StudyCount, u => u.MapFrom(s => userTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator ? s.StudyList.Count(t => t.TrialSite.CRCUserList.Any(t => t.UserId == userId)) : s.StudyList.Count())) //.ForMember(d => d.SubjectCount, u => u.MapFrom(s => userTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator ? s.SubjectList.Count(t => t.TrialSite.CRCUserList.Any(t => t.UserId == userId)) : s.SubjectList.Count())) diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig2.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig2.cs index 84c15094d..6d4fe9422 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig2.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/_MapConfig2.cs @@ -1,10 +1,6 @@ using AutoMapper; -using AutoMapper.EquivalencyExpression; -using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; -using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Application.Service @@ -24,9 +20,9 @@ namespace IRaCIS.Core.Application.Service .ForMember(t => t.ResearchProgramNo, u => u.MapFrom(c => c.ResearchProgramNo)) .ForMember(t => t.UrgentCount, u => u.MapFrom(c => c - .SubjectVisitList.Where(t=>(t.CheckState==CheckStateEnum.ToCheck ||t.CheckState==CheckStateEnum.CVIng) && t.IsUrgent).Count())) + .SubjectVisitList.Where(t => (t.CheckState == CheckStateEnum.ToCheck || t.CheckState == CheckStateEnum.CVIng) && t.IsUrgent).Count())) .ForMember(t => t.ToBeCheckedCount, u => u.MapFrom(c => c - .SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.ToCheck ).Count())) + .SubjectVisitList.Where(t => t.CheckState == CheckStateEnum.ToCheck).Count())) .ForMember(t => t.ToBeRepliedCount, u => u.MapFrom(c => c .SubjectVisitList.Where(t => (t.CheckState == CheckStateEnum.ToCheck || t.CheckState == CheckStateEnum.CVIng) && t.IsUrgent).Count())); @@ -52,7 +48,7 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap(); - + diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs b/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs index bd0178751..65333b6cd 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/ClinicalStudySubjects.cs @@ -1,15 +1,13 @@ -using System; -using IRaCIS.Core.Infrastructure.Extention; -using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Application.Contracts -{ +{ public class SubjectCommand { public Guid? Id { get; set; } public string Code { get; set; } = String.Empty; - + public int? Age { get; set; } public string Sex { get; set; } = string.Empty; @@ -66,9 +64,9 @@ namespace IRaCIS.Application.Contracts public class TrialSubjectConfig { public string SubjectCodeRule { get; set; } = string.Empty; - public bool IsNoticeSubjectCodeRule { get; set; } + public bool IsNoticeSubjectCodeRule { get; set; } public bool IsHaveFirstGiveMedicineDate { get; set; } - public bool IsEnrollementQualificationConfirm { get; set; } + public bool IsEnrollementQualificationConfirm { get; set; } public bool IsHaveSubjectAge { get; set; } public string OutEnrollmentVisitName { get; set; } = string.Empty; public bool VisitPlanConfirmed { get; set; } @@ -78,13 +76,13 @@ namespace IRaCIS.Application.Contracts public bool IsPDProgressView { get; set; } - public bool IsSubjectSecondCodeView { get; set; } = false; + public bool IsSubjectSecondCodeView { get; set; } = false; } - public class SubjectQueryView: SubjectCommand + public class SubjectQueryView : SubjectCommand { public DateTime? OutEnrollmentTime { get; set; } @@ -130,11 +128,11 @@ namespace IRaCIS.Application.Contracts public string LatestBlindName { get; set; } = string.Empty; - public bool IsMissingImages { get; set; } + public bool IsMissingImages { get; set; } + + public Guid LatestSubmitSubjectVisitId { get; set; } - public Guid LatestSubmitSubjectVisitId { get; set; } - } @@ -143,7 +141,7 @@ namespace IRaCIS.Application.Contracts public class SubjectQueryParam : PageInput { [NotDefault] - public Guid TrialId { get; set; } + public Guid TrialId { get; set; } public string Code { get; set; } = string.Empty; public string Name { get; set; } = string.Empty; @@ -151,9 +149,9 @@ namespace IRaCIS.Application.Contracts public string Sex { get; set; } = string.Empty; - public bool? IsMissingImages { get; set; } - public Guid? TrialSiteId { get; set; } - public SubjectStatus? Status { get; set; } + public bool? IsMissingImages { get; set; } + public Guid? TrialSiteId { get; set; } + public SubjectStatus? Status { get; set; } } @@ -167,7 +165,7 @@ namespace IRaCIS.Application.Contracts public string Code { get; set; } = string.Empty; - public string Sex { get; set; } = string.Empty; + public string Sex { get; set; } = string.Empty; public int? Age { get; set; } public SubjectStatus Status { get; set; } diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index fe54d8536..61cc7611c 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -1,10 +1,7 @@ using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure.Extention; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using System.Web; namespace IRaCIS.Application.Contracts { @@ -398,7 +395,7 @@ namespace IRaCIS.Application.Contracts public List SCPStudyIdList { get; set; } } - public class SubmitVisitStudyBindingCommand: VerifyPacsImageCommand + public class SubmitVisitStudyBindingCommand : VerifyPacsImageCommand { diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPlanViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPlanViewModel.cs index b30eea9a4..6e428afdb 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPlanViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPlanViewModel.cs @@ -1,5 +1,4 @@ -using IRaCIS.Core.Infrastructure.Extention; -using MiniExcelLibs.Attributes; +using MiniExcelLibs.Attributes; using System.ComponentModel.DataAnnotations; namespace IRaCIS.Application.Contracts diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs index 5655cf27c..02e3bdded 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/VisitPointViewModel.cs @@ -1,9 +1,7 @@ -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Contracts.Dicom.DTO; using Newtonsoft.Json; using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Application.Service.Inspection.DTO; namespace IRaCIS.Core.Application.Contracts { diff --git a/IRaCIS.Core.Application/Service/Visit/Interface/IVisitPlanService.cs b/IRaCIS.Core.Application/Service/Visit/Interface/IVisitPlanService.cs index 772176eda..afbb9b5db 100644 --- a/IRaCIS.Core.Application/Service/Visit/Interface/IVisitPlanService.cs +++ b/IRaCIS.Core.Application/Service/Visit/Interface/IVisitPlanService.cs @@ -1,5 +1,4 @@ using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infra.EFCore; using Microsoft.AspNetCore.Mvc; namespace IRaCIS.Application.Interfaces diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index b173a72a9..f9f5ab9d0 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -1,47 +1,17 @@ -using IRaCIS.Application.Interfaces; +using FellowOakDicom; using IRaCIS.Application.Contracts; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Contracts.Dicom.DTO; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; -using MassTransit; -using Panda.DynamicWebApi.Attributes; -using DocumentFormat.OpenXml.Spreadsheet; -using AutoMapper.EntityFrameworkCore; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Application.Service.Reading.Dto; -using Microsoft.Extensions.Options; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.Configuration.Json; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; -using SharpCompress.Common; -using System.Reactive.Subjects; -using Subject = IRaCIS.Core.Domain.Models.Subject; -using IRaCIS.Core.Application.ViewModel; -using Medallion.Threading; using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Mvc; using Pipelines.Sockets.Unofficial.Arenas; -using IRaCIS.Core.Application.Contracts; -using MailKit.Search; -using DocumentFormat.OpenXml.Office2010.Excel; -using IRaCIS.Core.Application.Contracts.Dicom.DTO; -using IRaCIS.Core.Application.Helper; -using NPOI.SS.Formula.Functions; -using System.Linq; using System.Linq.Dynamic.Core; -using System.Text; -using DocumentFormat.OpenXml.EMMA; -using Azure; -using System.IO.Compression; -using static IRaCIS.Core.Domain.Share.StaticData; -using FellowOakDicom; -using DocumentFormat.OpenXml.Office2010.Drawing; using IDistributedLockProvider = Medallion.Threading.IDistributedLockProvider; -using DocumentFormat.OpenXml.InkML; +using Subject = IRaCIS.Core.Domain.Models.Subject; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Trial")] public class PatientService( @@ -57,7 +27,7 @@ namespace IRaCIS.Application.Services IDistributedLockProvider _distributedLockProvider) : BaseService { - + [HttpGet] @@ -319,7 +289,7 @@ namespace IRaCIS.Application.Services var subjectId = inCommand.SubjectId; - var isVerifyVisitImageDate = await _trialRepository.Where(t => t.Id == inCommand.TrialId).Select(t => t.IsVerifyVisitImageDate).FirstNotNullAsync(); + var isVerifyVisitImageDate = await _trialRepository.Where(t => t.Id == inCommand.TrialId).Select(t => t.IsVerifyVisitImageDate).FirstNotNullAsync(); var result = new List(); diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs index 857722353..49318c930 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectService.cs @@ -1,14 +1,10 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Infrastructure; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Trial")] public class SubjectService( @@ -16,7 +12,7 @@ namespace IRaCIS.Application.Services IRepository _trialRepository, IRepository _subjectVisitRepository) : BaseService, ISubjectService { - + /// /// 添加或更新受试者信息[New] @@ -115,17 +111,17 @@ namespace IRaCIS.Application.Services .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Name), t => t.ShortName.Contains(inQuery.Name)) .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Sex), t => t.Sex.Contains(inQuery.Sex)) .WhereIf(inQuery.Status != null, t => t.Status == inQuery.Status) - - .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) + + .WhereIf(inQuery.TrialSiteId != null, t => t.TrialSiteId == inQuery.TrialSiteId) // CRC 只负责他管理site的受试者 .WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id)) .ProjectTo(_mapper.ConfigurationProvider) - .WhereIf(inQuery.IsMissingImages != null, t => t.IsMissingImages == inQuery.IsMissingImages); + .WhereIf(inQuery.IsMissingImages != null, t => t.IsMissingImages == inQuery.IsMissingImages); - var pageList = await subjectQuery.ToPagedListAsync(inQuery,nameof(SubjectQueryView.Code)); + var pageList = await subjectQuery.ToPagedListAsync(inQuery, nameof(SubjectQueryView.Code)); - var trialConfig = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); + var trialConfig = await _trialRepository.Where(t => t.Id == inQuery.TrialId).ProjectTo(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException(); return ResponseOutput.Ok(pageList, trialConfig); @@ -158,6 +154,6 @@ namespace IRaCIS.Application.Services - + } } diff --git a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs index a6483c556..3f7638f92 100644 --- a/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs +++ b/IRaCIS.Core.Application/Service/Visit/SubjectVisitService.cs @@ -1,21 +1,13 @@ -using IRaCIS.Core.Application.Filter; - -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Contracts.Dicom.DTO; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Infrastructure; -using IRaCIS.Core.Application.Auth; -using IRaCIS.Core.Infra.EFCore.Common; -using MassTransit; using IRaCIS.Core.Application.Service.Reading.Dto; -using IRaCIS.Application.Services; +using IRaCIS.Core.Domain.Share; +using IRaCIS.Core.Infrastructure; +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.DependencyInjection; -using DocumentFormat.OpenXml.Drawing.Charts; -using IRaCIS.Core.Domain.Models; -using NPOI.SS.Formula.Functions; namespace IRaCIS.Core.Application.Services { @@ -676,8 +668,8 @@ namespace IRaCIS.Core.Application.Services { var nodicom = noDicomList.Where(x => x.Id == item.StudyId).First(); - var instanceCount = await _noneDicomStudyFileRepository.WhereIf(isExistTaskNoneDicomFile,x=>x.OriginNoneDicomStudyId== item.StudyId) - .WhereIf(isExistTaskNoneDicomFile==false, x=>x.NoneDicomStudyId == item.StudyId).CountAsync(); + var instanceCount = await _noneDicomStudyFileRepository.WhereIf(isExistTaskNoneDicomFile, x => x.OriginNoneDicomStudyId == item.StudyId) + .WhereIf(isExistTaskNoneDicomFile == false, x => x.NoneDicomStudyId == item.StudyId).CountAsync(); if (instanceCount == 0) { diff --git a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs index 812c5902c..b76d823f0 100644 --- a/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs +++ b/IRaCIS.Core.Application/Service/Visit/VisitPlanService.cs @@ -1,14 +1,12 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Application.Contracts; +using IRaCIS.Application.Contracts; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Filter; -using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; +using Microsoft.AspNetCore.Mvc; using MiniExcelLibs; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Trial")] public class VisitPlanService( @@ -20,7 +18,7 @@ namespace IRaCIS.Application.Services IRepository _subjectRepository, IRepository _visitPlanInfluenceStatRepository) : BaseService, IVisitPlanService { - + ///暂时不用 @@ -32,7 +30,7 @@ namespace IRaCIS.Application.Services .WhereIf(!string.IsNullOrWhiteSpace(inQuery.Keyword), t => t.VisitName.Contains(inQuery.Keyword)) .ProjectTo(_mapper.ConfigurationProvider); - return await visitStageQuery.ToPagedListAsync(inQuery,nameof(VisitStageDTO.CreateTime)); + return await visitStageQuery.ToPagedListAsync(inQuery, nameof(VisitStageDTO.CreateTime)); } @@ -53,18 +51,18 @@ namespace IRaCIS.Application.Services TimePointsPerPatient = trial.TimePointsPerPatient, VisitPlanConfirmed = trial.VisitPlanConfirmed, IsHaveFirstGiveMedicineDate = trial.IsHaveFirstGiveMedicineDate, - BlindBaseLineName=trial.BlindBaseLineName, - BlindFollowUpPrefix=trial.BlindFollowUpPrefix, - IsHaveGeneratedTask= isHaveGeneratedTask, + BlindBaseLineName = trial.BlindBaseLineName, + BlindFollowUpPrefix = trial.BlindFollowUpPrefix, + IsHaveGeneratedTask = isHaveGeneratedTask, //SubjectHasAdded = _subjectVisitRepository.Any(t => t.TrialId == trialId) }; } [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "BeforeOngoingCantOpt", "AfterStopCannNotOpt" })] - public async Task UpdateVisitBlindName(VisitBlindNameCommand command) + public async Task UpdateVisitBlindName(VisitBlindNameCommand command) { - await _trialRepository.UpdatePartialFromQueryAsync(command.TrialId, t => new Trial() { BlindBaseLineName = command.BlindBaseLineName, BlindFollowUpPrefix = command.BlindFollowUpPrefix }); + await _trialRepository.UpdatePartialFromQueryAsync(command.TrialId, t => new Trial() { BlindBaseLineName = command.BlindBaseLineName, BlindFollowUpPrefix = command.BlindFollowUpPrefix }); await _trialRepository.SaveChangesAsync(); @@ -115,7 +113,7 @@ namespace IRaCIS.Application.Services //比当前 visitNum小的 visitDay的最大值 还小 不允许添加 if (visitPlan.VisitDay <= visitPlanList.Where(t => t.VisitNum < visitPlan.VisitNum).Select(t => t.VisitDay).Max()) { - //---访视计划中,访视号大的访视,其访视间隔也应该比访视号小的访视大。 + //---访视计划中,访视号大的访视,其访视间隔也应该比访视号小的访视大。 throw new BusinessValidationFailedException(_localizer["VisitPlan_LargerVisitNumLargerInterval"]); } @@ -125,7 +123,7 @@ namespace IRaCIS.Application.Services { if (visitPlan.VisitDay >= visitPlanList.Where(t => t.VisitNum > visitPlan.VisitNum).Select(t => t.VisitDay).Min()) { - //---访视计划中,访视号大的计划访视,其访视间隔也应该比访视号小的计划访视大。 + //---访视计划中,访视号大的计划访视,其访视间隔也应该比访视号小的计划访视大。 throw new BusinessValidationFailedException(_localizer["VisitPlan_LargerPlanNumLargerInterval"]); } } @@ -137,13 +135,13 @@ namespace IRaCIS.Application.Services if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && (t.VisitName == visitPlan.VisitName || t.VisitNum == visitPlan.VisitNum), true)) { - //---访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。 + //---访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。 throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistNameOrNumTemplate"]); } if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && t.IsBaseLine, true) && visitPlan.IsBaseLine) { - //---访视计划中已经存在基线。 + //---访视计划中已经存在基线。 throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistBaseline"]); } @@ -162,13 +160,13 @@ namespace IRaCIS.Application.Services if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && (t.VisitName == visitPlan.VisitName || t.VisitNum == visitPlan.VisitNum) && t.Id != visitPlan.Id, true)) { - //---访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。 + //---访视计划中已经存在具有项目访视名称或者访视号的计划访视模板。 throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistNameOrNumTemplate"]); } if (await _visitStageRepository.AnyAsync(t => t.TrialId == visitPlan.TrialId && t.IsBaseLine && t.Id != visitPlan.Id, true) && visitPlan.IsBaseLine) { - //---访视计划中已经存在基线。 + //---访视计划中已经存在基线。 throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistBaseline"]); } @@ -182,7 +180,7 @@ namespace IRaCIS.Application.Services { if (await _subjectVisitRepository.Where(t => t.TrialId == visitPlan.TrialId).AnyAsync(v => v.IsBaseLine && v.SubmitState >= SubmitStateEnum.ToSubmit)) { - //---有受试者的基线已经上传了影像数据,不允许修改基线访视。 + //---有受试者的基线已经上传了影像数据,不允许修改基线访视。 throw new BusinessValidationFailedException(_localizer["VisitPlan_ExistBaselineImgNoModify"]); } } @@ -482,7 +480,7 @@ namespace IRaCIS.Application.Services FileDownloadName = _localizer["VisitPlan_CheckExport", DateTime.Now.ToString("yyyy-MM-dd:hh:mm:ss")] }; - + } diff --git a/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs b/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs index 3d9d002e6..9949e6ccf 100644 --- a/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs @@ -19,7 +19,7 @@ namespace IRaCIS.Core.Application.Service CreateMap(); CreateMap() .ForMember(d => d.Id, t => t.Ignore()) - .ForMember(d => d.VisitStageId, t =>t.MapFrom(u=>u.Id)); + .ForMember(d => d.VisitStageId, t => t.MapFrom(u => u.Id)); @@ -28,10 +28,10 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(d => d.CreateUser, u => u.MapFrom(g => g.CreateUser.LastName + " / " + g.CreateUser.FirstName)); - + CreateMap() - .ForMember(d => d.Id, t => t.MapFrom(u=>u.SubjectId)); + .ForMember(d => d.Id, t => t.MapFrom(u => u.SubjectId)); CreateMap(); CreateMap() @@ -41,8 +41,8 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.LatestVisitName, u => u.MapFrom(s => s.LatestSubjectVisit.VisitName)) - //.ForMember(d => d.FinalSubjectVisitId, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.IsFinalVisit).Select(c => (Guid?)c.Id).FirstOrDefault())) - //.ForMember(d => d.FinalSubjectVisitName, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.IsFinalVisit).Select(c => c.VisitName).FirstOrDefault())) + //.ForMember(d => d.FinalSubjectVisitId, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.IsFinalVisit).Select(c => (Guid?)c.Id).FirstOrDefault())) + //.ForMember(d => d.FinalSubjectVisitName, u => u.MapFrom(s => s.SubjectVisitList.Where(t => t.IsFinalVisit).Select(c => c.VisitName).FirstOrDefault())) .ForMember(d => d.FinalSubjectVisitId, u => u.MapFrom(s => s.FinalSubjectVisitId)) .ForMember(d => d.FinalSubjectVisitName, u => u.MapFrom(s => s.FinalSubjectVisit.VisitName)) @@ -62,12 +62,12 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.InPlanVisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.InPlan))) .ForMember(d => d.OutPlanVisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.InPlan == false))) - //执行不一定上传了 可能是失访 实际执行过了 + //执行不一定上传了 可能是失访 实际执行过了 - - .ForMember(d => d.MissingSubmmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.VisitNum d.IsMissingImages, u => u.MapFrom(s => s.SubjectVisitList.Any(t => t.VisitNum < s.LatestSubjectVisit.VisitNum && t.SubmitState != SubmitStateEnum.Submitted && t.IsLostVisit == false))) - .ForMember(d => d.InPlanVisitSubmmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.Submitted && t.InPlan == true))) + + .ForMember(d => d.MissingSubmmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.VisitNum < s.LatestSubjectVisit.VisitNum && t.SubmitState != SubmitStateEnum.Submitted && t.IsLostVisit == false))) + .ForMember(d => d.IsMissingImages, u => u.MapFrom(s => s.SubjectVisitList.Any(t => t.VisitNum < s.LatestSubjectVisit.VisitNum && t.SubmitState != SubmitStateEnum.Submitted && t.IsLostVisit == false))) + .ForMember(d => d.InPlanVisitSubmmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.Submitted && t.InPlan == true))) .ForMember(d => d.LostVisitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.IsLostVisit))) .ForMember(d => d.InPlanVisitSubmmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.Submitted && t.InPlan == true))) .ForMember(d => d.OutPlanVisitSubmmitCount, u => u.MapFrom(s => s.SubjectVisitList.Count(t => t.SubmitState == SubmitStateEnum.Submitted && t.InPlan == false))); @@ -88,7 +88,7 @@ namespace IRaCIS.Core.Application.Service - CreateMap().IncludeMembers(t=>t.Trial) + CreateMap().IncludeMembers(t => t.Trial) .ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName)) .ForMember(d => d.SubjectVisitId, u => u.MapFrom(s => s.Id)) .ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode)) @@ -127,5 +127,5 @@ namespace IRaCIS.Core.Application.Service } } - + } diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs b/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs index cf9457c26..d5d26d41e 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DTO/DoctorWorkLoadViewModel.cs @@ -1,6 +1,5 @@ -using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Core.Domain.Share; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Application.Contracts { @@ -269,7 +268,7 @@ namespace IRaCIS.Application.Contracts public Guid EnrollId { get; set; } public DateTime? OutEnrollTime { get; set; } - public Guid? AgreementId { get; set; } + public Guid AgreementId { get; set; } public string AgreementPath { get; set; } = String.Empty; @@ -300,13 +299,13 @@ namespace IRaCIS.Application.Contracts new CriterionReadingCategory() { EnrollId = EnrollId, - PendingCount= ReadingTaskStateList.Where(x=>x.ReadingTaskState != ReadingTaskState.HaveSigned&& x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(), + PendingCount = ReadingTaskStateList.Where(x => x.ReadingTaskState != ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(), ComplectedCount = ReadingTaskStateList.Where(x => x.ReadingTaskState == ReadingTaskState.HaveSigned && x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(), - TotalCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId) .Count(), + TotalCount = ReadingTaskStateList.Where(x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).Count(), - StatementCriterionFileList = CriterionFileList.Where(x=>x.CriterionType==t.CriterionType&&x.FileType==CriterionFileType.Statement) + StatementCriterionFileList = CriterionFileList.Where(x => x.CriterionType == t.CriterionType && x.FileType == CriterionFileType.Statement) .WhereIf(t.CriterionType == CriterionType.SelfDefine, x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).ToList(), AcknowledgementCriterionFileList = CriterionFileList.Where(x => x.CriterionType == t.CriterionType && x.FileType == CriterionFileType.Acknowledgement) .WhereIf(t.CriterionType == CriterionType.SelfDefine, x => x.TrialReadingCriterionId == t.TrialReadingCriterionId).ToList(), diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs b/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs index 9ffb53c47..47d75931a 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DTO/EnrollViewModel.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Service.WorkLoad.DTO { @@ -56,13 +51,13 @@ namespace IRaCIS.Core.Application.Service.WorkLoad.DTO } - public class EnrollGetQuery:PageInput + public class EnrollGetQuery : PageInput { public Guid TrialId { get; set; } - - + + } @@ -72,7 +67,7 @@ namespace IRaCIS.Core.Application.Service.WorkLoad.DTO [NotDefault] public Guid TrialId { get; set; } - public Guid[] DoctorIdArray { get; set; } = new Guid [0]; + public Guid[] DoctorIdArray { get; set; } = new Guid[0]; public int ConfirmState { get; set; } @@ -110,4 +105,4 @@ namespace IRaCIS.Core.Application.Service.WorkLoad.DTO } - } +} diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DTO/WorkloadDistribution.cs b/IRaCIS.Core.Application/Service/WorkLoad/DTO/WorkloadDistribution.cs index 863e87046..ee6fc7743 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DTO/WorkloadDistribution.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DTO/WorkloadDistribution.cs @@ -1,6 +1,4 @@ -using IRaCIS.Core.Infrastructure.Extention; - -namespace IRaCIS.Application.Contracts +namespace IRaCIS.Application.Contracts { #region TP public class WorkloadTPDTO @@ -57,11 +55,11 @@ namespace IRaCIS.Application.Contracts public Guid Id { get; set; } public Guid TrialId { get; set; } public Guid TrialSiteId { get; set; } - public string SiteName { get; set; }=String.Empty; + public string SiteName { get; set; } = String.Empty; public Guid SubjectId { get; set; } public string SubjectCode { get; set; } = String.Empty; public string ADCode { get; set; } = String.Empty; - public Guid ReviewerId { get; set; } + public Guid ReviewerId { get; set; } public string ReviewerCode { get; set; } = String.Empty; public string ReviewerFirstName { get; set; } = String.Empty; public string ReviewerLastName { get; set; } = String.Empty; diff --git a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs index ea914d838..4fb28c933 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/DoctorWorkloadService.cs @@ -1,14 +1,10 @@ -using AutoMapper; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Domain.Share; -using System.Linq.Expressions; +using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Domain.Share; using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; using System.Linq.Dynamic.Core; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Trial")] public class DoctorWorkloadService( @@ -25,7 +21,7 @@ namespace IRaCIS.Application.Services IRepository _visitTaskRepository, IRepository _taskAllocationRuleRepository) : BaseService, IDoctorWorkloadService { - + #region 入组工作量统计列表 具体详情 增删改查相关 上传\删除协议 @@ -91,7 +87,7 @@ namespace IRaCIS.Application.Services if (item.Id == null) { //配合前端,没有传id的时候,查询数据库判断一下 - var find= await _enrollReadingCriterionRepository.FirstOrDefaultAsync(t=>t.TrialReadingCriterionId==item.TrialReadingCriterionId && t.EnrollId==item.EnrollId); + var find = await _enrollReadingCriterionRepository.FirstOrDefaultAsync(t => t.TrialReadingCriterionId == item.TrialReadingCriterionId && t.EnrollId == item.EnrollId); if (find == null) { @@ -109,8 +105,8 @@ namespace IRaCIS.Application.Services } } - - await _enrollReadingCriterionRepository.SaveChangesAsync(); + + await _enrollReadingCriterionRepository.SaveChangesAsync(); return ResponseOutput.Ok(); } @@ -223,12 +219,12 @@ namespace IRaCIS.Application.Services TrialReadingCriterionList = intoGroup.Trial.TrialReadingCriterionList.Where(t => t.IsConfirm).Select(t => new TrialReadingCriterionDto() { TrialReadingCriterionId = t.Id, TrialReadingCriterionName = t.CriterionName, CriterionType = t.CriterionType, IsOncologyReading = t.IsOncologyReading, IsArbitrationReading = t.IsArbitrationReading, IsGlobalReading = t.IsGlobalReading, ReadingInfoSignTime = t.ReadingInfoSignTime, ReadingType = t.ReadingType }).ToList(), - DoctorCriterionStatusList= intoGroup.EnrollReadingCriteriaList.Select(t=>new DoctorCriterionStatus() + DoctorCriterionStatusList = intoGroup.EnrollReadingCriteriaList.Select(t => new DoctorCriterionStatus() { - EnrollId=t.Id, - Id=t.Id, - IsJoinAnalysis=t.IsJoinAnalysis, - TrialReadingCriterionId=t.TrialReadingCriterionId + EnrollId = t.Id, + Id = t.Id, + IsJoinAnalysis = t.IsJoinAnalysis, + TrialReadingCriterionId = t.TrialReadingCriterionId }).ToList(), diff --git a/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs b/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs index 58eda4ce6..23532a4be 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/EnrollService.cs @@ -1,14 +1,10 @@ -using IRaCIS.Application.Interfaces; -using IRaCIS.Core.Infra.EFCore; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Application.Filter; -using Microsoft.AspNetCore.Mvc; +using IRaCIS.Core.Application.Filter; using IRaCIS.Core.Application.Service.WorkLoad.DTO; -using Microsoft.AspNetCore.Authorization; -using IRaCIS.Core.Application.Auth; +using IRaCIS.Core.Domain.Share; +using Microsoft.AspNetCore.Mvc; using System.Text.RegularExpressions; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Enroll")] public class EnrollService( @@ -23,7 +19,7 @@ namespace IRaCIS.Application.Services IRepository _trialUserRepository, IMailVerificationService _mailVerificationService) : BaseService, IEnrollService { - + @@ -110,7 +106,7 @@ namespace IRaCIS.Application.Services /// [HttpPost("{trialId:guid}")] - [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })] + [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] //[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM_SMM_CMM)] public async Task SelectReviewers(Guid trialId, Guid[] doctorIdArray) { @@ -163,14 +159,14 @@ namespace IRaCIS.Application.Services /// [HttpPost("{trialId:guid}/{commitState:int}")] - [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })] + [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] //[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM_SMM_CMM)] public async Task SubmitReviewer(Guid trialId, Guid[] doctorIdArray, int commitState) { var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId); - var hasSPMOrCPM = await _trialUserRepository.Where(t => t.TrialId == trialId).AnyAsync(t=> t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM); + var hasSPMOrCPM = await _trialUserRepository.Where(t => t.TrialId == trialId).AnyAsync(t => t.User.UserTypeEnum == UserTypeEnum.SPM || t.User.UserTypeEnum == UserTypeEnum.CPM); if (trial != null) { @@ -217,7 +213,7 @@ namespace IRaCIS.Application.Services }); } - + } } @@ -247,7 +243,7 @@ namespace IRaCIS.Application.Services } - return ResponseOutput.Result(await _enrollRepository.SaveChangesAsync(), new {IsHaveSPMOrCPM=hasSPMOrCPM}); + return ResponseOutput.Result(await _enrollRepository.SaveChangesAsync(), new { IsHaveSPMOrCPM = hasSPMOrCPM }); } //$"Cannot find trial {trialId}" return ResponseOutput.NotOk(_localizer["Enroll_NotFound", trialId]); @@ -258,7 +254,7 @@ namespace IRaCIS.Application.Services /// [HttpPost("{trialId:guid}/{auditState:int}")] - [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })] + [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] //[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM_SMM_CMM)] public async Task ApproveReviewer(Guid trialId, Guid[] doctorIdArray, int auditState) { @@ -286,7 +282,7 @@ namespace IRaCIS.Application.Services TrialId = trialId, TrialStatus = (int)TrialEnrollStatus.HasConfirmedDoctorNames }; - await _trialDetailRepository.AddAsync(trialDetail); + await _trialDetailRepository.AddAsync(trialDetail); //更新入组表 跟踪方式,不用下面的_enrollRepository.Update(intoGroupItem); var intoGroupList = _enrollRepository.Where(t => t.TrialId == trialId, true).ToList(); @@ -331,7 +327,7 @@ namespace IRaCIS.Application.Services } } - + } return ResponseOutput.Result(await _enrollRepository.SaveChangesAsync()); @@ -344,7 +340,7 @@ namespace IRaCIS.Application.Services /// [HttpPost] - [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })] + [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] //[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM_SMM_CMM)] [UnitOfWork] public async Task ConfirmReviewer(ConfirmReviewerCommand confirmReviewerCommand, @@ -366,7 +362,7 @@ namespace IRaCIS.Application.Services //更新入组表 - var intoGroupList = await _enrollRepository.Where(t => t.TrialId == trialId,true).ToListAsync(); + var intoGroupList = await _enrollRepository.Where(t => t.TrialId == trialId, true).ToListAsync(); //验证邮件 var emaiList = await _doctorRepository.Where(t => intoGroupList.Select(t => t.DoctorId).Contains(t.Id)) @@ -379,7 +375,7 @@ namespace IRaCIS.Application.Services if (errorList.Count() > 0) { // errorList.Select(c => c.LastName+" / "+c.FirstName)) +"邮箱格式存在问题" - return ResponseOutput.NotOk(string.Join(',', _localizer["Enroll_EmailFormat"], errorList.Select(c => c.LastName + " / " + c.FirstName))) ; + return ResponseOutput.NotOk(string.Join(',', _localizer["Enroll_EmailFormat"], errorList.Select(c => c.LastName + " / " + c.FirstName))); } if (confirmReviewerCommand.ConfirmState == 1) //确认入组 @@ -418,15 +414,15 @@ namespace IRaCIS.Application.Services intoGroupItem.EnrollStatus = EnrollStatus.ConfirmIntoGroup; intoGroupItem.EnrollTime = DateTime.Now; } - catch (Exception ) + catch (Exception) { intoGroupItem.EnrollStatus = EnrollStatus.ConfirmIntoGroupFailed; } - + } } - + } else if (confirmReviewerCommand.ConfirmState == 0)//回退上一步 { @@ -446,7 +442,7 @@ namespace IRaCIS.Application.Services } } - + } await _enrollRepository.SaveChangesAsync(); @@ -465,7 +461,7 @@ namespace IRaCIS.Application.Services /// /// [HttpPost("{trialId:guid}/{doctorId:guid}/{optType:int}")] - [TypeFilter(typeof(TrialResourceFilter),Arguments = new object[] { "AfterStopCannNotOpt" })] + [TypeFilter(typeof(TrialResourceFilter), Arguments = new object[] { "AfterStopCannNotOpt" })] //[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM)] [Obsolete] public async Task EnrollBackOrOut(Guid trialId, Guid doctorId, int optType, DateTime? outEnrollTime) @@ -481,7 +477,7 @@ namespace IRaCIS.Application.Services u.Downtime); if (sum != 0) { - //---Reviewers with workload cannot go back + //---Reviewers with workload cannot go back return ResponseOutput.NotOk(_localizer["Enroll_CannotRollback"]); } diff --git a/IRaCIS.Core.Application/Service/WorkLoad/Interface/IDoctorWorkloadService.cs b/IRaCIS.Core.Application/Service/WorkLoad/Interface/IDoctorWorkloadService.cs index b3972e414..da19dd428 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/Interface/IDoctorWorkloadService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/Interface/IDoctorWorkloadService.cs @@ -1,6 +1,6 @@ using IRaCIS.Application.Contracts; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public interface IDoctorWorkloadService { diff --git a/IRaCIS.Core.Application/Service/WorkLoad/Interface/IEnrollService.cs b/IRaCIS.Core.Application/Service/WorkLoad/Interface/IEnrollService.cs index bc34d3197..5eb562773 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/Interface/IEnrollService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/Interface/IEnrollService.cs @@ -1,6 +1,6 @@ using IRaCIS.Core.Application.Service.WorkLoad.DTO; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { public interface IEnrollService { diff --git a/IRaCIS.Core.Application/Service/WorkLoad/Interface/ITrialEnrollmentService.cs b/IRaCIS.Core.Application/Service/WorkLoad/Interface/ITrialEnrollmentService.cs index e0e5374ee..fad3bec00 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/Interface/ITrialEnrollmentService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/Interface/ITrialEnrollmentService.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Core.Application.Service.WorkLoad.DTO; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Core.Application.Service.WorkLoad.DTO; namespace IRaCIS.Application.Interfaces { @@ -8,22 +6,22 @@ namespace IRaCIS.Application.Interfaces { IResponseOutput AddOrUpdateEnroll(EnrollCommand addOrUpdateModel); - Task< PageOutput> GetTrialDoctorList(EnrollGetQuery challengeQuery); + Task> GetTrialDoctorList(EnrollGetQuery challengeQuery); /// 入组流程-筛选医生 [select] - IResponseOutput SelectReviewers( Guid trialId, Guid[] doctorIdArray); + IResponseOutput SelectReviewers(Guid trialId, Guid[] doctorIdArray); /// 入组流程-向CRO提交医生[Submit] - IResponseOutput SubmitReviewer( Guid trialId, Guid[] doctorIdArray, int commitState); + IResponseOutput SubmitReviewer(Guid trialId, Guid[] doctorIdArray, int commitState); /// 入组流程-CRO确定医生名单 [ Approve] - IResponseOutput ApproveReviewer( Guid trialId, Guid[] doctorIdArray, int auditState); + IResponseOutput ApproveReviewer(Guid trialId, Guid[] doctorIdArray, int auditState); /// 入组流程-向CRO提交医生[Submit] IResponseOutput ConfirmReviewer(Guid trialId, Guid[] doctorIdArray, int confirmState); - IResponseOutput EnrollBackOrOut( Guid trialId, Guid doctorId, int optType,DateTime? outEnrollTime); + IResponseOutput EnrollBackOrOut(Guid trialId, Guid doctorId, int optType, DateTime? outEnrollTime); } } diff --git a/IRaCIS.Core.Application/Service/WorkLoad/Interface/IWorkloadDistributionService.cs b/IRaCIS.Core.Application/Service/WorkLoad/Interface/IWorkloadDistributionService.cs index 7043447d9..0a99200c5 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/Interface/IWorkloadDistributionService.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/Interface/IWorkloadDistributionService.cs @@ -1,7 +1,4 @@ -using System; -using System.Collections.Generic; -using IRaCIS.Application.Contracts; -using IRaCIS.Core.Infrastructure.Extention; +using IRaCIS.Application.Contracts; namespace IRaCIS.Core.Application.Contracts { @@ -13,7 +10,7 @@ namespace IRaCIS.Core.Application.Contracts PageOutput GetWorkloadGlobalList(WorkloadDistributionQueryParam param); IResponseOutput DistributeGlobal(WorkloadGlobalCommand workloadGlobalCommand); - IResponseOutput UpdateDistributeGlobal(Guid tpId, Guid ReviewerId,Guid subjectId, decimal visitNum); + IResponseOutput UpdateDistributeGlobal(Guid tpId, Guid ReviewerId, Guid subjectId, decimal visitNum); PageOutput GetWorkloadADList(WorkloadDistributionQueryParam param); IResponseOutput DistributeAD(WorkloadAdCommand workloadTPCommand); diff --git a/IRaCIS.Core.Application/Service/WorkLoad/_MapConfig.cs b/IRaCIS.Core.Application/Service/WorkLoad/_MapConfig.cs index fa1cbefe3..7ca95812c 100644 --- a/IRaCIS.Core.Application/Service/WorkLoad/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/WorkLoad/_MapConfig.cs @@ -1,8 +1,7 @@ using AutoMapper; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Service.WorkLoad.DTO; -using IRaCIS.Core.Domain.Models; -using static IRaCIS.Application.Services.TestService; +using static IRaCIS.Core.Application.Service.TestService; namespace IRaCIS.Core.Application.Service { @@ -20,7 +19,7 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForAllMembers(opts => opts.Condition((src, dest, srcMember) => srcMember != null)); - + } } diff --git a/IRaCIS.Core.Application/TestService.cs b/IRaCIS.Core.Application/TestService.cs index 5bf264ac6..8601bda5f 100644 --- a/IRaCIS.Core.Application/TestService.cs +++ b/IRaCIS.Core.Application/TestService.cs @@ -1,12 +1,8 @@ using Aliyun.OSS; -using DocumentFormat.OpenXml.Drawing.Charts; -using DocumentFormat.OpenXml.Wordprocessing; -using IP2Region.Net.XDB; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.BusinessFilter; using IRaCIS.Core.Application.Contracts; using IRaCIS.Core.Application.Helper; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; @@ -16,24 +12,14 @@ using Medallion.Threading; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Hosting; using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Caching.Distributed; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using MiniExcelLibs; -using Minio; -using Minio.DataModel.Args; using NPOI.XWPF.UserModel; -using SharpCompress.Common; -using Spire.Doc; -using System.Linq.Expressions; -using System.Reflection.Metadata; using System.Text; -using System.Text.RegularExpressions; -using Xceed.Document.NET; -using Xceed.Words.NET; -namespace IRaCIS.Application.Services +namespace IRaCIS.Core.Application.Service { [ApiExplorerSettings(GroupName = "Institution")] public class TestService( @@ -292,7 +278,10 @@ namespace IRaCIS.Application.Services string iv = "your-iv-12345678"; // IV 长度为 16 字节 - Console.WriteLine(AesEncryption.Encrypt(MD5Helper.Md5("123456"), key)); + var encreptMd5 = AesEncryption.Encrypt(MD5Helper.Md5("123456"), key); + Console.WriteLine(encreptMd5); + var decrept= AesEncryption.Decrypt(encreptMd5, key); + Console.WriteLine(); diff --git a/IRaCIS.Core.Application/Triggers/AddCRCCliniaclDataTrigger.cs b/IRaCIS.Core.Application/Triggers/AddCRCCliniaclDataTrigger.cs index d55cd73a6..c726a6d2f 100644 --- a/IRaCIS.Core.Application/Triggers/AddCRCCliniaclDataTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/AddCRCCliniaclDataTrigger.cs @@ -1,31 +1,26 @@ using EntityFrameworkCore.Triggered; using IRaCIS.Core.Application.Service.Reading.Interface; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Triggers { public class AddCRCCliniaclDataTrigger( - IRepository _subjectVisitRepository, - IClinicalAnswerService _iClinicalAnswerService) : IAfterSaveTrigger + IRepository _subjectVisitRepository, + IClinicalAnswerService _iClinicalAnswerService) : IAfterSaveTrigger { - - //注意删除不能用扩展方法,必须用EF跟踪的实体 否则不能取到 SubjectVisitId - public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) - { - var subjectVisit = context.Entity; - await _iClinicalAnswerService.AutoAddCRCClinical(new Service.Reading.Dto.AutoAddClinicalInDto() - { - TrialId = subjectVisit.TrialId, - SubjectId = subjectVisit.SubjectId, + //注意删除不能用扩展方法,必须用EF跟踪的实体 否则不能取到 SubjectVisitId + public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) + { + var subjectVisit = context.Entity; - }); - } + await _iClinicalAnswerService.AutoAddCRCClinical(new Service.Reading.Dto.AutoAddClinicalInDto() + { + TrialId = subjectVisit.TrialId, + SubjectId = subjectVisit.SubjectId, - } + }); + } + + } } diff --git a/IRaCIS.Core.Application/Triggers/AddSubjectTrigger.cs b/IRaCIS.Core.Application/Triggers/AddSubjectTrigger.cs index a20275b91..5452498e2 100644 --- a/IRaCIS.Core.Application/Triggers/AddSubjectTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/AddSubjectTrigger.cs @@ -1,6 +1,5 @@ using AutoMapper; using EntityFrameworkCore.Triggered; -using IRaCIS.Core.Domain.Share; using MassTransit; namespace IRaCIS.Core.Application.Triggers @@ -15,7 +14,7 @@ namespace IRaCIS.Core.Application.Triggers IRepository _trialRepository, IMapper _mapper) : IBeforeSaveTrigger { - + public async Task BeforeSave(ITriggerContext context, CancellationToken cancellationToken) { @@ -33,10 +32,10 @@ namespace IRaCIS.Core.Application.Triggers var IsEnrollementQualificationConfirm = await _trialRepository.Where(t => t.Id == subject.TrialId).Select(u => u.IsEnrollementQualificationConfirm).FirstOrDefaultAsync(); - - + + svList.ForEach(t => { t.Subject = subject; @@ -45,7 +44,7 @@ namespace IRaCIS.Core.Application.Triggers t.TrialSiteId = subject.TrialSiteId; t.IsEnrollmentConfirm = t.IsBaseLine ? IsEnrollementQualificationConfirm : false; t.Id = NewId.NextGuid(); - + }); diff --git a/IRaCIS.Core.Application/Triggers/AddlTrialUserTrigger.cs b/IRaCIS.Core.Application/Triggers/AddlTrialUserTrigger.cs index 85a721ffb..a59d46f6c 100644 --- a/IRaCIS.Core.Application/Triggers/AddlTrialUserTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/AddlTrialUserTrigger.cs @@ -2,11 +2,6 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using Microsoft.Extensions.Localization; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Triggers { @@ -18,7 +13,7 @@ namespace IRaCIS.Core.Application.Triggers IRepository _userRepository) : IBeforeSaveTrigger { - + public async Task BeforeSave(ITriggerContext context, CancellationToken cancellationToken) { var trialUser = context.Entity; @@ -36,7 +31,7 @@ namespace IRaCIS.Core.Application.Triggers if (user.IsTestUser) { - //---正式类型 、培训类型的项目 不允许加入测试用户 + //---正式类型 、培训类型的项目 不允许加入测试用户 throw new BusinessValidationFailedException(_localizer["AddlTrialUser_NoTestUser"]); } @@ -45,9 +40,9 @@ namespace IRaCIS.Core.Application.Triggers if (trialInfo.TrialType == TrialType.NoneOfficial) { - if (user.IsTestUser == false ) + if (user.IsTestUser == false) { - //---测试项目 不允许加入正式用户 + //---测试项目 不允许加入正式用户 throw new BusinessValidationFailedException(_localizer["AddlTrialUser_NoFormalUser"]); } diff --git a/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs b/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs index e169a367a..ab7324d88 100644 --- a/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/ChallengeStateTrigger.cs @@ -7,7 +7,7 @@ namespace IRaCIS.Core.Application.Triggers //访视 质疑状态 触发修改 public class ChallengeStateTrigger(IRepository _qcChallengeRepository, IRepository _subjectVisitRepository) : IAfterSaveTrigger { - + public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) { @@ -39,5 +39,5 @@ namespace IRaCIS.Core.Application.Triggers - + } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Triggers/SubjectStateTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectStateTrigger.cs index 3f5a484c3..cfc46e118 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectStateTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectStateTrigger.cs @@ -1,9 +1,6 @@ -using AutoMapper; -using EntityFrameworkCore.Triggered; +using EntityFrameworkCore.Triggered; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infrastructure; -using MassTransit; using Microsoft.Extensions.Localization; namespace IRaCIS.Core.Application.Triggers @@ -15,18 +12,18 @@ namespace IRaCIS.Core.Application.Triggers IStringLocalizer _localizer, IRepository _subjectVisitRepository) : IAfterSaveTrigger { - + public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) { var dbSubject = context.Entity; - if (context.ChangeType == ChangeType.Modified ) + if (context.ChangeType == ChangeType.Modified) { //Site变更 - if ( context.Entity.TrialSiteId != context.UnmodifiedEntity?.TrialSiteId) + if (context.Entity.TrialSiteId != context.UnmodifiedEntity?.TrialSiteId) { var subjectId = context.Entity.Id; var trialSiteId = context.Entity.TrialSiteId; @@ -61,7 +58,7 @@ namespace IRaCIS.Core.Application.Triggers { throw new BusinessValidationFailedException( - //---该受试者已经有访视被设置为末次访视,不允许将当前访视设置为末次访视。 + //---该受试者已经有访视被设置为末次访视,不允许将当前访视设置为末次访视。 _localizer["SubjectState_CannotSetCurrentAsLastVisit"]); } @@ -71,7 +68,7 @@ namespace IRaCIS.Core.Application.Triggers { throw new BusinessValidationFailedException( - //---该受试者当前访视后有访视的影像已上传,当前访视不允许设置为末次访视。 + //---该受试者当前访视后有访视的影像已上传,当前访视不允许设置为末次访视。 _localizer["SubjectState_CannotSetAsLastVisitWithImage"]); } diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs index acf9923a2..075fabb41 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitCheckPassedTrigger.cs @@ -1,10 +1,6 @@ -using AutoMapper; -using EntityFrameworkCore.Triggered; +using EntityFrameworkCore.Triggered; using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; namespace IRaCIS.Core.Application.Triggers { @@ -65,7 +61,7 @@ namespace IRaCIS.Core.Application.Triggers } - } + } } } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs index 9889f1d3a..b12e1a32d 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitFinalVisitTrigger.cs @@ -1,8 +1,6 @@ using EntityFrameworkCore.Triggered; -using IRaCIS.Core.Application.Service; using IRaCIS.Core.Application.ViewModel; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infrastructure; using MassTransit; using Microsoft.Extensions.Localization; @@ -23,7 +21,7 @@ namespace IRaCIS.Core.Application.Triggers IRepository _readingQuestionCriterionTrialRepository ) : IAfterSaveTrigger { - + public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) { @@ -43,7 +41,7 @@ namespace IRaCIS.Core.Application.Triggers await DealGenerateReadModuleAndSubjectVisit(subjectVisit); - + } else { @@ -92,7 +90,7 @@ namespace IRaCIS.Core.Application.Triggers // 是否全局阅片 - var trial = await _trialRepository.Where(x => x.Id == trialId).FirstNotNullAsync(); + var trial = await _trialRepository.Where(x => x.Id == trialId).FirstNotNullAsync(); if (!subjectVisit.IsBaseLine && subjectVisit.SubmitState == SubmitStateEnum.Submitted) diff --git a/IRaCIS.Core.Application/Triggers/SubjectVisitTrigger.cs b/IRaCIS.Core.Application/Triggers/SubjectVisitTrigger.cs index a5d1043bf..66dfd2ca9 100644 --- a/IRaCIS.Core.Application/Triggers/SubjectVisitTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/SubjectVisitTrigger.cs @@ -14,13 +14,13 @@ namespace IRaCIS.Core.Application.Triggers IRepository _noneDicomStudyRepository ) : IAfterSaveTrigger, IAfterSaveTrigger, IAfterSaveTrigger { - + //注意删除不能用扩展方法,必须用EF跟踪的实体 否则不能取到 SubjectVisitId public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) { var subjectVisitId = context.Entity.SubjectVisitId; - + if (context.ChangeType == ChangeType.Added || context.ChangeType == ChangeType.Modified) { await UpdateSubjectVisitImageDateAsync(context.Entity.SubjectVisitId); @@ -44,7 +44,7 @@ namespace IRaCIS.Core.Application.Triggers public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) { var subjectVisitId = context.Entity.SubjectVisitId; - if (context.ChangeType == ChangeType.Added ) + if (context.ChangeType == ChangeType.Added) { await UpdateSubjectVisitImageDateAsync(subjectVisitId); @@ -68,16 +68,16 @@ namespace IRaCIS.Core.Application.Triggers // 检查类型 ModalityForEdit // 检查模态 Modalities var modalities = context.Entity.Modalities; - List modalitieTypess = new List() { "PT、CT", "CT、PT", "PET-CT"}; + List modalitieTypess = new List() { "PT、CT", "CT、PT", "PET-CT" }; - if (modalitieTypess.Contains(modalities)) + if (modalitieTypess.Contains(modalities)) { - await _iClinicalAnswerService.AddStudyClinical(new Service.Reading.Dto.AddStudyClinicalInDto() - { - StudyId = studyId, - }); - } - + await _iClinicalAnswerService.AddStudyClinical(new Service.Reading.Dto.AddStudyClinicalInDto() + { + StudyId = studyId, + }); + } + } @@ -87,20 +87,20 @@ namespace IRaCIS.Core.Application.Triggers await UpdateSubjectVisitSubmitStateAsync(subjectVisitId); //删除检查级别临床数据 - await _iClinicalAnswerService.DeleteStudyClinical(new Service.Reading.Dto.DeleteStudyClinicalInDto() - { - StudyId = context.Entity.Id, - }); - } + await _iClinicalAnswerService.DeleteStudyClinical(new Service.Reading.Dto.DeleteStudyClinicalInDto() + { + StudyId = context.Entity.Id, + }); + } } public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) { - var subjectVisitId =await _noneDicomStudyRepository.Where(x=>x.Id== context.Entity.NoneDicomStudyId).Select(x=>x.SubjectVisitId).FirstOrDefaultAsync(); - + var subjectVisitId = await _noneDicomStudyRepository.Where(x => x.Id == context.Entity.NoneDicomStudyId).Select(x => x.SubjectVisitId).FirstOrDefaultAsync(); + if (context.ChangeType == ChangeType.Deleted || context.ChangeType == ChangeType.Added) - { + { await UpdateSubjectVisitSubmitStateAsync(subjectVisitId); } @@ -110,7 +110,7 @@ namespace IRaCIS.Core.Application.Triggers public async Task UpdateSubjectVisitSubmitStateAsync(Guid subjectVisitId) { - + //一个访视下面有多个检查,所以需要检测 没有的时候才清空 非dicom 是检查文件 不是表记录 if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.StudyList).CountAsync() == 0 && await _subjectVisitRepository.Where(t => t.Id == subjectVisitId) @@ -118,12 +118,12 @@ namespace IRaCIS.Core.Application.Triggers { await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.ToSubmit, - u => new SubjectVisit() { VisitExecuted = 0, SVENDTC = null, SVSTDTC = null, SubmitState = SubmitStateEnum.None },true); + u => new SubjectVisit() { VisitExecuted = 0, SVENDTC = null, SVSTDTC = null, SubmitState = SubmitStateEnum.None }, true); } else { // 上传非Dicom 后 将状态改为待提交 分为普通上传 和QC后重传 普通上传时才改为待提交 - await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.None, u => new SubjectVisit() { SubmitState = SubmitStateEnum.ToSubmit },true); + await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.None, u => new SubjectVisit() { SubmitState = SubmitStateEnum.ToSubmit }, true); } } @@ -142,7 +142,7 @@ namespace IRaCIS.Core.Application.Triggers var minArray = new DateTime?[] { svTime.DicomStudyMinStudyTime, svTime.NoneDicomStudyMinStudyTime }; var maxArray = new DateTime?[] { svTime.DicomStudyMaxStudyTime, svTime.NoneDicomStudyMaxStudyTime }; - await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t=>t.Id ==subjectVisitId, u => new SubjectVisit() + await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { EarliestScanDate = minArray.Min(), diff --git a/IRaCIS.Core.Application/Triggers/TableQuestionRowTrigger.cs b/IRaCIS.Core.Application/Triggers/TableQuestionRowTrigger.cs index 40ba60b9d..a4b14dc0e 100644 --- a/IRaCIS.Core.Application/Triggers/TableQuestionRowTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/TableQuestionRowTrigger.cs @@ -1,5 +1,4 @@ using EntityFrameworkCore.Triggered; -using IRaCIS.Core.Domain.Share; using System.Linq.Dynamic.Core; namespace IRaCIS.Core.Application.Triggers @@ -8,8 +7,8 @@ namespace IRaCIS.Core.Application.Triggers public class TableQuestionRowTrigger( IRepository _readingQuestionTrialRepository) : IBeforeSaveTrigger { - - public async Task BeforeSave(ITriggerContext context, CancellationToken cancellationToken) + + public async Task BeforeSave(ITriggerContext context, CancellationToken cancellationToken) { Dictionary splitLesionDic = new Dictionary() { @@ -43,9 +42,9 @@ namespace IRaCIS.Core.Application.Triggers }; if (context.Entity.OrderMark == string.Empty) { - context.Entity.OrderMark =await _readingQuestionTrialRepository.Where(x => x.Id == context.Entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync(); + context.Entity.OrderMark = await _readingQuestionTrialRepository.Where(x => x.Id == context.Entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync(); - } + } if (context.Entity.RowIndex % 1 == 0) { context.Entity.RowMark = context.Entity.OrderMark + decimal.ToInt32(context.Entity.RowIndex).ToString().PadLeft(2, '0'); diff --git a/IRaCIS.Core.Application/Triggers/TrialCriterionSignTrigger.cs b/IRaCIS.Core.Application/Triggers/TrialCriterionSignTrigger.cs index 49c7c9303..693232369 100644 --- a/IRaCIS.Core.Application/Triggers/TrialCriterionSignTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/TrialCriterionSignTrigger.cs @@ -1,9 +1,4 @@ -using AutoMapper; -using EntityFrameworkCore.Triggered; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; +using EntityFrameworkCore.Triggered; namespace IRaCIS.Core.Application.Triggers { @@ -13,8 +8,8 @@ namespace IRaCIS.Core.Application.Triggers public class TrialCriterionSignTrigger( IVisitTaskHelpeService _visitTaskHelpeService) : IBeforeSaveTrigger { - - + + public async Task BeforeSave(ITriggerContext context, CancellationToken cancellationToken) { @@ -25,7 +20,7 @@ namespace IRaCIS.Core.Application.Triggers { // 一致性核查通过 生成读片任务 同时要是自动生成的才会触发 - if (context.UnmodifiedEntity?.ReadingInfoSignTime != trialCriterion.ReadingInfoSignTime && trialCriterion.ReadingInfoSignTime != null && trialCriterion.IsAutoCreate==true) + if (context.UnmodifiedEntity?.ReadingInfoSignTime != trialCriterion.ReadingInfoSignTime && trialCriterion.ReadingInfoSignTime != null && trialCriterion.IsAutoCreate == true) { diff --git a/IRaCIS.Core.Application/Triggers/UserLogTrigger.cs b/IRaCIS.Core.Application/Triggers/UserLogTrigger.cs index 1ae92ddff..3cd46a4c8 100644 --- a/IRaCIS.Core.Application/Triggers/UserLogTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/UserLogTrigger.cs @@ -1,19 +1,12 @@ using EntityFrameworkCore.Triggered; using IP2Region.Net.Abstractions; -using Microsoft.Extensions.Localization; -using Microsoft.Extensions.Logging; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Application.Triggers { public class UserLogTrigger( ISearcher _searcher) : IBeforeSaveTrigger { - + //国家|区域|省份|城市|ISP 缺省的地域信息默认是0 //0|0|0|内网IP|内网IP @@ -28,7 +21,7 @@ namespace IRaCIS.Core.Application.Triggers var ipinfo = _searcher.Search(userLog.IP); userLog.IPRegion = string.Join('|', ipinfo.Split('|').TakeLast(3)); - + } } diff --git a/IRaCIS.Core.Application/Triggers/VisitTaskIbeforeTrigger.cs b/IRaCIS.Core.Application/Triggers/VisitTaskIbeforeTrigger.cs index f07fda841..2a86e0a82 100644 --- a/IRaCIS.Core.Application/Triggers/VisitTaskIbeforeTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/VisitTaskIbeforeTrigger.cs @@ -1,11 +1,5 @@ -using AutoMapper; -using EntityFrameworkCore.Triggered; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Domain.Models; +using EntityFrameworkCore.Triggered; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using System.Linq.Expressions; namespace IRaCIS.Core.Application.Triggers { @@ -15,7 +9,7 @@ namespace IRaCIS.Core.Application.Triggers IRepository _readingJudgeInfoRepository) : IBeforeSaveTrigger, IAfterSaveTrigger { - + /// /// 因为维护状态先后顺序导致 裁判任务关联的 任务上的JudgeVisitTaskId==nulll 在这里需要重新设置下 diff --git a/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs b/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs index 0bd82cfd0..7c5136458 100644 --- a/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs +++ b/IRaCIS.Core.Application/Triggers/VisitTaskIsFrontTaskNeedSignButNotSignTrigger.cs @@ -1,10 +1,5 @@ -using AutoMapper; -using EntityFrameworkCore.Triggered; -using IRaCIS.Core.Application.Service; -using IRaCIS.Core.Application.ViewModel; +using EntityFrameworkCore.Triggered; using IRaCIS.Core.Domain.Share; -using IRaCIS.Core.Infrastructure; -using System.Linq.Expressions; namespace IRaCIS.Core.Application.Triggers { @@ -16,7 +11,7 @@ namespace IRaCIS.Core.Application.Triggers IRepository _trialReadingCriterionRepository) : IAfterSaveTrigger { - + //添加任务的时候 如果需要签名 并且已经签名了 那么要维护该标准 该Subject IsFrontTaskNeedSignButNotSign字段 public async Task AfterSave(ITriggerContext context, CancellationToken cancellationToken) @@ -26,7 +21,7 @@ namespace IRaCIS.Core.Application.Triggers if (context.ChangeType == ChangeType.Added) { - Expression> visitTaskLambda = x => x.TrialId == visitTask.TrialId && x.SubjectId == visitTask.SubjectId && x.TrialReadingCriterionId == visitTask.TrialReadingCriterionId ; + Expression> visitTaskLambda = x => x.TrialId == visitTask.TrialId && x.SubjectId == visitTask.SubjectId && x.TrialReadingCriterionId == visitTask.TrialReadingCriterionId; if (visitTask.ArmEnum == Arm.TumorArm) { @@ -44,11 +39,11 @@ namespace IRaCIS.Core.Application.Triggers { //有序阅片 IsFrontTaskNeedSignButNotSign 维护才有意义 - if (_trialReadingCriterionRepository.Any(t => t.Id == visitTask.TrialReadingCriterionId && t.IsReadingTaskViewInOrder == ReadingOrder.InOrder)) + if (_trialReadingCriterionRepository.Any(t => t.Id == visitTask.TrialReadingCriterionId && t.IsReadingTaskViewInOrder == ReadingOrder.InOrder)) { var visitTaskIdQueryable = _visitTaskRepository.Where(visitTaskLambda) //该Subject 该标准的任务 //小于自己任务号的任务 存在需要签名 但是没签名 - + .Where(t => t.IsFrontTaskNeedSignButNotSign == false && (t.Subject.SubjectVisitTaskList.AsQueryable().Where(visitTaskLambda).Any(c => c.IsNeedClinicalDataSign == true && c.IsClinicalDataSign == false && c.VisitTaskNum < t.VisitTaskNum) diff --git a/IRaCIS.Core.Domain.Share/GlobalUsings.cs b/IRaCIS.Core.Domain.Share/GlobalUsings.cs new file mode 100644 index 000000000..d78845e89 --- /dev/null +++ b/IRaCIS.Core.Domain.Share/GlobalUsings.cs @@ -0,0 +1,4 @@ +global using System; +global using System.Collections.Generic; + + diff --git a/IRaCIS.Core.Domain/GlobalUsings.cs b/IRaCIS.Core.Domain/GlobalUsings.cs index cf790c1af..08aa961ea 100644 --- a/IRaCIS.Core.Domain/GlobalUsings.cs +++ b/IRaCIS.Core.Domain/GlobalUsings.cs @@ -3,5 +3,6 @@ global using System; global using System.Collections.Generic; global using System.ComponentModel.DataAnnotations; global using System.ComponentModel.DataAnnotations.Schema; +global using Newtonsoft.Json; diff --git a/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj b/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj index 8f65510a5..d6a71a4f3 100644 --- a/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj +++ b/IRaCIS.Core.Domain/IRaCIS.Core.Domain.csproj @@ -15,17 +15,10 @@ - - - - - - - diff --git a/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs b/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs index b2970b619..6653a770d 100644 --- a/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs +++ b/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs @@ -1,6 +1,4 @@ -using System; - -namespace IRaCIS.Core.Domain.Share +namespace IRaCIS.Core.Domain.Share { /// /// 用户信息接口 @@ -51,12 +49,12 @@ namespace IRaCIS.Core.Domain.Share Guid? BatchId { get; set; } - bool IsNotNeedInspection { get; set; } + bool IsNotNeedInspection { get; set; } - /// - /// 字符串形式 标识时区 - /// - string TimeZoneId { get; } + /// + /// 字符串形式 标识时区 + /// + string TimeZoneId { get; } } } diff --git a/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs b/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs index d101ec1b7..b83ac6d04 100644 --- a/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs +++ b/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs @@ -1,7 +1,4 @@ -using System; -using System.Linq; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Http; namespace IRaCIS.Core.Domain.Share { @@ -303,7 +300,7 @@ namespace IRaCIS.Core.Domain.Share /// 是否不需要记录稽查 /// public bool IsNotNeedInspection { get; set; } = false; - } + } public static class ClaimAttributes { diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index 6a211b97c..37ee67e59 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -3,19 +3,9 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; using MassTransit; -using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.ChangeTracking.Internal; -using NetTopologySuite.Index.HPRtree; using Newtonsoft.Json; -using SharpCompress.Common; -using SharpCompress.Compressors.Xz; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Security.Cryptography.X509Certificates; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore.Common @@ -80,36 +70,36 @@ namespace IRaCIS.Core.Infra.EFCore.Common } } - // 修改为删除 - private List UpdateIsDelete - { - get - { - return new List() - { - typeof(TrialDocument) - }; - } - } + // 修改为删除 + private List UpdateIsDelete + { + get + { + return new List() + { + typeof(TrialDocument) + }; + } + } - public string GetEntityAuditOpt(EntityEntry entityEntry) + public string GetEntityAuditOpt(EntityEntry entityEntry) { if (entityEntry.State == EntityState.Added) { return AuditOpt.Add; } - else if ( - UpdateIsDelete.Contains(entityEntry.Entity.GetType()) - && entityEntry.State == EntityState.Modified - && (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity) + else if ( + UpdateIsDelete.Contains(entityEntry.Entity.GetType()) + && entityEntry.State == EntityState.Modified + && (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity) - ) - { - return AuditOpt.Deleted; - } + ) + { + return AuditOpt.Deleted; + } - else if (entityEntry.State == EntityState.Deleted || + else if (entityEntry.State == EntityState.Deleted || (entityEntry.State == EntityState.Modified && typeof(ISoftDelete).IsAssignableFrom(entityEntry.Entity.GetType()) && (bool)entityEntry.Entity.GetType().GetProperty(nameof(ISoftDelete.IsDeleted)).GetValue(entityEntry.Entity) @@ -150,7 +140,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common .Where(t => t.TrialId == entity.Id && t.IsConfirm).OrderBy(t => t.ShowOrder).Select(t => t.CriterionName).ToList(); //临床数据配置 - var clinicalDataSetNameList = await _dbContext.ClinicalDataTrialSet.Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t =>_userInfo.IsEn_Us?t.ClinicalDataSetEnName: t.ClinicalDataSetName).ToListAsync(); + var clinicalDataSetNameList = await _dbContext.ClinicalDataTrialSet.Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t => _userInfo.IsEn_Us ? t.ClinicalDataSetEnName : t.ClinicalDataSetName).ToListAsync(); var memoryClinicalDataSetNameList = entitys.Where(x => x.Entity.GetType() == typeof(ClinicalDataTrialSet)).Select(t => t.Entity as ClinicalDataTrialSet) .Where(t => t.TrialId == entity.Id && t.IsConfirm).Select(t => _userInfo.IsEn_Us ? t.ClinicalDataSetEnName : t.ClinicalDataSetName).ToList(); @@ -295,29 +285,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common var oncologyAssessIdsStr = string.Empty; var allList = new List(); - if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary))) + if (entitys.Any(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary))) { - allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)) - .Select(t => t.Entity as ReadingTrialCriterionDictionary).ToList().Where(x=> - x.CriterionId== entity.Id && - x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess).ToList(); + allList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTrialCriterionDictionary)) + .Select(t => t.Entity as ReadingTrialCriterionDictionary).ToList().Where(x => + x.CriterionId == entity.Id && + x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess).ToList(); } else { - allList=await _dbContext.ReadingTrialCriterionDictionary.Where(x => - x.CriterionId == entity.Id && - x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess).ToListAsync(); - } + allList = await _dbContext.ReadingTrialCriterionDictionary.Where(x => + x.CriterionId == entity.Id && + x.ParentCode == ReadingCommon.CriterionDictionary.OncologyAssess).ToListAsync(); + } - //查询出字典的Value ValueCN Des 保存 - var diclistOncologyAssess = allList.Select(t => t.DictionaryId).ToList(); + //查询出字典的Value ValueCN Des 保存 + var diclistOncologyAssess = allList.Select(t => t.DictionaryId).ToList(); - var selectList = await _dbContext.Dictionary.Where(x => diclistOncologyAssess.Contains(x.Id)).Select(t => t.ValueCN).ToListAsync(); + var selectList = await _dbContext.Dictionary.Where(x => diclistOncologyAssess.Contains(x.Id)).Select(t => t.ValueCN).ToListAsync(); - oncologyAssessIdsStr = string.Join(",", selectList); + oncologyAssessIdsStr = string.Join(",", selectList); - await InsertInspection(entity, type, x => new InspectionConvertDTO() + await InsertInspection(entity, type, x => new InspectionConvertDTO() { IsDistinctionInterface = isDistinctionInterface, @@ -329,9 +319,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common }, new { - OncologyAssessIdsStr= oncologyAssessIdsStr, + OncologyAssessIdsStr = oncologyAssessIdsStr, - EvaluationResultTypes = dicValueList.Count > 0 ? string.Join(",", dicValueList) : string.Empty, + EvaluationResultTypes = dicValueList.Count > 0 ? string.Join(",", dicValueList) : string.Empty, AdditionalAssessmentTypeList = addtionalAssesementList }); } @@ -347,7 +337,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(entity, type, x => new InspectionConvertDTO() { - ObjectRelationParentId=entity.TrialSiteId, + ObjectRelationParentId = entity.TrialSiteId, }); } @@ -534,13 +524,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common dependQuestionShowOrder = await _dbContext.ReadingQuestionSystem.Where(t => t.Id == entity.DependParentId).Select(t => t.ShowOrder).FirstOrDefaultAsync(); } - - await InsertInspection(entity, type, x => new InspectionConvertDTO() + + await InsertInspection(entity, type, x => new InspectionConvertDTO() { IsDistinctionInterface = false, - TrialId=x.TrialId, + TrialId = x.TrialId, TrialReadingCriterionId = entity.TrialCriterionId, @@ -764,7 +754,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common SelectList = selectList.Join(list, t => t.Id, u => u.DictionaryId, (t, u) => new { - Value =t.Value , + Value = t.Value, t.ValueCN, t.Description, t.ShowOrder, @@ -791,10 +781,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common //查询出字典的Value ValueCN Des 保存 var dicIdList = allList.Select(t => t.DictionaryId).ToList(); - var selectList = await _dbContext.Dictionary.Where(x => dicIdList.Contains(x.Id)).Select(t => new { t.Id, + var selectList = await _dbContext.Dictionary.Where(x => dicIdList.Contains(x.Id)).Select(t => new + { + t.Id, - Value= _userInfo.IsEn_Us? t.Value: t.ValueCN, - t.ValueCN, t.Description, t.ShowOrder }).ToListAsync(); + Value = _userInfo.IsEn_Us ? t.Value : t.ValueCN, + t.ValueCN, + t.Description, + t.ShowOrder + }).ToListAsync(); foreach (var list in allList.GroupBy(t => t.ParentCode)) @@ -894,7 +889,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common CreateUserName = _userInfo.UserName, UserType = _userInfo.UserTypeShortName, - IsSigned = entity.ConfirmTime!=null, // 是否签署 添加了就是签署了 + IsSigned = entity.ConfirmTime != null, // 是否签署 添加了就是签署了 }); } @@ -1231,7 +1226,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var questionIdList = list.Select(t => t.ReadingMedicineQuestionId).ToList(); - var questionNameList = await _dbContext.ReadingMedicineTrialQuestion.Where(x => questionIdList.Contains(x.Id)).Select(t => new { t.QuestionName, ReadingMedicineQuestionId = t.Id, t.ShowOrder }).ToListAsync(); + var questionNameList = await _dbContext.ReadingMedicineTrialQuestion.Where(x => questionIdList.Contains(x.Id)).Select(t => new { t.QuestionName, ReadingMedicineQuestionId = t.Id, t.ShowOrder }).ToListAsync(); var firstEntity = list.FirstOrDefault(); @@ -1406,7 +1401,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common QcQuestionAnswerList = answerList.Join(trialQuestionNameList, t => t.TrialQCQuestionConfigureId, u => u.TrialQCQuestionConfigureId, (t, u) => new { t.Answer, - + u.QuestionName, u.ShowOrder }).OrderBy(t => t.ShowOrder).ToList(), @@ -1571,17 +1566,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteUserSurvey))) { var type = GetEntityAuditOpt(item); - var entity = item.Entity as TrialSiteUserSurvey; + var entity = item.Entity as TrialSiteUserSurvey; + + var trialid = await _dbContext.TrialSiteSurvey.Where(x => x.Id == entity.TrialSiteSurveyId).Select(x => x.TrialId).FirstOrDefaultAsync(); - var trialid = await _dbContext.TrialSiteSurvey.Where(x => x.Id == entity.TrialSiteSurveyId).Select(x=>x.TrialId).FirstOrDefaultAsync(); - await InsertInspection(entity, type, x => new InspectionConvertDTO() { - TrialId= trialid, + TrialId = trialid, - IsDistinctionInterface = false + IsDistinctionInterface = false }); } @@ -1590,12 +1585,12 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as TrialSiteEquipmentSurvey; - var trialid = await _dbContext.TrialSiteSurvey.Where(x => x.Id == entity.TrialSiteSurveyId).Select(x => x.TrialId).FirstOrDefaultAsync(); + var trialid = await _dbContext.TrialSiteSurvey.Where(x => x.Id == entity.TrialSiteSurveyId).Select(x => x.TrialId).FirstOrDefaultAsync(); - await InsertInspection(entity, type, x => new InspectionConvertDTO() + await InsertInspection(entity, type, x => new InspectionConvertDTO() { - TrialId = trialid, - IsDistinctionInterface = false + TrialId = trialid, + IsDistinctionInterface = false }); } @@ -1701,13 +1696,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as TrialSite; - if (entity.Site == null && entity.SiteId!=null) + if (entity.Site == null && entity.SiteId != null) { entity.Site = await _dbContext.Site.Where(x => x.Id == entity.SiteId).FirstOrDefaultAsync(); } await InsertInspection(entity, type, x => new InspectionConvertDTO() { - IsDistinctionInterface= type == AuditOpt.Update ? true : false, + IsDistinctionInterface = type == AuditOpt.Update ? true : false, TrialId = x.TrialId, ObjectRelationParentId = x.TrialId @@ -1756,7 +1751,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common await InsertInspection(item.Entity as TrialSiteUser, type, x => new InspectionConvertDTO { - IsDistinctionInterface= type == AuditOpt.Update ? true : false, + IsDistinctionInterface = type == AuditOpt.Update ? true : false, TrialId = x.TrialId, ObjectRelationParentId = entity.TrialSite.Id, ObjectRelationParentId2 = x.UserId, @@ -1976,11 +1971,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId2 = x.ClinicalDataTrialSetId, - }, new + }, new { - ClinicalDataLevel= ClinicalLevel.Subject, + ClinicalDataLevel = ClinicalLevel.Subject, - Type = ClinicalFileType.PreviousSurgery + Type = ClinicalFileType.PreviousSurgery }); } @@ -2005,8 +2000,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId = x.SubjectVisitId, }, new { - ClinicalDataLevel = ClinicalLevel.Subject, - Type = ClinicalFileType.PreviousHistory + ClinicalDataLevel = ClinicalLevel.Subject, + Type = ClinicalFileType.PreviousHistory }); } @@ -2029,11 +2024,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId = x.SubjectVisitId, }, new { - ClinicalDataLevel = ClinicalLevel.Subject, - Type = ClinicalFileType.PreviousOther + ClinicalDataLevel = ClinicalLevel.Subject, + Type = ClinicalFileType.PreviousOther }); } - + #endregion #region 阅片人入组 @@ -2210,14 +2205,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common clinicalDataTrialSet.ClinicalDataLevel, clinicalDataTrialSet.ClinicalUploadType, CriterionNames = string.Join(",", criterionNameList.Distinct()), - + }); } - - + + //系统临床数据配置 @@ -2272,8 +2267,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (entity.TrialClinicalDataSetCriteriaList == null || entity.TrialClinicalDataSetCriteriaList.Count() == 0) { - criterionNameList = await _dbContext.TrialClinicalDataSetCriterion.Where(t => t.TrialClinicalDataSetId == entity.Id).Select(t => t.TrialReadingCriterion.CriterionName).ToListAsync(); - } + criterionNameList = await _dbContext.TrialClinicalDataSetCriterion.Where(t => t.TrialClinicalDataSetId == entity.Id).Select(t => t.TrialReadingCriterion.CriterionName).ToListAsync(); + } else { var ids = entity.TrialClinicalDataSetCriteriaList.Select(t => t.TrialReadingCriterionId).ToList(); @@ -2301,16 +2296,17 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as TrialClinicalQuestion; - var trialId= await _dbContext.ClinicalDataTrialSet.Where(t => t.Id == entity.TrialClinicalId).Select(t => t.TrialId).FirstOrDefaultAsync(); - var GroupName = entity.GroupId == null ? entity.QuestionName: _dbContext.TrialClinicalQuestion.Where(t => t.Id == entity.GroupId).Select(t => t.QuestionName).FirstOrDefault(); + var trialId = await _dbContext.ClinicalDataTrialSet.Where(t => t.Id == entity.TrialClinicalId).Select(t => t.TrialId).FirstOrDefaultAsync(); + var GroupName = entity.GroupId == null ? entity.QuestionName : _dbContext.TrialClinicalQuestion.Where(t => t.Id == entity.GroupId).Select(t => t.QuestionName).FirstOrDefault(); var GroupEnName = entity.GroupId == null ? entity.QuestionEnName : _dbContext.TrialClinicalQuestion.Where(t => t.Id == entity.GroupId).Select(t => t.QuestionEnName).FirstOrDefault(); await InsertInspection(entity, type, x => new InspectionConvertDTO() { - TrialId= trialId, + TrialId = trialId, }, - new { - GroupName= GroupName, - GroupEnName= GroupEnName, + new + { + GroupName = GroupName, + GroupEnName = GroupEnName, } ); } @@ -2328,7 +2324,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common { TrialId = trialId, } - + ); } @@ -2440,7 +2436,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //临床数据表单确认 - if(_userInfo.RequestUrl== "ClinicalAnswer/cRCConfirmClinical") + if (_userInfo.RequestUrl == "ClinicalAnswer/cRCConfirmClinical") { extraIndentification = "/" + _userInfo.RequestUrl; var readModuleCriterionFromList = entitys.Where(x => x.Entity.GetType() == typeof(ReadModuleCriterionFrom)).ToList(); @@ -2451,7 +2447,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common var clinicalFormIds = new List(); var criterionIds = new List(); - readModuleCriterionFromList.ForEach(x => { + readModuleCriterionFromList.ForEach(x => + { var form = x.Entity as ReadModuleCriterionFrom; clinicalFormIds.Add(form.ClinicalFormId); }); @@ -2481,7 +2478,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common TrialSite siteInfo = await _dbContext.TrialSite.Where(x => x.Id == subject.TrialSiteId).FirstOrDefaultAsync(); var clinicalDataSetNameList = clinicalDataTrialSetList.Select(x => x.ClinicalDataSetName).ToList(); - objData= new + objData = new { SiteCode = siteInfo == null ? "" : siteInfo.TrialSiteCode, SubjectCode = subject == null ? "" : subject.Code, @@ -2495,13 +2492,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common }; } } - + List urlList = new List() { "ClinicalAnswer/cRCCancelConfirmClinical", "ClinicalAnswer/PMConfirmClinical" }; - + if (urlList.Contains(_userInfo.RequestUrl)) @@ -2512,12 +2509,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common { status = "已撤回"; extraIndentification += "/revocation"; - } else if (entity.IsPMConfirm && _userInfo.RequestUrl == "ClinicalAnswer/PMConfirmClinical") + } + else if (entity.IsPMConfirm && _userInfo.RequestUrl == "ClinicalAnswer/PMConfirmClinical") { status = "已核对"; extraIndentification += "/Confirm"; } - + var readModuleCriterionFrom = await _dbContext.ReadModuleCriterionFrom.Where(t => t.ReadModuleId == entity.Id).FirstOrDefaultAsync(); var latestScanDate = await _dbContext.ReadModule.Where(t => t.Id == entity.Id).Select(x => x.SubjectVisit.LatestScanDate).FirstOrDefaultAsync(); @@ -2551,7 +2549,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common - objData=new + objData = new { SiteCode = siteInfo == null ? "" : siteInfo.TrialSiteCode, SubjectCode = subject == null ? "" : subject.Code, @@ -2561,7 +2559,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common ClinicalUploadType = clinicalDataTrialSetList.Select(x => x.ClinicalUploadType).FirstOrDefault(), CriterionNames = string.Join(",", criterionNameList.Distinct()), RecordNumber = clinicalFormIds.Count(), - Status= status, + Status = status, }; } @@ -2573,7 +2571,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId = entity.SubjectVisitId, ObjectRelationParentId2 = entity.TrialReadingCriterionId, - ExtraIndentification= extraIndentification, + ExtraIndentification = extraIndentification, //SubjectVisitId = x.SubjectVisitId, IsDistinctionInterface = false, }, objData); @@ -2620,7 +2618,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var entity = item.Entity as TaskAllocationRule; - var userRealName =await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync(); + var userRealName = await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync(); await InsertInspection(entity, type, x => new InspectionConvertDTO() { @@ -2630,9 +2628,10 @@ namespace IRaCIS.Core.Infra.EFCore.Common ObjectRelationParentId2 = entity.DoctorUserId - }, new { - UserRealName= userRealName - }); + }, new + { + UserRealName = userRealName + }); } // suject 医生绑定关系 @@ -2656,27 +2655,27 @@ namespace IRaCIS.Core.Infra.EFCore.Common } - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectCanceDoctor))) - { - var type = GetEntityAuditOpt(item); + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(SubjectCanceDoctor))) + { + var type = GetEntityAuditOpt(item); - var entity = item.Entity as SubjectCanceDoctor; + var entity = item.Entity as SubjectCanceDoctor; - await InsertInspection(entity, type, x => new InspectionConvertDTO() - { + await InsertInspection(entity, type, x => new InspectionConvertDTO() + { - ObjectRelationParentId = entity.SubjectId, + ObjectRelationParentId = entity.SubjectId, - ObjectRelationParentId3 = entity.TrialReadingCriterionId, + ObjectRelationParentId3 = entity.TrialReadingCriterionId, - }, new { }); - } + }, new { }); + } - //申请重阅记录表 - foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTaskReReading))) + //申请重阅记录表 + foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(VisitTaskReReading))) { var type = GetEntityAuditOpt(item); @@ -2704,14 +2703,14 @@ namespace IRaCIS.Core.Infra.EFCore.Common } reason = entity.RequestReReadingRejectReason; - if (entity.RequestReReadingResultEnum == RequestReReadingResult.Agree) + if (entity.RequestReReadingResultEnum == RequestReReadingResult.Agree) { - extraIdentification = extraIdentification+"/" + 1; + extraIdentification = extraIdentification + "/" + 1; } else if (entity.RequestReReadingResultEnum == RequestReReadingResult.Reject) { - extraIdentification = extraIdentification+ "/" + 2; + extraIdentification = extraIdentification + "/" + 2; } break; } @@ -2789,128 +2788,129 @@ namespace IRaCIS.Core.Infra.EFCore.Common } else { - // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 、附加评估 - if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer" - || _userInfo.RequestUrl == "ReadingImageTask/saveImageQuality" - || _userInfo.RequestUrl.Contains("SaveTaskQuestion") - || _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions" - || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer" - || _userInfo.RequestUrl == "ReadingImageTask/submitTaskAdditionalQuestion") - { - var type = AuditOpt.Add; + // 保存影像质量 、 修改整体肿瘤评估结果 、 非dicom 保存访视阅片结果 、附加评估 + if (_userInfo.RequestUrl == "ReadingImageTask/changeDicomReadingQuestionAnswer" + || _userInfo.RequestUrl == "ReadingImageTask/saveImageQuality" + || _userInfo.RequestUrl.Contains("SaveTaskQuestion") + || _userInfo.RequestUrl == "ReadingImageTask/saveVisitTaskQuestions" + || _userInfo.RequestUrl == "ReadingImageTask/changeCalculationAnswer" + || _userInfo.RequestUrl == "ReadingImageTask/submitTaskAdditionalQuestion") + { + var type = AuditOpt.Add; - List unitDataList = (await _dbContext.Dictionary.Where(x => x.Parent.Code == "ValueUnit").Where(x => x.Code != "0").ToListAsync()).Select(x => new UnitData() - { + List unitDataList = (await _dbContext.Dictionary.Where(x => x.Parent.Code == "ValueUnit").Where(x => x.Code != "0").ToListAsync()).Select(x => new UnitData() + { - Unit = (ValueUnit)int.Parse(x.Code), - UnitName = x.Value.ToString(), - }).ToList(); - var extraIdentification = string.Empty; + Unit = (ValueUnit)int.Parse(x.Code), + UnitName = x.Value.ToString(), + }).ToList(); + var extraIdentification = string.Empty; - //具体的答案 - var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList(); + //具体的答案 + var taskQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTaskQuestionAnswer)).Select(t => t.Entity as ReadingTaskQuestionAnswer).ToList(); - //获取问题名称 组合成数组 - var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).IgnoreQueryFilters().Select(t => new - { - QuestionName=t.QuestionName, - t.QuestionEnName, - QuestionId = t.Id, - t.DictionaryCode, - t.Unit, - t.ShowOrder, - AnswerType = t.Type, - }).OrderBy(t => t.ShowOrder).ToListAsync(); + //获取问题名称 组合成数组 + var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => taskQuestionAnswerList.Select(k => k.ReadingQuestionTrialId).Contains(t.Id)).IgnoreQueryFilters().Select(t => new + { + QuestionName = t.QuestionName, + t.QuestionEnName, + QuestionId = t.Id, + t.DictionaryCode, + t.Unit, + t.ShowOrder, + AnswerType = t.Type, + }).OrderBy(t => t.ShowOrder).ToListAsync(); - var firstEntity = taskQuestionAnswerList.First(); + var firstEntity = taskQuestionAnswerList.First(); - var cloneEntity = firstEntity.Clone(); + var cloneEntity = firstEntity.Clone(); - //保证Id 唯一 - cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.ReadingQuestionCriterionTrialId.ToString(), firstEntity.ReadingQuestionTrialId.ToString(), firstEntity.VisitTaskId.ToString()); + //保证Id 唯一 + cloneEntity.Id = IdentifierHelper.CreateGuid(firstEntity.ReadingQuestionCriterionTrialId.ToString(), firstEntity.ReadingQuestionTrialId.ToString(), firstEntity.VisitTaskId.ToString()); - dynamic tableQuesionAndAnswerList = null; - //自定义特有标识 - if (await _dbContext.ReadingQuestionCriterionTrial.AnyAsync(t => t.Id == firstEntity.ReadingQuestionCriterionTrialId && t.CriterionType == CriterionType.SelfDefine)) - { - extraIdentification = "/Self"; + dynamic tableQuesionAndAnswerList = null; + //自定义特有标识 + if (await _dbContext.ReadingQuestionCriterionTrial.AnyAsync(t => t.Id == firstEntity.ReadingQuestionCriterionTrialId && t.CriterionType == CriterionType.SelfDefine)) + { + extraIdentification = "/Self"; - //还会把病灶问题答案更新 + //还会把病灶问题答案更新 - var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList(); + var tableQuestionAnswerList = entitys.Where(x => x.Entity.GetType() == typeof(ReadingTableQuestionAnswer)).Select(t => t.Entity as ReadingTableQuestionAnswer).ToList(); - //获取表格问题名称 组合成数组 - var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => - new - { - TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id - Type = t.ReadingQuestionTrial.QuestionName, //病灶类型 - t.ReadingQuestionTrial.Unit, - t.ReadingQuestionTrial.CustomUnit, - t.DictionaryCode, - t.QuestionName, - t.QuestionEnName, - QuestionId = t.Id, - t.ShowOrder, - AnswerType = t.Type, - }) - .OrderBy(t => t.ShowOrder).ToListAsync(); + //获取表格问题名称 组合成数组 + var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => + new + { + TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id + Type = t.ReadingQuestionTrial.QuestionName, //病灶类型 + t.ReadingQuestionTrial.Unit, + t.ReadingQuestionTrial.CustomUnit, + t.DictionaryCode, + t.QuestionName, + t.QuestionEnName, + QuestionId = t.Id, + t.ShowOrder, + AnswerType = t.Type, + }) + .OrderBy(t => t.ShowOrder).ToListAsync(); - tableQuesionAndAnswerList = tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => - new - { - //如果问题类型是附件 特殊处理 方便前端解析 - Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, - u.QuestionName, - u.QuestionEnName, - u.DictionaryCode, - u.ShowOrder, - t.RowId - } - ).OrderBy(t => t.RowId).ThenBy(t => t.ShowOrder).ToList(); + tableQuesionAndAnswerList = tableQuestionAnswerList.Join(tableQuesionList, t => t.TableQuestionId, u => u.QuestionId, (t, u) => + new + { + //如果问题类型是附件 特殊处理 方便前端解析 + Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer, + u.QuestionName, + u.QuestionEnName, + u.DictionaryCode, + u.ShowOrder, + t.RowId + } + ).OrderBy(t => t.RowId).ThenBy(t => t.ShowOrder).ToList(); - } + } - await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO() - { - VisitTaskId = x.VisitTaskId, + await InsertInspection(cloneEntity, type, x => new InspectionConvertDTO() + { + VisitTaskId = x.VisitTaskId, - ObjectRelationParentId = x.VisitTaskId, + ObjectRelationParentId = x.VisitTaskId, - TrialReadingCriterionId = x.ReadingQuestionCriterionTrialId, + TrialReadingCriterionId = x.ReadingQuestionCriterionTrialId, - ExtraIndentification = extraIdentification, + ExtraIndentification = extraIdentification, - }, new - { - QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, - t => t.ReadingQuestionTrialId, - u => u.QuestionId, - (t, u) => - new { - Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty() - , - u.DictionaryCode, - u.QuestionName, - u.QuestionEnName, - u.ShowOrder - }).OrderBy(t => t.ShowOrder).ToList() - , - TableQuestionAndAnswerList = tableQuesionAndAnswerList - } - ); + }, new + { + QuestionAnswerList = taskQuestionAnswerList.Join(quesionList, + t => t.ReadingQuestionTrialId, + u => u.QuestionId, + (t, u) => + new + { + Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty() + , + u.DictionaryCode, + u.QuestionName, + u.QuestionEnName, + u.ShowOrder + }).OrderBy(t => t.ShowOrder).ToList() + , + TableQuestionAndAnswerList = tableQuesionAndAnswerList + } + ); - } - } - + } + } + } @@ -2933,8 +2933,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common Unit = (ValueUnit)int.Parse(x.Code), }).ToList(); - //获取表格问题名称 组合成数组 - var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => + //获取表格问题名称 组合成数组 + var tableQuesionList = await _dbContext.ReadingTableQuestionTrial.Where(t => tableQuestionAnswerList.Select(k => k.TableQuestionId).Contains(t.Id)).Select(t => new { TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id @@ -2966,15 +2966,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common originalRowMark = await _dbContext.ReadingTableAnswerRowInfo.Where(t => t.Id == entity.SplitRowId).Select(t => t.RowMark).FirstOrDefaultAsync(); } - //处理标识 因为触发器在稽查后才进行操作 + //处理标识 因为触发器在稽查后才进行操作 - if (entity.OrderMark == string.Empty) - { - entity.OrderMark = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync(); + if (entity.OrderMark == string.Empty) + { + entity.OrderMark = await _dbContext.ReadingQuestionTrial.Where(x => x.Id == entity.QuestionId).Select(x => x.OrderMark).FirstOrDefaultAsync(); - } + } - entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark(); + entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark(); @@ -2999,7 +2999,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common new { //如果问题类型是附件 特殊处理 方便前端解析 - Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer+ unitDataList.Where(y=>y.Unit==u.Unit).Select(x=>x.UnitName).FirstIsNullReturnEmpty(), + Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty(), //t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/, u.QuestionName, u.QuestionEnName, @@ -3122,7 +3122,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var quesionList = await _dbContext.ReadingQuestionTrial.Where(t => questionIdList.Contains(t.Id)).Select(t => new { - QuestionName=t.QuestionName, + QuestionName = t.QuestionName, t.QuestionEnName, QuestionId = t.Id, t.DictionaryCode, @@ -3140,7 +3140,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common { TaskBlindName = u.VisitTask.TaskBlindName, QuestionId = u.ReadingQuestionTrialId, - QuestionName= u.ReadingQuestionTrial.QuestionName, + QuestionName = u.ReadingQuestionTrial.QuestionName, u.ReadingQuestionTrial.QuestionEnName, u.ReadingQuestionTrial.DictionaryCode, u.ReadingQuestionTrial.ShowOrder, @@ -3230,15 +3230,15 @@ namespace IRaCIS.Core.Infra.EFCore.Common var type = GetEntityAuditOpt(item); var entity = item.Entity as VisitTask; - var userRealName = await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync(); + var userRealName = await _dbContext.User.Where(x => x.Id == entity.DoctorUserId).Select(x => x.FullName).FirstOrDefaultAsync(); VisitTaskAuditingDto obj = new VisitTaskAuditingDto() { UserRealName = userRealName, }; - #region 标识区分 + #region 标识区分 - if (type == AuditOpt.Add) + if (type == AuditOpt.Add) { //生成一致性分析任务 if (entity.IsSelfAnalysis == true) @@ -3302,7 +3302,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common //跳转阅片结果需要该参数 var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First(); - obj.SubjectCode=subjectCode; + obj.SubjectCode = subjectCode; } #region 裁判、肿瘤学、全局 都是通用的 @@ -3318,7 +3318,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var r1 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).FirstOrDefault(); var r2 = list.Where(t => t.ArmEnum == Arm.DoubleReadingArm2).FirstOrDefault(); - obj.R1 = r1.FullName; + obj.R1 = r1.FullName; obj.R2 = r2.FullName; obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2"; } @@ -3409,9 +3409,9 @@ namespace IRaCIS.Core.Infra.EFCore.Common obj.CutOffVisitName = await _dbContext.SubjectVisit.Where(x => x.Id == subjectVisitId).Select(x => x.BlindName).FirstOrDefaultAsync(); - } + } - await InsertInspection(entity, type, x => new InspectionConvertDTO() + await InsertInspection(entity, type, x => new InspectionConvertDTO() { VisitTaskId = x.Id, @@ -3459,7 +3459,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var generalId = (inspection.GeneralId != null && inspection.GeneralId != Guid.Empty) ? inspection.GeneralId : entityObj.Id; inspection.GeneralId = generalId; - inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification; + inspection.Identification = GetInspectionRecordIdentification(entityObj, type, inspection.IsDistinctionInterface, inspection.IsSelfDefine) + inspection.ExtraIndentification; //将实体对象属性 映射到稽查实体 MapEntityPropertyToAuditEntity(entityObj, inspection); @@ -3564,7 +3564,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common InspectionGeneralData generalData = new InspectionGeneralData() { - TrialSiteId=inspection.TrialSiteId, + TrialSiteId = inspection.TrialSiteId, SubjectId = inspection.SubjectId, SubjectVisitId = inspection.SubjectVisitId, TrialId = inspection.TrialId, @@ -3638,7 +3638,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common var subject = _dbContext.Subject.Find(generalData.SubjectId); generalData.TrialId = subject?.TrialId; - generalData.TrialSiteId = subject?.TrialSiteId ; + generalData.TrialSiteId = subject?.TrialSiteId; } else { @@ -3669,7 +3669,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// 获取稽查记录的标识符 部分业务会进行特殊处理 /// /// - public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false) + public string GetInspectionRecordIdentification(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false) { var entityTypeName = entityObj.GetType().Name; diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingDto.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingDto.cs index ced7f0951..f1a95da9b 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingDto.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.ComponentModel.DataAnnotations; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; namespace IRaCIS.Core.Infra.EFCore.Common diff --git a/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs b/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs index 2afd573c2..cc0ea5866 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/ReadingCommon.cs @@ -1,14 +1,6 @@ -using IRaCIS.Core.Domain.Models; -using IRaCIS.Core.Domain.Share; -using Microsoft.AspNetCore.Mvc; -using System; -using System.Collections.Generic; +using IRaCIS.Core.Domain.Share; using System.ComponentModel.DataAnnotations; -using System.Linq; using System.Reflection; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Hosting; namespace IRaCIS.Core.Infra.EFCore.Common { @@ -50,11 +42,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common if (isConvertedTask) { - return new List() { CrterionDictionaryGroup.General, CrterionDictionaryGroup.Converted }; + return new List() { CrterionDictionaryGroup.General, CrterionDictionaryGroup.Converted }; } else { - return new List() { CrterionDictionaryGroup.General, CrterionDictionaryGroup.BeforeConvert }; + return new List() { CrterionDictionaryGroup.General, CrterionDictionaryGroup.BeforeConvert }; } } @@ -93,7 +85,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common public const string Calculation = "calculation"; } - + public static Dictionary SplitLesionDic = new Dictionary() @@ -160,27 +152,27 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// /// public static string GetEnumNullInt(this T? value) where T : struct, Enum - { + { if (value == null) { return string.Empty; } else { - return ((int)(object)value).ToString(); - } - - } + return ((int)(object)value).ToString(); + } - /// - /// 获取枚举Int值 - /// - /// - /// - /// - public static string GetEnumInt(this T value) where T : Enum + } + + /// + /// 获取枚举Int值 + /// + /// + /// + /// + public static string GetEnumInt(this T value) where T : Enum { - + return ((int)(object)value).ToString(); } @@ -191,7 +183,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common /// /// /// - public static bool EqEnum(this string value, T enumValue) where T:Enum + public static bool EqEnum(this string value, T enumValue) where T : Enum { try { @@ -235,7 +227,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common return 0; } - + } diff --git a/IRaCIS.Core.Infra.EFCore/Context/Convention/DecimalPrecisionConvention.cs b/IRaCIS.Core.Infra.EFCore/Context/Convention/DecimalPrecisionConvention.cs index caf8ebd9f..01ae5aa2a 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/Convention/DecimalPrecisionConvention.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/Convention/DecimalPrecisionConvention.cs @@ -1,11 +1,5 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Conventions; -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore; @@ -30,7 +24,7 @@ public class DecimalPrecisionConvention : IModelFinalizingConvention .SelectMany( entityType => entityType.GetDeclaredProperties() .Where( - property => property.ClrType == typeof(decimal) || property.ClrType == typeof(decimal?)))) + property => property.ClrType == typeof(decimal) || property.ClrType == typeof(decimal?)))) { diff --git a/IRaCIS.Core.Infra.EFCore/Context/Convention/DefaultStringLengthConvention .cs b/IRaCIS.Core.Infra.EFCore/Context/Convention/DefaultStringLengthConvention .cs index 1e5845ef8..f4c49057e 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/Convention/DefaultStringLengthConvention .cs +++ b/IRaCIS.Core.Infra.EFCore/Context/Convention/DefaultStringLengthConvention .cs @@ -1,8 +1,6 @@ using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Conventions; -using System; using System.ComponentModel.DataAnnotations; -using System.Linq; namespace IRaCIS.Core.Infra.EFCore; diff --git a/IRaCIS.Core.Infra.EFCore/Context/DbContextExt.cs b/IRaCIS.Core.Infra.EFCore/Context/DbContextExt.cs index 88d80e112..81d671a24 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/DbContextExt.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/DbContextExt.cs @@ -1,8 +1,4 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections; -using System.Collections.Generic; -using System.Linq; +using System.Collections; using System.Reflection; namespace IRaCIS.Core.Infra.EFCore; diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index a993da691..3c2d91347 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -1,30 +1,9 @@ using IRaCIS.Core.Domain.Models; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore.ChangeTracking; -using System.Reflection; -using EntityFramework.Exceptions.SqlServer; -using IRaCIS.Core.Domain.Share; -using MassTransit; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.ValueGeneration; -using UserTypeGroup = IRaCIS.Core.Domain.Models.UserTypeGroup; using IRaCIS.Core.Infra.EFCore.Common; -using Microsoft.Identity.Client; -using EntityFramework.Exceptions.Common; -using System.Data; -using IRaCIS.Core.Infrastructure; -using System.Reflection.Metadata; -using System.Collections.Generic; using System.ComponentModel; -using Microsoft.VisualBasic; -using System.ComponentModel.DataAnnotations; +using System.Data; +using System.Reflection; +using UserTypeGroup = IRaCIS.Core.Domain.Models.UserTypeGroup; namespace IRaCIS.Core.Infra.EFCore; @@ -568,6 +547,6 @@ public class IRaCISDBContext : DbContext public virtual DbSet TrialImageDownload { get; set; } - + } \ No newline at end of file diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs index 55d07f2f7..e04cd8624 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContextFactory.cs @@ -1,10 +1,4 @@ using Microsoft.EntityFrameworkCore.Design; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore.Context; diff --git a/IRaCIS.Core.Infra.EFCore/Context/ValueGenerator/MySequentialGuidValueGenerator.cs b/IRaCIS.Core.Infra.EFCore/Context/ValueGenerator/MySequentialGuidValueGenerator.cs index 7534f6b57..184e80e42 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/ValueGenerator/MySequentialGuidValueGenerator.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/ValueGenerator/MySequentialGuidValueGenerator.cs @@ -1,6 +1,4 @@ -using System; -using IRaCIS.Core.Domain.Models; -using MassTransit; +using MassTransit; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.ValueGeneration; diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/SubjectConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/SubjectConfigration.cs index fef08e64e..e80bf8f1c 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/SubjectConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/SubjectConfigration.cs @@ -1,7 +1,5 @@ using IRaCIS.Core.Domain.Models; -using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System.Reflection.Emit; namespace IRaCIS.Core.Infra.EFCore.EntityConfigration @@ -83,7 +81,7 @@ namespace IRaCIS.Core.Infra.EFCore.EntityConfigration public void Configure(EntityTypeBuilder builder) { //TrialUser 和User 之间 一对多 (一个用户可以参与多个项目) - builder.HasOne(s => s.User) + builder.HasOne(s => s.User) .WithMany(t => t.UserTrials) .HasForeignKey(s => s.UserId); diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/TrialUserConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/TrialUserConfigration.cs index 98ccf65cd..7449ba29e 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/TrialUserConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/TrialUserConfigration.cs @@ -1,5 +1,4 @@ using IRaCIS.Core.Domain.Models; -using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; namespace IRaCIS.Core.Infra.EFCore.EntityConfigration diff --git a/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs b/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs index 2f355ef5e..c592a9fbb 100644 --- a/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs +++ b/IRaCIS.Core.Infra.EFCore/EntityConfigration/VisitTaskConfigration.cs @@ -1,14 +1,12 @@ using IRaCIS.Core.Domain.Models; -using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -using System.Reflection.Emit; namespace IRaCIS.Core.Infra.EFCore.EntityConfigration { public class VisitTaskConfigration : IEntityTypeConfiguration { - + public void Configure(EntityTypeBuilder builder) { diff --git a/IRaCIS.Core.Infra.EFCore/GlobalUsings.cs b/IRaCIS.Core.Infra.EFCore/GlobalUsings.cs new file mode 100644 index 000000000..a3b781dcb --- /dev/null +++ b/IRaCIS.Core.Infra.EFCore/GlobalUsings.cs @@ -0,0 +1,9 @@ +global using Microsoft.EntityFrameworkCore; +global using System; +global using System.Collections.Generic; +global using System.Linq; +global using System.Linq.Expressions; +global using System.Threading; +global using System.Threading.Tasks; + + diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs index 2ea86c02c..c851f0f65 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AuditEntityInterceptor.cs @@ -2,17 +2,9 @@ using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore.Common; -using IRaCIS.Core.Infra.EFCore.Interceptor; -using Microsoft.AspNetCore.Mvc.Diagnostics; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Diagnostics; using Microsoft.Extensions.Logging; -using System; using System.Data; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore; @@ -54,9 +46,9 @@ public class AuditEntityInterceptor(IUserInfo _userInfo, ILoggert.Metadata.ClrType==typeof(string) && t.CurrentValue == null)) + foreach (var property in entry.Properties.Where(t => t.Metadata.ClrType == typeof(string) && t.CurrentValue == null)) { - property.CurrentValue = string.Empty; + property.CurrentValue = string.Empty; } switch (entry.State) diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs index f89896e3c..d7f0ec974 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/DispatchDomainEventsInterceptor.cs @@ -1,17 +1,7 @@ -using Microsoft.EntityFrameworkCore.Diagnostics; -using Microsoft.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Models; using MassTransit; -using EntityFramework.Exceptions.Common; -using IRaCIS.Core.Infrastructure; +using Microsoft.EntityFrameworkCore.Diagnostics; using System.Data; -using Microsoft.Extensions.Logging; namespace IRaCIS.Core.Infra.EFCore.Interceptor { @@ -61,6 +51,6 @@ namespace IRaCIS.Core.Infra.EFCore.Interceptor await publishEndpoint.Publish(domainEvent); } } - + } } diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/QueryWithNoLockDbCommandInterceptor.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/QueryWithNoLockDbCommandInterceptor.cs index cca322b36..675a72408 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/QueryWithNoLockDbCommandInterceptor.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/QueryWithNoLockDbCommandInterceptor.cs @@ -1,11 +1,6 @@ using Microsoft.EntityFrameworkCore.Diagnostics; -using System; -using System.Collections.Generic; using System.Data.Common; -using System.Text; using System.Text.RegularExpressions; -using System.Threading; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore { diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/SoftDeleteQueryExtension.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/SoftDeleteQueryExtension.cs index 5f517893f..d7acc11a5 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/SoftDeleteQueryExtension.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/SoftDeleteQueryExtension.cs @@ -1,12 +1,6 @@ using IRaCIS.Core.Domain.Models; using Microsoft.EntityFrameworkCore.Metadata; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; using System.Reflection; -using System.Text; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore { @@ -21,7 +15,7 @@ namespace IRaCIS.Core.Infra.EFCore .MakeGenericMethod(entityData.ClrType); var filter = methodToCall.Invoke(null, new object[] { }); entityData.SetQueryFilter((LambdaExpression)filter); - + } private static LambdaExpression GetSoftDeleteFilter() diff --git a/IRaCIS.Core.Infra.EFCore/Repository/DynamicRelationalExtensions.cs b/IRaCIS.Core.Infra.EFCore/Repository/DynamicRelationalExtensions.cs index b2ebb10f0..ed9db8ce5 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/DynamicRelationalExtensions.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/DynamicRelationalExtensions.cs @@ -1,13 +1,5 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Query; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; +using Microsoft.EntityFrameworkCore.Query; using System.Reflection; -using System.Text; -using System.Threading; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore { diff --git a/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs index 68e05af17..feb8acd5c 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/ICommandRepository.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq.Expressions; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Models; using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Query; @@ -95,7 +89,7 @@ namespace IRaCIS.Core.Infra.EFCore /// /// /// - Task FirstAsync(Expression> exp = null, bool isTracking = false,bool ignoreQueryFilters = false); + Task FirstAsync(Expression> exp = null, bool isTracking = false, bool ignoreQueryFilters = false); /// ///跟踪 查询单个实体,会出现NUll 可以直接在实体对属性进行修改,然后save diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IQueryRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/IQueryRepository.cs index 8b9a723a6..b52e4c989 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IQueryRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IQueryRepository.cs @@ -1,18 +1,12 @@ using AutoMapper; using IRaCIS.Core.Domain.Models; //using AutoMapper.EntityFrameworkCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore { public interface IQueryRepository where TEntity : Entity { - IQueryable Select( Expression> selector); + IQueryable Select(Expression> selector); ValueTask FindAsync(TKey id, CancellationToken cancellationToken = default); @@ -24,7 +18,7 @@ namespace IRaCIS.Core.Infra.EFCore { TEntity ImageFind(Guid id, Type type); IQueryable Where(Expression> exp = null, bool isTraking = false, bool ignoreQueryFilters = false); - IQueryable AsQueryable( bool ignoreQueryFilters = false); + IQueryable AsQueryable(bool ignoreQueryFilters = false); IQueryable WhereIf(bool condition, Expression> filter); IQueryable ProjectTo(IConfigurationProvider configuration, params Expression>[] membersToExpand); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs b/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs index 25059eb64..ca1a44653 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IRaCISContextExtension.cs @@ -1,17 +1,8 @@ -using AutoMapper.Internal; -using EFCore.BulkExtensions; -using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Query; -using SharpCompress.Factories; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; using System.Reflection; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore { @@ -235,7 +226,7 @@ namespace IRaCIS.Core.Infra.EFCore public static async Task ExecuteUpdateAsync(this IRaCISDBContext _dbContext, Expression> where, Expression, SetPropertyCalls>> setPropertyCalls) where T : Entity { - return await _dbContext.Set().Where(where).ExecuteUpdateAsync(setPropertyCalls)>0; + return await _dbContext.Set().Where(where).ExecuteUpdateAsync(setPropertyCalls) > 0; } diff --git a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs index 0d30571c0..bd33d1a93 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/IRepository.cs @@ -2,16 +2,10 @@ using AutoMapper; using IRaCIS.Core.Domain.Models; +using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.ChangeTracking; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Threading.Tasks; -using IRaCIS.Core.Domain.Share; using Microsoft.Extensions.Localization; namespace IRaCIS.Core.Infra.EFCore @@ -176,7 +170,7 @@ namespace IRaCIS.Core.Infra.EFCore if (dbEntity == null) { - + throw new BusinessValidationFailedException(_localizer["Repository_UpdateError"]); } @@ -378,7 +372,7 @@ namespace IRaCIS.Core.Infra.EFCore { _dbContext.Set().UpdateRange(entities); - await SaveChangesAsync(autoSave); + await SaveChangesAsync(autoSave); } @@ -428,9 +422,9 @@ namespace IRaCIS.Core.Infra.EFCore { if (updateFilter == null) { - - throw new ArgumentException("The update filter condition cannot be empty", nameof(updateFilter)); + + throw new ArgumentException("The update filter condition cannot be empty", nameof(updateFilter)); } var query = ignoreQueryFilter ? _dbContext.Set().AsNoTracking().IgnoreQueryFilters() : _dbContext.Set().AsNoTracking(); @@ -446,7 +440,7 @@ namespace IRaCIS.Core.Infra.EFCore public async Task UpdateAsync(T waitModifyEntity, Expression> updateFactory, bool autoSave = false) where T : Entity { - + _dbContext.EntityModifyPartialFiled(waitModifyEntity, updateFactory); return await SaveChangesAsync(autoSave); diff --git a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs index 9b7b7c487..d27e4021f 100644 --- a/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs +++ b/IRaCIS.Core.Infra.EFCore/Repository/Repository.cs @@ -1,20 +1,12 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Linq.Expressions; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; -using AutoMapper; -using IRaCIS.Core.Domain.Models; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.ChangeTracking; +using AutoMapper; using AutoMapper.QueryableExtensions; +using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; using IRaCIS.Core.Infrastructure.Extention; -using Microsoft.Extensions.Localization; +using Microsoft.EntityFrameworkCore.ChangeTracking; using Microsoft.EntityFrameworkCore.Query; +using Microsoft.Extensions.Localization; namespace IRaCIS.Core.Infra.EFCore { @@ -153,14 +145,14 @@ namespace IRaCIS.Core.Infra.EFCore /// EF跟踪方式 先查询出来,再更新部分字段 当在同一个事务里面需要更新同一个实体两次,请使用该方法,否则会因为重复跟踪同一个实体报错 (稽查的时候需要完整的实体信息) public async Task UpdatePartialFromQueryAsync(Guid id, Expression> updateFactory, - bool autoSave = false, CancellationToken cancellationToken = default) + bool autoSave = false, CancellationToken cancellationToken = default) { //var query = ignoreQueryFilter ? _dbSet.AsNoTracking().IgnoreQueryFilters() : _dbSet.AsNoTracking(); //不跟踪 查询出来的实体就是Detached - var searchEntity = await _dbSet.FindAsync( id); + var searchEntity = await _dbSet.FindAsync(id); if (searchEntity == null) { @@ -275,7 +267,7 @@ namespace IRaCIS.Core.Infra.EFCore Expression> updateFactory) { - return await _dbContext.BatchUpdateNoTrackingAsync(where, updateFactory,_userInfo.Id); + return await _dbContext.BatchUpdateNoTrackingAsync(where, updateFactory, _userInfo.Id); } @@ -477,7 +469,7 @@ namespace IRaCIS.Core.Infra.EFCore } - public bool Any(Expression> exp, bool ignoreQueryFilters = false) + public bool Any(Expression> exp, bool ignoreQueryFilters = false) { var query = _dbSet.AsQueryable(); @@ -486,7 +478,7 @@ namespace IRaCIS.Core.Infra.EFCore query = query.IgnoreQueryFilters(); } - return query.AsNoTracking().Any(exp); + return query.AsNoTracking().Any(exp); } public async Task CountAsync(Expression> whereLambda = null, bool ignoreQueryFilters = false) diff --git a/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWork.cs b/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWork.cs index 2b80fab4e..2271b139a 100644 --- a/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWork.cs +++ b/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWork.cs @@ -20,7 +20,7 @@ // DbContext = dbContext; // } - + // public void BeginTransaction(IsolationLevel isolationLevel = IsolationLevel.ReadCommitted) // { // if (DbContext.Database.IsRelational()) @@ -57,6 +57,6 @@ // _transaction?.Dispose(); // } - + // } //} diff --git a/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWorkFilter.cs b/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWorkFilter.cs index fd464e4c3..12fa68bab 100644 --- a/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWorkFilter.cs +++ b/IRaCIS.Core.Infra.EFCore/UnitOfWork/EFUnitOfWorkFilter.cs @@ -1,10 +1,7 @@ using Microsoft.AspNetCore.Mvc.Controllers; using Microsoft.AspNetCore.Mvc.Filters; -using Microsoft.EntityFrameworkCore; -using System; using System.Data; using System.Reflection; -using System.Threading.Tasks; namespace IRaCIS.Core.Infra.EFCore { @@ -107,12 +104,12 @@ namespace IRaCIS.Core.Infra.EFCore await _transaction?.RollbackAsync(); } } - - + + }); + } } } -} } diff --git a/IRaCIS.Core.Test/GenerateContextModelFolder/Dictionary.cs b/IRaCIS.Core.Test/GenerateContextModelFolder/Dictionary.cs deleted file mode 100644 index 41fd5b3ff..000000000 --- a/IRaCIS.Core.Test/GenerateContextModelFolder/Dictionary.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using IRaCIS.Core.Domain.Models; - -namespace IRaCIS.Core.Test.GenerateContextModelFolder; - -[Comment("后台 - 字典表(需要同步)")] -[Table("Dictionary")] -public partial class Dictionary: BaseFullAuditEntity -{ - [StringLength(400)] - public string ChildGroup { get; set; } = null!; - - public string Code { get; set; } = null!; - - public Guid? ConfigTypeId { get; set; } - - [Comment(" 字典类型- 枚举|bool|下拉框")] - public int DataTypeEnum { get; set; } - - [StringLength(512)] - public string Description { get; set; } = null!; - - [Comment(" 是否字典类型配置")] - public bool IsConfig { get; set; } - - public bool IsEnable { get; set; } - - public Guid? ParentId { get; set; } - - public int ShowOrder { get; set; } - - [StringLength(400)] - public string Value { get; set; } = null!; - - [StringLength(400)] - public string ValueCN { get; set; } = null!; -} diff --git a/IRaCIS.Core.Test/GenerateContextModelFolder/TempContext.cs b/IRaCIS.Core.Test/GenerateContextModelFolder/TempContext.cs deleted file mode 100644 index e3443c1e1..000000000 --- a/IRaCIS.Core.Test/GenerateContextModelFolder/TempContext.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; - -namespace IRaCIS.Core.Test.GenerateContextModelFolder; - -public partial class TempContext : DbContext -{ - public TempContext() - { - } - - public TempContext(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet Dictionaries { get; set; } - - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) -#warning To protect potentially sensitive information in your connection string, you should move it out of source code. You can avoid scaffolding the connection string by using the Name= syntax to read it from configuration - see https://go.microsoft.com/fwlink/?linkid=2131148. For more guidance on storing connection strings, see https://go.microsoft.com/fwlink/?LinkId=723263. - => optionsBuilder.UseSqlServer("Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true"); - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.UseCollation("Chinese_PRC_CI_AS"); - - modelBuilder.Entity(entity => - { - entity.ToTable("Dictionary", tb => tb.HasComment("后台 - 字典表(需要同步)")); - - entity.Property(e => e.Id).ValueGeneratedNever(); - entity.Property(e => e.ChildGroup).HasDefaultValue(""); - entity.Property(e => e.Code).HasDefaultValue(""); - entity.Property(e => e.DataTypeEnum).HasComment("字典类型- 枚举|bool|下拉框"); - entity.Property(e => e.IsConfig).HasComment("是否字典类型配置"); - entity.Property(e => e.IsEnable).HasDefaultValue(true); - entity.Property(e => e.Value).HasDefaultValue(""); - entity.Property(e => e.ValueCN).HasDefaultValue(""); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); -} diff --git a/IRaCIS.Core.Test/LiquidTemplate/EntityViewModel.liquid b/IRaCIS.Core.Test/LiquidTemplate/EntityViewModel.liquid index 87f4d4f2d..64c03e2b6 100644 --- a/IRaCIS.Core.Test/LiquidTemplate/EntityViewModel.liquid +++ b/IRaCIS.Core.Test/LiquidTemplate/EntityViewModel.liquid @@ -11,32 +11,32 @@ namespace IRaCIS.Core.Application.ViewModel; public class {{ TableNameView }} : {{ TableNameAddOrEdit }} { - {% for field in ViewListFieldList %} - public {{ field.CSharpType }} {{ field.FieldName }} { get; set; } + {% for field in ViewListFieldList %} + public {{ field.CSharpType }} {{ field.FieldName }} { get; set; } {% endfor %} } public class {{ TableNameAddOrEdit }} { - {%- for field in AddOrUpdateFieldList -%} - {% if field.IsPrimarykey %} - public {{ field.CSharpType }}? {{ field.FieldName }} { get; set; } - {% else %} - public {{ field.CSharpType }} {{ field.FieldName }} { get; set; } - {% endif %} - {%- endfor -%} +{%- for field in AddOrUpdateFieldList -%} + {% if field.IsPrimarykey %} + public {{ field.CSharpType }}? {{ field.FieldName }} { get; set; } + {% else %} + public {{ field.CSharpType }} {{ field.FieldName }} { get; set; } + {% endif %} +{%- endfor -%} } public class {{ TableNameQuery }} { - {%- for field in QueryListFieldList -%} - {% if field.IsNullable and field.IsCSharpString == false %} - public {{ field.CSharpType }} {{ field.FieldName }} { get; set; } - {% else %} - public {{ field.CSharpType }}? {{ field.FieldName }} { get; set; } - {% endif %} - {%- endfor -%} +{%- for field in QueryListFieldList -%} +{% if field.IsNullable and field.IsCSharpString == false %} + public {{ field.CSharpType }} {{ field.FieldName }} { get; set; } + {% else %} + public {{ field.CSharpType }}? {{ field.FieldName }} { get; set; } + {% endif %} +{%- endfor -%} } diff --git a/IRaCIS.Core.Test/LiquidTemplate/IEntityService.liquid b/IRaCIS.Core.Test/LiquidTemplate/IEntityService.liquid index cd38ad0fc..788946d56 100644 --- a/IRaCIS.Core.Test/LiquidTemplate/IEntityService.liquid +++ b/IRaCIS.Core.Test/LiquidTemplate/IEntityService.liquid @@ -12,14 +12,14 @@ namespace IRaCIS.Core.Application.Interfaces; public interface I{{TableName}}Service { - {% if IsPaged %} - Task> Get{{TableName}}List({{TableNameQuery}} inQuery); - {% else %} - Task> Get{{TableName}}List({{TableNameQuery}} inQuery); - {% endif %} - Task AddOrUpdate{{TableName}}({{TableNameAddOrEdit}} addOrEdit{{TableName}}); +{% if IsPaged %} + Task Get{{TableName}}List({{TableNameQuery}} inQuery); +{% else %} + Task> Get{{TableName}}List({{TableNameQuery}} inQuery); +{% endif %} + Task AddOrUpdate{{TableName}}({{TableNameAddOrEdit}} addOrEdit{{TableName}}); - Task Delete{{TableNameView}}(Guid {{LowercaseTableNameId}}); + Task Delete{{TableNameView}}(Guid {{LowercaseTableNameId}}); } diff --git a/IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryService.cs b/IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryService.cs deleted file mode 100644 index 8bf4ef952..000000000 --- a/IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryService.cs +++ /dev/null @@ -1,60 +0,0 @@ - -//-------------------------------------------------------------------- -// 此代码由liquid模板自动生成 byzhouhang 20240909 -// 生成时间 2024-09-20 01:22:34Z -// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 -//-------------------------------------------------------------------- -using IRaCIS.Core.Domain.Models; -using Microsoft.AspNetCore.Mvc; -using IRaCIS.Core.Application.Interfaces; -using IRaCIS.Core.Application.ViewModel; -using IRaCIS.Core.Infrastructure.Extention; -using System.Threading.Tasks; -using IRaCIS.Core.Infra.EFCore; -namespace IRaCIS.Core.Application.Service; - -[ ApiExplorerSettings(GroupName = "Test")] -public class DictionaryService(IRepository _dictionaryRepository): BaseService, IDictionaryService -{ - - - [HttpPost] - public async Task> GetDictionaryList(DictionaryQuery inQuery) - { - - var dictionaryQueryable =_dictionaryRepository - .ProjectTo(_mapper.ConfigurationProvider); - - var pageList= await dictionaryQueryable.ToPagedListAsync(inQuery); - - return pageList; - } - - - - public async Task AddOrUpdateDictionary(DictionaryAddOrEdit addOrEditDictionary) - { - // 在此处拷贝automapper 映射 - - CreateMap(); - CreateMap().ReverseMap(); - - - var entity = await _dictionaryRepository.InsertOrUpdateAsync(addOrEditDictionary, true); - - return ResponseOutput.Ok(entity.Id.ToString()); - - } - - - [HttpDelete("{dictionaryId:guid}")] - public async Task DeleteDictionary(Guid dictionaryId) - { - var success = await _<#=char.ToLower(tableName[0]) + tableName.Substring(1)#>Repository.DeleteFromQueryAsync(t => t.Id == dictionaryId,true); - return ResponseOutput.Ok(); - } - -} - - - diff --git a/IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryViewModel.cs b/IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryViewModel.cs deleted file mode 100644 index 203974b43..000000000 --- a/IRaCIS.Core.Test/LiquidTemplateOutPut/DictionaryViewModel.cs +++ /dev/null @@ -1,76 +0,0 @@ - -//-------------------------------------------------------------------- -// 此代码由liquid模板自动生成 byzhouhang 20240909 -// 生成时间 2024-09-20 01:22:37Z -// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 -//-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Domain.Share; -using System.Collections.Generic; -namespace IRaCIS.Core.Application.ViewModel; - -public class DictionaryView : DictionaryAddOrEdit -{ - - public DateTime CreateTime { get; set; } - - public DateTime UpdateTime { get; set; } - -} - - -public class DictionaryAddOrEdit -{ - public Guid? Id { get; set; } - - public string ChildGroup { get; set; } - - public string Code { get; set; } - - public Guid? ConfigTypeId { get; set; } - - public DicDataTypeEnum DataTypeEnum { get; set; } - - public string Description { get; set; } - - public bool IsConfig { get; set; } - - public bool IsEnable { get; set; } - - public Guid? ParentId { get; set; } - - public int ShowOrder { get; set; } - - public string Value { get; set; } - - public string ValueCN { get; set; } - } - -public class DictionaryQuery -{ - public string? ChildGroup { get; set; } - - public string? Code { get; set; } - - public Guid? ConfigTypeId { get; set; } - - public DicDataTypeEnum? DataTypeEnum { get; set; } - - public string? Description { get; set; } - - public bool? IsConfig { get; set; } - - public bool? IsEnable { get; set; } - - public Guid? ParentId { get; set; } - - public int? ShowOrder { get; set; } - - public string? Value { get; set; } - - public string? ValueCN { get; set; } - } - - - - diff --git a/IRaCIS.Core.Test/LiquidTemplateOutPut/IDictionaryService.cs b/IRaCIS.Core.Test/LiquidTemplateOutPut/IDictionaryService.cs deleted file mode 100644 index d8b5e7ba7..000000000 --- a/IRaCIS.Core.Test/LiquidTemplateOutPut/IDictionaryService.cs +++ /dev/null @@ -1,23 +0,0 @@ - -//-------------------------------------------------------------------- -// 此代码由liquid模板自动生成 byzhouhang 20240909 -// 生成时间 2024-09-20 01:22:37Z -// 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 -//-------------------------------------------------------------------- -using System; -using IRaCIS.Core.Infrastructure.Extention; -using System.Threading.Tasks; -using IRaCIS.Core.Application.ViewModel; -namespace IRaCIS.Core.Application.Interfaces; - -public interface IDictionaryService -{ - - Task> GetDictionaryList(DictionaryQuery inQuery); - - Task AddOrUpdateDictionary(DictionaryAddOrEdit addOrEditDictionary); - - Task DeleteDictionaryView(Guid dictionaryId); -} - -