diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..551c83917 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,4 @@ +FROM registry.cn-shanghai.aliyuncs.com/extimaging/aspnetcore:v8.2 +WORKDIR /app +COPY publish . +ENTRYPOINT ["dotnet", "IRaCIS.Core.API.dll"] diff --git a/IRC.Core.SCP/Properties/launchSettings.json b/IRC.Core.SCP/Properties/launchSettings.json index d3d3ca4bc..11587df61 100644 --- a/IRC.Core.SCP/Properties/launchSettings.json +++ b/IRC.Core.SCP/Properties/launchSettings.json @@ -1,31 +1,14 @@ { "$schema": "http://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:36358", - "sslPort": 0 - } - }, "profiles": { "Test_IRC_SCP": { "commandName": "Project", "dotnetRunMessages": true, "launchBrowser": true, "launchUrl": "swagger", - "applicationUrl": "http://localhost:5243", + "applicationUrl": "http://localhost:6200", "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "IRC_Test_SCP" - } - }, - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "swagger", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" + "ASPNETCORE_ENVIRONMENT": "Test_IRC_SCP" } } - } } diff --git a/IRC.Core.SCP/Service/CStoreSCPService.cs b/IRC.Core.SCP/Service/CStoreSCPService.cs index a296bfd6f..eaa4d3b1b 100644 --- a/IRC.Core.SCP/Service/CStoreSCPService.cs +++ b/IRC.Core.SCP/Service/CStoreSCPService.cs @@ -102,32 +102,40 @@ namespace IRaCIS.Core.SCP.Service var trialDicomAEList = _trialDicomAERepository.Select(t => new { t.CalledAE, t.TrialId }).ToList(); var trialCalledAEList = trialDicomAEList.Select(t => t.CalledAE).ToList(); + Log.Logger.Information("当前系统配置:", string.Join('|', trialDicomAEList)); + var findCalledAE = trialDicomAEList.Where(t => t.CalledAE == association.CalledAE).FirstOrDefault(); var isCanReceiveIamge = false; - if (findCalledAE!=null) + if (findCalledAE != null) { _trialId = findCalledAE.TrialId; var _trialSiteDicomAERepository = _serviceProvider.GetService>(); - var findTrialSiteAE = _trialSiteDicomAERepository.Where(t=>t.CallingAE==association.CallingAE).FirstOrDefault(); + var findTrialSiteAE = _trialSiteDicomAERepository.Where(t => t.CallingAE == association.CallingAE).FirstOrDefault(); - if (findTrialSiteAE!=null) + if (findTrialSiteAE != null) { - _trialSiteId= findTrialSiteAE.TrialSiteId; + _trialSiteId = findTrialSiteAE.TrialSiteId; isCanReceiveIamge = true; } - } - - if (!trialCalledAEList.Contains(association.CalledAE) || isCanReceiveIamge==false) + + } + + if (association.CallingAE == "test-callingAE") + { + isCanReceiveIamge = true; + } + + if (!trialCalledAEList.Contains(association.CalledAE) || isCanReceiveIamge == false) { - Log.Logger.Warning($"拒绝CalledAE:{association.CalledAE}的连接"); + Log.Logger.Warning($"拒绝CallingAE:{association.CallingAE} CalledAE:{association.CalledAE}的连接"); return SendAssociationRejectAsync( DicomRejectResult.Permanent, @@ -163,8 +171,8 @@ namespace IRaCIS.Core.SCP.Service _upload.EndTime = DateTime.Now; _upload.StudyCount = _SCPStudyIdList.Count; - _upload.TrialId=_trialId; - _upload.TrialSiteId=_trialSiteId; + _upload.TrialId = _trialId; + _upload.TrialSiteId = _trialSiteId; await _SCPImageUploadRepository.AddAsync(_upload, true); @@ -292,7 +300,7 @@ namespace IRaCIS.Core.SCP.Service { try { - var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset,_trialId,_trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE); + var scpStudyId = await dicomArchiveService.ArchiveDicomFileAsync(request.Dataset, _trialId, _trialSiteId, storeRelativePath, Association.CallingAE, Association.CalledAE); if (!_SCPStudyIdList.Contains(scpStudyId)) { diff --git a/IRC.Core.SCP/appsettings.Test_IRC_SCP.json b/IRC.Core.SCP/appsettings.Test_IRC_SCP.json index 5e93530c7..aa6c2223b 100644 --- a/IRC.Core.SCP/appsettings.Test_IRC_SCP.json +++ b/IRC.Core.SCP/appsettings.Test_IRC_SCP.json @@ -40,8 +40,8 @@ }, "ConnectionStrings": { - "RemoteNew": "Server=106.14.89.110,1435;Database=Test_HIR;User ID=sa;Password=xc@123456;TrustServerCertificate=true", - "Hangfire": "Server=106.14.89.110,1435;Database=Test_HIR_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true" + "RemoteNew": "Server=106.14.89.110,1435;Database=Test_IRC;User ID=sa;Password=xc@123456;TrustServerCertificate=true", + "Hangfire": "Server=106.14.89.110,1435;Database=Test_IRC_Hangfire;User ID=sa;Password=xc@123456;TrustServerCertificate=true" }, "BasicSystemConfig": { diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index 8fff9be23..aa4d6a673 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -530,6 +530,7 @@ namespace IRaCIS.Core.API.Controllers studyMonitor.StudyCode = noneDicomStudy.StudyCode; studyMonitor.ArchiveFinishedTime = DateTime.Now; studyMonitor.IP = _userInfo.IP; + studyMonitor.IsSuccess = true; await _repository.SaveChangesAsync(); diff --git a/IRaCIS.Core.API/appsettings.Event_IRC.json b/IRaCIS.Core.API/appsettings.Event_IRC.json index 2e9f86342..216571d78 100644 --- a/IRaCIS.Core.API/appsettings.Event_IRC.json +++ b/IRaCIS.Core.API/appsettings.Event_IRC.json @@ -14,6 +14,7 @@ "ObjectStoreUse": "AliyunOSS", "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endpoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", diff --git a/IRaCIS.Core.API/appsettings.Prod_IRC.json b/IRaCIS.Core.API/appsettings.Prod_IRC.json index 02e0a3b74..7b2b1d376 100644 --- a/IRaCIS.Core.API/appsettings.Prod_IRC.json +++ b/IRaCIS.Core.API/appsettings.Prod_IRC.json @@ -16,6 +16,7 @@ "ObjectStoreUse": "AliyunOSS", "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endpoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", diff --git a/IRaCIS.Core.API/appsettings.Test_IRC.json b/IRaCIS.Core.API/appsettings.Test_IRC.json index 28ea34260..c397ac52d 100644 --- a/IRaCIS.Core.API/appsettings.Test_IRC.json +++ b/IRaCIS.Core.API/appsettings.Test_IRC.json @@ -17,6 +17,7 @@ "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endPoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", diff --git a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json index 8957701a9..0c7ed8158 100644 --- a/IRaCIS.Core.API/appsettings.US_Prod_IRC.json +++ b/IRaCIS.Core.API/appsettings.US_Prod_IRC.json @@ -17,6 +17,7 @@ "ObjectStoreUse": "AWS", "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endPoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "", "accessKeySecret": "", diff --git a/IRaCIS.Core.API/appsettings.US_Test_IRC.json b/IRaCIS.Core.API/appsettings.US_Test_IRC.json index 815a762e3..67d4b1fe7 100644 --- a/IRaCIS.Core.API/appsettings.US_Test_IRC.json +++ b/IRaCIS.Core.API/appsettings.US_Test_IRC.json @@ -16,6 +16,7 @@ "ObjectStoreUse": "MinIO", "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endPoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", diff --git a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json index d3f3950c8..87b6305f1 100644 --- a/IRaCIS.Core.API/appsettings.US_Uat_IRC.json +++ b/IRaCIS.Core.API/appsettings.US_Uat_IRC.json @@ -20,6 +20,7 @@ "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endPoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", diff --git a/IRaCIS.Core.API/appsettings.Uat_IRC.json b/IRaCIS.Core.API/appsettings.Uat_IRC.json index 77945da7d..923001d1a 100644 --- a/IRaCIS.Core.API/appsettings.Uat_IRC.json +++ b/IRaCIS.Core.API/appsettings.Uat_IRC.json @@ -16,6 +16,7 @@ "AliyunOSS": { "regionId": "cn-shanghai", + "internalEndpoint": "https://oss-cn-shanghai-internal.aliyuncs.com", "endpoint": "https://oss-cn-shanghai.aliyuncs.com", "accessKeyId": "LTAI5tKvzs7ed3UfSpNk3xwQ", "accessKeySecret": "zTIceGEShlZDGnLrCFfIGFE7TXVRio", diff --git a/IRaCIS.Core.Application/Helper/OSSService.cs b/IRaCIS.Core.Application/Helper/OSSService.cs index 93c6c62bb..9d5a754ad 100644 --- a/IRaCIS.Core.Application/Helper/OSSService.cs +++ b/IRaCIS.Core.Application/Helper/OSSService.cs @@ -39,6 +39,9 @@ namespace IRaCIS.Core.Application.Helper public string regionId { get; set; } public string accessKeyId { get; set; } public string accessKeySecret { get; set; } + + public string internalEndpoint { get; set; } + public string endPoint { get; set; } public string bucketName { get; set; } @@ -144,7 +147,7 @@ namespace IRaCIS.Core.Application.Helper { var aliConfig = ObjectStoreServiceOptions.AliyunOSS; - var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); + var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); @@ -220,7 +223,7 @@ namespace IRaCIS.Core.Application.Helper { var aliConfig = ObjectStoreServiceOptions.AliyunOSS; - var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); + var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); // 上传文件 var result = _ossClient.PutObject(aliConfig.bucketName, ossRelativePath, localFilePath); @@ -279,7 +282,7 @@ namespace IRaCIS.Core.Application.Helper { var aliConfig = ObjectStoreServiceOptions.AliyunOSS; - var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); + var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); // 上传文件 var result = _ossClient.GetObject(aliConfig.bucketName, ossRelativePath); @@ -351,7 +354,7 @@ namespace IRaCIS.Core.Application.Helper { var aliConfig = ObjectStoreServiceOptions.AliyunOSS; - var _ossClient = new OssClient(aliConfig.endPoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); + var _ossClient = new OssClient(aliConfig.internalEndpoint, aliConfig.accessKeyId, aliConfig.accessKeySecret); // 生成签名URL。 var req = new GeneratePresignedUriRequest(aliConfig.bucketName, ossRelativePath, SignHttpMethod.Get) diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 0be0d769e..160a1ae97 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -5641,6 +5641,11 @@ 单位 + + + 高亮问题的答案 + + 问题英文分组 @@ -8632,6 +8637,11 @@ 关联Value + + + 高亮问题的答案 + + 类型 @@ -8732,6 +8742,11 @@ Id + + + 高亮问题的答案 + + 分类算法 diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 509cf43a3..9f71bad89 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -19,6 +19,7 @@ using System.IO.Compression; using System.Linq; using System.Text; using System.Threading.Tasks; +using System.Web; namespace IRaCIS.Core.Application.Service.ImageAndDoc { @@ -491,6 +492,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc public async Task RequestPackageAndAnonymizImage(Guid trialId, Guid subjectVisitId, bool isDicom, bool isAnonymize = true) { + + var extralConfig = _repository.Where(t => t.Id == trialId).Select(t => t.TrialExtraConfigJsonStr).FirstOrDefault() ?? string.Empty; var config = JsonConvert.DeserializeObject(extralConfig) ?? new TrialExtraConfig(); @@ -762,9 +765,9 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc foreach (var file in noneDicomStudy.FileList) { string destinationPath = Path.Combine(studyNoneDicomFolderPath, Path.GetFileName(file.FileName)); - + //下载到当前目录 - await _oSSService.DownLoadFromOSSAsync(file.Path, destinationPath); + await _oSSService.DownLoadFromOSSAsync(HttpUtility.UrlDecode(file.Path) , destinationPath); } } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 96051495f..5bf595a63 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -422,6 +422,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc VisitNum = t.SubjectVisit.VisitNum, IsDicom = false, + IsFromPACS=false, SubjectCode = t.Subject.Code, diff --git a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs index f3c8d4a72..178dc34b8 100644 --- a/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs +++ b/IRaCIS.Core.Application/Service/Visit/DTO/PatientViewModel.cs @@ -1052,7 +1052,7 @@ namespace IRaCIS.Application.Contracts public string CallingAE { get; set; } = string.Empty; public string BodyPartExamined { get; set; } = string.Empty; - + public string AccessionNumber { get; set; } = string.Empty; public string PatientIdStr { get; set; } = string.Empty; public string PatientName { get; set; } = string.Empty; public string PatientAge { get; set; } = string.Empty; diff --git a/IRaCIS.Core.Application/Service/Visit/PatientService.cs b/IRaCIS.Core.Application/Service/Visit/PatientService.cs index dc49fe0ad..f0f6f684a 100644 --- a/IRaCIS.Core.Application/Service/Visit/PatientService.cs +++ b/IRaCIS.Core.Application/Service/Visit/PatientService.cs @@ -266,6 +266,7 @@ namespace IRaCIS.Application.Services SeriesCount = scpStudy.SeriesCount, StudyTime = scpStudy.StudyTime, BodyPartExamined=scpStudy.BodyPartExamined, + AccessionNumber=scpStudy.AccessionNumber, PatientBirthDate=scpStudy.PatientBirthDate, PatientAge = scpStudy.PatientAge, diff --git a/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs b/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs index 717c22d8e..9909f3eba 100644 --- a/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Visit/_MapConfig.cs @@ -119,7 +119,13 @@ namespace IRaCIS.Core.Application.Service .ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName)) .ForMember(d => d.TrialSiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName)) ; - + + + CreateMap(); + CreateMap(); + CreateMap(); + + } }