修改 HIR 验证
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
81443e5e36
commit
d568964c64
|
@ -20,7 +20,7 @@ namespace IRaCIS.Application.Contracts
|
|||
|
||||
public string? StudyID { get; set; }
|
||||
|
||||
public string? ModalitiesInStudy { get; set; }
|
||||
public List<string>? ModalitiesInStudyList { get; set; }
|
||||
|
||||
public string? AccessionNumber { get; set; }
|
||||
|
||||
|
@ -52,5 +52,8 @@ namespace IRaCIS.Application.Contracts
|
|||
public class SCUStudyView : SCUBasicInfo
|
||||
{
|
||||
public bool IsStudyExist { get; set; }
|
||||
|
||||
public string? ModalitiesInStudy { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2827,7 +2827,7 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
#region 基础方法
|
||||
|
||||
public static DicomCFindRequest CreateStudyRequest(SCUQuery inQuery)
|
||||
public static DicomCFindRequest CreateStudyRequest(SCUQuery inQuery, List<string> modalityList)
|
||||
{
|
||||
|
||||
var request = new DicomCFindRequest(DicomQueryRetrieveLevel.Study);
|
||||
|
@ -2862,6 +2862,8 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
//request.Dataset.AddOrUpdate(DicomTag.PatientID, "Test*");
|
||||
|
||||
var modalityQuery = string.Join($"\\", (inQuery.ModalitiesInStudyList == null || inQuery.ModalitiesInStudyList?.Count == 0) ? modalityList : inQuery.ModalitiesInStudyList);
|
||||
|
||||
//病例号
|
||||
request.Dataset.AddOrUpdate(DicomTag.PatientID, inQuery.PatientID.IsNullOrEmpty() ? "" : inQuery.PatientID);
|
||||
|
||||
|
@ -2872,16 +2874,21 @@ namespace IRaCIS.Application.Services
|
|||
request.Dataset.AddOrUpdate(DicomTag.StudyID, inQuery.StudyID.IsNullOrEmpty() ? "" : inQuery.StudyID);
|
||||
request.Dataset.AddOrUpdate(DicomTag.AccessionNumber, inQuery.StudyID.IsNullOrEmpty() ? "" : inQuery.AccessionNumber);
|
||||
|
||||
request.Dataset.AddOrUpdate(DicomTag.ModalitiesInStudy, inQuery.ModalitiesInStudy.IsNullOrEmpty() ? "" : inQuery.ModalitiesInStudy);
|
||||
//request.Dataset.AddOrUpdate(DicomTag.ModalitiesInStudy, modalityQuery);
|
||||
|
||||
request.Dataset.AddOrUpdate(DicomTag.StudyDate, inQuery.StudyDate.IsNullOrEmpty() ? "" : inQuery.StudyDate);
|
||||
request.Dataset.AddOrUpdate(DicomTag.StudyTime, inQuery.StudyTime.IsNullOrEmpty() ? "" : inQuery.StudyTime);
|
||||
|
||||
request.Dataset.AddOrUpdate(DicomTag.BodyPartExamined, inQuery.BodyPartExamined.IsNullOrEmpty() ? "" : inQuery.BodyPartExamined);
|
||||
|
||||
request.Dataset.AddOrUpdate(DicomTag.StudyDescription, inQuery.StudyDescription.IsNullOrEmpty() ? "" : inQuery.StudyDescription);
|
||||
|
||||
request.Dataset.AddOrUpdate(DicomTag.StudyInstanceUID, inQuery.StudyInstanceUID.IsNullOrEmpty() ? "" : inQuery.StudyInstanceUID);
|
||||
|
||||
//测试
|
||||
//request.Dataset.AddOrUpdate(DicomTag.SeriesInstanceUID, "");
|
||||
//request.Dataset.AddOrUpdate(DicomTag.SeriesDescription, "");
|
||||
//request.Dataset.AddOrUpdate(DicomTag.BodyPartExamined, inQuery.BodyPartExamined.IsNullOrEmpty() ? "" : inQuery.BodyPartExamined);
|
||||
|
||||
return request;
|
||||
}
|
||||
|
||||
|
@ -2896,6 +2903,8 @@ namespace IRaCIS.Application.Services
|
|||
if (response.Status == DicomStatus.Success)
|
||||
{
|
||||
Console.WriteLine(response.Status.ToString());
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2925,17 +2934,20 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
if (find != null)
|
||||
{
|
||||
//// 设置 CancellationTokenSource
|
||||
//var cts = new CancellationTokenSource();
|
||||
//CancellationToken token = cts.Token;
|
||||
|
||||
var maxStudyCount = find.MaxStudyCount > 0 ? find.MaxStudyCount : 50;
|
||||
|
||||
var client = DicomClientFactory.Create(find.IP, find.Port, false, "HIRSCUAE", find.CalledAE);
|
||||
|
||||
client.NegotiateAsyncOps();
|
||||
|
||||
var request = CreateStudyRequest(inQuery);
|
||||
var request = CreateStudyRequest(inQuery, find.ModalityList);
|
||||
|
||||
request.OnResponseReceived += (req, response) =>
|
||||
{
|
||||
//DebugStudyResponse(response, _logger);
|
||||
|
||||
if (response.HasDataset)
|
||||
{
|
||||
|
@ -2946,9 +2958,9 @@ namespace IRaCIS.Application.Services
|
|||
DateOnly datePart = DateOnly.FromDateTime(studyTime);
|
||||
TimeOnly timePart = TimeOnly.FromDateTime(studyTime);
|
||||
|
||||
DateTime birthDate = DateTime.ParseExact(response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.PatientBirthDate, ""), "yyyyMMdd", null);
|
||||
DateTime? birthDate = DateTime.ParseExact(response.Dataset?.GetSingleValueOrDefault<string>(DicomTag.PatientBirthDate, ""), "yyyyMMdd", null);
|
||||
// 格式化为你需要的日期格式,例如:yyyy-MM-dd
|
||||
string formattedBirthDate = birthDate.ToString("yyyy-MM-dd");
|
||||
string formattedBirthDate = birthDate?.ToString("yyyy-MM-dd") ?? string.Empty;
|
||||
|
||||
|
||||
result.Add(new SCUStudyView()
|
||||
|
@ -2970,12 +2982,20 @@ namespace IRaCIS.Application.Services
|
|||
if (result.Count == maxStudyCount)
|
||||
{
|
||||
|
||||
response.Status = DicomStatus.Cancel;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
|
||||
await client.AddRequestAsync(request);
|
||||
|
||||
|
||||
await client.SendAsync();
|
||||
|
||||
|
||||
}
|
||||
|
||||
var resultInstanceUidList = result.Select(t => t.StudyInstanceUID).ToList();
|
||||
|
|
18656
IRaCIS.Core.Infra.EFCore/Migrations/20241217060929_PACSStudyCount.Designer.cs
generated
Normal file
18656
IRaCIS.Core.Infra.EFCore/Migrations/20241217060929_PACSStudyCount.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,29 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class PACSStudyCount : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "MaxStudyCount",
|
||||
table: "DicomAE",
|
||||
type: "int",
|
||||
nullable: false,
|
||||
defaultValue: 0);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "MaxStudyCount",
|
||||
table: "DicomAE");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -807,6 +807,9 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
|||
b.Property<DateTime?>("LatestTestTime")
|
||||
.HasColumnType("datetime2");
|
||||
|
||||
b.Property<int>("MaxStudyCount")
|
||||
.HasColumnType("int");
|
||||
|
||||
b.Property<string>("ModalityList")
|
||||
.IsRequired()
|
||||
.HasColumnType("nvarchar(max)");
|
||||
|
|
Loading…
Reference in New Issue