From b31e70e5739dc54f1d8fb9896f2ba45a1a837026 Mon Sep 17 00:00:00 2001 From: DK Date: Mon, 28 Mar 2022 16:38:06 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BB=93=E6=9E=84=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/InspectionController.cs | 199 +++++++++----- IRaCIS.Core.API/IRaCIS.Core.API.xml | 38 ++- .../IRaCIS.Core.Application.xml | 101 ++++++++ IRaCIS.Core.Application/Resources/en-US.json | 184 +++++++++++-- IRaCIS.Core.Application/Resources/zh-CN.json | 157 ++++++++++- .../Service/Inspection/DTO/InspectionModel.cs | 206 +++++++++++++++ .../Service/Inspection/InspectionService.cs | 244 ++++++++++++++++++ .../Interface/IInspectionService.cs | 26 ++ .../TrialSiteUser/DTO/InspectionViewModel.cs | 68 +---- .../Visit/Interface/ISubjectService.cs | 2 + IRaCIS.Core.Domain/Trial/DataInspection.cs | 103 +++++--- 11 files changed, 1150 insertions(+), 178 deletions(-) create mode 100644 IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs create mode 100644 IRaCIS.Core.Application/Service/Inspection/InspectionService.cs create mode 100644 IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs diff --git a/IRaCIS.Core.API/Controllers/InspectionController.cs b/IRaCIS.Core.API/Controllers/InspectionController.cs index d49552255..0701c7836 100644 --- a/IRaCIS.Core.API/Controllers/InspectionController.cs +++ b/IRaCIS.Core.API/Controllers/InspectionController.cs @@ -1,13 +1,22 @@ using System; +using System.Collections.Generic; +using System.Linq; using System.Threading.Tasks; using AutoMapper; +using Castle.Core.Internal; +using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Filter; +using IRaCIS.Core.Application.Image.QA; +using IRaCIS.Core.Application.Service.Inspection.DTO; +using IRaCIS.Core.Application.Service.Inspection.Interface; using IRaCIS.Core.Domain.Models; using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infra.EFCore; using IRaCIS.Core.Infrastructure.Extention; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; namespace IRaCIS.Core.API.Controllers { @@ -18,93 +27,153 @@ namespace IRaCIS.Core.API.Controllers private readonly IRepository _repository; private readonly IMapper _mapper; private readonly IUserInfo _userInfo; + private readonly ITrialDocumentService _trialDocumentService; + private readonly IQCListService _qCListService; + private readonly ITrialConfigService _trialConfigService; + private readonly ISubjectService _subjectService; + private readonly IInspectionService _inspectionService; + private readonly IRepository _dataInspectionRepository; + private delegate Task executionFun(dynamic data); - public InspectionController(IRepository repository, IMapper mapper, IUserInfo userInfo) + public InspectionController(IRepository repository, + IRepository _repositoryDataInspection, + IMapper mapper, IUserInfo userInfo, + ITrialDocumentService trialDocumentService, + IRepository dataInspectionRepository, + IQCListService _qCListService, + IInspectionService sinspectionService, + ITrialConfigService _trialConfigService, + ISubjectService _subjectService) { _repository = repository; _mapper = mapper; _userInfo = userInfo; + this._inspectionService = sinspectionService; + this._trialDocumentService = trialDocumentService; + this._qCListService = _qCListService; + this._trialConfigService = _trialConfigService; + this._subjectService = _subjectService; + this._dataInspectionRepository = dataInspectionRepository; } - [HttpPost, Route("trialDocument/userConfirm")] - public async Task UserConfirm(TrialDocumentConfirmDTO opt, [FromServices] ITrialDocumentService _trialDocumentService) + /// + /// 获取稽查数据 + /// + /// + [HttpPost, Route("Inspection/GetInspectionData")] + public async Task> GetInspectionData(GetDataInspectionDto dto) { - var verifyResult = await VerifySignatureAsync(opt.SignInfo); - - if (verifyResult.IsSuccess == false) - { - return verifyResult; - } - - var bResult = await _trialDocumentService.UserConfirm(opt.OptCommand); - - if (bResult.IsSuccess == false) - { - return bResult; - } - - //SiteId SubjectId SubjectVisitId TrialId 最开始没有 需要特殊处理 - //表冗余字段 前端只传递一次的话 后台模型就需要单独处理 - - - if (opt.AuditInfo.IsSign) - { - var signId = await AddSignRecordAsync(opt.SignInfo); - - await AddInspectionRecordAsync(opt.AuditInfo, signId); - } - else - { - await AddInspectionRecordAsync(opt.AuditInfo, null); - } - - return bResult; + return await _inspectionService.GetInspectionData(dto); } - - - /// 验证用户签名信息 /// - private async Task VerifySignatureAsync(SignDTO signDTO) + /// + /// 用户 签名某个文档 签署文件 + /// + /// + /// + [HttpPost, Route("Inspection/trialDocument/userConfirm")] + [UnitOfWork] + public async Task UserConfirm(TrialDocumentConfirmDTO opt) { - var user = await _repository.FirstOrDefaultAsync(u => u.UserName == signDTO.UserName && u.Password == signDTO.PassWord); - if (user == null) - { - return ResponseOutput.NotOk("password error"); - } - else if (user.Status == UserStateEnum.Disable) - { - return ResponseOutput.NotOk("The user has been disabled!"); - } - return ResponseOutput.Ok(); - + var fun = _trialDocumentService.UserConfirm; + return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); } - /// 添加签名记录 /// - private async Task AddSignRecordAsync(SignDTO signDTO) - { - var add = await _repository.AddAsync(_mapper.Map(signDTO)); + #region setting + ///// + ///// 配置 基础逻辑信息 + ///// + ///// + ///// + //[HttpPut, Route("configTrialBasicInfo/configTrialBasicInfo")] + //[UnitOfWork] + //public async Task ConfigTrialBasicInfo(InsBasicTrialConfig opt) + //{ + // var fun = _trialConfigService.ConfigTrialBasicInfo; + // return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); + //} - var success = await _repository.SaveChangesAsync(); + ///// + ///// 配置流程 + ///// + ///// + ///// + //[HttpPut, Route("configTrialBasicInfo/configTrialProcessInfo")] + //[UnitOfWork] + //public async Task ConfigTrialProcessInfo(InsTrialProcessConfig opt) + //{ + // var fun = _trialConfigService.ConfigTrialProcessInfo; + // return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); + //} - return add.Id; + ///// + ///// 配置加急信息 + ///// + ///// + ///// + //[HttpPut, Route("configTrialBasicInfo/ConfigTrialUrgentInfo")] + //[UnitOfWork] + //public async Task ConfigTrialUrgentInfo(InsTrialUrgentConfig opt) + //{ + // var fun = _trialConfigService.ConfigTrialUrgentInfo; + // return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); + //} - } - /// 添加稽查记录( 有的会签名,有的不会签名) /// - private async Task AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId) + #endregion + + + + #region 受试者 + /// + /// 添加或更新受试者信息[New] + /// + /// + /// + //[TypeFilter(typeof(TrialResourceFilter))] + [HttpPost, Route("Inspection/Subject/AddOrUpdateSubject")] + [UnitOfWork] + public async Task AddOrUpdateSubject(InsSubjectCommand opt) { - var add = await _repository.AddAsync(_mapper.Map(addDto)); - - add.SignId = signId; - add.IP = _userInfo.IP; - - var success = await _repository.SaveChangesAsync(); - - + opt.AuditInfo.SubjectId = opt.OptCommand.Id; + var fun = _subjectService.AddOrUpdateSubject; + return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); } + /// + /// 修改受试者状态 + /// + /// + /// + /// + [HttpPut, Route("Inspection/Subject/UpdateSubjectStatus")] + [UnitOfWork] + public async Task UpdateSubjectStatus(InsUpdateSubjectStatus opt) + { + var fun = _subjectService.UpdateSubjectStatus; + return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun); + } + + + /// + /// 删除受试者 + /// + /// + /// + [HttpDelete, Route("Inspection/Subject/DeleteSubject")] + [UnitOfWork] + public async Task DeleteSubject(InsDeleteSubjectDto opt) + { + var fun = _subjectService.DeleteSubject; + var data = await _subjectService.DeleteSubject(opt.OptCommand.SubjectId); + return await _inspectionService.Enforcement(opt.OptCommand, opt.AuditInfo, opt.SignInfo, fun, data); + } + #endregion + + + } diff --git a/IRaCIS.Core.API/IRaCIS.Core.API.xml b/IRaCIS.Core.API/IRaCIS.Core.API.xml index f8ffea41d..9f4508f58 100644 --- a/IRaCIS.Core.API/IRaCIS.Core.API.xml +++ b/IRaCIS.Core.API/IRaCIS.Core.API.xml @@ -152,14 +152,40 @@ Financials /Monthly Payment 列表查询接口 - - 验证用户签名信息 /// + + + 获取稽查数据 + + - - 添加签名记录 /// + + + 用户 签名某个文档 签署文件 + + + - - 添加稽查记录( 有的会签名,有的不会签名) /// + + + 添加或更新受试者信息[New] + + + + + + + 修改受试者状态 + + + + + + + + 删除受试者 + + + diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index f84b34e11..d231f1cd4 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -699,6 +699,107 @@ SystemAnonymizationService + + + 子类 + + + + + 配置 基础逻辑信息 + + + + + 配置流程 + + + + + 配置加急信息 + + + + + 用户 签名某个文档 Dto + + + + + 功能模块 + + + + + 盲态访视名 + + + + + 项目iD + + + + + 中心 + + + + + 受试者 + + + + + 访视 + + + + + 操作类型 + + + + + 子类 + + + + + 修改原因 + + + + + 是否有签名 + + + + + 通用逻辑封装 + + 方法参数 + 添加稽查 + 用户签名 + 委托 + + + + + 映射 SiteId SubjectId SubjectVisitId TrialId 最开始没有 需要特殊处理 + + + + + + 验证用户签名信息 /// + + + 添加签名记录 /// + + + 添加稽查记录( 有的会签名,有的不会签名) /// + 项目外部人员 录入流程相关 diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index 6ce94d0b8..49cb16383 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -1,5 +1,5 @@ { - "test{0}": "英文本地化{0}", + "test{0}{1}": "英文本地化{0}{1}", "RequiredAttribute": "{0} is required", // SiteSurvey 服务-------------------------------------------------------------------------------------------------------------------------- @@ -15,28 +15,180 @@ "RecordLockUpdateDisable": "Your record is not locked, you are not allowed to choose to update, if submitted, can be rejected after operation", //记录锁定禁止更新 "SiteLockUpdateDisableOther": "At the current Site, your survey record has been locked, and it is not allowed to update other people's email survey record", //Site锁定禁止更新其他人 "SiteLockUpdateDisableSelf": "At the current Site, your survey record has been locked, and there are other unlocked records, so you are not allowed to update your own survey record", //Site锁定禁止更新自己 - "SiteLockUpdateDisableEmail": "当前Site 存在未锁定的调研记录,不允许更新已锁定邮箱的调研记录", //Site锁定禁止更新邮箱调研记录 - "EmailNotLatestDisableEmail{0}": "该邮箱{0}对应的调查表不是最新锁定的记录,不允许更新!", //邮箱调研表不是最新 不允许更新 - "SiteExistOtherUpdateDisable": "该Site下已经有其他用户已填写的调研表,您不被允许继续填写", //存在其他用户调研表不允许填写 - "IsLockUpdateDisable": "已锁定,不允许操作", //已锁定,不允许操作 - "OnlyAbolishNotFiled": "只允许废除未提交的记录", //只允许废除未提交的记录 - "AdminOperateDisable": "不允许Admin操作", // 不允许Admin操作 - "UserWrongNotSubmit": "人员信息有不正确项,不允许提交", // 人员信息有不正确项,不允许提交 - "FillInTheType": "请填写生成账号的类型。人员姓名{0}", // 请填写生成账号的类型。人员姓名 + "SiteLockUpdateDisableEmail": "Currently, there are unlocked survey records in the Site, and the survey records of the locked mailbox are not allowed to be updated", //Site锁定禁止更新邮箱调研记录 + "EmailNotLatestDisableEmail{0}": "The questionnaire corresponding to this mailbox {0} is not the latest locked record and is not allowed to be updated!", //邮箱调研表不是最新 不允许更新 + "SiteExistOtherUpdateDisable": "Other users have already filled in the survey form under this Site, you are not allowed to continue to fill in", //存在其他用户调研表不允许填写 + "IsLockUpdateDisable": "The operation is not allowed because it has been locked", //已锁定,不允许操作 + "OnlyAbolishNotFiled": "Only uncommitted records are allowed to be annulled", //只允许废除未提交的记录 + "AdminOperateDisable": "The Admin operation is not allowed", // 不允许Admin操作 + "UserWrongNotSubmit": "Personnel information is not allowed to be submitted because there are incorrect items", // 人员信息有不正确项,不允许提交 + "FillInTheType{0}": "Please enter the type of account to be generated. Name of person {0}", // 请填写生成账号的类型。人员姓名 // TrialSiteUserSurveyService - "InfoInconformity": "该用户在系统中账户名为:{0} ,与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存", // 信息不一致 修改一致进行保存 + "InfoInconformity": "The user name in the system is {0}, which is inconsistent with the entered information. You can modify the information to be consistent with the system and save the information", // 信息不一致 修改一致进行保存 // TrialSiteUser 服务------------------------------------------------------------------------------------------------------------ // TrialConfigService - "NoDataDound": "未在系统中找到该签名场景的数据", //未在系统中找到该签名场景的数据 + "NoDataDound": "No data for the signature scenario was found in the system", //未在系统中找到该签名场景的数据 "PasswordError": "password error", //密码错误 "UserBeDisabled": "The user has been disabled!", - "ProjSetDisable": "项目不在Initializing/Ongoing,不允许确认配置", //不允许确认配置 - "QCRepate": "QC问题显示序号不允许重复", // QC问题显示序号不允许重复 - "ParentNumToLow": "父问题的序号要比子问题序号小,请确认", // 父问题的序号要比子问题序号小,请确认 - "ExistUnconfirmedItems": "项目、基础配置、流程配置、加急配置、访视计划,有未确认项", // 存在未确认项 - "NotAllCanOperate": "only in Initializing or Ongoing State can operate" //只有“初始化中”和“正在进行中”才能进行操作 + "ProjSetDisable": "The project is not Initializing/Ongoing and configuration confirmation is not allowed", //不允许确认配置 + "QCRepate": "The serial number of QC problem display is not allowed to repeat", // QC问题显示序号不允许重复 + "ParentNumToLow": "Please confirm that the parent problem number is smaller than the child problem number", // 父问题的序号要比子问题序号小,请确认 + "ExistUnconfirmedItems": "Project, basic configuration, process configuration, urgent configuration, visit plan, unconfirmed items", // 存在未确认项 + "NotAllCanOperate": "only in Initializing or Ongoing State can operate", //只有“初始化中”和“正在进行中”才能进行操作 + + // TrialExternalUserService + "InfoDoNotAgree{0}{1}": "The user account name in the system is {0} Phone number: {1}. The information is inconsistent with the entered information. Now, modify the page information to be consistent with the system information and save the information", // 用户信息不一致 + "UserExist": "The email address and user type already exist", //该邮箱和用户类型,已存在该账户 + + // TrialMaintenanceService + "OneTrial": "Only one pm is allowed in a trial", + "Participant": "Participant has participated in site maintenance", + + // TrialService + "OnlyPMAPM": "Only PM/APM can perform this operation!", + "TrialIDExist": "Same Trial ID already exists.", + "ProjNot": "Operations are allowed only when the project is initialized or in progress", + "TrialConfirm": "The Trial visit schedule has been confirmed and cannot be deleted", + "TrialIntoTheGroup": "The Trial cannot be deleted because a doctor has been enrolled in the Trial or is in the enrollment process", + "TrialHaveSite": "There is a Site under this Trial and it cannot be deleted", + "TrialHaveParticipants": "There are participants under this Trial and they cannot be deleted", + "NotRevertEditable": "VisitPlan has been generated for some subjects,can not revert editable state", + + // TrialSiteService + "CodeRepeated": "Code is not allowed to be repeated", + "CRCCanNotDeleted": "The site has been associated with CRC, and couldn't be deleted", + "SiteCanNotDeleted": "The subjects has been added to this site, and couldn't be deleted", + "StudyCanNotDeleted": "The site has been uploaded study, and couldn't be deleted.", + + // Visit ------------------------------------------------------------------------------------------------------------------------------------------- + + // SubjectService + "VisitNotConfirmed": "The trial visit plan has not been confirmed yet.Please contact the project manager to confirm the visit plan before adding subject", + "ExistedTrial": "A subjects with the same subject ID already existed in this trial.", + "TheLastVisit": "The subject is not allowed to set this visit as the last visit since there is already an visit set as the last visit", + "ImagesUploaded": "The subject uploaded the image after this visit, and this visit is not allowed to be set as the last visit", + "StudyImagesCanBotDeleted": "This subject has executed a visit with uploading study images,and couldn't be deleted", + + // SubjectVisitService + "ContainsVisitnum": "This subject's visit plan already contains a visit with the same visitnum", + "LastEvaluationNotAllowed": "After setting the last evaluation, you are not allowed to add scheduled outbound visits", + "CRCSubmit": "PD confirmation status cannot be modified after CRC submission", + "BacktrackingVisits": "After the CRC is submitted, the PD confirmation status cannot be changed", + "ImageUpload": "The subject uploaded the image after this visit, and this visit is not allowed to be set as the last visit", + "AssociatedUploaded": "This visit is associated with the uploaded study images and couldn't be deleted", + "InPlanCanNotDeleted": "This visit is InPlan and couldn't be deleted", + + // VisitPlanService + "OnlyInitializing": "only in Initializing or Ongoing State can operate", + "AccordWithVisitNum": "For the visit plan, the VisitDay with a larger VisitNum should be larger than the VisitDay with a smaller VisitNum", + "same/VisitName": "A visit with the same VisitName/VisitNum already existed in the current visit plan", + "AlreadyBaseline": "A visit already is baseline in the current visit plan", + "IsUploadVideo": "A CRC has uploaded image data for the baseline and is not allowed to modify the baseline", + "VisitHasBeenExecuted": "The visit plan has been assigned to the subjects and executed", + "OnlyProgressCanEdit": "Modification validation is allowed only during project initialization or in progress", + "NoBaselineNoConfirmation": "No baseline, no confirmation allowed", + "NotConfirmedCanNotVisit": "If the project configuration is not confirmed, the visit plan is not allowed to be confirmed", + "VisitDayNotMinimum": "Baseline VisitDay is not minimum and confirmation is not allowed", + + //Document----------------------------------------------------------------------------------------------------------------------------------------------- + + //SystemDocumentService + "ExistsFileName": "The filename of the same type already exists", + "SignedUser": "A user has signed the document", + + //TrialDocumentService + + //同类型已存在该文件名 上面存在 ExistsFileName + "ExistsSignedUser": "This document, which has been signed by the user, cannot be deleted", + //password error 上面存在 PasswordError + //The user has been disabled 上面存在 UserBeDisabled + "DocumentsSigned": "The document has been signed", + "FileBeDelete": "File deleted or cancelled, signing failed", + + //QC-------------------------------------------------------------------------------------------------------------------------- + + // ClinicalDataService + + // NoneDicomStudyService + + // QCListService + "NotFirstTrial": "The current user is not a preliminary user and cannot perform this operation", + "NotReviewUser": "The current user is not a review user and cannot perform this operation", + + // QCOperationService + "AuditQuestionMust": "The audit question must be filled out and saved, otherwise no challenge is allowed to be added", + "VisitNoClose": "The current viewer has unclosed query for CRC upload permission. No further query is allowed", + "NotFinish": "CRC retransmission request /QC agrees to retransmission challenge and is not allowed to close the challenge until CRC setup retransmission is complete", + "QCHasBeenReplied": "This QC inquiry has been answered", + "OperationUserMustBeCRC/PM": "Only CRC and PM are allowed", + "CanNotCloseQuery": "Visits that perform conformance checks are not allowed to close queries", + "OnlyPMCanSet": "Only PM manual Settings are allowed to pass the consistency check", + "CanNotSettingConsistency": "Currently, the PM approves the rollback and does not allow the consistency check to pass", + "ConsistencyNotClose": "Compliance check challenge unclosed/audit status is not passed, setting conformance check is not allowed to pass", + "PassDataNotFallback": "The data that passes the verification is not allowed to apply for rollback", + "OnlyPMFallback": "Only PM rollback is allowed", + "UnderDetectionNotFallback": "Data to be verified/verified is not allowed to be rolled back", + "OnlyPMCanOperation": "Only PM operations are allowed", + "OnlyExcelCSV": "Only Excel and CSV are allowed!", + "ExcelVerificationFailed": "Please upload an Excel file in the specified format to ensure valid data", + "QCUnconfirmed": "The QC problem is not confirmed, it is not allowed to receive the task", + "MustBeFinish": "You are not allowed to pick up new subjects until you have already picked up other subjects", + "BeReceive": "It is currently claimed and not allowed to be claimed", + "CancelQCTask": "The project is configured to not review, not receive or cancel the QC Task", + "FirstTriaPassed": "The first examination has been passed, can not continue to receive", + "CanNotReceive": "The item is configured as single audit and cannot be collected if SubmmitState: submitted or AuditState: to be audited/audited is not met. Please refresh the interface", + "MustBeDifferent": "The retrial cannot be the same person as the first trial", + "IsNotSatisfied": "The project is configured for review and does not meet the submission status: Submitted or reviewed status: pending review /QC, it is not allowed to receive, please refresh the interface", + "VisitNotUploaded": "Visitors who have not uploaded any Dicom/ non-DICOM data are not allowed to submit", + "MandatoryFailed": "The project is configured to require filling in the date of first administration, but subjects do not fill in the date of first administration, which is not allowed to submit", + "YouBeenRemoved": "You have been removed from the project and are not allowed to do this", + "QuestionsNotClosed": "The operation is not allowed if it is not closed", + "CanNotSetQCPassed": "QC Passed cannot be set if the value is not Passed", + "MustSetQuestion": "The audit question must be filled out and saved, otherwise submission will not be allowed", + "CanNotChangeQCPassed": "The audit status of the item is not InPrimaryQC and cannot be changed to QCPassed", + // "必须填写审核问题,并保存,否则不允许提交" 上面 MustSetQuestion + "TrialIsDoubleCheck{0}": "The audit status of the item is {0} and cannot be changed to QCPassed", + "CanNotSetQCFailed": "QC Failed cannot be set in the unchecked state", + "NotInPrimaryQCQCFailed": "The project is configured as a single audit. The current audit status is not InPrimaryQC and cannot be changed to QCFailed", + "TrialIsDoubleCheckCanNotQCFailed{0}": "The project is configured with double audit. The current audit status is {0} and cannot be changed to QCFailed", + "CRCHasBeenSubmitted": "CRC has submitted an unmodified group confirmation status", + "CannotBeChangedPD": "PD confirmation status cannot be modified for rollback visits", + "OtherQCProcessAudit": "Other QC is conducting audit, current operation is not allowed", + "ForwardFailed": "Forward failure", + + // QCQuestionService + + // TrialQCQuestionService + "QCHasConfirmed": "QC has confirmed that operation is not allowed", + "BeforeClearSubproblem": "The parent problem can only be deleted if the child problem is cleared", + "HasQCAuditRecord": "There is QC audit record, it is not allowed to delete the problem item", + + //ImageAndDoc ----------------------------------------------------------------------------------------------------------------------------- + + //DicomArchiveService + + //ImageShareService + "NoImage": "There is no image in the current study and cannot be shared!", + "ResourceNotExist": "The resource does not exist! ", + "PasswordIsError": "Shared password error!", + "ResourceExpired": "Resource sharing has expired!", + + //InstanceService + + //SeriesService + + //StudyListService + + "TimeTooLow": "当前访视检查时间不能小于该访视之前检查的时间,请核对检查数据是否有误", + "SomeoneLoading": "当前有人正在上传归档该检查!", + "VisitEnd": "受试者访视结束,不允许上传!", + "DICOMUploaded{0}{1}{2}{3}": "{0}: This DICOM images have been uploaded and allocate to the {1} of the subject {2} (Study ID: {3}), which cannot continue to upload and assign it to others." + + //StudyService + + //SystemAnonymizationService } diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 2dc09e958..99bb84096 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -1,5 +1,5 @@ { - "test{0}": "中文本地化{0}", + "test{0}{1}": "中文本地化{0}{1}", "RequiredAttribute": "{0} 字段是必须的", // SiteSurvey 服务-------------------------------------------------------------------------------------------------------------------------- @@ -40,6 +40,157 @@ "NotAllCanOperate": "只有“初始化中”和“正在进行中”才能进行操作", //只有“初始化中”和“正在进行中”才能进行操作 // TrialExternalUserService - "InfoDoNotAgree{0}{1}": "该用户在系统中账户名为:{0} 电话:{1},与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存" // 用户信息不一致 - "UserExist" + "InfoDoNotAgree{0}{1}": "该用户在系统中账户名为:{0} 电话:{1},与填写信息存在不一致项, 现将界面信息修改为与系统一致,可进行保存", // 用户信息不一致 + "UserExist": "该邮箱和用户类型,已存在该账户", //该邮箱和用户类型,已存在该账户 + + // TrialMaintenanceService + "OneTrial": "一次验证中只能一个PM", + "Participant": "参与过现场维护工作", + + // TrialService + "OnlyPMAPM": "仅PM/APM可以操作!", + "TrialIDExist": "相同的试用ID已经存在。", + "ProjNot": "项目初始化或者进行中时,才允许操作", + "TrialConfirm": "Trial访视计划已经确认,无法删除", + "TrialIntoTheGroup": "该Trial有医生入组或在入组流程中,无法删除", + "TrialHaveSite": "该Trial下面有Site,无法删除", + "TrialHaveParticipants": "该Trial下面有参与者,无法删除", + "NotRevertEditable": "部分主题已生成VisitPlan,无法恢复编辑状态", + + // TrialSiteService + "CodeRepeated": "编码不允许重复", + "CRCCanNotDeleted": "该站点已与CRC关联,无法删除", + "SiteCanNotDeleted": "主题已添加到本网站,无法删除", + "StudyCanNotDeleted": "该网站已上传研究,无法删除", + + // Visit ------------------------------------------------------------------------------------------------------------------------------------------- + + // SubjectService + "VisitNotConfirmed": "试访计划尚未确定。添加主题前请联系项目经理确认访问计划", + "ExistedTrial": "在本试验中已经存在一个具有相同受试者ID的受试者.", + "TheLastVisit": "该受试者已经有访视设置为末次访视,不允许将该访视设置为末次访视", + "ImagesUploaded": "该受试者此访视后有影像上传,该访视不允许设置为末次访视", + "StudyImagesCanBotDeleted": "本课题已上传研究图像进行访问,无法删除", + + // SubjectVisitService + "ContainsVisitnum": "这个主题的访问计划已经包含了一个访问次数相同的访问", + //该受试者已经有访视设置为末次访视,不允许将该访视设置为末次访视 这个在上面有 TheLastVisit + "LastEvaluationNotAllowed": "设置末次评估后,不允许添加计划外访视", + "CRCSubmit": "CRC提交后,不允许修改PD确认状态", + "BacktrackingVisits": "回退的访视,不允许修改PD确认状态", + "ImageUpload": "该受试者此访视后有影像上传,该访视不允许设置为末次访视", + "AssociatedUploaded": "本次访问与上传的研究图片有关,无法删除", + "InPlanCanNotDeleted": "此访问为InPlan,不能删除", + + // VisitPlanService + "OnlyInitializing": "只有“初始化中”和“正在进行中”才能进行操作", + "AccordWithVisitNum": "对于访问计划,具有较大VisitNum的VisitDay应该大于具有较小VisitNum的VisitDay", + "same/VisitName": "当前访问计划中已经存在具有相同VisitName/VisitNum的访问", + "AlreadyBaseline": "已访视是当前访视计划的基线", + "IsUploadVideo": "有CRC已经为基线上传了影像数据,不允许修改基线", + "VisitHasBeenExecuted": "访问计划已分配给受试者并执行", + "OnlyProgressCanEdit": "仅仅在项目初始化或者进行中时,才允许修改确认", + "NoBaselineNoConfirmation": "没有基线,不允许确认", + "NotConfirmedCanNotVisit": "项目配置未确认,不允许确认访视计划", + "VisitDayNotMinimum": "基线VisitDay 不是最小的, 不允许确认", + + + //Document----------------------------------------------------------------------------------------------------------------------------------------------- + + //SystemDocumentService + "ExistsFileName": "同类型已存在该文件名", + "SignedUser": "该文档下已有签名的用户", + + //TrialDocumentService + + //同类型已存在该文件名 上面存在 ExistsFileName + "ExistsSignedUser": "该文档,已有用户签名,不允许删除", + //password error 上面存在 PasswordError + //The user has been disabled 上面存在 UserBeDisabled + "DocumentsSigned": "该文档已经签名", + "FileBeDelete": "文件已删除或者废除,签署失败", + + //QC-------------------------------------------------------------------------------------------------------------------------- + + // ClinicalDataService + + // NoneDicomStudyService + + // QCListService + "NotFirstTrial": "当前用户不是初审用户,不允许操作", + "NotReviewUser": "当前用户不是复审用户,不允许操作", + + // QCOperationService + "AuditQuestionMust": "必须填写审核问题,并保存,否则不允许添加质疑", + "VisitNoClose": "当前访视有未关闭的 同意CRC上传的质疑,不允许再次添加质疑", + "NotFinish": "CRC申请重传的/QC同意重传的质疑,在CRC设置重传完成前不允许关闭质疑", + "QCHasBeenReplied": "此QC质询已回复", + "OperationUserMustBeCRC/PM": "一致性核查对话操作用户 只允许 CRC/PM", + "CanNotCloseQuery": "执行一致性核查的访视 不允许关闭质疑", + "OnlyPMCanSet": "只允许PM 手动设置一致性核查通过", + "CanNotSettingConsistency": "当前是PM同意回退,不允许设置一致性核查通过", + "ConsistencyNotClose": "致性核查质疑未关闭/审核状态不是通过,不允许设置一致性核查通过", + "PassDataNotFallback": "核查通过的数据不允许申请回退", + "OnlyPMFallback": "只允许PM 回退", + "UnderDetectionNotFallback": "待核查/核查通过的数据不允许回退", + "OnlyPMCanOperation": "只允许PM 操作", + "OnlyExcelCSV": "只允许Excel、 CSV!", + "ExcelVerificationFailed": "请上传规定格式的Excel文件,保证有有效数据", + "QCUnconfirmed": "QC问题未确认,不允许领取任务", + "MustBeFinish": "您已经领取了其他受试者,完成后才允许领取新的受试者", + "BeReceive": "当前已被领取,不允许领取", + "CancelQCTask": "项目配置为不审,没有领取或者取消QC Task", + "FirstTriaPassed": "初审已通过,不能继续领取", + "CanNotReceive": "项目配置为单审,不满足SubmmitState:已提交 或者 AuditState:待审核/审核中, 不允许领取,请刷新界面", + "MustBeDifferent": "复审不能和初审是同一个人", + "IsNotSatisfied": "项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面", + "VisitNotUploaded": "有访视未上传任何Dicom/非Dicom数据 不允许提交", + "MandatoryFailed": "项目配置了需要填写首次给药日期 但是受试者没有填写首次给药日期,不允许提交", + "YouBeenRemoved": "您已经被移出项目,不允许该操作", + "QuestionsNotClosed": "有质疑未关闭,不允许该操作", + "CanNotSetQCPassed": "不审状态下,不允许设置为QC Passed", + "MustSetQuestion": "必须填写审核问题,并保存,否则不允许提交", + "CanNotChangeQCPassed": "项目配置为单审 当前审核状态不为 InPrimaryQC,不能变更到 QCPassed", + // "必须填写审核问题,并保存,否则不允许提交" 上面 MustSetQuestion + "TrialIsDoubleCheck{0}": "项目配置为双审 当前审核状态为 {0},不能变更到 QCPassed", + "CanNotSetQCFailed": "不审状态下,不允许设置为QC Failed", + "NotInPrimaryQCQCFailed": "项目配置为单审 当前审核状态不为 InPrimaryQC,不能变更到 QCFailed", + "TrialIsDoubleCheckCanNotQCFailed{0}": "项目配置为双审 当前审核状态为 {0},不能变更到 QCFailed", + "CRCHasBeenSubmitted": "CRC已提交了 不能修改入组确认状态", + "CannotBeChangedPD": "回退的访视,不允许修改PD确认状态", + "OtherQCProcessAudit": "其他QC正在进行审核,当前操作不允许", + "ForwardFailed": "转发失败", + + // QCQuestionService + + // TrialQCQuestionService + "QCHasConfirmed": "QC已确认,不允许操作", + "BeforeClearSubproblem": "清除子问题 才允许删除父问题", + "HasQCAuditRecord": "已有QC审核记录,不允许删除问题项", + + + //ImageAndDoc ----------------------------------------------------------------------------------------------------------------------------- + + //DicomArchiveService + + //ImageShareService + "NoImage": "目前研究中没有图片,不能分享!", + "ResourceNotExist": "资源不存在!", + "PasswordIsError": "共享密码错误!", + "ResourceExpired": "资源共享过期!", + + //InstanceService + + //SeriesService + + //StudyListService + + "TimeTooLow": "当前访视检查时间不能小于该访视之前检查的时间,请核对检查数据是否有误", + "SomeoneLoading": "当前有人正在上传归档该检查!", + "VisitEnd": "受试者访视结束,不允许上传!", + "DICOMUploaded{0}{1}{2}{3}": "{0}:此DICOM图片已上传并分配给课题{2}(研究ID:{3})的{1},课题{2}无法继续上传并分配给他人。" + + //StudyService + + //SystemAnonymizationService } diff --git a/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs new file mode 100644 index 000000000..7a246a119 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Inspection/DTO/InspectionModel.cs @@ -0,0 +1,206 @@ +using IRaCIS.Application.Contracts; +using IRaCIS.Core.Application.Contracts; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Service.Inspection.DTO +{ + + + + + public class DataInspectionAddDTO + { + + public Guid? TrialId { get; set; } + public Guid? SiteId { get; set; } + public Guid? SubjectId { get; set; } + public Guid? SubjectVisitId { get; set; } + public string ModuleType { get; set; } = string.Empty; + public string OptType { get; set; } = string.Empty; + + + + public string BlindName { get; set; } = string.Empty; + public string Reason { get; set; } = string.Empty; + + + /// + /// 子类 + /// + public int ChildrenType { get; set; } + public bool IsSign { get; set; } + public string JsonDetail { get; set; } = string.Empty; + + + + + ////需要单独处理 + //public string IP { get; set; } + + //public Guid? SignId { get; set; } + + } + + + public interface IInspectionDTO + { + public DataInspectionAddDTO AuditInfo { get; set; } + } + + public interface ISignDTO + { + public SignDTO SignInfo { get; set; } + + } + + #region Setting + /// + /// 配置 基础逻辑信息 + /// + public class InsBasicTrialConfig : InspectionBase, IInspectionDTO, ISignDTO + { + public BasicTrialConfig OptCommand { get; set; } + } + + /// + /// 配置流程 + /// + public class InsTrialProcessConfig : InspectionBase, IInspectionDTO, ISignDTO + { + public TrialProcessConfig OptCommand { get; set; } + } + + /// + /// 配置加急信息 + /// + public class InsTrialUrgentConfig : InspectionBase, IInspectionDTO, ISignDTO + { + public TrialUrgentConfig OptCommand { get; set; } + } + #endregion + + + #region 受试者 + public class InsSubjectCommand : InspectionBase, IInspectionDTO, ISignDTO + { + public SubjectCommand OptCommand { get; set; } + } + + public class InsUpdateSubjectStatus : InspectionBase, IInspectionDTO, ISignDTO + { + public SubjectStatusChangeCommand OptCommand { get; set; } + } + + + public class InsDeleteSubjectDto : InspectionBase, IInspectionDTO, ISignDTO + { + public DeleteSubjectDto OptCommand { get; set; } + } + + + public class DeleteSubjectDto + { + public Guid SubjectId { get; set; } + + public Guid TrialId { get; set; } + + public Guid SiteId { get; set; } + } + + #endregion + + /// + /// 用户 签名某个文档 Dto + /// + public class TrialDocumentConfirmDTO : InspectionBase, IInspectionDTO, ISignDTO + { + + public UserConfirmCommand OptCommand { get; set; } + + } + + public class GetDataInspectionOutDto : DataInspection + { + public string ExperimentName { get; set; } = string.Empty; + + public string SiteName { get; set; } = string.Empty; + + public string FirstName { get; set; } = string.Empty; + + public string LastName { get; set; } = string.Empty; + + public string VisitName { get; set; } = string.Empty; + + public string ParentJson { get; set; } = string.Empty; + + public string CreateUser { get; set; } = string.Empty; + public string UserFirstName { get; set; } = string.Empty; + public string UserLastName { get; set; } = string.Empty; + + + } + + + public class GetDataInspectionDto : PageInput + { + /// + /// 功能模块 + /// + public string ModuleType { get; set; } = string.Empty; + /// + /// 盲态访视名 + /// + public string BlindName { get; set; } = string.Empty; + + /// + /// 项目iD + /// + public Guid? TrialId { get; set; } + + /// + /// 中心 + /// + public Guid? SiteId { get; set; } + + /// + /// 受试者 + /// + public Guid? SubjectId { get; set; } + + /// + /// 访视 + /// + public Guid? SubjectVisitId { get; set; } + + /// + /// 操作类型 + /// + public string OptType { get; set; } = string.Empty; + /// + /// 子类 + /// + public int? ChildrenType { get; set; } + + /// + /// 修改原因 + /// + + public string Reason { get; set; } = string.Empty; + + /// + /// 是否有签名 + /// + public bool? IsSign { get; set; } + } + + public class InspectionBase + { + public DataInspectionAddDTO AuditInfo { get; set; } + + public SignDTO SignInfo { get; set; } = new SignDTO(); + } +} diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs new file mode 100644 index 000000000..4c1abf803 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -0,0 +1,244 @@ +using Castle.Core.Internal; +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Service.Inspection.DTO; +using IRaCIS.Core.Application.Service.Inspection.Interface; +using IRaCIS.Core.Domain.Share; +using Panda.DynamicWebApi.Attributes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Service.Inspection +{ + [NonDynamicWebApi] + public class InspectionService : BaseService, IInspectionService + { + public InspectionService() + { + + } + public async Task> GetInspectionData(GetDataInspectionDto dto) + { + //_repository.GetQueryable.GetQueryable < DataInspection > + + #region 逻辑代码 + var query = from data in _repository.GetQueryable() + join trial in _repository.GetQueryable() on data.TrialId equals trial.Id into trialtemp + from leftrial in trialtemp.DefaultIfEmpty() + join site in _repository.GetQueryable() on data.SiteId equals site.Id into sitetemp + from leftsite in sitetemp.DefaultIfEmpty() + join subject in _repository.GetQueryable() on data.SubjectId equals subject.Id into subtemp + from leftsubject in subtemp.DefaultIfEmpty() + join subjectVisit in _repository.GetQueryable() on data.SubjectVisitId equals subjectVisit.Id into subjectVisittemp + from leftsubjectVisit in subjectVisittemp.DefaultIfEmpty() + join parent in _repository.GetQueryable() on data.ParentId equals parent.Id into parenttemp + from leftparent in parenttemp.DefaultIfEmpty() + join user in _repository.GetQueryable() on data.CreateUserId equals user.Id into usertemp + from leftuser in usertemp.DefaultIfEmpty() + + select new GetDataInspectionOutDto() + { + CreateTime = data.CreateTime, + CreateUserId = data.CreateUserId, + ModuleType = data.ModuleType, + BlindName = data.BlindName, + TrialId = data.TrialId, + SiteId = data.SiteId, + SubjectId = data.SubjectId, + SubjectVisitId = data.SubjectVisitId, + OptType = data.OptType, + IP = data.IP, + Reason = data.Reason, + IsSign = data.IsSign, + SignId = data.SignId, + ParentId = data.ParentId, + ChildrenType = data.ChildrenType, + JsonDetail = data.JsonDetail, + SiteName = leftsite.SiteName, + ExperimentName = leftrial.ExperimentName, + FirstName = leftsubject.FirstName, + LastName = leftsubject.LastName, + Id = data.Id, + ParentJson = leftparent.JsonDetail, + VisitName = leftsubjectVisit.VisitName, + CreateUser = leftuser.UserName, + UserFirstName = leftuser.FirstName, + UserLastName = leftuser.LastName, + }; + + query = query.WhereIf(!dto.BlindName.IsNullOrEmpty(), x => x.BlindName == dto.BlindName) + .WhereIf(dto.IsSign != null, x => x.IsSign == dto.IsSign) + .WhereIf(dto.ChildrenType != null, x => x.ChildrenType == dto.ChildrenType) + .WhereIf(!dto.ModuleType.IsNullOrEmpty(), x => x.ModuleType == dto.ModuleType) + .WhereIf(!dto.OptType.IsNullOrEmpty(), x => x.OptType == dto.OptType) + .WhereIf(!dto.Reason.IsNullOrEmpty(), x => x.Reason == dto.Reason) + .WhereIf(dto.TrialId != null, x => x.TrialId == dto.TrialId) + .WhereIf(dto.SubjectId != null, x => x.SubjectId == dto.SubjectId) + .WhereIf(dto.SubjectVisitId != null, x => x.SubjectVisitId == dto.SubjectVisitId) + .WhereIf(dto.SiteId != null, x => x.SiteId == dto.SiteId); + #endregion + + #region 测试 + //var query = from data in _repository.GetQueryable() + + // join parent in _repository.GetQueryable() on data.ParentId equals parent.Id into parenttemp + // from leftparent in parenttemp.DefaultIfEmpty() + // join subjectVisit in _repository.GetQueryable() on data.SubjectVisitId equals subjectVisit.Id into subjectVisittemp + + // from leftsubjectVisit in subjectVisittemp.DefaultIfEmpty() + // select new GetDataInspectionOutDto() + // { + // CreateTime = data.CreateTime, + // CreateUserId = data.CreateUserId, + // ModuleType = data.ModuleType, + // BlindName = data.BlindName, + // TrialId = data.TrialId, + // SiteId = data.SiteId, + // SubjectId = data.SubjectId, + // SubjectVisitId = data.SubjectVisitId, + // OptType = data.OptType, + // IP = data.IP, + // Reason = data.Reason, + // IsSign = data.IsSign, + // SignId = data.SignId, + // ParentId = data.ParentId, + // ChildrenType = data.ChildrenType, + // JsonDetail = data.JsonDetail, + // VisitName = leftsubjectVisit.VisitName, + // Id = data.Id, + // ParentJson = leftparent.JsonDetail, + + // }; + #endregion + + + dto.Asc = false; + return await query.ToPagedListAsync(dto.PageIndex, dto.PageSize, "CreateTime", dto.Asc); + } + + + /// + /// 通用逻辑封装 + /// + /// 方法参数 + /// 添加稽查 + /// 用户签名 + /// 委托 + /// + public async Task Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput response=null) + { + Guid? signId = null; + MapData(OptCommand, AuditInfo); + if (AuditInfo.IsSign) + { + // 验证用户签名信息 + var verifyResult = await VerifySignatureAsync(SignInfo); + signId = await AddSignRecordAsync(SignInfo); + if (verifyResult.IsSuccess == false) + { + return verifyResult; + } + await AddSignRecordAsync(SignInfo); + } + + IResponseOutput bResult; + + if (response != null) + { + bResult = response; + } + else + { + bResult = await fun(OptCommand); + } + + // 用户 签名某个文档 + + + if (bResult.IsSuccess == false) + { + return bResult; + } + + // 判断是否需要前面 + + await AddInspectionRecordAsync(AuditInfo, signId); + + if (bResult.IsSuccess == false) + { + return bResult; + } + return bResult; + } + + + /// + /// 映射 SiteId SubjectId SubjectVisitId TrialId 最开始没有 需要特殊处理 + /// + /// + /// + public void MapData(dynamic data, dynamic mapData) + { + List column = new List() { "TrialId", "SiteId", "SubjectId", "SubjectVisitId" }; + foreach (var item in column) + { + try + { + var value = data.GetType().GetProperty(item).GetValue(data); + mapData.GetType().GetProperty(item).SetValue(mapData, value); + } + catch (Exception) + { + continue; + + } + } + } + + /// 验证用户签名信息 /// + public async Task VerifySignatureAsync(SignDTO signDTO) + { + var user = await _repository.FirstOrDefaultAsync(u => u.UserName == signDTO.UserName && u.Password == signDTO.PassWord); + if (user == null) + { + return ResponseOutput.NotOk("password error"); + } + else if (user.Status == UserStateEnum.Disable) + { + return ResponseOutput.NotOk("The user has been disabled!"); + } + return ResponseOutput.Ok(); + + } + + /// 添加签名记录 /// + public async Task AddSignRecordAsync(SignDTO signDTO) + { + var add = await _repository.AddAsync(_mapper.Map(signDTO)); + + var success = await _repository.SaveChangesAsync(); + + return add.Id; + + } + + /// 添加稽查记录( 有的会签名,有的不会签名) /// + public async Task AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId) + { + var add = _mapper.Map(addDto); + Guid? parentId = null; + parentId = (await _repository.GetQueryable().Where(x => x.TrialId == add.TrialId && x.SubjectVisitId == add.SubjectVisitId && x.SubjectId == add.SubjectId && x.SiteId == x.SiteId).OrderByDescending(x => x.CreateTime).FirstOrDefaultAsync())?.Id; + add.ParentId = parentId; + add.CreateTime = DateTime.Now; + add.CreateUserId = _userInfo.Id; + add.SignId = signId; + add.IP = _userInfo.IP; + await _repository.AddAsync(add); + var success = await _repository.SaveChangesAsync(); + return ResponseOutput.Ok(success); + + } + } +} diff --git a/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs new file mode 100644 index 000000000..8c3368bc9 --- /dev/null +++ b/IRaCIS.Core.Application/Service/Inspection/Interface/IInspectionService.cs @@ -0,0 +1,26 @@ +using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Service.Inspection.DTO; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace IRaCIS.Core.Application.Service.Inspection.Interface +{ + public interface IInspectionService + { + + Task> GetInspectionData(GetDataInspectionDto dto); + + void MapData(dynamic data, dynamic mapData); + + Task VerifySignatureAsync(SignDTO signDTO); + + Task AddSignRecordAsync(SignDTO signDTO); + + Task Enforcement(dynamic OptCommand, DataInspectionAddDTO AuditInfo, SignDTO SignInfo, dynamic fun, IResponseOutput response = null); + + Task AddInspectionRecordAsync(DataInspectionAddDTO addDto, Guid? signId); + } +} diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs index 7f48a5b5e..883e5cac0 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/InspectionViewModel.cs @@ -1,75 +1,27 @@ -using System.ComponentModel.DataAnnotations; +using IRaCIS.Application.Contracts; +using System.ComponentModel.DataAnnotations; namespace IRaCIS.Core.Application.Contracts; public class SignDTO { - public string UserName { get; set; } = String.Empty; + public string UserName { get; set; } = string.Empty; - public string PassWord { get; set; } = String.Empty; + public string PassWord { get; set; } = string.Empty; - public string SignText { get; set; } = String.Empty; + public string SignText { get; set; } = string.Empty; - [NotDefault] - public Guid TrialId { get; set; } - [NotDefault] - public Guid SignCodeId { get; set; } + public Guid? TrialId { get; set; } - [NotDefault] - public string SignCode { get; set; } = String.Empty; + public Guid? SignCodeId { get; set; } + + + public string SignCode { get; set; } = string.Empty; public Guid? SubjectVisitId { get; set; } } - -public class DataInspectionAddDTO -{ - - public Guid TrialId { get; set; } - public Guid SiteId { get; set; } - public Guid SubjectId { get; set; } - public Guid SubjectVisitId { get; set; } - public int ModuleEnum { get; set; } - public int OptEnum { get; set; } - - - - public string BlindName { get; set; } = string.Empty; - public string Reason { get; set; } = string.Empty; - public bool IsSign { get; set; } - public string JsonDetail { get; set; } = string.Empty; - - - - - ////需要单独处理 - //public string IP { get; set; } - - //public Guid? SignId { get; set; } - -} - - -public interface IInspectionDTO -{ - public DataInspectionAddDTO AuditInfo { get; set; } -} - -public interface ISignDTO -{ - public SignDTO SignInfo { get; set; } - -} - -public class TrialDocumentConfirmDTO : IInspectionDTO, ISignDTO -{ - public UserConfirmCommand OptCommand { get; set; } - - public DataInspectionAddDTO AuditInfo { get; set; } - - public SignDTO SignInfo { get; set; } -} \ No newline at end of file diff --git a/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectService.cs b/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectService.cs index 412272b0c..798d1e78b 100644 --- a/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectService.cs +++ b/IRaCIS.Core.Application/Service/Visit/Interface/ISubjectService.cs @@ -7,6 +7,8 @@ namespace IRaCIS.Application.Interfaces { Task AddOrUpdateSubject([FromBody] SubjectCommand subjectCommand); Task DeleteSubject(Guid id); + + Task UpdateSubjectStatus(SubjectStatusChangeCommand subjectStatusChangeCommand); Task, TrialSubjectConfig>> GetSubjectList(SubjectQueryParam param); } } \ No newline at end of file diff --git a/IRaCIS.Core.Domain/Trial/DataInspection.cs b/IRaCIS.Core.Domain/Trial/DataInspection.cs index b1254fcbf..9f0666e6f 100644 --- a/IRaCIS.Core.Domain/Trial/DataInspection.cs +++ b/IRaCIS.Core.Domain/Trial/DataInspection.cs @@ -1,6 +1,5 @@ //-------------------------------------------------------------------- -// 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-03-21 17:13:43 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 using System; @@ -9,56 +8,100 @@ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; namespace IRaCIS.Core.Domain.Models { - /// - ///DataInspection - /// - [Table("DataInspection")] - public class DataInspection : Entity, IAuditAdd - { - + /// + ///DataInspection + /// + [Table("DataInspection")] + public class DataInspection : Entity, IAuditAdd + { + + /// + /// 创建时间 + /// public DateTime CreateTime { get; set; } - public Guid CreateUserId { get; set; } - - [Required] - public int ModuleEnum { get; set; } + /// + /// 创建用户ID + /// + public Guid CreateUserId { get; set; } + /// + /// 功能模块 + /// + public string ModuleType { get; set; } - public string BlindName { get; set; } = string.Empty; - + /// + /// 盲态访视名 + /// + public string BlindName { get; set; } = string.Empty; + /// + /// 项目iD + /// [Required] public Guid TrialId { get; set; } - - [Required] - public Guid SiteId { get; set; } - + /// + /// 中心 + /// + public Guid? SiteId { get; set; } - [Required] - public Guid SubjectId { get; set; } + /// + /// 受试者 + /// + public Guid? SubjectId { get; set; } - [Required] - public Guid SubjectVisitId { get; set; } - + /// + /// 访视 + /// + public Guid? SubjectVisitId { get; set; } - [Required] - public int OptEnum { get; set; } + /// + /// 操作类型 + /// + public string OptType { get; set; } + /// + /// IP地址 + /// public string IP { get; set; } = string.Empty; - + /// + /// 修改原因 + /// [Required] public string Reason { get; set; } = string.Empty; - + /// + /// 是否有签名 + /// public bool IsSign { get; set; } - + /// + /// 签名ID + /// public Guid? SignId { get; set; } - public string JsonDetail { get; set; } = string.Empty; + /// + /// 父类ID + /// + + public Guid? ParentId { get; set; } + + /// + /// 子类 + /// + public int? ChildrenType { get; set; } + + /// + /// Json 对象 + /// + + public string JsonDetail { get; set; } = string.Empty; + } -} + + +}