Compare commits
104 Commits
Test_IRC_N
...
EICS-V1.11
Author | SHA1 | Date |
---|---|---|
|
a47ac76729 | |
|
f86a88332c | |
|
f6be5e4355 | |
|
8deeb0290a | |
|
fb6231373b | |
|
a407313a95 | |
|
b1806d2eff | |
|
19351f34e1 | |
|
e0f708082d | |
|
44464a809d | |
|
c7c01b7ba3 | |
|
38b71d5267 | |
|
3950a3453a | |
|
7aa59da586 | |
|
9b2fbdb13f | |
|
c98b9e1bd4 | |
|
9522461508 | |
|
5bb99180b6 | |
|
62ec1e4955 | |
|
58e1af24c9 | |
|
a7394e7119 | |
|
a93d81de0d | |
|
6aafe02c6c | |
|
1511ef1608 | |
|
1141439c8e | |
|
559663082b | |
|
3a298518f9 | |
|
7f20232401 | |
|
20b0849b40 | |
|
db951e9195 | |
|
d5d78a99d2 | |
|
1609a7a88a | |
|
289831fce8 | |
|
dde058be18 | |
|
be8b730ee4 | |
|
28360861aa | |
|
3e097fa42b | |
|
b8a7cd6ebc | |
|
a9aefaf240 | |
|
266a0c5dd5 | |
|
54822ae038 | |
|
05203d6716 | |
|
2ce8edde80 | |
|
3c30f5dc14 | |
|
e4ad1c0653 | |
|
84df49ca07 | |
|
400edd0b70 | |
|
c4add1ecc8 | |
|
d5879e28d7 | |
|
37e083face | |
|
290506a060 | |
|
1b4bc3690a | |
|
6374781d26 | |
|
b28013a02f | |
|
fe429d2bdc | |
|
d63af2ed20 | |
|
cebf9875b1 | |
|
131681a0b3 | |
|
f833adc710 | |
|
df80d1e551 | |
|
82dc092247 | |
|
44894fcaa9 | |
|
083bebdc03 | |
|
e808764dd6 | |
|
77d198cb09 | |
|
180b02b28c | |
|
c49a74d742 | |
|
c76fc8f052 | |
|
14875dfacc | |
|
0a68788c0f | |
|
b17e5d9ff3 | |
|
05ce4b7155 | |
|
c8bbb3da48 | |
|
65de108ecd | |
|
d20c306219 | |
|
e69991ae37 | |
|
e1e2544ee3 | |
|
318333bae4 | |
|
d569de4dfe | |
|
05627ff126 | |
|
627618c854 | |
|
2711c5eb04 | |
|
a6982f79c3 | |
|
2a542949cd | |
|
a8ccbce76f | |
|
df7cf30aed | |
|
0664fbdfb7 | |
|
0a6ee05417 | |
|
f9bd8c3f5c | |
|
cb83c2a737 | |
|
fdd9afd4f0 | |
|
53d26c0445 | |
|
40d035e7a7 | |
|
a13807ae5f | |
|
9d5aaf1e26 | |
|
c347d08e2b | |
|
87f2d0e429 | |
|
89d009fcbf | |
|
7d65cf5051 | |
|
e74427c45c | |
|
e8825c7efa | |
|
628e0ad034 | |
|
2f3f639918 | |
|
87caf24dd1 |
|
@ -52,7 +52,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingImageTask/SubmitOncologyReadingInfo")]
|
[HttpPost, Route("Inspection/ReadingImageTask/SubmitOncologyReadingInfo")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SetOncologyReadingInfo(DataInspectionDto<SubmitOncologyReadingInfoInDto> opt)
|
public async Task<IResponseOutput> SetOncologyReadingInfo(DataInspectionDto<SubmitOncologyReadingInfoInDto> opt)
|
||||||
|
@ -69,7 +69,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingImageTask/SubmitDicomVisitTask")]
|
[HttpPost, Route("Inspection/ReadingImageTask/SubmitDicomVisitTask")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SubmitDicomVisitTask(DataInspectionDto<SubmitDicomVisitTaskInDto> opt)
|
public async Task<IResponseOutput> SubmitDicomVisitTask(DataInspectionDto<SubmitDicomVisitTaskInDto> opt)
|
||||||
|
@ -88,7 +88,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingImageTask/SubmitGlobalReadingInfo")]
|
[HttpPost, Route("Inspection/ReadingImageTask/SubmitGlobalReadingInfo")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SubmitGlobalReadingInfo(DataInspectionDto<SubmitGlobalReadingInfoInDto> opt)
|
public async Task<IResponseOutput> SubmitGlobalReadingInfo(DataInspectionDto<SubmitGlobalReadingInfoInDto> opt)
|
||||||
|
@ -107,7 +107,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialReadingInfoSign")]
|
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialReadingInfoSign")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> TrialReadingInfoSign(DataInspectionDto<TrialReadingInfoSignInDto> opt)
|
public async Task<IResponseOutput> TrialReadingInfoSign(DataInspectionDto<TrialReadingInfoSignInDto> opt)
|
||||||
|
@ -126,7 +126,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingMedicalReview/FinishMedicalReview")]
|
[HttpPost, Route("Inspection/ReadingMedicalReview/FinishMedicalReview")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> FinishMedicalReview(DataInspectionDto<FinishMedicalReviewInDto> opt)
|
public async Task<IResponseOutput> FinishMedicalReview(DataInspectionDto<FinishMedicalReviewInDto> opt)
|
||||||
|
@ -143,7 +143,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingMedicineQuestion/ConfirmReadingMedicineQuestion")]
|
[HttpPost, Route("Inspection/ReadingMedicineQuestion/ConfirmReadingMedicineQuestion")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> ConfirmReadingMedicineQuestion(DataInspectionDto<ConfirmReadingMedicineQuestionInDto> opt)
|
public async Task<IResponseOutput> ConfirmReadingMedicineQuestion(DataInspectionDto<ConfirmReadingMedicineQuestionInDto> opt)
|
||||||
|
@ -161,7 +161,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingImageTask/SubmitVisitTaskQuestions")]
|
[HttpPost, Route("Inspection/ReadingImageTask/SubmitVisitTaskQuestions")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SubmitVisitTaskQuestions(DataInspectionDto<SubmitVisitTaskQuestionsInDto> opt)
|
public async Task<IResponseOutput> SubmitVisitTaskQuestions(DataInspectionDto<SubmitVisitTaskQuestionsInDto> opt)
|
||||||
|
@ -179,7 +179,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ClinicalAnswer/CRCSignClinicalData")]
|
[HttpPost, Route("Inspection/ClinicalAnswer/CRCSignClinicalData")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CRCSignClinicalData(DataInspectionDto<CRCSignClinicalDataInDto> opt)
|
public async Task<IResponseOutput> CRCSignClinicalData(DataInspectionDto<CRCSignClinicalDataInDto> opt)
|
||||||
|
@ -197,7 +197,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ClinicalAnswer/CRCConfirmClinical")]
|
[HttpPost, Route("Inspection/ClinicalAnswer/CRCConfirmClinical")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CRCConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
public async Task<IResponseOutput> CRCConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
||||||
|
@ -214,7 +214,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ClinicalAnswer/CRCCancelConfirmClinical")]
|
[HttpPost, Route("Inspection/ClinicalAnswer/CRCCancelConfirmClinical")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CRCCancelConfirmClinical(DataInspectionDto<CRCCancelConfirmClinicalInDto> opt)
|
public async Task<IResponseOutput> CRCCancelConfirmClinical(DataInspectionDto<CRCCancelConfirmClinicalInDto> opt)
|
||||||
|
@ -232,7 +232,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ClinicalAnswer/PMConfirmClinical")]
|
[HttpPost, Route("Inspection/ClinicalAnswer/PMConfirmClinical")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> PMConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
public async Task<IResponseOutput> PMConfirmClinical(DataInspectionDto<CRCConfirmClinicalInDto> opt)
|
||||||
|
@ -250,7 +250,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingClinicalData/SignConsistencyAnalysisReadingClinicalData")]
|
[HttpPost, Route("Inspection/ReadingClinicalData/SignConsistencyAnalysisReadingClinicalData")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SignConsistencyAnalysisReadingClinicalData(DataInspectionDto<SignConsistencyAnalysisReadingClinicalDataInDto> opt)
|
public async Task<IResponseOutput> SignConsistencyAnalysisReadingClinicalData(DataInspectionDto<SignConsistencyAnalysisReadingClinicalDataInDto> opt)
|
||||||
|
@ -267,7 +267,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ClinicalAnswer/SubmitClinicalFormAndSign")]
|
[HttpPost, Route("Inspection/ClinicalAnswer/SubmitClinicalFormAndSign")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SubmitClinicalFormAndSign(DataInspectionDto<SubmitClinicalFormInDto> opt)
|
public async Task<IResponseOutput> SubmitClinicalFormAndSign(DataInspectionDto<SubmitClinicalFormInDto> opt)
|
||||||
|
@ -284,7 +284,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingImageTask/SubmitJudgeVisitTaskResult")]
|
[HttpPost, Route("Inspection/ReadingImageTask/SubmitJudgeVisitTaskResult")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SubmitJudgeVisitTaskResult(DataInspectionDto<SaveJudgeVisitTaskResult> opt)
|
public async Task<IResponseOutput> SubmitJudgeVisitTaskResult(DataInspectionDto<SaveJudgeVisitTaskResult> opt)
|
||||||
|
@ -303,7 +303,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialBasicInfoConfirm")]
|
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialBasicInfoConfirm")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt")]
|
||||||
public async Task<IResponseOutput> ConfigTrialBasicInfoConfirm(DataInspectionDto<BasicTrialConfig> opt)
|
public async Task<IResponseOutput> ConfigTrialBasicInfoConfirm(DataInspectionDto<BasicTrialConfig> opt)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -345,7 +345,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialUrgentInfoConfirm")]
|
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialUrgentInfoConfirm")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt")]
|
||||||
public async Task<IResponseOutput> ConfigTrialUrgentInfoConfirm(DataInspectionDto<TrialUrgentConfig> opt)
|
public async Task<IResponseOutput> ConfigTrialUrgentInfoConfirm(DataInspectionDto<TrialUrgentConfig> opt)
|
||||||
{
|
{
|
||||||
opt.Data.IsTrialUrgentConfirmed = true;
|
opt.Data.IsTrialUrgentConfirmed = true;
|
||||||
|
@ -358,7 +358,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
|
|
||||||
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialPACSInfoConfirm")]
|
[HttpPost, Route("Inspection/configTrialBasicInfo/ConfigTrialPACSInfoConfirm")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt")]
|
||||||
public async Task<IResponseOutput> ConfigTrialPACSInfoConfirm(DataInspectionDto<TrialPACSConfig> opt)
|
public async Task<IResponseOutput> ConfigTrialPACSInfoConfirm(DataInspectionDto<TrialPACSConfig> opt)
|
||||||
{
|
{
|
||||||
opt.Data.IsTrialPACSConfirmed = true;
|
opt.Data.IsTrialPACSConfirmed = true;
|
||||||
|
@ -374,7 +374,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialConfigSignatureConfirm")]
|
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialConfigSignatureConfirm")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
|
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
|
||||||
{
|
{
|
||||||
|
@ -391,7 +391,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadingCriterion/ResetAndAsyncCriterion")]
|
[HttpPost, Route("Inspection/ReadingCriterion/ResetAndAsyncCriterion")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
public async Task<IResponseOutput> ResetAndAsyncCriterion(DataInspectionDto<ResetAndAsyncCriterionInDto> opt)
|
public async Task<IResponseOutput> ResetAndAsyncCriterion(DataInspectionDto<ResetAndAsyncCriterionInDto> opt)
|
||||||
{
|
{
|
||||||
|
@ -409,7 +409,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/QCOperation/CRCRequestToQC")]
|
[HttpPost, Route("Inspection/QCOperation/CRCRequestToQC")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CRCRequestToQC(DataInspectionDto<CRCRequestToQCCommand> opt)
|
public async Task<IResponseOutput> CRCRequestToQC(DataInspectionDto<CRCRequestToQCCommand> opt)
|
||||||
{
|
{
|
||||||
|
@ -424,21 +424,31 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// 设置QC 通过或者不通过 7:QC failed 8:QC passed
|
/// 设置QC 通过或者不通过 7:QC failed 8:QC passed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpPost, Route("Inspection/QCOperation/QCPassedOrFailed")]
|
[HttpPost, Route("Inspection/QCOperation/QCPassedOrFailed")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
|
public async Task<IResponseOutput> QCPassedOrFailed(DataInspectionDto<QCPassedOrFailedDto> opt)
|
||||||
{
|
{
|
||||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||||
|
if (opt.Data.IsSecondPass != null)
|
||||||
|
{
|
||||||
|
var result = await _qCOperationService.QCSecondReviewPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, (bool)opt.Data.IsSecondPass);
|
||||||
|
await _inspectionService.CompletedSign(singid, result);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
var result = await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
|
var result = await _qCOperationService.QCPassedOrFailed(opt.Data.trialId, opt.Data.subjectVisitId, opt.Data.auditState);
|
||||||
await _inspectionService.CompletedSign(singid, result);
|
await _inspectionService.CompletedSign(singid, result);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 一致性核查 回退 对话记录不清除 只允许PM回退
|
/// 一致性核查 回退 对话记录不清除 只允许PM回退
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpPost, Route("Inspection/QCOperation/CheckBack")]
|
[HttpPost, Route("Inspection/QCOperation/CheckBack")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> CheckBack(DataInspectionDto<IDDto> opt)
|
public async Task<IResponseOutput> CheckBack(DataInspectionDto<IDDto> opt)
|
||||||
{
|
{
|
||||||
|
@ -455,7 +465,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/ReadClinicalData/ReadClinicalDataSign")]
|
[HttpPost, Route("Inspection/ReadClinicalData/ReadClinicalDataSign")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> ReadClinicalDataSign(DataInspectionDto<ReadingClinicalDataSignIndto> opt)
|
public async Task<IResponseOutput> ReadClinicalDataSign(DataInspectionDto<ReadingClinicalDataSignIndto> opt)
|
||||||
{
|
{
|
||||||
|
@ -470,7 +480,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// CRC 设置已经重传完成
|
/// CRC 设置已经重传完成
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[HttpPost, Route("Inspection/QCOperation/SetReuploadFinished")]
|
[HttpPost, Route("Inspection/QCOperation/SetReuploadFinished")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
|
public async Task<IResponseOutput> SetReuploadFinished(DataInspectionDto<CRCReuploadFinishedCommand> opt)
|
||||||
{
|
{
|
||||||
|
@ -486,7 +496,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <param name="opt"></param>
|
/// <param name="opt"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/TrialConfig/updateTrialState")]
|
[HttpPost, Route("Inspection/TrialConfig/updateTrialState")]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt")]
|
[TrialGlobalLimit("BeforeOngoingCantOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> UpdateTrialState(DataInspectionDto<UpdateTrialStateDto> opt)
|
public async Task<IResponseOutput> UpdateTrialState(DataInspectionDto<UpdateTrialStateDto> opt)
|
||||||
{
|
{
|
||||||
|
@ -502,7 +512,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/TrialDocument/userConfirm")]
|
[HttpPost, Route("Inspection/TrialDocument/userConfirm")]
|
||||||
[TrialGlobalLimit( "BeforeOngoingCantOpt", "SignSystemDocNoTrialId", "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("BeforeOngoingCantOpt", "SignSystemDocNoTrialId", "AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
|
public async Task<IResponseOutput> UserConfirm(DataInspectionDto<UserConfirmCommand> opt)
|
||||||
{
|
{
|
||||||
|
@ -519,7 +529,7 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/VisitTask/ConfirmReReading")]
|
[HttpPost, Route("Inspection/VisitTask/ConfirmReReading")]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
|
|
||||||
public async Task<IResponseOutput> ConfirmReReading(DataInspectionDto<ConfirmReReadingCommand> opt, [FromServices] IVisitTaskService _visitTaskService)
|
public async Task<IResponseOutput> ConfirmReReading(DataInspectionDto<ConfirmReReadingCommand> opt, [FromServices] IVisitTaskService _visitTaskService)
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
<PackageReference Include="MaxMind.GeoIP2" Version="5.2.0" />
|
<PackageReference Include="MaxMind.GeoIP2" Version="5.2.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
|
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="8.0.10" />
|
||||||
<PackageReference Include="MimeKit" Version="4.11.0" />
|
<PackageReference Include="MimeKit" Version="4.11.0" />
|
||||||
<PackageReference Include="MiniExcel" Version="1.40.0" />
|
<PackageReference Include="MiniExcel" Version="1.41.3" />
|
||||||
<PackageReference Include="Minio" Version="6.0.4" />
|
<PackageReference Include="Minio" Version="6.0.4" />
|
||||||
<PackageReference Include="MiniWord" Version="0.9.2" />
|
<PackageReference Include="MiniWord" Version="0.9.2" />
|
||||||
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
|
<PackageReference Include="My.Extensions.Localization.Json" Version="3.3.0">
|
||||||
|
|
|
@ -10525,6 +10525,11 @@
|
||||||
阅片版本
|
阅片版本
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionTrialInDto.ReadingToolList">
|
||||||
|
<summary>
|
||||||
|
阅片工具
|
||||||
|
</summary>
|
||||||
|
</member>
|
||||||
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionSystemInDto.CriterionGroup">
|
<member name="P:IRaCIS.Core.Application.Service.Reading.Dto.AddOrUpdateReadingQuestionCriterionSystemInDto.CriterionGroup">
|
||||||
<summary>
|
<summary>
|
||||||
标准分组
|
标准分组
|
||||||
|
@ -13307,7 +13312,7 @@
|
||||||
阅片期配置
|
阅片期配置
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadingPeriodSetService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitStage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodPlan},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Site},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadingPeriodSetService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitStage},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodPlan},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Site},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
阅片期配置
|
阅片期配置
|
||||||
</summary>
|
</summary>
|
||||||
|
@ -13379,7 +13384,7 @@
|
||||||
生成的阅片模块(在大列表上展示的) 阅片期
|
生成的阅片模块(在大列表上展示的) 阅片期
|
||||||
</summary>
|
</summary>
|
||||||
</member>
|
</member>
|
||||||
<member name="M:IRaCIS.Core.Application.Service.ReadModuleService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleView},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
<member name="M:IRaCIS.Core.Application.Service.ReadModuleService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.SubjectVisit},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Subject},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Application.Service.IVisitTaskHelpeService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.VisitTask},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ClinicalDataTrialSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModuleView},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingQuestionCriterionTrial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.DicomInstance},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.NoneDicomStudyFile},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingClinicalData},IRaCIS.Core.Application.Contracts.IReadingImageTaskService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadingPeriodSet},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.ReadModule},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||||
<summary>
|
<summary>
|
||||||
生成的阅片模块(在大列表上展示的) 阅片期
|
生成的阅片模块(在大列表上展示的) 阅片期
|
||||||
</summary>
|
</summary>
|
||||||
|
|
|
@ -216,6 +216,8 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
//public bool IsAfterConvertedTask { get; set; }
|
//public bool IsAfterConvertedTask { get; set; }
|
||||||
|
|
||||||
public string PMBackReason { get; set; }
|
public string PMBackReason { get; set; }
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -482,6 +484,9 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
public string? RequestReReadingReason { get; set; }
|
public string? RequestReReadingReason { get; set; }
|
||||||
|
|
||||||
public ExportResult? ReadingExportType { get; set; }
|
public ExportResult? ReadingExportType { get; set; }
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
|
public bool? IsRandomOrderList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -908,6 +913,30 @@ namespace IRaCIS.Core.Application.ViewModel
|
||||||
CancelAssign = 4,
|
CancelAssign = 4,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SetRandomTaskOrderCommand
|
||||||
|
{
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid TrialReadingCriterionId { get; set; }
|
||||||
|
|
||||||
|
[NotDefault]
|
||||||
|
public Guid DoctorUserId { get; set; }
|
||||||
|
|
||||||
|
public bool IsAutoSet { get; set; }
|
||||||
|
|
||||||
|
public List<VisitTaskOrderCommand> SetList { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class VisitTaskOrderCommand
|
||||||
|
{
|
||||||
|
public Guid Id { get; set; }
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,12 +51,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
|
return await ExcelExportHelper.ExportTemplateAsync(new ExportTemplateServiceDto()
|
||||||
{
|
{
|
||||||
Data=inDto.Data,
|
Data = inDto.Data,
|
||||||
commonDocumentRepository= _commonDocumentRepository,
|
commonDocumentRepository = _commonDocumentRepository,
|
||||||
TemplateCode=inDto.TemplateCode,
|
TemplateCode = inDto.TemplateCode,
|
||||||
ExportFileName=inDto.ExportFileName,
|
ExportFileName = inDto.ExportFileName,
|
||||||
hostEnvironment=_hostEnvironment,
|
hostEnvironment = _hostEnvironment,
|
||||||
IsEnglish=_userInfo.IsEn_Us,
|
IsEnglish = _userInfo.IsEn_Us,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -757,24 +757,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
if (trialReadingCriterionConfig.TaskAllocateObjEnum == TaskAllocateObj.Subject)
|
||||||
{
|
{
|
||||||
var allocateSubjectArmList = _visitTaskRepository.Where(t => t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.TrialId == trialId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)
|
|
||||||
.Select(t => new { t.DoctorUserId, t.ArmEnum }).Distinct().ToList();
|
|
||||||
|
|
||||||
//当前任务没有分配医生,初次分配 不处理 只生成任务,后续根据生成的任务 再进行分配
|
|
||||||
if (allocateSubjectArmList.Count == 0)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
//并且配置了医生
|
|
||||||
if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
|
|
||||||
{
|
|
||||||
|
|
||||||
#region 后续访视 未分配的进行再次分配,重置的或者失效的 需要重新生成新的任务 (PM 有序退回 或者PM 有序 申请重阅)
|
|
||||||
|
|
||||||
|
|
||||||
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (trialReadingCriterionConfig.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
|
{
|
||||||
|
#region 当前访视处理
|
||||||
|
|
||||||
|
//配置了医生
|
||||||
|
if (assignConfigList.Count > 0)
|
||||||
{
|
{
|
||||||
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
//之前有回退到影像上传的访视 那么当前访视一致性核查通过的时候,当前访视生成但是不分配出去(排除失访的)
|
||||||
|
|
||||||
|
@ -813,6 +803,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#region 后续访视处理
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//后续最近的未一致性核查通过的访视任务
|
//后续最近的未一致性核查通过的访视任务
|
||||||
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
var followBackVisitTask = await _visitTaskRepository.Where(t => t.TrialId == trialId && t.TrialReadingCriterionId == trialReadingCriterionConfig.TrialReadingCriterionId && t.SubjectId == subjectVisit.SubjectId && t.VisitTaskNum > subjectVisit.VisitNum && t.ReadingCategory == ReadingCategory.Visit && t.SourceSubjectVisit.CheckState != CheckStateEnum.CVPassed && t.SourceSubjectVisit.IsLostVisit == false).OrderBy(t => t.VisitTaskNum).FirstOrDefaultAsync();
|
||||||
|
@ -867,13 +864,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
if (arm1 != null)
|
if (arm1 != null)
|
||||||
{
|
{
|
||||||
|
arm1.IsUrgent = visit.IsUrgent;
|
||||||
|
arm1.TaskUrgentType = urgentType;
|
||||||
|
arm1.IsCanEditUrgentState = isCanEdit;
|
||||||
|
|
||||||
//有可能仅仅只分配了一个Subject 未分配 那么
|
//有可能仅仅只分配了一个Subject 未分配 那么
|
||||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||||
{
|
{
|
||||||
arm1.IsUrgent = visit.IsUrgent;
|
|
||||||
arm1.TaskUrgentType = urgentType;
|
|
||||||
arm1.IsCanEditUrgentState = isCanEdit;
|
|
||||||
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
arm1.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
arm1.AllocateTime = DateTime.Now;
|
arm1.AllocateTime = DateTime.Now;
|
||||||
arm1.DoctorUserId = task1.DoctorUserId;
|
arm1.DoctorUserId = task1.DoctorUserId;
|
||||||
|
@ -885,9 +882,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
var latestTask = visitGroup.Where(t => t.ArmEnum == Arm.DoubleReadingArm1).OrderByDescending(t => t.CreateTime).First();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
var taskOne = await _visitTaskRepository.AddAsync(new VisitTask()
|
||||||
{
|
{
|
||||||
TrialId = trialId,
|
TrialId = trialId,
|
||||||
|
@ -909,15 +903,21 @@ namespace IRaCIS.Core.Application.Service
|
||||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||||
TaskAllocationState = TaskAllocationState.Allocated,
|
|
||||||
AllocateTime = DateTime.Now,
|
|
||||||
DoctorUserId = task1!.DoctorUserId,
|
|
||||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
|
||||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm1) && task1 != null)
|
||||||
|
{
|
||||||
|
taskOne.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
taskOne.AllocateTime = DateTime.Now;
|
||||||
|
taskOne. DoctorUserId = task1!.DoctorUserId;
|
||||||
|
taskOne. SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
@ -934,13 +934,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
var arm2 = visitGroup.FirstOrDefault(t => t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.NotAllocate && t.DoctorUserId == null && t.ArmEnum == Arm.DoubleReadingArm2);
|
||||||
if (arm2 != null)
|
if (arm2 != null)
|
||||||
{
|
|
||||||
//有可能仅仅只分配了一个Subject
|
|
||||||
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
|
||||||
{
|
{
|
||||||
arm2.IsUrgent = visit.IsUrgent;
|
arm2.IsUrgent = visit.IsUrgent;
|
||||||
arm2.TaskUrgentType = urgentType;
|
arm2.TaskUrgentType = urgentType;
|
||||||
arm2.IsCanEditUrgentState = isCanEdit;
|
arm2.IsCanEditUrgentState = isCanEdit;
|
||||||
|
|
||||||
|
//有可能仅仅只分配了一个Subject
|
||||||
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||||
|
{
|
||||||
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
arm2.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
arm2.AllocateTime = DateTime.Now;
|
arm2.AllocateTime = DateTime.Now;
|
||||||
arm2.DoctorUserId = task2.DoctorUserId;
|
arm2.DoctorUserId = task2.DoctorUserId;
|
||||||
|
@ -975,17 +976,20 @@ namespace IRaCIS.Core.Application.Service
|
||||||
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
BlindTrialSiteCode = latestTask.BlindTrialSiteCode,
|
||||||
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
IsAnalysisCreate = latestTask.IsAnalysisCreate,
|
||||||
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
IsSelfAnalysis = latestTask.IsSelfAnalysis,
|
||||||
TaskAllocationState = TaskAllocationState.Allocated,
|
|
||||||
|
|
||||||
AllocateTime = DateTime.Now,
|
|
||||||
DoctorUserId = task2!.DoctorUserId,
|
|
||||||
SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget),
|
|
||||||
|
|
||||||
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
TrialReadingCriterionId = latestTask.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = latestTask.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
IsClinicalDataSign = latestTask.IsClinicalDataSign
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (assignConfigList.Any(t => t.ArmEnum == Arm.DoubleReadingArm2) && task2 != null)
|
||||||
|
{
|
||||||
|
taskTwo.TaskAllocationState = TaskAllocationState.Allocated;
|
||||||
|
taskTwo.AllocateTime = DateTime.Now;
|
||||||
|
taskTwo.DoctorUserId = task2!.DoctorUserId;
|
||||||
|
taskTwo.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
|
}
|
||||||
|
|
||||||
currentMaxCodeInt = currentMaxCodeInt + 1;
|
currentMaxCodeInt = currentMaxCodeInt + 1;
|
||||||
|
|
||||||
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
_fusionCache.Set<int>(CacheKeys.TrialStudyMaxCode(trialId), currentMaxCodeInt, TimeSpan.FromMinutes(30));
|
||||||
|
@ -994,10 +998,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
//无序的时候 生成任务并分配出去
|
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
//无序的时候 生成任务并分配出去
|
||||||
|
if (assignConfigList.Count > 0 && trialReadingCriterionConfig.IsFollowVisitAutoAssign)
|
||||||
{
|
{
|
||||||
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
var defaultState = trialReadingCriterionConfig.FollowVisitAutoAssignDefaultState == TaskAllocateDefaultState.InitAllocated ? TaskAllocationState.InitAllocated : TaskAllocationState.Allocated;
|
||||||
|
|
||||||
|
@ -1018,21 +1027,10 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task2.AllocateTime = DateTime.Now;
|
task2.AllocateTime = DateTime.Now;
|
||||||
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
task2.SuggesteFinishedTime = GetSuggessFinishTime(true, UrgentType.NotUrget);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
|
||||||
//后续访视不自动分配,或者配置的医生数量不足,就不进行分配
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.Extensions.Logging;
|
using Microsoft.Extensions.Logging;
|
||||||
|
using Newtonsoft.Json;
|
||||||
using System.Linq.Dynamic.Core;
|
using System.Linq.Dynamic.Core;
|
||||||
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
using Subject = IRaCIS.Core.Domain.Models.Subject;
|
||||||
|
|
||||||
|
@ -74,7 +75,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
return await _visitTaskRepository.SaveChangesAsync();
|
return await _visitTaskRepository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null)
|
public async Task<List<TrialReadingCriterionDto>> GetTrialCriterionList(Guid trialId, bool isHaveSigned = true, bool? isAutoCreate = null, bool? isRandom = null)
|
||||||
{
|
{
|
||||||
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
var list = await _readingQuestionCriterionTrialRepository.Where(t => t.TrialId == trialId && t.IsConfirm)
|
||||||
|
|
||||||
|
@ -107,7 +108,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
|
|
||||||
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
return list.AsQueryable().WhereIf(isHaveSigned == true, t => t.ReadingInfoSignTime != null)
|
||||||
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate).ToList();
|
.WhereIf(isAutoCreate == false, t => t.IsAutoCreate == isAutoCreate)
|
||||||
|
.WhereIf(isRandom == true, t => t.IsReadingTaskViewInOrder == ReadingOrder.Random).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -761,6 +763,8 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||||
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||||
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||||
|
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
||||||
|
.WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState==ReadingTaskState.Reading) && t.TaskAllocationState==TaskAllocationState.Allocated)
|
||||||
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
.ProjectTo<ReadingTaskView>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
var defalutSortArray = new string[] { nameof(ReadingTaskView.IsUrgent) + " desc", nameof(ReadingTaskView.SubjectCode), nameof(ReadingTaskView.VisitTaskNum) };
|
||||||
|
@ -1005,6 +1009,10 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
if (critrion.IsReadingTaskViewInOrder == ReadingOrder.InOrder)
|
||||||
{
|
{
|
||||||
|
var extralObj = _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.TrialExtraConfigJsonStr }).FirstOrDefault();
|
||||||
|
|
||||||
|
var extralConfig = JsonConvert.DeserializeObject<TrialExtraConfig>(extralObj?.TrialExtraConfigJsonStr) ?? new TrialExtraConfig();
|
||||||
|
|
||||||
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
|
var visitQuery = _visitTaskRepository.Where(x => x.TrialId == inQuery.TrialId && x.DoctorUserId == _userInfo.UserRoleId && x.TaskState == TaskState.Effect)
|
||||||
|
|
||||||
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, x => x.SubjectId == inQuery.SubjectId)
|
||||||
|
@ -1012,7 +1020,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
.WhereIf(critrion.IsAutoCreate == false, t => !t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(f => f.IsGeneratedTask == false && t.VisitTaskNum > f.SubjectVisit.VisitNum))
|
||||||
|
|
||||||
// 前序 不存在 未一致性核查未通过的
|
// 前序 不存在 未一致性核查未通过的
|
||||||
.Where(t => !t.Subject.SubjectVisitList.Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
.Where(t => !t.Subject.SubjectVisitList.Where(t => extralConfig.IsOpenLostVistRead ? t.IsLostVisit == false : true).Any(sv => sv.CheckState != CheckStateEnum.CVPassed && t.VisitTaskNum >= sv.VisitNum))
|
||||||
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
//.WhereIf(critrion.IsAutoCreate == false, t => t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId).Any(t => t.IsGeneratedTask == false) ?
|
||||||
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
//t.VisitTaskNum <= t.Subject.SubjectCriteriaEvaluationVisitFilterList.Where(t => t.TrialReadingCriterionId == trialReadingCriterionId && t.IsGeneratedTask == false).Min(t => t.SubjectVisit.VisitNum) : true)
|
||||||
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
//.Where(t => t.Subject.SubjectVisitList.Any(t => t.CheckState != CheckStateEnum.CVPassed) ? t.VisitTaskNum <= t.Subject.SubjectVisitList.Where(t => t.CheckState != CheckStateEnum.CVPassed).Min(t => t.VisitNum) : true)
|
||||||
|
@ -1035,14 +1043,15 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
UnReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned).Count(),
|
||||||
|
|
||||||
//未读 里可读任务量
|
//未读 里可读任务量
|
||||||
UnReadCanReadTaskCount = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
UnReadCanReadTaskCount = x.Where(t => extralConfig.IsOpenLostVistRead ? true : t.IsFrontTaskNeedSignButNotSign == false).Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true)
|
||||||
//不能对包含聚合或子查询的表达式执行聚合函数
|
//不能对包含聚合或子查询的表达式执行聚合函数
|
||||||
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
//&& !x.Any(t => t.ReadingTaskState != ReadingTaskState.HaveSigned && t.IsNeedClinicalDataSign == true && t.IsClinicalDataSign == false && t.VisitTaskNum<y.VisitTaskNum )
|
||||||
).Count(),
|
).Count(),
|
||||||
|
|
||||||
|
|
||||||
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
UnReadCanReadTaskList = x.Where(y => y.TrialReadingCriterionId == trialReadingCriterionId && y.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
.Where(y => y.IsFrontTaskNeedSignButNotSign == false && (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
.Where(t => extralConfig.IsOpenLostVistRead ? true : t.IsFrontTaskNeedSignButNotSign == false)
|
||||||
|
.Where(y => /*y.IsFrontTaskNeedSignButNotSign == false &&*/ (y.IsNeedClinicalDataSign == false || y.IsClinicalDataSign == true))
|
||||||
.OrderBy(x => x.VisitTaskNum)
|
.OrderBy(x => x.VisitTaskNum)
|
||||||
.Select(u => new IRUnreadTaskView()
|
.Select(u => new IRUnreadTaskView()
|
||||||
{
|
{
|
||||||
|
@ -1055,7 +1064,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
ReadingCategory = u.ReadingCategory,
|
ReadingCategory = u.ReadingCategory,
|
||||||
IsAnalysisCreate = u.IsAnalysisCreate,
|
IsAnalysisCreate = u.IsAnalysisCreate,
|
||||||
ArmEnum = u.ArmEnum,
|
ArmEnum = u.ArmEnum,
|
||||||
IsExistUnprocessedFeedback=u.UserFeedBackList.Any(t => t.State ==0),
|
IsExistUnprocessedFeedback = u.UserFeedBackList.Any(t => t.State == 0),
|
||||||
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
TrialReadingCriterionId = u.TrialReadingCriterionId,
|
||||||
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
IsNeedClinicalDataSign = u.IsNeedClinicalDataSign,
|
||||||
IsClinicalDataSign = u.IsClinicalDataSign,
|
IsClinicalDataSign = u.IsClinicalDataSign,
|
||||||
|
@ -2244,7 +2253,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
var originalVisitTaskId = item.VisitTaskId;
|
var originalVisitTaskId = item.VisitTaskId;
|
||||||
var originalFristAddTaskId = item.FristAddTaskId;
|
var originalFristAddTaskId = item.FristAddTaskId;
|
||||||
|
|
||||||
var newRowId= NewId.NextSequentialGuid();
|
var newRowId = NewId.NextSequentialGuid();
|
||||||
|
|
||||||
foreach (var mark in readingTaskQuestionMarkList)
|
foreach (var mark in readingTaskQuestionMarkList)
|
||||||
{
|
{
|
||||||
|
@ -2285,7 +2294,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
|
||||||
public async Task<IResponseOutput> PMSetTaskBack(Guid trialId, Guid taskId,string pmBackReason)
|
public async Task<IResponseOutput> PMSetTaskBack(Guid trialId, Guid taskId, string pmBackReason)
|
||||||
{
|
{
|
||||||
|
|
||||||
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
//var trialConfig = (await _trialRepository.Where(t => t.Id == trialId).Select(t => new { TrialId = t.Id, t.IsReadingTaskViewInOrder, t.ReadingType }).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
@ -2577,7 +2586,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
sv.CurrentActionUserId = null;
|
sv.CurrentActionUserId = null;
|
||||||
sv.PreliminaryAuditUserId = null;
|
sv.PreliminaryAuditUserId = null;
|
||||||
sv.ReviewAuditUserId = null;
|
sv.ReviewAuditUserId = null;
|
||||||
|
sv.SecondReviewState = SecondReviewState.None;
|
||||||
|
|
||||||
if (sv.IsBaseLine)
|
if (sv.IsBaseLine)
|
||||||
{
|
{
|
||||||
|
@ -2616,7 +2625,7 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
|
|
||||||
private bool IsSpmOrCPM()
|
private bool IsSpmOrCPM()
|
||||||
{
|
{
|
||||||
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM ;
|
return _userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -2942,6 +2951,88 @@ public class VisitTaskService(IRepository<VisitTask> _visitTaskRepository,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#region 完全随机设置序号
|
||||||
|
[HttpPost]
|
||||||
|
[UnitOfWork]
|
||||||
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
|
public async Task<IResponseOutput> SetRandomTaskOrder(SetRandomTaskOrderCommand inCommand)
|
||||||
|
{
|
||||||
|
|
||||||
|
if (inCommand.IsAutoSet)
|
||||||
|
{
|
||||||
|
//找到所有的已分配的,未阅片的,生效的 非一致性分析
|
||||||
|
|
||||||
|
var needRandomOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
||||||
|
.Where(t => t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||||
|
.Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
//var haveSignOrderList = _visitTaskRepository.Where(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId)
|
||||||
|
// .Where(t => t.ReadingTaskState == ReadingTaskState.HaveSigned && t.SignTime != null && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze))
|
||||||
|
// .Select(t => t.RandomOrder).ToList();
|
||||||
|
|
||||||
|
//已阅,阅片中任务的序号
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId
|
||||||
|
&& t.DoctorUserId == inCommand.DoctorUserId && t.ReadingTaskState != ReadingTaskState.WaitReading, u => new VisitTask() { RandomOrder = null });
|
||||||
|
|
||||||
|
//随机赋值编号 比如要处理5个任务,实例化一个包含1-5的数组,每次随机取出一个
|
||||||
|
List<int> availableNumbers = Enumerable.Range(1, needRandomOrderList.Count).ToList();
|
||||||
|
Random rng = new Random();
|
||||||
|
foreach (var id in needRandomOrderList)
|
||||||
|
{
|
||||||
|
int randomIndex = rng.Next(availableNumbers.Count);
|
||||||
|
|
||||||
|
var num = availableNumbers[randomIndex];
|
||||||
|
|
||||||
|
var order = 11 + 5 * (num - 1);
|
||||||
|
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, t => new VisitTask() { RandomOrder = order });
|
||||||
|
|
||||||
|
availableNumbers.RemoveAt(randomIndex);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
foreach (var item in inCommand.SetList)
|
||||||
|
{
|
||||||
|
var task = await _visitTaskRepository.Where(t => t.Id == item.Id).Select(t => new { t.RandomOrder, t.ReadingTaskState, t.TaskAllocationState, t.DoctorUserId }).FirstNotNullAsync();
|
||||||
|
|
||||||
|
if (task.ReadingTaskState != ReadingTaskState.WaitReading || task.DoctorUserId != inCommand.DoctorUserId
|
||||||
|
|| task.TaskAllocationState != TaskAllocationState.Allocated)
|
||||||
|
{
|
||||||
|
//"任务不符合设置阅片序号条件"
|
||||||
|
return ResponseOutput.NotOk(_localizer["VisitTask_NotRandomOrderTask"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
//设置交换序号的任务,可能不符合条件
|
||||||
|
|
||||||
|
//没有序号,直接设置
|
||||||
|
if (task.RandomOrder == null)
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if(!_visitTaskRepository.Any(t => t.TrialId == inCommand.TrialId && t.TrialReadingCriterionId == inCommand.TrialReadingCriterionId && t.DoctorUserId == inCommand.DoctorUserId
|
||||||
|
&& t.TaskAllocationState == TaskAllocationState.Allocated && t.ReadingTaskState == ReadingTaskState.WaitReading && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||||
|
&& t.RandomOrder == item.RandomOrder))
|
||||||
|
{
|
||||||
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == item.Id, t => new VisitTask() { RandomOrder = item.RandomOrder });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//"序号已被占用!"
|
||||||
|
return ResponseOutput.NotOk(_localizer["VisitTask_RandomOrderUserd"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
#region 暂时废弃
|
#region 暂时废弃
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -361,7 +361,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var systemDocQuery =
|
var systemDocQuery =
|
||||||
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
||||||
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.Status == UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
||||||
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
@ -1304,8 +1304,10 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
var list = await _visitTaskRepository.Where(t => t.TrialId == inQuery.TrialId && t.IsAnalysisCreate == false)
|
||||||
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
//.Where(t => t.IsAnalysisCreate == false && t.DoctorUserId != null)
|
||||||
|
|
||||||
|
.WhereIf(inQuery.IsEffect == true, t => t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze)
|
||||||
|
.WhereIf(inQuery.IsEffect == false, t => t.TaskState == TaskState.Adbandon || t.TaskState == TaskState.HaveReturned)
|
||||||
|
|
||||||
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
.WhereIf(inQuery.TaskState != null, t => t.TaskState == inQuery.TaskState)
|
||||||
.WhereIf(inQuery.ArmEnum != null, t => t.ArmEnum == inQuery.ArmEnum)
|
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
.WhereIf(inQuery.SubjectId != null, t => t.SubjectId == inQuery.SubjectId)
|
||||||
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
.WhereIf(inQuery.IsUrgent != null, t => t.IsUrgent == inQuery.IsUrgent)
|
||||||
|
@ -1314,27 +1316,51 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
.WhereIf(inQuery.ReadingTaskState != null, t => t.ReadingTaskState == inQuery.ReadingTaskState)
|
||||||
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
.WhereIf(inQuery.TaskAllocationState != null, t => t.TaskAllocationState == inQuery.TaskAllocationState)
|
||||||
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
.WhereIf(inQuery.TrialReadingCriterionId != null, t => t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId)
|
||||||
|
.WhereIf(inQuery.ReReadingApplyState != null, t => t.ReReadingApplyState == inQuery.ReReadingApplyState)
|
||||||
|
|
||||||
|
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.Complete, t => t.IsClinicalDataSign && t.IsNeedClinicalDataSign == true)
|
||||||
|
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NotComplete, t => t.IsClinicalDataSign == false && t.IsNeedClinicalDataSign == true)
|
||||||
|
.WhereIf(inQuery.CompleteClinicalDataEnum == CompleteClinicalDataEnum.NA, t => t.IsNeedClinicalDataSign == false)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialSiteCode), t => (t.BlindTrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate) || (t.Subject.TrialSite.TrialSiteCode.Contains(inQuery.TrialSiteCode!) && t.IsAnalysisCreate == false))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TaskName), t => t.TaskName.Contains(inQuery.TaskName) || t.TaskBlindName.Contains(inQuery.TaskName))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => t.Subject.Code.Contains(inQuery.SubjectCode) || t.BlindSubjectCode.Contains(inQuery.SubjectCode))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubjectCode), t => (t.Subject.Code.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate == false) || (t.BlindSubjectCode.Contains(inQuery.SubjectCode) && t.IsAnalysisCreate))
|
||||||
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
.WhereIf(inQuery.BeginAllocateDate != null, t => t.AllocateTime > inQuery.BeginAllocateDate)
|
||||||
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate!.Value.AddDays(1))
|
.WhereIf(inQuery.EndAllocateDate != null, t => t.AllocateTime < inQuery.EndAllocateDate)
|
||||||
|
.WhereIf(inQuery.BeginSignTime != null, t => t.SignTime > inQuery.BeginSignTime)
|
||||||
|
.WhereIf(inQuery.EndSignTime != null, t => t.SignTime < inQuery.EndSignTime)
|
||||||
|
.WhereIf(inQuery.RandomOrder != null, t => t.RandomOrder == inQuery.RandomOrder)
|
||||||
|
.WhereIf(inQuery.IsRandomOrderList == true, t => (t.ReadingTaskState == ReadingTaskState.WaitReading || t.ReadingTaskState == ReadingTaskState.Reading) && t.TaskAllocationState == TaskAllocationState.Allocated)
|
||||||
|
|
||||||
.ProjectTo<ReadingTaskExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<ReadingTaskExportDto>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
//var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
//var defalutSortArray = new string[] { nameof(VisitTask.IsUrgent) + " desc", nameof(VisitTask.SubjectId), nameof(VisitTask.VisitTaskNum) };
|
||||||
|
|
||||||
list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitTaskNum).ToList();
|
|
||||||
|
|
||||||
|
|
||||||
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
var exportInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
|
||||||
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
exportInfo.CurrentTime = ExportExcelConverterDate.DateTimeInternationalToString(DateTime.Now, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
|
|
||||||
|
if (inQuery.IsRandomOrderList == true)
|
||||||
|
{
|
||||||
|
list = list.OrderBy(t => t.RandomOrder).ToList();
|
||||||
|
|
||||||
|
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialTaskRandomOrderList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
list = list.OrderBy(t => t.TrialSiteCode).ThenBy(t => t.SubjectCode).ThenBy(t => t.VisitTaskNum).ToList();
|
||||||
|
|
||||||
|
exportInfo.List = ExportExcelConverterDate.ConvertToClientTimeInObject(list, _userInfo.TimeZoneId);
|
||||||
|
|
||||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialReadingTaskList_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(ReadingTaskExportDto));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -799,7 +799,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var systemDocQuery =
|
var systemDocQuery =
|
||||||
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
from sysDoc in _systemDocumentRepository.AsQueryable(false)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == inQuery.UserTypeId) : true)
|
||||||
from identityUser in _identityUserRepository.AsQueryable(false).Where(t => t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
from identityUser in _identityUserRepository.AsQueryable(false).Where(t =>t.Status== UserStateEnum.Enable && t.UserRoleList.Where(t => t.IsUserRoleDisabled == false).Any(t => sysDoc.NeedConfirmedUserTypeList.AsQueryable().Any(c => c.NeedConfirmUserTypeId == t.UserTypeId)))
|
||||||
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
.Where(t => inQuery.UserId != null ? t.Id == inQuery.UserId : true)
|
||||||
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
.Where(t => inQuery.UserTypeId != null ? t.UserRoleList.Any(t => t.UserTypeId == inQuery.UserTypeId && t.IsUserRoleDisabled == false) : true)
|
||||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = identityUser.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||||
|
|
|
@ -81,7 +81,7 @@ namespace IRaCIS.Core.Application.Contracts.Dicom.DTO
|
||||||
|
|
||||||
public bool IsReading { get; set; }
|
public bool IsReading { get; set; }
|
||||||
public bool IsDeleted { get; set; }
|
public bool IsDeleted { get; set; }
|
||||||
|
public long? FileSize { get; set; }
|
||||||
|
|
||||||
|
|
||||||
public Guid? StudyId { get; set; }
|
public Guid? StudyId { get; set; }
|
||||||
|
|
|
@ -107,8 +107,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||||
public string Modalities { get; set; }
|
public string Modalities { get; set; }
|
||||||
|
|
||||||
public string Description { get; set; }
|
public string Description { get; set; }
|
||||||
|
|
||||||
public int SeriesCount { get; set; }
|
public int SeriesCount { get; set; }
|
||||||
public int InstanceCount { get; set; }
|
public int InstanceCount { get; set; }
|
||||||
|
|
||||||
|
public int ReadingSeriesCount { get; set; }
|
||||||
|
|
||||||
|
public int ReadingInstanceCount { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class NoneDicomStudyBasicInfo
|
public class NoneDicomStudyBasicInfo
|
||||||
|
@ -128,6 +133,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc.DTO
|
||||||
public string Description { get; set; } = string.Empty;
|
public string Description { get; set; } = string.Empty;
|
||||||
|
|
||||||
|
|
||||||
|
public int ReadingFileCount { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ using MassTransit.Initializers;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System.Data;
|
using System.Data;
|
||||||
using System.IO.Compression;
|
using System.IO.Compression;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
@ -62,7 +63,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
//subject 随机阅片 或者无序 有上传 才处理任务编号
|
//subject 随机阅片 或者无序 有上传 才处理任务编号
|
||||||
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
|
if (_visitTaskRepository.Any(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId &&
|
||||||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom ||
|
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.SubjectRandom ||
|
||||||
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageUploadEnum != ReadingImageUpload.None))))
|
(t.TrialReadingCriterion.IsReadingTaskViewInOrder == ReadingOrder.Random && t.TrialReadingCriterion.ImageDownloadEnum != ReadingImageDownload.None))))
|
||||||
{
|
{
|
||||||
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
//找到 非一致性分析,未签名,状态正常的 并且任务名称是TimePoint的 任务
|
||||||
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
var needDealTaskList = await _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == trialReadingCriterionId && t.IsAnalysisCreate == false && t.DoctorUserId == _userInfo.UserRoleId
|
||||||
|
@ -881,6 +882,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
subjectCode = inQuery.SubjectCode;
|
subjectCode = inQuery.SubjectCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TaskState? taskState = null;
|
||||||
if (inQuery.VisitTaskId != null)
|
if (inQuery.VisitTaskId != null)
|
||||||
{
|
{
|
||||||
//考虑到一致性分析,必须要这个编号进行过滤
|
//考虑到一致性分析,必须要这个编号进行过滤
|
||||||
|
@ -891,19 +893,25 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
SubjectCode = t.IsAnalysisCreate ? t.BlindSubjectCode : t.Subject.Code,
|
SubjectCode = t.IsAnalysisCreate ? t.BlindSubjectCode : t.Subject.Code,
|
||||||
SubjectId = t.SubjectId,
|
SubjectId = t.SubjectId,
|
||||||
t.DoctorUserId,
|
t.DoctorUserId,
|
||||||
t.IsAnalysisCreate
|
t.IsAnalysisCreate,
|
||||||
|
t.TaskState
|
||||||
}).FirstNotNullAsync();
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
subjectId = taskInfo.SubjectId;
|
subjectId = taskInfo.SubjectId;
|
||||||
subjectCode = taskInfo.SubjectCode;
|
subjectCode = taskInfo.SubjectCode;
|
||||||
doctorUserId = (Guid)taskInfo.DoctorUserId!;
|
doctorUserId = (Guid)taskInfo.DoctorUserId!;
|
||||||
isAnalysisCreate = taskInfo.IsAnalysisCreate;
|
isAnalysisCreate = taskInfo.IsAnalysisCreate;
|
||||||
|
|
||||||
|
taskState = taskInfo.TaskState;
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
var query = _visitTaskRepository.Where(t => t.SubjectId == subjectId && t.TrialReadingCriterionId == inQuery.TrialReadingCriterionId
|
||||||
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId && t.TaskState == TaskState.Effect)
|
&& t.SourceSubjectVisitId != null && t.DoctorUserId == doctorUserId)
|
||||||
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
//满足 有序,或者随机只看到当前任务的dicom 非dicom检查
|
||||||
|
.WhereIf(inQuery.VisitTaskId == null, t => t.TaskState == TaskState.Effect)//从待阅列表进入,要筛选出有效的,任务可能重阅了,也要看到该任务的
|
||||||
.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)
|
||||||
|
.WhereIf(taskState == TaskState.Effect || taskState == TaskState.Freeze, t => t.TaskState == TaskState.Effect)//subject 随机可能当前阅片人有退回任务,此时传递了任务Id,但是要看整个subject得,要只留生效的
|
||||||
|
.WhereIf(taskState != null && taskState != TaskState.Effect && taskState != TaskState.Freeze, t => t.Id == inQuery.VisitTaskId) //非生效只查当前任务
|
||||||
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
.ProjectTo<SubjectCRCImageUploadedDto>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
//这里过滤是否是一致性分析的
|
//这里过滤是否是一致性分析的
|
||||||
|
@ -1004,11 +1012,11 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
u.StudyTime,
|
u.StudyTime,
|
||||||
u.StudyCode,
|
u.StudyCode,
|
||||||
|
|
||||||
SeriesList = u.SeriesList.Select(z => new
|
SeriesList = u.SeriesList.Where(t => t.IsReading).Select(z => new
|
||||||
{
|
{
|
||||||
z.Modality,
|
z.Modality,
|
||||||
|
|
||||||
InstancePathList = z.DicomInstanceList.Select(k => new
|
InstancePathList = z.DicomInstanceList.Where(t => t.IsReading).Select(k => new
|
||||||
{
|
{
|
||||||
k.Path,
|
k.Path,
|
||||||
k.FileSize
|
k.FileSize
|
||||||
|
@ -1019,13 +1027,14 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false)
|
NoneDicomStudyList = sv.NoneDicomStudyList.Where(t => isQueryNoneDicom ? inQuery.NoneDicomStudyIdList.Contains(t.Id) : false)
|
||||||
.Where(t => info.IsImageFilter ? ("|" + info.CriterionModalitys + "|").Contains("|" + t.Modality + "|") : true)
|
.Where(t => info.IsImageFilter ? ("|" + info.CriterionModalitys + "|").Contains("|" + t.Modality + "|") : true)
|
||||||
|
.Where(t => t.IsReading)
|
||||||
.Select(nd => new
|
.Select(nd => new
|
||||||
{
|
{
|
||||||
nd.Modality,
|
nd.Modality,
|
||||||
nd.StudyCode,
|
nd.StudyCode,
|
||||||
nd.ImageDate,
|
nd.ImageDate,
|
||||||
|
|
||||||
FileList = nd.NoneDicomFileList.Select(file => new
|
FileList = nd.NoneDicomFileList.Where(t => t.IsReading).Select(file => new
|
||||||
{
|
{
|
||||||
file.FileName,
|
file.FileName,
|
||||||
file.Path,
|
file.Path,
|
||||||
|
@ -1107,7 +1116,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
HtmlPath = k.HtmlPath,
|
HtmlPath = k.HtmlPath,
|
||||||
Path = k.Path,
|
Path = k.Path,
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
FileSize=k.FileSize,
|
||||||
}).ToList()
|
}).ToList()
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
|
@ -4,7 +4,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IStudyService
|
public interface IStudyService
|
||||||
{
|
{
|
||||||
IResponseOutput<List<RelationStudyDTO>> GetAllRelationStudyList(Guid subjectVisitId);
|
IResponseOutput<List<RelationStudyDTO>> GetAllRelationStudyList(Guid subjectVisitId,bool? isReading);
|
||||||
Task<PageOutput<UnionStudyViewModel>> GetDicomAndNoneDicomStudyList(StudyQuery studyQuery);
|
Task<PageOutput<UnionStudyViewModel>> GetDicomAndNoneDicomStudyList(StudyQuery studyQuery);
|
||||||
Task<PageOutput<UnionStudyMonitorModel>> GetDicomAndNoneDicomStudyMonitorList(StudyQuery studyQuery);
|
Task<PageOutput<UnionStudyMonitorModel>> GetDicomAndNoneDicomStudyMonitorList(StudyQuery studyQuery);
|
||||||
(List<string> SeriesInstanceUid, List<string> SopInstanceUid) GetHasUploadSeriesAndInstance(Guid studyId);
|
(List<string> SeriesInstanceUid, List<string> SopInstanceUid) GetHasUploadSeriesAndInstance(Guid studyId);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
using IRaCIS.Core.Application.Contracts.Dicom.DTO;
|
||||||
using IRaCIS.Core.Application.Helper;
|
using IRaCIS.Core.Application.Helper;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using Microsoft.AspNetCore.Authorization;
|
using Microsoft.AspNetCore.Authorization;
|
||||||
using Microsoft.AspNetCore.Hosting;
|
using Microsoft.AspNetCore.Hosting;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
@ -19,8 +20,9 @@ namespace IRaCIS.Core.Application.Services
|
||||||
//医生读片那一块有耦合,关键序列 这里暂时留存
|
//医生读片那一块有耦合,关键序列 这里暂时留存
|
||||||
/// <summary> 指定资源Id,获取Dicom检查所属序列信息列表 </summary>
|
/// <summary> 指定资源Id,获取Dicom检查所属序列信息列表 </summary>
|
||||||
/// <param name="studyId"> Dicom检查的Id </param>
|
/// <param name="studyId"> Dicom检查的Id </param>
|
||||||
|
/// <param name="isReading"></param>
|
||||||
[HttpGet, Route("{studyId:guid}")]
|
[HttpGet, Route("{studyId:guid}")]
|
||||||
public async Task<IResponseOutput<List<DicomSeriesDTO>>> List(Guid studyId)
|
public async Task<IResponseOutput<List<DicomSeriesDTO>>> List(Guid studyId, bool? isReading)
|
||||||
{
|
{
|
||||||
//质控的时候,要标记序列,和instance 删除 ,所以要返回全部,但是 质控通过后,pm 进去看的时候要看过滤后的
|
//质控的时候,要标记序列,和instance 删除 ,所以要返回全部,但是 质控通过后,pm 进去看的时候要看过滤后的
|
||||||
|
|
||||||
|
@ -32,14 +34,16 @@ namespace IRaCIS.Core.Application.Services
|
||||||
//断点
|
//断点
|
||||||
var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
var seriesList = await _seriesRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
||||||
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
||||||
|
.WhereIf(isReading == true, t => t.IsReading == true)
|
||||||
.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime)
|
.OrderBy(s => s.SeriesNumber).ThenBy(s => s.SeriesTime).ThenBy(s => s.CreateTime)
|
||||||
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
var instanceList = await _instanceRepository.Where(s => s.StudyId == studyId).IgnoreQueryFilters()
|
||||||
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
||||||
|
.WhereIf(isReading == true, t => t.IsReading == true)
|
||||||
.OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
.OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||||
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||||
|
|
||||||
|
|
||||||
foreach (var series in seriesList)
|
foreach (var series in seriesList)
|
||||||
|
@ -54,7 +58,8 @@ namespace IRaCIS.Core.Application.Services
|
||||||
Path = k.Path,
|
Path = k.Path,
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
IsReading = k.IsReading,
|
IsReading = k.IsReading,
|
||||||
IsDeleted = k.IsDeleted
|
IsDeleted = k.IsDeleted,
|
||||||
|
FileSize = k.FileSize
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
|
@ -579,7 +579,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpGet("{subjectVisitId:guid}")]
|
[HttpGet("{subjectVisitId:guid}")]
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public IResponseOutput<List<RelationStudyDTO>> GetAllRelationStudyList(Guid subjectVisitId)
|
public IResponseOutput<List<RelationStudyDTO>> GetAllRelationStudyList(Guid subjectVisitId,bool? isReading)
|
||||||
{
|
{
|
||||||
#region 废弃
|
#region 废弃
|
||||||
//var studylist = _studyRepository.Where(u => u.SubjectVisitId == subjectVisitId && u.IsDeleted == false).Select(t => new { StudyId = t.Id, t.SubjectId, t.TrialId }).ToList();
|
//var studylist = _studyRepository.Where(u => u.SubjectVisitId == subjectVisitId && u.IsDeleted == false).Select(t => new { StudyId = t.Id, t.SubjectId, t.TrialId }).ToList();
|
||||||
|
@ -607,10 +607,18 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
var studyInfo = _dicomStudyRepository.Where(u => u.SubjectVisitId == subjectVisitId).Select(t => new { t.SubjectId, t.TrialId }).FirstOrDefault().IfNullThrowException();
|
var studyInfo = _dicomStudyRepository.Where(u => u.SubjectVisitId == subjectVisitId).Select(t => new { t.SubjectId, t.TrialId }).FirstOrDefault().IfNullThrowException();
|
||||||
|
|
||||||
var query = _dicomStudyRepository.Where(t => t.SubjectVisitId != subjectVisitId && t.TrialId == studyInfo.TrialId && t.SubjectId == studyInfo.SubjectId)
|
var list = _dicomStudyRepository.Where(t => t.SubjectVisitId != subjectVisitId && t.TrialId == studyInfo.TrialId && t.SubjectId == studyInfo.SubjectId)
|
||||||
.ProjectTo<RelationStudyDTO>(_mapper.ConfigurationProvider).ToList();
|
.Select(t=> new RelationStudyDTO()
|
||||||
|
{
|
||||||
|
StudyId = t.Id,
|
||||||
|
StudyCode = t.StudyCode,
|
||||||
|
VisitName = t.SubjectVisit.VisitName,
|
||||||
|
Modalities = t.Modalities,
|
||||||
|
Description = t.Description,
|
||||||
|
SeriesCount = t.SeriesList.Where(t=> isReading==true? t.IsReading==true:true).Count()
|
||||||
|
}) .ToList();
|
||||||
|
|
||||||
var list = query.OrderBy(u => u.VisitName).ThenBy(s => s.StudyCode).ToList();
|
list = list.Where(t=>t.SeriesCount>0).OrderBy(u => u.VisitName).ThenBy(s => s.StudyCode).ToList();
|
||||||
|
|
||||||
return ResponseOutput.Ok(list);
|
return ResponseOutput.Ok(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,16 +130,20 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.CriterionModalitys, u => u.MapFrom(s => s.TrialReadingCriterion.CriterionModalitys))
|
.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.SubjectCode, u => u.MapFrom(u => u.IsAnalysisCreate == true ? u.BlindSubjectCode : u.Subject.Code));
|
||||||
|
|
||||||
CreateMap<DicomStudy, DicomStudyBasicInfo>();
|
CreateMap<DicomStudy, DicomStudyBasicInfo>()
|
||||||
CreateMap<NoneDicomStudy, NoneDicomStudyBasicInfo>();
|
.ForMember(d => d.ReadingSeriesCount, u => u.MapFrom(s => s.SeriesList.Where(t => t.IsReading).Count()))
|
||||||
|
.ForMember(d => d.ReadingInstanceCount, u => u.MapFrom(s => s.InstanceList.Where(t => t.IsReading && t.DicomSerie.IsReading).Count()));
|
||||||
|
|
||||||
|
CreateMap<NoneDicomStudy, NoneDicomStudyBasicInfo>()
|
||||||
|
.ForMember(d => d.ReadingFileCount, u => u.MapFrom(s => s.NoneDicomFileList.Where(t => t.IsReading).Count()));
|
||||||
|
|
||||||
CreateMap<VisitTask, SubjectCRCImageUploadedDto>()
|
CreateMap<VisitTask, SubjectCRCImageUploadedDto>()
|
||||||
.ForMember(d => d.VisitTaskId, u => u.MapFrom(s => s.Id))
|
.ForMember(d => d.VisitTaskId, u => u.MapFrom(s => s.Id))
|
||||||
.ForMember(d => d.IsImageFilter, u => u.MapFrom(s => s.TrialReadingCriterion.IsImageFilter))
|
.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.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.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))
|
.ForMember(d => d.NoneDicomStudyList, u => u.MapFrom(s => s.SourceSubjectVisit.NoneDicomStudyList.Where(t => t.IsReading)));
|
||||||
;
|
|
||||||
|
|
||||||
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
||||||
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||||
|
|
|
@ -199,6 +199,8 @@ namespace IRaCIS.Core.Application.Service.Inspection.DTO
|
||||||
public Guid subjectVisitId { get; set; }
|
public Guid subjectVisitId { get; set; }
|
||||||
|
|
||||||
public AuditStateEnum auditState { get; set; }
|
public AuditStateEnum auditState { get; set; }
|
||||||
|
|
||||||
|
public bool? IsSecondPass { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SetSeriesStateDto
|
public class SetSeriesStateDto
|
||||||
|
|
|
@ -251,7 +251,13 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SecondReviewDto
|
||||||
|
{
|
||||||
|
public DateTime? SecondReviewTime { get; set; }
|
||||||
|
public string FullName { get; set; }
|
||||||
|
public string UserName { get; set; }
|
||||||
|
public DateTime? SignTime { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public class TrialVisitQADTO
|
public class TrialVisitQADTO
|
||||||
|
@ -270,6 +276,7 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
||||||
|
|
||||||
public QARelationInfo RelationInfo { get; set; } = new QARelationInfo();
|
public QARelationInfo RelationInfo { get; set; } = new QARelationInfo();
|
||||||
|
|
||||||
|
public List<SecondReviewDto> SecondReviewList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -203,6 +203,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public bool IsShowStudyName { get; set; } = false;
|
public bool IsShowStudyName { get; set; } = false;
|
||||||
|
|
||||||
|
public bool IsQCQuestionConfirmed { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -897,6 +899,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
/*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/;
|
/*string.Format("{0}分钟", (ReadingDurationTimeSpan)?.TotalMinutes)*/;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1947,6 +1951,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public class QCQuestionAnswer
|
public class QCQuestionAnswer
|
||||||
{
|
{
|
||||||
|
public Guid? AnswerId { get; set; }
|
||||||
public Guid Id { get; set; }
|
public Guid Id { get; set; }
|
||||||
public string QuestionName { get; set; } = String.Empty;
|
public string QuestionName { get; set; } = String.Empty;
|
||||||
public bool IsRequired { get; set; }
|
public bool IsRequired { get; set; }
|
||||||
|
@ -1975,6 +1980,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
// 1代表第一个人QC数据 2 代表第二个人QC数据
|
// 1代表第一个人QC数据 2 代表第二个人QC数据
|
||||||
public CurrentQC CurrentQCEnum { get; set; }
|
public CurrentQC CurrentQCEnum { get; set; }
|
||||||
|
|
||||||
|
public DateTime? SecondReviewTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class ForwardQuery : PageInput
|
public class ForwardQuery : PageInput
|
||||||
|
@ -2128,6 +2135,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
public class QCVisitBasicListViewModel
|
public class QCVisitBasicListViewModel
|
||||||
{
|
{
|
||||||
|
public SecondReviewState SecondReviewState { get; set; }
|
||||||
|
public bool IsSubjectQuit { get; set; }
|
||||||
public ChallengeStateEnum ChallengeState { get; set; }
|
public ChallengeStateEnum ChallengeState { get; set; }
|
||||||
public bool? IsConfirmedClinicalData { get; set; }
|
public bool? IsConfirmedClinicalData { get; set; }
|
||||||
public bool IsQCConfirmedReupload { get; set; }
|
public bool IsQCConfirmedReupload { get; set; }
|
||||||
|
|
|
@ -35,6 +35,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public DateTime UpdateTime { get; set; }
|
public DateTime UpdateTime { get; set; }
|
||||||
public Guid UpdateUserId { get; set; }
|
public Guid UpdateUserId { get; set; }
|
||||||
|
|
||||||
|
public bool IsQuestionQCAuditPassed { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class QCQuestionFilterSelect
|
public class QCQuestionFilterSelect
|
||||||
|
|
|
@ -13,7 +13,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
|
Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState);
|
||||||
Task<IResponseOutput> SetCheckPass(SetCheckPassDt data);
|
Task<IResponseOutput> SetCheckPass(SetCheckPassDt data);
|
||||||
|
|
||||||
|
Task<IResponseOutput> QCSecondReviewPassedOrFailed(Guid trialId, Guid subjectVisitId, bool isSecondPass);
|
||||||
|
|
||||||
|
|
||||||
Task<IResponseOutput> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand);
|
Task<IResponseOutput> AddCheckChallengeReply(CheckChallengeDialogCommand checkDialogCommand);
|
||||||
|
|
|
@ -7,6 +7,8 @@ using IRaCIS.Core.Infrastructure;
|
||||||
using IRaCIS.Core.Infrastructure.Extention;
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using MassTransit.Initializers;
|
using MassTransit.Initializers;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Image.QA
|
namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
|
@ -24,6 +26,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||||
IRepository<QCChallenge> _qcChallengeRepository,
|
IRepository<QCChallenge> _qcChallengeRepository,
|
||||||
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
|
IRepository<SubjectVisitImageBackRecord> _subjectVisitImageBackRecordReposiotry,
|
||||||
|
IRepository<UserRole> _userRoleReposiotry,
|
||||||
IReadingImageTaskService _IReadingImageTaskService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IQCListService
|
IReadingImageTaskService _IReadingImageTaskService, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IQCListService
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -409,10 +412,50 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType);
|
var qacheckList = await GetQCQuestionAnswerList(subjectVisitId, sv.TrialId, trialQCProcess, currentQCType);
|
||||||
|
|
||||||
|
List<SecondReviewDto> secondReviewList = new List<SecondReviewDto>();
|
||||||
|
|
||||||
|
|
||||||
|
if (sv.SecondReviewState != SecondReviewState.None)
|
||||||
|
{
|
||||||
|
var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||||
|
|
||||||
|
secondReviewList = (from answer in _trialQCQuestionAnswerRepository.Where(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.SecondReview).Where(t => t.SecondReviewTime != null)
|
||||||
|
join userRole in _userRoleReposiotry.Where() on answer.UpdateUserId equals userRole.Id
|
||||||
|
select new SecondReviewDto { SecondReviewTime = answer.SecondReviewTime, SignTime = answer.UpdateTime, FullName = userRole.FullName, UserName = userRole.UserName })
|
||||||
|
.Distinct().ToList();
|
||||||
|
|
||||||
|
var secondReviewTimeList = secondReviewList.Select(t => t.SecondReviewTime).Distinct().ToList();
|
||||||
|
|
||||||
|
//首次加入
|
||||||
|
if (!secondReviewTimeList.Contains(trialConfirmTime))
|
||||||
|
{
|
||||||
|
secondReviewList.Add(new SecondReviewDto() { SecondReviewTime = trialConfirmTime });
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (sv.SecondReviewState == SecondReviewState.WaitAudit)
|
||||||
|
{
|
||||||
|
foreach (var item in secondReviewList)
|
||||||
|
{
|
||||||
|
if (item.SecondReviewTime == trialConfirmTime)
|
||||||
|
{
|
||||||
|
item.SignTime = null;
|
||||||
|
item.FullName = "";
|
||||||
|
item.UserName = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
secondReviewList = secondReviewList.OrderByDescending(t => t.SecondReviewTime).ToList();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return new TrialVisitQADTO
|
return new TrialVisitQADTO
|
||||||
{
|
{
|
||||||
QCQuestionAnswerList = qacheckList,
|
QCQuestionAnswerList = qacheckList,
|
||||||
|
|
||||||
|
SecondReviewList = secondReviewList,
|
||||||
|
|
||||||
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
|
IsHaveStudyClinicalData = await _clinicalDataTrialSetRepository.AnyAsync(x => x.IsConfirm && x.TrialId == sv.TrialId && x.ClinicalDataLevel == ClinicalLevel.Study),
|
||||||
StudyList = temp.StudyList,
|
StudyList = temp.StudyList,
|
||||||
ExistsManual = (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0,
|
ExistsManual = (await _IReadingImageTaskService.GetManualList(new GetManualListInDto() { TrialId = sv.TrialId })).Count() > 0,
|
||||||
|
@ -432,11 +475,53 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<List<QCQuestionAnswer>> GetQCQuestionAnswer(GetQCQuestionAnswerInDto inDto)
|
public async Task<List<QCQuestionAnswer>> GetQCQuestionAnswer(GetQCQuestionAnswerInDto inDto)
|
||||||
{
|
{
|
||||||
var questionAnswerlist = await (from data in _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsEnable)
|
var subjectVisitId = inDto.SubjectVisitId;
|
||||||
join answer in _trialQCQuestionAnswerRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId && x.QCProcessEnum == inDto.QCProcessEnum && x.CurrentQCEnum == inDto.CurrentQCEnum).AsQueryable() on data.Id equals answer.TrialQCQuestionConfigureId into answertemp
|
|
||||||
|
List<QCQuestionAnswer> questionAnswerlist = new List<QCQuestionAnswer>();
|
||||||
|
|
||||||
|
//判断当前访视质控是否完成,再判断复审是完成查看,还是添加编辑
|
||||||
|
|
||||||
|
var sv = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||||
|
|
||||||
|
var secondReviewTime = inDto.SecondReviewTime != null ? (DateTime)inDto.SecondReviewTime : trialConfirmTime == null ? DateTime.Now : (DateTime)trialConfirmTime;
|
||||||
|
|
||||||
|
if ((sv.AuditState == AuditStateEnum.QCPassed && inDto.CurrentQCEnum != CurrentQC.SecondReview) || (inDto.CurrentQCEnum == CurrentQC.SecondReview && secondReviewTime.AddSeconds(1) < trialConfirmTime))
|
||||||
|
{
|
||||||
|
|
||||||
|
//之前质控完的,+二次复核完的,都要从答案表中取 二次复核完的还需要加时间
|
||||||
|
|
||||||
|
questionAnswerlist = await _trialQCQuestionAnswerRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId && x.QCProcessEnum == inDto.QCProcessEnum && x.CurrentQCEnum == inDto.CurrentQCEnum)
|
||||||
|
.Where(t => inDto.CurrentQCEnum == CurrentQC.SecondReview ? t.SecondReviewTime >= secondReviewTime && t.SecondReviewTime <= secondReviewTime.AddSeconds(1) : true)
|
||||||
|
.Select(data => new QCQuestionAnswer()
|
||||||
|
{
|
||||||
|
AnswerId = data.Id,
|
||||||
|
Answer = data.Answer,
|
||||||
|
ShowOrder = data.TrialQCQuestionConfigure.ShowOrder,
|
||||||
|
QuestionName = data.TrialQCQuestionConfigure.QuestionName,
|
||||||
|
Id = data.TrialQCQuestionConfigure.Id,
|
||||||
|
IsRequired = data.TrialQCQuestionConfigure.IsRequired,
|
||||||
|
ParentId = data.TrialQCQuestionConfigure.ParentId,
|
||||||
|
ParentTriggerValue = data.TrialQCQuestionConfigure.ParentTriggerValue,
|
||||||
|
Type = data.TrialQCQuestionConfigure.Type,
|
||||||
|
TypeValue = data.TrialQCQuestionConfigure.TypeValue
|
||||||
|
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
#region 之前编辑和审核通过后展示都是通过这个接口
|
||||||
|
|
||||||
|
questionAnswerlist = await (from data in _trialQCQuestionRepository.Where(x => x.TrialId == inDto.TrialId && x.IsEnable)
|
||||||
|
join answer in _trialQCQuestionAnswerRepository.Where(x => x.SubjectVisitId == inDto.SubjectVisitId && x.QCProcessEnum == inDto.QCProcessEnum && x.CurrentQCEnum == inDto.CurrentQCEnum)
|
||||||
|
.Where(t => inDto.CurrentQCEnum == CurrentQC.SecondReview ? t.SecondReviewTime >= secondReviewTime && t.SecondReviewTime <= secondReviewTime.AddSeconds(1) : true)
|
||||||
|
on data.Id equals answer.TrialQCQuestionConfigureId into answertemp
|
||||||
from leftanswer in answertemp.DefaultIfEmpty()
|
from leftanswer in answertemp.DefaultIfEmpty()
|
||||||
select new QCQuestionAnswer()
|
select new QCQuestionAnswer()
|
||||||
{
|
{
|
||||||
|
AnswerId = leftanswer.Id,
|
||||||
Answer = leftanswer.Answer,
|
Answer = leftanswer.Answer,
|
||||||
ShowOrder = data.ShowOrder,
|
ShowOrder = data.ShowOrder,
|
||||||
QuestionName = data.QuestionName,
|
QuestionName = data.QuestionName,
|
||||||
|
@ -447,6 +532,17 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
Type = data.Type,
|
Type = data.Type,
|
||||||
TypeValue = data.TypeValue
|
TypeValue = data.TypeValue
|
||||||
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var result = questionAnswerlist.Where(x => x.ParentId == null).OrderBy(t => t.ShowOrder).ToList();
|
var result = questionAnswerlist.Where(x => x.ParentId == null).OrderBy(t => t.ShowOrder).ToList();
|
||||||
result.ForEach(x =>
|
result.ForEach(x =>
|
||||||
|
|
|
@ -384,6 +384,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
sv.CurrentActionUserId = null;
|
sv.CurrentActionUserId = null;
|
||||||
sv.PreliminaryAuditUserId = null;
|
sv.PreliminaryAuditUserId = null;
|
||||||
sv.ReviewAuditUserId = null;
|
sv.ReviewAuditUserId = null;
|
||||||
|
sv.SecondReviewState = SecondReviewState.None;
|
||||||
|
|
||||||
|
|
||||||
if (sv.IsBaseLine)
|
if (sv.IsBaseLine)
|
||||||
|
@ -691,6 +692,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
sv.CurrentActionUserId = null;
|
sv.CurrentActionUserId = null;
|
||||||
sv.PreliminaryAuditUserId = null;
|
sv.PreliminaryAuditUserId = null;
|
||||||
sv.ReviewAuditUserId = null;
|
sv.ReviewAuditUserId = null;
|
||||||
|
sv.SecondReviewState = SecondReviewState.None;
|
||||||
|
|
||||||
//var success1 = _studyRepository.Delete(t => t.SubjectVisitId == subjectVisitId);
|
//var success1 = _studyRepository.Delete(t => t.SubjectVisitId == subjectVisitId);
|
||||||
//var succeess2 = _instanceRepository.Delete(t => t.SubjectVisitId == subjectVisitId);
|
//var succeess2 = _instanceRepository.Delete(t => t.SubjectVisitId == subjectVisitId);
|
||||||
|
@ -727,9 +729,17 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||||
public async Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
public async Task<IResponseOutput> AddOrUpdateQCQuestionAnswerList(QCQuestionAnswerCommand[] qcQuestionAnswerCommands, Guid trialId, Guid subjectVisitId, [FromRoute] TrialQCProcess trialQCProcess, [FromRoute] CurrentQC currentQCType)
|
||||||
{
|
{
|
||||||
|
if (currentQCType == CurrentQC.SecondReview)
|
||||||
|
{
|
||||||
|
//二次复核自动领取,如果有人先领取了,那么后续不能操作
|
||||||
|
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.Id == subjectVisitId && t.CurrentActionUserId == null, u => new SubjectVisit() { CurrentActionUserId = _userInfo.UserRoleId, IsTake = true }, true);
|
||||||
|
}
|
||||||
//验证是否能操作
|
//验证是否能操作
|
||||||
await VerifyIsCanQCAsync(null, subjectVisitId);
|
await VerifyIsCanQCAsync(null, subjectVisitId);
|
||||||
|
|
||||||
|
|
||||||
|
var trialConfirmTime = _trialRepository.Where(t => t.Id == trialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||||
|
|
||||||
//更新
|
//更新
|
||||||
if (qcQuestionAnswerCommands.Any(t => t.Id != null))
|
if (qcQuestionAnswerCommands.Any(t => t.Id != null))
|
||||||
{
|
{
|
||||||
|
@ -774,11 +784,13 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
{
|
{
|
||||||
var addlist = _mapper.Map<List<TrialQCQuestionAnswer>>(qcQuestionAnswerCommands);
|
var addlist = _mapper.Map<List<TrialQCQuestionAnswer>>(qcQuestionAnswerCommands);
|
||||||
|
|
||||||
addlist.ForEach(t => { t.TrialId = trialId; t.SubjectVisitId = subjectVisitId; t.CurrentQCEnum = currentQCType; t.QCProcessEnum = trialQCProcess; });
|
|
||||||
|
|
||||||
|
addlist.ForEach(t => { t.TrialId = trialId; t.SubjectVisitId = subjectVisitId; t.CurrentQCEnum = currentQCType; t.QCProcessEnum = trialQCProcess; t.SecondReviewTime = currentQCType == CurrentQC.SecondReview ? trialConfirmTime : null; });
|
||||||
|
|
||||||
await _trialQCQuestionAnswerRepository.AddRangeAsync(addlist);
|
await _trialQCQuestionAnswerRepository.AddRangeAsync(addlist);
|
||||||
|
|
||||||
return ResponseOutput.Result(await _trialQCQuestionAnswerRepository.SaveChangesAsync());
|
return ResponseOutput.Ok(await _trialQCQuestionAnswerRepository.SaveChangesAsync());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -961,6 +973,9 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
var noneDicomStudyFile = (await _noneDicomStudyFileRepository.Where(t => t.Id == noneDicomStudyFileId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
var noneDicomStudyFile = (await _noneDicomStudyFileRepository.Where(t => t.Id == noneDicomStudyFileId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
|
var noneDicomStudy = (await _noneDicomStudyRepository.Where(t => t.Id == noneDicomStudyFile.NoneDicomStudyId, true).IgnoreQueryFilters().FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
|
|
||||||
if (state == 1)
|
if (state == 1)
|
||||||
{
|
{
|
||||||
noneDicomStudyFile.IsReading = false;
|
noneDicomStudyFile.IsReading = false;
|
||||||
|
@ -972,10 +987,15 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
else if (state == 4)
|
else if (state == 4)
|
||||||
{
|
{
|
||||||
noneDicomStudyFile.IsDeleted = true;
|
noneDicomStudyFile.IsDeleted = true;
|
||||||
|
|
||||||
|
noneDicomStudy.FileCount = noneDicomStudy.FileCount - 1;
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (state == 5)
|
else if (state == 5)
|
||||||
{
|
{
|
||||||
noneDicomStudyFile.IsDeleted = false;
|
noneDicomStudyFile.IsDeleted = false;
|
||||||
|
|
||||||
|
noneDicomStudy.FileCount = noneDicomStudy.FileCount + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1165,10 +1185,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
[HttpPut("{trialId:guid}/{subjectVisitId:guid}")]
|
||||||
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
//[Authorize(Policy = IRaCISPolicy.IQC)]
|
||||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId)
|
public async Task<IResponseOutput> ReplaceQCTaskActionUser(Guid trialId, Guid subjectVisitId, Guid? replaceUserRoleId)
|
||||||
{
|
{
|
||||||
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
var dbSubjectVisit = (await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException();
|
||||||
|
|
||||||
|
//await VerifyIsCanQCAsync(dbSubjectVisit);
|
||||||
|
|
||||||
if (dbSubjectVisit.CurrentActionUserId == null && dbSubjectVisit.IsTake == false)
|
if (dbSubjectVisit.CurrentActionUserId == null && dbSubjectVisit.IsTake == false)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -1179,7 +1201,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
dbSubjectVisit.IsTake = true;
|
dbSubjectVisit.IsTake = true;
|
||||||
|
|
||||||
dbSubjectVisit.CurrentActionUserId = _userInfo.UserRoleId;
|
dbSubjectVisit.CurrentActionUserId = replaceUserRoleId == null || replaceUserRoleId == Guid.Empty ? _userInfo.UserRoleId : replaceUserRoleId;
|
||||||
|
|
||||||
dbSubjectVisit.CurrentActionUserExpireTime = DateTime.Now.AddHours(1);
|
dbSubjectVisit.CurrentActionUserExpireTime = DateTime.Now.AddHours(1);
|
||||||
|
|
||||||
|
@ -1347,6 +1369,12 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
if (obtaionOrCancel)
|
if (obtaionOrCancel)
|
||||||
{
|
{
|
||||||
|
//复核的时候,指派后,另外一个人进来的时候如果是自己,那么不进行后续流程
|
||||||
|
if (dbSubjectVisit.CurrentActionUserId == _userInfo.UserRoleId)
|
||||||
|
{
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
if (dbSubjectVisit.CurrentActionUserId != null && dbSubjectVisit.IsTake)
|
if (dbSubjectVisit.CurrentActionUserId != null && dbSubjectVisit.IsTake)
|
||||||
{
|
{
|
||||||
//throw new BusinessValidationFailedException("当前访视已被领取,不允许领取");
|
//throw new BusinessValidationFailedException("当前访视已被领取,不允许领取");
|
||||||
|
@ -1378,6 +1406,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
// return ResponseOutput.NotOk("您已经领取了其他受试者,完成后才允许领取新的受试者");
|
// return ResponseOutput.NotOk("您已经领取了其他受试者,完成后才允许领取新的受试者");
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
if (dbSubjectVisit.SecondReviewState == SecondReviewState.None)
|
||||||
|
{
|
||||||
#region 处理验证
|
#region 处理验证
|
||||||
|
|
||||||
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit)
|
||||||
|
@ -1437,6 +1467,8 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
dbSubjectVisit.IsTake = true;
|
dbSubjectVisit.IsTake = true;
|
||||||
|
|
||||||
|
@ -2069,8 +2101,46 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<IResponseOutput> QCSecondReviewPassedOrFailed(Guid trialId, Guid subjectVisitId, bool isSecondPass)
|
||||||
|
{
|
||||||
|
if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.UserRoleId))
|
||||||
|
{
|
||||||
|
//---您已经被移出项目,没有操作权限。
|
||||||
|
return ResponseOutput.NotOk(_localizer["QCOperation_RemoveItem"]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
var sv = await _subjectVisitRepository.FirstOrDefaultAsync(t => t.Id == subjectVisitId);
|
||||||
|
|
||||||
|
await VerifyIsCanQCAsync(sv);
|
||||||
|
|
||||||
|
var trialConfirmTime = _trialRepository.Where(t => t.Id == sv.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||||
|
|
||||||
|
if (sv.SecondReviewState == SecondReviewState.WaitAudit)
|
||||||
|
{
|
||||||
|
if (isSecondPass)
|
||||||
|
{
|
||||||
|
sv.SecondReviewState = SecondReviewState.AuditPassed;
|
||||||
|
sv.IsTake = false;
|
||||||
|
sv.CurrentActionUserId = null;
|
||||||
|
sv.CurrentActionUserExpireTime = null;
|
||||||
|
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
sv.SecondReviewState = SecondReviewState.AuditFailed;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _trialQCQuestionAnswerRepository.BatchUpdateNoTrackingAsync(t => t.SubjectVisitId == sv.Id && t.CurrentQCEnum == CurrentQC.SecondReview && t.SecondReviewTime == trialConfirmTime, u => new TrialQCQuestionAnswer()
|
||||||
|
{
|
||||||
|
UpdateUserId = _userInfo.UserRoleId,
|
||||||
|
UpdateTime = DateTime.Now
|
||||||
|
});
|
||||||
|
}
|
||||||
|
await _subjectVisitRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
return ResponseOutput.Ok();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设置、取消 访视紧急
|
/// 设置、取消 访视紧急
|
||||||
|
|
|
@ -472,6 +472,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<TrialQCQuestion, TrialQCQuestionAddOrEdit>();
|
CreateMap<TrialQCQuestion, TrialQCQuestionAddOrEdit>();
|
||||||
|
|
||||||
CreateMap<TrialQCQuestion, TrialQCQuestionConfigureView>()
|
CreateMap<TrialQCQuestion, TrialQCQuestionConfigureView>()
|
||||||
|
.ForMember(d => d.IsQuestionQCAuditPassed, u => u.MapFrom(s => s.TrialQCQuestionAnswerList.Any(c => c.TrialQCQuestionConfigureId == s.Id && c.SubjectVisit.AuditState == AuditStateEnum.QCPassed)))
|
||||||
.ForMember(d => d.ParentShowOrder, u => u.MapFrom(s => s.ParentQCQuestion.ShowOrder));
|
.ForMember(d => d.ParentShowOrder, u => u.MapFrom(s => s.ParentQCQuestion.ShowOrder));
|
||||||
|
|
||||||
CreateMap<TrialQCQuestionSelect, TrialQCQuestionConfigureView>();
|
CreateMap<TrialQCQuestionSelect, TrialQCQuestionConfigureView>();
|
||||||
|
|
|
@ -798,6 +798,14 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto
|
||||||
public ReadingVersion? ReadingVersionEnum { get; set; }
|
public ReadingVersion? ReadingVersionEnum { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public ReadingTool? ReadingTool { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 阅片工具
|
||||||
|
/// </summary>
|
||||||
|
public List<string> ReadingToolList { get; set; } = new List<string>();
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
public interface IReadingImageTaskService
|
public interface IReadingImageTaskService
|
||||||
{
|
{
|
||||||
|
Task TriggerJudgeQuestion(Guid visitTaskId);
|
||||||
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
Task<IResponseOutput> SubmitVisitTaskQuestions(SubmitVisitTaskQuestionsInDto inDto);
|
||||||
|
|
||||||
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
Task<IResponseOutput> SubmitJudgeVisitTaskResult(SaveJudgeVisitTaskResult inDto);
|
||||||
|
|
|
@ -393,6 +393,12 @@ namespace IRaCIS.Core.Application.Service.RC
|
||||||
|
|
||||||
indto.ReadingVersionEnum=(ReadingVersion)maxDic;
|
indto.ReadingVersionEnum=(ReadingVersion)maxDic;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
indto.ReadingTool = ReadingTool.Dicom;
|
||||||
|
indto.ReadingToolList = new List<string>()
|
||||||
|
{
|
||||||
|
"Length", "Bidirectional", "RectangleROI", "ArrowAnnotate", "CircleROI"
|
||||||
|
};
|
||||||
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
|
var entity = await _readingQuestionCriterionTrialRepository.InsertOrUpdateAsync(indto, true);
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
}
|
}
|
||||||
|
|
|
@ -54,7 +54,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
public async Task<IResponseOutput> BatchSubmitGlobalReadingInfo(BatchSubmitGlobalReadingInfo inDto)
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||||
|
@ -94,7 +94,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
})).ToList();
|
})).ToList();
|
||||||
|
|
||||||
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
await _readingGlobalTaskInfoRepository.AddRangeAsync(answers);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
await _visitTaskRepository.UpdatePartialFromEFAutoAsync(inDto.GlobalTaskId, u => new VisitTask() { ReadingTaskState = ReadingTaskState.Reading });
|
||||||
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
var result = await _readingGlobalTaskInfoRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok(result);
|
return ResponseOutput.Ok(result);
|
||||||
}
|
}
|
||||||
|
@ -107,7 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
/// <param name="inDto"></param>
|
/// <param name="inDto"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||||
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
public async Task<IResponseOutput> SaveGlobalReadingInfo(SaveGlobalReadingInfoInDto inDto)
|
||||||
{
|
{
|
||||||
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
await VerifyTaskIsSign(inDto.GlobalTaskId);
|
||||||
|
@ -301,7 +301,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
LimitEdit = y.LimitEdit,
|
LimitEdit = y.LimitEdit,
|
||||||
MaxAnswerLength = y.MaxAnswerLength,
|
MaxAnswerLength = y.MaxAnswerLength,
|
||||||
FileType = y.FileType,
|
FileType = y.FileType,
|
||||||
Unit=y.Unit,
|
Unit = y.Unit,
|
||||||
QuestionGenre = y.QuestionGenre,
|
QuestionGenre = y.QuestionGenre,
|
||||||
ShowOrder = y.ShowOrder,
|
ShowOrder = y.ShowOrder,
|
||||||
DictionaryCode = y.DictionaryCode,
|
DictionaryCode = y.DictionaryCode,
|
||||||
|
|
|
@ -647,7 +647,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
IsCurrentTask = x.Id == inDto.VisitTaskId,
|
||||||
IsConvertedTask = x.IsConvertedTask,
|
IsConvertedTask = x.IsConvertedTask,
|
||||||
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
IsFirstChangeTask = x.BeforeConvertedTaskId != null,
|
||||||
IsExistUnprocessedFeedback=x.UserFeedBackList.Any(y => y.State == 0),
|
IsExistUnprocessedFeedback = x.UserFeedBackList.Any(y => y.State == 0),
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
@ -3034,7 +3034,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
var subjectTaskList = (await _visitTaskService.GetSubjectReadingIQueryable(new GetReadingIQueryableInDto()
|
||||||
{
|
{
|
||||||
TrialId = inDto.TrialId,
|
TrialId = inDto.TrialId,
|
||||||
|
SubjectId = inDto.SubjectId,
|
||||||
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
TrialReadingCriterionId = trialReadingCriterionId!.Value,
|
||||||
|
SubjectCode = inDto.SubjectCode,
|
||||||
PageIndex = 1,
|
PageIndex = 1,
|
||||||
PageSize = 99999,
|
PageSize = 99999,
|
||||||
|
|
||||||
|
@ -3117,24 +3119,45 @@ namespace IRaCIS.Core.Application.Service
|
||||||
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
&& x.TrialReadingCriterionId == trialReadingCriterionId
|
||||||
&& x.TaskState == TaskState.Effect)
|
&& x.TaskState == TaskState.Effect)
|
||||||
.Where(x => !cacheSkipIds.Contains(x.Id));
|
.Where(x => !cacheSkipIds.Contains(x.Id));
|
||||||
var count = await query.CountAsync();
|
|
||||||
if (count == 0)
|
//如果是随机阅片
|
||||||
{
|
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
|
||||||
}
|
|
||||||
Random random = new Random();
|
Random random = new Random();
|
||||||
var skipcount = 0;
|
var skipcount = 0;
|
||||||
if (count >= 2)
|
|
||||||
{
|
|
||||||
skipcount = random.Next(0, count - 1);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
var minRandomOrder = query.Where(t => t.RandomOrder != null).Select(t => t.RandomOrder).MinOrDefault();
|
||||||
|
|
||||||
|
//以随机序号优先,阅片中优先先给IR
|
||||||
|
if (minRandomOrder != null)
|
||||||
|
{
|
||||||
|
query = query.Where(x => x.RandomOrder == minRandomOrder);
|
||||||
|
skipcount = 0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//没有随机序号的,那么就按照阅片中最新的时间给
|
||||||
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
var maxReadingTime = query.MaxOrDefault(x => x.FirstReadingTime);
|
||||||
if (maxReadingTime != null)
|
if (maxReadingTime != null)
|
||||||
{
|
{
|
||||||
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
query = query.Where(x => x.FirstReadingTime == maxReadingTime);
|
||||||
skipcount = 0;
|
skipcount = 0;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
var count = await query.CountAsync();
|
||||||
|
if (count >= 2)
|
||||||
|
{
|
||||||
|
skipcount = random.Next(0, count - 1);
|
||||||
|
}
|
||||||
|
if (count == 0)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
task = await query
|
task = await query
|
||||||
.Select(x => new GetReadingTaskDto()
|
.Select(x => new GetReadingTaskDto()
|
||||||
{
|
{
|
||||||
|
@ -3155,6 +3178,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
throw new BusinessValidationFailedException(_localizer["ReadingImage_TaskFinish"], ApiResponseCodeEnum.CloseCurrentWindows);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//触发任务随机编号
|
||||||
|
|
||||||
|
await _downloadAndUploadService.SubejctRandomReadingTaskNameDeal(task.SubjectId, task.TrialReadingCriterionId);
|
||||||
|
|
||||||
|
task.TaskBlindName = await _visitTaskRepository.Where(t => t.Id == task.VisitTaskId).Select(t => t.TaskBlindName).FirstOrDefaultAsync() ?? "";
|
||||||
|
}
|
||||||
|
|
||||||
if (task.SubjectCode.IsNullOrEmpty())
|
if (task.SubjectCode.IsNullOrEmpty())
|
||||||
{
|
{
|
||||||
|
@ -3235,7 +3266,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
task.SubjectCode = blindSubjectCode.IsNullOrEmpty() ? task.SubjectCode : blindSubjectCode;
|
||||||
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
task.ExistsManual = (await GetManualList(new GetManualListInDto() { TrialId = visitTaskInfo.TrialId })).Count > 0;
|
||||||
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
task.ReadingTaskState = visitTaskInfo.ReadingTaskState;
|
||||||
task.IsShowStudyName= trialInfo.IsShowStudyName;
|
task.IsShowStudyName = trialInfo.IsShowStudyName;
|
||||||
task.IsBaseLine = isBaseLine;
|
task.IsBaseLine = isBaseLine;
|
||||||
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
|
task.ReadingVersionEnum = criterionInfo.ReadingVersionEnum;
|
||||||
task.ReadingToolList = criterionInfo.ReadingToolList;
|
task.ReadingToolList = criterionInfo.ReadingToolList;
|
||||||
|
@ -3271,7 +3302,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
await _readingTableQuestionAnswerRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
await _readingTaskQuestionMarkRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
await _readingCustomTagRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
await _readingCustomTagRepository.BatchDeleteNoTrackingAsync(x => x.VisitTaskId == inDto.VisitTaskId);
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.VisitTaskId, x => new VisitTask()
|
||||||
{
|
{
|
||||||
ReadingTaskState = ReadingTaskState.WaitReading
|
ReadingTaskState = ReadingTaskState.WaitReading
|
||||||
});
|
});
|
||||||
|
@ -3351,7 +3382,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
public async Task<bool> ResetReadingRestTime(Guid? userRoleId)
|
||||||
{
|
{
|
||||||
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid) userRoleId : _userInfo.UserRoleId;
|
var roleId = (userRoleId != null && userRoleId != Guid.Empty) ? (Guid)userRoleId : _userInfo.UserRoleId;
|
||||||
|
|
||||||
//int readingMinute = 120; // 为60整数
|
//int readingMinute = 120; // 为60整数
|
||||||
int restMinute = 10; //
|
int restMinute = 10; //
|
||||||
|
|
|
@ -346,7 +346,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
var relatedVisitTaskIds = JsonConvert.SerializeObject(relatedVisitTaskIdList);
|
||||||
|
|
||||||
// 这里先保存 签名的时候 会统一创建关系
|
// 这里先保存 签名的时候 会统一创建关系
|
||||||
await _visitTaskRepository.UpdatePartialFromQueryAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(t => t.Id == inDto.OncologyTaskId, u => new VisitTask()
|
||||||
{
|
{
|
||||||
RelatedVisitTaskIds = relatedVisitTaskIds
|
RelatedVisitTaskIds = relatedVisitTaskIds
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
@ -25,6 +27,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||||
IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
|
IRepository<NoneDicomStudyFile> _noneDicomStudyFileRepository,
|
||||||
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
IRepository<ReadingClinicalData> _readingClinicalDataRepository,
|
||||||
|
IReadingImageTaskService _readingImageTaskService,
|
||||||
IRepository<ReadingPeriodSet> _readingPeriodSetRepository,
|
IRepository<ReadingPeriodSet> _readingPeriodSetRepository,
|
||||||
IRepository<ReadModule> _readModuleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
IRepository<ReadModule> _readModuleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService
|
||||||
{
|
{
|
||||||
|
@ -64,7 +67,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
var resultlist = await visitQuery.WhereIf(finalVisitNum != null && finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
||||||
.Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum)
|
.Where(x => x.VisitNum > mixReadVisitNum|| x.VisitNum==thisVisitNum)
|
||||||
.Where(x => !x.IsBaseLine) // 排除基线
|
//.Where(x => !x.IsBaseLine) // 排除基线
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0)
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.ImageReading, x => readModulequery.Where(y => y.Id != inDto.Id && y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() == 0)
|
||||||
.Select(x => new GetSubjectReadVisitsOutDto()
|
.Select(x => new GetSubjectReadVisitsOutDto()
|
||||||
|
@ -94,6 +97,29 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]);
|
throw new BusinessValidationFailedException(_localizer["ReadModule_CRCConfirmCanNtoEdit"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var readModule = await _readModuleRepository.Where(x => x.Id == inDto.Id).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new
|
||||||
|
{
|
||||||
|
x.ReadingType,
|
||||||
|
x.IsArbitrationReading,
|
||||||
|
x.IsReadingPeriod,
|
||||||
|
x.ArbitrationRule,
|
||||||
|
x.IsGlobalReading,
|
||||||
|
x.IsOncologyReading,
|
||||||
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
|
// 如果生成了 访视级别的阅片期裁判 不让修改
|
||||||
|
if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||||
|
{
|
||||||
|
if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge))
|
||||||
|
{
|
||||||
|
//---当前阅片已生成裁判任务,操作失败。
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule()
|
await _readModuleRepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new ReadModule()
|
||||||
{
|
{
|
||||||
SubjectVisitId = inDto.SubjectVisitIdId,
|
SubjectVisitId = inDto.SubjectVisitIdId,
|
||||||
|
@ -499,8 +525,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
#region 方式二
|
#region 方式二
|
||||||
|
|
||||||
var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId).Where(t => t.IsLostVisit == false)
|
var subjectVisitQuery = _subjectVisitRepository.Where(t => t.TrialId == inQuery.TrialId)/*.Where(t => t.IsLostVisit == false)*/
|
||||||
.Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum < sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView()
|
.Where(sv => sv.Subject.FinalSubjectVisitId == null ? true : sv.VisitNum <= sv.Subject.LatestSubjectVisit.VisitNum).Select(sv => new ReadModuleView()
|
||||||
{
|
{
|
||||||
Id = sv.Id,
|
Id = sv.Id,
|
||||||
CreateTime = sv.CreateTime,
|
CreateTime = sv.CreateTime,
|
||||||
|
@ -885,7 +911,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var resultlist = await visitQuery.WhereIf(finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
var resultlist = await visitQuery.WhereIf(finalVisitNum != 0, x => x.VisitNum <= finalVisitNum)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == ReadingSetType.ImageReading).Count() > 0)
|
||||||
.Where(x => x.VisitNum > maxReadVisitNum)
|
.Where(x => x.VisitNum > maxReadVisitNum)
|
||||||
.Where(x => !x.IsBaseLine) // 排除基线
|
//.Where(x => !x.IsBaseLine) // 排除基线
|
||||||
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
.Where(x => readModulequery.Where(y => y.SubjectVisitId == x.Id && y.TrialReadingCriterionId == inDto.TrialReadingCriterionId && y.ReadingSetType == inDto.ReadingSetType).Count() == 0).OrderBy(x => finalVisitNum)
|
||||||
.Select(x => new GetSubjectReadVisitsOutDto()
|
.Select(x => new GetSubjectReadVisitsOutDto()
|
||||||
{
|
{
|
||||||
|
@ -954,6 +980,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
&& !x.IsAnalysisCreate && x.TrialReadingCriterionId == dto.TrialReadingCriterionId
|
&& !x.IsAnalysisCreate && x.TrialReadingCriterionId == dto.TrialReadingCriterionId
|
||||||
|
|
||||||
).ToListAsync();
|
).ToListAsync();
|
||||||
|
|
||||||
|
// 生成全局阅片任务 具体是否需要生成在_visitTaskHelpeService里面有逻辑判断
|
||||||
foreach (var taskInfo in taskListInfo)
|
foreach (var taskInfo in taskListInfo)
|
||||||
{
|
{
|
||||||
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
await _visitTaskHelpeService.AddTaskAsync(new GenerateTaskCommand()
|
||||||
|
@ -974,6 +1002,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 生成裁判任务 是否需要生成函数里面有逻辑判断
|
||||||
|
if (taskListInfo.Count() > 0)
|
||||||
|
{
|
||||||
|
await _readingImageTaskService.TriggerJudgeQuestion(taskListInfo[0].Id);
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ModuleTypeEnum.Oncology:
|
case ModuleTypeEnum.Oncology:
|
||||||
|
@ -1066,6 +1101,15 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync();
|
var readModule = await _readModuleRepository.Where(x => x.Id == readModuleId).FirstNotNullAsync();
|
||||||
|
|
||||||
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == readModule.TrialReadingCriterionId).Select(x => new
|
||||||
|
{
|
||||||
|
x.ReadingType,
|
||||||
|
x.IsArbitrationReading,
|
||||||
|
x.IsReadingPeriod,
|
||||||
|
x.ArbitrationRule,
|
||||||
|
x.IsGlobalReading,
|
||||||
|
x.IsOncologyReading,
|
||||||
|
}).FirstNotNullAsync();
|
||||||
|
|
||||||
if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned))
|
if (await _readingClinicalDataRepository.Where(t => t.ReadingId == readModuleId).AnyAsync(t => t.ReadingClinicalDataState == ReadingClinicalDataStatus.HaveSigned))
|
||||||
{
|
{
|
||||||
|
@ -1094,6 +1138,17 @@ namespace IRaCIS.Core.Application.Service
|
||||||
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
throw new BusinessValidationFailedException(_localizer["ReadModule_TaskGenerated"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 如果生成了 访视级别的阅片期裁判 不让删除
|
||||||
|
if (criterionInfo.IsArbitrationReading && criterionInfo.IsReadingPeriod && !criterionInfo.IsGlobalReading && criterionInfo.ArbitrationRule == ArbitrationRule.Reading)
|
||||||
|
{
|
||||||
|
if (await _visitTaskRepository.AnyAsync(x => x.SourceSubjectVisitId == readModule.SubjectVisitId && x.ReadingCategory == ReadingCategory.Judge))
|
||||||
|
{
|
||||||
|
//---当前阅片已生成裁判任务,操作失败。
|
||||||
|
throw new BusinessValidationFailedException(_localizer["ReadModule_JudgeTaskGenerated"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask()
|
await _visitTaskRepository.BatchUpdateNoTrackingAsync(x => readModuleId == x.SouceReadModuleId, x => new VisitTask()
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
@ -17,6 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IRepository<ReadModule> _readModuleRepository,
|
IRepository<ReadModule> _readModuleRepository,
|
||||||
IRepository<VisitStage> _visitStageRepository,
|
IRepository<VisitStage> _visitStageRepository,
|
||||||
IRepository<Trial> _trialRepository,
|
IRepository<Trial> _trialRepository,
|
||||||
|
IReadingImageTaskService _readingImageTaskService,
|
||||||
IRepository<VisitTask> _visitTaskRepository,
|
IRepository<VisitTask> _visitTaskRepository,
|
||||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||||
IVisitTaskHelpeService _visitTaskHelpeService,
|
IVisitTaskHelpeService _visitTaskHelpeService,
|
||||||
|
@ -165,6 +167,9 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
await _readModuleRepository.AddRangeAsync(readModules);
|
||||||
|
|
||||||
|
await _readModuleRepository.SaveChangesAsync();
|
||||||
|
|
||||||
// 判断是否要添加肿瘤学或者全局阅片任务
|
// 判断是否要添加肿瘤学或者全局阅片任务
|
||||||
var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
|
var subjectVisitIds = readModules.Select(x => x.SubjectVisitId).ToList();
|
||||||
|
@ -201,6 +206,14 @@ namespace IRaCIS.Core.Application.Service
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 根据SourceSubjectVisitId 分组
|
||||||
|
var visitTaskid = taskInfoList.GroupBy(x => x.SourceSubjectVisitId).Select(x => x.Max(y => y.Id)).ToList();
|
||||||
|
// 生成裁判任务 是否需要生成函数里面有逻辑判断
|
||||||
|
foreach (var item in visitTaskid)
|
||||||
|
{
|
||||||
|
await _readingImageTaskService.TriggerJudgeQuestion(item);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ReadingSetType.TumorReading:
|
case ReadingSetType.TumorReading:
|
||||||
|
@ -269,7 +282,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
await _readModuleRepository.AddRangeAsync(readModules);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -443,13 +456,13 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
List<GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId)
|
List<GetReadingVisitListOutDto> result = await _visitStageRepository.Where(x => x.TrialId == inDto.TrialId)
|
||||||
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => globalVisitNum.Contains(x.VisitNum))
|
.WhereIf(inDto.ReadingSetType == ReadingSetType.TumorReading, x => globalVisitNum.Contains(x.VisitNum))
|
||||||
.Where(x => x.VisitNum > 0)// 不能是基线
|
//.Where(x => x.VisitNum > 0)// 不能是基线
|
||||||
.Where(x => x.VisitNum == thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
|
.Where(x => x.VisitNum == thisVisitNum || x.VisitNum >= maxVisitNum).Select(x => new GetReadingVisitListOutDto()
|
||||||
{
|
{
|
||||||
VisitName = x.VisitName,
|
VisitName = x.VisitName,
|
||||||
VisitNum = x.VisitNum,
|
VisitNum = x.VisitNum,
|
||||||
VisitStageId = x.Id,
|
VisitStageId = x.Id,
|
||||||
}).ToListAsync();
|
}).OrderBy(x=>x.VisitNum).ToListAsync();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -729,6 +729,21 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_AllNeedToBeMark"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
List<QuestionMark?> questionMarkList = new List<QuestionMark?>() { QuestionMark.FirstMeasurement, QuestionMark.SecondMeasurement, QuestionMark.ThirdMeasurement };
|
||||||
|
var measuredValueList = rowInfo.SelectMany(x => x.TableQuestionList).Where(x =>x.Answer.IsNotNullOrEmpty()&& questionMarkList.Contains(x.QuestionMark)).Select(x => decimal.Parse(x.Answer)).ToList();
|
||||||
|
if (measuredValueList.Any(x => x > 100))
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_MeasurementGT100"]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception)
|
||||||
|
{
|
||||||
|
|
||||||
|
throw new BusinessValidationFailedException(_localizer["MRIPDFF_MeasurementGT100"]);
|
||||||
|
}
|
||||||
|
|
||||||
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
|
var notableQuestionList = rowInfo.Where(x => x.TableQuestionList.Any(x => x.QuestionMark == QuestionMark.IsMeasurable && x.Answer.EqEnum(YesOrNoOrNa.No))).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -828,7 +828,13 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
#region 计算 这里顺序非常重要 后面计算的值要依赖前面计算的结果
|
||||||
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
var needAddList = new List<ReadingTaskQuestionAnswer>();
|
||||||
|
|
||||||
if (inDto.ComputationTrigger != ComputationTrigger.PatchDataStatistics)
|
List< ComputationTrigger > computationTriggers = new List<ComputationTrigger>()
|
||||||
|
{
|
||||||
|
ComputationTrigger.PatchDataStatistics,
|
||||||
|
ComputationTrigger.SaveEICRFQuestions,
|
||||||
|
|
||||||
|
};
|
||||||
|
if (!computationTriggers.Contains(inDto.ComputationTrigger))
|
||||||
{
|
{
|
||||||
// 计算斑块统计数据
|
// 计算斑块统计数据
|
||||||
await this.CalculatePatchDataStatistics(inDto);
|
await this.CalculatePatchDataStatistics(inDto);
|
||||||
|
|
|
@ -139,5 +139,16 @@ namespace IRaCIS.Core.Application.Contracts.DTO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class TrialSelectUserBasicInfo
|
||||||
|
{
|
||||||
|
public Guid UserRoleId { get; set; }
|
||||||
|
|
||||||
|
public string FullName { get; set; }
|
||||||
|
|
||||||
|
public string UserName { get; set; }
|
||||||
|
|
||||||
|
public string Email { get; set; }
|
||||||
|
|
||||||
|
public string Phone { get; set; }
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -261,11 +261,18 @@ namespace IRaCIS.Application.Contracts
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
#region 项目术语配置
|
/// <summary>
|
||||||
|
/// 打开失访可读
|
||||||
|
/// </summary>
|
||||||
|
public bool IsOpenLostVistRead { get; set; } = false;
|
||||||
|
|
||||||
|
|
||||||
|
#region 视图模型返回 项目术语配置 ,实际数据库没有配置
|
||||||
public List<TrialObjectNameConfig> TrialObjectNameList { get; set; }
|
public List<TrialObjectNameConfig> TrialObjectNameList { get; set; }
|
||||||
|
public CollectImagesType CollectImagesEnum { get; set; }
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
public CollectImagesType CollectImagesEnum { get; set; }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialPacsInfo
|
public class TrialPacsInfo
|
||||||
|
|
|
@ -6,6 +6,7 @@ using IRaCIS.Core.Application.Helper;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Service.Reading.Dto;
|
using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
using IRaCIS.Core.Infra.EFCore.Common;
|
using IRaCIS.Core.Infra.EFCore.Common;
|
||||||
using IRaCIS.Core.Infrastructure;
|
using IRaCIS.Core.Infrastructure;
|
||||||
|
@ -41,6 +42,7 @@ namespace IRaCIS.Core.Application
|
||||||
IRepository<SystemBasicData> _systemBasicDataRepository,
|
IRepository<SystemBasicData> _systemBasicDataRepository,
|
||||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||||
IRepository<Enroll> _enrollRepository,
|
IRepository<Enroll> _enrollRepository,
|
||||||
|
IRepository<TrialQCQuestionAnswer> _qcQuestionAnswerRepository,
|
||||||
IRepository<TrialStateChange> _trialStateChangeRepository,
|
IRepository<TrialStateChange> _trialStateChangeRepository,
|
||||||
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
|
IRepository<ReadingTableQuestionTrial> _readingTableQuestionTrialRepository,
|
||||||
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, ITrialConfigService
|
IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer, IFusionCache _fusionCache) : BaseService, ITrialConfigService
|
||||||
|
@ -562,7 +564,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
await _readingQuestionCriterionTrialRepository.UpdatePartialFromQueryAsync(inDto.TrialReadingCriterionId, x => new ReadingQuestionCriterionTrial()
|
||||||
{
|
{
|
||||||
ReadingToolList=inDto.ReadingToolList,
|
ReadingToolList = inDto.ReadingToolList,
|
||||||
IsImageFilter = inDto.IsImageFilter,
|
IsImageFilter = inDto.IsImageFilter,
|
||||||
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
ImageDownloadEnum = inDto.ImageDownloadEnum,
|
||||||
ImageUploadEnum = inDto.ImageUploadEnum,
|
ImageUploadEnum = inDto.ImageUploadEnum,
|
||||||
|
@ -837,9 +839,46 @@ namespace IRaCIS.Core.Application
|
||||||
{
|
{
|
||||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { IsTrialUrgentConfirmed = true });
|
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { IsTrialUrgentConfirmed = true });
|
||||||
}
|
}
|
||||||
else
|
else if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirmUpdate).ToString())
|
||||||
|
{
|
||||||
|
var trialConfirmTime = _trialRepository.Where(t => t.Id == signConfirmDTO.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||||
|
|
||||||
if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirm).ToString())
|
if (trialConfirmTime != null)
|
||||||
|
{
|
||||||
|
//删除复审中间临时数据
|
||||||
|
await _qcQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisit.TrialId == signConfirmDTO.TrialId && t.SubjectVisit.SecondReviewState == SecondReviewState.WaitAudit
|
||||||
|
&& t.CurrentQCEnum == CurrentQC.SecondReview && t.UpdateTime > trialConfirmTime);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = null, QCQuestionConfirmedUserId = null, IsQCQuestionConfirmed = false });
|
||||||
|
}
|
||||||
|
else if (signConfirmDTO.SignCode == ((int)SignEnum.SecondReviewConfirm).ToString())
|
||||||
|
{
|
||||||
|
var trialConfirmTime = _trialRepository.Where(t => t.Id == signConfirmDTO.TrialId).Select(t => t.QCQuestionConfirmedTime).FirstOrDefault();
|
||||||
|
|
||||||
|
if (trialConfirmTime != null)
|
||||||
|
{
|
||||||
|
//删除复审中间临时数据--没重置,一直点生成复核任务
|
||||||
|
await _qcQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisit.TrialId == signConfirmDTO.TrialId && t.SubjectVisit.SecondReviewState == SecondReviewState.WaitAudit
|
||||||
|
&& t.CurrentQCEnum == CurrentQC.SecondReview && t.UpdateTime > trialConfirmTime);
|
||||||
|
|
||||||
|
//删除质控中 临时保存的问题答案 (因为添加那里只会新增 和全部更新,如果不处理,那么有新增,也有更新,稽查那里也会有问题)
|
||||||
|
await _qcQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisit.TrialId == signConfirmDTO.TrialId && t.SubjectVisit.AuditState == AuditStateEnum.InPrimaryQC
|
||||||
|
&& t.CurrentQCEnum == CurrentQC.First);
|
||||||
|
|
||||||
|
await _qcQuestionAnswerRepository.BatchDeleteNoTrackingAsync(t => t.SubjectVisit.TrialId == signConfirmDTO.TrialId && t.SubjectVisit.AuditState == AuditStateEnum.InSecondaryQC
|
||||||
|
&& t.CurrentQCEnum == CurrentQC.Second);
|
||||||
|
|
||||||
|
//重复二次复核签名
|
||||||
|
await _subjectVisitRepository.UpdatePartialFromQueryAsync(t => t.TrialId == signConfirmDTO.TrialId && t.AuditState == AuditStateEnum.QCPassed
|
||||||
|
&& !t.TrialQCQuestionAnswerList.Any(t => t.SecondReviewTime == trialConfirmTime), u => new SubjectVisit() { SecondReviewState = SecondReviewState.WaitAudit });
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
else if (signConfirmDTO.SignCode == ((int)SignEnum.TrialQCQuestionConfirm).ToString())
|
||||||
{
|
{
|
||||||
|
|
||||||
var trialConfig = (await _trialRepository
|
var trialConfig = (await _trialRepository
|
||||||
|
@ -879,14 +918,14 @@ namespace IRaCIS.Core.Application
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialConfig_AuditQuestionConfirmed"]);
|
throw new BusinessValidationFailedException(_localizer["TrialConfig_AuditQuestionConfirmed"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
await _trialQCQuestionRepository.UpdatePartialFromQueryAsync(t => t.TrialId == signConfirmDTO.TrialId, x => new TrialQCQuestion
|
await _trialQCQuestionRepository.BatchUpdateNoTrackingAsync(t => t.TrialId == signConfirmDTO.TrialId, x => new TrialQCQuestion
|
||||||
{
|
{
|
||||||
IsConfirm = true
|
IsConfirm = true
|
||||||
});
|
});
|
||||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.UserRoleId, IsQCQuestionConfirmed = true });
|
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.UserRoleId, IsQCQuestionConfirmed = true });
|
||||||
await _trialRepository.SaveChangesAsync();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
await _trialRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
|
@ -1311,7 +1350,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<IResponseOutput<List<TrialBodyPartView>>> GetTrialBodyPartList(Guid trialId)
|
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, Id = t.Id, IsHandAdd = t.IsHandAdd }).OrderBy(t=>t.Name).ToListAsync();
|
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, Id = t.Id, IsHandAdd = t.IsHandAdd }).OrderBy(t => t.Name).ToListAsync();
|
||||||
|
|
||||||
return ResponseOutput.Ok(list);
|
return ResponseOutput.Ok(list);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,9 +6,11 @@ using IRaCIS.Core.Application.Contracts.DTO;
|
||||||
using IRaCIS.Core.Application.Filter;
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
|
using IRaCIS.Core.Infrastructure.Extention;
|
||||||
using MassTransit.Serialization;
|
using MassTransit.Serialization;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using Microsoft.EntityFrameworkCore.Storage.Json;
|
using Microsoft.EntityFrameworkCore.Storage.Json;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
using System;
|
using System;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
|
@ -56,8 +58,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
IsDeleted = t.IsDeleted,
|
IsDeleted = t.IsDeleted,
|
||||||
UserTypeId = t.UserRole.UserTypeRole.Id,
|
UserTypeId = t.UserRole.UserTypeRole.Id,
|
||||||
UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
CreateTime=t.CreateTime,
|
CreateTime = t.CreateTime,
|
||||||
UpdateTime=t.UpdateTime,
|
UpdateTime = t.UpdateTime,
|
||||||
}).ToList(),
|
}).ToList(),
|
||||||
|
|
||||||
}).ToPagedListAsync(inQuery);
|
}).ToPagedListAsync(inQuery);
|
||||||
|
@ -315,7 +317,29 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public async Task<List<TrialSelectUserBasicInfo>> GetTrialUserRoleList(Guid trialId, Guid? subjectVisitId, UserTypeEnum? userTypeEnum)
|
||||||
|
{
|
||||||
|
var isSeconReview = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).AnyAsync(t => t.SecondReviewState == SecondReviewState.WaitAudit);
|
||||||
|
//复审指派需要过滤初审的人
|
||||||
|
var firstUserId = await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).Select(t => t.PreliminaryAuditUserId).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
var list = await _trialIdentityUserRepository.Where(t => t.TrialId == trialId)
|
||||||
|
.SelectMany(t => t.TrialUserRoleList)
|
||||||
|
.WhereIf(userTypeEnum != null, t => t.UserRole.UserTypeEnum == userTypeEnum)
|
||||||
|
.Where(t => t.UserRole.Id != _userInfo.UserRoleId)//iQC 指派过滤自己
|
||||||
|
.WhereIf(firstUserId != null && isSeconReview == false, t => t.UserRole.Id != firstUserId)//iQC 过滤初审的人,复核不过滤
|
||||||
|
.Select(t => new TrialSelectUserBasicInfo()
|
||||||
|
{
|
||||||
|
FullName = t.TrialUser.IdentityUser.FullName,
|
||||||
|
UserRoleId = t.UserRole.Id,
|
||||||
|
UserName = t.TrialUser.IdentityUser.UserName,
|
||||||
|
Phone = t.TrialUser.IdentityUser.Phone,
|
||||||
|
Email = t.TrialUser.IdentityUser.EMail
|
||||||
|
})
|
||||||
|
.ToListAsync();
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var instanceList = await _instanceRepository.Where(s => s.StudyId == scpStudyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
var instanceList = await _instanceRepository.Where(s => s.StudyId == scpStudyId).OrderBy(t => t.SeriesId).ThenBy(t => t.InstanceNumber)
|
||||||
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
.ThenBy(s => s.InstanceTime).ThenBy(s => s.CreateTime)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
.Select(t => new { t.SeriesId, t.Id, t.Path, t.NumberOfFrames, t.InstanceNumber,t.FileSize }).ToListAsync();//.GroupBy(u => u.SeriesId);
|
||||||
|
|
||||||
foreach (var series in seriesList)
|
foreach (var series in seriesList)
|
||||||
{
|
{
|
||||||
|
@ -55,6 +55,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//HtmlPath = string.Empty,
|
//HtmlPath = string.Empty,
|
||||||
Path = k.Path,
|
Path = k.Path,
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
FileSize=k.FileSize,
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,7 +233,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
var studyList = await _dicomStudyRepository.Where(t => t.TrialId == trialId && t.SubjectVisitId == sujectVisitId).IgnoreQueryFilters()
|
var studyList = await _dicomStudyRepository.Where(t => t.TrialId == trialId && t.SubjectVisitId == sujectVisitId).IgnoreQueryFilters()
|
||||||
.Where(t => isImageFilter ? ("|" + criterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|") : true)
|
.Where(t => isImageFilter ? ("|" + criterionModalitys + "|").Contains("|" + t.ModalityForEdit + "|") : true)
|
||||||
.WhereIf(isReading == 1 || isQCFinished, s=> s.IsDeleted == false)
|
.WhereIf(isReading == 1 || isQCFinished, s => s.IsDeleted == false)
|
||||||
.Select(k => new VisitStudyDTO()
|
.Select(k => new VisitStudyDTO()
|
||||||
{
|
{
|
||||||
InstanceCount = k.InstanceCount,
|
InstanceCount = k.InstanceCount,
|
||||||
|
@ -248,7 +248,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters()
|
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId)).IgnoreQueryFilters()
|
||||||
.WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false)
|
.WhereIf(isReading == 1, s => s.IsReading && s.IsDeleted == false)
|
||||||
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
.WhereIf(isQCFinished, t => t.IsDeleted == false)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.HtmlPath, t.IsReading, t.IsDeleted, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
foreach (var t in studyList)
|
foreach (var t in studyList)
|
||||||
{
|
{
|
||||||
|
@ -272,6 +272,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
IsReading = k.IsReading,
|
IsReading = k.IsReading,
|
||||||
IsDeleted = k.IsDeleted,
|
IsDeleted = k.IsDeleted,
|
||||||
|
FileSize = k.FileSize,
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
series.InstanceCount = series.InstanceInfoList.Count();
|
series.InstanceCount = series.InstanceInfoList.Count();
|
||||||
|
@ -303,7 +304,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
DicomSeriesDTO series = await _dicomSeriesRepository.Where(s => s.Id == inDto.SeriesId).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
DicomSeriesDTO series = await _dicomSeriesRepository.Where(s => s.Id == inDto.SeriesId).ProjectTo<DicomSeriesDTO>(_mapper.ConfigurationProvider).FirstNotNullAsync();
|
||||||
|
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => t.SeriesId == inDto.SeriesId)
|
var instanceList = await _dicomInstanceRepository.Where(t => t.SeriesId == inDto.SeriesId)
|
||||||
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.SliceLocation }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.SliceLocation, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -315,6 +316,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
HtmlPath = k.HtmlPath,
|
HtmlPath = k.HtmlPath,
|
||||||
Path = k.Path,
|
Path = k.Path,
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
FileSize = k.FileSize
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
@ -391,7 +393,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var seriesIds = ctseriesIds.Union(ptseriesIds).ToList(); //并集
|
var seriesIds = ctseriesIds.Union(ptseriesIds).ToList(); //并集
|
||||||
|
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => seriesIds.Contains(t.SeriesId))
|
var instanceList = await _dicomInstanceRepository.Where(t => seriesIds.Contains(t.SeriesId))
|
||||||
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.StudyId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
var studyIds = instanceList.Select(x => x.StudyId).Distinct().ToList();
|
var studyIds = instanceList.Select(x => x.StudyId).Distinct().ToList();
|
||||||
|
|
||||||
|
@ -422,7 +424,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
HtmlPath = k.HtmlPath,
|
HtmlPath = k.HtmlPath,
|
||||||
Path = k.Path,
|
Path = k.Path,
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
FileSize = k.FileSize
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
@ -506,7 +508,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
.Select(k => new VisitStudyDTO()
|
.Select(k => new VisitStudyDTO()
|
||||||
{
|
{
|
||||||
InstanceCount = k.InstanceCount,
|
InstanceCount = k.InstanceCount,
|
||||||
StudyName=k.StudyName,
|
StudyName = k.StudyName,
|
||||||
Modalities = k.Modalities,
|
Modalities = k.Modalities,
|
||||||
//SeriesCount = k.SeriesCount,
|
//SeriesCount = k.SeriesCount,
|
||||||
StudyCode = k.StudyCode,
|
StudyCode = k.StudyCode,
|
||||||
|
@ -516,7 +518,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
var studyIds = dicomStudyList.Select(t => t.StudyId).ToList();
|
var studyIds = dicomStudyList.Select(t => t.StudyId).ToList();
|
||||||
|
|
||||||
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId) && t.IsReading)
|
var instanceList = await _dicomInstanceRepository.Where(t => studyIds.Contains(t.StudyId) && t.IsReading)
|
||||||
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.IsReading }).ToListAsync();
|
.Select(t => new { t.SeriesId, t.Id, t.InstanceNumber, t.Path, t.NumberOfFrames, t.WindowCenter, t.WindowWidth, t.HtmlPath, t.IsReading, t.FileSize }).ToListAsync();
|
||||||
|
|
||||||
List<DicomSeriesDTO> seriesLists = await _dicomSeriesRepository.Where(s => studyIds.Contains(s.StudyId))
|
List<DicomSeriesDTO> seriesLists = await _dicomSeriesRepository.Where(s => studyIds.Contains(s.StudyId))
|
||||||
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
.WhereIf(isManualGenerate == false, t => t.IsReading)
|
||||||
|
@ -537,6 +539,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
HtmlPath = k.HtmlPath,
|
HtmlPath = k.HtmlPath,
|
||||||
Path = k.Path,
|
Path = k.Path,
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
|
FileSize = k.FileSize
|
||||||
|
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
|
@ -613,7 +616,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
var markInstanceIdList = rowInfoList.Where(y => y.InstanceId != null).OrderBy(x => x.ShowOrder).ThenBy(x => x.RowIndex).Select(y => y.InstanceId!.Value).Distinct().ToList();
|
||||||
|
|
||||||
item.InstanceInfoList = await _dicomInstanceRepository.Where(t => markInstanceIdList.Contains(t.Id)).OrderBy(s => s.DicomSerie.SeriesNumber).ThenBy(s => s.DicomSerie.SeriesTime).ThenBy(x=>x.InstanceTime).Select(k =>
|
item.InstanceInfoList = await _dicomInstanceRepository.Where(t => markInstanceIdList.Contains(t.Id)).OrderBy(s => s.DicomSerie.SeriesNumber).ThenBy(s => s.DicomSerie.SeriesTime).ThenBy(x => x.InstanceTime).Select(k =>
|
||||||
new InstanceBasicInfo()
|
new InstanceBasicInfo()
|
||||||
{
|
{
|
||||||
Id = k.Id,
|
Id = k.Id,
|
||||||
|
@ -623,6 +626,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
InstanceNumber = k.InstanceNumber,
|
InstanceNumber = k.InstanceNumber,
|
||||||
StudyId = k.StudyId,
|
StudyId = k.StudyId,
|
||||||
SeriesId = k.SeriesId,
|
SeriesId = k.SeriesId,
|
||||||
|
FileSize = k.FileSize
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
item.InstanceInfoList.ForEach(x =>
|
item.InstanceInfoList.ForEach(x =>
|
||||||
|
@ -707,7 +711,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
{
|
{
|
||||||
var nodicom = noDicomList.Where(x => x.Id == item.StudyId).First();
|
var nodicom = noDicomList.Where(x => x.Id == item.StudyId).First();
|
||||||
|
|
||||||
var instanceCount = await _noneDicomStudyFileRepository.Where(t=>t.IsReading)
|
var instanceCount = await _noneDicomStudyFileRepository.Where(t => t.IsReading)
|
||||||
.WhereIf(isExistTaskNoneDicomFile, x => x.OriginNoneDicomStudyId == item.StudyId)
|
.WhereIf(isExistTaskNoneDicomFile, x => x.OriginNoneDicomStudyId == item.StudyId)
|
||||||
.WhereIf(isExistTaskNoneDicomFile == false, x => x.NoneDicomStudyId == item.StudyId).CountAsync();
|
.WhereIf(isExistTaskNoneDicomFile == false, x => x.NoneDicomStudyId == item.StudyId).CountAsync();
|
||||||
|
|
||||||
|
|
|
@ -29,6 +29,13 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
TrialQCQuestionConfirm=107,
|
TrialQCQuestionConfirm=107,
|
||||||
|
|
||||||
|
|
||||||
|
//重置质控问题配置
|
||||||
|
|
||||||
|
TrialQCQuestionConfirmUpdate=112,
|
||||||
|
|
||||||
|
SecondReviewConfirm = 113,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,4 +19,14 @@ namespace IRaCIS.Core.Domain.Share
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum SecondReviewState
|
||||||
|
{
|
||||||
|
None = 0,
|
||||||
|
|
||||||
|
WaitAudit=1,
|
||||||
|
|
||||||
|
AuditPassed=2,
|
||||||
|
|
||||||
|
AuditFailed=3,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,7 +14,11 @@
|
||||||
|
|
||||||
First = 1,
|
First = 1,
|
||||||
|
|
||||||
Second = 2
|
Second = 2,
|
||||||
|
|
||||||
|
|
||||||
|
//二次复核,只会一个人
|
||||||
|
SecondReview=3,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2903,6 +2903,11 @@ public enum PET5PSScore
|
||||||
/// 保存肝脏分段
|
/// 保存肝脏分段
|
||||||
/// </summary>
|
/// </summary>
|
||||||
SaveLiverSegments = 11,
|
SaveLiverSegments = 11,
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 保存eCRF
|
||||||
|
/// </summary>
|
||||||
|
SaveEICRFQuestions=12,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|
|
@ -288,4 +288,13 @@ public class VisitTask : BaseFullAuditEntity
|
||||||
|
|
||||||
[Comment("退回原因")]
|
[Comment("退回原因")]
|
||||||
public string PMBackReason { get; set; }
|
public string PMBackReason { get; set; }
|
||||||
|
|
||||||
|
#region 完全随机增加字段
|
||||||
|
|
||||||
|
[Comment("完全随机阅片号")]
|
||||||
|
public int? RandomOrder { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -108,6 +108,7 @@ public abstract class BaseFullAuditEntity : Entity, IAuditUpdate, IAuditAdd
|
||||||
[ForeignKey("CreateUserId")]
|
[ForeignKey("CreateUserId")]
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public UserRole CreateUserRole { get; set; }
|
public UserRole CreateUserRole { get; set; }
|
||||||
|
|
||||||
}
|
}
|
||||||
public abstract class BaseFullDeleteAuditEntity : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
|
public abstract class BaseFullDeleteAuditEntity : Entity, IAuditUpdate, IAuditAdd, ISoftDelete
|
||||||
{
|
{
|
||||||
|
|
|
@ -8,6 +8,9 @@ public class TrialQCQuestionAnswer : BaseFullAuditEntity
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public TrialQCQuestion TrialQCQuestionConfigure { get; set; }
|
public TrialQCQuestion TrialQCQuestionConfigure { get; set; }
|
||||||
|
|
||||||
|
[JsonIgnore]
|
||||||
|
public SubjectVisit SubjectVisit { get; set; }
|
||||||
#endregion
|
#endregion
|
||||||
public Guid TrialId { get; set; }
|
public Guid TrialId { get; set; }
|
||||||
|
|
||||||
|
@ -20,4 +23,7 @@ public class TrialQCQuestionAnswer : BaseFullAuditEntity
|
||||||
|
|
||||||
public Guid SubjectVisitId { get; set; }
|
public Guid SubjectVisitId { get; set; }
|
||||||
public Guid TrialQCQuestionConfigureId { get; set; }
|
public Guid TrialQCQuestionConfigureId { get; set; }
|
||||||
|
|
||||||
|
|
||||||
|
public DateTime? SecondReviewTime { get; set; }
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,8 @@ namespace IRaCIS.Core.Domain.Models;
|
||||||
public class SubjectVisit : BaseFullDeleteAuditEntity
|
public class SubjectVisit : BaseFullDeleteAuditEntity
|
||||||
{
|
{
|
||||||
#region 导航属性
|
#region 导航属性
|
||||||
|
[JsonIgnore]
|
||||||
|
public List<TrialQCQuestionAnswer> TrialQCQuestionAnswerList { get; set; }
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
public TrialSite TrialSite { get; set; }
|
public TrialSite TrialSite { get; set; }
|
||||||
|
@ -185,7 +187,7 @@ public class SubjectVisit : BaseFullDeleteAuditEntity
|
||||||
public Guid? SubmitUserId { get; set; }
|
public Guid? SubmitUserId { get; set; }
|
||||||
public ReadingStatusEnum ReadingStatus { get; set; }
|
public ReadingStatusEnum ReadingStatus { get; set; }
|
||||||
|
|
||||||
|
public SecondReviewState SecondReviewState { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
[Comment("受试者访视影像回退记录表")]
|
[Comment("受试者访视影像回退记录表")]
|
||||||
|
|
|
@ -83,7 +83,29 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 翻译单位
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="answerType">答案类型</param>
|
||||||
|
/// <param name="unit">单位</param>
|
||||||
|
/// <param name="customUnit">自定义单位</param>
|
||||||
|
/// <param name="unitDataList">单位字典</param>
|
||||||
|
/// <param name="answer">答案</param>
|
||||||
|
/// <returns></returns>
|
||||||
|
public string Translationunit(string answerType, ValueUnit? unit, string customUnit, List<UnitData> unitDataList, string? answer)
|
||||||
|
{
|
||||||
|
if (answerType == "upload")
|
||||||
|
{
|
||||||
|
return "❄❅❆❇❈❉❊";
|
||||||
|
}
|
||||||
|
|
||||||
|
if (unit == ValueUnit.Custom)
|
||||||
|
{
|
||||||
|
return answer + customUnit;
|
||||||
|
}
|
||||||
|
|
||||||
|
return answer + unitDataList.Where(y => y.Unit == unit).Select(x => x.UnitName).FirstIsNullReturnEmpty();
|
||||||
|
}
|
||||||
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
public string GetEntityAuditOpt(EntityEntry entityEntry)
|
||||||
{
|
{
|
||||||
if (entityEntry.State == EntityState.Added)
|
if (entityEntry.State == EntityState.Added)
|
||||||
|
@ -176,6 +198,13 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
extraIdentification = oldentity.IsConfigureEmail ? "/EmailUpdate" : "/EmailSave";
|
extraIdentification = oldentity.IsConfigureEmail ? "/EmailUpdate" : "/EmailSave";
|
||||||
break;
|
break;
|
||||||
|
case "configTrialBasicInfo/TrialConfigSignatureConfirm":
|
||||||
|
|
||||||
|
if (entity.IsQCQuestionConfirmed == false)
|
||||||
|
{
|
||||||
|
extraIdentification = $"/ConfirmReset";
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -188,7 +217,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//TrialDicList = string.Join(",", trialDics)
|
//TrialDicList = string.Join(",", trialDics)
|
||||||
|
|
||||||
ImageFormatListStr = string.Join("|", entity.ImageFormatList),
|
ImageFormatListStr = string.Join("|", entity.ImageFormatList),
|
||||||
StudyNamesStr = string.Join("|", entity.StudyNameList.Where(x => x.IsChoose).Select(x=>_userInfo.IsEn_Us?x.EnName:x.Name )),
|
StudyNamesStr = string.Join("|", entity.StudyNameList.Where(x => x.IsChoose).Select(x => _userInfo.IsEn_Us ? x.EnName : x.Name)),
|
||||||
|
|
||||||
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()),
|
CriterionNames = string.Join(",", criterionNameList.Union(memoryCriterionNameList).Distinct()),
|
||||||
|
|
||||||
|
@ -1949,8 +1978,16 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//待处理?
|
//待处理?
|
||||||
case "qcoperation/qcpassedorfailed":
|
case "qcoperation/qcpassedorfailed":
|
||||||
|
|
||||||
|
if (entity.AuditState == AuditStateEnum.QCPassed && (entity.SecondReviewState == SecondReviewState.AuditPassed || entity.SecondReviewState == SecondReviewState.AuditFailed))
|
||||||
|
{
|
||||||
|
extraIdentification = "/SecondReviewFinished";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
extraIdentification = "/" + (40 % (int)entity.AuditState).ToString();
|
extraIdentification = "/" + (40 % (int)entity.AuditState).ToString();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
//设置核查通过
|
//设置核查通过
|
||||||
|
@ -1980,6 +2017,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(_userInfo.RequestUrl== "QCOperation/addCheckChallengeReply" || _userInfo.RequestUrl == "QCOperation/UploadVisitCheckExcel")
|
||||||
|
{
|
||||||
if (entity.CheckChallengeState == CheckChanllengeTypeEnum.CRCWaitPMReply || entity.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply)
|
if (entity.CheckChallengeState == CheckChanllengeTypeEnum.CRCWaitPMReply || entity.CheckChallengeState == CheckChanllengeTypeEnum.PMWaitCRCReply)
|
||||||
{
|
{
|
||||||
//发送对话 修改质疑状态 不需要区分接口
|
//发送对话 修改质疑状态 不需要区分接口
|
||||||
|
@ -1987,6 +2026,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
extraIdentification = "/ModifyCheckChallengeState";
|
extraIdentification = "/ModifyCheckChallengeState";
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -2018,10 +2058,23 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(DicomStudy)))
|
||||||
{
|
{
|
||||||
var type = GetEntityAuditOpt(item);
|
var type = GetEntityAuditOpt(item);
|
||||||
|
var extraIdentification = string.Empty;
|
||||||
|
|
||||||
|
switch (_userInfo.RequestUrl)
|
||||||
|
{
|
||||||
|
case "QCOperation/updateModality":
|
||||||
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator)
|
||||||
|
{
|
||||||
|
extraIdentification = "/2";
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
|
await InsertInspection<DicomStudy>(item.Entity as DicomStudy, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
ObjectRelationParentId = x.SubjectVisitId
|
ObjectRelationParentId = x.SubjectVisitId,
|
||||||
|
ExtraIndentification = extraIdentification
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3013,6 +3066,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
QuestionId = t.Id,
|
QuestionId = t.Id,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.Unit,
|
t.Unit,
|
||||||
|
t.CustomUnit,
|
||||||
t.ShowOrder,
|
t.ShowOrder,
|
||||||
AnswerType = t.Type,
|
AnswerType = t.Type,
|
||||||
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
}).OrderBy(t => t.ShowOrder).ToListAsync();
|
||||||
|
@ -3045,8 +3099,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||||
t.ReadingQuestionTrial.Unit,
|
t.Unit,
|
||||||
t.ReadingQuestionTrial.CustomUnit,
|
t.CustomUnit,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.QuestionName,
|
t.QuestionName,
|
||||||
t.QuestionEnName,
|
t.QuestionEnName,
|
||||||
|
@ -3060,7 +3114,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer,
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
u.DictionaryCode,
|
u.DictionaryCode,
|
||||||
|
@ -3091,8 +3145,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
(t, u) =>
|
(t, u) =>
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty()
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
,
|
|
||||||
u.DictionaryCode,
|
u.DictionaryCode,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
@ -3152,6 +3205,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
Unit = (ValueUnit)int.Parse(x.Code),
|
Unit = (ValueUnit)int.Parse(x.Code),
|
||||||
|
UnitName = x.Value.ToString(),
|
||||||
}).ToList();
|
}).ToList();
|
||||||
|
|
||||||
//获取表格问题名称 组合成数组
|
//获取表格问题名称 组合成数组
|
||||||
|
@ -3160,8 +3214,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
TrialReadingCriterionId = t.ReadingQuestionTrial.ReadingQuestionCriterionTrialId, //标准Id
|
||||||
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
Type = t.ReadingQuestionTrial.QuestionName, //病灶类型
|
||||||
t.ReadingQuestionTrial.Unit,
|
t.Unit,
|
||||||
t.ReadingQuestionTrial.CustomUnit,
|
t.CustomUnit,
|
||||||
t.DictionaryCode,
|
t.DictionaryCode,
|
||||||
t.QuestionName,
|
t.QuestionName,
|
||||||
t.QuestionEnName,
|
t.QuestionEnName,
|
||||||
|
@ -3197,10 +3251,19 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark();
|
entity.RowMark = entity.OrderMark + entity.RowIndex.GetLesionMark();
|
||||||
|
|
||||||
|
string extraIdentification = string.Empty;
|
||||||
|
|
||||||
|
var readingQuestion = await _dbContext.ReadingQuestionTrial.Where(t => t.Id == entity.QuestionId).Include(x => x.ReadingQuestionCriterionTrial).FirstNotNullAsync();
|
||||||
|
if (readingQuestion.ReadingQuestionCriterionTrial.CriterionGroup == CriterionGroup.Nontumorous)
|
||||||
|
{
|
||||||
|
extraIdentification = "/Nontumorous";
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
await InsertInspection<ReadingTableAnswerRowInfo>(entity, type, x => new InspectionConvertDTO()
|
||||||
{
|
{
|
||||||
|
ExtraIndentification = extraIdentification,
|
||||||
VisitTaskId = x.VisitTaskId,
|
VisitTaskId = x.VisitTaskId,
|
||||||
|
|
||||||
ObjectRelationParentId = x.VisitTaskId,
|
ObjectRelationParentId = x.VisitTaskId,
|
||||||
|
@ -3220,7 +3283,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
new
|
new
|
||||||
{
|
{
|
||||||
//如果问题类型是附件 特殊处理 方便前端解析
|
//如果问题类型是附件 特殊处理 方便前端解析
|
||||||
Answer = u.AnswerType == "upload" ? "❄❅❆❇❈❉❊" + t.Answer : t.Answer + unitDataList.Where(y => y.Unit == u.Unit).Select(x => x.UnitName).FirstIsNullReturnEmpty(),
|
Answer = Translationunit(u.AnswerType, u.Unit, u.CustomUnit, unitDataList, t.Answer),
|
||||||
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
//t.Answer /*u.Unit==ValueUnit.Custom? t.Answer+u.CustomUnit:(u.Unit != ValueUnit.None|| u.Unit != null)*/,
|
||||||
u.QuestionName,
|
u.QuestionName,
|
||||||
u.QuestionEnName,
|
u.QuestionEnName,
|
||||||
|
@ -3228,7 +3291,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
u.ShowOrder
|
u.ShowOrder
|
||||||
}
|
}
|
||||||
).OrderBy(t => t.ShowOrder).ToList()
|
).OrderBy(t => t.ShowOrder).ToList()
|
||||||
},_userInfo.AuditIdentification);
|
}, _userInfo.AuditIdentification);
|
||||||
|
|
||||||
|
|
||||||
////添加/修改病灶接口 只会对单个病灶进行操作
|
////添加/修改病灶接口 只会对单个病灶进行操作
|
||||||
|
@ -3489,18 +3552,24 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
isDistinctionInterface = false;
|
|
||||||
switch (_userInfo.RequestUrl)
|
switch (_userInfo.RequestUrl)
|
||||||
{
|
{
|
||||||
//申请重阅
|
//申请重阅
|
||||||
case "VisitTask/applyReReading":
|
case "VisitTask/applyReReading":
|
||||||
|
|
||||||
|
|
||||||
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
extraIdentification = "/" + (int)entity.ReReadingApplyState;
|
||||||
|
|
||||||
//PM 申请重阅,区分不了是否有SPM参与
|
//PM 申请重阅,区分不了是否有SPM参与
|
||||||
|
|
||||||
if (entity.ReReadingApplyState== ReReadingApplyState.TrialGroupHaveApplyed)
|
if (entity.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed)
|
||||||
{
|
{
|
||||||
var hasSPM = _dbContext.VisitTaskReReading.Any(t => t.OriginalReReadingTaskId == entity.Id);
|
|
||||||
|
//var hasSPM = _dbContext.VisitTaskReReading.Any(t => t.OriginalReReadingTaskId == entity.Id);
|
||||||
|
|
||||||
|
var hasSPM = entitys.Where(x => x.Entity.GetType() == typeof(VisitTaskReReading))
|
||||||
|
.Select(t => t.Entity as VisitTaskReReading).Any(t => t.OriginalReReadingTaskId == entity.Id);
|
||||||
|
|
||||||
|
|
||||||
if (!hasSPM)
|
if (!hasSPM)
|
||||||
{
|
{
|
||||||
|
@ -3515,6 +3584,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//同意重阅
|
//同意重阅
|
||||||
case "VisitTask/ConfirmReReading":
|
case "VisitTask/ConfirmReReading":
|
||||||
|
|
||||||
|
|
||||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
{
|
{
|
||||||
extraIdentification = "/" + 1;
|
extraIdentification = "/" + 1;
|
||||||
|
@ -3536,26 +3606,34 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
case "ReadingImageTask/SubmitVisitTaskQuestions":
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
//访视任务-- 非Dicom 阅片
|
//访视任务-- 非Dicom 阅片
|
||||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitVisitTaskQuestions" && entity.ReadingTaskState != ReadingTaskState.HaveSigned && type == AuditOpt.Update)
|
if (entity.ReadingTaskState != ReadingTaskState.HaveSigned)
|
||||||
{
|
{
|
||||||
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
//提交访视任务的时候 会多次更新同一个记录 只记录最后一次
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
//Dicom 阅片 签名
|
//Dicom 阅片 签名
|
||||||
if (_userInfo.RequestUrl == "ReadingImageTask/SubmitDicomVisitTask")
|
case "ReadingImageTask/SubmitDicomVisitTask":
|
||||||
{
|
|
||||||
//跳转阅片结果需要该参数
|
//跳转阅片结果需要该参数
|
||||||
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
var subjectCode = _dbContext.Subject.Where(t => t.Id == entity.SubjectId).Select(t => t.Code).First();
|
||||||
|
|
||||||
obj.SubjectCode = subjectCode;
|
obj.SubjectCode = subjectCode;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "ReadingImageTask/resetReadingTask":
|
||||||
|
//跳转阅片结果需要该参数
|
||||||
|
|
||||||
|
obj.IsReadingReset = true;
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#region 裁判、肿瘤学、全局 都是通用的
|
#region 裁判、肿瘤学、全局 都是通用的
|
||||||
|
@ -3576,10 +3654,46 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
obj.SelectResult = r1.Id == entity.JudgeResultTaskId ? "R1" : "R2";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
//增加进入阅片中的稽查
|
||||||
|
|
||||||
|
//重置阅片也会从待阅片 变为阅片中,因为复制病灶依赖这个改变
|
||||||
|
if (obj.IsReadingReset != true)
|
||||||
|
{
|
||||||
|
if (entity.ReadingTaskState == ReadingTaskState.Reading)
|
||||||
|
{
|
||||||
|
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.ReadingTaskState == ReadingTaskState.WaitReading))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/ChangeToReading";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (entity.IsReadClinicalData == true)
|
||||||
|
{
|
||||||
|
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => t.IsReadClinicalData == false))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/ReadClinicalData";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.TaskBlindName.Contains("Timepoint Ran"))
|
||||||
|
{
|
||||||
|
if (_dbContext.VisitTask.Where(t => t.Id == entity.Id).Any(t => !t.TaskBlindName.Contains("Timepoint Ran")))
|
||||||
|
{
|
||||||
|
isDistinctionInterface = false;
|
||||||
|
extraIdentification = "/TriggerSystemBlindingName";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#region 通过链接跳转 2022 12-19
|
#region 通过链接跳转 2022 12-19
|
||||||
|
@ -3697,7 +3811,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// <param name="expression">表达式</param>
|
/// <param name="expression">表达式</param>
|
||||||
/// <param name="otherItem">其他对象</param>
|
/// <param name="otherItem">其他对象</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null,string auditIdentification = "") where T : Entity
|
public async Task InsertInspection<T>(T entityObj, string type, Expression<Func<T, InspectionConvertDTO>> expression = null, object otherItem = null, string auditIdentification = "") where T : Entity
|
||||||
{
|
{
|
||||||
|
|
||||||
InspectionConvertDTO inspection = new InspectionConvertDTO();
|
InspectionConvertDTO inspection = new InspectionConvertDTO();
|
||||||
|
@ -3924,7 +4038,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
/// 获取稽查记录的标识符 部分业务会进行特殊处理
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public string GetInspectionRecordIdentification<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false,string auditIdentification="")
|
public string GetInspectionRecordIdentification<T>(T entityObj, string type, bool IsDistinctionInterface = true, bool isSelfDefine = false, string auditIdentification = "")
|
||||||
{
|
{
|
||||||
//var entityType = _dbContext.Model.FindEntityType(entityObj.GetType());
|
//var entityType = _dbContext.Model.FindEntityType(entityObj.GetType());
|
||||||
//var tableName = entityType.GetTableName();
|
//var tableName = entityType.GetTableName();
|
||||||
|
@ -3943,11 +4057,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
//自定义 标识后面 补充由代码上层的 extraIdentification 附加
|
//自定义 标识后面 补充由代码上层的 extraIdentification 附加
|
||||||
if (isSelfDefine)
|
if (isSelfDefine)
|
||||||
{
|
{
|
||||||
result= $"{_userInfo.RequestUrl}/{entityTypeName}";
|
result = $"{_userInfo.RequestUrl}/{entityTypeName}";
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result= $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
|
result = $"{_userInfo.RequestUrl}/{entityTypeName}/{type}";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -62,6 +62,8 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
public string CutOffVisitName { get; set; }
|
public string CutOffVisitName { get; set; }
|
||||||
|
|
||||||
public string SelectResult { get; set; }
|
public string SelectResult { get; set; }
|
||||||
|
|
||||||
|
public bool? IsReadingReset { get;set; }
|
||||||
}
|
}
|
||||||
public class InspectionConvertDTO : DataInspection
|
public class InspectionConvertDTO : DataInspection
|
||||||
{
|
{
|
||||||
|
|
19756
IRaCIS.Core.Infra.EFCore/Migrations/20250613024223_addRandomOrder.Designer.cs
generated
Normal file
19756
IRaCIS.Core.Infra.EFCore/Migrations/20250613024223_addRandomOrder.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,70 @@
|
||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
#nullable disable
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
public partial class addRandomOrder : Migration
|
||||||
|
{
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<int>(
|
||||||
|
name: "RandomOrder",
|
||||||
|
table: "VisitTask",
|
||||||
|
type: "int",
|
||||||
|
nullable: true,
|
||||||
|
comment: "完全随机阅片号");
|
||||||
|
|
||||||
|
//migrationBuilder.CreateIndex(
|
||||||
|
// name: "IX_NoneDicomStudy_TrialId",
|
||||||
|
// table: "NoneDicomStudy",
|
||||||
|
// column: "TrialId");
|
||||||
|
|
||||||
|
//migrationBuilder.CreateIndex(
|
||||||
|
// name: "IX_ClinicalForm_ReadingId",
|
||||||
|
// table: "ClinicalForm",
|
||||||
|
// column: "ReadingId");
|
||||||
|
|
||||||
|
//migrationBuilder.AddForeignKey(
|
||||||
|
// name: "FK_ClinicalForm_SubjectVisit_ReadingId",
|
||||||
|
// table: "ClinicalForm",
|
||||||
|
// column: "ReadingId",
|
||||||
|
// principalTable: "SubjectVisit",
|
||||||
|
// principalColumn: "Id");
|
||||||
|
|
||||||
|
//migrationBuilder.AddForeignKey(
|
||||||
|
// name: "FK_NoneDicomStudy_Trial_TrialId",
|
||||||
|
// table: "NoneDicomStudy",
|
||||||
|
// column: "TrialId",
|
||||||
|
// principalTable: "Trial",
|
||||||
|
// principalColumn: "Id",
|
||||||
|
// onDelete: ReferentialAction.Cascade);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <inheritdoc />
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_ClinicalForm_SubjectVisit_ReadingId",
|
||||||
|
table: "ClinicalForm");
|
||||||
|
|
||||||
|
migrationBuilder.DropForeignKey(
|
||||||
|
name: "FK_NoneDicomStudy_Trial_TrialId",
|
||||||
|
table: "NoneDicomStudy");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_NoneDicomStudy_TrialId",
|
||||||
|
table: "NoneDicomStudy");
|
||||||
|
|
||||||
|
migrationBuilder.DropIndex(
|
||||||
|
name: "IX_ClinicalForm_ReadingId",
|
||||||
|
table: "ClinicalForm");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "RandomOrder",
|
||||||
|
table: "VisitTask");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -487,6 +487,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("CreateUserId");
|
b.HasIndex("CreateUserId");
|
||||||
|
|
||||||
|
b.HasIndex("ReadingId");
|
||||||
|
|
||||||
b.HasIndex("SubjectId");
|
b.HasIndex("SubjectId");
|
||||||
|
|
||||||
b.ToTable("ClinicalForm", t =>
|
b.ToTable("ClinicalForm", t =>
|
||||||
|
@ -3287,6 +3289,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.HasIndex("SubjectVisitId");
|
b.HasIndex("SubjectVisitId");
|
||||||
|
|
||||||
|
b.HasIndex("TrialId");
|
||||||
|
|
||||||
b.ToTable("NoneDicomStudy", t =>
|
b.ToTable("NoneDicomStudy", t =>
|
||||||
{
|
{
|
||||||
t.HasComment("影像 - 非dicom检查");
|
t.HasComment("影像 - 非dicom检查");
|
||||||
|
@ -14390,6 +14394,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.HasColumnType("nvarchar(2000)")
|
.HasColumnType("nvarchar(2000)")
|
||||||
.HasComment("既往任务Id 不包括自己");
|
.HasComment("既往任务Id 不包括自己");
|
||||||
|
|
||||||
|
b.Property<int?>("RandomOrder")
|
||||||
|
.HasColumnType("int")
|
||||||
|
.HasComment("完全随机阅片号");
|
||||||
|
|
||||||
b.Property<int>("ReReadingApplyState")
|
b.Property<int>("ReReadingApplyState")
|
||||||
.HasColumnType("int")
|
.HasColumnType("int")
|
||||||
.HasComment("重阅状态");
|
.HasComment("重阅状态");
|
||||||
|
@ -14867,6 +14875,10 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.SubjectVisit", "SubjectVisit")
|
||||||
|
.WithMany("ClinicalFormList")
|
||||||
|
.HasForeignKey("ReadingId");
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.Subject", "Subject")
|
b.HasOne("IRaCIS.Core.Domain.Models.Subject", "Subject")
|
||||||
.WithMany("ClinicalFormList")
|
.WithMany("ClinicalFormList")
|
||||||
.HasForeignKey("SubjectId")
|
.HasForeignKey("SubjectId")
|
||||||
|
@ -14878,6 +14890,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
|
|
||||||
|
b.Navigation("SubjectVisit");
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
|
modelBuilder.Entity("IRaCIS.Core.Domain.Models.ClinicalQuestionAnswer", b =>
|
||||||
|
@ -15467,6 +15481,12 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("IRaCIS.Core.Domain.Models.Trial", null)
|
||||||
|
.WithMany("NoneDicomStudyList")
|
||||||
|
.HasForeignKey("TrialId")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
b.Navigation("CreateUserRole");
|
b.Navigation("CreateUserRole");
|
||||||
|
|
||||||
b.Navigation("Subject");
|
b.Navigation("Subject");
|
||||||
|
@ -16573,7 +16593,7 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
|
||||||
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
b.HasOne("IRaCIS.Core.Domain.Models.VisitTask", "VisitTask")
|
||||||
.WithMany()
|
.WithMany("ReadingTaskQuestionMarkList")
|
||||||
.HasForeignKey("VisitTaskId")
|
.HasForeignKey("VisitTaskId")
|
||||||
.OnDelete(DeleteBehavior.Cascade)
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
.IsRequired();
|
.IsRequired();
|
||||||
|
@ -19241,6 +19261,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
{
|
{
|
||||||
b.Navigation("CheckChallengeDialogList");
|
b.Navigation("CheckChallengeDialogList");
|
||||||
|
|
||||||
|
b.Navigation("ClinicalFormList");
|
||||||
|
|
||||||
b.Navigation("NoneDicomStudyList");
|
b.Navigation("NoneDicomStudyList");
|
||||||
|
|
||||||
b.Navigation("PreviousHistoryList");
|
b.Navigation("PreviousHistoryList");
|
||||||
|
@ -19309,6 +19331,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("EnrollList");
|
b.Navigation("EnrollList");
|
||||||
|
|
||||||
|
b.Navigation("NoneDicomStudyList");
|
||||||
|
|
||||||
b.Navigation("ReadModuleList");
|
b.Navigation("ReadModuleList");
|
||||||
|
|
||||||
b.Navigation("ReadingClinicalDataList");
|
b.Navigation("ReadingClinicalDataList");
|
||||||
|
@ -19436,6 +19460,8 @@ namespace IRaCIS.Core.Infra.EFCore.Migrations
|
||||||
|
|
||||||
b.Navigation("ReadingTaskQuestionAnswerList");
|
b.Navigation("ReadingTaskQuestionAnswerList");
|
||||||
|
|
||||||
|
b.Navigation("ReadingTaskQuestionMarkList");
|
||||||
|
|
||||||
b.Navigation("TaskInfluenceList");
|
b.Navigation("TaskInfluenceList");
|
||||||
|
|
||||||
b.Navigation("TaskMedicalReviewList");
|
b.Navigation("TaskMedicalReviewList");
|
||||||
|
|
|
@ -35,15 +35,19 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
Task<bool> UpdateAsync(TEntity entity, Expression<Func<TEntity, TEntity>> updateFactory,
|
Task<bool> UpdateAsync(TEntity entity, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 </summary>
|
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 一定会产生更新sql </summary>
|
||||||
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
Task<TEntity> UpdatePartialFromQueryAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 </summary>
|
/// <summary> 稽查用这个 EF跟踪方式 先查询出来所有实体,再更新部分字段 一定会产生更新sql</summary>
|
||||||
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||||
Expression<Func<TEntity, TEntity>> updateFactory,
|
Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
|
/// <summary> EF跟踪方式 会去数据库查询完整的实体,再更新部分字段 根据是否修改了字段ef 自动判断是否生成sql</summary>
|
||||||
|
Task<TEntity> UpdatePartialFromEFAutoAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
|
bool autoSave = false, CancellationToken cancellationToken = default);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@ using Microsoft.EntityFrameworkCore;
|
||||||
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
using Microsoft.EntityFrameworkCore.ChangeTracking;
|
||||||
using Microsoft.EntityFrameworkCore.Query;
|
using Microsoft.EntityFrameworkCore.Query;
|
||||||
using Microsoft.Extensions.Localization;
|
using Microsoft.Extensions.Localization;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Infra.EFCore
|
namespace IRaCIS.Core.Infra.EFCore
|
||||||
{
|
{
|
||||||
|
@ -167,6 +168,36 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
return searchEntity;
|
return searchEntity;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async Task<TEntity> UpdatePartialFromEFAutoAsync(Guid id, Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
|
bool autoSave = false, CancellationToken cancellationToken = default)
|
||||||
|
{
|
||||||
|
var searchEntity = await _dbSet.FindAsync(id);
|
||||||
|
|
||||||
|
if (searchEntity == null)
|
||||||
|
{
|
||||||
|
throw new BusinessValidationFailedException(I18n.T("Repository_UpdateError"));
|
||||||
|
}
|
||||||
|
|
||||||
|
var list = ((MemberInitExpression)updateFactory.Body).Bindings.Select(mb => mb.Member.Name)
|
||||||
|
.Select(propName => typeof(TEntity).GetProperty(propName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic)).ToList();
|
||||||
|
|
||||||
|
Func<TEntity, TEntity> func = updateFactory.Compile();
|
||||||
|
|
||||||
|
TEntity applyObj = func(searchEntity);
|
||||||
|
|
||||||
|
foreach (PropertyInfo prop in list)
|
||||||
|
{
|
||||||
|
object value = prop.GetValue(applyObj);
|
||||||
|
prop.SetValue(searchEntity, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
await SaveChangesAsync(autoSave);
|
||||||
|
|
||||||
|
return searchEntity;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public async Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
public async Task UpdatePartialFromQueryAsync(Expression<Func<TEntity, bool>> updateFilter,
|
||||||
Expression<Func<TEntity, TEntity>> updateFactory,
|
Expression<Func<TEntity, TEntity>> updateFactory,
|
||||||
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
bool autoSave = false, bool ignoreQueryFilter = false, CancellationToken cancellationToken = default)
|
||||||
|
@ -191,6 +222,7 @@ namespace IRaCIS.Core.Infra.EFCore
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>EF跟踪方式 删除</summary>
|
/// <summary>EF跟踪方式 删除</summary>
|
||||||
public async Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
|
public async Task<bool> DeleteAsync(TEntity entity, bool autoSave = false, CancellationToken cancellationToken = default)
|
||||||
{
|
{
|
||||||
|
|
|
@ -232,6 +232,10 @@ public static class StaticData
|
||||||
|
|
||||||
public const string TrialReadingTaskList_Export = "TrialReadingTaskList_Export";
|
public const string TrialReadingTaskList_Export = "TrialReadingTaskList_Export";
|
||||||
|
|
||||||
|
public const string TrialTaskRandomOrderList_Export = "TrialTaskRandomOrderList_Export";
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public const string TrialReReadingTaskList_Export = "TrialReReadingTaskList_Export";
|
public const string TrialReReadingTaskList_Export = "TrialReReadingTaskList_Export";
|
||||||
|
|
||||||
public const string TrialMedicalReviewList_Export = "TrialMedicalReviewList_Export";
|
public const string TrialMedicalReviewList_Export = "TrialMedicalReviewList_Export";
|
||||||
|
|
Loading…
Reference in New Issue