21 changed files with 44921 additions and 64 deletions
-
17src/Shentun.Peis.Application.Contracts/OccupationalDiseases/OccupationalDiseaseWithDetailByPatientRegisterIdDto.cs
-
266src/Shentun.Peis.Application.Contracts/OccupationalDiseases/OccupationalDiseaseWithDetailInputDto.cs
-
171src/Shentun.Peis.Application.Contracts/OccupationalDiseases/PatientOccupationalDiseaseDto.cs
-
47src/Shentun.Peis.Application.Contracts/OccupationalDiseases/PatientOccupationalHistoryDto.cs
-
11src/Shentun.Peis.Application.Contracts/OccupationalDiseases/PatientPoisonDto.cs
-
23src/Shentun.Peis.Application.Contracts/OccupationalDiseases/PatientSymptomDto.cs
-
285src/Shentun.Peis.Application/OccupationalDiseases/OccupationalDiseaseAppService.cs
-
3src/Shentun.Peis.Application/PatientRegisters/PatientRegisterAppService.cs
-
36src/Shentun.Peis.Application/PeisApplicationAutoMapperProfile.cs
-
1src/Shentun.Peis.Application/ProtectiveMeasuress/ProtectiveMeasuresAppService.cs
-
32src/Shentun.Peis.Domain/PatientOccupationalDiseases/PatientOccupationalDisease.cs
-
110src/Shentun.Peis.Domain/PatientOccupationalDiseases/PatientOccupationalDiseaseManager.cs
-
31src/Shentun.Peis.Domain/PatientPoisons/PatientPoisonManager.cs
-
2src/Shentun.Peis.Domain/ProtectiveMeasuress/ProtectiveMeasures.cs
-
14556src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521080202_init20240521004.Designer.cs
-
92src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521080202_init20240521004.cs
-
14559src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521092759_init20240521005.Designer.cs
-
27src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521092759_init20240521005.cs
-
14560src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521100809_init20240521006.Designer.cs
-
35src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521100809_init20240521006.cs
-
121src/Shentun.Peis.EntityFrameworkCore/Migrations/PeisDbContextModelSnapshot.cs
@ -0,0 +1,17 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
public class OccupationalDiseaseWithDetailByPatientRegisterIdDto |
|||
{ |
|||
public PatientOccupationalDiseaseDto PatientOccupationalDisease { get; set; } |
|||
|
|||
public List<PatientPoisonDto> PatientPoisonDtos { get; set; } |
|||
|
|||
public List<PatientSymptomDto> PatientSymptomDtos { get; set; } |
|||
|
|||
public List<PatientOccupationalHistoryDto> PatientOccupationalHistoryDtos { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,266 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
/// <summary>
|
|||
///职业病信息
|
|||
/// </summary>
|
|||
public class OccupationalDiseaseWithDetailInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 人员ID
|
|||
/// </summary>
|
|||
public Guid PatientRegisterId { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 基础信息
|
|||
/// </summary>
|
|||
public PatientOccupationalDiseaseInputDto PatientOccupationalDisease { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 毒害因素
|
|||
/// </summary>
|
|||
public List<PatientPoisonInputDto> PatientPoisons { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 职业史
|
|||
/// </summary>
|
|||
public List<PatientOccupationalHistoryInputDto> PatientOccupationalHistorys { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 症状
|
|||
/// </summary>
|
|||
public List<PatientSymptomInputDto> PatientSymptoms { get; set; } |
|||
} |
|||
|
|||
public class PatientOccupationalDiseaseInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 职业病检查类别
|
|||
/// </summary>
|
|||
public Guid OcCheckTypeId { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 工种
|
|||
/// </summary>
|
|||
public string JobType { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 总工龄
|
|||
/// </summary>
|
|||
public string TotalWorkTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 接害工龄
|
|||
/// </summary>
|
|||
public string PoisonWorkTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 既往病史
|
|||
/// </summary>
|
|||
public string PreviousHistory { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 病名
|
|||
/// </summary>
|
|||
public string OccupationalDisease { get; set; } |
|||
/// <summary>
|
|||
/// 诊断日期
|
|||
/// </summary>
|
|||
public DateTime? DiagnosisDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 诊断单位
|
|||
/// </summary>
|
|||
public string DiagnosisHospital { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否恢复
|
|||
/// </summary>
|
|||
public char? IsRecovery { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 末次月经日期
|
|||
/// </summary>
|
|||
public DateTime? LastMenstrualPeriodDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 初潮多少岁
|
|||
/// </summary>
|
|||
public int? FirstMenstruation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 经期多少天
|
|||
/// </summary>
|
|||
public int? MenstruationTimeLength { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 周期多少天
|
|||
/// </summary>
|
|||
public int? MenstruationCycle { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 停经多少岁
|
|||
/// </summary>
|
|||
public int? MenstruationEndAge { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 经期
|
|||
/// </summary>
|
|||
public char? MenstruationFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 现有子女人数
|
|||
/// </summary>
|
|||
public int? ChildrenNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 流产次数
|
|||
/// </summary>
|
|||
public int? AbortionTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 早产次数
|
|||
/// </summary>
|
|||
public int? PrematureBirthTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 死产次数
|
|||
/// </summary>
|
|||
public int? StillbirthTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 异常胎次数
|
|||
/// </summary>
|
|||
public int? AbnormalTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 抽烟史
|
|||
/// </summary>
|
|||
public char? SmokeFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 每天多少支
|
|||
/// </summary>
|
|||
public int? SmokeNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 抽烟年限
|
|||
/// </summary>
|
|||
public int? SmokeYears { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 饮酒史
|
|||
/// </summary>
|
|||
public char? DrinkFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 每次多少ml
|
|||
/// </summary>
|
|||
public int? DrinkNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 饮酒年限
|
|||
/// </summary>
|
|||
public int? DrinkYears { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 其他
|
|||
/// </summary>
|
|||
public string Other { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 职业性异常
|
|||
/// </summary>
|
|||
public string OccupationalAbnormal { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 非职业性异常
|
|||
/// </summary>
|
|||
public string NoOccupationalAbnormal { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 职业性异常建议
|
|||
/// </summary>
|
|||
public string OccupationalAbSuggestion { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 非职业性异常建议
|
|||
/// </summary>
|
|||
public string NoOccupAbSuggestion { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 处理意见
|
|||
/// </summary>
|
|||
public string HandleSuggestion { get; set; } |
|||
} |
|||
|
|||
public class PatientPoisonInputDto |
|||
{ |
|||
/// <summary>
|
|||
/// 毒害因素ID
|
|||
/// </summary>
|
|||
public Guid PoisonId { get; set; } |
|||
} |
|||
|
|||
public class PatientOccupationalHistoryInputDto |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 单位
|
|||
/// </summary>
|
|||
public string Org { get; set; } |
|||
/// <summary>
|
|||
/// 开始日期
|
|||
/// </summary>
|
|||
public DateTime? BeginDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结束日期
|
|||
/// </summary>
|
|||
public DateTime? EndDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 车间
|
|||
/// </summary>
|
|||
public string WorkShop { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工种
|
|||
/// </summary>
|
|||
public string WorkType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 毒害因素
|
|||
/// </summary>
|
|||
public string Poison { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 防护措施
|
|||
/// </summary>
|
|||
public string ProtectiveMeasures { get; set; } |
|||
} |
|||
|
|||
public class PatientSymptomInputDto |
|||
{ |
|||
|
|||
public Guid SymptomId { get; set; } |
|||
/// <summary>
|
|||
/// 程度
|
|||
/// </summary>
|
|||
|
|||
public string Degree { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 时间
|
|||
/// </summary>
|
|||
public string TimeLength { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,171 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
public class PatientOccupationalDiseaseDto : AuditedEntityDtoName |
|||
{ |
|||
/// <summary>
|
|||
/// 职业病检查类别
|
|||
/// </summary>
|
|||
public Guid OcCheckTypeId { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 工种
|
|||
/// </summary>
|
|||
public string JobType { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 总工龄
|
|||
/// </summary>
|
|||
public string TotalWorkTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 接害工龄
|
|||
/// </summary>
|
|||
public string PoisonWorkTime { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 既往病史
|
|||
/// </summary>
|
|||
public string PreviousHistory { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 病名
|
|||
/// </summary>
|
|||
public string OccupationalDisease { get; set; } |
|||
/// <summary>
|
|||
/// 诊断日期
|
|||
/// </summary>
|
|||
public DateTime? DiagnosisDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 诊断单位
|
|||
/// </summary>
|
|||
public string DiagnosisHospital { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 是否恢复
|
|||
/// </summary>
|
|||
public char? IsRecovery { get; set; } |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 末次月经日期
|
|||
/// </summary>
|
|||
public DateTime? LastMenstrualPeriodDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 初潮多少岁
|
|||
/// </summary>
|
|||
public int? FirstMenstruation { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 经期多少天
|
|||
/// </summary>
|
|||
public int? MenstruationTimeLength { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 周期多少天
|
|||
/// </summary>
|
|||
public int? MenstruationCycle { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 停经多少岁
|
|||
/// </summary>
|
|||
public int? MenstruationEndAge { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 经期
|
|||
/// </summary>
|
|||
public char? MenstruationFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 现有子女人数
|
|||
/// </summary>
|
|||
public int? ChildrenNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 流产次数
|
|||
/// </summary>
|
|||
public int? AbortionTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 早产次数
|
|||
/// </summary>
|
|||
public int? PrematureBirthTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 死产次数
|
|||
/// </summary>
|
|||
public int? StillbirthTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 异常胎次数
|
|||
/// </summary>
|
|||
public int? AbnormalTimes { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 抽烟史
|
|||
/// </summary>
|
|||
public char? SmokeFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 每天多少支
|
|||
/// </summary>
|
|||
public int? SmokeNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 抽烟年限
|
|||
/// </summary>
|
|||
public int? SmokeYears { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 饮酒史
|
|||
/// </summary>
|
|||
public char? DrinkFlag { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 每次多少ml
|
|||
/// </summary>
|
|||
public int? DrinkNum { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 饮酒年限
|
|||
/// </summary>
|
|||
public int? DrinkYears { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 其他
|
|||
/// </summary>
|
|||
public string Other { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 职业性异常
|
|||
/// </summary>
|
|||
public string OccupationalAbnormal { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 非职业性异常
|
|||
/// </summary>
|
|||
public string NoOccupationalAbnormal { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 职业性异常建议
|
|||
/// </summary>
|
|||
public string OccupationalAbSuggestion { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 非职业性异常建议
|
|||
/// </summary>
|
|||
public string NoOccupAbSuggestion { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 处理意见
|
|||
/// </summary>
|
|||
public string HandleSuggestion { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,47 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
public class PatientOccupationalHistoryDto : AuditedEntityDtoName |
|||
{ |
|||
|
|||
/// <summary>
|
|||
/// 单位
|
|||
/// </summary>
|
|||
public string Org { get; set; } |
|||
/// <summary>
|
|||
/// 开始日期
|
|||
/// </summary>
|
|||
public DateTime? BeginDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 结束日期
|
|||
/// </summary>
|
|||
[Column("end_date")] |
|||
public DateTime? EndDate { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 车间
|
|||
/// </summary>
|
|||
public string WorkShop { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 工种
|
|||
/// </summary>
|
|||
public string WorkType { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 毒害因素
|
|||
/// </summary>
|
|||
public string Poison { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 防护措施
|
|||
/// </summary>
|
|||
public string ProtectiveMeasures { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,11 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
public class PatientPoisonDto: AuditedEntityDtoNameNoGuid |
|||
{ |
|||
public Guid PoisonId { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.ComponentModel.DataAnnotations.Schema; |
|||
using System.ComponentModel.DataAnnotations; |
|||
using System.Text; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
public class PatientSymptomDto: AuditedEntityDtoNameNoGuid |
|||
{ |
|||
|
|||
public Guid SymptomId { get; set; } |
|||
/// <summary>
|
|||
/// 程度
|
|||
/// </summary>
|
|||
public string Degree { get; set; } |
|||
|
|||
/// <summary>
|
|||
/// 时间
|
|||
/// </summary>
|
|||
public string TimeLength { get; set; } |
|||
} |
|||
} |
|||
@ -0,0 +1,285 @@ |
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Microsoft.AspNetCore.Mvc; |
|||
using Shentun.Peis.Models; |
|||
using Shentun.Peis.OcCheckTypes; |
|||
using Shentun.Peis.PatientOccupationalDiseases; |
|||
using Shentun.Peis.PatientRegisters; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp; |
|||
using Volo.Abp.Application.Services; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.ObjectMapping; |
|||
|
|||
namespace Shentun.Peis.OccupationalDiseases |
|||
{ |
|||
/// <summary>
|
|||
/// 职业病业务
|
|||
/// </summary>
|
|||
[ApiExplorerSettings(GroupName = "Work")] |
|||
[Authorize] |
|||
public class OccupationalDiseaseAppService : ApplicationService |
|||
{ |
|||
private readonly IRepository<PatientOccupationalDisease, Guid> _patientOccupationalDiseaseRepository; |
|||
private readonly IRepository<PatientOccupationalHistory, Guid> _patientOccupationalHistoryRepository; |
|||
private readonly IRepository<PatientPoison> _patientPoisonRepository; |
|||
private readonly IRepository<PatientSymptom> _patientSymptomRepository; |
|||
private readonly PatientOccupationalDiseaseManager _patientOccupationalDiseaseManager; |
|||
private readonly CacheService _cacheService; |
|||
public OccupationalDiseaseAppService( |
|||
IRepository<PatientOccupationalDisease, Guid> patientOccupationalDiseaseRepository, |
|||
IRepository<PatientOccupationalHistory, Guid> patientOccupationalHistoryRepository, |
|||
IRepository<PatientPoison> patientPoisonRepository, |
|||
IRepository<PatientSymptom> patientSymptomRepository, |
|||
PatientOccupationalDiseaseManager patientOccupationalDiseaseManager, |
|||
CacheService cacheService) |
|||
{ |
|||
_patientOccupationalDiseaseRepository = patientOccupationalDiseaseRepository; |
|||
_patientOccupationalHistoryRepository = patientOccupationalHistoryRepository; |
|||
_patientPoisonRepository = patientPoisonRepository; |
|||
_patientSymptomRepository = patientSymptomRepository; |
|||
_patientOccupationalDiseaseManager = patientOccupationalDiseaseManager; |
|||
_cacheService = cacheService; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建职业病信息
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/OccupationalDisease/CreateOccupationalDiseaseWithDetail")] |
|||
public async Task CreateOccupationalDiseaseWithDetailAsync(OccupationalDiseaseWithDetailInputDto input) |
|||
{ |
|||
if (input == null) |
|||
{ |
|||
throw new UserFriendlyException("请求参数有误"); |
|||
} |
|||
|
|||
if (input.PatientRegisterId == Guid.Empty) |
|||
throw new UserFriendlyException("人员ID不正确"); |
|||
|
|||
#region 基础信息
|
|||
if (input.PatientOccupationalDisease == null) |
|||
throw new UserFriendlyException("职业病基础信息有误"); |
|||
|
|||
var patientOccupationalDiseaseInput = ObjectMapper.Map<PatientOccupationalDiseaseInputDto, PatientOccupationalDisease>(input.PatientOccupationalDisease); |
|||
|
|||
var patientOccupationalDiseaseEnt = await _patientOccupationalDiseaseRepository.FirstOrDefaultAsync(f => f.PatientRegisterId == input.PatientRegisterId); |
|||
if (patientOccupationalDiseaseEnt == null) |
|||
{ |
|||
var entity = _patientOccupationalDiseaseManager.CreateAsync(patientOccupationalDiseaseInput); |
|||
await _patientOccupationalDiseaseRepository.InsertAsync(entity); |
|||
} |
|||
else |
|||
{ |
|||
_patientOccupationalDiseaseManager.UpdateAsync(patientOccupationalDiseaseEnt, patientOccupationalDiseaseInput); |
|||
await _patientOccupationalDiseaseRepository.UpdateAsync(patientOccupationalDiseaseEnt); |
|||
} |
|||
#endregion
|
|||
|
|||
#region 毒害因素
|
|||
|
|||
var patientPoisonsInput = ObjectMapper.Map<List<PatientPoisonInputDto>, List<PatientPoison>>(input.PatientPoisons); |
|||
await _patientPoisonRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId); |
|||
List<PatientPoison> patientPoisonList = new List<PatientPoison>(); |
|||
foreach (var item in patientPoisonsInput) |
|||
{ |
|||
patientPoisonList.Add(new PatientPoison |
|||
{ |
|||
PatientRegisterId = input.PatientRegisterId, |
|||
PoisonId = item.PoisonId |
|||
}); |
|||
} |
|||
|
|||
await _patientPoisonRepository.InsertManyAsync(patientPoisonList); |
|||
#endregion
|
|||
|
|||
#region 症状
|
|||
|
|||
var patientSymptomsInput = ObjectMapper.Map<List<PatientSymptomInputDto>, List<PatientSymptom>>(input.PatientSymptoms); |
|||
await _patientSymptomRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId); |
|||
List<PatientSymptom> patientSymptomList = new List<PatientSymptom>(); |
|||
foreach (var item in patientSymptomsInput) |
|||
{ |
|||
patientSymptomList.Add(new PatientSymptom |
|||
{ |
|||
PatientRegisterId = input.PatientRegisterId, |
|||
Degree = item.Degree, |
|||
SymptomId = item.SymptomId, |
|||
TimeLength = item.TimeLength |
|||
}); |
|||
} |
|||
|
|||
await _patientSymptomRepository.InsertManyAsync(patientSymptomList); |
|||
|
|||
#endregion
|
|||
|
|||
#region 职业史
|
|||
|
|||
var patientOccupationalHistorysInput = ObjectMapper.Map<List<PatientOccupationalHistoryInputDto>, List<PatientOccupationalHistory>>(input.PatientOccupationalHistorys); |
|||
await _patientOccupationalHistoryRepository.DeleteAsync(d => d.PatientRegisterId == input.PatientRegisterId); |
|||
List<PatientOccupationalHistory> patientOccupationalHistoryList = new List<PatientOccupationalHistory>(); |
|||
foreach (var item in patientOccupationalHistorysInput) |
|||
{ |
|||
patientOccupationalHistoryList.Add(new PatientOccupationalHistory |
|||
{ |
|||
PatientRegisterId = input.PatientRegisterId, |
|||
BeginDate = item.BeginDate, |
|||
EndDate = item.EndDate, |
|||
Org = item.Org, |
|||
Poison = item.Poison, |
|||
ProtectiveMeasures = item.ProtectiveMeasures, |
|||
WorkShop = item.WorkShop, |
|||
WorkType = item.WorkType |
|||
}); |
|||
} |
|||
|
|||
await _patientOccupationalHistoryRepository.InsertManyAsync(patientOccupationalHistoryList); |
|||
|
|||
#endregion
|
|||
} |
|||
|
|||
|
|||
/// <summary>
|
|||
/// 获取职业病信息 根据人员登记ID
|
|||
/// </summary>
|
|||
/// <returns></returns>
|
|||
[HttpPost("api/app/OccupationalDisease/GetOccupationalDiseaseWithDetailByPatientRegisterId")] |
|||
public async Task<OccupationalDiseaseWithDetailByPatientRegisterIdDto> GetOccupationalDiseaseWithDetailByPatientRegisterIdAsync(PatientRegisterIdInputDto input) |
|||
{ |
|||
if (input == null) |
|||
{ |
|||
throw new UserFriendlyException("请求参数有误"); |
|||
} |
|||
|
|||
if (input.PatientRegisterId == Guid.Empty) |
|||
throw new UserFriendlyException("人员ID不正确"); |
|||
|
|||
var result = new OccupationalDiseaseWithDetailByPatientRegisterIdDto(); |
|||
|
|||
#region 基础信息
|
|||
|
|||
var patientOccupationalDiseaseEnt = await _patientOccupationalDiseaseRepository.FirstOrDefaultAsync(f => f.PatientRegisterId == input.PatientRegisterId); |
|||
if (patientOccupationalDiseaseEnt == null) |
|||
{ |
|||
result.PatientOccupationalDisease = new PatientOccupationalDiseaseDto |
|||
{ |
|||
IsRecovery = patientOccupationalDiseaseEnt.IsRecovery, |
|||
AbnormalTimes = patientOccupationalDiseaseEnt.AbnormalTimes, |
|||
AbortionTimes = patientOccupationalDiseaseEnt.AbortionTimes, |
|||
ChildrenNum = patientOccupationalDiseaseEnt.ChildrenNum, |
|||
CreationTime = patientOccupationalDiseaseEnt.CreationTime, |
|||
CreatorId = patientOccupationalDiseaseEnt.CreatorId, |
|||
DiagnosisDate = patientOccupationalDiseaseEnt.DiagnosisDate, |
|||
DiagnosisHospital = patientOccupationalDiseaseEnt.DiagnosisHospital, |
|||
DrinkFlag = patientOccupationalDiseaseEnt.DrinkFlag, |
|||
DrinkNum = patientOccupationalDiseaseEnt.DrinkNum, |
|||
DrinkYears = patientOccupationalDiseaseEnt.DrinkYears, |
|||
FirstMenstruation = patientOccupationalDiseaseEnt.FirstMenstruation, |
|||
HandleSuggestion = patientOccupationalDiseaseEnt.HandleSuggestion, |
|||
Id = patientOccupationalDiseaseEnt.Id, |
|||
JobType = patientOccupationalDiseaseEnt.JobType, |
|||
LastMenstrualPeriodDate = patientOccupationalDiseaseEnt.LastMenstrualPeriodDate, |
|||
LastModificationTime = patientOccupationalDiseaseEnt.LastModificationTime, |
|||
LastModifierId = patientOccupationalDiseaseEnt.LastModifierId, |
|||
MenstruationCycle = patientOccupationalDiseaseEnt.MenstruationCycle, |
|||
MenstruationEndAge = patientOccupationalDiseaseEnt.MenstruationEndAge, |
|||
MenstruationFlag = patientOccupationalDiseaseEnt.MenstruationFlag, |
|||
MenstruationTimeLength = patientOccupationalDiseaseEnt.MenstruationTimeLength, |
|||
NoOccupAbSuggestion = patientOccupationalDiseaseEnt.NoOccupAbSuggestion, |
|||
NoOccupationalAbnormal = patientOccupationalDiseaseEnt.NoOccupationalAbnormal, |
|||
OcCheckTypeId = patientOccupationalDiseaseEnt.OcCheckTypeId, |
|||
OccupationalAbnormal = patientOccupationalDiseaseEnt.OccupationalAbnormal, |
|||
OccupationalAbSuggestion = patientOccupationalDiseaseEnt.OccupationalAbSuggestion, |
|||
OccupationalDisease = patientOccupationalDiseaseEnt.OccupationalDisease, |
|||
Other = patientOccupationalDiseaseEnt.Other, |
|||
PoisonWorkTime = patientOccupationalDiseaseEnt.PoisonWorkTime, |
|||
PrematureBirthTimes = patientOccupationalDiseaseEnt.PrematureBirthTimes, |
|||
PreviousHistory = patientOccupationalDiseaseEnt.PreviousHistory, |
|||
SmokeFlag = patientOccupationalDiseaseEnt.SmokeFlag, |
|||
SmokeNum = patientOccupationalDiseaseEnt.SmokeNum, |
|||
SmokeYears = patientOccupationalDiseaseEnt.SmokeYears, |
|||
StillbirthTimes = patientOccupationalDiseaseEnt.StillbirthTimes, |
|||
TotalWorkTime = patientOccupationalDiseaseEnt.TotalWorkTime, |
|||
CreatorName = _cacheService.GetSurnameAsync(patientOccupationalDiseaseEnt.CreatorId).Result, |
|||
LastModifierName = _cacheService.GetSurnameAsync(patientOccupationalDiseaseEnt.LastModifierId).Result |
|||
}; |
|||
} |
|||
|
|||
#endregion
|
|||
|
|||
#region 毒害因素
|
|||
|
|||
List<PatientPoisonDto> patientPoisonDtos = new List<PatientPoisonDto>(); |
|||
var patientPoisonList = await _patientPoisonRepository.GetListAsync(d => d.PatientRegisterId == input.PatientRegisterId); |
|||
|
|||
patientPoisonDtos = patientPoisonList.Select(s => new PatientPoisonDto |
|||
{ |
|||
PoisonId = s.PoisonId, |
|||
CreationTime = s.CreationTime, |
|||
CreatorId = s.CreatorId, |
|||
LastModificationTime = s.LastModificationTime, |
|||
LastModifierId = s.LastModifierId, |
|||
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result, |
|||
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result |
|||
}).ToList(); |
|||
|
|||
result.PatientPoisonDtos = patientPoisonDtos; |
|||
|
|||
#endregion
|
|||
|
|||
#region 症状
|
|||
|
|||
var patientSymptomList = await _patientSymptomRepository.GetListAsync(m => m.PatientRegisterId == input.PatientRegisterId); |
|||
|
|||
List<PatientSymptomDto> patientSymptomDtos = patientSymptomList.Select(s => new PatientSymptomDto |
|||
{ |
|||
Degree = s.Degree, |
|||
SymptomId = s.SymptomId, |
|||
TimeLength = s.TimeLength, |
|||
CreationTime = s.CreationTime, |
|||
CreatorId = s.CreatorId, |
|||
LastModificationTime = s.LastModificationTime, |
|||
LastModifierId = s.LastModifierId, |
|||
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result, |
|||
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result |
|||
}).ToList(); |
|||
|
|||
result.PatientSymptomDtos = patientSymptomDtos; |
|||
|
|||
#endregion
|
|||
|
|||
#region 职业史
|
|||
|
|||
|
|||
var patientOccupationalHistoryList = await _patientOccupationalHistoryRepository.GetListAsync(d => d.PatientRegisterId == input.PatientRegisterId); |
|||
|
|||
List<PatientOccupationalHistoryDto> patientOccupationalHistoryDtos = patientOccupationalHistoryList.Select(s => new PatientOccupationalHistoryDto |
|||
{ |
|||
BeginDate = s.BeginDate, |
|||
EndDate = s.EndDate, |
|||
Org = s.Org, |
|||
Poison = s.Poison, |
|||
ProtectiveMeasures = s.ProtectiveMeasures, |
|||
WorkShop = s.WorkShop, |
|||
WorkType = s.WorkType, |
|||
CreationTime = s.CreationTime, |
|||
CreatorId = s.CreatorId, |
|||
Id = s.Id, |
|||
LastModifierId = s.LastModifierId, |
|||
LastModificationTime = s.LastModificationTime, |
|||
CreatorName = _cacheService.GetSurnameAsync(s.CreatorId).Result, |
|||
LastModifierName = _cacheService.GetSurnameAsync(s.LastModifierId).Result |
|||
}).ToList(); |
|||
|
|||
result.PatientOccupationalHistoryDtos = patientOccupationalHistoryDtos; |
|||
|
|||
#endregion
|
|||
|
|||
|
|||
return result; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,110 @@ |
|||
using Shentun.Peis.Diagnosises; |
|||
using Shentun.Peis.Models; |
|||
using Shentun.Utilities; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Entities; |
|||
using Volo.Abp.Domain.Repositories; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Shentun.Peis.PatientOccupationalDiseases |
|||
{ |
|||
public class PatientOccupationalDiseaseManager : DomainService |
|||
{ |
|||
public PatientOccupationalDiseaseManager() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
/// <returns></returns>
|
|||
public PatientOccupationalDisease CreateAsync(PatientOccupationalDisease entity) |
|||
{ |
|||
return new PatientOccupationalDisease(GuidGenerator.Create()) |
|||
{ |
|||
AbnormalTimes = entity.AbnormalTimes, |
|||
AbortionTimes = entity.AbortionTimes, |
|||
ChildrenNum = entity.ChildrenNum, |
|||
DiagnosisDate = entity.DiagnosisDate, |
|||
DiagnosisHospital = entity.DiagnosisHospital, |
|||
DrinkFlag = entity.DrinkFlag, |
|||
DrinkNum = entity.DrinkNum, |
|||
DrinkYears = entity.DrinkYears, |
|||
FirstMenstruation = entity.FirstMenstruation, |
|||
JobType = entity.JobType, |
|||
MenstruationCycle = entity.MenstruationCycle, |
|||
MenstruationEndAge = entity.MenstruationEndAge, |
|||
MenstruationFlag = entity.MenstruationFlag, |
|||
MenstruationTimeLength = entity.MenstruationTimeLength, |
|||
//OccupationalAbnormal = entity.OccupationalAbnormal,
|
|||
//OccupationalAbSuggestion = entity.OccupationalAbSuggestion,
|
|||
//NoOccupAbSuggestion = entity.NoOccupAbSuggestion,
|
|||
//NoOccupationalAbnormal = entity.NoOccupationalAbnormal,
|
|||
// HandleSuggestion = entity.HandleSuggestion,
|
|||
LastMenstrualPeriodDate = entity.LastMenstrualPeriodDate, |
|||
OcCheckTypeId = entity.OcCheckTypeId, |
|||
OccupationalDisease = entity.OccupationalDisease, |
|||
Other = entity.Other, |
|||
PoisonWorkTime = entity.PoisonWorkTime, |
|||
PrematureBirthTimes = entity.PrematureBirthTimes, |
|||
PreviousHistory = entity.PreviousHistory, |
|||
IsRecovery = entity.IsRecovery, |
|||
SmokeFlag = entity.SmokeFlag, |
|||
SmokeNum = entity.SmokeNum, |
|||
SmokeYears = entity.SmokeYears, |
|||
StillbirthTimes = entity.StillbirthTimes, |
|||
TotalWorkTime = entity.TotalWorkTime |
|||
}; |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 更新
|
|||
/// </summary>
|
|||
/// <param name="sourceEntity"></param>
|
|||
/// <param name="targetEntity"></param>
|
|||
/// <returns></returns>
|
|||
public void UpdateAsync( |
|||
PatientOccupationalDisease sourceEntity, |
|||
PatientOccupationalDisease targetEntity |
|||
) |
|||
{ |
|||
targetEntity.AbnormalTimes = sourceEntity.AbnormalTimes; |
|||
targetEntity.AbortionTimes = sourceEntity.AbortionTimes; |
|||
targetEntity.ChildrenNum = sourceEntity.ChildrenNum; |
|||
targetEntity.DiagnosisDate = sourceEntity.DiagnosisDate; |
|||
targetEntity.DiagnosisHospital = sourceEntity.DiagnosisHospital; |
|||
targetEntity.DrinkFlag = sourceEntity.DrinkFlag; |
|||
targetEntity.DrinkNum = sourceEntity.DrinkNum; |
|||
targetEntity.DrinkYears = sourceEntity.DrinkYears; |
|||
targetEntity.FirstMenstruation = sourceEntity.FirstMenstruation; |
|||
targetEntity.JobType = sourceEntity.JobType; |
|||
targetEntity.MenstruationCycle = sourceEntity.MenstruationCycle; |
|||
targetEntity.MenstruationEndAge = sourceEntity.MenstruationEndAge; |
|||
targetEntity.MenstruationFlag = sourceEntity.MenstruationFlag; |
|||
targetEntity.MenstruationTimeLength = sourceEntity.MenstruationTimeLength; |
|||
targetEntity.LastMenstrualPeriodDate = sourceEntity.LastMenstrualPeriodDate; |
|||
targetEntity.OcCheckTypeId = sourceEntity.OcCheckTypeId; |
|||
//targetEntity.NoOccupAbSuggestion = sourceEntity.NoOccupAbSuggestion;
|
|||
//targetEntity.NoOccupationalAbnormal = sourceEntity.NoOccupationalAbnormal;
|
|||
//targetEntity.OccupationalAbnormal = sourceEntity.OccupationalAbnormal;
|
|||
//targetEntity.OccupationalAbSuggestion = sourceEntity.OccupationalAbSuggestion;
|
|||
//targetEntity.HandleSuggestion = sourceEntity.HandleSuggestion;
|
|||
targetEntity.OccupationalDisease = sourceEntity.OccupationalDisease; |
|||
targetEntity.Other = sourceEntity.Other; |
|||
targetEntity.PoisonWorkTime = sourceEntity.PoisonWorkTime; |
|||
targetEntity.PrematureBirthTimes = sourceEntity.PrematureBirthTimes; |
|||
targetEntity.PreviousHistory = sourceEntity.PreviousHistory; |
|||
targetEntity.IsRecovery = sourceEntity.IsRecovery; |
|||
targetEntity.SmokeFlag = sourceEntity.SmokeFlag; |
|||
targetEntity.SmokeNum = sourceEntity.SmokeNum; |
|||
targetEntity.SmokeYears = sourceEntity.SmokeYears; |
|||
targetEntity.StillbirthTimes = sourceEntity.StillbirthTimes; |
|||
targetEntity.TotalWorkTime = sourceEntity.TotalWorkTime; |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,31 @@ |
|||
using Shentun.Peis.Models; |
|||
using System; |
|||
using System.Collections.Generic; |
|||
using System.Linq; |
|||
using System.Text; |
|||
using System.Threading.Tasks; |
|||
using Volo.Abp.Domain.Services; |
|||
|
|||
namespace Shentun.Peis.PatientPoisons |
|||
{ |
|||
public class PatientPoisonManager : DomainService |
|||
{ |
|||
public PatientPoisonManager() |
|||
{ |
|||
} |
|||
|
|||
/// <summary>
|
|||
/// 创建
|
|||
/// </summary>
|
|||
/// <param name="entity"></param>
|
|||
/// <returns></returns>
|
|||
public PatientPoison CreateAsync(PatientPoison entity) |
|||
{ |
|||
return new PatientPoison |
|||
{ |
|||
PatientRegisterId = entity.PatientRegisterId, |
|||
PoisonId = entity.PoisonId |
|||
}; |
|||
} |
|||
} |
|||
} |
|||
14556
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521080202_init20240521004.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,92 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class init20240521004 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "total_work_time", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(6)", |
|||
oldMaxLength: 6, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "previous_history", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(100)", |
|||
maxLength: 100, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "poison_work_time", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(6)", |
|||
oldMaxLength: 6, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AddColumn<string>( |
|||
name: "job_type", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(50)", |
|||
maxLength: 50, |
|||
nullable: true); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "job_type", |
|||
table: "patient_occupational_disease"); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "total_work_time", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(6)", |
|||
maxLength: 6, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "previous_history", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(50)", |
|||
maxLength: 50, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(100)", |
|||
oldMaxLength: 100, |
|||
oldNullable: true); |
|||
|
|||
migrationBuilder.AlterColumn<string>( |
|||
name: "poison_work_time", |
|||
table: "patient_occupational_disease", |
|||
type: "character varying(6)", |
|||
maxLength: 6, |
|||
nullable: true, |
|||
oldClrType: typeof(string), |
|||
oldType: "character varying(50)", |
|||
oldMaxLength: 50, |
|||
oldNullable: true); |
|||
} |
|||
} |
|||
} |
|||
14559
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521092759_init20240521005.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,27 @@ |
|||
using System; |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class init20240521005 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.AddColumn<Guid>( |
|||
name: "PatientRegisterId", |
|||
table: "patient_occupational_disease", |
|||
type: "uuid", |
|||
nullable: false, |
|||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.DropColumn( |
|||
name: "PatientRegisterId", |
|||
table: "patient_occupational_disease"); |
|||
} |
|||
} |
|||
} |
|||
14560
src/Shentun.Peis.EntityFrameworkCore/Migrations/20240521100809_init20240521006.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,35 @@ |
|||
using Microsoft.EntityFrameworkCore.Migrations; |
|||
|
|||
#nullable disable |
|||
|
|||
namespace Shentun.Peis.Migrations |
|||
{ |
|||
public partial class init20240521006 : Migration |
|||
{ |
|||
protected override void Up(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.RenameColumn( |
|||
name: "PatientRegisterId", |
|||
table: "patient_occupational_disease", |
|||
newName: "patient_register_id"); |
|||
|
|||
migrationBuilder.RenameColumn( |
|||
name: "recovery", |
|||
table: "patient_occupational_disease", |
|||
newName: "is_recovery"); |
|||
} |
|||
|
|||
protected override void Down(MigrationBuilder migrationBuilder) |
|||
{ |
|||
migrationBuilder.RenameColumn( |
|||
name: "patient_register_id", |
|||
table: "patient_occupational_disease", |
|||
newName: "PatientRegisterId"); |
|||
|
|||
migrationBuilder.RenameColumn( |
|||
name: "is_recovery", |
|||
table: "patient_occupational_disease", |
|||
newName: "recovery"); |
|||
} |
|||
} |
|||
} |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue