|
@@ -54,6 +54,7 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
private ExamScoreDBRepository _examScoreDBRepository;
|
|
|
private ReportTemplateDBRepository _reportTemplateDBRepository;
|
|
|
private ReportInfoResultDBRepository _reportInfoResultDBRepository;
|
|
|
+ private CustomLabelDBRepository _customLabelDBRepository;
|
|
|
|
|
|
public MigrateService(string dcServiceUrl)
|
|
|
{
|
|
@@ -81,6 +82,7 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
_reportTemplateDBRepository = new ReportTemplateDBRepository();
|
|
|
_adminDBRepository = new AdminDBRepository();
|
|
|
_reportInfoResultDBRepository = new ReportInfoResultDBRepository();
|
|
|
+ _customLabelDBRepository = new CustomLabelDBRepository();
|
|
|
}
|
|
|
|
|
|
public async Task WriteMigrateStaticAsync()
|
|
@@ -942,16 +944,50 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
+ var customLabelIds = reports.SelectMany(x => x.CustomLabels ?? new List<string>()).Distinct().ToList();
|
|
|
+ var customerLabels = _customLabelDBRepository.GetCustomLabelByCodes(customLabelIds);
|
|
|
+
|
|
|
var reportInfos = new List<ReportInfoResultDTO>();
|
|
|
- foreach (var video in reports)
|
|
|
+ foreach (var report in reports)
|
|
|
{
|
|
|
- var videoInfo = new ReportInfoResultDTO
|
|
|
+ var reportInfo = new ReportInfoResultDTO
|
|
|
{
|
|
|
- Code = video.Id,
|
|
|
- CreateTime = video.CreateTime,
|
|
|
- UpdateTime = video.UpdateTime,
|
|
|
+ Code = report.Id,
|
|
|
+ CreateTime = report.CreateTime,
|
|
|
+ UpdateTime = report.UpdateTime,
|
|
|
+ ReportTemplateJson = report.Template,
|
|
|
+ ElementCollectionJson = Newtonsoft.Json.JsonConvert.SerializeObject(report.ElementCollection),
|
|
|
+ MeasureElementCollectionJson = Newtonsoft.Json.JsonConvert.SerializeObject(report.MeasureElementCollection),
|
|
|
+ ReportUserCode = report.User?._id,
|
|
|
+ ReportUserName = report.User?.Name,
|
|
|
+ RecordCode = report.RecordId,
|
|
|
+ PatientPerfPhysician = report.PatientPerfPhysician,
|
|
|
+ PatientRefPhysician = report.PatientRefPhysician,
|
|
|
+ PatientName = report.PatientName,
|
|
|
+ PreviewImages = report.PreviewImages.MappingTo<List<WingInterfaceLibrary.DTO.DataCenter.ReportImageInfo>>(),
|
|
|
+ CustomLabels = new List<CustomLabelView>(),
|
|
|
+ ReportOrgan = (DiagnosisOrganEnum)report.Organ,
|
|
|
+ QualifiedState = (WingInterfaceLibrary.Enum.QualifiedState)report.QualifiedState,
|
|
|
+ QualityType = (WingInterfaceLibrary.Enum.QualityType)report.QualityType,
|
|
|
+ ReportPreviewPdf = GetFileUrl(report.ReportPreviewPdf),
|
|
|
+ QualityControlDatas = new List<QualityControlDataView>(),
|
|
|
};
|
|
|
- reportInfos.Add(videoInfo);
|
|
|
+ if (report.CustomLabels != null && report.CustomLabels.Any())
|
|
|
+ {
|
|
|
+ foreach (var item in report.CustomLabels)
|
|
|
+ {
|
|
|
+ var customLabel = customerLabels.FirstOrDefault(x => x.Code == item);
|
|
|
+ if (customLabel != null)
|
|
|
+ {
|
|
|
+ reportInfo.CustomLabels.Add(customLabel.MappingTo<CustomLabelView>());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (report.QualityControlDatas != null && report.QualityControlDatas.Any())
|
|
|
+ {
|
|
|
+ reportInfo.QualityControlDatas = report.QualityControlDatas.MappingTo<List<QualityControlDataView>>();
|
|
|
+ }
|
|
|
+ reportInfos.Add(reportInfo);
|
|
|
}
|
|
|
var request = new ReceiveReportInfosRequest
|
|
|
{
|
|
@@ -1197,11 +1233,11 @@ namespace Flyinsono.DBCopy.Tool.Service
|
|
|
CarotidScanType = (CarotidScanTypeEnum)carotid3dModelData.CarotidScanType,
|
|
|
MeasureImageFiles = new List<MeasureImageFileDTO>()
|
|
|
};
|
|
|
- if (!string.IsNullOrWhiteSpace(carotid3dModelData.CarotidAIMeasureImageToken))
|
|
|
+ if (!string.IsNullOrWhiteSpace(carotid3dModelData.CarotidAIMeasureImageToken))
|
|
|
{
|
|
|
string[] keyValuePairs = carotid3dModelData.CarotidAIMeasureImageToken.Split(';');
|
|
|
foreach (string keyValuePair in keyValuePairs)
|
|
|
- {
|
|
|
+ {
|
|
|
string[] parts = keyValuePair.Split('=');
|
|
|
if (parts.Length != 2) continue;
|
|
|
if (Enum.TryParse(parts[0], out CarotidAIImageTypeEnum imageType))
|