任务记录

This commit is contained in:
zhangheng 2024-03-26 17:45:29 +08:00
parent d646a62680
commit 521830bb88
13 changed files with 164 additions and 95 deletions

View File

@ -0,0 +1,67 @@
package com.xinelu.common.utils;
import com.xinelu.common.exception.ServiceException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.Calendar;
import java.util.GregorianCalendar;
/**
* @author ljh
* @version 1.0
* Create by 2023/2/27 11:45
*/
public class AgeUtil {
/**
* 根据出生日期计算年龄数值
*
* @param date 出生日期
* @return 年龄数值
*/
public static Long getAgeMonth(String date) {
if (StringUtils.isBlank(date)) {
throw new ServiceException("请输入正确的出生日期!");
}
String[] data = StringUtils.split(date, "-");
if (data.length < 3) {
throw new ServiceException("请输入正确的出生日期!");
}
Calendar birthday = new GregorianCalendar(Integer.parseInt(data[0]), Integer.parseInt(data[1]), Integer.parseInt(data[2]));
Calendar now = Calendar.getInstance();
int day = now.get(Calendar.DAY_OF_MONTH) - birthday.get(Calendar.DAY_OF_MONTH);
//月份从0开始计算所以需要+1
int month = now.get(Calendar.MONTH) + 1 - birthday.get(Calendar.MONTH);
BigDecimal monthFraction;
int year = now.get(Calendar.YEAR) - birthday.get(Calendar.YEAR);
//按照减法原理先day相减不够向month借然后month相减不够向year借最后year相减
if (day < 0) {
month -= 1;
//得到上一个月用来得到上个月的天数
now.add(Calendar.MONTH, -1);
}
if (month < 0) {
//当前月份加12个月
monthFraction = BigDecimal.valueOf(month).add(BigDecimal.valueOf(12)).divide(BigDecimal.valueOf(12), 1, RoundingMode.HALF_UP);
year--;
} else {
//当前月份
monthFraction = BigDecimal.valueOf(month).divide(BigDecimal.valueOf(12), 1, RoundingMode.HALF_UP);
}
BigDecimal bigDecimal = BigDecimal.ZERO;
if (year >= 0) {
bigDecimal = bigDecimal.add(BigDecimal.valueOf(year));
}
if ((monthFraction.compareTo(BigDecimal.ZERO) > 0)) {
bigDecimal = bigDecimal.add(monthFraction);
}
//今天出生
if (year == 0 && month == 0 && day == 0) {
return BigDecimal.ZERO.longValue();
}
return Math.round(bigDecimal.doubleValue());
}
}

View File

@ -59,7 +59,7 @@ public class AgencyController extends BaseController {
if (Objects.isNull(agency) || Objects.isNull(agency.getParentId())) {
return AjaxResult.success();
}
return agencyService.subordinateAgencyList(agency);
return agencyService.selectAgencyByIdList(agency);
}
/**

View File

@ -76,4 +76,12 @@ public class PatientTaskExecuteRecordController extends BaseController {
public AjaxResult remove(@PathVariable Long[] ids) {
return toAjax(patientTaskExecuteRecordService.deletePatientTaskExecuteRecordByIds(ids));
}
/**
* 根据患者信息查询就诊记录
*/
@GetMapping("/selectVisitRecord")
public AjaxResult selectVisitRecord(Long id) {
return patientTaskExecuteRecordService.selectVisitRecord(id);
}
}

View File

@ -38,6 +38,11 @@ public class TaskStatusDictController extends BaseController {
return getDataTable(list);
}
@GetMapping("/taskStatusDictList")
public AjaxResult taskStatusDictList(TaskStatusDict taskStatusDict) {
return AjaxResult.success(taskStatusDictService.selectTaskStatusDictList(taskStatusDict));
}
/**
* 导出任务状态字典列表
*/

View File

@ -112,6 +112,9 @@ public class PatientTaskExecuteRecord extends BaseEntity {
@Excel(name = "备注信息")
private String executeRemark;
@ApiModelProperty(value = "患者就诊记录基本信息表id")
@Excel(name = "患者就诊记录基本信息表id")
private Long visitRecordId;
@Override
public String toString() {

View File

@ -218,4 +218,6 @@ public class PatientVisitRecord extends BaseEntity {
@Excel(name = "手术名称")
private String surgicalName;
@ApiModelProperty(value = "手术记录")
private String surgicalRecord;
}

View File

@ -67,4 +67,12 @@ public interface PatientTaskExecuteRecordMapper {
* @return 结果
*/
int deletePatientTaskExecuteRecordByIds(Long[] ids);
/**
* 根据患者信息查询就诊记录
*
* @param id id
* @return AjaxResult
*/
PatientTaskExecuteRecordVO selectVisitRecord(Long id);
}

View File

@ -40,14 +40,6 @@ public interface IAgencyService {
*/
AjaxResult selectAgencyByIdList(Agency agency);
/**
* 查询院区机构信息列表
*
* @param agency 机构信息
* @return 机构信息集合
*/
AjaxResult subordinateAgencyList(Agency agency);
/**
* 新增机构信息
*

View File

@ -98,18 +98,6 @@ public class AgencyServiceImpl implements IAgencyService {
}
/**
* 查询院区机构信息列表
*
* @param agency 机构信息
* @return 机构信息
*/
@Override
public AjaxResult subordinateAgencyList(Agency agency) {
return AjaxResult.success(agencyMapper.selectAgencyList(agency));
}
/**
* 新增机构信息
*

View File

@ -1,5 +1,6 @@
package com.xinelu.manage.service.patienttaskexecuterecord;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.vo.patienttaskexecuterecord.PatientTaskExecuteRecordVO;
@ -59,4 +60,12 @@ public interface IPatientTaskExecuteRecordService {
* @return 结果
*/
int deletePatientTaskExecuteRecordById(Long id);
/**
* 根据患者信息查询就诊记录
*
* @param id 记录id
* @return AjaxResult
*/
AjaxResult selectVisitRecord(Long id);
}

View File

@ -1,5 +1,7 @@
package com.xinelu.manage.service.patienttaskexecuterecord.impl;
import com.xinelu.common.core.domain.AjaxResult;
import com.xinelu.common.utils.AgeUtil;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import com.xinelu.manage.mapper.patienttaskexecuterecord.PatientTaskExecuteRecordMapper;
import com.xinelu.manage.service.patienttaskexecuterecord.IPatientTaskExecuteRecordService;
@ -88,4 +90,17 @@ public class PatientTaskExecuteRecordServiceImpl implements IPatientTaskExecuteR
public int deletePatientTaskExecuteRecordById(Long id) {
return patientTaskExecuteRecordMapper.deletePatientTaskExecuteRecordById(id);
}
/**
* 根据患者信息查询就诊记录
*
* @param id id
* @return AjaxResult
*/
@Override
public AjaxResult selectVisitRecord(Long id) {
PatientTaskExecuteRecordVO patientTaskExecuteRecordVO = patientTaskExecuteRecordMapper.selectVisitRecord(id);
patientTaskExecuteRecordVO.setAge(AgeUtil.getAgeMonth(patientTaskExecuteRecordVO.getBirthDate().toString()));
return AjaxResult.success(patientTaskExecuteRecordVO);
}
}

View File

@ -2,12 +2,9 @@ package com.xinelu.manage.vo.patienttaskexecuterecord;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.xinelu.manage.domain.patienttaskexecuterecord.PatientTaskExecuteRecord;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import java.time.LocalDate;
@ -18,102 +15,57 @@ import java.time.LocalDate;
* @author xinelu
* @date 2024-03-25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@EqualsAndHashCode(callSuper = true)
@ApiModel(value = "患者管理任务执行记录对象", description = "patient_task_execute_record")
@Data
public class PatientTaskExecuteRecordVO extends PatientTaskExecuteRecord {
/**
* 患者姓名
*/
@ApiModelProperty(value = "患者年龄")
private Long age;
@ApiModelProperty(value = "患者姓名")
private String patientName;
/**
* 患者电话
*/
@ApiModelProperty(value = "患者电话")
private String patientPhone;
/**
* 就诊流水号
*/
@ApiModelProperty(value = "就诊流水号")
private String visitSerialNumber;
/**
* 所属医院id
*/
@ApiModelProperty(value = "所属医院id")
private Long hospitalAgencyId;
/**
* 所属医院名称
*/
@ApiModelProperty(value = "所属医院名称")
private String hospitalAgencyName;
/**
* 所属院区id
*/
@ApiModelProperty(value = "所属院区id")
private Long campusAgencyId;
/**
* 所属院区名称
*/
@ApiModelProperty(value = "所属院区名称")
private String campusAgencyName;
/**
* 所属科室id
*/
@ApiModelProperty(value = "所属科室id")
private Long departmentId;
/**
* 所属科室名称
*/
@ApiModelProperty(value = "所属科室名称")
private String departmentName;
/**
* 所属病区id
*/
@ApiModelProperty(value = "所属病区id")
private Long wardId;
/**
* 所属病区名称
*/
@ApiModelProperty(value = "所属病区名称")
private String wardName;
/**
* 手术名称
*/
@ApiModelProperty(value = "手术名称")
private String surgicalName;
/**
* 入院时间时间格式yyyy-MM-dd
*/
@ApiModelProperty(value = "入院时间")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate admissionDate;
/**
* 出院时间出院患者时间格式yyyy-MM-dd
*/
@JsonFormat(pattern = "yyyy-MM-dd")
@ApiModelProperty(value = "出院时间(出院患者)")
private LocalDate dischargeDate;
/**
* 就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL
*/
@ApiModelProperty(value = "就诊方式门诊OUTPATIENT_SERVICE住院BE_IN_HOSPITAL")
private String visitMethod;
@ -123,34 +75,28 @@ public class PatientTaskExecuteRecordVO extends PatientTaskExecuteRecord {
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate endDate;
/**
* 家属电话
*/
@ApiModelProperty(value = "家属电话")
private String familyMemberPhone;
/**
* 出生日期格式yyyy-MM-dd
*/
@ApiModelProperty(value = "出生日期格式yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private LocalDate birthDate;
/**
* 身份证号
*/
@ApiModelProperty(value = "身份证号")
private String cardNo;
/**
* 性别MALEFEMALE
*/
@ApiModelProperty(value = "性别MALEFEMALE")
private String sex;
/**
* 住址
*/
@ApiModelProperty(value = "住址")
private String address;
@ApiModelProperty(value = "入院病历信息,存储患者入院的整个病历信息")
private String inHospitalInfo;
@ApiModelProperty(value = "出院病历信息,存储患者出院的整个病历信息")
private String outHospitalInfo;
@ApiModelProperty(value = "手术记录")
private String surgicalRecord;
}

View File

@ -17,6 +17,7 @@
<result property="executePerson" column="execute_person"/>
<result property="executeType" column="execute_type"/>
<result property="executeRemark" column="execute_remark"/>
<result property="visitRecordId" column="visit_record_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateBy" column="update_by"/>
@ -36,6 +37,7 @@
execute_person,
execute_type,
execute_remark,
visit_record_id,
create_by,
create_time,
update_by,
@ -56,6 +58,9 @@
<if test="manageRouteNodeId != null ">
and manage_route_node_id = #{manageRouteNodeId}
</if>
<if test="visitRecordId != null ">
and visit_record_id = #{visitRecordId}
</if>
<if test="patientName != null and patientName != ''">
and patient_name like concat('%', #{patientName}, '%')
</if>
@ -96,7 +101,6 @@
pter.execute_time,
pter.execute_person,
pter.execute_type,
pi.patient_phone,
pi.patient_type,
pi.visit_method,
pi.hospital_agency_name,
@ -107,13 +111,9 @@
pi.admission_date,
pi.discharge_date,
pi.in_hospital_number,
pi.family_member_phone,
pi.birth_date,
pi.card_no,
pi.sex,
pi.address
pi.patient_phone
from patient_task_execute_record pter
left join patient_info pi ON pi.id = pter.patient_id
LEFT JOIN patient_info pi ON pi.id = pter.patient_id
where pi.del_flag = 0
<if test="patientName != null and patientName != ''">
and pi.patient_name = #{patientName}
@ -181,6 +181,8 @@
</if>
<if test="updateTime != null">update_time,
</if>
<if test="visitRecordId != null">visit_record_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="patientId != null">#{patientId},
@ -213,6 +215,8 @@
</if>
<if test="updateTime != null">#{updateTime},
</if>
<if test="visitRecordId != null">#{visitRecordId},
</if>
</trim>
</insert>
@ -228,6 +232,9 @@
<if test="manageRouteNodeId != null">manage_route_node_id =
#{manageRouteNodeId},
</if>
<if test="visitRecordId != null ">
and visit_record_id = #{visitRecordId}
</if>
<if test="patientName != null">patient_name =
#{patientName},
</if>
@ -280,4 +287,23 @@
#{id}
</foreach>
</delete>
<select id="selectVisitRecord"
resultType="com.xinelu.manage.vo.patienttaskexecuterecord.PatientTaskExecuteRecordVO">
select pvr.in_hospital_info,
pvr.out_hospital_info,
pvr.surgical_record,
ri.patient_name,
ri.patient_phone,
ri.family_member_phone,
ri.birth_date,
ri.card_no,
ri.sex,
ri.address
FROM patient_task_execute_record pter
LEFT JOIN patient_visit_record pvr ON pter.visit_record_id = pvr.id
LEFT JOIN patient_info pi ON pi.id = pter.patient_id
LEFT JOIN resident_info ri ON ri.id = pi.resident_id
where pter.id = #{id}
</select>
</mapper>