门诊记录 相关更新
This commit is contained in:
@@ -0,0 +1,92 @@
|
||||
package com.openhis.web.patientmanage.controller;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
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.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.core.common.core.domain.R;
|
||||
import com.openhis.common.enums.AdministrativeGender;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
|
||||
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
|
||||
import com.openhis.web.patientmanage.dto.PatientListDto;
|
||||
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* 门诊记录
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/patientmanage/records")
|
||||
@Slf4j
|
||||
public class OutpatientRecordController {
|
||||
|
||||
@Autowired(required = false)
|
||||
PatientManageMapper patientManageMapper;
|
||||
|
||||
/**
|
||||
* 获取医生名字列表
|
||||
*/
|
||||
@GetMapping("/list-doctornames")
|
||||
public R<?> getDoctorNames() {
|
||||
// 获取医生名字列表
|
||||
List<String> listDoctorNames = patientManageMapper.getDoctorNames();
|
||||
|
||||
return R.ok(listDoctorNames);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取性别列表
|
||||
*/
|
||||
@GetMapping("/list-administrativegender")
|
||||
public R<?> getAdministrativeGender() {
|
||||
// 获取性别
|
||||
List<AdministrativeGender> statusList = Arrays.asList(AdministrativeGender.values());
|
||||
List<PatientListDto> dtos = new ArrayList<>();
|
||||
// 取得更新值
|
||||
for (AdministrativeGender status : statusList) {
|
||||
PatientListDto dto = new PatientListDto();
|
||||
dto.setValue(status.getValue());
|
||||
dto.setInfo(status.getInfo());
|
||||
dtos.add(dto);
|
||||
}
|
||||
return R.ok(dtos);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询门诊记录,可选条件
|
||||
*
|
||||
* @param outpatientRecordSearchParam 查询条件
|
||||
* @param pageNo 页码(默认为1)
|
||||
* @param pageSize 每页大小(默认为10)
|
||||
*/
|
||||
@GetMapping("/outpatient-record-page")
|
||||
public R<?> getPatient(@RequestParam(required = false) OutpatientRecordSearchParam outpatientRecordSearchParam,
|
||||
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
|
||||
|
||||
// 跳过的记录数
|
||||
Integer offset = (pageNo - 1) * pageSize;
|
||||
// 连表查询患者信息
|
||||
List<OutpatientRecordDto> listOutpatientRecords =
|
||||
patientManageMapper.getOutpatientRecord(outpatientRecordSearchParam, pageSize, offset);
|
||||
// 查询总记录数
|
||||
long total = patientManageMapper.countOutpatientRecords(outpatientRecordSearchParam);
|
||||
// 创建Page对象并设置属性
|
||||
Page<OutpatientRecordDto> OutpatientRecordPage = new Page<>(pageNo, pageSize, total);
|
||||
OutpatientRecordPage.setRecords(listOutpatientRecords);
|
||||
|
||||
return R.ok(OutpatientRecordPage);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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,6 +11,7 @@ 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.*;
|
||||
import com.core.common.utils.bean.BeanUtils;
|
||||
import com.openhis.administration.domain.Patient;
|
||||
import com.openhis.administration.service.IPatientService;
|
||||
@@ -181,8 +181,8 @@ public class PatientInformationController {
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
|
||||
// 设置五笔首拼
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
|
||||
//设置死亡时间
|
||||
if(patientService.isFuture(patientInformationDto.getDeceasedDate())){
|
||||
// 设置死亡时间
|
||||
if (patientService.isFuture(patientInformationDto.getDeceasedDate())) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"死亡时间未来时"}));
|
||||
}
|
||||
patient.setDeceasedDate(DateUtils.parseDate(patientInformationDto.getDeceasedDate()));
|
||||
@@ -213,8 +213,8 @@ public class PatientInformationController {
|
||||
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
|
||||
// 设置五笔首拼
|
||||
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
|
||||
//设置死亡时间
|
||||
if(patientService.isFuture(patientInformationDto.getDeceasedDate())){
|
||||
// 设置死亡时间
|
||||
if (patientService.isFuture(patientInformationDto.getDeceasedDate())) {
|
||||
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, new Object[] {"死亡时间未来时"}));
|
||||
}
|
||||
patient.setDeceasedDate(DateUtils.parseDate(patientInformationDto.getDeceasedDate()));
|
||||
@@ -256,11 +256,12 @@ public class PatientInformationController {
|
||||
// 职业编码枚举类回显赋值
|
||||
e.setPrfsEnum_enumText(EnumUtils.getInfoByValue(OccupationType.class, e.getPrfsEnum()));
|
||||
// 血型ABO枚举类回显赋值
|
||||
e.setBloodAbo_text(EnumUtils.getInfoByValue(BloodTypeABO.class, e.getBloodAbo()));
|
||||
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()));
|
||||
e.setLinkRelationCode_enumText(
|
||||
EnumUtils.getInfoByValue(FamilyRelationshipType.class, e.getLinkRelationCode()));
|
||||
});
|
||||
return R.ok(patientInformationPage);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 门诊记录Dto
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@Data
|
||||
public class OutpatientRecordDto {
|
||||
|
||||
/** 患者姓名 */
|
||||
private String name;
|
||||
|
||||
/** 身份证号 */
|
||||
private String idCard;
|
||||
|
||||
/** 疾病与诊断描述 */
|
||||
private String description;
|
||||
|
||||
/** 患者院内编码/病历号 */
|
||||
private String patientBusNo;
|
||||
|
||||
/** 就诊号 */
|
||||
private String encounterBusNo;
|
||||
|
||||
/** 性别编码 */
|
||||
private Integer genderEnum;
|
||||
|
||||
/** 就诊时间 */
|
||||
private Date encounterTime;
|
||||
|
||||
/** 就诊对象状态 */
|
||||
private Integer subjectStatusEnum;
|
||||
|
||||
/** 机构名称/接诊医院 */
|
||||
private String organizationName;
|
||||
|
||||
/** 接诊医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
/** 手机号码 */
|
||||
private String phone;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.openhis.web.patientmanage.dto;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* 门诊记录查询参数
|
||||
*
|
||||
* @author liuhr
|
||||
* @date 2025/2/28
|
||||
*/
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class OutpatientRecordSearchParam {
|
||||
|
||||
/** 身份证号/病人ID/门诊号/病人姓名 */
|
||||
private String searchKey;
|
||||
|
||||
/** 手机号码 */
|
||||
private String phone;
|
||||
|
||||
/** 医生姓名 */
|
||||
private String doctorName;
|
||||
|
||||
/** 筛选开始时间 */
|
||||
private Date startTime;
|
||||
|
||||
/** 筛选结束时间 */
|
||||
private Date endTime;
|
||||
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class PatientInformationDto {
|
||||
|
||||
/** 血型ABO */
|
||||
private Integer bloodAbo;
|
||||
private String bloodAbo_text;
|
||||
private String bloodAbo_enumText;
|
||||
|
||||
/** 血型RH */
|
||||
private Integer bloodRh;
|
||||
|
||||
@@ -7,12 +7,14 @@ import org.springframework.stereotype.Repository;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
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 Wuser
|
||||
* @author liuhr
|
||||
* @date 2025/2/25
|
||||
*/
|
||||
@Repository
|
||||
@@ -31,7 +33,7 @@ public interface PatientManageMapper extends BaseMapper<Patient> {
|
||||
@Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
|
||||
|
||||
/**
|
||||
* 统计总记录数的方法
|
||||
* 统计病人信息总记录数的方法
|
||||
*
|
||||
* @param busNo 病人ID
|
||||
* @param name 病人姓名
|
||||
@@ -39,4 +41,32 @@ public interface PatientManageMapper extends BaseMapper<Patient> {
|
||||
*/
|
||||
long countPatients(@Param("busNo") String busNo, @Param("name") String name);
|
||||
|
||||
/**
|
||||
* 门诊信息分页查询
|
||||
*
|
||||
* @param outpatientRecordSearchParam 门诊查询参数
|
||||
* @param pageSize 页面大小
|
||||
* @param offset 跳过条数
|
||||
* @return 分页查询
|
||||
*/
|
||||
List<OutpatientRecordDto> getOutpatientRecord(
|
||||
@Param("OutpatientRecordSearchParam") OutpatientRecordSearchParam outpatientRecordSearchParam,
|
||||
@Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
|
||||
|
||||
/**
|
||||
* 统计门诊总记录数的方法
|
||||
*
|
||||
* @param outpatientRecordSearchParam 门诊查询参数
|
||||
* @return 分页查询
|
||||
*/
|
||||
long countOutpatientRecords(
|
||||
@Param("OutpatientRecordSearchParam") OutpatientRecordSearchParam outpatientRecordSearchParam);
|
||||
|
||||
/**
|
||||
* 获取医生名字列表
|
||||
*
|
||||
* @return 医生名字列表
|
||||
*/
|
||||
List<String> getDoctorNames();
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user