22 changed files with 16255 additions and 22 deletions
-
27src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpDto.cs
-
11src/Shentun.Peis.Application.Contracts/FollowUps/FollowUpIdInputDto.cs
-
27src/Shentun.Peis.Application.Contracts/FollowUps/GetFollowUpListInputDto.cs
-
31src/Shentun.Peis.Application.Contracts/PhoneFollowUps/CreatePhoneFollowUpDto.cs
-
41src/Shentun.Peis.Application.Contracts/RegisterCheckItems/UpdateRegisterCheckItemCriticalInputDto.cs
-
2src/Shentun.Peis.Application.Contracts/RegisterChecks/RegisterCheckDto.cs
-
38src/Shentun.Peis.Application.Contracts/RegisterChecks/UpdateRegisterCheckCriticalInputDto.cs
-
17src/Shentun.Peis.Application/DiagnosisFunctions/DiagnosisFunctionAppService.cs
-
109src/Shentun.Peis.Application/FollowUps/FollowUpAppService.cs
-
39src/Shentun.Peis.Application/PhoneFollowUps/PhoneFollowUpAppService.cs
-
72src/Shentun.Peis.Application/RegisterCheckItems/RegisterCheckItemAppService.cs
-
68src/Shentun.Peis.Application/RegisterChecks/RegisterCheckAppService.cs
-
11src/Shentun.Peis.Domain/FollowUps/FollowUp.cs
-
58src/Shentun.Peis.Domain/FollowUps/FollowUpManager.cs
-
6src/Shentun.Peis.Domain/PatientRegisters/PatientRegister.cs
-
23src/Shentun.Peis.Domain/PhoneFollowUps/PhoneFollowUp.cs
-
6src/Shentun.Peis.Domain/SmsSends/SmsSend.cs
-
2src/Shentun.Peis.EntityFrameworkCore/DbMapping/PhoneFollows/PhoneFollowDbMapping.cs
-
2src/Shentun.Peis.EntityFrameworkCore/DbMapping/SmsSends/SmsSendDbMapping.cs
-
15637src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.Designer.cs
-
38src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.cs
-
12src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.FollowUps |
|||
{ |
|||
public class FollowUpDto : AuditedEntityDtoName |
|||
{ |
|||
/// <summary>
|
|||
/// 人员登记ID
|
|||
/// </summary>
|
|||
public Guid PatientRegisterId { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 是否短信随访创建完成
|
|||
/// </summary>
|
|||
public char IsSmsComplete { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否电话随访创建完成
|
|||
/// </summary>
|
|||
public char IsPhoneComplete { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.FollowUps |
|||
{ |
|||
public class FollowUpIdInputDto |
|||
{ |
|||
public Guid FollowUpId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.FollowUps |
|||
{ |
|||
public class GetFollowUpListInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 人员登记ID 集合
|
|||
/// </summary>
|
|||
public List<Guid> PatientRegisterIds { get; set; } = new List<Guid>(); |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 是否短信随访创建完成
|
|||
/// </summary>
|
|||
public char? IsSmsComplete { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否电话随访创建完成
|
|||
/// </summary>
|
|||
public char? IsPhoneComplete { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.PhoneFollowUps |
|||
{ |
|||
public class CreatePhoneFollowUpDto |
|||
{ |
|||
/// <summary>
|
|||
/// 表达式
|
|||
/// </summary>
|
|||
public string CornValue { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 随访主表ID
|
|||
/// </summary>
|
|||
public Guid FollowUpId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 随访内容
|
|||
/// </summary>
|
|||
public string FollowUpContent { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 回复内容
|
|||
/// </summary>
|
|||
public string? ReplyContent { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,41 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.RegisterCheckItems |
|||
{ |
|||
public class UpdateRegisterCheckItemCriticalInputDto |
|||
{ |
|||
public Guid RegisterCheckId { get; set; } |
|||
|
|||
public Guid ItemId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 危急值标志 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsCriticalValue { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 随访值标志 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsFollowUp { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 危急值医生填写的内容
|
|||
/// </summary>
|
|||
public string CriticalValueContent { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 危急值是否审核 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsCriticalValueAudit { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 该项目要复查 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsReview { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.RegisterChecks |
|||
{ |
|||
public class UpdateRegisterCheckCriticalInputDto |
|||
{ |
|||
public Guid RegisterCheckId { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 危急值标志 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsCriticalValue { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 随访值标志 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsFollowUp { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 危急值医生填写的内容
|
|||
/// </summary>
|
|||
public string CriticalValueContent { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 危急值是否审核 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsCriticalValueAudit { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 该项目要复查 Y N 无需修改时传null
|
|||
/// </summary>
|
|||
public char? IsReview { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,109 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.Peis.Models; |
|||
using Shentun.Peis.PatientRegisters; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Shentun.Peis.FollowUps |
|||
{ |
|||
/// <summary>
|
|||
/// 随访主表
|
|||
/// </summary>
|
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
[Authorize] |
|||
public class FollowUpAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<FollowUp, Guid> _followUpRepository; |
|||
private readonly CacheService _cacheService; |
|||
private readonly FollowUpManager _followUpManager; |
|||
public FollowUpAppService( |
|||
IRepository<FollowUp, Guid> followUpRepository, |
|||
CacheService cacheService, |
|||
FollowUpManager followUpManager |
|||
) |
|||
{ |
|||
_followUpRepository = followUpRepository; |
|||
_cacheService = cacheService; |
|||
_followUpManager = followUpManager; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 生成危急值标记、随访记录
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/FollowUp/Create")] |
|||
public async Task CreateAsync(PatientRegisterIdInputDto input) |
|||
{ |
|||
var isFollowUp = await _followUpRepository.FirstOrDefaultAsync(f => f.PatientRegisterId == input.PatientRegisterId); |
|||
if (isFollowUp == null) |
|||
{ |
|||
var followUpEnt = new FollowUp |
|||
{ |
|||
IsPhoneComplete = 'N', |
|||
IsSmsComplete = 'N', |
|||
PatientRegisterId = input.PatientRegisterId |
|||
}; |
|||
|
|||
await _followUpRepository.InsertAsync(followUpEnt); |
|||
} |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 获取随访主表记录 可根据人员跟状态筛选
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/FollowUp/GetList")] |
|||
public async Task<List<FollowUpDto>> GetListAsync(GetFollowUpListInputDto input) |
|||
{ |
|||
var query = await _followUpRepository.GetQueryableAsync(); |
|||
if (input.PatientRegisterIds.Any()) |
|||
{ |
|||
query = query.Where(m => input.PatientRegisterIds.Contains(m.PatientRegisterId)); |
|||
} |
|||
if (input.IsPhoneComplete != null) |
|||
{ |
|||
query = query.Where(m => m.IsPhoneComplete == input.IsPhoneComplete); |
|||
} |
|||
|
|||
if (input.IsSmsComplete != null) |
|||
{ |
|||
query = query.Where(m => m.IsSmsComplete == input.IsSmsComplete); |
|||
} |
|||
|
|||
var entListDto = query.ToList().Select(s => new FollowUpDto |
|||
{ |
|||
CreationTime = s.CreationTime, |
|||
CreatorId = s.CreatorId, |
|||
Id = s.Id, |
|||
IsPhoneComplete = s.IsPhoneComplete, |
|||
IsSmsComplete = s.IsSmsComplete, |
|||
LastModificationTime = s.LastModificationTime, |
|||
LastModifierId = s.LastModifierId, |
|||
PatientRegisterId = s.PatientRegisterId, |
|||
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).GetAwaiter().GetResult(), |
|||
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).GetAwaiter().GetResult() |
|||
}).ToList(); |
|||
|
|||
return entListDto; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 删除记录
|
|||
/// </summary>
|
|||
/// <param name="input"></param>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/FollowUp/Delete")] |
|||
public async Task DeleteAsync(FollowUpIdInputDto input) |
|||
{ |
|||
await _followUpManager.CheckAndDeleteAsync(input.FollowUpId); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,39 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.Peis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
|
|||
namespace Shentun.Peis.PhoneFollowUps |
|||
{ |
|||
/// <summary>
|
|||
/// 电话随访记录
|
|||
/// </summary>
|
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
[Authorize] |
|||
public class PhoneFollowUpAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<PhoneFollowUp, Guid> _phoneFollowUpRepository; |
|||
|
|||
public PhoneFollowUpAppService(IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository) |
|||
{ |
|||
_phoneFollowUpRepository = phoneFollowUpRepository; |
|||
} |
|||
|
|||
|
|||
///// <summary>
|
|||
///// 创建电话随访记录
|
|||
///// </summary>
|
|||
///// <param name="input"></param>
|
|||
///// <returns></returns>
|
|||
//public async Task CreateAsync(CreatePhoneFollowUpDto input)
|
|||
//{
|
|||
|
|||
//}
|
|||
} |
|||
} |
|||
@ -0,0 +1,58 @@ |
|||
using Shentun.Peis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Shentun.Peis.FollowUps |
|||
{ |
|||
/// <summary>
|
|||
/// 随访主表
|
|||
/// </summary>
|
|||
public class FollowUpManager : DomainService |
|||
{ |
|||
private readonly IRepository<FollowUp, Guid> _followUpRepository; |
|||
private readonly IRepository<PhoneFollowUp, Guid> _phoneFollowUpRepository; |
|||
private readonly IRepository<SmsSend, Guid> _smsSendRepository; |
|||
public FollowUpManager( |
|||
IRepository<FollowUp, Guid> followUpRepository, |
|||
IRepository<PhoneFollowUp, Guid> phoneFollowUpRepository, |
|||
IRepository<SmsSend, Guid> smsSendRepository |
|||
) |
|||
{ |
|||
_followUpRepository = followUpRepository; |
|||
_phoneFollowUpRepository = phoneFollowUpRepository; |
|||
_smsSendRepository = smsSendRepository; |
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 删除
|
|||
/// </summary>
|
|||
/// <param name="id"></param>
|
|||
/// <returns></returns>
|
|||
/// <exception cref="UserFriendlyException"></exception>
|
|||
public async Task CheckAndDeleteAsync(Guid id) |
|||
{ |
|||
|
|||
var phoneFollowUpEnt = await _phoneFollowUpRepository.FirstOrDefaultAsync(m => m.FollowUpId == id); |
|||
if (phoneFollowUpEnt != null) |
|||
{ |
|||
throw new UserFriendlyException($"已创建电话随访记录,不能删除"); |
|||
} |
|||
|
|||
var smsSendEnt = await _smsSendRepository.FirstOrDefaultAsync(m => m.FollowUpId == id); |
|||
if (smsSendEnt != null) |
|||
{ |
|||
throw new UserFriendlyException($"已创建短信随访记录,不能删除"); |
|||
} |
|||
|
|||
await _followUpRepository.DeleteAsync(id); |
|||
|
|||
} |
|||
} |
|||
} |
|||
15637
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240919025259_update_follow_up_follow_up_date.Designer.cs
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,38 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class update_follow_up_follow_up_date : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<DateTime>( |
|||
name: "send_date", |
|||
table: "sms_send", |
|||
type: "timestamp without time zone", |
|||
nullable: true, |
|||
defaultValueSql: "(date(timezone('UTC-8'::text, now())) - 1)"); |
|||
|
|||
migrationBuilder.AddColumn<DateTime>( |
|||
name: "follow_up_date", |
|||
table: "phone_follow_up", |
|||
type: "timestamp without time zone", |
|||
nullable: false, |
|||
defaultValueSql: "(date(timezone('UTC-8'::text, now())) - 1)"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "send_date", |
|||
table: "sms_send"); |
|||
|
|||
migrationBuilder.DropColumn( |
|||
name: "follow_up_date", |
|||
table: "phone_follow_up"); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue