版本更新
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
package com.openhis.web.patientmanage.appservice;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
||||
|
||||
/**
|
||||
* 门诊记录查询
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/15
|
||||
*/
|
||||
public interface IOutpatientRecordService {
|
||||
|
||||
/**
|
||||
* 分页查询门诊记录
|
||||
*
|
||||
* @param outpatientRecordSearchParam 门诊录查询参数
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
* @return 分页查询
|
||||
*/
|
||||
IPage<OutpatientRecordDto> getPatient(OutpatientRecordSearchParam outpatientRecordSearchParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
/**
|
||||
* 获取医生名字列表
|
||||
*
|
||||
* @return 医生名字列表
|
||||
*/
|
||||
R<?> getDoctorNames();
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.openhis.web.patientmanage.appservice;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto;
|
||||
import com.openhis.web.patientmanage.dto.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 病人管理——病人信息
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/15
|
||||
*/
|
||||
public interface IPatientInformationService {
|
||||
|
||||
/**
|
||||
* 获取病人信息记录初期数据列表
|
||||
*
|
||||
* @return 病人信息记录初期数据列表
|
||||
*/
|
||||
PatientInfoInitDto getPatientInfoInit();
|
||||
|
||||
/**
|
||||
* 分页查询门诊记录
|
||||
*
|
||||
* @param patientInfoSearchParam 病人查询参数
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
* @return 分页查询
|
||||
*/
|
||||
IPage<PatientInformationDto> getPatientInfo(PatientInfoSearchParam patientInfoSearchParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request);
|
||||
|
||||
|
||||
/**
|
||||
* 修改病人信息
|
||||
*
|
||||
* @param patientInformationDto 病人信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
R<?> editPatient(PatientInformationDto patientInformationDto);
|
||||
|
||||
/**
|
||||
* 添加病人信息
|
||||
*
|
||||
* @param patientInformationDto 病人信息
|
||||
*/
|
||||
R<?> addPatient(PatientInformationDto patientInformationDto);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
package com.openhis.web.patientmanage.appservice.impl;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.HashSet;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.common.enums.EncounterSubjectStatus;
|
||||
import com.openhis.common.enums.ParticipantType;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.web.patientmanage.appservice.IOutpatientRecordService;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
||||
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
||||
|
||||
/**
|
||||
* 门诊记录查询 应用实现
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/15
|
||||
*/
|
||||
@Service
|
||||
public class OutpatientRecordServiceImpl implements IOutpatientRecordService {
|
||||
|
||||
@Resource
|
||||
private PatientManageMapper patientManageMapper;
|
||||
|
||||
/**
|
||||
* 分页查询门诊记录
|
||||
*
|
||||
* @param outpatientRecordSearchParam 门诊录查询参数
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
* @return 分页查询
|
||||
*/
|
||||
@Override
|
||||
public IPage<OutpatientRecordDto> getPatient(OutpatientRecordSearchParam outpatientRecordSearchParam,
|
||||
String searchKey, Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<OutpatientRecordDto> queryWrapper =
|
||||
HisQueryUtils.buildQueryWrapper(outpatientRecordSearchParam, searchKey,
|
||||
new HashSet<>(Arrays.asList(CommonConstants.FieldName.idCard, CommonConstants.FieldName.Name,
|
||||
CommonConstants.FieldName.PatientBusNo, CommonConstants.FieldName.EncounterBusNo)),
|
||||
request);
|
||||
|
||||
IPage<OutpatientRecordDto> outpatientRecordPage = patientManageMapper
|
||||
.getOutpatientRecord(ParticipantType.ADMITTER.getCode(), new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
outpatientRecordPage.getRecords().forEach(e -> {
|
||||
// 性别枚举类回显赋值
|
||||
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
|
||||
// 就诊对象状态枚举类回显赋值
|
||||
e.setSubjectStatusEnum_enumText(
|
||||
EnumUtils.getInfoByValue(EncounterSubjectStatus.class, e.getSubjectStatusEnum()));
|
||||
});
|
||||
|
||||
return outpatientRecordPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取医生名字列表
|
||||
*
|
||||
* @return 医生名字列表
|
||||
*/
|
||||
public R<?> getDoctorNames() {
|
||||
return R.ok(patientManageMapper.getDoctorNames());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
package com.openhis.web.patientmanage.appservice.impl;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.core.common.exception.ServiceException;
|
||||
import com.core.common.utils.AssignSeqUtil;
|
||||
import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.MessageUtils;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.domain.PatientIdentifier;
|
||||
import com.openhis.administration.mapper.PatientMapper;
|
||||
import com.openhis.administration.service.IPatientIdentifierService;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import com.openhis.common.constant.PromptMsgConstant;
|
||||
import com.openhis.common.enums.*;
|
||||
import com.openhis.common.utils.EnumUtils;
|
||||
import com.openhis.common.utils.HisQueryUtils;
|
||||
import com.openhis.common.utils.IdCardUtil;
|
||||
import com.openhis.web.patientmanage.appservice.IPatientInformationService;
|
||||
import com.openhis.web.patientmanage.dto.PatientInfoInitDto;
|
||||
import com.openhis.web.patientmanage.dto.PatientInfoSearchParam;
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
||||
|
||||
/**
|
||||
* 门诊患者
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/15
|
||||
*/
|
||||
@Service
|
||||
public class PatientInformationServiceImpl implements IPatientInformationService {
|
||||
|
||||
@Autowired
|
||||
PatientManageMapper patientManageMapper;
|
||||
|
||||
@Autowired
|
||||
private PatientMapper patientMapper;
|
||||
|
||||
@Autowired
|
||||
private IPatientService patientService;
|
||||
@Autowired
|
||||
private IPatientIdentifierService patientIdentifierService;
|
||||
|
||||
@Autowired(required = false)
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
/**
|
||||
* 获取病人信息记录初期数据列表
|
||||
*
|
||||
* @return 病人信息记录初期数据列表
|
||||
*/
|
||||
@Override
|
||||
public PatientInfoInitDto getPatientInfoInit() {
|
||||
PatientInfoInitDto initDto = new PatientInfoInitDto();
|
||||
// 获取婚姻状态列表
|
||||
List<PatientInfoInitDto.statusEnumOption> maritalStatusOptions = Stream.of(MaritalStatus.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setMaritalStatus(maritalStatusOptions);
|
||||
|
||||
// 获取职业编码列表
|
||||
List<PatientInfoInitDto.statusEnumOption> occupationTypeOptions = Stream.of(OccupationType.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setOccupationType(occupationTypeOptions);
|
||||
|
||||
// 获取性别列表
|
||||
List<PatientInfoInitDto.statusEnumOption> sexOptions = new ArrayList<>();
|
||||
sexOptions.add(new PatientInfoInitDto.statusEnumOption(AdministrativeGender.MALE.getValue(),
|
||||
AdministrativeGender.MALE.getInfo()));
|
||||
sexOptions.add(new PatientInfoInitDto.statusEnumOption(AdministrativeGender.FEMALE.getValue(),
|
||||
AdministrativeGender.FEMALE.getInfo()));
|
||||
initDto.setSex(sexOptions);
|
||||
|
||||
// 获取ABO血型列表
|
||||
List<PatientInfoInitDto.statusEnumOption> bloodTypeABOOptions = Stream.of(BloodTypeABO.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setBloodTypeABO(bloodTypeABOOptions);
|
||||
|
||||
// 获取RH血型列表
|
||||
List<PatientInfoInitDto.statusEnumOption> bloodTypeRHOptions = Stream.of(BloodTypeRH.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setBloodTypeRH(bloodTypeRHOptions);
|
||||
|
||||
// 获取家庭关系列表
|
||||
List<PatientInfoInitDto.statusEnumOption> familyRelationshipType = Stream.of(FamilyRelationshipType.values())
|
||||
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
|
||||
.collect(Collectors.toList());
|
||||
initDto.setFamilyRelationshipType(familyRelationshipType);
|
||||
|
||||
// 获取是/否状态
|
||||
List<PatientInfoInitDto.statusEnumOption> whetherOptions = new ArrayList<>();
|
||||
whetherOptions.add(new PatientInfoInitDto.statusEnumOption(PublicationStatus.ACTIVE.getValue(),
|
||||
PublicationStatus.ACTIVE.getInfo()));
|
||||
whetherOptions.add(new PatientInfoInitDto.statusEnumOption(PublicationStatus.RETIRED.getValue(),
|
||||
PublicationStatus.RETIRED.getInfo()));
|
||||
initDto.setWhetherStatus(whetherOptions);
|
||||
|
||||
return initDto;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询门诊记录
|
||||
*
|
||||
* @param patientInfoSearchParam 病人查询参数
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
* @return 分页查询
|
||||
*/
|
||||
@Override
|
||||
public IPage<PatientInformationDto> getPatientInfo(PatientInfoSearchParam patientInfoSearchParam, String searchKey,
|
||||
Integer pageNo, Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
// 构建查询条件
|
||||
QueryWrapper<PatientInformationDto> queryWrapper = HisQueryUtils.buildQueryWrapper(
|
||||
patientInfoSearchParam, searchKey, new HashSet<>(Arrays.asList(CommonConstants.FieldName.Name,
|
||||
CommonConstants.FieldName.BusNo, CommonConstants.FieldName.PyStr, CommonConstants.FieldName.WbStr)),
|
||||
request);
|
||||
|
||||
IPage<PatientInformationDto> patientInformationPage =
|
||||
patientManageMapper.getPatientPage(new Page<>(pageNo, pageSize), queryWrapper);
|
||||
|
||||
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_enumText(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 patientInformationPage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病人信息
|
||||
*
|
||||
* @param patientInformationDto 病人信息
|
||||
* @return 更新结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> editPatient(PatientInformationDto patientInformationDto) {
|
||||
// 如果患者没有输入身份证号则根据年龄自动生成
|
||||
String idCard = patientInformationDto.getIdCard();
|
||||
if (idCard == null || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||
idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
}
|
||||
Patient patient = new Patient();
|
||||
BeanUtils.copyProperties(patientInformationDto, patient);
|
||||
|
||||
// 当死亡时间不为空,检查死亡时间
|
||||
if (patient.getDeceasedDate() != null) {
|
||||
// 检验死亡时间未来时报错
|
||||
if (DateUtils.isFuture(patient.getDeceasedDate())) {
|
||||
R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, new Object[] {"死亡时间未来时!"}));
|
||||
}
|
||||
}
|
||||
// 调用服务层更新病人信息
|
||||
boolean resPatient = patientService.updatePatient(patient);
|
||||
|
||||
// 根据患者的标识,判断是否需要修改
|
||||
PatientIdentifier patientIdentifier = patientIdentifierService.selectByPatientId(patient.getId());
|
||||
boolean resPatId = true;
|
||||
if (patientIdentifier == null) {
|
||||
PatientIdentifier newIdentifier = new PatientIdentifier();
|
||||
newIdentifier.setPatientId(patient.getId()).setTypeCode(patientInformationDto.getTypeCode())
|
||||
.setIdentifierNo(patientInformationDto.getIdentifierNo())
|
||||
// 标识状态默认:常规
|
||||
.setStateEnum(IdentifierStatusEnum.USUAL.getValue());
|
||||
resPatId = patientIdentifierService.save(newIdentifier);
|
||||
} else if (patientIdentifier.getIdentifierNo() != null
|
||||
&& !patientIdentifier.getIdentifierNo().equals(patientInformationDto.getIdentifierNo())) {
|
||||
// resPatId =
|
||||
// patientIdentifierService.updateTypeByPatientId(patient.getId(), patientInformationDto.getTypeCode());
|
||||
PatientIdentifier newIdentifier = new PatientIdentifier();
|
||||
newIdentifier.setPatientId(patient.getId()).setTypeCode(patientInformationDto.getTypeCode())
|
||||
.setIdentifierNo(patientInformationDto.getIdentifierNo())
|
||||
// 标识状态默认:常规
|
||||
.setStateEnum(IdentifierStatusEnum.USUAL.getValue());
|
||||
resPatId = patientIdentifierService.save(newIdentifier);
|
||||
}
|
||||
|
||||
return resPatient && resPatId
|
||||
? R.ok(idCard, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病人信息
|
||||
*
|
||||
* @param patientInformationDto 病人信息
|
||||
*/
|
||||
@Override
|
||||
public R<?> addPatient(PatientInformationDto patientInformationDto) {
|
||||
// 如果患者没有输入身份证号则根据年龄自动生成
|
||||
String idCard = patientInformationDto.getIdCard();
|
||||
if (idCard == null || idCard.isEmpty() || CommonConstants.Common.AREA_CODE.equals(idCard.substring(0, 6))) {
|
||||
idCard = IdCardUtil.generateIdByAge(patientInformationDto.getAge());
|
||||
Date birthday = IdCardUtil.extractBirthdayFromIdCard(idCard);
|
||||
patientInformationDto.setIdCard(idCard).setBirthDate(birthday);
|
||||
}
|
||||
Patient patient = new Patient();
|
||||
BeanUtils.copyProperties(patientInformationDto, patient);
|
||||
patient.setBusNo(assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix(), 10));
|
||||
// 当死亡时间不为空,检查死亡时间
|
||||
if (patient.getDeceasedDate() != null) {
|
||||
// 检验死亡时间未来时报错
|
||||
if (DateUtils.isFuture(patient.getDeceasedDate())) {
|
||||
R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00011, new Object[] {"死亡时间未来时!"}));
|
||||
}
|
||||
}
|
||||
// 调用服务层,添加病人
|
||||
boolean resPatient = patientService.addPatient(patient);
|
||||
if (!resPatient) {
|
||||
throw new ServiceException("身份证号已存在");
|
||||
}
|
||||
// 调用服务层,添加病人标识
|
||||
PatientIdentifier patientIdentifier = new PatientIdentifier();
|
||||
patientIdentifier.setPatientId(patient.getId()).setTypeCode(patientInformationDto.getTypeCode())
|
||||
.setIdentifierNo(patientInformationDto.getIdentifierNo())
|
||||
// 标识状态默认:常规
|
||||
.setStateEnum(IdentifierStatusEnum.USUAL.getValue());
|
||||
boolean resPatId = patientIdentifierService.save(patientIdentifier);
|
||||
|
||||
return resPatient && resPatId
|
||||
? R.ok(patient, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}))
|
||||
: R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"病人信息"}));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
package com.openhis.web.patientmanage.controller;
|
||||
|
||||
import com.openhis.web.datadictionary.dto.DeviceManageSelParam;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.patientmanage.appservice.IOutpatientRecordService;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* 门诊记录
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/patient-manage/records")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class OutpatientRecordController {
|
||||
|
||||
@Autowired
|
||||
IOutpatientRecordService outpatientRecordService;
|
||||
|
||||
/**
|
||||
* 门诊记录初期数据
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/init")
|
||||
public R<?> getDoctorNames() {
|
||||
// 获取医生名字列表
|
||||
return outpatientRecordService.getDoctorNames();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询门诊记录,可选条件
|
||||
*
|
||||
* @param outpatientRecordSearchParam 查询条件
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
*/
|
||||
@GetMapping("/outpatient-record-page")
|
||||
public R<?> getPatient(OutpatientRecordSearchParam outpatientRecordSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
|
||||
return R.ok(outpatientRecordService.getPatient(outpatientRecordSearchParam,searchKey, pageNo, pageSize,request));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
package com.openhis.web.patientmanage.controller;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.web.patientmanage.appservice.IPatientInformationService;
|
||||
import com.openhis.web.patientmanage.dto.PatientInfoSearchParam;
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 病人管理——病人信息
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/22
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/patient-manage/information")
|
||||
@Slf4j
|
||||
@AllArgsConstructor
|
||||
public class PatientInformationController {
|
||||
|
||||
@Autowired
|
||||
IPatientInformationService patientInformationService;
|
||||
|
||||
/**
|
||||
* 病人信息记录初期数据列表
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/init")
|
||||
public R<?> getPatientInfoInit() {
|
||||
return R.ok(patientInformationService.getPatientInfoInit());
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加病人信息
|
||||
*
|
||||
* @param patientInformationDto 病人信息
|
||||
*/
|
||||
@PostMapping("/patient-information")
|
||||
public R<?> addPatient(@Validated @RequestBody PatientInformationDto patientInformationDto) {
|
||||
return patientInformationService.addPatient(patientInformationDto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改病人信息
|
||||
*
|
||||
* @param patientInformationDto 病人信息
|
||||
*/
|
||||
@PutMapping("/patient-information")
|
||||
public R<?> editPatient(@Validated @RequestBody PatientInformationDto patientInformationDto) {
|
||||
// 调用服务层更新病人信息
|
||||
return patientInformationService.editPatient(patientInformationDto);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询病人信息,可选条件
|
||||
*
|
||||
* @param patientInfoSearchParam 患者查询参数
|
||||
* @param searchKey 查询条件-模糊查询
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
*/
|
||||
@GetMapping("/patient-information-page")
|
||||
public R<?> getPatient(PatientInfoSearchParam patientInfoSearchParam,
|
||||
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest request) {
|
||||
return R
|
||||
.ok(patientInformationService.getPatientInfo(patientInfoSearchParam, searchKey, pageNo, pageSize, request));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 门诊记录Dto
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientRecordDto {
|
||||
|
||||
/** 患者姓名 */
|
||||
private String name;
|
||||
|
||||
/** 身份证号 */
|
||||
private String idCard;
|
||||
|
||||
/** 疾病与诊断描述 */
|
||||
private String description;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String patientBusNo;
|
||||
|
||||
/** 就诊号 */
|
||||
private String encounterBusNo;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 就诊时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date encounterTime;
|
||||
|
||||
/** 就诊对象状态 */
|
||||
private Integer subjectStatusEnum;
|
||||
private String subjectStatusEnum_enumText;
|
||||
|
||||
/** 机构名称/接诊医院 */
|
||||
private String organizationName;
|
||||
|
||||
/** 接诊医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
/** 手机号码 */
|
||||
private String phone;
|
||||
|
||||
/** 就诊开始时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date StartTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊记录查询参数
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientRecordSearchParam {
|
||||
|
||||
/** 手机号码 */
|
||||
private String phone;
|
||||
|
||||
/** 医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 病人信息初期信息列表
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/25
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientInfoInitDto {
|
||||
|
||||
//获取婚姻状态列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> maritalStatus;
|
||||
//获取职业编码列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> occupationType;
|
||||
//获取性别列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> sex;
|
||||
//获取ABO血型列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> bloodTypeABO;
|
||||
//获取RH血型列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> bloodTypeRH;
|
||||
//获取家庭关系列表
|
||||
private List<PatientInfoInitDto.statusEnumOption> familyRelationshipType;
|
||||
//身份证件类型
|
||||
private List<PatientInfoInitDto.statusEnumOption> identityDocumentType;
|
||||
//是/否 状态
|
||||
private List<PatientInfoInitDto.statusEnumOption> whetherStatus;
|
||||
|
||||
/**
|
||||
* 状态
|
||||
*/
|
||||
@Data
|
||||
public static class statusEnumOption {
|
||||
private Integer value;
|
||||
private String info;
|
||||
|
||||
public statusEnumOption(Integer value, String info) {
|
||||
this.value = value;
|
||||
this.info = info;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 病人信息查询参数Dto
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/3/31
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientInfoSearchParam {
|
||||
|
||||
/** 病人编号 */
|
||||
private String busNo;
|
||||
}
|
||||
@@ -0,0 +1,155 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
|
||||
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
|
||||
import com.openhis.common.annotation.Dict;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 病人信息Dto
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/22
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class PatientInformationDto {
|
||||
|
||||
/** ID */
|
||||
@JsonSerialize(using = ToStringSerializer.class)
|
||||
private Long id;
|
||||
|
||||
/** 临时标识 */
|
||||
private Integer tempFlag;
|
||||
|
||||
/** 患者姓名 */
|
||||
@NotBlank(message = "患者姓名不能为空")
|
||||
private String name;
|
||||
|
||||
/** 患者其他名称 */
|
||||
private String nameJson;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String busNo;
|
||||
|
||||
/** 性别编码 */
|
||||
@NotNull
|
||||
private Integer genderEnum;
|
||||
private String genderEnum_enumText;
|
||||
|
||||
/** 生日 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd")
|
||||
private Date birthDate;
|
||||
|
||||
/** 死亡时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date deceasedDate;
|
||||
|
||||
/** 婚姻状态 */
|
||||
private Integer maritalStatusEnum;
|
||||
private String maritalStatusEnum_enumText;
|
||||
|
||||
/** 职业编码 */
|
||||
private Integer prfsEnum;
|
||||
private String prfsEnum_enumText;
|
||||
|
||||
/** 电话 */
|
||||
// @NotBlank(message = "电话不能为空")
|
||||
@Size(min = 11, max = 11, message = "电话长度必须为11位")
|
||||
@Pattern(regexp = "^1[3-9]\\d{9}$", message = "电话格式不正确")
|
||||
private String phone;
|
||||
|
||||
/** 地址 */
|
||||
private String address;
|
||||
|
||||
/** 地址省 */
|
||||
private String addressProvince;
|
||||
|
||||
/** 地址市 */
|
||||
private String addressCity;
|
||||
|
||||
/** 地址区 */
|
||||
private String addressDistrict;
|
||||
|
||||
/** 地址街道 */
|
||||
private String addressStreet;
|
||||
|
||||
/** 患者其他地址 */
|
||||
private String addressJson;
|
||||
|
||||
/** 民族 */
|
||||
private String nationalityCode;
|
||||
|
||||
/** 证件号码 */
|
||||
private String idCard;
|
||||
|
||||
/** 证件类型 */
|
||||
@Dict(dictCode = "sys_idtype")
|
||||
private String typeCode;
|
||||
private String typeCode_dictText;
|
||||
|
||||
/** 标识号 */
|
||||
private String identifierNo;
|
||||
|
||||
/** 拼音码 */
|
||||
private String pyStr;
|
||||
|
||||
/** 五笔码 */
|
||||
private String wbStr;
|
||||
|
||||
/** 血型ABO */
|
||||
private Integer bloodAbo;
|
||||
private String bloodAbo_enumText;
|
||||
|
||||
/** 血型RH */
|
||||
private Integer bloodRh;
|
||||
private String bloodRh_enumText;
|
||||
|
||||
/** 工作单位 */
|
||||
private String workCompany;
|
||||
|
||||
/** 籍贯 */
|
||||
private String nativePlace;
|
||||
|
||||
/** 国家编码 */
|
||||
private String countryCode;
|
||||
|
||||
/** 联系人 */
|
||||
private String linkName;
|
||||
|
||||
/** 联系人关系 */
|
||||
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;
|
||||
|
||||
/** 其他联系人 */
|
||||
private String linkJsons;
|
||||
|
||||
/** 机构Id */
|
||||
private Long organizationId;
|
||||
|
||||
/** 机构名 */
|
||||
private String organizationName;
|
||||
|
||||
/** 创建时间 */
|
||||
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createTime;
|
||||
|
||||
/** 年龄 */
|
||||
private Integer age;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
package com.openhis.web.patientmanage.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
||||
import com.openhis.web.patientmanage.dto.PatientInformationDto;
|
||||
|
||||
/**
|
||||
* 病人信息管理
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/25
|
||||
*/
|
||||
@Repository
|
||||
public interface PatientManageMapper extends BaseMapper<Patient> {
|
||||
|
||||
/**
|
||||
* 病人信息分页查询
|
||||
*
|
||||
* @param page 分页参数
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 病人信息列表
|
||||
*/
|
||||
IPage<PatientInformationDto> getPatientPage(@Param("page") Page<PatientInformationDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<PatientInformationDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 门诊信息分页查询
|
||||
*
|
||||
* @param typeCode 参与者身份类型(枚举类ParticipantType)
|
||||
* @param page 分页参数
|
||||
* @param queryWrapper 查询条件
|
||||
* @return 门诊信息列表
|
||||
*/
|
||||
IPage<OutpatientRecordDto> getOutpatientRecord(@Param("typeCode") String typeCode,
|
||||
@Param("page") Page<OutpatientRecordDto> page,
|
||||
@Param(Constants.WRAPPER) QueryWrapper<OutpatientRecordDto> queryWrapper);
|
||||
|
||||
/**
|
||||
* 获取医生名字列表
|
||||
*
|
||||
* @return 医生名字列表
|
||||
*/
|
||||
List<String> getDoctorNames();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user