医生站-部分

This commit is contained in:
Wang.Huan
2025-03-10 13:52:31 +08:00
parent e2d17ce60c
commit f78d8902da
13 changed files with 430 additions and 16 deletions

View File

@@ -0,0 +1,23 @@
package com.openhis.web.doctorstation.appservice;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.openhis.web.doctorstation.dto.PatientInfoDto;
/**
* 医生站-电子病历 应用Service
*/
public interface IDoctorStationEmrAppService {
/**
* 查询就诊患者信息
*
* @param patientInfoDto 查询条件 (前端传 statusEnum 区分就诊状态tab)
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 就诊患者信息
*/
IPage<PatientInfoDto> getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo,
Integer pageSize);
}

View File

@@ -0,0 +1,61 @@
package com.openhis.web.doctorstation.appservice.impl;
import java.util.Arrays;
import java.util.HashSet;
import javax.annotation.Resource;
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.utils.AgeCalculatorUtil;
import com.openhis.common.enums.AdministrativeGender;
import com.openhis.common.enums.ClinicalStatus;
import com.openhis.common.enums.EncounterStatus;
import com.openhis.common.enums.ParticipantType;
import com.openhis.common.utils.EnumUtils;
import com.openhis.common.utils.HisQueryUtils;
import com.openhis.web.doctorstation.appservice.IDoctorStationEmrAppService;
import com.openhis.web.doctorstation.dto.PatientInfoDto;
import com.openhis.web.doctorstation.mapper.DoctorStationEmrAppMapper;
/**
* 医生站-电子病历 应用实现类
*/
@Service
public class DoctorStationEmrAppServiceImpl implements IDoctorStationEmrAppService {
@Resource
DoctorStationEmrAppMapper doctorStationEmrAppMapper;
/**
* 查询就诊患者信息
*
* @param patientInfoDto 查询条件 (前端传 statusEnum 区分就诊状态tab)
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 就诊患者信息
*/
@Override
public IPage<PatientInfoDto> getPatientInfo(PatientInfoDto patientInfoDto, String searchKey, Integer pageNo,
Integer pageSize) {
// 构建查询条件
QueryWrapper<PatientInfoDto> queryWrapper = HisQueryUtils.buildQueryWrapper(patientInfoDto, searchKey,
new HashSet<>(Arrays.asList("patient_name", "id_card", "phone")), null);
IPage<PatientInfoDto> patientInfo = doctorStationEmrAppMapper.getPatientInfo(new Page<>(pageNo, pageSize),
ParticipantType.ADMITTER.getCode(), ClinicalStatus.INACTIVE.getValue(), null, null, queryWrapper);
patientInfo.getRecords().forEach(e -> {
// 性别
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));
// 计算年龄
e.setAge(AgeCalculatorUtil.getAge(e.getBirthDate()));
// 就诊状态
e.setStatusEnum_enumText(EnumUtils.getInfoByValue(EncounterStatus.class, e.getStatusEnum()));
});
return patientInfo;
}
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.doctorstation.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 医生站-医嘱 controller
*/
@RestController
@RequestMapping("/doctor-station/advice")
@Slf4j
@AllArgsConstructor
public class DoctorStationAdviceController {
}

View File

@@ -0,0 +1,21 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.doctorstation.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 医生站-诊断 controller
*/
@RestController
@RequestMapping("/doctor-station/diagnosis")
@Slf4j
@AllArgsConstructor
public class DoctorStationDiagnosisController {
}

View File

@@ -0,0 +1,58 @@
/*
* Copyright ©2023 CJB-CNIT Team. All rights reserved
*/
package com.openhis.web.doctorstation.controller;
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.doctorstation.appservice.IDoctorStationEmrAppService;
import com.openhis.web.doctorstation.dto.DoctorStationInitDto;
import com.openhis.web.doctorstation.dto.PatientInfoDto;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
/**
* 医生站-电子病历 controller
*/
@RestController
@RequestMapping("/doctor-station/emr")
@Slf4j
@AllArgsConstructor
public class DoctorStationEmrController {
private final IDoctorStationEmrAppService iDoctorStationEmrAppService;
/**
* 医生站基础数据初始化
*
* @return 基础数据
*/
@GetMapping(value = "/init")
public R<?> init() {
// DoctorStationInitDto doctorStationInitDto = new DoctorStationInitDto();
return R.ok(new DoctorStationInitDto());
}
/**
* 查询就诊患者信息
*
* @param patientInfoDto 查询条件 (前端传 statusEnum 区分就诊状态tab)
* @param searchKey 模糊查询关键字
* @param pageNo 当前页
* @param pageSize 每页多少条
* @return 就诊患者信息
*/
@GetMapping(value = "/patient-info")
public R<?> getPatientInfo(PatientInfoDto patientInfoDto,
@RequestParam(value = "searchKey", defaultValue = "") String searchKey,
@RequestParam(value = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize", defaultValue = "10") Integer pageSize) {
return R.ok(iDoctorStationEmrAppService.getPatientInfo(patientInfoDto, searchKey, pageNo, pageSize));
}
}

View File

@@ -0,0 +1,50 @@
package com.openhis.web.doctorstation.dto;
import java.util.ArrayList;
import java.util.List;
import com.openhis.common.enums.EncounterStatus;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 医生站 init基础数据
*/
@Data
@Accessors(chain = true)
public class DoctorStationInitDto {
private List<patientEncounterStatusOption> patientEncounterStatusOptions;
/**
* 患者就诊状态
*/
@Data
public static class patientEncounterStatusOption {
private Integer value;
private String label;
public patientEncounterStatusOption(Integer value, String label) {
this.value = value;
this.label = label;
}
}
/**
* 设置默认值
*/
public DoctorStationInitDto() {
List<patientEncounterStatusOption> options = new ArrayList<>();
options.add(
new patientEncounterStatusOption(EncounterStatus.PLANNED.getValue(), EncounterStatus.PLANNED.getInfo()));
options.add(new patientEncounterStatusOption(EncounterStatus.IN_PROGRESS.getValue(),
EncounterStatus.IN_PROGRESS.getInfo()));
options.add(
new patientEncounterStatusOption(EncounterStatus.ON_HOLD.getValue(), EncounterStatus.ON_HOLD.getInfo()));
options.add(new patientEncounterStatusOption(EncounterStatus.DISCHARGED.getValue(),
EncounterStatus.DISCHARGED.getInfo()));
this.patientEncounterStatusOptions = options;
}
}

View File

@@ -0,0 +1,73 @@
package com.openhis.web.doctorstation.dto;
import java.util.Date;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
/**
* 就诊患者信息 dto
*/
@Data
@Accessors(chain = true)
public class PatientInfoDto {
/**
* 就诊ID
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long encounterId;
/**
* 患者id
*/
@JsonSerialize(using = ToStringSerializer.class)
private Long patientId;
/**
* 患者姓名
*/
private String patientName;
/**
* 患者性别
*/
private Integer genderEnum;
private String genderEnum_enumText;
/**
* 证件号
*/
private String idCard;
/**
* 电话
*/
private String phone;
/**
* 生日
*/
private Date birthDate;
/**
* 年龄
*/
private String age;
/**
* 就诊状态
*/
private Integer statusEnum;
private String statusEnum_enumText;
/**
* 过敏史标记
*/
private Integer allergyHistoryFlag;
}

View File

@@ -0,0 +1,34 @@
package com.openhis.web.doctorstation.mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.web.doctorstation.dto.PatientInfoDto;
/**
* 医生站-电子病历 应用Mapper
*/
@Repository
public interface DoctorStationEmrAppMapper {
/**
* 查询就诊患者信息
*
* @param page 分页参数
* @param participantType 参与者类型
* @param ClinicalStatus 过敏史状态
* @param userId 当前登录账号ID
* @param currentUserOrganizationId 当前登录账号所属的科室ID
* @param queryWrapper 查询条件
* @return 就诊患者信息
*/
IPage<PatientInfoDto> getPatientInfo(@Param("page") Page<PatientInfoDto> page,
@Param("participantType") String participantType, @Param("ClinicalStatus") Integer ClinicalStatus,
@Param("userId") Long userId, @Param("currentUserOrganizationId") Long currentUserOrganizationId,
@Param(Constants.WRAPPER) QueryWrapper<PatientInfoDto> queryWrapper);
}

View File

@@ -41,7 +41,7 @@ import com.openhis.web.outpatientservice.mapper.OutpatientRegistrationAppMapper;
* 门诊挂号 应用实现类
*/
@Service
public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistrationAppService {
public class OutpatientRegistrationAppServiceImpl implements IOutpatientRegistrationAppService {
@Resource
PatientMapper patientMapper;
@@ -283,8 +283,8 @@ public class IOutpatientRegistrationAppServiceImpl implements IOutpatientRegistr
new HashSet<>(Arrays.asList("patient_name", "organization_name", "practitioner_name", "healthcare_name")),
null);
IPage<CurrentDayEncounterDto> currentDayEncounter =
outpatientRegistrationAppMapper.getCurrentDayEncounter(new Page<>(pageNo, pageSize), queryWrapper);
IPage<CurrentDayEncounterDto> currentDayEncounter = outpatientRegistrationAppMapper
.getCurrentDayEncounter(new Page<>(pageNo, pageSize), ParticipantType.ADMITTER.getCode(), queryWrapper);
currentDayEncounter.getRecords().forEach(e -> {
// 性别
e.setGenderEnum_enumText(EnumUtils.getInfoByValue(AdministrativeGender.class, e.getGenderEnum()));

View File

@@ -32,10 +32,12 @@ public interface OutpatientRegistrationAppMapper {
* 查询当日就诊数据
*
* @param page 分页参数
* @param participantType 参与者类型
* @param queryWrapper 查询条件
* @return 当日就诊数据
*/
IPage<CurrentDayEncounterDto> getCurrentDayEncounter(@Param("page") Page<CurrentDayEncounterDto> page,
@Param("participantType") String participantType,
@Param(Constants.WRAPPER) QueryWrapper<CurrentDayEncounterDto> queryWrapper);
}