门诊和皮试和病人信息的格式修改

This commit is contained in:
liuhongrui
2025-03-15 16:06:22 +08:00
parent 48dfed2808
commit cd04bca322
17 changed files with 376 additions and 266 deletions

View File

@@ -68,8 +68,10 @@ public interface IOutpatientInfusionRecordService {
/**
* 显示门诊输液执行记录查询
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return 门诊输液记录列表
*/
List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord();
List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord(String beginTime,String endTime);
}

View File

@@ -2,14 +2,12 @@ package com.openhis.web.outpatientmanage.appservice;
import java.util.List;
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto;
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestInitDto;
import org.apache.ibatis.annotations.Param;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto;
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordSearchParam;
import com.openhis.web.patientmanage.dto.PatientListDto;
/**
* 门诊管理 应用实现类
@@ -49,15 +47,6 @@ public interface IOutpatientSkinTestRecordService {
@Param("OutpatientSkinTestRecordSearchParam") OutpatientSkinTestRecordSearchParam outpatientSkinTestRecordSearchParam,
@Param("pageSize") Integer pageSize, @Param("offset") Integer offset);
/**
* 统计门诊皮试记录数的方法
*
* @param outpatientSkinTestRecordSearchParam 门诊皮试记录查询参数
* @return 分页查询
*/
long countOutpatientSkinTestRecords(
@Param("OutpatientSkinTestRecordSearchParam") OutpatientSkinTestRecordSearchParam outpatientSkinTestRecordSearchParam);
/**
* 护士确认执行皮试后,更新皮试记录信息(服务申请管理与过敏与不耐受的相关字段更新)
*

View File

@@ -3,6 +3,7 @@ package com.openhis.web.outpatientmanage.appservice.impl;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Arrays;
import java.util.Date;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
@@ -72,11 +73,6 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
*/
public OutpatientInfusionInitDto getOutpatientInfusionInit() {
OutpatientInfusionInitDto initDto = new OutpatientInfusionInitDto();
// 获取药品状态
List<OutpatientInfusionInitDto.statusEnumOption> statusEnumOptions = Stream.of(EventStatus.values())
.map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setMedicationStatus(statusEnumOptions);
// 获取皮试结果
List<OutpatientInfusionInitDto.statusEnumOption> statusEnumOptions2 = Stream.of(ClinicalStatus.values())
@@ -126,7 +122,8 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
String searchKey;
LocalDateTime beginTime;
LocalDateTime endTime;
if (outpatientInfusionSearchParam == null) {
if (outpatientInfusionSearchParam == null || outpatientInfusionSearchParam.getBeginTime() == null
|| outpatientInfusionSearchParam.getEndTime() == null) {
searchKey = null;
beginTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true);
endTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false);
@@ -138,9 +135,9 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
// 构建查询条件
QueryWrapper<OutpatientInfusionPatientDto> queryWrapper = HisQueryUtils.buildQueryWrapper(null, searchKey,
new HashSet<>(Arrays.asList("patient_busNo", "encounter_busNo", "patient_name")), null);
new HashSet<>(Arrays.asList("patient_bus_no", "encounter_bus_no", "patient_name")), null);
// based_on_id 是为空的
queryWrapper.eq("based_on_id",null);
queryWrapper.eq("based_on_id", null);
// 状态是未完成的
queryWrapper.in("status_enum", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue());
// 添加时间段查询条件
@@ -179,7 +176,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
QueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("patient_id", outpatientInfusionPatientDto.getPatientId());
// based_on_id 是为空的
queryWrapper.eq("based_on_id",null);
queryWrapper.eq("based_on_id", null);
// 状态是未完成的
queryWrapper.in("status_enum", EventStatus.IN_PROGRESS.getValue(), EventStatus.NOT_DONE.getValue());
// 从数据库获取输液记录列表
@@ -249,8 +246,7 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
updateWrapper.eq("id", outpatientInfusionRecordDto.getServiceId())
.set("status_enum", EventStatus.COMPLETED.getValue())
.set("performer_type_code", practitionerRole.getRoleCode())
.set("performer_id", practitioner.getId())
.set("occurrence_start_time", DateUtils.getNowDate())
.set("performer_id", practitioner.getId()).set("occurrence_start_time", DateUtils.getNowDate())
.set("occurrence_end_time", DateUtils.getNowDate());
int countUpdate = serviceRequestMapper.update(null, updateWrapper);
if (countUpdate < 0) {
@@ -286,17 +282,33 @@ public class OutpatientInfusionRecordServiceImpl implements IOutpatientInfusionR
/**
* 显示门诊输液执行记录查询
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return 门诊输液记录列表
*/
@Override
public List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord() {
public List<OutpatientInfusionRecordDto> getPatientInfusionPerformRecord(String beginTime, String endTime) {
LocalDateTime beginDateTime;
LocalDateTime endDateTime;
//筛选时间不传,默认当天记录
if (beginTime == null || endTime == null) {
beginDateTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), true);
endDateTime = DateUtils.startDayOrEndDay(DateUtils.getDate(), false);
} else {
beginDateTime = DateUtils.startDayOrEndDay(beginTime, true);
endDateTime = DateUtils.startDayOrEndDay(endTime, false);
}
// 创建查询包装器
QueryWrapper<OutpatientInfusionRecordDto> queryWrapper = new QueryWrapper<>();
// based_on_id 不为空
queryWrapper.isNotNull("based_on_id");
// 状态是已完成
queryWrapper.eq("status_enum", EventStatus.COMPLETED.getValue());
// 时间筛选
queryWrapper.ge("begin_time", beginDateTime);
queryWrapper.le("end_time", endDateTime);
// 从数据库获取输液记录列表
List<OutpatientInfusionRecordDto> infusionPerformList =
outpatientManageMapper.getOutpatientInfusionRecord(queryWrapper);

View File

@@ -1,7 +1,5 @@
package com.openhis.web.outpatientmanage.appservice.impl;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.stream.Collectors;
@@ -37,7 +35,6 @@ import com.openhis.web.outpatientmanage.appservice.IOutpatientSkinTestRecordServ
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordDto;
import com.openhis.web.outpatientmanage.dto.OutpatientSkinTestRecordSearchParam;
import com.openhis.web.outpatientmanage.mapper.OutpatientManageMapper;
import com.openhis.web.patientmanage.dto.PatientListDto;
import com.openhis.workflow.domain.ServiceRequest;
import com.openhis.workflow.mapper.ServiceRequestMapper;
import com.openhis.workflow.service.IServiceRequestService;
@@ -87,14 +84,14 @@ public class OutpatientSkinTestRecordServiceImpl implements IOutpatientSkinTestR
@Override public OutpatientSkinTestInitDto getOutpatientSkinTestInit() {
OutpatientSkinTestInitDto initDto = new OutpatientSkinTestInitDto();
//获取皮试状态
List<OutpatientInfusionInitDto.statusEnumOption> statusEnumOptions1 = Stream.of(VerificationStatus.values())
.map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo()))
List<OutpatientSkinTestInitDto.statusEnumOption> statusEnumOptions1 = Stream.of(VerificationStatus.values())
.map(status -> new OutpatientSkinTestInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setVerificationStatus(statusEnumOptions1);
// 获取皮试结果
List<OutpatientInfusionInitDto.statusEnumOption> statusEnumOptions2 = Stream.of(ClinicalStatus.values())
.map(status -> new OutpatientInfusionInitDto.statusEnumOption(status.getValue(), status.getInfo()))
List<OutpatientSkinTestInitDto.statusEnumOption> statusEnumOptions2 = Stream.of(ClinicalStatus.values())
.map(status -> new OutpatientSkinTestInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setClinicalStatus(statusEnumOptions2);
@@ -150,18 +147,6 @@ public class OutpatientSkinTestRecordServiceImpl implements IOutpatientSkinTestR
offset);
}
/**
* 统计门诊皮试记录数的方法
*
* @param outpatientSkinTestRecordSearchParam 门诊皮试记录查询参数
* @return 分页查询
*/
@Override
public long
countOutpatientSkinTestRecords(OutpatientSkinTestRecordSearchParam outpatientSkinTestRecordSearchParam) {
return outpatientManageMapper.countOutpatientSkinTestRecords(outpatientSkinTestRecordSearchParam);
}
/**
* 护士确认执行皮试后,更新皮试记录信息(服务申请管理与过敏与不耐受的相关字段更新)
*

View File

@@ -1,5 +1,7 @@
package com.openhis.web.outpatientmanage.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -16,8 +18,6 @@ import com.openhis.workflow.service.IServiceRequestService;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import java.util.List;
/**
* 门诊输液记录
*
@@ -76,24 +76,24 @@ public class OutpatientInfusionRecordController {
return R.ok(outpatientInfusionRecordService.getPatientInfusionRecord(outpatientInfusionPatientDto));
}
/**
* 执行单个患者门诊输液
*
* @param outpatientInfusionRecordDto 患者输液信息
* @return 门诊输液记录列表
*/
@PutMapping("/infusion-perform")
public R<?>
editPatientInfusionRecord(@Validated @RequestBody OutpatientInfusionRecordDto outpatientInfusionRecordDto) {
// 获取执行次数
Long exeCount =
serviceRequestService.countServiceRequestByBasedOnId(outpatientInfusionRecordDto.getServiceId());
boolean res = outpatientInfusionRecordService.editPatientInfusionRecord(outpatientInfusionRecordDto, exeCount);
if (!res) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
}
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"}));
}
// /**
// * 执行单个患者门诊输液
// *
// * @param outpatientInfusionRecordDto 患者输液信息
// * @return 门诊输液记录列表
// */
// @PutMapping("/infusion-perform")
// public R<?>
// editPatientInfusionRecord(@Validated @RequestBody OutpatientInfusionRecordDto outpatientInfusionRecordDto) {
// // 获取执行次数
// Long exeCount =
// serviceRequestService.countServiceRequestByBasedOnId(outpatientInfusionRecordDto.getServiceId());
// boolean res = outpatientInfusionRecordService.editPatientInfusionRecord(outpatientInfusionRecordDto, exeCount);
// if (!res) {
// return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
// }
// return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"患者门诊输液执行"}));
// }
/**
* 批量执行患者门诊输液
@@ -133,12 +133,15 @@ public class OutpatientInfusionRecordController {
/**
* 显示门诊输液执行记录查询
*
* @param beginTime 开始时间
* @param endTime 结束时间
* @return 门诊输液记录列表
*/
@GetMapping(value = "/infusion-perform-Record")
public R<?> getPatientInfusionPerformRecord() {
public R<?> getPatientInfusionPerformRecord(@RequestParam(required = false) String beginTime,
@RequestParam(required = false) String endTime) {
return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord());
return R.ok(outpatientInfusionRecordService.getPatientInfusionPerformRecord(beginTime,endTime));
}
}

View File

@@ -17,8 +17,6 @@ import java.util.List;
@Accessors(chain = true)
public class OutpatientInfusionInitDto {
//发药状态
private List<statusEnumOption> medicationStatus;
//皮试结果
private List<statusEnumOption> clinicalStatus;
//当天位执行的输液记录

View File

@@ -60,6 +60,10 @@ public class OutpatientInfusionRecordDto {
@JsonSerialize(using = ToStringSerializer.class)
private Long executionCount;
/** 分组id */
@JsonSerialize(using = ToStringSerializer.class)
private Long groupId;
/** 执行护士 */
@Dict(dictCode = "id", dictTable = "adm_practitioner", dictText = "name")
@JsonSerialize(using = ToStringSerializer.class)

View File

@@ -14,10 +14,11 @@ import java.util.List;
@Data
@Accessors(chain = true)
public class OutpatientSkinTestInitDto {
//皮试检查项目状态
private List<OutpatientInfusionInitDto.statusEnumOption> VerificationStatus;
private List<OutpatientSkinTestInitDto.statusEnumOption> verificationStatus;
//皮试结果
private List<OutpatientInfusionInitDto.statusEnumOption> clinicalStatus;
private List<OutpatientSkinTestInitDto.statusEnumOption> clinicalStatus;
/**
* 状态

View File

@@ -0,0 +1,35 @@
package com.openhis.web.patientmanage.appservice;
import java.util.List;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
/**
* 门诊记录查询
*
* @author Wuser
* @date 2025/3/15
*/
public interface IOutpatientRecordService {
/**
* 获取门诊记录初期数据列表
*
* @return 门诊记录初期数据列表
*/
List<String> getOutpatientRecordInit();
/**
* 分页查询门诊记录
*
* @param outpatientRecordSearchParam 门诊录查询参数
* @param pageNo 页码默认为1
* @param pageSize 每页大小默认为10
* @return 分页查询
*/
Page<OutpatientRecordDto> getPatient(OutpatientRecordSearchParam outpatientRecordSearchParam, Integer pageNo,
Integer pageSize);
}

View File

@@ -0,0 +1,19 @@
package com.openhis.web.patientmanage.appservice;
import com.openhis.web.patientmanage.dto.PatientInfoInitDto;
/**
* 病人管理——病人信息
*
* @author Wuser
* @date 2025/3/15
*/
public interface IPatientInformationService {
/**
* 获取病人信息记录初期数据列表
*
* @return 病人信息记录初期数据列表
*/
PatientInfoInitDto getPatientInfoInit();
}

View File

@@ -0,0 +1,74 @@
package com.openhis.web.patientmanage.appservice.impl;
import java.util.List;
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.openhis.common.enums.AdministrativeGender;
import com.openhis.common.enums.EncounterSubjectStatus;
import com.openhis.common.utils.EnumUtils;
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 Wuser
* @date 2025/3/15
*/
@Service
public class OutpatientRecordServiceImpl implements IOutpatientRecordService {
@Autowired
PatientManageMapper patientManageMapper;
/**
* 获取门诊记录初期数据列表
*
* @return 门诊记录初期数据列表
*/
@Override
public List<String> getOutpatientRecordInit() {
// 获取医生名字列表
List<String> listDoctorNames = patientManageMapper.getDoctorNames();
return listDoctorNames;
}
/**
* 分页查询门诊记录
*
* @param outpatientRecordSearchParam 门诊录查询参数
* @param pageNo 页码默认为1
* @param pageSize 每页大小默认为10
* @return 分页查询
*/
public Page<OutpatientRecordDto> getPatient(OutpatientRecordSearchParam outpatientRecordSearchParam, Integer pageNo,
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);
outpatientRecordPage.getRecords().forEach(e -> {
// 性别枚举类回显赋值
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
// 就诊对象状态枚举类回显赋值
e.setSubjectStatusEnum_enumText(
EnumUtils.getInfoByValue(EncounterSubjectStatus.class, e.getSubjectStatusEnum()));
});
return outpatientRecordPage;
}
}

View File

@@ -0,0 +1,68 @@
package com.openhis.web.patientmanage.appservice.impl;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import com.openhis.common.enums.*;
import com.openhis.web.patientmanage.appservice.IPatientInformationService;
import com.openhis.web.patientmanage.dto.PatientInfoInitDto;
import org.springframework.stereotype.Service;
/**
* 门诊患者
*
* @author liuhr
* @date 2025/3/15
*/
@Service
public class PatientInformationServiceImpl implements IPatientInformationService {
/**
* 获取病人信息记录初期数据列表
*
* @return 病人信息记录初期数据列表
*/
@Override
public PatientInfoInitDto getPatientInfoInit() {
PatientInfoInitDto initDto = new PatientInfoInitDto();
// 获取婚姻状态列表
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions1 = Stream.of(MaritalStatus.values())
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setMaritalStatus(statusEnumOptions1);
// 获取职业编码列表
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions2 = Stream.of(OccupationType.values())
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setOccupationType(statusEnumOptions2);
// 获取性别列表
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions3 = Stream.of(AdministrativeGender.values())
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setAdministrativeGender(statusEnumOptions3);
// 获取ABO血型列表
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions4 = Stream.of(BloodTypeABO.values())
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setBloodTypeABO(statusEnumOptions4);
// 获取RH血型列表
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions5 = Stream.of(BloodTypeRH.values())
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setBloodTypeRH(statusEnumOptions5);
// 获取家庭关系列表
List<PatientInfoInitDto.statusEnumOption> statusEnumOptions6 = Stream.of(FamilyRelationshipType.values())
.map(status -> new PatientInfoInitDto.statusEnumOption(status.getValue(), status.getInfo()))
.collect(Collectors.toList());
initDto.setFamilyRelationshipType(statusEnumOptions6);
return initDto;
}
}

View File

@@ -1,22 +1,16 @@
package com.openhis.web.patientmanage.controller;
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.common.enums.EncounterSubjectStatus;
import com.openhis.common.utils.EnumUtils;
import com.openhis.web.patientmanage.dto.OutpatientRecordDto;
import com.openhis.web.patientmanage.appservice.IOutpatientRecordService;
import com.openhis.web.patientmanage.dto.OutpatientRecordSearchParam;
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
@@ -28,20 +22,21 @@ import lombok.extern.slf4j.Slf4j;
@RestController
@RequestMapping("/patientmanage/records")
@Slf4j
@AllArgsConstructor
public class OutpatientRecordController {
@Autowired(required = false)
PatientManageMapper patientManageMapper;
@Autowired
IOutpatientRecordService outpatientRecordService;
/**
* 获取医生名字列表
* 门诊输液记录初期数据
*
* @return
*/
@GetMapping("/list-doctornames")
@GetMapping("/init")
public R<?> getDoctorNames() {
// 获取医生名字列表
List<String> listDoctorNames = patientManageMapper.getDoctorNames();
return R.ok(listDoctorNames);
return R.ok(outpatientRecordService.getOutpatientRecordInit());
}
/**
@@ -56,25 +51,7 @@ public class OutpatientRecordController {
@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);
outpatientRecordPage.getRecords().forEach(e -> {
// 性别枚举类回显赋值
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
// 就诊对象状态枚举类回显赋值
e.setSubjectStatusEnum_enumText(
EnumUtils.getInfoByValue(EncounterSubjectStatus.class, e.getSubjectStatusEnum()));
});
return R.ok(outpatientRecordPage);
return R.ok(outpatientRecordService.getPatient(outpatientRecordSearchParam, pageNo, pageSize));
}
}

View File

@@ -4,6 +4,8 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.openhis.web.patientmanage.appservice.IPatientInformationService;
import lombok.AllArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
@@ -19,7 +21,7 @@ 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.dto.PatientInfoInitDto;
import com.openhis.web.patientmanage.mapper.PatientManageMapper;
import lombok.extern.slf4j.Slf4j;
@@ -33,6 +35,7 @@ import lombok.extern.slf4j.Slf4j;
@RestController
@RequestMapping("/patientmanage/information")
@Slf4j
@AllArgsConstructor
public class PatientInformationController {
@Autowired
@@ -43,119 +46,25 @@ public class PatientInformationController {
@Autowired(required = false)
PatientManageMapper patientManageMapper;
//
// @Autowired(required = false)
// StringUtils stringUtils;
@Autowired(required = false)
StringUtils stringUtils;
@Autowired
IPatientInformationService patientInformationService;
// todo 暂且机构ID写死后续从登录里取得
private final Long organizationId = 91L;
/**
* 获取婚姻状态列表
* 病人信息记录初期数据列表
*
* @return
*/
@GetMapping("/list-maritalstatus")
public R<?> getMaritalStatus() {
// 获取婚姻状态
List<MaritalStatus> statusList = Arrays.asList(MaritalStatus.values());
List<PatientListDto> dtos = new ArrayList<>();
// 取得更新值
for (MaritalStatus status : statusList) {
PatientListDto dto = new PatientListDto();
dto.setValue(status.getValue());
dto.setInfo(status.getInfo());
dtos.add(dto);
}
return R.ok(dtos);
}
@GetMapping("/init")
public R<?> getPatientInfoInit() {
/**
* 获取职业编码列表
*/
@GetMapping("/list-occupationtype")
public R<?> getOccupationType() {
// 获取职业编码
List<OccupationType> statusList = Arrays.asList(OccupationType.values());
List<PatientListDto> dtos = new ArrayList<>();
// 取得更新值
for (OccupationType status : statusList) {
PatientListDto dto = new PatientListDto();
dto.setValue(status.getValue());
dto.setInfo(status.getInfo());
dtos.add(dto);
}
return R.ok(dtos);
}
/**
* 获取性别列表
*/
@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);
}
/**
* 获取ABO血型列表
*/
@GetMapping("/list-bloodtypeabo")
public R<?> getBloodTypeABO() {
// 获取ABO血型
List<BloodTypeABO> statusList = Arrays.asList(BloodTypeABO.values());
List<PatientListDto> dtos = new ArrayList<>();
// 取得更新值
for (BloodTypeABO status : statusList) {
PatientListDto dto = new PatientListDto();
dto.setValue(status.getValue());
dto.setInfo(status.getInfo());
dtos.add(dto);
}
return R.ok(dtos);
}
/**
* 获取RH血型列表
*/
@GetMapping("/list-bloodtypearh")
public R<?> getBloodTypeRH() {
// 获取RH血型
List<BloodTypeRH> statusList = Arrays.asList(BloodTypeRH.values());
List<PatientListDto> dtos = new ArrayList<>();
// 取得更新值
for (BloodTypeRH status : statusList) {
PatientListDto dto = new PatientListDto();
dto.setValue(status.getValue());
dto.setInfo(status.getInfo());
dtos.add(dto);
}
return R.ok(dtos);
}
/**
* 获取家庭关系列表
*/
@GetMapping("/list-familyrelationshiptype")
public R<?> getFamilyRelationshipType() {
// 获取RH血型
List<FamilyRelationshipType> statusList = Arrays.asList(FamilyRelationshipType.values());
List<PatientListDto> dtos = new ArrayList<>();
// 取得更新值
for (FamilyRelationshipType status : statusList) {
PatientListDto dto = new PatientListDto();
dto.setValue(status.getValue());
dto.setInfo(status.getInfo());
dtos.add(dto);
}
return R.ok(dtos);
return R.ok(patientInformationService.getPatientInfoInit());
}
/**
@@ -163,38 +72,38 @@ public class PatientInformationController {
*
* @param patientInformationDto 病人信息
*/
@PostMapping("/patient-information")
public R<?> addPatient(@Validated @RequestBody PatientInformationDto patientInformationDto) {
Patient patient = new Patient();
BeanUtils.copyProperties(patientInformationDto, patient);
// 使用基础采番设置病人ID
String code = assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix());
patient.setBusNo(code);
// 设置机构ID
patient.setOrganizationId(organizationId);
// 设置生日
patient.setBirthDate(patientService.extractBirthday(patient.getIdCard()));
// 设置拼音首拼
patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
// 设置五笔首拼
patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
// 设置死亡时间
if (patientService.isFuture(patientInformationDto.getDeceasedDate())) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"死亡时间未来时"}));
}
patient.setDeceasedDate(DateUtils.parseDate(patientInformationDto.getDeceasedDate()));
// 调用服务层保存病人信息
boolean savePatientSuccess = patientService.save(patient);
if (!savePatientSuccess) {
return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, null));
}
return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}));
}
// @PostMapping("/patient-information")
// public R<?> addPatient(@Validated @RequestBody PatientInformationDto patientInformationDto) {
//
// Patient patient = new Patient();
// BeanUtils.copyProperties(patientInformationDto, patient);
//
// // 使用基础采番设置病人ID
// String code = assignSeqUtil.getSeq(AssignSeqEnum.PATIENT_NUM.getPrefix());
// patient.setBusNo(code);
//
// // 设置机构ID
// patient.setOrganizationId(organizationId);
// // 设置生日
// patient.setBirthDate(patientService.extractBirthday(patient.getIdCard()));
// // 设置拼音首拼
// patient.setPyStr(ChineseConvertUtils.toPinyinFirstLetter(patient.getName()));
// // 设置五笔首拼
// patient.setWbStr(ChineseConvertUtils.toWBFirstLetter(patient.getName()));
// // 设置死亡时间
// if (patientService.isFuture(patientInformationDto.getDeceasedDate())) {
// return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, new Object[] {"死亡时间未来时"}));
// }
// patient.setDeceasedDate(DateUtils.parseDate(patientInformationDto.getDeceasedDate()));
// // 调用服务层保存病人信息
// boolean savePatientSuccess = patientService.save(patient);
//
// if (!savePatientSuccess) {
// return R.fail(MessageUtils.createMessage(PromptMsgConstant.Common.M00003, null));
// }
//
// return R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00001, new Object[] {"病人信息"}));
// }
/**
* 修改病人信息

View File

@@ -0,0 +1,46 @@
package com.openhis.web.patientmanage.dto;
import com.openhis.web.outpatientmanage.dto.OutpatientInfusionInitDto;
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> administrativeGender;
//获取ABO血型列表
private List<PatientInfoInitDto.statusEnumOption> bloodTypeABO;
//获取RH血型列表
private List<PatientInfoInitDto.statusEnumOption> bloodTypeRH;
//获取家庭关系列表
private List<PatientInfoInitDto.statusEnumOption> familyRelationshipType;
/**
* 状态
*/
@Data
public static class statusEnumOption {
private Integer value;
private String info;
public statusEnumOption(Integer value, String info) {
this.value = value;
this.info = info;
}
}
}

View File

@@ -1,16 +0,0 @@
package com.openhis.web.patientmanage.dto;
import lombok.Data;
/**
* 状态列表
*
* @author liuhr
* @date 2025/2/25
*/
@Data
public class PatientListDto {
private Integer value;
private String info;
}

View File

@@ -148,6 +148,7 @@
SELECT DISTINCT
sr.id AS service_id, --服务申请管理ID
sr.prescription_no, --处方号
sr.tenant_id,
e.bus_no as encounter_busNo, --就诊号
pt.birth_date , --病人生日
pt.bus_no AS patient_busNo, --病人ID前台显示用
@@ -184,13 +185,14 @@
T1.activity_id,
T1.prescription_no,
T1.encounter_id,
T1.encounter_busNo,
T1.encounter_bus_No,
T1.patient_name,
T1.patient_busNo,
T1.patient_bus_No,
T1.patient_id,
T1.medication_information,
T1.medication_antity,
T1.medication_statusEnum,
T1.medication_status_Enum,
T1.group_id,
T1.clinical_status_enum,
T1.flag_text,
T1.speed,
@@ -207,18 +209,20 @@
SELECT
sr.id AS service_id, --服务申请管理ID
sr.bus_no, -- 服务请求编码
(SELECT COUNT(*) FROM wor_service_request WHERE based_on_id = SPLIT_PART(sr.bus_no, '.', 1)) AS execution_count, -- 执行次数
sr.based_on_id, --请求基于什么的ID
(SELECT COUNT(*) FROM wor_service_request wsr WHERE wsr.based_on_id = sr.based_on_id) AS execution_count,
sr.based_on_id, -- 请求基于什么的ID
sr.activity_id,--请求code,输液
sr.prescription_no, --处方号
sr.encounter_id , --就诊ID
sr.tenant_id,
e.bus_no AS encounter_busNo, --就诊ID前台显示用
pt.name AS patient_name, --病人姓名
pt.bus_no AS patient_busNo, --病人ID前台显示用
sr.patient_id, --病人ID
ad.name AS medication_information, --药品信息
mr.antity AS medication_antity,--药品数量
mr.status_enum AS medication_statusEnum, --药品状态
mr.status_enum AS medication_status_Enum, --药品状态
mr.group_id, --注射药品组号
ai.clinical_status_enum, --皮试检查结果
CASE mr.skin_test_flag--皮试标志
WHEN 1 THEN '是'
@@ -249,7 +253,7 @@
</where>
ORDER BY
mr.create_time,e.bus_no,pt.bus_no
mr.create_time desc,e.bus_no,pt.bus_no
) AS T1
${ew.customSqlSegment}
</select>