Merge branch 'master' of https://codeup.aliyun.com/61c0318acd8b75daa5a125f7/medical/openhis
This commit is contained in:
@@ -17,6 +17,7 @@ import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.AccountStatus;
|
||||
import com.openhis.common.enums.WhetherContainUnknown;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceAddOrUpdateParam;
|
||||
import com.openhis.web.basicservice.dto.HealthcareServiceDto;
|
||||
@@ -106,6 +107,10 @@ public class HealthcareServiceController {
|
||||
new HashSet<>(Arrays.asList("name", "charge_name")), request);
|
||||
IPage<HealthcareServiceDto> healthcareServicePage = healthcareServiceBizMapper.getHealthcareServicePage(
|
||||
new Page<>(pageNo, pageSize), CommonConstants.TableName.ADM_HEALTHCARE_SERVICE, queryWrapper);
|
||||
// 枚举类回显赋值
|
||||
healthcareServicePage.getRecords().forEach(e ->
|
||||
e.setActiveFlag_enumText(EnumUtils.getInfoByValue(AccountStatus.class, e.getActiveFlag()))
|
||||
);
|
||||
return R.ok(healthcareServicePage, MessageUtils.createMessage(PromptMsgConstant.Common.M00009, null));
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ public class HealthcareServiceDto {
|
||||
* 活动标记
|
||||
*/
|
||||
private Integer activeFlag;
|
||||
private String activeFlag_enumText;
|
||||
|
||||
/**
|
||||
* 提供部门ID
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.openhis.web.inpatientManage.Assembler;
|
||||
|
||||
public class AdmissionAssembler {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.openhis.web.inpatientManage.dto;
|
||||
|
||||
public class AdmissionDto {
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
package com.openhis.web.inpatientManage.dto;
|
||||
|
||||
public class AdmissionInitPageDto {
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.openhis.web.inpatientmanage.assembler;
|
||||
|
||||
public class AdmissionAssembler {}
|
||||
@@ -1,16 +1,18 @@
|
||||
package com.openhis.web.inpatientManage.controller;
|
||||
package com.openhis.web.inpatientmanage.controller;
|
||||
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.web.inpatientManage.dto.AdmissionDto;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.openhis.administration.service.IEncounterService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.web.inpatientmanage.dto.AdmissionDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/inpatient-manage")
|
||||
@Slf4j
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
public class AdmissionDto {}
|
||||
@@ -0,0 +1,3 @@
|
||||
package com.openhis.web.inpatientmanage.dto;
|
||||
|
||||
public class AdmissionInitPageDto {}
|
||||
@@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import com.core.common.utils.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -12,11 +11,16 @@ import org.springframework.web.bind.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.enums.AssignSeqEnum;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.ChineseConvertUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
import com.openhis.web.patientmanage.dto.PatientListDto;
|
||||
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
||||
@@ -171,18 +175,15 @@ public class PatientInformationController {
|
||||
// 使用基础采番,设置病人ID
|
||||
String code = assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix());
|
||||
patient.setBusNo(code);
|
||||
// 设置生日
|
||||
patient.setBirthDate(patientService.extractBirthday(patient.getIdCard()));
|
||||
|
||||
// 设置机构ID
|
||||
patient.setOrganizationId(organizationId);
|
||||
// 设置生日
|
||||
patient.setBirthDate(patientService.extractBirthday(patient.getIdCard()));
|
||||
// 设置拼音首拼
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
|
||||
// 设置五笔首拼
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
|
||||
// 设置地址
|
||||
String fullAddress = stringUtils.joinStrings(patient.getAddressProvince(),
|
||||
patient.getAddressCity(), patient.getAddressDistrict(), patient.getAddressStreet(),patient.getAddress());
|
||||
patient.setAddress(fullAddress);
|
||||
|
||||
// 调用服务层保存病人信息
|
||||
boolean savePatientSuccess = patientService.save(patient);
|
||||
@@ -211,19 +212,12 @@ public class PatientInformationController {
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
|
||||
// 设置五笔首拼
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
|
||||
// 设置地址
|
||||
String fullAddress = stringUtils.joinStrings(patient.getAddressProvince(),
|
||||
patient.getAddressCity(), patient.getAddressDistrict(), patient.getAddressStreet(),patient.getAddress());
|
||||
patient.setAddress(fullAddress);
|
||||
|
||||
// 调用服务层更新病人信息
|
||||
boolean updateSuccess = patientService.updateById(patient);
|
||||
return patientService.updateById(patient)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
if (!updateSuccess) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -248,7 +242,20 @@ public class PatientInformationController {
|
||||
// 创建Page对象并设置属性
|
||||
Page<PatientInformationDto> patientInformationPage = new Page<>(pageNo, pageSize, total);
|
||||
patientInformationPage.setRecords(listPatients);
|
||||
|
||||
patientInformationPage.getRecords().forEach(e -> {
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 婚姻状态枚举类回显赋值
|
||||
e.setMaritalStatusEnum_enumText(EnumUtils.getInfoByValue(MaritalStatus.class, e.getMaritalStatusEnum()));
|
||||
// 职业编码枚举类回显赋值
|
||||
e.setPrfsEnum_enumText(EnumUtils.getInfoByValue(OccupationType.class, e.getPrfsEnum()));
|
||||
// 血型ABO枚举类回显赋值
|
||||
e.setBloodAbo_text(EnumUtils.getInfoByValue(BloodTypeABO.class, e.getBloodAbo()));
|
||||
// 血型RH枚举类回显赋值
|
||||
e.setBloodRh_enumText(EnumUtils.getInfoByValue(BloodTypeRH.class, e.getBloodRh()));
|
||||
// 家庭关系枚举类回显赋值
|
||||
e.setLinkRelationCode_enumText(EnumUtils.getInfoByValue(FamilyRelationshipType.class, e.getLinkRelationCode()));
|
||||
});
|
||||
return R.ok(patientInformationPage);
|
||||
}
|
||||
|
||||
|
||||
@@ -2,9 +2,13 @@ package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.MaritalStatus;
|
||||
import com.openhis.common.enums.OccupationType;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@@ -17,6 +21,8 @@ import lombok.Data;
|
||||
@Data
|
||||
public class PatientInformationDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 活动标记 */
|
||||
@@ -26,6 +32,7 @@ public class PatientInformationDto {
|
||||
private Integer tempFlag;
|
||||
|
||||
/** 患者姓名 */
|
||||
@NotBlank(message = "患者姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/** 患者其他名称 */
|
||||
@@ -36,6 +43,7 @@ public class PatientInformationDto {
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
@@ -45,11 +53,17 @@ public class PatientInformationDto {
|
||||
|
||||
/** 婚姻状态 */
|
||||
private Integer maritalStatusEnum;
|
||||
private String maritalStatusEnum_enumText;
|
||||
|
||||
/** 职业编码 */
|
||||
private Integer prfsEnum;
|
||||
private String prfsEnum_enumText;
|
||||
|
||||
/** 电话 */
|
||||
@NotNull(message = "电话不能为空")
|
||||
@NotBlank(message = "电话不能为空")
|
||||
@Size(min = 11, max = 11, message = "电话长度必须为11位")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String phone;
|
||||
|
||||
/** 地址 */
|
||||
@@ -74,6 +88,9 @@ public class PatientInformationDto {
|
||||
private String nationalityCode;
|
||||
|
||||
/** 身份证号 */
|
||||
@NotNull(message = "身份证号不能为空")
|
||||
@Size(min = 18, max = 18, message = "身份证号必须是18位")
|
||||
@Pattern(regexp = "^[0-9Xx]{18}$", message = "身份证号格式不正确")
|
||||
private String idCard;
|
||||
|
||||
/** 拼音码 */
|
||||
@@ -84,9 +101,11 @@ public class PatientInformationDto {
|
||||
|
||||
/** 血型ABO */
|
||||
private Integer bloodAbo;
|
||||
private String bloodAbo_text;
|
||||
|
||||
/** 血型RH */
|
||||
private Integer bloodRh;
|
||||
private String bloodRh_enumText;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workCompany;
|
||||
@@ -102,8 +121,11 @@ public class PatientInformationDto {
|
||||
|
||||
/** 联系人关系 */
|
||||
private Integer linkRelationCode;
|
||||
private String linkRelationCode_enumText;
|
||||
|
||||
/** 联系人电话 */
|
||||
@Size(min = 11, max = 11, message = "电话长度必须为11位")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String linkTelcom;
|
||||
|
||||
/** 其他联系人 */
|
||||
@@ -118,7 +140,4 @@ public class PatientInformationDto {
|
||||
/** 创建时间 */
|
||||
private Date createTime;
|
||||
|
||||
/** 删除标识 */
|
||||
// 0 为未删除,1 为删除
|
||||
private String deleteFlag;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.openhis.web.patientmanage.mapper.PatientManageMapper">
|
||||
<!-- 病人信息相关查询-->
|
||||
<select id="getPatientPage" resultType="com.openhis.web.patientmanage.dto.PatientInformationDto">
|
||||
SELECT
|
||||
pt.id,
|
||||
@@ -97,4 +98,7 @@
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<!-- 门诊记录相关查询-->
|
||||
|
||||
</mapper>
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AccountStatus {
|
||||
public enum AccountStatus implements HisEnumInterface {
|
||||
|
||||
ACTIVE (1, "active", "有效"),
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum AdministrativeGender {
|
||||
public enum AdministrativeGender implements HisEnumInterface {
|
||||
MALE(1, "male", "男性"),
|
||||
FEMALE(2, "female", "女性"),
|
||||
OTHER(3, "other", "其他"),
|
||||
|
||||
@@ -13,7 +13,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BloodTypeABO {
|
||||
public enum BloodTypeABO implements HisEnumInterface {
|
||||
|
||||
TYPE_A(1, "typeA", "A 型"),
|
||||
TYPE_B(2, "typeB", "B 型"),
|
||||
|
||||
@@ -12,7 +12,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum BloodTypeRH {
|
||||
public enum BloodTypeRH implements HisEnumInterface {
|
||||
|
||||
TYPE_RH_NEGATIVEB(1, "typeRHNegative", "Rh 阴性"),
|
||||
TYPE_RH_POSITIVE(2, "typeRHPositive", "Rh 阳性"),
|
||||
|
||||
@@ -12,7 +12,7 @@ import lombok.Getter;
|
||||
*/
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum FamilyRelationshipType {
|
||||
public enum FamilyRelationshipType implements HisEnumInterface {
|
||||
|
||||
SELF(1, "01", "本人"),
|
||||
HOUSEHOLDER(2, "02", "户主"),
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
package com.openhis.common.enums;
|
||||
|
||||
/**
|
||||
* 枚举类通用接口
|
||||
*/
|
||||
public interface HisEnumInterface {
|
||||
Integer getValue();
|
||||
String getInfo();
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum MaritalStatus {
|
||||
public enum MaritalStatus implements HisEnumInterface {
|
||||
|
||||
UNMARRIED(10, "10", "未婚"),
|
||||
MARRIED(20, "20", "已婚"),
|
||||
|
||||
@@ -6,7 +6,7 @@ import lombok.Getter;
|
||||
|
||||
@Getter
|
||||
@AllArgsConstructor
|
||||
public enum OccupationType {
|
||||
public enum OccupationType implements HisEnumInterface {
|
||||
STATE_CIVIL_SERVANT(11, "11", "国家公务员"),
|
||||
PROFESSIONAL(13, "13", "专业技术人员"),
|
||||
CLERK(17, "17", "职员"),
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.openhis.common.utils;
|
||||
|
||||
import com.openhis.common.enums.HisEnumInterface;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
public class EnumUtils {
|
||||
|
||||
/**
|
||||
* 根据 value 获取枚举的 info
|
||||
*
|
||||
* @param enumClass 枚举类
|
||||
* @param value 枚举的 value
|
||||
* @param <E> 枚举类型
|
||||
* @return 对应的 info,如果未找到则返回 null
|
||||
*/
|
||||
public static <E extends Enum<E> & HisEnumInterface> String getInfoByValue(Class<E> enumClass, Integer value) {
|
||||
return Arrays.stream(enumClass.getEnumConstants())
|
||||
.filter(e -> e.getValue().equals(value))
|
||||
.findFirst()
|
||||
.map(HisEnumInterface::getInfo)
|
||||
.orElse(null);
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.core.common.core.domain.HisBaseEntity;
|
||||
import com.openhis.common.enums.*;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -44,7 +43,7 @@ public class Patient extends HisBaseEntity {
|
||||
private String busNo;
|
||||
|
||||
/** 性别编码 */
|
||||
private AdministrativeGender genderEnum;
|
||||
private Integer genderEnum;
|
||||
|
||||
/** 生日 */
|
||||
private Date birthDate;
|
||||
@@ -53,10 +52,10 @@ public class Patient extends HisBaseEntity {
|
||||
private Date deceasedDate;
|
||||
|
||||
/** 婚姻状态 */
|
||||
private MaritalStatus maritalStatusEnum;
|
||||
private Integer maritalStatusEnum;
|
||||
|
||||
/** 职业编码 */
|
||||
private OccupationType prfsEnum;
|
||||
private Integer prfsEnum;
|
||||
|
||||
/** 电话 */
|
||||
private String phone;
|
||||
@@ -92,10 +91,10 @@ public class Patient extends HisBaseEntity {
|
||||
private String wbStr;
|
||||
|
||||
/** 血型ABO */
|
||||
private BloodTypeABO bloodAbo;
|
||||
private Integer bloodAbo;
|
||||
|
||||
/** 血型RH */
|
||||
private BloodTypeRH bloodRh;
|
||||
private Integer bloodRh;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workCompany;
|
||||
@@ -110,7 +109,7 @@ public class Patient extends HisBaseEntity {
|
||||
private String linkName;
|
||||
|
||||
/** 联系人关系 */
|
||||
private FamilyRelationshipType linkRelationCode;
|
||||
private Integer linkRelationCode;
|
||||
|
||||
/** 联系人电话 */
|
||||
private String linkTelcom;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.openhis.administration.service.impl;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.time.LocalDate;
|
||||
import java.time.ZoneId;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
@@ -39,8 +38,9 @@ public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient> impl
|
||||
// 将生日字符串转换为 LocalDate
|
||||
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
|
||||
LocalDate date = LocalDate.parse(birthdayStr, formatter);
|
||||
// 使用系统默认时区,将 LocalDate 转换为 Date
|
||||
return Date.from(Instant.from(date.atStartOfDay(ZoneId.systemDefault())));
|
||||
|
||||
// 将 LocalDate 转换为 java.util.Date
|
||||
return Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant());
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user