项目bodypart 以及bug
parent
9875d9622d
commit
8bcac405e5
|
@ -48,7 +48,7 @@ namespace IRaCIS.Core.Application.AutoMapper
|
|||
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveyView>()
|
||||
.ForMember(d => d.TrialSiteAliasName, u => u.MapFrom(s => s.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => isEn_Us ? s.Site.SiteName : s.Site.SiteNameCN))
|
||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.TrialSite.TrialSiteName ))
|
||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.TrialSite.TrialSiteCode));
|
||||
|
||||
CreateMap<TrialSiteSurvey, TrialSiteSurveySelectView>();
|
||||
|
|
|
@ -1084,4 +1084,31 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
//public string TrialSiteSurveyEquipmentType { get; set; } = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class AddOrUpdateTrialBodyPartCommand
|
||||
{
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
public string Name { get; set; }
|
||||
|
||||
|
||||
public string NameCN { get; set; }
|
||||
|
||||
|
||||
|
||||
public Guid? Id { get; set; }
|
||||
|
||||
[NotDefault]
|
||||
public Guid TrialId { get; set; }
|
||||
}
|
||||
|
||||
public class TrialBodyPartView
|
||||
{
|
||||
public string Code { get; set; }
|
||||
|
||||
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@ 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;
|
||||
|
||||
namespace IRaCIS.Core.Application
|
||||
{
|
||||
|
@ -1307,5 +1308,29 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
|
||||
|
||||
public async Task<IResponseOutput<List<TrialBodyPartView>>> GetTrialBodyPartList(Guid trialId)
|
||||
{
|
||||
var list = await _trialRepository.Where(t => t.Id == trialId).SelectMany(t => t.TrialBodyPartList).Select(t=>new TrialBodyPartView() { Code=t.Code,Name=_userInfo.IsEn_Us?t.Name:t.NameCN}).ToListAsync();
|
||||
|
||||
return ResponseOutput.Ok(list);
|
||||
}
|
||||
|
||||
public async Task<IResponseOutput> AddOrUpdateTrialBodyPart(AddOrUpdateTrialBodyPartCommand incommand)
|
||||
{
|
||||
|
||||
var exp = new EntityVerifyExp<TrialBodyPart>()
|
||||
{
|
||||
VerifyExp = t => (t.Name.Equals(incommand.Name) || t.NameCN.Equals(incommand.NameCN)),
|
||||
|
||||
VerifyMsg = _localizer["TrialBodyPart_DupName"]
|
||||
};
|
||||
|
||||
var cro = await _repository.InsertOrUpdateAsync<TrialBodyPart, AddOrUpdateTrialBodyPartCommand>(incommand, true, exp);
|
||||
|
||||
|
||||
|
||||
return ResponseOutput.Ok(cro.Id.ToString());
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
CreateMap<VisitTask, ReReadingApprovalToBeDoneDto>();
|
||||
|
||||
|
||||
CreateMap<AddOrUpdateTrialBodyPartCommand, TrialBodyPart>();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
using BeetleX;
|
||||
using BeetleX.BNR;
|
||||
using Castle.DynamicProxy.Generators.Emitters.SimpleAST;
|
||||
using IP2Region.Net.XDB;
|
||||
using IRaCIS.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Contracts;
|
||||
using IRaCIS.Core.Application.Helper;
|
||||
using IRaCIS.Core.Application.Service;
|
||||
|
@ -354,6 +356,28 @@ namespace IRaCIS.Application.Services
|
|||
|
||||
|
||||
|
||||
public async Task<IResponseOutput> ModifyTrialBodyPart()
|
||||
{
|
||||
|
||||
var searchList = await _dicRepository.Where(t => t.Parent.Code == "BodyPart" && t.ParentId != null && t.IsEnable).ProjectTo<BasicDicSelect>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
var needAddBodyPartList = searchList.Select(t => new TrialBodyPart() { Code = t.Code, Name = t.Value, NameCN = t.ValueCN });
|
||||
|
||||
var trialIds = _repository.Where<Trial>(t => !t.TrialBodyPartList.Any()).Select(t => t.Id).ToList();
|
||||
|
||||
foreach (var trialId in trialIds)
|
||||
{
|
||||
var tempList = needAddBodyPartList.Clone();
|
||||
|
||||
tempList.ForEach(t => t.TrialId = trialId);
|
||||
|
||||
await _repository.AddRangeAsync(tempList);
|
||||
}
|
||||
|
||||
await _repository.SaveChangesAsync();
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
#region 历史维护
|
||||
/// <summary>
|
||||
/// 维护临床数据 --一定要在同步表前同步数据才行
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
[ForeignKey("JudgeVisitTaskId")]
|
||||
public VisitTask JudgeVisitTask { get; set; }
|
||||
|
||||
//public SubjectUser SujectArm { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public Subject Subject { get; set; }
|
||||
|
|
|
@ -35,8 +35,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public TrialSite TrialSite { get; set; }
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
[JsonIgnore]
|
||||
public Site Site { get; set; }
|
||||
|
||||
|
||||
public DateTime? DeletedTime { get; set; }
|
||||
|
||||
|
|
|
@ -17,6 +17,10 @@ namespace IRaCIS.Core.Domain.Models
|
|||
TrialDicList = new List<TrialDictionary>();
|
||||
}
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TrialBodyPart> TrialBodyPartList { get; set; }
|
||||
|
||||
|
||||
[JsonIgnore]
|
||||
public List<TaskMedicalReview> TaskMedicalReviewList { get; set; }
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@ using System;
|
|||
using IRaCIS.Core.Domain.Share;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using System.Collections.Generic;
|
||||
namespace IRaCIS.Core.Domain.Models
|
||||
{
|
||||
///<summary>
|
||||
|
@ -31,5 +32,8 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
public Guid TrialId { get; set; }
|
||||
|
||||
[JsonIgnore]
|
||||
public Trial Trial { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -70,7 +70,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Guid? Auditor { get; set; }
|
||||
|
||||
|
||||
//public SubjectVisitStateEnum VisitState { get; set; }
|
||||
|
||||
//核查状态
|
||||
public CheckStateEnum CheckState { get; set; }
|
||||
|
@ -218,12 +217,6 @@ namespace IRaCIS.Core.Domain.Models
|
|||
public Subject Subject { get; set; }
|
||||
|
||||
|
||||
//// 一个访视可以被多个参与者 查看
|
||||
//public List<TrialUser> TrialUsers { get; set; }
|
||||
|
||||
////一个访视 对应该Site下的多个CRC管理 必须加这个 不然生成的sql 会报 TrialSiteUserId 不存在该列名
|
||||
|
||||
//public List<TrialSiteUser> TrialSiteUserList { get; set; }
|
||||
[JsonIgnore]
|
||||
public List<PreviousHistory> PreviousHistoryList { get; set; }
|
||||
[JsonIgnore]
|
||||
|
|
|
@ -300,8 +300,6 @@ namespace IRaCIS.Core.Infra.EFCore
|
|||
#region Institution
|
||||
|
||||
|
||||
|
||||
public virtual DbSet<Site> ResearchCenter { get; set; }
|
||||
public virtual DbSet<Hospital> Hospitals { get; set; }
|
||||
public virtual DbSet<CRO> CROCompany { get; set; }
|
||||
public virtual DbSet<Sponsor> Sponsor { get; set; }
|
||||
|
|
Loading…
Reference in New Issue